diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-application.c | 10 | ||||
-rw-r--r-- | src/eom-clipboard-handler.c | 9 | ||||
-rw-r--r-- | src/eom-close-confirmation-dialog.c | 11 | ||||
-rw-r--r-- | src/eom-dialog.c | 11 | ||||
-rw-r--r-- | src/eom-exif-details.c | 11 | ||||
-rw-r--r-- | src/eom-file-chooser.c | 10 | ||||
-rw-r--r-- | src/eom-image.c | 9 | ||||
-rw-r--r-- | src/eom-list-store.c | 8 |
8 files changed, 19 insertions, 60 deletions
diff --git a/src/eom-application.c b/src/eom-application.c index 9830bd2..f49d37c 100644 --- a/src/eom-application.c +++ b/src/eom-application.c @@ -46,10 +46,7 @@ static void eom_application_load_accelerators (void); static void eom_application_save_accelerators (void); -#define EOM_APPLICATION_GET_PRIVATE(object) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_APPLICATION, EomApplicationPrivate)) - -G_DEFINE_TYPE (EomApplication, eom_application, GTK_TYPE_APPLICATION); +G_DEFINE_TYPE_WITH_PRIVATE (EomApplication, eom_application, GTK_TYPE_APPLICATION); static void eom_application_activate (GApplication *application) @@ -141,9 +138,6 @@ eom_application_class_init (EomApplicationClass *eom_application_class) GApplicationClass *application_class; GObjectClass *object_class; - g_type_class_add_private (eom_application_class, - sizeof (EomApplicationPrivate)); - application_class = (GApplicationClass *) eom_application_class; object_class = (GObjectClass *) eom_application_class; @@ -181,7 +175,7 @@ eom_application_init (EomApplication *eom_application) eom_session_init (eom_application); - eom_application->priv = EOM_APPLICATION_GET_PRIVATE (eom_application); + eom_application->priv = eom_application_get_instance_private (eom_application); priv = eom_application->priv; priv->toolbars_model = egg_toolbars_model_new (); diff --git a/src/eom-clipboard-handler.c b/src/eom-clipboard-handler.c index 6d7cd4f..a15e733 100644 --- a/src/eom-clipboard-handler.c +++ b/src/eom-clipboard-handler.c @@ -47,10 +47,7 @@ struct _EomClipboardHandlerPrivate { gchar *uri; }; -#define EOM_CLIPBOARD_HANDLER_GET_PRIVATE(object) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_CLIPBOARD_HANDLER, EomClipboardHandlerPrivate)) - -G_DEFINE_TYPE(EomClipboardHandler, eom_clipboard_handler, G_TYPE_INITIALLY_UNOWNED) +G_DEFINE_TYPE_WITH_PRIVATE (EomClipboardHandler, eom_clipboard_handler, G_TYPE_INITIALLY_UNOWNED) static GdkPixbuf* eom_clipboard_handler_get_pixbuf (EomClipboardHandler *handler) @@ -178,7 +175,7 @@ eom_clipboard_handler_dispose (GObject *obj) static void eom_clipboard_handler_init (EomClipboardHandler *handler) { - handler->priv = EOM_CLIPBOARD_HANDLER_GET_PRIVATE (handler); + handler->priv = eom_clipboard_handler_get_instance_private (handler); } static void @@ -186,8 +183,6 @@ eom_clipboard_handler_class_init (EomClipboardHandlerClass *klass) { GObjectClass *g_obj_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (EomClipboardHandlerPrivate)); - g_obj_class->get_property = eom_clipboard_handler_get_property; g_obj_class->set_property = eom_clipboard_handler_set_property; g_obj_class->dispose = eom_clipboard_handler_dispose; diff --git a/src/eom-close-confirmation-dialog.c b/src/eom-close-confirmation-dialog.c index bd17faf..0192124 100644 --- a/src/eom-close-confirmation-dialog.c +++ b/src/eom-close-confirmation-dialog.c @@ -67,18 +67,13 @@ struct _EomCloseConfirmationDialogPrivate GtkCellRenderer *toggle_renderer; }; - -#define EOM_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - EOM_TYPE_CLOSE_CONFIRMATION_DIALOG, \ - EomCloseConfirmationDialogPrivate)) - #define GET_MODE(priv) (((priv->unsaved_images != NULL) && \ (priv->unsaved_images->next == NULL)) ? \ SINGLE_IMG_MODE : MULTIPLE_IMGS_MODE) #define IMAGE_COLUMN_HEIGHT 40 -G_DEFINE_TYPE(EomCloseConfirmationDialog, eom_close_confirmation_dialog, GTK_TYPE_DIALOG) +G_DEFINE_TYPE_WITH_PRIVATE (EomCloseConfirmationDialog, eom_close_confirmation_dialog, GTK_TYPE_DIALOG) static void set_unsaved_image (EomCloseConfirmationDialog *dlg, const GList *list); @@ -175,7 +170,7 @@ eom_close_confirmation_dialog_init (EomCloseConfirmationDialog *dlg) { AtkObject *atk_obj; - dlg->priv = EOM_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE (dlg); + dlg->priv = eom_close_confirmation_dialog_get_instance_private (dlg); gtk_container_set_border_width (GTK_CONTAINER (dlg), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), 14); @@ -267,8 +262,6 @@ eom_close_confirmation_dialog_class_init (EomCloseConfirmationDialogClass *klass gobject_class->get_property = eom_close_confirmation_dialog_get_property; gobject_class->finalize = eom_close_confirmation_dialog_finalize; - g_type_class_add_private (klass, sizeof (EomCloseConfirmationDialogPrivate)); - g_object_class_install_property (gobject_class, PROP_UNSAVED_IMAGES, g_param_spec_pointer ("unsaved_images", diff --git a/src/eom-dialog.c b/src/eom-dialog.c index 935c7a1..c99ef99 100644 --- a/src/eom-dialog.c +++ b/src/eom-dialog.c @@ -29,11 +29,6 @@ #include <glib-object.h> #include <gtk/gtk.h> -#define EOM_DIALOG_GET_PRIVATE(object) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_DIALOG, EomDialogPrivate)) - -G_DEFINE_TYPE (EomDialog, eom_dialog, G_TYPE_OBJECT); - enum { PROP_0, PROP_PARENT_WINDOW, @@ -45,6 +40,8 @@ struct _EomDialogPrivate { 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, @@ -171,14 +168,12 @@ eom_dialog_class_init (EomDialogClass *class) G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - - g_type_class_add_private (g_object_class, sizeof (EomDialogPrivate)); } static void eom_dialog_init (EomDialog *dialog) { - dialog->priv = EOM_DIALOG_GET_PRIVATE (dialog); + dialog->priv = eom_dialog_get_instance_private (dialog); dialog->priv->dlg = NULL; dialog->priv->xml = NULL; diff --git a/src/eom-exif-details.c b/src/eom-exif-details.c index 0fdb0eb..2203a60 100644 --- a/src/eom-exif-details.c +++ b/src/eom-exif-details.c @@ -40,11 +40,6 @@ #include <string.h> -#define EOM_EXIF_DETAILS_GET_PRIVATE(object) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_EXIF_DETAILS, EomExifDetailsPrivate)) - -G_DEFINE_TYPE (EomExifDetails, eom_exif_details, GTK_TYPE_TREE_VIEW) - typedef enum { EXIF_CATEGORY_CAMERA, EXIF_CATEGORY_IMAGE_DATA, @@ -209,6 +204,8 @@ static char* set_row_data (GtkTreeStore *store, char *path, char *parent, const static void eom_exif_details_reset (EomExifDetails *exif_details); +G_DEFINE_TYPE_WITH_PRIVATE (EomExifDetails, eom_exif_details, GTK_TYPE_TREE_VIEW) + static void eom_exif_details_dispose (GObject *object) { @@ -240,7 +237,7 @@ eom_exif_details_init (EomExifDetails *exif_details) GtkTreeViewColumn *column; GtkCellRenderer *cell; - exif_details->priv = EOM_EXIF_DETAILS_GET_PRIVATE (exif_details); + exif_details->priv = eom_exif_details_get_instance_private (exif_details); priv = exif_details->priv; @@ -277,8 +274,6 @@ eom_exif_details_class_init (EomExifDetailsClass *klass) GObjectClass *object_class = (GObjectClass*) klass; object_class->dispose = eom_exif_details_dispose; - - g_type_class_add_private (object_class, sizeof (EomExifDetailsPrivate)); } #ifdef HAVE_EXIF diff --git a/src/eom-file-chooser.c b/src/eom-file-chooser.c index b7caf3c..009b45b 100644 --- a/src/eom-file-chooser.c +++ b/src/eom-file-chooser.c @@ -41,10 +41,6 @@ static char *last_dir[] = { NULL, NULL, NULL, NULL }; #define FILE_FORMAT_KEY "file-format" -#define EOM_FILE_CHOOSER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ - EOM_TYPE_FILE_CHOOSER, \ - EomFileChooserPrivate)) - struct _EomFileChooserPrivate { MateDesktopThumbnailFactory *thumb_factory; @@ -55,7 +51,7 @@ struct _EomFileChooserPrivate GtkWidget *creator_label; }; -G_DEFINE_TYPE(EomFileChooser, eom_file_chooser, GTK_TYPE_FILE_CHOOSER_DIALOG) +G_DEFINE_TYPE_WITH_PRIVATE (EomFileChooser, eom_file_chooser, GTK_TYPE_FILE_CHOOSER_DIALOG) static void eom_file_chooser_finalize (GObject *object) @@ -76,14 +72,12 @@ eom_file_chooser_class_init (EomFileChooserClass *klass) GObjectClass *object_class = (GObjectClass *) klass; object_class->finalize = eom_file_chooser_finalize; - - g_type_class_add_private (object_class, sizeof (EomFileChooserPrivate)); } static void eom_file_chooser_init (EomFileChooser *chooser) { - chooser->priv = EOM_FILE_CHOOSER_GET_PRIVATE (chooser); + chooser->priv = eom_file_chooser_get_instance_private (chooser); } static void diff --git a/src/eom-image.c b/src/eom-image.c index ab91ef1..5cd4839 100644 --- a/src/eom-image.c +++ b/src/eom-image.c @@ -69,10 +69,7 @@ #include <librsvg/rsvg.h> #endif -#define EOM_IMAGE_GET_PRIVATE(object) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_IMAGE, EomImagePrivate)) - -G_DEFINE_TYPE (EomImage, eom_image, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_PRIVATE (EomImage, eom_image, G_TYPE_OBJECT) enum { SIGNAL_CHANGED, @@ -277,14 +274,12 @@ eom_image_class_init (EomImageClass *klass) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - - g_type_class_add_private (object_class, sizeof (EomImagePrivate)); } static void eom_image_init (EomImage *img) { - img->priv = EOM_IMAGE_GET_PRIVATE (img); + img->priv = eom_image_get_instance_private (img); img->priv->file = NULL; img->priv->image = NULL; diff --git a/src/eom-list-store.c b/src/eom-list-store.c index 51df69d..4153bbc 100644 --- a/src/eom-list-store.c +++ b/src/eom-list-store.c @@ -32,8 +32,6 @@ #define EOM_LIST_STORE_GET_PRIVATE(object) \ (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_LIST_STORE, EomListStorePrivate)) -G_DEFINE_TYPE (EomListStore, eom_list_store, GTK_TYPE_LIST_STORE); - struct _EomListStorePrivate { GList *monitors; /* Monitors for the directories */ gint initial_image; /* The image that should be selected firstly by the view. */ @@ -42,6 +40,8 @@ struct _EomListStorePrivate { GMutex mutex; /* Mutex for saving the jobs in the model */ }; +G_DEFINE_TYPE_WITH_PRIVATE (EomListStore, eom_list_store, GTK_TYPE_LIST_STORE); + static void foreach_monitors_free (gpointer data, gpointer user_data) { @@ -81,8 +81,6 @@ eom_list_store_class_init (EomListStoreClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->dispose = eom_list_store_dispose; - - g_type_class_add_private (object_class, sizeof (EomListStorePrivate)); } /* @@ -152,7 +150,7 @@ eom_list_store_init (EomListStore *self) gtk_list_store_set_column_types (GTK_LIST_STORE (self), EOM_LIST_STORE_NUM_COLUMNS, types); - self->priv = EOM_LIST_STORE_GET_PRIVATE (self); + self->priv = eom_list_store_get_instance_private (self); self->priv->monitors = NULL; self->priv->initial_image = -1; |