Commit 6d3d7186 authored by Manish Singh's avatar Manish Singh

More and more and more... I don't know where we're going to....

-Yosh
parent a68650f9
...@@ -337,8 +337,6 @@ plug-ins/xd/Makefile ...@@ -337,8 +337,6 @@ plug-ins/xd/Makefile
plug-ins/bmp/Makefile plug-ins/bmp/Makefile
plug-ins/megawidget/Makefile plug-ins/megawidget/Makefile
plug-ins/blur/Makefile plug-ins/blur/Makefile
plug-ins/gfig/Makefile
plug-ins/gfig/gfig-examples/Makefile
plug-ins/flame/Makefile plug-ins/flame/Makefile
plug-ins/gimptcl/Makefile plug-ins/gimptcl/Makefile
plug-ins/gimptcl/scripts/Makefile plug-ins/gimptcl/scripts/Makefile
...@@ -397,7 +395,6 @@ plug-ins/colorify/Makefile ...@@ -397,7 +395,6 @@ plug-ins/colorify/Makefile
plug-ins/papertile/Makefile plug-ins/papertile/Makefile
plug-ins/illusion/Makefile plug-ins/illusion/Makefile
plug-ins/fractaltrace/Makefile plug-ins/fractaltrace/Makefile
plug-ins/FractalExplorer/Makefile
plug-ins/fs/Makefile plug-ins/fs/Makefile
plug-ins/flarefx/Makefile plug-ins/flarefx/Makefile
app/Makefile app/Makefile
......
Makefile.in
Makefile
.deps
_libs
.libs
FractalExplorer
/**********************************************************************
FUNCTION: dialog_close_callback
*********************************************************************/
void
dialog_close_callback(GtkWidget * widget, gpointer data)
{
gtk_main_quit();
} /* dialog_close_callback */
/**********************************************************************
FUNCTION: dialog_save_callback
*********************************************************************/
void
dialog_save_callback(GtkWidget * widget, gpointer data)
{
create_file_selection();
} /* dialog_save_callback */
/**********************************************************************
FUNCTION: dialog_savelanguage_callback
*********************************************************************/
void
dialog_savelanguage_callback(GtkWidget * widget, gpointer data)
{
FILE * fp;
char * filname=NULL;
filname =g_malloc(100);
sprintf (filname, "%s%s", getenv("HOME"), "/.fractalexplorerrc");
lng=wvals.language;
fp = fopen (filname, "w");
if (fp) {
if (lng==0) fputs("FX-LANG:En\n",fp);
if (lng==1) fputs("FX-LANG:Fr\n",fp);
if (lng==2) fputs("FX-LANG:De\n",fp);
fclose(fp);
}
} /* dialog_savelanguage_callback */
/**********************************************************************
FUNCTION: load_button_press
*********************************************************************/
void
load_button_press(GtkWidget * widget,
gpointer data)
{
create_load_file_selection();
}
/**********************************************************************
FUNCTION: dialog_ok_callback
*********************************************************************/
void
dialog_ok_callback(GtkWidget * widget, gpointer data)
{
wint.run = TRUE;
gtk_widget_destroy(GTK_WIDGET(data));
} /* dialog_ok_callback */
/**********************************************************************
FUNCTION: dialog_reset_callback
*********************************************************************/
void
dialog_reset_callback(GtkWidget * widget, gpointer data)
{
wvals.xmin = standardvals.xmin;
wvals.xmax = standardvals.xmax;
wvals.ymin = standardvals.ymin;
wvals.ymax = standardvals.ymax;
wvals.iter = standardvals.iter;
wvals.cx = standardvals.cx;
wvals.cy = standardvals.cy;
dialog_change_scale();
set_cmap_preview();
dialog_update_preview();
}
/**********************************************************************
FUNCTION: dialog_redraw_callback
*********************************************************************/
void
dialog_redraw_callback(GtkWidget * widget, gpointer data)
{
int alwaysprev = wvals.alwayspreview;
wvals.alwayspreview = TRUE;
set_cmap_preview();
dialog_update_preview();
wvals.alwayspreview = alwaysprev;
}
/**********************************************************************
FUNCTION: dialog_cancel_callback
*********************************************************************/
void
dialog_cancel_callback(GtkWidget * widget, gpointer data)
{
gtk_widget_destroy(GTK_WIDGET(data));
} /* dialog_cancel_callback */
/**********************************************************************
FUNCTION: dialog_undo_zoom_callback
*********************************************************************/
void
dialog_undo_zoom_callback(GtkWidget * widget, gpointer data)
{
if (zoomindex > 1) {
zooms[zoomindex] = wvals;
zoomindex--;
wvals = zooms[zoomindex];
dialog_change_scale();
set_cmap_preview();
dialog_update_preview();
}
} /* dialog_undo_zoom_callback */
/**********************************************************************
FUNCTION: dialog_redo_zoom_callback
*********************************************************************/
void
dialog_redo_zoom_callback(GtkWidget * widget, gpointer data)
{
if (zoomindex < zoommax) {
zoomindex++;
wvals = zooms[zoomindex];
dialog_change_scale();
set_cmap_preview();
dialog_update_preview();
}
} /* dialog_redo_zoom_callback */
/**********************************************************************
FUNCTION: dialog_step_in_callback
*********************************************************************/
void
dialog_step_in_callback(GtkWidget * widget, gpointer data)
{
double xdifferenz;
double ydifferenz;
if (zoomindex < zoommax) {
zooms[zoomindex]=wvals;
zoomindex++;
}
xdifferenz=wvals.xmax-wvals.xmin;
ydifferenz=wvals.ymax-wvals.ymin;
wvals.xmin+=1.0/6.0*xdifferenz;
wvals.ymin+=1.0/6.0*ydifferenz;
wvals.xmax-=1.0/6.0*xdifferenz;
wvals.ymax-=1.0/6.0*ydifferenz;
zooms[zoomindex]=wvals;
dialog_change_scale();
set_cmap_preview();
dialog_update_preview();
} /* dialog_step_in_callback */
/**********************************************************************
FUNCTION: dialog_step_out_callback
*********************************************************************/
void
dialog_step_out_callback(GtkWidget * widget, gpointer data)
{
double xdifferenz;
double ydifferenz;
if (zoomindex < zoommax) {
zooms[zoomindex]=wvals;
zoomindex++;
}
xdifferenz=wvals.xmax-wvals.xmin;
ydifferenz=wvals.ymax-wvals.ymin;
wvals.xmin-=1.0/4.0*xdifferenz;
wvals.ymin-=1.0/4.0*ydifferenz;
wvals.xmax+=1.0/4.0*xdifferenz;
wvals.ymax+=1.0/4.0*ydifferenz;
zooms[zoomindex]=wvals;
dialog_change_scale();
set_cmap_preview();
dialog_update_preview();
} /* dialog_step_out_callback */
/**********************************************************************
FUNCTION: explorer_logo_ok_callback
*********************************************************************/
void
explorer_logo_ok_callback(GtkWidget * widget, gpointer data)
{
gtk_widget_set_sensitive(maindlg, TRUE);
gtk_widget_destroy(logodlg);
}
/**********************************************************************
FUNCTION: explorer_about_callback
*********************************************************************/
void
explorer_about_callback(GtkWidget * widget, gpointer data)
{
gtk_widget_set_sensitive(maindlg, FALSE);
explorer_logo_dialog();
}
/**********************************************************************
FUNCTION: explorer_toggle_update
*********************************************************************/
void
explorer_toggle_update(GtkWidget * widget,
gpointer data)
{
int *toggle_val;
toggle_val = (int *) data;
if (GTK_TOGGLE_BUTTON(widget)->active)
*toggle_val = TRUE;
else
*toggle_val = FALSE;
if (do_redsinus)
wvals.redmode = SINUS;
else if (do_redcosinus)
wvals.redmode = COSINUS;
else if (do_rednone)
wvals.redmode = NONE;
if (do_greensinus)
wvals.greenmode = SINUS;
else if (do_greencosinus)
wvals.greenmode = COSINUS;
else if (do_greennone)
wvals.greenmode = NONE;
if (do_bluesinus)
wvals.bluemode = SINUS;
else if (do_bluecosinus)
wvals.bluemode = COSINUS;
else if (do_bluenone)
wvals.bluemode = NONE;
if (do_colormode1)
wvals.colormode = 0;
else if (do_colormode2)
wvals.colormode = 1;
if (do_english)
wvals.language = 0;
else if (do_french)
wvals.language = 1;
else if (do_german)
wvals.language = 2;
if (do_type0)
wvals.fractaltype = 0;
else if (do_type1)
wvals.fractaltype = 1;
else if (do_type2)
wvals.fractaltype = 2;
else if (do_type3)
wvals.fractaltype = 3;
else if (do_type4)
wvals.fractaltype = 4;
else if (do_type5)
wvals.fractaltype = 5;
else if (do_type6)
wvals.fractaltype = 6;
else if (do_type7)
wvals.fractaltype = 7;
else if (do_type8)
wvals.fractaltype = 8;
set_cmap_preview();
dialog_update_preview();
}
/**********************************************************************
FUNCTION: dialog_scale_update
*********************************************************************/
void
dialog_scale_update(GtkAdjustment * adjustment, gdouble * value)
{
GtkWidget *entry;
char buf[256];
if (*value != adjustment->value) {
*value = adjustment->value;
entry = gtk_object_get_user_data(GTK_OBJECT(adjustment));
sprintf(buf, "%0.15f", *value);
gtk_signal_handler_block_by_data(GTK_OBJECT(entry), value);
gtk_entry_set_text(GTK_ENTRY(entry), buf);
gtk_signal_handler_unblock_by_data(GTK_OBJECT(entry), value);
dialog_update_preview();
}
} /* dialog_scale_update */
/**********************************************************************
FUNCTION: dialog_scale_int_update
*********************************************************************/
void
dialog_scale_int_update(GtkAdjustment * adjustment, gdouble * value)
{
GtkWidget *entry;
char buf[256];
if (*value != adjustment->value) {
*value = adjustment->value;
entry = gtk_object_get_user_data(GTK_OBJECT(adjustment));
sprintf(buf, "%i", (int) *value);
gtk_signal_handler_block_by_data(GTK_OBJECT(entry), value);
gtk_entry_set_text(GTK_ENTRY(entry), buf);
gtk_signal_handler_unblock_by_data(GTK_OBJECT(entry), value);
set_cmap_preview();
dialog_update_preview();
}
} /* dialog_scale_int_update */
/**********************************************************************
FUNCTION: dialog_entry_update
*********************************************************************/
void
dialog_entry_update(GtkWidget * widget, gdouble * value)
{
GtkAdjustment *adjustment;
gdouble new_value;
new_value = atof(gtk_entry_get_text(GTK_ENTRY(widget)));
if (*value != new_value) {
adjustment = gtk_object_get_user_data(GTK_OBJECT(widget));
if ((new_value >= adjustment->lower) &&
(new_value <= adjustment->upper)) {
*value = new_value;
adjustment->value = new_value;
gtk_signal_emit_by_name(GTK_OBJECT(adjustment), "value_changed");
dialog_update_preview();
}
}
} /* dialog_entry_update */
/**********************************************************************
FUNCTION: explorer_dialog
*********************************************************************/
gint
explorer_dialog(void)
{
GtkWidget *dialog,
*top_table,
*text,
*top_table2,
*frame,
*frame2,
*frame3,
*toggle,
*toggle_vbox,
*toggle_vbox2,
*toggle_vbox3,
*notebook,
*hbox,
*table,
*table6,
*button;
gint argc;
gchar **argv;
guchar *color_cube;
GSList *redmode_group = NULL,
*greenmode_group = NULL,
*bluemode_group = NULL,
*language_group = NULL,
*colormode_group = NULL,
*type_group = NULL;
do_redsinus = (wvals.redmode == SINUS);
do_redcosinus = (wvals.redmode == COSINUS);
do_rednone = (wvals.redmode == NONE);
do_greensinus = (wvals.greenmode == SINUS);
do_greencosinus = (wvals.greenmode == COSINUS);
do_greennone = (wvals.greenmode == NONE);
do_bluesinus = (wvals.bluemode == SINUS);
do_bluecosinus = (wvals.bluemode == COSINUS);
do_bluenone = (wvals.bluemode == NONE);
do_redinvert = (wvals.redinvert != FALSE);
do_greeninvert = (wvals.greeninvert != FALSE);
do_blueinvert = (wvals.blueinvert != FALSE);
do_colormode1 = (wvals.colormode == 0);
do_colormode2 = (wvals.colormode == 1);
do_type0 = (wvals.fractaltype == 0);
do_type1 = (wvals.fractaltype == 1);
do_type2 = (wvals.fractaltype == 2);
do_type3 = (wvals.fractaltype == 3);
do_type4 = (wvals.fractaltype == 4);
do_type5 = (wvals.fractaltype == 5);
do_type6 = (wvals.fractaltype == 6);
do_type7 = (wvals.fractaltype == 7);
do_type8 = (wvals.fractaltype == 8);
do_english = (wvals.language == 0);
do_french = (wvals.language == 1);
do_german = (wvals.language == 2);
argc = 1;
argv = g_new(gchar *, 1);
argv[0] = g_strdup("fractalexplorer");
gtk_init(&argc, &argv);
plug_in_parse_fractalexplorer_path();
gtk_preview_set_gamma(gimp_gamma());
gtk_preview_set_install_cmap(gimp_install_cmap());
color_cube = gimp_color_cube();
gtk_preview_set_color_cube(color_cube[0], color_cube[1], color_cube[2], color_cube[3]);
gtk_widget_set_default_visual(gtk_preview_get_visual());
gtk_widget_set_default_colormap(gtk_preview_get_cmap());
wint.wimage = g_malloc(preview_width * preview_height * 3 * sizeof(guchar));
elements = g_malloc(sizeof(DialogElements));
explorer_load_dialog();
dialog = maindlg = gtk_dialog_new();
gtk_window_set_title(GTK_WINDOW(dialog), "Fractal Explorer <Daniel Cotting/cotting@mygale.org>");
gtk_window_position(GTK_WINDOW(dialog), GTK_WIN_POS_NONE);
gtk_container_border_width(GTK_CONTAINER(dialog), 0);
gtk_signal_connect(GTK_OBJECT(dialog), "destroy",
(GtkSignalFunc) dialog_close_callback,
NULL);
top_table = gtk_table_new(4, 5, FALSE);
gtk_container_border_width(GTK_CONTAINER(top_table), 4);
gtk_table_set_row_spacings(GTK_TABLE(top_table), 10);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), top_table, FALSE, FALSE, 0);
gtk_widget_show(top_table);
/* Tool-Tips */
/* use black as foreground: */
tips = gtk_tooltips_new();
tips_fg.red = 0;
tips_fg.green = 0;
tips_fg.blue = 0;
/* postit yellow (khaki) as background: */
gdk_color_alloc(gtk_widget_get_colormap(top_table), &tips_fg);
tips_bg.red = 61669;
tips_bg.green = 59113;
tips_bg.blue = 35979;
gdk_color_alloc(gtk_widget_get_colormap(top_table), &tips_bg);
gtk_tooltips_set_colors(tips, &tips_bg, &tips_fg);
/* Preview */
frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_table_attach(GTK_TABLE(top_table), frame, 0, 1, 0, 1, 0, 0, 0, 0);
gtk_widget_show(frame);
wint.preview = gtk_preview_new(GTK_PREVIEW_COLOR);
gtk_preview_size(GTK_PREVIEW(wint.preview), preview_width, preview_height);
gtk_container_add(GTK_CONTAINER(frame), wint.preview);
gtk_signal_connect(GTK_OBJECT(wint.preview), "button_press_event",
(GtkSignalFunc) preview_button_press_event, NULL);
gtk_signal_connect(GTK_OBJECT(wint.preview), "button_release_event",
(GtkSignalFunc) preview_button_release_event, NULL);
gtk_signal_connect(GTK_OBJECT(wint.preview), "motion_notify_event",
(GtkSignalFunc) preview_motion_notify_event, NULL);
gtk_signal_connect(GTK_OBJECT(wint.preview), "leave_notify_event",
(GtkSignalFunc) preview_leave_notify_event, NULL);
gtk_signal_connect(GTK_OBJECT(wint.preview), "enter_notify_event",
(GtkSignalFunc) preview_enter_notify_event, NULL);
gtk_widget_set_events(wint.preview, GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK
| GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK);
gtk_widget_show(wint.preview);
/* Create notebook */
notebook = gtk_notebook_new ();
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP);
gtk_table_attach(GTK_TABLE(top_table), notebook, 4, 5, 0, 4, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 3, 3);
gtk_widget_show (notebook);
/* Controls */
frame2 = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame2), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame2), 10);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame2,
gtk_label_new (msg[lng][MSG_FRACTALOPTIONS]));
gtk_widget_show (frame2);
toggle_vbox2 = gtk_vbox_new(FALSE, 0);
gtk_container_border_width(GTK_CONTAINER(toggle_vbox2), 0);
gtk_container_add(GTK_CONTAINER(frame2), toggle_vbox2);
gtk_widget_show(toggle_vbox2);
top_table2 = gtk_table_new(5, 5, FALSE);
gtk_container_border_width(GTK_CONTAINER(top_table2), 10);
gtk_table_set_row_spacings(GTK_TABLE(top_table2), 0);
gtk_box_pack_start(GTK_BOX(toggle_vbox2), top_table2, FALSE, FALSE, 0);
gtk_widget_show(top_table2);
frame = gtk_frame_new(msg[lng][MSG_PARAMETERS]);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame), 0);
gtk_table_attach(GTK_TABLE(top_table2), frame, 0, 4, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 3, 3);
toggle_vbox = gtk_vbox_new(FALSE, 0);
gtk_container_border_width(GTK_CONTAINER(toggle_vbox), 0);
gtk_container_add(GTK_CONTAINER(frame), toggle_vbox);
table = gtk_table_new(9, 5, FALSE);
gtk_container_border_width(GTK_CONTAINER(table), 5);
gtk_table_set_row_spacings(GTK_TABLE(table), 0);
gtk_box_pack_start(GTK_BOX(toggle_vbox), table, FALSE, FALSE, 0);
gtk_widget_show(table);
dialog_create_value("XMIN", GTK_TABLE(table), 0, &wvals.xmin, -3, 3, msg[lng][MSG_XMIN], &(elements->xmin));
dialog_create_value("XMAX", GTK_TABLE(table), 1, &wvals.xmax, -3, 3, msg[lng][MSG_XMAX], &(elements->xmax));
dialog_create_value("YMIN", GTK_TABLE(table), 2, &wvals.ymin, -3, 3, msg[lng][MSG_YMIN], &(elements->ymin));
dialog_create_value("YMAX", GTK_TABLE(table), 3, &wvals.ymax, -3, 3, msg[lng][MSG_YMAX], &(elements->ymax));
dialog_create_value("ITER", GTK_TABLE(table), 4, &wvals.iter, 0, 1000, msg[lng][MSG_ITER], &(elements->iter));
dialog_create_value("CX", GTK_TABLE(table), 5, &wvals.cx, -2.5, 2.5, msg[lng][MSG_CX], &(elements->cx));
dialog_create_value("CY", GTK_TABLE(table), 6, &wvals.cy, -2.5, 2.5, msg[lng][MSG_CY], &(elements->cy));
button = gtk_button_new();
gtk_table_attach(GTK_TABLE(table), button, 1, 2, 7, 8, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 3, 3);
text = gtk_label_new(msg[lng][MSG_RESET]);
gtk_misc_set_alignment(GTK_MISC(text), 0.5, 0.5);
gtk_container_add(GTK_CONTAINER(button), text);
gtk_widget_show(text);
gtk_signal_connect(GTK_OBJECT(button), "clicked",
(GtkSignalFunc) dialog_reset_callback,