From: <enl...@li...> - 2002-06-09 12:33:51
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebony Dir : e17/apps/ebony/src Modified Files: callbacks.c callbacks.h ebony.h gtk_util.c interface.c interface.h main.c util.c util.h Log Message: Ebony can now do screensize previews instead of just filling the window. You can specify or use some provided defaults. You can specify the number of screens, vertical and horizontal. One of benr's requests filled =) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/callbacks.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- callbacks.c 2 Jun 2002 21:40:07 -0000 1.13 +++ callbacks.c 9 Jun 2002 12:33:48 -0000 1.14 @@ -21,6 +21,7 @@ if (bg) e_bg_free(bg); + if (!bg_ref) rebuild_bg_ref(); @@ -122,7 +123,9 @@ { evas_set_output_viewport(evas, 0, 0, event->width, event->height); evas_set_output_size(evas, event->width, event->height); - e_bg_resize(bg, event->width, event->height); + e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h, + export_info.screen.h * export_info.xinerama.v); + e_bg_resize(ebony_base_bg, event->width, event->height); if (bl) outline_evas_object(bl->obj); @@ -863,6 +866,11 @@ bg = NULL; bl = NULL; } + if (ebony_base_bg) + { + e_bg_free(ebony_base_bg); + ebony_base_bg = NULL; + } if (evas) { evas_free(evas); @@ -931,43 +939,57 @@ void on_scale_preview_toggled(GtkToggleButton * togglebutton, gpointer user_data) { + GtkWidget *w; -} - - -void -on_preview_screen_h_changed(GtkEditable * editable, gpointer user_data) -{ - -} - - -void -on_preview_screen_w_changed(GtkEditable * editable, gpointer user_data) -{ - -} - - -void -on_preview_xinerama_v_changed(GtkEditable * editable, gpointer user_data) -{ + w = gtk_object_get_data(GTK_OBJECT(win_ref), "screen_size_frame"); + if (!w) + fprintf(stderr, "Unable to find screen_size_frame widget\n"); + if (gtk_toggle_button_get_active(togglebutton)) + { + export_info.screen.w = 800; + export_info.screen.h = 600; + gtk_widget_set_sensitive(GTK_WIDGET(w), TRUE); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_xinerama_h"); + if (w) + { + export_info.xinerama.h = + gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w)); + } + else + { + fprintf(stderr, "Unable to find export_xinerama_h\n"); + } + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_xinerama_v"); + if (w) + { + export_info.xinerama.v = + gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w)); + } + else + { + fprintf(stderr, "Unable to find export_xinerama_v\n"); + } + } + else + { + export_info.screen.w = 0; + export_info.screen.h = 0; + export_info.xinerama.v = export_info.xinerama.h = 1; + gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE); + } + e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h, + export_info.screen.h * export_info.xinerama.v); + DRAW(); } void -on_preview_xinerama_h_changed(GtkEditable * editable, gpointer user_data) -{ - -} - -void unset_export_size_editable(void) { GtkWidget *w; - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_screen_w"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_w"); if (w) { gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE); @@ -976,7 +998,7 @@ { fprintf(stderr, "Unable to find export_screen_w\n"); } - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_screen_h"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_h"); if (w) { gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE); @@ -991,7 +1013,7 @@ { GtkWidget *w; - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_screen_w"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_w"); if (w) { gtk_widget_set_sensitive(GTK_WIDGET(w), TRUE); @@ -1000,7 +1022,7 @@ { fprintf(stderr, "Unable to find export_screen_w\n"); } - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_screen_h"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_h"); if (w) { gtk_widget_set_sensitive(GTK_WIDGET(w), TRUE); @@ -1011,22 +1033,6 @@ } } -void -on_export_bg_activate(GtkMenuItem * menuitem, gpointer user_data) -{ - if (!export_ref) - { - export_info.xinerama.v = export_info.xinerama.h = 1; - export_info.screen.w = 1024; - export_info.screen.h = 768; - - export_ref = create_export_win(); - unset_export_size_editable(); - gtk_widget_show(export_ref); - } - -} - void on_export_size_toggled(GtkToggleButton * togglebutton, gpointer user_data) @@ -1066,45 +1072,19 @@ default: break; } + e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h, + export_info.screen.h * export_info.xinerama.v); + DRAW(); } } - -void -on_export_next_button_clicked(GtkButton * button, gpointer user_data) -{ - GtkWidget *fs; - char buf[PATH_MAX]; - - snprintf(buf, PATH_MAX, "%s/", export_fileselection_dir); - fs = gtk_file_selection_new("Export Background As Image ..."); - gtk_file_selection_set_filename(GTK_FILE_SELECTION(fs), buf); - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->cancel_button), - "clicked", - GTK_SIGNAL_FUNC(on_export_cancel_button_clicked), - (gpointer) fs); - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), - "clicked", GTK_SIGNAL_FUNC(export_ok_clicked), - (gpointer) fs); - gtk_widget_show(fs); -} - - -void -on_export_cancel_button_clicked(GtkButton * button, gpointer user_data) -{ - gtk_widget_destroy(export_ref); - export_ref = NULL; -} - - void on_export_screen_h_changed(GtkEditable * editable, gpointer user_data) { GtkWidget *w; - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_screen_h"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_h"); if (w) { export_info.screen.h = @@ -1115,6 +1095,9 @@ { fprintf(stderr, "Unable to find export_screen_h\n"); } + e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h, + export_info.screen.h * export_info.xinerama.v); + DRAW(); } @@ -1123,7 +1106,7 @@ { GtkWidget *w; - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_screen_w"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_w"); if (w) { export_info.screen.w = @@ -1133,6 +1116,9 @@ { fprintf(stderr, "Unable to find export_screen_w\n"); } + e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h, + export_info.screen.h * export_info.xinerama.v); + DRAW(); } @@ -1141,7 +1127,7 @@ { GtkWidget *w; - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_xinerama_v"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_xinerama_v"); if (w) { export_info.xinerama.v = @@ -1152,6 +1138,9 @@ { fprintf(stderr, "Unable to find export_xinerama_v\n"); } + e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h, + export_info.screen.h * export_info.xinerama.v); + DRAW(); } @@ -1160,7 +1149,7 @@ { GtkWidget *w; - w = gtk_object_get_data(GTK_OBJECT(export_ref), "export_xinerama_h"); + w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_xinerama_h"); if (w) { export_info.xinerama.h = @@ -1170,4 +1159,33 @@ { fprintf(stderr, "Unable to find export_xinerama_h\n"); } + e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h, + export_info.screen.h * export_info.xinerama.v); + DRAW(); +} + +void +on_export_cancel_button_clicked(GtkButton * button, gpointer user_data) +{ + gtk_widget_destroy(user_data); +} + +void +on_export_button_clicked(GtkButton * button, gpointer user_data) +{ + GtkWidget *fs; + char buf[PATH_MAX]; + + snprintf(buf, PATH_MAX, "%s/", export_fileselection_dir); + fs = gtk_file_selection_new("Export Background As Image ..."); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(fs), buf); + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->cancel_button), + "clicked", + GTK_SIGNAL_FUNC(on_export_cancel_button_clicked), + (gpointer) fs); + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), + "clicked", GTK_SIGNAL_FUNC(export_ok_clicked), + (gpointer) fs); + gtk_widget_show(fs); + } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/callbacks.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- callbacks.h 2 Jun 2002 21:40:07 -0000 1.8 +++ callbacks.h 9 Jun 2002 12:33:48 -0000 1.9 @@ -148,21 +148,9 @@ void on_scale_preview_toggled(GtkToggleButton * togglebutton, gpointer user_data); -void on_preview_screen_h_changed(GtkEditable * editable, gpointer user_data); - -void on_preview_screen_w_changed(GtkEditable * editable, gpointer user_data); - -void on_preview_xinerama_v_changed(GtkEditable * editable, - gpointer user_data); - -void on_preview_xinerama_h_changed(GtkEditable * editable, - gpointer user_data); - void on_export_size_toggled(GtkToggleButton * togglebutton, gpointer user_data); -void on_export_next_button_clicked(GtkButton * button, gpointer user_data); - void on_export_cancel_button_clicked(GtkButton * button, gpointer user_data); void on_export_screen_h_changed(GtkEditable * editable, gpointer user_data); @@ -175,3 +163,5 @@ void on_export_size_toggled(GtkToggleButton * togglebutton, gpointer user_data); + +void on_export_button_clicked(GtkButton * button, gpointer user_data); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/ebony.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ebony.h 2 Jun 2002 21:40:07 -0000 1.4 +++ ebony.h 9 Jun 2002 12:33:48 -0000 1.5 @@ -10,12 +10,12 @@ GtkWidget *ebony_status; GtkWidget *win_ref, *bg_ref; -GtkWidget *export_ref; GList *recent_bgs; Evas evas; -E_Background bg; +E_Background bg; /* the bg we're manipulating */ +E_Background ebony_base_bg; /* the canvases background */ E_Background_Layer bl; int idle; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/gtk_util.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- gtk_util.c 2 Jun 2002 21:40:07 -0000 1.5 +++ gtk_util.c 9 Jun 2002 12:33:48 -0000 1.6 @@ -818,9 +818,6 @@ g_snprintf(errstr, 1024, "Unable to load %s", name); ebony_status_message(errstr, EBONY_STATUS_TO); } - - return; - UN(name); } gboolean @@ -980,29 +977,42 @@ regen_recent_menu(void) { GList *l; - GtkWidget *mi, *w; + GtkWidget *w; GtkWidget *menu; + GtkWidget *mi = NULL; char *short_name, *filename; w = gtk_object_get_data(GTK_OBJECT(win_ref), "recent_bg_mi"); - - menu = gtk_menu_new(); - gtk_widget_show(menu); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(w), menu); - - for (l = recent_bgs; l; l = l->next) + if (w) { - filename = (char *) l->data; + gtk_menu_item_remove_submenu(GTK_MENU_ITEM(w)); + menu = gtk_menu_new(); + gtk_widget_show(menu); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(w), menu); - short_name = get_shortname_for(filename); - mi = gtk_menu_item_new_with_label(short_name); + for (l = recent_bgs; l; l = l->next) + { + filename = (char *) l->data; - gtk_menu_append(GTK_MENU(menu), mi); - gtk_signal_connect(GTK_OBJECT(mi), "activate", GTK_SIGNAL_FUNC(open_bg), - (gpointer) filename); - gtk_widget_show(mi); + short_name = get_shortname_for(filename); + if (short_name) + { + mi = gtk_menu_item_new_with_label(short_name); + + free(short_name); + } + + gtk_menu_append(GTK_MENU(menu), mi); + gtk_signal_connect(GTK_OBJECT(mi), "activate", + GTK_SIGNAL_FUNC(open_bg), (gpointer) filename); + gtk_widget_show(mi); + } + recent_menu = menu; + } + else + { + fprintf(stderr, "Unable to locate the recent_bg_mi widget\n"); } - recent_menu = menu; } /** @@ -1115,11 +1125,6 @@ ebony_status_message(errstr, EBONY_STATUS_TO); gtk_widget_destroy(GTK_WIDGET(data)); - if (export_ref) - { - gtk_widget_destroy(export_ref); - export_ref = NULL; - } return; UN(w); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/interface.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- interface.c 2 Jun 2002 21:40:07 -0000 1.12 +++ interface.c 9 Jun 2002 12:33:48 -0000 1.13 @@ -33,12 +33,11 @@ GtkWidget *recent_bg_mi; GtkWidget *separator2; GtkWidget *save; - GtkWidget *export1; GtkWidget *save_as; GtkWidget *separator3; GtkWidget *quit; GtkWidget *notebook1; - GtkWidget *empty_notebook_page; + GtkWidget *label30; GtkWidget *label1; GtkWidget *vbox2; GtkWidget *vbox3; @@ -144,21 +143,34 @@ GtkWidget *gradient_angle; GtkWidget *label21; GtkWidget *whocares; - GtkWidget *vbox15; - GtkWidget *scale_preview_toggle; - GtkWidget *table6; - GtkWidget *label30; - GtkWidget *label31; - GtkWidget *label32; - GtkObject *preview_screen_h_adj; - GtkWidget *preview_screen_h; - GtkObject *preview_screen_w_adj; - GtkWidget *preview_screen_w; - GtkObject *preview_xinerama_v_adj; - GtkWidget *preview_xinerama_v; - GtkObject *preview_xinerama_h_adj; - GtkWidget *preview_xinerama_h; - GtkWidget *label33; + GtkWidget *vbox1492; + GtkWidget *scale_preview; + GtkWidget *screen_size_frame; + GtkWidget *vbox14; + GtkWidget *table3; + GSList *export_size_group_group = NULL; + GtkWidget *radiobutton1; + GtkWidget *radiobutton2; + GtkWidget *radiobutton3; + GtkWidget *radiobutton4; + GtkWidget *radiobutton5; + GtkWidget *radiobutton6; + GtkWidget *table5; + GtkObject *export_screen_h_adj; + GtkWidget *export_screen_h; + GtkWidget *label26; + GtkObject *export_screen_w_adj; + GtkWidget *export_screen_w; + GtkWidget *label25; + GtkWidget *table4; + GtkObject *export_xinerama_v_adj; + GtkWidget *export_xinerama_v; + GtkObject *export_xinerama_h_adj; + GtkWidget *export_xinerama_h; + GtkWidget *label28; + GtkWidget *label27; + GtkWidget *hbuttonbox1; + GtkWidget *export_next_button; GtkWidget *label29; GtkAccelGroup *accel_group; @@ -264,16 +276,6 @@ gtk_widget_add_accelerator(save, "activate", accel_group, GDK_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - export1 = gtk_menu_item_new_with_label(_("Export")); - gtk_widget_set_name(export1, "export1"); - gtk_widget_ref(export1); - gtk_object_set_data_full(GTK_OBJECT(main_win), "export1", export1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(export1); - gtk_container_add(GTK_CONTAINER(_file_menu), export1); - gtk_widget_add_accelerator(export1, "activate", accel_group, GDK_e, - GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - save_as = gtk_menu_item_new_with_label(_("Save As")); gtk_widget_set_name(save_as, "save_as"); gtk_widget_ref(save_as); @@ -309,9 +311,13 @@ gtk_widget_show(notebook1); gtk_box_pack_start(GTK_BOX(vbox1), notebook1, TRUE, TRUE, 0); - empty_notebook_page = gtk_vbox_new(FALSE, 0); - gtk_widget_show(empty_notebook_page); - gtk_container_add(GTK_CONTAINER(notebook1), empty_notebook_page); + label30 = gtk_label_new(_("This tab is intentionally left blank.")); + gtk_widget_set_name(label30, "label30"); + gtk_widget_ref(label30); + gtk_object_set_data_full(GTK_OBJECT(main_win), "label30", label30, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(label30); + gtk_container_add(GTK_CONTAINER(notebook1), label30); label1 = gtk_label_new(_("Settings")); gtk_widget_set_name(label1, "label1"); @@ -1145,400 +1151,46 @@ (notebook1), 1), whocares); - vbox15 = gtk_vbox_new(FALSE, 0); - gtk_widget_set_name(vbox15, "vbox15"); - gtk_widget_ref(vbox15); - gtk_object_set_data_full(GTK_OBJECT(main_win), "vbox15", vbox15, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(vbox15); - gtk_container_add(GTK_CONTAINER(notebook1), vbox15); - - scale_preview_toggle = gtk_check_button_new_with_label(_("Scale Preview")); - gtk_widget_set_name(scale_preview_toggle, "scale_preview_toggle"); - gtk_widget_ref(scale_preview_toggle); - gtk_object_set_data_full(GTK_OBJECT(main_win), "scale_preview_toggle", - scale_preview_toggle, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(scale_preview_toggle); - gtk_box_pack_start(GTK_BOX(vbox15), scale_preview_toggle, FALSE, TRUE, 0); - - table6 = gtk_table_new(4, 2, FALSE); - gtk_widget_set_name(table6, "table6"); - gtk_widget_ref(table6); - gtk_object_set_data_full(GTK_OBJECT(main_win), "table6", table6, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(table6); - gtk_box_pack_start(GTK_BOX(vbox15), table6, FALSE, TRUE, 1); - gtk_container_set_border_width(GTK_CONTAINER(table6), 2); - gtk_table_set_col_spacings(GTK_TABLE(table6), 4); - - label30 = gtk_label_new(_("Screen Width")); - gtk_widget_set_name(label30, "label30"); - gtk_widget_ref(label30); - gtk_object_set_data_full(GTK_OBJECT(main_win), "label30", label30, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(label30); - gtk_table_attach(GTK_TABLE(table6), label30, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, - 0); - gtk_label_set_justify(GTK_LABEL(label30), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment(GTK_MISC(label30), 0, 0.5); - - label31 = gtk_label_new(_("Screen Height")); - gtk_widget_set_name(label31, "label31"); - gtk_widget_ref(label31); - gtk_object_set_data_full(GTK_OBJECT(main_win), "label31", label31, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(label31); - gtk_table_attach(GTK_TABLE(table6), label31, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, - 0); - gtk_label_set_justify(GTK_LABEL(label31), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment(GTK_MISC(label31), 0, 0.5); - - label32 = gtk_label_new(_("Xinerama Vertical")); - gtk_widget_set_name(label32, "label32"); - gtk_widget_ref(label32); - gtk_object_set_data_full(GTK_OBJECT(main_win), "label32", label32, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(label32); - gtk_table_attach(GTK_TABLE(table6), label32, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, - 0); - gtk_label_set_justify(GTK_LABEL(label32), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment(GTK_MISC(label32), 0, 0.5); - - preview_screen_h_adj = gtk_adjustment_new(600, 240, 9999, 1, 10, 10); - preview_screen_h = - gtk_spin_button_new(GTK_ADJUSTMENT(preview_screen_h_adj), 1, 0); - gtk_widget_set_name(preview_screen_h, "preview_screen_h"); - gtk_widget_ref(preview_screen_h); - gtk_object_set_data_full(GTK_OBJECT(main_win), "preview_screen_h", - preview_screen_h, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(preview_screen_h); - gtk_table_attach(GTK_TABLE(table6), preview_screen_h, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - preview_screen_w_adj = gtk_adjustment_new(800, 320, 9999, 1, 10, 10); - preview_screen_w = - gtk_spin_button_new(GTK_ADJUSTMENT(preview_screen_w_adj), 1, 0); - gtk_widget_set_name(preview_screen_w, "preview_screen_w"); - gtk_widget_ref(preview_screen_w); - gtk_object_set_data_full(GTK_OBJECT(main_win), "preview_screen_w", - preview_screen_w, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(preview_screen_w); - gtk_table_attach(GTK_TABLE(table6), preview_screen_w, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - preview_xinerama_v_adj = gtk_adjustment_new(1, 0, 10, 1, 10, 10); - preview_xinerama_v = - gtk_spin_button_new(GTK_ADJUSTMENT(preview_xinerama_v_adj), 1, 0); - gtk_widget_set_name(preview_xinerama_v, "preview_xinerama_v"); - gtk_widget_ref(preview_xinerama_v); - gtk_object_set_data_full(GTK_OBJECT(main_win), "preview_xinerama_v", - preview_xinerama_v, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(preview_xinerama_v); - gtk_table_attach(GTK_TABLE(table6), preview_xinerama_v, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, - 0); - - preview_xinerama_h_adj = gtk_adjustment_new(1, 0, 10, 1, 10, 10); - preview_xinerama_h = - gtk_spin_button_new(GTK_ADJUSTMENT(preview_xinerama_h_adj), 1, 0); - gtk_widget_set_name(preview_xinerama_h, "preview_xinerama_h"); - gtk_widget_ref(preview_xinerama_h); - gtk_object_set_data_full(GTK_OBJECT(main_win), "preview_xinerama_h", - preview_xinerama_h, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(preview_xinerama_h); - gtk_table_attach(GTK_TABLE(table6), preview_xinerama_h, 1, 2, 3, 4, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, - 0); - - label33 = gtk_label_new(_("Xinerama Horizontal")); - gtk_widget_set_name(label33, "label33"); - gtk_widget_ref(label33); - gtk_object_set_data_full(GTK_OBJECT(main_win), "label33", label33, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(label33); - gtk_table_attach(GTK_TABLE(table6), label33, 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, - 0); - gtk_label_set_justify(GTK_LABEL(label33), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment(GTK_MISC(label33), 0, 0.5); - - label29 = gtk_label_new(_("Preview")); - gtk_widget_set_name(label29, "label29"); - gtk_widget_ref(label29); - gtk_object_set_data_full(GTK_OBJECT(main_win), "label29", label29, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(label29); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), - gtk_notebook_get_nth_page(GTK_NOTEBOOK - (notebook1), 2), - label29); - - gtk_signal_connect(GTK_OBJECT(main_win), "delete_event", - GTK_SIGNAL_FUNC(on_main_win_delete_event), NULL); - gtk_signal_connect(GTK_OBJECT(new1), "activate", - GTK_SIGNAL_FUNC(on_new_bg_activate), NULL); - gtk_signal_connect(GTK_OBJECT(open), "activate", - GTK_SIGNAL_FUNC(on_open_bg_activate), NULL); - gtk_signal_connect(GTK_OBJECT(recent_bg_mi), "activate", - GTK_SIGNAL_FUNC(on_recent_bg_mi_activate), NULL); - gtk_signal_connect(GTK_OBJECT(save), "activate", - GTK_SIGNAL_FUNC(on_save_bg_activate), NULL); - gtk_signal_connect(GTK_OBJECT(export1), "activate", - GTK_SIGNAL_FUNC(on_export_bg_activate), NULL); - gtk_signal_connect(GTK_OBJECT(save_as), "activate", - GTK_SIGNAL_FUNC(on_save_bg_as_activate), NULL); - gtk_signal_connect(GTK_OBJECT(quit), "activate", - GTK_SIGNAL_FUNC(on_quit_ebony_activate), NULL); - gtk_signal_connect(GTK_OBJECT(layer_num), "changed", - GTK_SIGNAL_FUNC(on_layer_num_spin_button_changed), - NULL); - gtk_signal_connect(GTK_OBJECT(button3), "clicked", - GTK_SIGNAL_FUNC(on_layer_add_clicked), NULL); - gtk_signal_connect(GTK_OBJECT(button4), "clicked", - GTK_SIGNAL_FUNC(on_layer_delete_clicked), NULL); - gtk_signal_connect(GTK_OBJECT(button1), "clicked", - GTK_SIGNAL_FUNC(on_move_layer_up_clicked), NULL); - gtk_signal_connect(GTK_OBJECT(button2), "clicked", - GTK_SIGNAL_FUNC(on_move_layer_downclicked), NULL); - gtk_signal_connect(GTK_OBJECT(type_image), "toggled", - GTK_SIGNAL_FUNC(on_layer_type_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(type_color), "toggled", - GTK_SIGNAL_FUNC(on_layer_type_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(type_gradient), "toggled", - GTK_SIGNAL_FUNC(on_layer_type_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(image_file), "changed", - GTK_SIGNAL_FUNC(on_image_file_entry_changed), NULL); - gtk_signal_connect(GTK_OBJECT(button5), "clicked", - GTK_SIGNAL_FUNC(on_file_select_button_clicked), NULL); - gtk_signal_connect(GTK_OBJECT(inline_image), "toggled", - GTK_SIGNAL_FUNC(on_inline_image_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(color_class_combo), "changed", - GTK_SIGNAL_FUNC(on_color_class_changed), NULL); - gtk_signal_connect(GTK_OBJECT(scroll_x), "changed", - GTK_SIGNAL_FUNC(on_scroll_x_changed), NULL); - gtk_signal_connect(GTK_OBJECT(scroll_y), "changed", - GTK_SIGNAL_FUNC(on_scroll_y_changed), NULL); - gtk_signal_connect(GTK_OBJECT(pos_x), "changed", - GTK_SIGNAL_FUNC(on_pos_x_changed), NULL); - gtk_signal_connect(GTK_OBJECT(pos_y), "changed", - GTK_SIGNAL_FUNC(on_pos_y_changed), NULL); - gtk_signal_connect(GTK_OBJECT(abs_x), "changed", - GTK_SIGNAL_FUNC(on_pos_abs_x_changed), NULL); - gtk_signal_connect(GTK_OBJECT(abs_y), "changed", - GTK_SIGNAL_FUNC(on_pos_abs_y_changed), NULL); - gtk_signal_connect(GTK_OBJECT(size_w), "changed", - GTK_SIGNAL_FUNC(on_size_w_changed), NULL); - gtk_signal_connect(GTK_OBJECT(size_h), "changed", - GTK_SIGNAL_FUNC(on_size_h_changed), NULL); - gtk_signal_connect(GTK_OBJECT(size_abs_w), "toggled", - GTK_SIGNAL_FUNC(on_size_abs_w_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(size_abs_h), "toggled", - GTK_SIGNAL_FUNC(on_size_abs_h_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(size_orig_w), "toggled", - GTK_SIGNAL_FUNC(on_size_orig_w_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(size_orig_h), "toggled", - GTK_SIGNAL_FUNC(on_size_orig_h_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(fill_w), "changed", - GTK_SIGNAL_FUNC(on_fill_w_changed), NULL); - gtk_signal_connect(GTK_OBJECT(fill_h), "changed", - GTK_SIGNAL_FUNC(on_fill_h_changed), NULL); - gtk_signal_connect(GTK_OBJECT(fill_orig_w), "toggled", - GTK_SIGNAL_FUNC(on_fill_orig_w_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(fill_orig_h), "toggled", - GTK_SIGNAL_FUNC(on_fill_orig_h_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(color_box), "expose_event", - GTK_SIGNAL_FUNC(on_color_box_expose_event), NULL); - gtk_signal_connect(GTK_OBJECT(color_box), "button_press_event", - GTK_SIGNAL_FUNC(on_color_box_button_release_event), - NULL); - gtk_signal_connect(GTK_OBJECT(gradient_one_color_box), "expose_event", - GTK_SIGNAL_FUNC(on_gradient_one_expose_event), NULL); - gtk_signal_connect(GTK_OBJECT(gradient_one_color_box), - "button_press_event", - GTK_SIGNAL_FUNC(on_gradient_one_button_release_event), - NULL); - gtk_signal_connect(GTK_OBJECT(gradient_two_color_box), - "button_press_event", - GTK_SIGNAL_FUNC(on_gradient_two_button_release_event), - NULL); - gtk_signal_connect(GTK_OBJECT(gradient_two_color_box), "expose_event", - GTK_SIGNAL_FUNC(on_gradient_two_expose_event), NULL); - gtk_signal_connect(GTK_OBJECT(gradient_angle), "changed", - GTK_SIGNAL_FUNC(on_gradient_angle_changed), NULL); - gtk_signal_connect(GTK_OBJECT(scale_preview_toggle), "toggled", - GTK_SIGNAL_FUNC(on_scale_preview_toggled), NULL); - gtk_signal_connect(GTK_OBJECT(preview_screen_h), "changed", - GTK_SIGNAL_FUNC(on_preview_screen_h_changed), NULL); - gtk_signal_connect(GTK_OBJECT(preview_screen_w), "changed", - GTK_SIGNAL_FUNC(on_preview_screen_w_changed), NULL); - gtk_signal_connect(GTK_OBJECT(preview_xinerama_v), "changed", - GTK_SIGNAL_FUNC(on_preview_xinerama_v_changed), NULL); - gtk_signal_connect(GTK_OBJECT(preview_xinerama_h), "changed", - GTK_SIGNAL_FUNC(on_preview_xinerama_h_changed), NULL); - - gtk_window_add_accel_group(GTK_WINDOW(main_win), accel_group); - - return main_win; -} - -GtkWidget * -create_win_bg(void) -{ - GtkWidget *win_bg; - GtkWidget *vbox13; - GtkWidget *hbox15; - GtkWidget *evas; - GtkWidget *yscale; - GtkWidget *xscale; - GtkWidget *_ebony_statusbar; - - win_bg = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name(win_bg, "win_bg"); - gtk_object_set_data(GTK_OBJECT(win_bg), "win_bg", win_bg); - gtk_widget_set_uposition(win_bg, 30, -2); - gtk_window_set_title(GTK_WINDOW(win_bg), _("Filename: ")); - gtk_window_set_default_size(GTK_WINDOW(win_bg), 400, 250); - gtk_window_set_policy(GTK_WINDOW(win_bg), TRUE, TRUE, FALSE); - gtk_window_set_wmclass(GTK_WINDOW(win_bg), "Ebony", "Background"); - - vbox13 = gtk_vbox_new(FALSE, 0); - gtk_widget_set_name(vbox13, "vbox13"); - gtk_widget_ref(vbox13); - gtk_object_set_data_full(GTK_OBJECT(win_bg), "vbox13", vbox13, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(vbox13); - gtk_container_add(GTK_CONTAINER(win_bg), vbox13); - gtk_container_set_border_width(GTK_CONTAINER(vbox13), 2); - - hbox15 = gtk_hbox_new(FALSE, 0); - gtk_widget_set_name(hbox15, "hbox15"); - gtk_widget_ref(hbox15); - gtk_object_set_data_full(GTK_OBJECT(win_bg), "hbox15", hbox15, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(hbox15); - gtk_box_pack_start(GTK_BOX(vbox13), hbox15, TRUE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(hbox15), 1); - - evas = gtk_drawing_area_new(); - gtk_widget_set_name(evas, "evas"); - gtk_widget_ref(evas); - gtk_object_set_data_full(GTK_OBJECT(win_bg), "evas", evas, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(evas); - gtk_box_pack_start(GTK_BOX(hbox15), evas, TRUE, TRUE, 2); - gtk_widget_set_usize(evas, 200, 200); - gtk_widget_set_events(evas, GDK_EXPOSURE_MASK); - - yscale = - gtk_vscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 1024, 0, 0, 0))); - gtk_widget_set_name(yscale, "yscale"); - gtk_widget_ref(yscale); - gtk_object_set_data_full(GTK_OBJECT(win_bg), "yscale", yscale, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(yscale); - gtk_box_pack_start(GTK_BOX(hbox15), yscale, FALSE, FALSE, 0); - - xscale = - gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 1024, 0, 0, 0))); - gtk_widget_set_name(xscale, "xscale"); - gtk_widget_ref(xscale); - gtk_object_set_data_full(GTK_OBJECT(win_bg), "xscale", xscale, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(xscale); - gtk_box_pack_start(GTK_BOX(vbox13), xscale, FALSE, FALSE, 0); - - _ebony_statusbar = gtk_statusbar_new(); - gtk_widget_set_name(_ebony_statusbar, "_ebony_statusbar"); - gtk_widget_ref(_ebony_statusbar); - gtk_object_set_data_full(GTK_OBJECT(win_bg), "_ebony_statusbar", - _ebony_statusbar, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(_ebony_statusbar); - gtk_box_pack_start(GTK_BOX(vbox13), _ebony_statusbar, FALSE, FALSE, 0); - - gtk_signal_connect(GTK_OBJECT(win_bg), "delete_event", - GTK_SIGNAL_FUNC(on_win_bg_delete_event), NULL); - gtk_signal_connect(GTK_OBJECT(win_bg), "key_press_event", - GTK_SIGNAL_FUNC(on_win_bg_button_press_event), NULL); - gtk_signal_connect(GTK_OBJECT(evas), "configure_event", - GTK_SIGNAL_FUNC(on_bg_evas_configure_event), NULL); - gtk_signal_connect(GTK_OBJECT(evas), "drag_data_received", - GTK_SIGNAL_FUNC(on_bg_evas_drag_data_received), NULL); - gtk_signal_connect(GTK_OBJECT(evas), "expose_event", - GTK_SIGNAL_FUNC(on_evas_expose_event), NULL); - - return win_bg; -} - -GtkWidget * -create_export_win(void) -{ - GtkWidget *export_win; - GtkWidget *frame12; - GtkWidget *vbox14; - GtkWidget *table3; - GSList *export_size_group_group = NULL; - GtkWidget *radiobutton1; - GtkWidget *radiobutton2; - GtkWidget *radiobutton3; - GtkWidget *radiobutton4; - GtkWidget *radiobutton5; - GtkWidget *radiobutton6; - GtkWidget *table5; - GtkObject *export_screen_h_adj; - GtkWidget *export_screen_h; - GtkWidget *label26; - GtkObject *export_screen_w_adj; - GtkWidget *export_screen_w; - GtkWidget *label25; - GtkWidget *table4; - GtkObject *export_xinerama_v_adj; - GtkWidget *export_xinerama_v; - GtkObject *export_xinerama_h_adj; - GtkWidget *export_xinerama_h; - GtkWidget *label28; - GtkWidget *label27; - GtkWidget *hbuttonbox1; - GtkWidget *export_next_button; - GtkWidget *export_cancel_button; - - export_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name(export_win, "export_win"); - gtk_object_set_data(GTK_OBJECT(export_win), "export_win", export_win); - gtk_window_set_title(GTK_WINDOW(export_win), _("Export to Image ...")); - gtk_window_set_policy(GTK_WINDOW(export_win), TRUE, FALSE, FALSE); - - frame12 = gtk_frame_new(_("Image Size")); - gtk_widget_set_name(frame12, "frame12"); - gtk_widget_ref(frame12); - gtk_object_set_data_full(GTK_OBJECT(export_win), "frame12", frame12, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(frame12); - gtk_container_add(GTK_CONTAINER(export_win), frame12); - gtk_container_set_border_width(GTK_CONTAINER(frame12), 4); + vbox1492 = gtk_vbox_new(FALSE, 0); + gtk_widget_set_name(vbox1492, "vbox1492"); + gtk_widget_ref(vbox1492); + gtk_object_set_data_full(GTK_OBJECT(main_win), "vbox1492", vbox1492, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(vbox1492); + gtk_container_add(GTK_CONTAINER(notebook1), vbox1492); + + scale_preview = gtk_check_button_new_with_label(_("Scale Preview")); + gtk_widget_set_name(scale_preview, "scale_preview"); + gtk_widget_ref(scale_preview); + gtk_object_set_data_full(GTK_OBJECT(main_win), "scale_preview", + scale_preview, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(scale_preview); + gtk_box_pack_start(GTK_BOX(vbox1492), scale_preview, FALSE, FALSE, 0); + + screen_size_frame = gtk_frame_new(_("Screen Size")); + gtk_widget_set_name(screen_size_frame, "screen_size_frame"); + gtk_widget_ref(screen_size_frame); + gtk_object_set_data_full(GTK_OBJECT(main_win), "screen_size_frame", + screen_size_frame, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(screen_size_frame); + gtk_box_pack_start(GTK_BOX(vbox1492), screen_size_frame, TRUE, TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(screen_size_frame), 2); + gtk_widget_set_sensitive(screen_size_frame, FALSE); vbox14 = gtk_vbox_new(FALSE, 0); gtk_widget_set_name(vbox14, "vbox14"); gtk_widget_ref(vbox14); - gtk_object_set_data_full(GTK_OBJECT(export_win), "vbox14", vbox14, + gtk_object_set_data_full(GTK_OBJECT(main_win), "vbox14", vbox14, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox14); - gtk_container_add(GTK_CONTAINER(frame12), vbox14); + gtk_container_add(GTK_CONTAINER(screen_size_frame), vbox14); table3 = gtk_table_new(3, 2, FALSE); gtk_widget_set_name(table3, "table3"); gtk_widget_ref(table3); - gtk_object_set_data_full(GTK_OBJECT(export_win), "table3", table3, + gtk_object_set_data_full(GTK_OBJECT(main_win), "table3", table3, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(table3); gtk_box_pack_start(GTK_BOX(vbox14), table3, FALSE, FALSE, 0); @@ -1549,7 +1201,7 @@ gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton1)); gtk_widget_set_name(radiobutton1, "radiobutton1"); gtk_widget_ref(radiobutton1); - gtk_object_set_data_full(GTK_OBJECT(export_win), "radiobutton1", + gtk_object_set_data_full(GTK_OBJECT(main_win), "radiobutton1", radiobutton1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(radiobutton1); @@ -1563,7 +1215,7 @@ gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton2)); gtk_widget_set_name(radiobutton2, "radiobutton2"); gtk_widget_ref(radiobutton2); - gtk_object_set_data_full(GTK_OBJECT(export_win), "radiobutton2", + gtk_object_set_data_full(GTK_OBJECT(main_win), "radiobutton2", radiobutton2, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(radiobutton2); @@ -1577,7 +1229,7 @@ gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton3)); gtk_widget_set_name(radiobutton3, "radiobutton3"); gtk_widget_ref(radiobutton3); - gtk_object_set_data_full(GTK_OBJECT(export_win), "radiobutton3", + gtk_object_set_data_full(GTK_OBJECT(main_win), "radiobutton3", radiobutton3, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(radiobutton3); @@ -1593,7 +1245,7 @@ gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton4)); gtk_widget_set_name(radiobutton4, "radiobutton4"); gtk_widget_ref(radiobutton4); - gtk_object_set_data_full(GTK_OBJECT(export_win), "radiobutton4", + gtk_object_set_data_full(GTK_OBJECT(main_win), "radiobutton4", radiobutton4, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(radiobutton4); @@ -1608,7 +1260,7 @@ gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton5)); gtk_widget_set_name(radiobutton5, "radiobutton5"); gtk_widget_ref(radiobutton5); - gtk_object_set_data_full(GTK_OBJECT(export_win), "radiobutton5", + gtk_object_set_data_full(GTK_OBJECT(main_win), "radiobutton5", radiobutton5, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(radiobutton5); @@ -1622,7 +1274,7 @@ gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton6)); gtk_widget_set_name(radiobutton6, "radiobutton6"); gtk_widget_ref(radiobutton6); - gtk_object_set_data_full(GTK_OBJECT(export_win), "radiobutton6", + gtk_object_set_data_full(GTK_OBJECT(main_win), "radiobutton6", radiobutton6, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(radiobutton6); @@ -1633,28 +1285,29 @@ table5 = gtk_table_new(2, 2, FALSE); gtk_widget_set_name(table5, "table5"); gtk_widget_ref(table5); - gtk_object_set_data_full(GTK_OBJECT(export_win), "table5", table5, + gtk_object_set_data_full(GTK_OBJECT(main_win), "table5", table5, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(table5); - gtk_box_pack_start(GTK_BOX(vbox14), table5, TRUE, TRUE, 2); + gtk_box_pack_start(GTK_BOX(vbox14), table5, FALSE, TRUE, 2); - export_screen_h_adj = gtk_adjustment_new(1, 0, 9999, 1, 10, 10); + export_screen_h_adj = gtk_adjustment_new(480, 240, 99999, 20, 200, 200); export_screen_h = gtk_spin_button_new(GTK_ADJUSTMENT(export_screen_h_adj), 1, 0); gtk_widget_set_name(export_screen_h, "export_screen_h"); gtk_widget_ref(export_screen_h); - gtk_object_set_data_full(GTK_OBJECT(export_win), "export_screen_h", + gtk_object_set_data_full(GTK_OBJECT(main_win), "export_screen_h", export_screen_h, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(export_screen_h); gtk_table_attach(GTK_TABLE(table5), export_screen_h, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_sensitive(export_screen_h, FALSE); label26 = gtk_label_new(_("Screen Height")); gtk_widget_set_name(label26, "label26"); gtk_widget_ref(label26); - gtk_object_set_data_full(GTK_OBJECT(export_win), "label26", label26, + gtk_object_set_data_full(GTK_OBJECT(main_win), "label26", label26, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label26); gtk_table_attach(GTK_TABLE(table5), label26, 0, 1, 1, 2, @@ -1663,23 +1316,24 @@ gtk_label_set_justify(GTK_LABEL(label26), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label26), 0.1, 0.5); - export_screen_w_adj = gtk_adjustment_new(1, 0, 9999, 1, 10, 10); + export_screen_w_adj = gtk_adjustment_new(640, 320, 99999, 20, 200, 200); export_screen_w = gtk_spin_button_new(GTK_ADJUSTMENT(export_screen_w_adj), 1, 0); gtk_widget_set_name(export_screen_w, "export_screen_w"); gtk_widget_ref(export_screen_w); - gtk_object_set_data_full(GTK_OBJECT(export_win), "export_screen_w", + gtk_object_set_data_full(GTK_OBJECT(main_win), "export_screen_w", export_screen_w, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(export_screen_w); gtk_table_attach(GTK_TABLE(table5), export_screen_w, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_sensitive(export_screen_w, FALSE); label25 = gtk_label_new(_("Screen Width")); gtk_widget_set_name(label25, "label25"); gtk_widget_ref(label25); - gtk_object_set_data_full(GTK_OBJECT(export_win), "label25", label25, + gtk_object_set_data_full(GTK_OBJECT(main_win), "label25", label25, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label25); gtk_table_attach(GTK_TABLE(table5), label25, 0, 1, 0, 1, @@ -1691,17 +1345,17 @@ table4 = gtk_table_new(2, 2, FALSE); gtk_widget_set_name(table4, "table4"); gtk_widget_ref(table4); - gtk_object_set_data_full(GTK_OBJECT(export_win), "table4", table4, + gtk_object_set_data_full(GTK_OBJECT(main_win), "table4", table4, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(table4); - gtk_box_pack_start(GTK_BOX(vbox14), table4, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(vbox14), table4, FALSE, TRUE, 0); export_xinerama_v_adj = gtk_adjustment_new(1, 1, 10, 1, 10, 10); export_xinerama_v = gtk_spin_button_new(GTK_ADJUSTMENT(export_xinerama_v_adj), 1, 0); gtk_widget_set_name(export_xinerama_v, "export_xinerama_v"); gtk_widget_ref(export_xinerama_v); - gtk_object_set_data_full(GTK_OBJECT(export_win), "export_xinerama_v", + gtk_object_set_data_full(GTK_OBJECT(main_win), "export_xinerama_v", export_xinerama_v, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(export_xinerama_v); @@ -1714,7 +1368,7 @@ gtk_spin_button_new(GTK_ADJUSTMENT(export_xinerama_h_adj), 1, 0); gtk_widget_set_name(export_xinerama_h, "export_xinerama_h"); gtk_widget_ref(export_xinerama_h); - gtk_object_set_data_full(GTK_OBJECT(export_win), "export_xinerama_h", + gtk_object_set_data_full(GTK_OBJECT(main_win), "export_xinerama_h", export_xinerama_h, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(export_xinerama_h); @@ -1725,7 +1379,7 @@ label28 = gtk_label_new(_("Xinerama Vertical")); gtk_widget_set_name(label28, "label28"); gtk_widget_ref(label28); - gtk_object_set_data_full(GTK_OBJECT(export_win), "label28", label28, + gtk_object_set_data_full(GTK_OBJECT(main_win), "label28", label28, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label28); gtk_table_attach(GTK_TABLE(table4), label28, 0, 1, 0, 1, @@ -1737,7 +1391,7 @@ label27 = gtk_label_new(_("Xinerama Horizontal")); gtk_widget_set_name(label27, "label27"); gtk_widget_ref(label27); - gtk_object_set_data_full(GTK_OBJECT(export_win), "label27", label27, + gtk_object_set_data_full(GTK_OBJECT(main_win), "label27", label27, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label27); gtk_table_attach(GTK_TABLE(table4), label27, 0, 1, 1, 2, @@ -1749,32 +1403,125 @@ hbuttonbox1 = gtk_hbutton_box_new(); gtk_widget_set_name(hbuttonbox1, "hbuttonbox1"); gtk_widget_ref(hbuttonbox1); - gtk_object_set_data_full(GTK_OBJECT(export_win), "hbuttonbox1", - hbuttonbox1, (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(main_win), "hbuttonbox1", hbuttonbox1, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbuttonbox1); - gtk_box_pack_start(GTK_BOX(vbox14), hbuttonbox1, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(vbox14), hbuttonbox1, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbuttonbox1), 2); - export_next_button = gtk_button_new_with_label(_("Next")); + export_next_button = gtk_button_new_with_label(_("Export To Image")); gtk_widget_set_name(export_next_button, "export_next_button"); gtk_widget_ref(export_next_button); - gtk_object_set_data_full(GTK_OBJECT(export_win), "export_next_button", + gtk_object_set_data_full(GTK_OBJECT(main_win), "export_next_button", export_next_button, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(export_next_button); gtk_container_add(GTK_CONTAINER(hbuttonbox1), export_next_button); GTK_WIDGET_SET_FLAGS(export_next_button, GTK_CAN_DEFAULT); - export_cancel_button = gtk_button_new_with_label(_("Cancel")); - gtk_widget_set_name(export_cancel_button, "export_cancel_button"); - gtk_widget_ref(export_cancel_button); - gtk_object_set_data_full(GTK_OBJECT(export_win), "export_cancel_button", - export_cancel_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show(export_cancel_button); - gtk_container_add(GTK_CONTAINER(hbuttonbox1), export_cancel_button); - GTK_WIDGET_SET_FLAGS(export_cancel_button, GTK_CAN_DEFAULT); + label29 = gtk_label_new(_("Preview")); + gtk_widget_set_name(label29, "label29"); + gtk_widget_ref(label29); + gtk_object_set_data_full(GTK_OBJECT(main_win), "label29", label29, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(label29); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), + gtk_notebook_get_nth_page(GTK_NOTEBOOK + (notebook1), 2), + label29); + gtk_signal_connect(GTK_OBJECT(main_win), "delete_event", + GTK_SIGNAL_FUNC(on_main_win_delete_event), NULL); + gtk_signal_connect(GTK_OBJECT(new1), "activate", + GTK_SIGNAL_FUNC(on_new_bg_activate), NULL); + gtk_signal_connect(GTK_OBJECT(open), "activate", + GTK_SIGNAL_FUNC(on_open_bg_activate), NULL); + gtk_signal_connect(GTK_OBJECT(recent_bg_mi), "activate", + GTK_SIGNAL_FUNC(on_recent_bg_mi_activate), NULL); + gtk_signal_connect(GTK_OBJECT(save), "activate", + GTK_SIGNAL_FUNC(on_save_bg_activate), NULL); + gtk_signal_connect(GTK_OBJECT(save_as), "activate", + GTK_SIGNAL_FUNC(on_save_bg_as_activate), NULL); + gtk_signal_connect(GTK_OBJECT(quit), "activate", + GTK_SIGNAL_FUNC(on_quit_ebony_activate), NULL); + gtk_signal_connect(GTK_OBJECT(layer_num), "changed", + GTK_SIGNAL_FUNC(on_layer_num_spin_button_changed), + NULL); + gtk_signal_connect(GTK_OBJECT(button3), "clicked", + GTK_SIGNAL_FUNC(on_layer_add_clicked), NULL); + gtk_signal_connect(GTK_OBJECT(button4), "clicked", + GTK_SIGNAL_FUNC(on_layer_delete_clicked), NULL); + gtk_signal_connect(GTK_OBJECT(button1), "clicked", + GTK_SIGNAL_FUNC(on_move_layer_up_clicked), NULL); + gtk_signal_connect(GTK_OBJECT(button2), "clicked", + GTK_SIGNAL_FUNC(on_move_layer_downclicked), NULL); + gtk_signal_connect(GTK_OBJECT(type_image), "toggled", + GTK_SIGNAL_FUNC(on_layer_type_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(type_color), "toggled", + GTK_SIGNAL_FUNC(on_layer_type_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(type_gradient), "toggled", + GTK_SIGNAL_FUNC(on_layer_type_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(image_file), "changed", + GTK_SIGNAL_FUNC(on_image_file_entry_changed), NULL); + gtk_signal_connect(GTK_OBJECT(button5), "clicked", + GTK_SIGNAL_FUNC(on_file_select_button_clicked), NULL); + gtk_signal_connect(GTK_OBJECT(inline_image), "toggled", + GTK_SIGNAL_FUNC(on_inline_image_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(color_class_combo), "changed", + GTK_SIGNAL_FUNC(on_color_class_changed), NULL); + gtk_signal_connect(GTK_OBJECT(scroll_x), "changed", + GTK_SIGNAL_FUNC(on_scroll_x_changed), NULL); + gtk_signal_connect(GTK_OBJECT(scroll_y), "changed", + GTK_SIGNAL_FUNC(on_scroll_y_changed), NULL); + gtk_signal_connect(GTK_OBJECT(pos_x), "changed", + GTK_SIGNAL_FUNC(on_pos_x_changed), NULL); + gtk_signal_connect(GTK_OBJECT(pos_y), "changed", + GTK_SIGNAL_FUNC(on_pos_y_changed), NULL); + gtk_signal_connect(GTK_OBJECT(abs_x), "changed", + GTK_SIGNAL_FUNC(on_pos_abs_x_changed), NULL); + gtk_signal_connect(GTK_OBJECT(abs_y), "changed", + GTK_SIGNAL_FUNC(on_pos_abs_y_changed), NULL); + gtk_signal_connect(GTK_OBJECT(size_w), "changed", + GTK_SIGNAL_FUNC(on_size_w_changed), NULL); + gtk_signal_connect(GTK_OBJECT(size_h), "changed", + GTK_SIGNAL_FUNC(on_size_h_changed), NULL); + gtk_signal_connect(GTK_OBJECT(size_abs_w), "toggled", + GTK_SIGNAL_FUNC(on_size_abs_w_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(size_abs_h), "toggled", + GTK_SIGNAL_FUNC(on_size_abs_h_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(size_orig_w), "toggled", + GTK_SIGNAL_FUNC(on_size_orig_w_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(size_orig_h), "toggled", + GTK_SIGNAL_FUNC(on_size_orig_h_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(fill_w), "changed", + GTK_SIGNAL_FUNC(on_fill_w_changed), NULL); + gtk_signal_connect(GTK_OBJECT(fill_h), "changed", + GTK_SIGNAL_FUNC(on_fill_h_changed), NULL); + gtk_signal_connect(GTK_OBJECT(fill_orig_w), "toggled", + GTK_SIGNAL_FUNC(on_fill_orig_w_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(fill_orig_h), "toggled", + GTK_SIGNAL_FUNC(on_fill_orig_h_toggled), NULL); + gtk_signal_connect(GTK_OBJECT(color_box), "expose_event", + GTK_SIGNAL_FUNC(on_color_box_expose_event), NULL); + gtk_signal_connect(GTK_OBJECT(color_box), "button_press_event", + GTK_SIGNAL_FUNC(on_color_box_button_release_event), + NULL); + gtk_signal_connect(GTK_OBJECT(gradient_one_color_box), "expose_event", + GTK_SIGNAL_FUNC(on_gradient_one_expose_event), NULL); + gtk_signal_connect(GTK_OBJECT(gradient_one_color_box), + "button_press_event", + GTK_SIGNAL_FUNC(on_gradient_one_button_release_event), + NULL); + gtk_signal_connect(GTK_OBJECT(gradient_two_color_box), + "button_press_event", + GTK_SIGNAL_FUNC(on_gradient_two_button_release_event), + NULL); + gtk_signal_connect(GTK_OBJECT(gradient_two_color_box), "expose_event", + GTK_SIGNAL_FUNC(on_gradient_two_expose_event), NULL); + gtk_signal_connect(GTK_OBJECT(gradient_angle), "changed", + GTK_SIGNAL_FUNC(on_gradient_angle_changed), NULL); + gtk_signal_connect(GTK_OBJECT(scale_preview), "toggled", + GTK_SIGNAL_FUNC(on_scale_preview_toggled), NULL); gtk_signal_connect(GTK_OBJECT(radiobutton1), "toggled", GTK_SIGNAL_FUNC(on_export_size_toggled), (gpointer) 0); gtk_signal_connect(GTK_OBJECT(radiobutton2), "toggled", @@ -1796,9 +1543,98 @@ gtk_signal_connect(GTK_OBJECT(export_xinerama_h), "changed", GTK_SIGNAL_FUNC(on_export_xinerama_h_changed), NULL); gtk_signal_connect(GTK_OBJECT(export_next_button), "clicked", - GTK_SIGNAL_FUNC(on_export_next_button_clicked), NULL); - gtk_signal_connect(GTK_OBJECT(export_cancel_button), "clicked", - GTK_SIGNAL_FUNC(on_export_cancel_button_clicked), NULL); + GTK_SIGNAL_FUNC(on_export_button_clicked), NULL); + + gtk_window_add_accel_group(GTK_WINDOW(main_win), accel_group); + + return main_win; +} + +GtkWidget * +create_win_bg(void) +{ + GtkWidget *win_bg; + GtkWidget *vbox13; + GtkWidget *hbox15; + GtkWidget *evas; + GtkWidget *yscale; + GtkWidget *xscale; + GtkWidget *_ebony_statusbar; + + win_bg = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name(win_bg, "win_bg"); + gtk_object_set_data(GTK_OBJECT(win_bg), "win_bg", win_bg); + gtk_widget_set_uposition(win_bg, 30, -2); + gtk_window_set_title(GTK_WINDOW(win_bg), _("Filename: ")); + gtk_window_set_default_size(GTK_WINDOW(win_bg), 400, 250); + gtk_window_set_policy(GTK_WINDOW(win_bg), TRUE, TRUE, FALSE); + gtk_window_set_wmclass(GTK_WINDOW(win_bg), "Ebony", "Background"); + + vbox13 = gtk_vbox_new(FALSE, 0); + gtk_widget_set_name(vbox13, "vbox13"); + gtk_widget_ref(vbox13); + gtk_object_set_data_full(GTK_OBJECT(win_bg), "vbox13", vbox13, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(vbox13); + gtk_container_add(GTK_CONTAINER(win_bg), vbox13); + gtk_container_set_border_width(GTK_CONTAINER(vbox13), 2); + + hbox15 = gtk_hbox_new(FALSE, 0); + gtk_widget_set_name(hbox15, "hbox15"); + gtk_widget_ref(hbox15); + gtk_object_set_data_full(GTK_OBJECT(win_bg), "hbox15", hbox15, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(hbox15); + gtk_box_pack_start(GTK_BOX(vbox13), hbox15, TRUE, TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(hbox15), 1); + + evas = gtk_drawing_area_new(); + gtk_widget_set_name(evas, "evas"); + gtk_widget_ref(evas); + gtk_object_set_data_full(GTK_OBJECT(win_bg), "evas", evas, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(evas); + gtk_box_pack_start(GTK_BOX(hbox15), evas, TRUE, TRUE, 2); + gtk_widget_set_usize(evas, 200, 200); + gtk_widget_set_events(evas, GDK_EXPOSURE_MASK); + + yscale = + gtk_vscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 1024, 0, 0, 0))); + gtk_widget_set_name(yscale, "yscale"); + gtk_widget_ref(yscale); + gtk_object_set_data_full(GTK_OBJECT(win_bg), "yscale", yscale, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(yscale); + gtk_box_pack_start(GTK_BOX(hbox15), yscale, FALSE, FALSE, 0); - return export_win; + xscale = + gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 1024, 0, 0, 0))); + gtk_widget_set_name(xscale, "xscale"); + gtk_widget_ref(xscale); + gtk_object_set_data_full(GTK_OBJECT(win_bg), "xscale", xscale, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(xscale); + gtk_box_pack_start(GTK_BOX(vbox13), xscale, FALSE, FALSE, 0); + + _ebony_statusbar = gtk_statusbar_new(); + gtk_widget_set_name(_ebony_statusbar, "_ebony_statusbar"); + gtk_widget_ref(_ebony_statusbar); + gtk_object_set_data_full(GTK_OBJECT(win_bg), "_ebony_statusbar", + _ebony_statusbar, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(_ebony_statusbar); + gtk_box_pack_start(GTK_BOX(vbox13), _ebony_statusbar, FALSE, FALSE, 0); + + gtk_signal_connect(GTK_OBJECT(win_bg), "delete_event", + GTK_SIGNAL_FUNC(on_win_bg_delete_event), NULL); + gtk_signal_connect(GTK_OBJECT(win_bg), "key_press_event", + GTK_SIGNAL_FUNC(on_win_bg_button_press_event), NULL); + gtk_signal_connect(GTK_OBJECT(evas), "configure_event", + GTK_SIGNAL_FUNC(on_bg_evas_configure_event), NULL); + gtk_signal_connect(GTK_OBJECT(evas), "drag_data_received", + GTK_SIGNAL_FUNC(on_bg_evas_drag_data_received), NULL); + gtk_signal_connect(GTK_OBJECT(evas), "expose_event", + GTK_SIGNAL_FUNC(on_evas_expose_event), NULL); + + return win_bg; } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/interface.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- interface.h 2 Jun 2002 21:40:07 -0000 1.8 +++ interface.h 9 Jun 2002 12:33:50 -0000 1.9 @@ -4,4 +4,3 @@ GtkWidget *create_main_win(void); GtkWidget *create_win_bg(void); -GtkWidget *create_export_win(void); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- main.c 2 Jun 2002 21:40:07 -0000 1.13 +++ main.c 9 Jun 2002 12:33:50 -0000 1.14 @@ -30,13 +30,15 @@ win_ref = NULL; ebony_status = NULL; bg_ref = NULL; - export_ref = NULL; recent_bgs = NULL; evas = NULL; bg = NULL; + ebony_base_bg = NULL; bl = NULL; idle = 0; + export_info.screen.w = export_info.screen.h = 0; + export_info.xinerama.h = export_info.xinerama.v = 1; snprintf(image_fileselection_dir, PATH_MAX, "%s", getenv("HOME")); snprintf(bg_fileselection_dir, PATH_MAX, "%s"... [truncated message content] |