diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:43:08 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:43:08 +0200 |
commit | 2b3f22361da0c1d8e6ce70d71352821758186db7 (patch) | |
tree | 5d10633b47369b3aa52a05bf889ede0dbe5ee108 /src/dialogs/SetBackground.c | |
parent | 211da5fc3048ca2b6ccee2166b0aaaade55cb84f (diff) | |
parent | dc6c76eb04dfe3d4262a1806808f0bc0bf523238 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/dialogs/SetBackground.c')
-rw-r--r-- | src/dialogs/SetBackground.c | 274 |
1 files changed, 274 insertions, 0 deletions
diff --git a/src/dialogs/SetBackground.c b/src/dialogs/SetBackground.c new file mode 100644 index 0000000..3f4d45f --- /dev/null +++ b/src/dialogs/SetBackground.c @@ -0,0 +1,274 @@ +/* SetBackground.c generated by valac 0.36.6, the Vala compiler + * generated from SetBackground.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * Copyright 2017 Jens Georg <mail@jensge.org> + * + * This software is licensed under the GNU LGPL (version 2.1 or later). + * See the COPYING file in this distribution. + */ + +#include <glib.h> +#include <glib-object.h> +#include <gtk/gtk.h> + + +#define TYPE_SET_BACKGROUND_PHOTO_DIALOG (set_background_photo_dialog_get_type ()) +#define SET_BACKGROUND_PHOTO_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialog)) +#define SET_BACKGROUND_PHOTO_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialogClass)) +#define IS_SET_BACKGROUND_PHOTO_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_BACKGROUND_PHOTO_DIALOG)) +#define IS_SET_BACKGROUND_PHOTO_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_BACKGROUND_PHOTO_DIALOG)) +#define SET_BACKGROUND_PHOTO_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialogClass)) + +typedef struct _SetBackgroundPhotoDialog SetBackgroundPhotoDialog; +typedef struct _SetBackgroundPhotoDialogClass SetBackgroundPhotoDialogClass; +typedef struct _SetBackgroundPhotoDialogPrivate SetBackgroundPhotoDialogPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define TYPE_PAGE_WINDOW (page_window_get_type ()) +#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow)) +#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass)) +#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW)) +#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW)) +#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass)) + +typedef struct _PageWindow PageWindow; +typedef struct _PageWindowClass PageWindowClass; + +#define TYPE_APP_WINDOW (app_window_get_type ()) +#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow)) +#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass)) +#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW)) +#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW)) +#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass)) + +typedef struct _AppWindow AppWindow; +typedef struct _AppWindowClass AppWindowClass; + +struct _SetBackgroundPhotoDialog { + GtkDialog parent_instance; + SetBackgroundPhotoDialogPrivate * priv; +}; + +struct _SetBackgroundPhotoDialogClass { + GtkDialogClass parent_class; +}; + +struct _SetBackgroundPhotoDialogPrivate { + GtkCheckButton* desktop_background_checkbox; + GtkCheckButton* screensaver_checkbox; +}; + + +static gpointer set_background_photo_dialog_parent_class = NULL; + +GType set_background_photo_dialog_get_type (void) G_GNUC_CONST; +#define SET_BACKGROUND_PHOTO_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialogPrivate)) +enum { + SET_BACKGROUND_PHOTO_DIALOG_DUMMY_PROPERTY +}; +SetBackgroundPhotoDialog* set_background_photo_dialog_new (void); +SetBackgroundPhotoDialog* set_background_photo_dialog_construct (GType object_type); +gint resources_use_header_bar (void); +GType page_window_get_type (void) G_GNUC_CONST; +GType app_window_get_type (void) G_GNUC_CONST; +AppWindow* app_window_get_instance (void); +static void set_background_photo_dialog_on_checkbox_clicked (SetBackgroundPhotoDialog* self); +static void _set_background_photo_dialog_on_checkbox_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self); +gboolean set_background_photo_dialog_execute (SetBackgroundPhotoDialog* self, gboolean* desktop_background, gboolean* screensaver); +static void set_background_photo_dialog_finalize (GObject * obj); + + +SetBackgroundPhotoDialog* set_background_photo_dialog_construct (GType object_type) { + SetBackgroundPhotoDialog * self = NULL; + gint _tmp0_; + AppWindow* _tmp1_; + AppWindow* _tmp2_; +#line 16 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp0_ = resources_use_header_bar (); +#line 16 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + self = (SetBackgroundPhotoDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp1_ = app_window_get_instance (); +#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp2_ = _tmp1_; +#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_window_get_type (), GtkWindow)); +#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _g_object_unref0 (_tmp2_); +#line 15 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + return self; +#line 102 "SetBackground.c" +} + + +SetBackgroundPhotoDialog* set_background_photo_dialog_new (void) { +#line 15 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + return set_background_photo_dialog_construct (TYPE_SET_BACKGROUND_PHOTO_DIALOG); +#line 109 "SetBackground.c" +} + + +static void set_background_photo_dialog_on_checkbox_clicked (SetBackgroundPhotoDialog* self) { + gboolean _tmp0_ = FALSE; + GtkCheckButton* _tmp1_; + gboolean _tmp2_; + gboolean _tmp3_; +#line 21 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + g_return_if_fail (IS_SET_BACKGROUND_PHOTO_DIALOG (self)); +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp1_ = self->priv->desktop_background_checkbox; +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp2_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp3_ = _tmp2_; +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + if (_tmp3_) { +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp0_ = TRUE; +#line 130 "SetBackground.c" + } else { + GtkCheckButton* _tmp4_; + gboolean _tmp5_; + gboolean _tmp6_; +#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp4_ = self->priv->screensaver_checkbox; +#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp5_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp6_ = _tmp5_; +#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp0_ = _tmp6_; +#line 143 "SetBackground.c" + } +#line 22 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_dialog_set_response_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK, _tmp0_); +#line 147 "SetBackground.c" +} + + +static void _set_background_photo_dialog_on_checkbox_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) { +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + set_background_photo_dialog_on_checkbox_clicked ((SetBackgroundPhotoDialog*) self); +#line 154 "SetBackground.c" +} + + +gboolean set_background_photo_dialog_execute (SetBackgroundPhotoDialog* self, gboolean* desktop_background, gboolean* screensaver) { + gboolean _vala_desktop_background = FALSE; + gboolean _vala_screensaver = FALSE; + gboolean result = FALSE; + gboolean _result_ = FALSE; + gint _tmp0_; + GtkCheckButton* _tmp1_; + gboolean _tmp2_; + gboolean _tmp3_; + GtkCheckButton* _tmp4_; + gboolean _tmp5_; + gboolean _tmp6_; +#line 27 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + g_return_val_if_fail (IS_SET_BACKGROUND_PHOTO_DIALOG (self), FALSE); +#line 28 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 29 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp0_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)); +#line 29 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _result_ = _tmp0_ == ((gint) GTK_RESPONSE_OK); +#line 30 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp1_ = self->priv->desktop_background_checkbox; +#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp2_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp3_ = _tmp2_; +#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _vala_desktop_background = _tmp3_; +#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp4_ = self->priv->screensaver_checkbox; +#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp5_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp6_ = _tmp5_; +#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _vala_screensaver = _tmp6_; +#line 35 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + result = _result_; +#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + if (desktop_background) { +#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + *desktop_background = _vala_desktop_background; +#line 204 "SetBackground.c" + } +#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + if (screensaver) { +#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + *screensaver = _vala_screensaver; +#line 210 "SetBackground.c" + } +#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + return result; +#line 214 "SetBackground.c" +} + + +static void set_background_photo_dialog_class_init (SetBackgroundPhotoDialogClass * klass) { + gint SetBackgroundPhotoDialog_private_offset; +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + set_background_photo_dialog_parent_class = g_type_class_peek_parent (klass); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + g_type_class_add_private (klass, sizeof (SetBackgroundPhotoDialogPrivate)); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + G_OBJECT_CLASS (klass)->finalize = set_background_photo_dialog_finalize; +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + SetBackgroundPhotoDialog_private_offset = g_type_class_get_instance_private_offset (klass); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/set_background_dialog.ui"); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "desktop_background_checkbox", FALSE, SetBackgroundPhotoDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundPhotoDialogPrivate, desktop_background_checkbox)); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "screensaver_checkbox", FALSE, SetBackgroundPhotoDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundPhotoDialogPrivate, screensaver_checkbox)); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_checkbox_clicked", G_CALLBACK(_set_background_photo_dialog_on_checkbox_clicked_gtk_toggle_button_toggled)); +#line 236 "SetBackground.c" +} + + +static void set_background_photo_dialog_instance_init (SetBackgroundPhotoDialog * self) { +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + self->priv = SET_BACKGROUND_PHOTO_DIALOG_GET_PRIVATE (self); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + gtk_widget_init_template (GTK_WIDGET (self)); +#line 245 "SetBackground.c" +} + + +static void set_background_photo_dialog_finalize (GObject * obj) { + SetBackgroundPhotoDialog * self; +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialog); +#line 11 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _g_object_unref0 (self->priv->desktop_background_checkbox); +#line 13 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _g_object_unref0 (self->priv->screensaver_checkbox); +#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + G_OBJECT_CLASS (set_background_photo_dialog_parent_class)->finalize (obj); +#line 259 "SetBackground.c" +} + + +GType set_background_photo_dialog_get_type (void) { + static volatile gsize set_background_photo_dialog_type_id__volatile = 0; + if (g_once_init_enter (&set_background_photo_dialog_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (SetBackgroundPhotoDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) set_background_photo_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SetBackgroundPhotoDialog), 0, (GInstanceInitFunc) set_background_photo_dialog_instance_init, NULL }; + GType set_background_photo_dialog_type_id; + set_background_photo_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "SetBackgroundPhotoDialog", &g_define_type_info, 0); + g_once_init_leave (&set_background_photo_dialog_type_id__volatile, set_background_photo_dialog_type_id); + } + return set_background_photo_dialog_type_id__volatile; +} + + + |