From c2fc00295668a545f2f69d281e100cafd88c2098 Mon Sep 17 00:00:00 2001 From: Felix Riemann Date: Sat, 3 May 2014 20:27:10 +0200 Subject: Remove EomDialog helper class EomDialog has become obsolete with the switch to GtkBuilder templates. origin commits: https://gitlab.gnome.org/GNOME/eog/commit/9a60071 --- src/Makefile.am | 2 - src/eom-dialog.c | 232 --------------------------------------------- src/eom-dialog.h | 75 --------------- src/eom-metadata-sidebar.c | 1 - src/eom-window.h | 1 - 5 files changed, 311 deletions(-) delete mode 100644 src/eom-dialog.c delete mode 100644 src/eom-dialog.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 13f890a..57313f8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -44,7 +44,6 @@ INST_H_FILES = \ eom-window.h \ eom-window-activatable.h \ eom-sidebar.h \ - eom-dialog.h \ eom-properties-dialog.h \ eom-error-message-area.h \ eom-file-chooser.h \ @@ -72,7 +71,6 @@ libeom_c_files = \ eom-window.c \ eom-window-activatable.c \ eom-sidebar.c \ - eom-dialog.c \ eom-preferences-dialog.c \ eom-properties-dialog.c \ eom-error-message-area.c \ diff --git a/src/eom-dialog.c b/src/eom-dialog.c deleted file mode 100644 index c99ef99..0000000 --- a/src/eom-dialog.c +++ /dev/null @@ -1,232 +0,0 @@ -/* Eye Of Mate - Image Dialog - * - * Copyright (C) 2006 The Free Software Foundation - * - * Author: Lucas Rocha - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "eom-dialog.h" - -#include -#include -#include - -enum { - PROP_0, - PROP_PARENT_WINDOW, -}; - -struct _EomDialogPrivate { - GtkWidget *dlg; - GtkBuilder *xml; - GtkWindow *parent; -}; - -G_DEFINE_TYPE_WITH_PRIVATE (EomDialog, eom_dialog, G_TYPE_OBJECT); - -static void -eom_dialog_construct_impl (EomDialog *dialog, - const gchar *ui_file, - const gchar *dlg_node) -{ - EomDialogPrivate *priv; - gchar *filename; - - g_return_if_fail (dialog != NULL); - g_return_if_fail (EOM_IS_DIALOG (dialog)); - - priv = dialog->priv; - - filename = g_build_filename (EOM_DATA_DIR, ui_file, NULL); - - priv->xml = gtk_builder_new (); - gtk_builder_set_translation_domain (priv->xml, GETTEXT_PACKAGE); - g_assert (gtk_builder_add_from_file (priv->xml, filename, NULL)); - - g_free (filename); - - priv->dlg = GTK_WIDGET (gtk_builder_get_object (priv->xml, dlg_node)); - - if (priv->parent != NULL) { - gtk_window_set_transient_for (GTK_WINDOW (priv->dlg), - priv->parent); - } -} - -static void -eom_dialog_show_impl (EomDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (EOM_IS_DIALOG (dialog)); - - gtk_window_present (GTK_WINDOW (dialog->priv->dlg)); -} - -static void -eom_dialog_hide_impl (EomDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (EOM_IS_DIALOG (dialog)); - - gtk_widget_hide (dialog->priv->dlg); -} - -static void -eom_dialog_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - EomDialog *dialog = EOM_DIALOG (object); - - switch (prop_id) { - case PROP_PARENT_WINDOW: - dialog->priv->parent = g_value_get_object (value); - break; - } -} - -static void -eom_dialog_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - EomDialog *dialog = EOM_DIALOG (object); - - switch (prop_id) { - case PROP_PARENT_WINDOW: - g_value_set_object (value, dialog->priv->parent); - break; - } -} - -static void -eom_dialog_dispose (GObject *object) -{ - EomDialog *dialog; - EomDialogPrivate *priv; - - g_return_if_fail (object != NULL); - g_return_if_fail (EOM_IS_DIALOG (object)); - - dialog = EOM_DIALOG (object); - priv = dialog->priv; - - if (priv->dlg) { - gtk_widget_destroy (priv->dlg); - priv->dlg = NULL; - } - - if (priv->xml) { - g_object_unref (priv->xml); - priv->xml = NULL; - } - - G_OBJECT_CLASS (eom_dialog_parent_class)->dispose (object); -} - -static void -eom_dialog_class_init (EomDialogClass *class) -{ - GObjectClass *g_object_class = (GObjectClass *) class; - - g_object_class->dispose = eom_dialog_dispose; - g_object_class->set_property = eom_dialog_set_property; - g_object_class->get_property = eom_dialog_get_property; - - class->construct = eom_dialog_construct_impl; - class->show = eom_dialog_show_impl; - class->hide = eom_dialog_hide_impl; - - g_object_class_install_property (g_object_class, - PROP_PARENT_WINDOW, - g_param_spec_object ("parent-window", - "Parent window", - "Parent window", - GTK_TYPE_WINDOW, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); -} - -static void -eom_dialog_init (EomDialog *dialog) -{ - dialog->priv = eom_dialog_get_instance_private (dialog); - - dialog->priv->dlg = NULL; - dialog->priv->xml = NULL; - dialog->priv->parent = NULL; -} - -void -eom_dialog_construct (EomDialog *dialog, - const gchar *ui_file, - const gchar *dlg_node) -{ - EomDialogClass *klass = EOM_DIALOG_GET_CLASS (dialog); - klass->construct (dialog, ui_file, dlg_node); -} - -void -eom_dialog_show (EomDialog *dialog) -{ - EomDialogClass *klass = EOM_DIALOG_GET_CLASS (dialog); - klass->show (dialog); -} - -void -eom_dialog_hide (EomDialog *dialog) -{ - EomDialogClass *klass = EOM_DIALOG_GET_CLASS (dialog); - klass->hide (dialog); -} - -void -eom_dialog_get_controls (EomDialog *dialog, - const gchar *property_id, - ...) -{ - EomDialogPrivate *priv; - GtkWidget **wptr; - va_list varargs; - - g_return_if_fail (dialog != NULL); - g_return_if_fail (EOM_IS_DIALOG (dialog)); - - priv = dialog->priv; - - va_start (varargs, property_id); - - while (property_id != NULL) - { - wptr = va_arg (varargs, GtkWidget **); - *wptr = GTK_WIDGET (gtk_builder_get_object (priv->xml, - property_id)); - - property_id = va_arg (varargs, const gchar *); - } - - va_end (varargs); -} diff --git a/src/eom-dialog.h b/src/eom-dialog.h deleted file mode 100644 index d2b92ac..0000000 --- a/src/eom-dialog.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Eye Of Mate - EOM Dialog - * - * Copyright (C) 2006 The Free Software Foundation - * - * Author: Lucas Rocha - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __EOM_DIALOG_H__ -#define __EOM_DIALOG_H__ - -#include -#include - -G_BEGIN_DECLS - -typedef struct _EomDialog EomDialog; -typedef struct _EomDialogClass EomDialogClass; -typedef struct _EomDialogPrivate EomDialogPrivate; - -#define EOM_TYPE_DIALOG (eom_dialog_get_type ()) -#define EOM_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_DIALOG, EomDialog)) -#define EOM_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EOM_TYPE_DIALOG, EomDialogClass)) -#define EOM_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_DIALOG)) -#define EOM_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EOM_TYPE_DIALOG)) -#define EOM_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EOM_TYPE_DIALOG, EomDialogClass)) - -struct _EomDialog { - GObject object; - - EomDialogPrivate *priv; -}; - -struct _EomDialogClass { - GObjectClass parent_class; - - void (* construct) (EomDialog *dialog, - const gchar *ui_file, - const gchar *dlg_node); - - void (* show) (EomDialog *dialog); - - void (* hide) (EomDialog *dialog); -}; - -GType eom_dialog_get_type (void) G_GNUC_CONST; - -void eom_dialog_construct (EomDialog *dialog, - const gchar *ui_file, - const gchar *dlg_node); - -void eom_dialog_show (EomDialog *dialog); - -void eom_dialog_hide (EomDialog *dialog); - -void eom_dialog_get_controls (EomDialog *dialog, - const gchar *property_id, - ...); - -G_END_DECLS - -#endif /* __EOM_DIALOG_H__ */ diff --git a/src/eom-metadata-sidebar.c b/src/eom-metadata-sidebar.c index 9c13c03..c0bb0dc 100644 --- a/src/eom-metadata-sidebar.c +++ b/src/eom-metadata-sidebar.c @@ -32,7 +32,6 @@ #include #include -#include "eom-dialog.h" #include "eom-image.h" #include "eom-metadata-sidebar.h" #include "eom-properties-dialog.h" diff --git a/src/eom-window.h b/src/eom-window.h index c90d291..04e028b 100644 --- a/src/eom-window.h +++ b/src/eom-window.h @@ -30,7 +30,6 @@ #include "eom-list-store.h" #include "eom-image.h" -#include "eom-dialog.h" #include #include -- cgit v1.2.1