X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fdemo-Gtk-widgets.c;h=176eaf68da79b9158507f652a0b55329fb9e8311;hb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;hp=65a9d9ba649af61630b5fab0f0673a61815b96a1;hpb=3f9592851ce4ed76a9979bfdd6ec7dc5c457e183;p=xscreensaver diff --git a/driver/demo-Gtk-widgets.c b/driver/demo-Gtk-widgets.c index 65a9d9ba..176eaf68 100644 --- a/driver/demo-Gtk-widgets.c +++ b/driver/demo-Gtk-widgets.c @@ -18,6 +18,12 @@ #include "demo-Gtk-widgets.h" #include "demo-Gtk-support.h" +# ifdef __GNUC__ +# define STFU __extension__ /* ignore gcc -pendantic warnings in next sexp */ +# else +# define STFU /* */ +# endif + GtkWidget* create_xscreensaver_demo (void) { @@ -480,7 +486,7 @@ create_xscreensaver_demo (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (demo); gtk_container_add (GTK_CONTAINER (demo_manual_hbbox), demo); - GTK_WIDGET_SET_FLAGS (demo, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (demo, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, demo, _("Demo the selected screen saver in full-screen mode (click the mouse to return.)"), NULL); settings = gtk_button_new_with_label (_("Settings...")); @@ -490,7 +496,7 @@ create_xscreensaver_demo (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (settings); gtk_container_add (GTK_CONTAINER (demo_manual_hbbox), settings); - GTK_WIDGET_SET_FLAGS (settings, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (settings, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, settings, _("Customization and explanation of the selected screen saver."), NULL); list_vbox = gtk_vbox_new (FALSE, 0); @@ -642,7 +648,7 @@ create_xscreensaver_demo (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (next); gtk_box_pack_start (GTK_BOX (next_prev_hbox), next, FALSE, FALSE, 0); - GTK_WIDGET_SET_FLAGS (next, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (next, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, next, _("Run the next screen saver in the list in full-screen mode (click the mouse to return.)"), NULL); prev = gtk_button_new_with_label (_("/\\")); @@ -652,7 +658,7 @@ create_xscreensaver_demo (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (prev); gtk_box_pack_start (GTK_BOX (next_prev_hbox), prev, FALSE, FALSE, 0); - GTK_WIDGET_SET_FLAGS (prev, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (prev, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, prev, _("Run the previous screen saver in the list in full-screen mode (click the mouse to return.)"), NULL); preview_frame = gtk_frame_new (_("Description")); @@ -718,7 +724,7 @@ create_xscreensaver_demo (void) gtk_container_add (GTK_CONTAINER (diag_frame), diag_hbox); gtk_container_set_border_width (GTK_CONTAINER (diag_hbox), 8); - diag_logo = create_pixmap (xscreensaver_demo, "screensaver-diagnostic.xpm"); + diag_logo = create_pixmap (xscreensaver_demo, "screensaver-diagnostic.png"); gtk_widget_set_name (diag_logo, "diag_logo"); gtk_widget_ref (diag_logo); gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "diag_logo", diag_logo, @@ -807,7 +813,7 @@ create_xscreensaver_demo (void) gtk_container_add (GTK_CONTAINER (cmap_frame), cmap_hbox); gtk_container_set_border_width (GTK_CONTAINER (cmap_hbox), 8); - cmap_logo = create_pixmap (xscreensaver_demo, "screensaver-colorselector.xpm"); + cmap_logo = create_pixmap (xscreensaver_demo, "screensaver-colorselector.png"); gtk_widget_set_name (cmap_logo, "cmap_logo"); gtk_widget_ref (cmap_logo); gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "cmap_logo", cmap_logo, @@ -953,7 +959,7 @@ create_xscreensaver_demo (void) gtk_container_add (GTK_CONTAINER (dpms_frame), dpms_hbox); gtk_container_set_border_width (GTK_CONTAINER (dpms_hbox), 8); - dpms_logo = create_pixmap (xscreensaver_demo, "screensaver-power.xpm"); + dpms_logo = create_pixmap (xscreensaver_demo, "screensaver-power.png"); gtk_widget_set_name (dpms_logo, "dpms_logo"); gtk_widget_ref (dpms_logo); gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "dpms_logo", dpms_logo, @@ -1134,7 +1140,7 @@ create_xscreensaver_demo (void) gtk_container_add (GTK_CONTAINER (grab_frame), grab_hbox); gtk_container_set_border_width (GTK_CONTAINER (grab_hbox), 8); - img_logo = create_pixmap (xscreensaver_demo, "screensaver-snap.xpm"); + img_logo = create_pixmap (xscreensaver_demo, "screensaver-snap.png"); gtk_widget_set_name (img_logo, "img_logo"); gtk_widget_ref (img_logo); gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "img_logo", img_logo, @@ -1425,6 +1431,7 @@ create_xscreensaver_settings_dialog (void) GtkWidget *dialog_hbuttonbox; GtkWidget *adv_button; GtkWidget *std_button; + GtkWidget *reset_button; GtkWidget *ok_cancel_hbuttonbox; GtkWidget *ok_button; GtkWidget *cancel_button; @@ -1502,7 +1509,7 @@ create_xscreensaver_settings_dialog (void) gtk_widget_show (opt_table); gtk_container_add (GTK_CONTAINER (opt_notebook), opt_table); - cmd_logo = create_pixmap (xscreensaver_settings_dialog, "screensaver-cmndln.xpm"); + cmd_logo = create_pixmap (xscreensaver_settings_dialog, "screensaver-cmndln.png"); gtk_widget_set_name (cmd_logo, "cmd_logo"); gtk_widget_ref (cmd_logo); gtk_object_set_data_full (GTK_OBJECT (xscreensaver_settings_dialog), "cmd_logo", cmd_logo, @@ -1645,7 +1652,7 @@ create_xscreensaver_settings_dialog (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (manual); gtk_container_add (GTK_CONTAINER (doc_hbuttonbox), manual); - GTK_WIDGET_SET_FLAGS (manual, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (manual, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, manual, _("Click here to read the manual for this display mode, if it has one."), NULL); dialog_action_area = GTK_DIALOG (xscreensaver_settings_dialog)->action_area; @@ -1678,7 +1685,7 @@ create_xscreensaver_settings_dialog (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (adv_button); gtk_container_add (GTK_CONTAINER (dialog_hbuttonbox), adv_button); - GTK_WIDGET_SET_FLAGS (adv_button, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (adv_button, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, adv_button, _("Edit the command line directly."), NULL); std_button = gtk_button_new_with_label (_("Standard <<")); @@ -1688,9 +1695,19 @@ create_xscreensaver_settings_dialog (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (std_button); gtk_container_add (GTK_CONTAINER (dialog_hbuttonbox), std_button); - GTK_WIDGET_SET_FLAGS (std_button, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (std_button, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, std_button, _("Back to the graphical configuration options."), NULL); + reset_button = gtk_button_new_with_label (_("Reset to Defaults")); + gtk_widget_set_name (reset_button, "reset_button"); + gtk_widget_ref (reset_button); + gtk_object_set_data_full (GTK_OBJECT (xscreensaver_settings_dialog), "reset_button", reset_button, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (reset_button); + gtk_container_add (GTK_CONTAINER (dialog_hbuttonbox), reset_button); + STFU GTK_WIDGET_SET_FLAGS (reset_button, GTK_CAN_DEFAULT); + gtk_tooltips_set_tip (tooltips, reset_button, _("Reset this screen saver to the default settings."), NULL); + ok_cancel_hbuttonbox = gtk_hbutton_box_new (); gtk_widget_set_name (ok_cancel_hbuttonbox, "ok_cancel_hbuttonbox"); gtk_widget_ref (ok_cancel_hbuttonbox); @@ -1707,7 +1724,7 @@ create_xscreensaver_settings_dialog (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (ok_button); gtk_container_add (GTK_CONTAINER (ok_cancel_hbuttonbox), ok_button); - GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); cancel_button = gtk_button_new_with_label (_("Cancel")); gtk_widget_set_name (cancel_button, "cancel_button"); @@ -1716,7 +1733,7 @@ create_xscreensaver_settings_dialog (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cancel_button); gtk_container_add (GTK_CONTAINER (ok_cancel_hbuttonbox), cancel_button); - GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + STFU GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); gtk_signal_connect (GTK_OBJECT (opt_notebook), "switch_page", GTK_SIGNAL_FUNC (settings_switch_page_cb), @@ -1730,6 +1747,9 @@ create_xscreensaver_settings_dialog (void) gtk_signal_connect (GTK_OBJECT (std_button), "clicked", GTK_SIGNAL_FUNC (settings_std_cb), NULL); + gtk_signal_connect (GTK_OBJECT (reset_button), "clicked", + GTK_SIGNAL_FUNC (settings_reset_cb), + NULL); gtk_signal_connect (GTK_OBJECT (ok_button), "clicked", GTK_SIGNAL_FUNC (settings_ok_cb), NULL);