[gthumb] removed calls to g_type_class_add_private
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] removed calls to g_type_class_add_private
- Date: Thu, 10 Jan 2019 18:17:23 +0000 (UTC)
commit 0ae549f189e8cc37a899e2bd37753d9ca47b8f60
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Jan 1 08:08:38 2019 +0100
removed calls to g_type_class_add_private
It's deprecated.
extensions/burn_disc/gth-burn-task.c | 51 +++++++------
extensions/cairo_io/gth-image-saver-jpeg.c | 13 ++--
extensions/cairo_io/gth-image-saver-png.c | 13 ++--
extensions/cairo_io/gth-image-saver-tga.c | 13 ++--
extensions/cairo_io/gth-image-saver-tiff.c | 13 ++--
extensions/cairo_io/gth-image-saver-webp.c | 13 ++--
extensions/catalogs/gth-catalog.c | 35 +++++----
extensions/catalogs/gth-file-source-catalogs.c | 24 +++---
extensions/catalogs/gth-organize-task.c | 12 +--
extensions/change_date/gth-change-date-task.c | 9 ++-
extensions/comments/gth-comment.c | 10 +--
extensions/comments/gth-import-metadata-task.c | 9 ++-
.../contact_sheet/gth-contact-sheet-creator.c | 13 ++--
.../contact_sheet/gth-contact-sheet-theme-dialog.c | 13 ++--
.../edit_metadata/gth-delete-metadata-task.c | 9 ++-
extensions/edit_metadata/gth-edit-comment-dialog.c | 7 +-
extensions/edit_metadata/gth-edit-general-page.c | 7 +-
extensions/edit_metadata/gth-edit-tags-dialog.c | 7 +-
extensions/edit_metadata/gth-tag-task.c | 9 ++-
extensions/exiv2_tools/gth-edit-iptc-page.c | 20 ++---
.../exiv2_tools/gth-metadata-provider-exiv2.c | 9 ++-
.../facebook/facebook-album-properties-dialog.c | 9 ++-
extensions/facebook/facebook-service.c | 13 ++--
extensions/file_manager/gth-copy-task.c | 9 ++-
extensions/file_manager/gth-duplicate-task.c | 9 ++-
extensions/file_manager/gth-reorder-task.c | 9 ++-
extensions/file_tools/gth-curve-editor.c | 9 ++-
.../file_tools/gth-curve-preset-editor-dialog.c | 9 ++-
extensions/file_tools/gth-curve-preset.c | 9 ++-
.../file_tools/gth-file-tool-adjust-colors.c | 12 +--
.../file_tools/gth-file-tool-adjust-contrast.c | 13 ++--
extensions/file_tools/gth-file-tool-color-picker.c | 9 ++-
extensions/file_tools/gth-file-tool-crop.c | 13 ++--
extensions/file_tools/gth-file-tool-curves.c | 13 ++--
extensions/file_tools/gth-file-tool-effects.c | 13 ++--
extensions/file_tools/gth-file-tool-grayscale.c | 13 ++--
extensions/file_tools/gth-file-tool-resize.c | 13 ++--
extensions/file_tools/gth-file-tool-rotate.c | 13 ++--
extensions/file_tools/gth-file-tool-sharpen.c | 13 ++--
extensions/file_tools/gth-image-line-tool.c | 7 +-
extensions/file_tools/gth-image-rotator.c | 20 +++--
extensions/file_tools/gth-preview-tool.c | 20 +++--
extensions/file_viewer/gth-file-viewer-page.c | 9 +--
extensions/find_duplicates/gth-find-duplicates.c | 12 +--
.../find_duplicates/gth-folder-chooser-dialog.c | 13 ++--
extensions/flicker_utils/flickr-photo.c | 6 +-
extensions/flicker_utils/flickr-service.c | 13 ++--
extensions/gstreamer_tools/gth-media-viewer-page.c | 19 +++--
extensions/image_print/gth-image-print-job.c | 13 ++--
extensions/image_print/gth-load-image-info-task.c | 9 ++-
.../image_rotation/gth-reset-orientation-task.c | 13 ++--
extensions/image_rotation/gth-transform-task.c | 13 ++--
extensions/image_viewer/gth-image-histogram.c | 22 +++---
.../image_viewer/gth-image-viewer-page-tool.c | 13 ++--
extensions/image_viewer/gth-image-viewer-page.c | 19 +++--
extensions/image_viewer/gth-image-viewer-task.c | 9 ++-
.../importer/gth-import-destination-button.c | 13 ++--
.../importer/gth-import-preferences-dialog.c | 13 ++--
extensions/importer/gth-import-task.c | 13 ++--
extensions/list_tools/gth-script-editor-dialog.c | 26 ++++---
extensions/list_tools/gth-script-file.c | 9 ++-
extensions/list_tools/gth-script-task.c | 13 ++--
extensions/list_tools/gth-script.c | 23 +++---
extensions/map_view/gth-map-view.c | 23 +++---
extensions/oauth/oauth-account-chooser-dialog.c | 13 ++--
extensions/oauth/oauth-account-manager-dialog.c | 13 ++--
extensions/oauth/oauth-ask-authorization-dialog.c | 13 ++--
extensions/oauth/oauth-service.c | 13 ++--
extensions/oauth/web-service.c | 13 ++--
.../picasaweb/picasa-album-properties-dialog.c | 13 ++--
extensions/picasaweb/picasa-web-service.c | 13 ++--
extensions/red_eye_removal/gth-file-tool-red-eye.c | 9 ++-
extensions/rename_series/gth-rename-task.c | 13 ++--
.../rename_series/gth-template-editor-dialog.c | 22 +++---
extensions/rename_series/gth-template-selector.c | 18 ++---
extensions/search/gth-search-editor-dialog.c | 28 ++-----
extensions/search/gth-search-editor.c | 20 ++---
extensions/search/gth-search-task.c | 41 ++++++----
extensions/search/gth-search.c | 36 ++++-----
extensions/selections/gth-file-source-selections.c | 28 ++-----
extensions/selections/gth-selections-manager.c | 12 +--
extensions/slideshow/gth-slideshow-preferences.c | 13 ++--
extensions/slideshow/gth-slideshow.c | 13 ++--
extensions/slideshow/gth-transition.c | 13 ++--
extensions/webalbums/gth-web-exporter.c | 13 ++--
gthumb/dom.c | 12 +--
gthumb/gnome-desktop-thumbnail.c | 14 ++--
gthumb/gth-accel-button.c | 9 ++-
gthumb/gth-async-task.c | 9 ++-
gthumb/gth-auto-paned.c | 13 ++--
gthumb/gth-browser.c | 14 ++--
gthumb/gth-color-manager.c | 9 ++-
gthumb/gth-color-scale.c | 9 ++-
gthumb/gth-delete-task.c | 9 ++-
gthumb/gth-empty-list.c | 9 ++-
gthumb/gth-extensions.c | 25 ++++---
gthumb/gth-extensions.h | 2 -
gthumb/gth-file-chooser-dialog.c | 13 ++--
gthumb/gth-file-data.c | 7 +-
gthumb/gth-file-list.c | 56 ++++++++------
gthumb/gth-file-list.h | 4 +-
gthumb/gth-file-properties.c | 10 +--
gthumb/gth-file-source-vfs.c | 47 +++++++-----
gthumb/gth-file-source.c | 24 +++---
gthumb/gth-file-store.c | 14 ++--
gthumb/gth-file-tool.c | 9 ++-
gthumb/gth-filter-editor-dialog.c | 22 ++++--
gthumb/gth-filter-grid.c | 9 ++-
gthumb/gth-filter.c | 11 ++-
gthumb/gth-filterbar.c | 31 +++++---
gthumb/gth-folder-tree.c | 68 +++++++++--------
gthumb/gth-grid-view.c | 25 +++----
gthumb/gth-histogram-view.c | 9 ++-
gthumb/gth-histogram.c | 9 ++-
gthumb/gth-icc-profile.c | 19 +++--
gthumb/gth-image-dragger.c | 7 +-
gthumb/gth-image-history.c | 31 ++++----
gthumb/gth-image-list-task.c | 9 ++-
gthumb/gth-image-loader.c | 9 ++-
gthumb/gth-image-navigator.c | 14 ++--
gthumb/gth-image-overview.c | 4 +-
gthumb/gth-image-preloader.c | 10 +--
gthumb/gth-image-selector.c | 7 +-
gthumb/gth-image-task-chain.c | 9 ++-
gthumb/gth-image-task.c | 9 ++-
gthumb/gth-image-viewer.c | 17 ++---
gthumb/gth-image.c | 9 ++-
gthumb/gth-info-bar.c | 9 ++-
gthumb/gth-load-file-data-task.c | 9 ++-
gthumb/gth-location-bar.c | 4 +-
gthumb/gth-location-chooser.c | 16 ++--
gthumb/gth-main.c | 87 ++++++++++++----------
gthumb/gth-menu-manager.c | 9 ++-
gthumb/gth-metadata-chooser.c | 9 ++-
gthumb/gth-metadata.c | 9 ++-
gthumb/gth-monitor.c | 11 +--
gthumb/gth-monitor.h | 4 +-
gthumb/gth-multipage.c | 12 ++-
gthumb/gth-overwrite-dialog.c | 8 +-
gthumb/gth-paned.c | 13 ++--
gthumb/gth-progress-dialog.c | 9 ++-
gthumb/gth-request-dialog.c | 9 ++-
gthumb/gth-save-file-data-task.c | 9 ++-
gthumb/gth-save-image-task.c | 9 ++-
gthumb/gth-screensaver.c | 9 ++-
gthumb/gth-sidebar.c | 10 +--
gthumb/gth-source-tree.c | 21 +++---
gthumb/gth-statusbar.c | 9 ++-
gthumb/gth-string-list.c | 8 +-
gthumb/gth-tags-entry.c | 9 ++-
gthumb/gth-task.c | 17 +++--
gthumb/gth-test-aspect-ratio.c | 39 +++-------
gthumb/gth-test-category.c | 32 ++++----
gthumb/gth-test-chain.c | 25 +++----
gthumb/gth-test-selector.c | 22 ++++--
gthumb/gth-test-simple.c | 34 ++++++---
gthumb/gth-test.c | 25 +++----
gthumb/gth-thumb-loader.c | 31 +++++---
gthumb/gth-time-selector.c | 12 +--
gthumb/gth-toolbox.c | 10 ++-
gthumb/gth-trash-task.c | 9 ++-
gthumb/gth-uri-list.c | 27 ++-----
gthumb/gth-window-title.c | 11 +--
gthumb/gth-window.c | 13 ++--
164 files changed, 1318 insertions(+), 1190 deletions(-)
---
diff --git a/extensions/burn_disc/gth-burn-task.c b/extensions/burn_disc/gth-burn-task.c
index 1e7a603d..c4ec5638 100644
--- a/extensions/burn_disc/gth-burn-task.c
+++ b/extensions/burn_disc/gth-burn-task.c
@@ -33,8 +33,7 @@
#include "gth-burn-task.h"
-struct _GthBurnTaskPrivate
-{
+struct _GthBurnTaskPrivate {
GthBrowser *browser;
GFile *location;
GList *selected_files;
@@ -51,7 +50,10 @@ struct _GthBurnTaskPrivate
};
-G_DEFINE_TYPE (GthBurnTask, gth_burn_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthBurnTask,
+ gth_burn_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthBurnTask))
static void
@@ -70,23 +72,18 @@ gth_burn_task_finalize (GObject *object)
task = GTH_BURN_TASK (object);
- if (task->priv != NULL) {
- gtk_widget_destroy (task->priv->dialog);
- g_hash_table_foreach (task->priv->content, free_file_list_from_content, NULL);
- g_hash_table_unref (task->priv->content);
- g_hash_table_unref (task->priv->parents);
- g_free (task->priv->current_directory);
- _g_object_unref (task->priv->file_source);
- _g_object_unref (task->priv->test);
- _g_object_unref (task->priv->builder);
- _g_object_list_unref (task->priv->selected_files);
- g_free (task->priv->base_directory);
- g_object_unref (task->priv->location);
- g_object_unref (task->priv->browser);
-
- g_free (task->priv);
- task->priv = NULL;
- }
+ gtk_widget_destroy (task->priv->dialog);
+ g_hash_table_foreach (task->priv->content, free_file_list_from_content, NULL);
+ g_hash_table_unref (task->priv->content);
+ g_hash_table_unref (task->priv->parents);
+ g_free (task->priv->current_directory);
+ _g_object_unref (task->priv->file_source);
+ _g_object_unref (task->priv->test);
+ _g_object_unref (task->priv->builder);
+ _g_object_list_unref (task->priv->selected_files);
+ g_free (task->priv->base_directory);
+ g_object_unref (task->priv->location);
+ g_object_unref (task->priv->browser);
G_OBJECT_CLASS (gth_burn_task_parent_class)->finalize (object);
}
@@ -445,10 +442,20 @@ gth_burn_task_class_init (GthBurnTaskClass *class)
static void
gth_burn_task_init (GthBurnTask *task)
{
- task->priv = g_new0 (GthBurnTaskPrivate, 1);
+ task->priv = gth_burn_task_get_instance_private (task);
+ task->priv->browser = NULL;
+ task->priv->location = NULL;
+ task->priv->selected_files = NULL;
+ task->priv->dialog = NULL;
+ task->priv->builder = NULL;
+ task->priv->test = NULL;
+ task->priv->file_source = NULL;
+ task->priv->base_directory = NULL;
+ task->priv->current_directory = NULL;
task->priv->content = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
task->priv->parents = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)
gtk_tree_path_free);
- task->priv->builder = NULL;
+ task->priv->session = NULL;
+ task->priv->track = NULL;
}
diff --git a/extensions/cairo_io/gth-image-saver-jpeg.c b/extensions/cairo_io/gth-image-saver-jpeg.c
index 5258ca18..b59796c1 100644
--- a/extensions/cairo_io/gth-image-saver-jpeg.c
+++ b/extensions/cairo_io/gth-image-saver-jpeg.c
@@ -35,9 +35,6 @@
#include "preferences.h"
-G_DEFINE_TYPE (GthImageSaverJpeg, gth_image_saver_jpeg, GTH_TYPE_IMAGE_SAVER)
-
-
struct _GthImageSaverJpegPrivate {
GtkBuilder *builder;
GSettings *settings;
@@ -45,6 +42,12 @@ struct _GthImageSaverJpegPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImageSaverJpeg,
+ gth_image_saver_jpeg,
+ GTH_TYPE_IMAGE_SAVER,
+ G_ADD_PRIVATE (GthImageSaverJpeg))
+
+
static void
gth_image_saver_jpeg_finalize (GObject *object)
{
@@ -506,8 +509,6 @@ gth_image_saver_jpeg_class_init (GthImageSaverJpegClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
- g_type_class_add_private (klass, sizeof (GthImageSaverJpegPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_jpeg_finalize;
@@ -527,7 +528,7 @@ gth_image_saver_jpeg_class_init (GthImageSaverJpegClass *klass)
static void
gth_image_saver_jpeg_init (GthImageSaverJpeg *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_JPEG, GthImageSaverJpegPrivate);
+ self->priv = gth_image_saver_jpeg_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_JPEG_SCHEMA);
self->priv->builder = NULL;
self->priv->default_ext = NULL;
diff --git a/extensions/cairo_io/gth-image-saver-png.c b/extensions/cairo_io/gth-image-saver-png.c
index 21b438d6..df3292b5 100644
--- a/extensions/cairo_io/gth-image-saver-png.c
+++ b/extensions/cairo_io/gth-image-saver-png.c
@@ -42,15 +42,18 @@
#endif
-G_DEFINE_TYPE (GthImageSaverPng, gth_image_saver_png, GTH_TYPE_IMAGE_SAVER)
-
-
struct _GthImageSaverPngPrivate {
GtkBuilder *builder;
GSettings *settings;
};
+G_DEFINE_TYPE_WITH_CODE (GthImageSaverPng,
+ gth_image_saver_png,
+ GTH_TYPE_IMAGE_SAVER,
+ G_ADD_PRIVATE (GthImageSaverPng))
+
+
static void
gth_image_saver_png_finalize (GObject *object)
{
@@ -343,8 +346,6 @@ gth_image_saver_png_class_init (GthImageSaverPngClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
- g_type_class_add_private (klass, sizeof (GthImageSaverPngPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_png_finalize;
@@ -364,7 +365,7 @@ gth_image_saver_png_class_init (GthImageSaverPngClass *klass)
static void
gth_image_saver_png_init (GthImageSaverPng *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_PNG, GthImageSaverPngPrivate);
+ self->priv = gth_image_saver_png_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_PNG_SCHEMA);
self->priv->builder = NULL;
}
diff --git a/extensions/cairo_io/gth-image-saver-tga.c b/extensions/cairo_io/gth-image-saver-tga.c
index c982e8b2..e5b81911 100644
--- a/extensions/cairo_io/gth-image-saver-tga.c
+++ b/extensions/cairo_io/gth-image-saver-tga.c
@@ -26,15 +26,18 @@
#include "preferences.h"
-G_DEFINE_TYPE (GthImageSaverTga, gth_image_saver_tga, GTH_TYPE_IMAGE_SAVER)
-
-
struct _GthImageSaverTgaPrivate {
GtkBuilder *builder;
GSettings *settings;
};
+G_DEFINE_TYPE_WITH_CODE (GthImageSaverTga,
+ gth_image_saver_tga,
+ GTH_TYPE_IMAGE_SAVER,
+ G_ADD_PRIVATE (GthImageSaverTga))
+
+
static void
gth_image_saver_tga_finalize (GObject *object)
{
@@ -334,8 +337,6 @@ gth_image_saver_tga_class_init (GthImageSaverTgaClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
- g_type_class_add_private (klass, sizeof (GthImageSaverTgaPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_tga_finalize;
@@ -355,7 +356,7 @@ gth_image_saver_tga_class_init (GthImageSaverTgaClass *klass)
static void
gth_image_saver_tga_init (GthImageSaverTga *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_TGA, GthImageSaverTgaPrivate);
+ self->priv = gth_image_saver_tga_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_TGA_SCHEMA);
self->priv->builder = NULL;
}
diff --git a/extensions/cairo_io/gth-image-saver-tiff.c b/extensions/cairo_io/gth-image-saver-tiff.c
index 41a9e60e..131b597f 100644
--- a/extensions/cairo_io/gth-image-saver-tiff.c
+++ b/extensions/cairo_io/gth-image-saver-tiff.c
@@ -30,9 +30,6 @@
#include "preferences.h"
-G_DEFINE_TYPE (GthImageSaverTiff, gth_image_saver_tiff, GTH_TYPE_IMAGE_SAVER)
-
-
struct _GthImageSaverTiffPrivate {
GSettings *settings;
GtkBuilder *builder;
@@ -40,6 +37,12 @@ struct _GthImageSaverTiffPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImageSaverTiff,
+ gth_image_saver_tiff,
+ GTH_TYPE_IMAGE_SAVER,
+ G_ADD_PRIVATE (GthImageSaverTiff))
+
+
static void
gth_image_saver_tiff_finalize (GObject *object)
{
@@ -553,8 +556,6 @@ gth_image_saver_tiff_class_init (GthImageSaverTiffClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
- g_type_class_add_private (klass, sizeof (GthImageSaverTiffPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_tiff_finalize;
@@ -574,7 +575,7 @@ gth_image_saver_tiff_class_init (GthImageSaverTiffClass *klass)
static void
gth_image_saver_tiff_init (GthImageSaverTiff *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_TIFF, GthImageSaverTiffPrivate);
+ self->priv = gth_image_saver_tiff_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_TIFF_SCHEMA);
self->priv->builder = NULL;
self->priv->default_ext = NULL;
diff --git a/extensions/cairo_io/gth-image-saver-webp.c b/extensions/cairo_io/gth-image-saver-webp.c
index 307020e2..c20a54cb 100644
--- a/extensions/cairo_io/gth-image-saver-webp.c
+++ b/extensions/cairo_io/gth-image-saver-webp.c
@@ -30,15 +30,18 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (GthImageSaverWebp, gth_image_saver_webp, GTH_TYPE_IMAGE_SAVER)
-
-
struct _GthImageSaverWebpPrivate {
GtkBuilder *builder;
GSettings *settings;
};
+G_DEFINE_TYPE_WITH_CODE (GthImageSaverWebp,
+ gth_image_saver_webp,
+ GTH_TYPE_IMAGE_SAVER,
+ G_ADD_PRIVATE (GthImageSaverWebp))
+
+
static void
gth_image_saver_webp_finalize (GObject *object)
{
@@ -372,8 +375,6 @@ gth_image_saver_webp_class_init (GthImageSaverWebpClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
- g_type_class_add_private (klass, sizeof (GthImageSaverWebpPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_webp_finalize;
@@ -393,7 +394,7 @@ gth_image_saver_webp_class_init (GthImageSaverWebpClass *klass)
static void
gth_image_saver_webp_init (GthImageSaverWebp *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_WEBP, GthImageSaverWebpPrivate);
+ self->priv = gth_image_saver_webp_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_WEBP_SCHEMA);
self->priv->builder = NULL;
}
diff --git a/extensions/catalogs/gth-catalog.c b/extensions/catalogs/gth-catalog.c
index 2a7bbcc6..85ae38c1 100644
--- a/extensions/catalogs/gth-catalog.c
+++ b/extensions/catalogs/gth-catalog.c
@@ -44,7 +44,10 @@ struct _GthCatalogPrivate {
};
-G_DEFINE_TYPE (GthCatalog, gth_catalog, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthCatalog,
+ gth_catalog,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthCatalog))
static void
@@ -54,17 +57,13 @@ gth_catalog_finalize (GObject *object)
g_value_hash_unref (catalog->attributes);
- if (catalog->priv != NULL) {
- if (catalog->priv->file != NULL)
- g_object_unref (catalog->priv->file);
- g_free (catalog->priv->name);
- _g_object_list_unref (catalog->priv->file_list);
- g_hash_table_destroy (catalog->priv->file_hash);
- gth_datetime_free (catalog->priv->date_time);
- g_free (catalog->priv->order);
- g_free (catalog->priv);
- catalog->priv = NULL;
- }
+ if (catalog->priv->file != NULL)
+ g_object_unref (catalog->priv->file);
+ g_free (catalog->priv->name);
+ _g_object_list_unref (catalog->priv->file_list);
+ g_hash_table_destroy (catalog->priv->file_hash);
+ gth_datetime_free (catalog->priv->date_time);
+ g_free (catalog->priv->order);
G_OBJECT_CLASS (gth_catalog_parent_class)->finalize (object);
}
@@ -245,9 +244,17 @@ static void
gth_catalog_init (GthCatalog *catalog)
{
catalog->attributes = g_value_hash_new ();
- catalog->priv = g_new0 (GthCatalogPrivate, 1);
- catalog->priv->date_time = gth_datetime_new ();
+ catalog->priv = gth_catalog_get_instance_private (catalog);
+ catalog->priv->type = GTH_CATALOG_TYPE_INVALID;
+ catalog->priv->file = NULL;
+ catalog->priv->file_list = NULL;
catalog->priv->file_hash = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, NULL, NULL);
+ catalog->priv->name = NULL;
+ catalog->priv->date_time = gth_datetime_new ();
+ catalog->priv->active = FALSE;
+ catalog->priv->order = NULL;
+ catalog->priv->order_inverse = FALSE;
+ catalog->priv->cancellable = NULL;
}
diff --git a/extensions/catalogs/gth-file-source-catalogs.c b/extensions/catalogs/gth-file-source-catalogs.c
index b17fd7fc..5384ec19 100644
--- a/extensions/catalogs/gth-file-source-catalogs.c
+++ b/extensions/catalogs/gth-file-source-catalogs.c
@@ -28,8 +28,7 @@
#include "gth-file-source-catalogs.h"
-struct _GthFileSourceCatalogsPrivate
-{
+struct _GthFileSourceCatalogsPrivate {
GList *files;
GthCatalog *catalog;
ListReady ready_func;
@@ -37,7 +36,10 @@ struct _GthFileSourceCatalogsPrivate
};
-G_DEFINE_TYPE (GthFileSourceCatalogs, gth_file_source_catalogs, GTH_TYPE_FILE_SOURCE)
+G_DEFINE_TYPE_WITH_CODE (GthFileSourceCatalogs,
+ gth_file_source_catalogs,
+ GTH_TYPE_FILE_SOURCE,
+ G_ADD_PRIVATE (GthFileSourceCatalogs))
static GList *
@@ -1455,14 +1457,9 @@ gth_file_source_catalogs_finalize (GObject *object)
{
GthFileSourceCatalogs *catalogs = GTH_FILE_SOURCE_CATALOGS (object);
- if (catalogs->priv != NULL) {
- g_object_unref (catalogs->priv->catalog);
- _g_object_list_unref (catalogs->priv->files);
- catalogs->priv->files = NULL;
-
- g_free (catalogs->priv);
- catalogs->priv = NULL;
- }
+ g_object_unref (catalogs->priv->catalog);
+ _g_object_list_unref (catalogs->priv->files);
+ catalogs->priv->files = NULL;
G_OBJECT_CLASS (gth_file_source_catalogs_parent_class)->finalize (object);
}
@@ -1500,6 +1497,9 @@ gth_file_source_catalogs_init (GthFileSourceCatalogs *catalogs)
{
gth_file_source_add_scheme (GTH_FILE_SOURCE (catalogs), "catalog");
- catalogs->priv = g_new0 (GthFileSourceCatalogsPrivate, 1);
+ catalogs->priv = gth_file_source_catalogs_get_instance_private (catalogs);
+ catalogs->priv->files = NULL;
catalogs->priv->catalog = gth_catalog_new ();
+ catalogs->priv->ready_func = NULL;
+ catalogs->priv->ready_data = NULL;
}
diff --git a/extensions/catalogs/gth-organize-task.c b/extensions/catalogs/gth-organize-task.c
index fd364c7e..071e642a 100644
--- a/extensions/catalogs/gth-organize-task.c
+++ b/extensions/catalogs/gth-organize-task.c
@@ -39,8 +39,7 @@ enum {
};
-struct _GthOrganizeTaskPrivate
-{
+struct _GthOrganizeTaskPrivate {
GthBrowser *browser;
GFile *folder;
GthGroupPolicy group_policy;
@@ -60,7 +59,10 @@ struct _GthOrganizeTaskPrivate
};
-G_DEFINE_TYPE (GthOrganizeTask, gth_organize_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthOrganizeTask,
+ gth_organize_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthOrganizeTask))
static void
@@ -636,8 +638,6 @@ gth_organize_task_class_init (GthOrganizeTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthOrganizeTaskPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_organize_task_finalize;
@@ -804,7 +804,7 @@ gth_organize_task_init (GthOrganizeTask *self)
{
GIcon *icon;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_ORGANIZE_TASK, GthOrganizeTaskPrivate);
+ self->priv = gth_organize_task_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("organize-files-task.ui", "catalogs");
self->priv->results_liststore = (GtkListStore *) gtk_builder_get_object (self->priv->builder,
"results_liststore");
self->priv->catalogs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
diff --git a/extensions/change_date/gth-change-date-task.c b/extensions/change_date/gth-change-date-task.c
index 25ad4a79..88ec3ba8 100644
--- a/extensions/change_date/gth-change-date-task.c
+++ b/extensions/change_date/gth-change-date-task.c
@@ -37,7 +37,10 @@ struct _GthChangeDateTaskPrivate {
};
-G_DEFINE_TYPE (GthChangeDateTask, gth_change_date_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthChangeDateTask,
+ gth_change_date_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthChangeDateTask))
static void
@@ -342,8 +345,6 @@ gth_change_date_task_class_init (GthChangeDateTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthChangeDateTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_change_date_task_finalize;
@@ -355,7 +356,7 @@ gth_change_date_task_class_init (GthChangeDateTaskClass *klass)
static void
gth_change_date_task_init (GthChangeDateTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CHANGE_DATE_TASK, GthChangeDateTaskPrivate);
+ self->priv = gth_change_date_task_get_instance_private (self);
self->priv->date_time = gth_datetime_new ();
}
diff --git a/extensions/comments/gth-comment.c b/extensions/comments/gth-comment.c
index 8e22be00..dc102c97 100644
--- a/extensions/comments/gth-comment.c
+++ b/extensions/comments/gth-comment.c
@@ -48,10 +48,11 @@ static void gth_comment_dom_domizable_interface_init (DomDomizableInterface *ifa
G_DEFINE_TYPE_WITH_CODE (GthComment,
gth_comment,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthComment)
G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_comment_gth_duplicable_interface_init)
- G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_comment_dom_domizable_interface_init))
+ gth_comment_gth_duplicable_interface_init)
+ G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
+ gth_comment_dom_domizable_interface_init))
static void
@@ -92,7 +93,6 @@ gth_comment_finalize (GObject *obj)
static void
gth_comment_class_init (GthCommentClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthCommentPrivate));
G_OBJECT_CLASS (klass)->finalize = gth_comment_finalize;
}
@@ -100,7 +100,7 @@ gth_comment_class_init (GthCommentClass *klass)
static void
gth_comment_init (GthComment *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_COMMENT, GthCommentPrivate);
+ self->priv = gth_comment_get_instance_private (self);
self->priv->caption = NULL;
self->priv->note = NULL;
self->priv->place = NULL;
diff --git a/extensions/comments/gth-import-metadata-task.c b/extensions/comments/gth-import-metadata-task.c
index a4836ccf..e720f12c 100644
--- a/extensions/comments/gth-import-metadata-task.c
+++ b/extensions/comments/gth-import-metadata-task.c
@@ -33,7 +33,10 @@ struct _GthImportMetadataTaskPrivate {
};
-G_DEFINE_TYPE (GthImportMetadataTask, gth_import_metadata_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthImportMetadataTask,
+ gth_import_metadata_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthImportMetadataTask))
static void
@@ -210,8 +213,6 @@ gth_import_metadata_task_class_init (GthImportMetadataTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthImportMetadataTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_import_metadata_task_finalize;
@@ -223,7 +224,7 @@ gth_import_metadata_task_class_init (GthImportMetadataTaskClass *klass)
static void
gth_import_metadata_task_init (GthImportMetadataTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMPORT_METADATA_TASK,
GthImportMetadataTaskPrivate);
+ self->priv = gth_import_metadata_task_get_instance_private (self);
self->priv->file_data = NULL;
}
diff --git a/extensions/contact_sheet/gth-contact-sheet-creator.c
b/extensions/contact_sheet/gth-contact-sheet-creator.c
index db7588f9..c3824c97 100644
--- a/extensions/contact_sheet/gth-contact-sheet-creator.c
+++ b/extensions/contact_sheet/gth-contact-sheet-creator.c
@@ -31,9 +31,6 @@
#define DEFAULT_FONT "Sans 12"
-G_DEFINE_TYPE (GthContactSheetCreator, gth_contact_sheet_creator, GTH_TYPE_TASK)
-
-
typedef struct {
GthFileData *file_data;
cairo_surface_t *thumbnail;
@@ -117,6 +114,12 @@ struct _GthContactSheetCreatorPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthContactSheetCreator,
+ gth_contact_sheet_creator,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthContactSheetCreator))
+
+
static int
get_text_height (GthContactSheetCreator *self,
const char *text,
@@ -1059,8 +1062,6 @@ gth_contact_sheet_creator_class_init (GthContactSheetCreatorClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthContactSheetCreatorPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_contact_sheet_creator_finalize;
@@ -1072,7 +1073,7 @@ gth_contact_sheet_creator_class_init (GthContactSheetCreatorClass *klass)
static void
gth_contact_sheet_creator_init (GthContactSheetCreator *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CONTACT_SHEET_CREATOR,
GthContactSheetCreatorPrivate);
+ self->priv = gth_contact_sheet_creator_get_instance_private (self);
self->priv->header = NULL;
self->priv->footer = NULL;
self->priv->destination = NULL;
diff --git a/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c
b/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c
index 3d3a4957..c9ab23bd 100644
--- a/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c
+++ b/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c
@@ -26,9 +26,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (GthContactSheetThemeDialog, gth_contact_sheet_theme_dialog, GTK_TYPE_DIALOG)
-
-
struct _GthContactSheetThemeDialogPrivate {
GtkBuilder *builder;
GtkWidget *copy_from_button;
@@ -38,6 +35,12 @@ struct _GthContactSheetThemeDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthContactSheetThemeDialog,
+ gth_contact_sheet_theme_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthContactSheetThemeDialog))
+
+
static void
gth_contact_sheet_theme_dialog_finalize (GObject *object)
{
@@ -58,8 +61,6 @@ gth_contact_sheet_theme_dialog_class_init (GthContactSheetThemeDialogClass *klas
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthContactSheetThemeDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_contact_sheet_theme_dialog_finalize;
}
@@ -185,7 +186,7 @@ gth_contact_sheet_theme_dialog_init (GthContactSheetThemeDialog *self)
{
GtkWidget *content;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CONTACT_SHEET_THEME_DIALOG,
GthContactSheetThemeDialogPrivate);
+ self->priv = gth_contact_sheet_theme_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("contact-sheet-theme-properties.ui",
"contact_sheet");
self->priv->theme = NULL;
self->priv->all_themes = NULL;
diff --git a/extensions/edit_metadata/gth-delete-metadata-task.c
b/extensions/edit_metadata/gth-delete-metadata-task.c
index 27df110c..8a110cb3 100644
--- a/extensions/edit_metadata/gth-delete-metadata-task.c
+++ b/extensions/edit_metadata/gth-delete-metadata-task.c
@@ -31,7 +31,10 @@ struct _GthDeleteMetadataTaskPrivate {
};
-G_DEFINE_TYPE (GthDeleteMetadataTask, gth_delete_metadata_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthDeleteMetadataTask,
+ gth_delete_metadata_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthDeleteMetadataTask))
static void
@@ -165,8 +168,6 @@ gth_delete_metadata_task_class_init (GthDeleteMetadataTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthDeleteMetadataTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_delete_metadata_task_finalize;
@@ -178,7 +179,7 @@ gth_delete_metadata_task_class_init (GthDeleteMetadataTaskClass *klass)
static void
gth_delete_metadata_task_init (GthDeleteMetadataTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_DELETE_METADATA_TASK,
GthDeleteMetadataTaskPrivate);
+ self->priv = gth_delete_metadata_task_get_instance_private (self);
self->priv->file_data = NULL;
}
diff --git a/extensions/edit_metadata/gth-edit-comment-dialog.c
b/extensions/edit_metadata/gth-edit-comment-dialog.c
index a7bbc2bb..2f31ca13 100644
--- a/extensions/edit_metadata/gth-edit-comment-dialog.c
+++ b/extensions/edit_metadata/gth-edit-comment-dialog.c
@@ -37,8 +37,9 @@ static void gth_edit_comment_dialog_gth_edit_metadata_dialog_interface_init (Gth
G_DEFINE_TYPE_WITH_CODE (GthEditCommentDialog,
gth_edit_comment_dialog,
GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthEditCommentDialog)
G_IMPLEMENT_INTERFACE (GTH_TYPE_EDIT_METADATA_DIALOG,
-
gth_edit_comment_dialog_gth_edit_metadata_dialog_interface_init))
+
gth_edit_comment_dialog_gth_edit_metadata_dialog_interface_init))
@@ -122,7 +123,7 @@ gth_edit_comment_dialog_gth_edit_metadata_dialog_interface_init (GthEditMetadata
static void
gth_edit_comment_dialog_class_init (GthEditCommentDialogClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthEditCommentDialogPrivate));
+ /* void */
}
@@ -133,7 +134,7 @@ gth_edit_comment_dialog_init (GthEditCommentDialog *self)
GArray *pages;
int i;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EDIT_COMMENT_DIALOG,
GthEditCommentDialogPrivate);
+ self->priv = gth_edit_comment_dialog_get_instance_private (self);
gtk_window_set_resizable (GTK_WINDOW (self), TRUE);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), 5);
diff --git a/extensions/edit_metadata/gth-edit-general-page.c
b/extensions/edit_metadata/gth-edit-general-page.c
index 1f2c59ec..e472849f 100644
--- a/extensions/edit_metadata/gth-edit-general-page.c
+++ b/extensions/edit_metadata/gth-edit-general-page.c
@@ -57,8 +57,9 @@ static void gth_edit_general_page_gth_edit_general_page_interface_init (GthEditC
G_DEFINE_TYPE_WITH_CODE (GthEditGeneralPage,
gth_edit_general_page,
GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthEditGeneralPage)
G_IMPLEMENT_INTERFACE (GTH_TYPE_EDIT_COMMENT_PAGE,
- gth_edit_general_page_gth_edit_general_page_interface_init))
+ gth_edit_general_page_gth_edit_general_page_interface_init))
static void
@@ -499,8 +500,6 @@ gth_edit_general_page_finalize (GObject *object)
static void
gth_edit_general_page_class_init (GthEditGeneralPageClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthEditGeneralPagePrivate));
-
G_OBJECT_CLASS (klass)->finalize = gth_edit_general_page_finalize;
}
@@ -541,7 +540,7 @@ tags_entry_list_collapsed_cb (GthTagsEntry *widget,
static void
gth_edit_general_page_init (GthEditGeneralPage *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EDIT_GENERAL_PAGE,
GthEditGeneralPagePrivate);
+ self->priv = gth_edit_general_page_get_instance_private (self);
self->priv->info = NULL;
gtk_container_set_border_width (GTK_CONTAINER (self), 12);
diff --git a/extensions/edit_metadata/gth-edit-tags-dialog.c b/extensions/edit_metadata/gth-edit-tags-dialog.c
index 7cd0e8ce..c4bdf73d 100644
--- a/extensions/edit_metadata/gth-edit-tags-dialog.c
+++ b/extensions/edit_metadata/gth-edit-tags-dialog.c
@@ -41,8 +41,9 @@ static void gth_edit_tags_dialog_gth_edit_metadata_dialog_interface_init (GthEdi
G_DEFINE_TYPE_WITH_CODE (GthEditTagsDialog,
gth_edit_tags_dialog,
GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthEditTagsDialog)
G_IMPLEMENT_INTERFACE (GTH_TYPE_EDIT_METADATA_DIALOG,
- gth_edit_tags_dialog_gth_edit_metadata_dialog_interface_init))
+ gth_edit_tags_dialog_gth_edit_metadata_dialog_interface_init))
static void
@@ -173,8 +174,6 @@ gth_edit_tags_dialog_class_init (GthEditTagsDialogClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthEditTagsDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_edit_tags_dialog_finalize;
}
@@ -183,7 +182,7 @@ gth_edit_tags_dialog_class_init (GthEditTagsDialogClass *klass)
static void
gth_edit_tags_dialog_init (GthEditTagsDialog *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EDIT_TAGS_DIALOG, GthEditTagsDialogPrivate);
+ self->priv = gth_edit_tags_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("tag-chooser.ui", "edit_metadata");
gtk_window_set_title (GTK_WINDOW (self), _("Assign Tags"));
diff --git a/extensions/edit_metadata/gth-tag-task.c b/extensions/edit_metadata/gth-tag-task.c
index e3a64272..32b1b5ac 100644
--- a/extensions/edit_metadata/gth-tag-task.c
+++ b/extensions/edit_metadata/gth-tag-task.c
@@ -30,7 +30,10 @@ struct _GthTagTaskPrivate {
};
-G_DEFINE_TYPE (GthTagTask, gth_tag_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthTagTask,
+ gth_tag_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthTagTask))
static void
@@ -149,8 +152,6 @@ gth_tag_task_class_init (GthTagTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthTagTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_tag_task_finalize;
@@ -162,7 +163,7 @@ gth_tag_task_class_init (GthTagTaskClass *klass)
static void
gth_tag_task_init (GthTagTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TAG_TASK, GthTagTaskPrivate);
+ self->priv = gth_tag_task_get_instance_private (self);
self->priv->file_list = NULL;
self->priv->file_data_list = NULL;
}
diff --git a/extensions/exiv2_tools/gth-edit-iptc-page.c b/extensions/exiv2_tools/gth-edit-iptc-page.c
index 066b7845..44edfdf6 100644
--- a/extensions/exiv2_tools/gth-edit-iptc-page.c
+++ b/extensions/exiv2_tools/gth-edit-iptc-page.c
@@ -30,21 +30,22 @@
#define GET_WIDGET(name) _gtk_builder_get_widget (self->priv->builder, (name))
+struct _GthEditIptcPagePrivate {
+ GtkBuilder *builder;
+ gboolean supported;
+ GFileInfo *info;
+};
+
+
static void gth_edit_iptc_page_gth_edit_comment_page_interface_init (GthEditCommentPageInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GthEditIptcPage,
gth_edit_iptc_page,
GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthEditIptcPage)
G_IMPLEMENT_INTERFACE (GTH_TYPE_EDIT_COMMENT_PAGE,
- gth_edit_iptc_page_gth_edit_comment_page_interface_init))
-
-
-struct _GthEditIptcPagePrivate {
- GtkBuilder *builder;
- gboolean supported;
- GFileInfo *info;
-};
+ gth_edit_iptc_page_gth_edit_comment_page_interface_init))
static void
@@ -216,7 +217,6 @@ gth_edit_iptc_page_finalize (GObject *object)
static void
gth_edit_iptc_page_class_init (GthEditIptcPageClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthEditIptcPagePrivate));
G_OBJECT_CLASS (klass)->finalize = gth_edit_iptc_page_finalize;
}
@@ -224,7 +224,7 @@ gth_edit_iptc_page_class_init (GthEditIptcPageClass *klass)
static void
gth_edit_iptc_page_init (GthEditIptcPage *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EDIT_IPTC_PAGE, GthEditIptcPagePrivate);
+ self->priv = gth_edit_iptc_page_get_instance_private (self);
self->priv->info = NULL;
gtk_container_set_border_width (GTK_CONTAINER (self), 12);
diff --git a/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
b/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
index f9827aa4..22be118b 100644
--- a/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
+++ b/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
@@ -33,7 +33,10 @@ struct _GthMetadataProviderExiv2Private {
};
-G_DEFINE_TYPE (GthMetadataProviderExiv2, gth_metadata_provider_exiv2, GTH_TYPE_METADATA_PROVIDER)
+G_DEFINE_TYPE_WITH_CODE (GthMetadataProviderExiv2,
+ gth_metadata_provider_exiv2,
+ GTH_TYPE_METADATA_PROVIDER,
+ G_ADD_PRIVATE (GthMetadataProviderExiv2))
static void
@@ -336,8 +339,6 @@ gth_metadata_provider_exiv2_class_init (GthMetadataProviderExiv2Class *klass)
GObjectClass *object_class;
GthMetadataProviderClass *mp_class;
- g_type_class_add_private (klass, sizeof (GthMetadataProviderExiv2Private));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_metadata_provider_exiv2_finalize;
@@ -352,6 +353,6 @@ gth_metadata_provider_exiv2_class_init (GthMetadataProviderExiv2Class *klass)
static void
gth_metadata_provider_exiv2_init (GthMetadataProviderExiv2 *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_METADATA_PROVIDER_EXIV2,
GthMetadataProviderExiv2Private);
+ self->priv = gth_metadata_provider_exiv2_get_instance_private (self);
self->priv->general_settings = NULL;
}
diff --git a/extensions/facebook/facebook-album-properties-dialog.c
b/extensions/facebook/facebook-album-properties-dialog.c
index ca1fd0bf..65757fa0 100644
--- a/extensions/facebook/facebook-album-properties-dialog.c
+++ b/extensions/facebook/facebook-album-properties-dialog.c
@@ -32,7 +32,10 @@ struct _FacebookAlbumPropertiesDialogPrivate {
};
-G_DEFINE_TYPE (FacebookAlbumPropertiesDialog, facebook_album_properties_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (FacebookAlbumPropertiesDialog,
+ facebook_album_properties_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (FacebookAlbumPropertiesDialog))
static void
@@ -52,8 +55,6 @@ facebook_album_properties_dialog_class_init (FacebookAlbumPropertiesDialogClass
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (FacebookAlbumPropertiesDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = facebook_album_properties_dialog_finalize;
}
@@ -64,7 +65,7 @@ facebook_album_properties_dialog_init (FacebookAlbumPropertiesDialog *self)
{
GtkWidget *content;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, FACEBOOK_TYPE_ALBUM_PROPERTIES_DIALOG,
FacebookAlbumPropertiesDialogPrivate);
+ self->priv = facebook_album_properties_dialog_get_instance_private(self);
self->priv->builder = _gtk_builder_new_from_file ("facebook-album-properties.ui", "facebook");
content = _gtk_builder_get_widget (self->priv->builder, "album_properties");
diff --git a/extensions/facebook/facebook-service.c b/extensions/facebook/facebook-service.c
index 68c5ab6a..5e546155 100644
--- a/extensions/facebook/facebook-service.c
+++ b/extensions/facebook/facebook-service.c
@@ -78,9 +78,6 @@ post_photos_data_free (PostPhotosData *post_photos)
/* -- facebook_service -- */
-G_DEFINE_TYPE (FacebookService, facebook_service, WEB_TYPE_SERVICE)
-
-
struct _FacebookServicePrivate {
char *state;
char *token;
@@ -88,6 +85,12 @@ struct _FacebookServicePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (FacebookService,
+ facebook_service,
+ WEB_TYPE_SERVICE,
+ G_ADD_PRIVATE (FacebookService))
+
+
static void
facebook_service_finalize (GObject *object)
{
@@ -398,8 +401,6 @@ facebook_service_class_init (FacebookServiceClass *klass)
GObjectClass *object_class;
WebServiceClass *service_class;
- g_type_class_add_private (klass, sizeof (FacebookServicePrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = facebook_service_finalize;
@@ -412,7 +413,7 @@ facebook_service_class_init (FacebookServiceClass *klass)
static void
facebook_service_init (FacebookService *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, FACEBOOK_TYPE_SERVICE, FacebookServicePrivate);
+ self->priv = facebook_service_get_instance_private (self);
self->priv->state = NULL;
self->priv->token = NULL;
self->priv->post_photos = NULL;
diff --git a/extensions/file_manager/gth-copy-task.c b/extensions/file_manager/gth-copy-task.c
index 5efacd95..67aa2bb9 100644
--- a/extensions/file_manager/gth-copy-task.c
+++ b/extensions/file_manager/gth-copy-task.c
@@ -32,7 +32,10 @@ struct _GthCopyTaskPrivate {
};
-G_DEFINE_TYPE (GthCopyTask, gth_copy_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthCopyTask,
+ gth_copy_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthCopyTask))
static void
@@ -118,8 +121,6 @@ gth_copy_task_class_init (GthCopyTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthCopyTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_copy_task_finalize;
@@ -131,7 +132,7 @@ gth_copy_task_class_init (GthCopyTaskClass *klass)
static void
gth_copy_task_init (GthCopyTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_COPY_TASK, GthCopyTaskPrivate);
+ self->priv = gth_copy_task_get_instance_private (self);
}
diff --git a/extensions/file_manager/gth-duplicate-task.c b/extensions/file_manager/gth-duplicate-task.c
index ab911056..3853b178 100644
--- a/extensions/file_manager/gth-duplicate-task.c
+++ b/extensions/file_manager/gth-duplicate-task.c
@@ -30,7 +30,10 @@ struct _GthDuplicateTaskPrivate {
};
-G_DEFINE_TYPE (GthDuplicateTask, gth_duplicate_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthDuplicateTask,
+ gth_duplicate_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthDuplicateTask))
static void
@@ -155,8 +158,6 @@ gth_duplicate_task_class_init (GthDuplicateTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthDuplicateTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_duplicate_task_finalize;
@@ -168,7 +169,7 @@ gth_duplicate_task_class_init (GthDuplicateTaskClass *klass)
static void
gth_duplicate_task_init (GthDuplicateTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_DUPLICATE_TASK, GthDuplicateTaskPrivate);
+ self->priv = gth_duplicate_task_get_instance_private (self);
self->priv->destination = NULL;
}
diff --git a/extensions/file_manager/gth-reorder-task.c b/extensions/file_manager/gth-reorder-task.c
index d760bc3c..5a887fc4 100644
--- a/extensions/file_manager/gth-reorder-task.c
+++ b/extensions/file_manager/gth-reorder-task.c
@@ -32,7 +32,10 @@ struct _GthReorderTaskPrivate {
};
-G_DEFINE_TYPE (GthReorderTask, gth_reorder_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthReorderTask,
+ gth_reorder_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthReorderTask))
static void
@@ -92,8 +95,6 @@ gth_reorder_task_class_init (GthReorderTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthReorderTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_reorder_task_finalize;
@@ -106,7 +107,7 @@ gth_reorder_task_class_init (GthReorderTaskClass *klass)
static void
gth_reorder_task_init (GthReorderTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_REORDER_TASK, GthReorderTaskPrivate);
+ self->priv = gth_reorder_task_get_instance_private (self);
}
diff --git a/extensions/file_tools/gth-curve-editor.c b/extensions/file_tools/gth-curve-editor.c
index 8ebc22c6..c7a97a45 100644
--- a/extensions/file_tools/gth-curve-editor.c
+++ b/extensions/file_tools/gth-curve-editor.c
@@ -73,7 +73,10 @@ struct _GthCurveEditorPrivate {
static guint gth_curve_editor_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthCurveEditor, gth_curve_editor, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthCurveEditor,
+ gth_curve_editor,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthCurveEditor))
static void
@@ -153,8 +156,6 @@ gth_curve_editor_class_init (GthCurveEditorClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthCurveEditorPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_curve_editor_set_property;
object_class->get_property = gth_curve_editor_get_property;
@@ -864,7 +865,7 @@ gth_curve_editor_init (GthCurveEditor *self)
GtkWidget *button;
int c;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CURVE_EDITOR, GthCurveEditorPrivate);
+ self->priv = gth_curve_editor_get_instance_private (self);
self->priv->histogram = NULL;
self->priv->current_channel = GTH_HISTOGRAM_CHANNEL_VALUE;
self->priv->scale_type = GTH_HISTOGRAM_SCALE_LINEAR;
diff --git a/extensions/file_tools/gth-curve-preset-editor-dialog.c
b/extensions/file_tools/gth-curve-preset-editor-dialog.c
index 73ca413e..8d8b6f16 100644
--- a/extensions/file_tools/gth-curve-preset-editor-dialog.c
+++ b/extensions/file_tools/gth-curve-preset-editor-dialog.c
@@ -46,7 +46,10 @@ struct _GthCurvePresetEditorDialogPrivate {
};
-G_DEFINE_TYPE (GthCurvePresetEditorDialog, gth_curve_preset_editor_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (GthCurvePresetEditorDialog,
+ gth_curve_preset_editor_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthCurvePresetEditorDialog))
static void
@@ -70,8 +73,6 @@ gth_curve_preset_editor_dialog_class_init (GthCurvePresetEditorDialogClass *klas
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthCurvePresetEditorDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_curve_preset_editor_dialog_finalize;
}
@@ -80,7 +81,7 @@ gth_curve_preset_editor_dialog_class_init (GthCurvePresetEditorDialogClass *klas
static void
gth_curve_preset_editor_dialog_init (GthCurvePresetEditorDialog *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CURVE_PRESET_EDITOR_DIALOG,
GthCurvePresetEditorDialogPrivate);
+ self->priv = gth_curve_preset_editor_dialog_get_instance_private (self);
self->priv->changed_id = 0;
}
diff --git a/extensions/file_tools/gth-curve-preset.c b/extensions/file_tools/gth-curve-preset.c
index 7e2b1250..9413661f 100644
--- a/extensions/file_tools/gth-curve-preset.c
+++ b/extensions/file_tools/gth-curve-preset.c
@@ -49,7 +49,10 @@ struct _GthCurvePresetPrivate {
static guint gth_curve_preset_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthCurvePreset, gth_curve_preset, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthCurvePreset,
+ gth_curve_preset,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthCurvePreset))
static char * Channel_Names[GTH_HISTOGRAM_N_CHANNELS] = { "value", "red", "green", "blue", "alpha" };
@@ -194,8 +197,6 @@ gth_curve_preset_class_init (GthCurvePresetClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthCurvePresetPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_curve_preset_finalize;
@@ -234,7 +235,7 @@ gth_curve_preset_changed (GthCurvePreset *self)
static void
gth_curve_preset_init (GthCurvePreset *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CURVE_PRESET, GthCurvePresetPrivate);
+ self->priv = gth_curve_preset_get_instance_private (self);
self->priv->set = NULL;
self->priv->file = NULL;
self->priv->next_id = 0;
diff --git a/extensions/file_tools/gth-file-tool-adjust-colors.c
b/extensions/file_tools/gth-file-tool-adjust-colors.c
index 959d0797..b8d12c3a 100644
--- a/extensions/file_tools/gth-file-tool-adjust-colors.c
+++ b/extensions/file_tools/gth-file-tool-adjust-colors.c
@@ -29,8 +29,6 @@
#define APPLY_DELAY 150
#define PREVIEW_SIZE 0.9
-G_DEFINE_TYPE (GthFileToolAdjustColors, gth_file_tool_adjust_colors, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
struct _GthFileToolAdjustColorsPrivate {
cairo_surface_t *destination;
@@ -53,6 +51,12 @@ struct _GthFileToolAdjustColorsPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolAdjustColors,
+ gth_file_tool_adjust_colors,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolAdjustColors))
+
+
typedef struct {
GthFileToolAdjustColors *self;
GthViewerPage *viewer_page;
@@ -584,7 +588,7 @@ gth_file_tool_sharpen_reset_image (GthImageViewerPageTool *base)
static void
gth_file_tool_adjust_colors_init (GthFileToolAdjustColors *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_ADJUST_COLORS,
GthFileToolAdjustColorsPrivate);
+ self->priv = gth_file_tool_adjust_colors_get_instance_private (self);
self->priv->histogram = gth_histogram_new ();
self->priv->preview = NULL;
self->priv->destination = NULL;
@@ -622,8 +626,6 @@ gth_file_tool_adjust_colors_class_init (GthFileToolAdjustColorsClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolAdjustColorsPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_adjust_colors_finalize;
diff --git a/extensions/file_tools/gth-file-tool-adjust-contrast.c
b/extensions/file_tools/gth-file-tool-adjust-contrast.c
index f0eb65c3..62421939 100644
--- a/extensions/file_tools/gth-file-tool-adjust-contrast.c
+++ b/extensions/file_tools/gth-file-tool-adjust-contrast.c
@@ -34,9 +34,6 @@
#define HISTOGRAM_CROP_1_5 0.015 /* ignores the 1.5% on each side of the histogram */
-G_DEFINE_TYPE (GthFileToolAdjustContrast, gth_file_tool_adjust_contrast, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
typedef enum {
METHOD_STRETCH,
METHOD_STRETCH_0_5,
@@ -61,6 +58,12 @@ struct _GthFileToolAdjustContrastPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolAdjustContrast,
+ gth_file_tool_adjust_contrast,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolAdjustContrast))
+
+
/* equalize histogram */
@@ -628,8 +631,6 @@ gth_file_tool_adjust_contrast_class_init (GthFileToolAdjustContrastClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolAdjustContrastPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_adjust_contrast_finalize;
@@ -646,7 +647,7 @@ gth_file_tool_adjust_contrast_class_init (GthFileToolAdjustContrastClass *klass)
static void
gth_file_tool_adjust_contrast_init (GthFileToolAdjustContrast *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_ADJUST_CONTRAST,
GthFileToolAdjustContrastPrivate);
+ self->priv = gth_file_tool_adjust_contrast_get_instance_private (self);
self->priv->preview = NULL;
self->priv->destination = NULL;
self->priv->builder = NULL;
diff --git a/extensions/file_tools/gth-file-tool-color-picker.c
b/extensions/file_tools/gth-file-tool-color-picker.c
index cada7b6d..f3af51d0 100644
--- a/extensions/file_tools/gth-file-tool-color-picker.c
+++ b/extensions/file_tools/gth-file-tool-color-picker.c
@@ -35,7 +35,10 @@ struct _GthFileToolColorPickerPrivate {
};
-G_DEFINE_TYPE (GthFileToolColorPicker, gth_file_tool_color_picker, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
+G_DEFINE_TYPE_WITH_CODE (GthFileToolColorPicker,
+ gth_file_tool_color_picker,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolColorPicker))
static void
@@ -224,8 +227,6 @@ gth_file_tool_color_picker_class_init (GthFileToolColorPickerClass *klass)
GObjectClass *gobject_class;
GthFileToolClass *file_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolColorPickerPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_color_picker_finalize;
@@ -239,7 +240,7 @@ gth_file_tool_color_picker_class_init (GthFileToolColorPickerClass *klass)
static void
gth_file_tool_color_picker_init (GthFileToolColorPicker *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_COLOR_PICKER,
GthFileToolColorPickerPrivate);
+ self->priv = gth_file_tool_color_picker_get_instance_private (self);
self->priv->builder = NULL;
self->priv->selector = NULL;
gth_file_tool_construct (GTH_FILE_TOOL (self), "eyedropper-symbolic", _("Color Picker"),
GTH_TOOLBOX_SECTION_COLORS);
diff --git a/extensions/file_tools/gth-file-tool-crop.c b/extensions/file_tools/gth-file-tool-crop.c
index bafd287e..2a5457e0 100644
--- a/extensions/file_tools/gth-file-tool-crop.c
+++ b/extensions/file_tools/gth-file-tool-crop.c
@@ -30,9 +30,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (GthFileToolCrop, gth_file_tool_crop, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
struct _GthFileToolCropPrivate {
GSettings *settings;
GtkBuilder *builder;
@@ -50,6 +47,12 @@ struct _GthFileToolCropPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolCrop,
+ gth_file_tool_crop,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolCrop))
+
+
static gpointer
crop_exec (GthAsyncTask *task,
gpointer user_data)
@@ -679,7 +682,7 @@ gth_file_tool_crop_reset_image (GthImageViewerPageTool *base)
static void
gth_file_tool_crop_init (GthFileToolCrop *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_CROP, GthFileToolCropPrivate);
+ self->priv = gth_file_tool_crop_get_instance_private (self);
self->priv->settings = NULL;
gth_file_tool_construct (GTH_FILE_TOOL (self), "image-crop-symbolic", _("Crop"),
GTH_TOOLBOX_SECTION_FORMAT);
}
@@ -711,8 +714,6 @@ gth_file_tool_crop_class_init (GthFileToolCropClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolCropPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_crop_finalize;
diff --git a/extensions/file_tools/gth-file-tool-curves.c b/extensions/file_tools/gth-file-tool-curves.c
index 9d08e409..a35b48b6 100644
--- a/extensions/file_tools/gth-file-tool-curves.c
+++ b/extensions/file_tools/gth-file-tool-curves.c
@@ -35,9 +35,6 @@
#define PREVIEW_SIZE 0.9
-G_DEFINE_TYPE (GthFileToolCurves, gth_file_tool_curves, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
struct _GthFileToolCurvesPrivate {
cairo_surface_t *destination;
cairo_surface_t *preview;
@@ -62,6 +59,12 @@ struct _GthFileToolCurvesPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolCurves,
+ gth_file_tool_curves,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolCurves))
+
+
/* -- apply_changes -- */
@@ -877,7 +880,7 @@ gth_file_tool_sharpen_reset_image (GthImageViewerPageTool *base)
static void
gth_file_tool_curves_init (GthFileToolCurves *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_CURVES, GthFileToolCurvesPrivate);
+ self->priv = gth_file_tool_curves_get_instance_private (self);
self->priv->preview = NULL;
self->priv->destination = NULL;
self->priv->builder = NULL;
@@ -917,8 +920,6 @@ gth_file_tool_curves_class_init (GthFileToolCurvesClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolCurvesPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_curves_finalize;
diff --git a/extensions/file_tools/gth-file-tool-effects.c b/extensions/file_tools/gth-file-tool-effects.c
index 8d035167..0faeec9a 100644
--- a/extensions/file_tools/gth-file-tool-effects.c
+++ b/extensions/file_tools/gth-file-tool-effects.c
@@ -35,9 +35,6 @@
#define PREVIEW_SIZE 0.9
-G_DEFINE_TYPE (GthFileToolEffects, gth_file_tool_effects, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
struct _GthFileToolEffectsPrivate {
cairo_surface_t *destination;
cairo_surface_t *preview;
@@ -54,6 +51,12 @@ struct _GthFileToolEffectsPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolEffects,
+ gth_file_tool_effects,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolEffects))
+
+
static void apply_changes (GthFileToolEffects *self);
@@ -326,8 +329,6 @@ gth_file_tool_effects_class_init (GthFileToolEffectsClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolEffectsPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_effects_finalize;
@@ -344,7 +345,7 @@ gth_file_tool_effects_class_init (GthFileToolEffectsClass *klass)
static void
gth_file_tool_effects_init (GthFileToolEffects *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_EFFECTS,
GthFileToolEffectsPrivate);
+ self->priv = gth_file_tool_effects_get_instance_private (self);
self->priv->preview = NULL;
self->priv->destination = NULL;
self->priv->builder = NULL;
diff --git a/extensions/file_tools/gth-file-tool-grayscale.c b/extensions/file_tools/gth-file-tool-grayscale.c
index be1a845f..f621f753 100644
--- a/extensions/file_tools/gth-file-tool-grayscale.c
+++ b/extensions/file_tools/gth-file-tool-grayscale.c
@@ -31,9 +31,6 @@
#define PREVIEW_SIZE 0.9
-G_DEFINE_TYPE (GthFileToolGrayscale, gth_file_tool_grayscale, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
typedef enum {
METHOD_BRIGHTNESS,
METHOD_SATURATION,
@@ -56,6 +53,12 @@ struct _GthFileToolGrayscalePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolGrayscale,
+ gth_file_tool_grayscale,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolGrayscale))
+
+
typedef struct {
Method method;
} GrayscaleData;
@@ -465,8 +468,6 @@ gth_file_tool_grayscale_class_init (GthFileToolGrayscaleClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolGrayscalePrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_grayscale_finalize;
@@ -483,7 +484,7 @@ gth_file_tool_grayscale_class_init (GthFileToolGrayscaleClass *klass)
static void
gth_file_tool_grayscale_init (GthFileToolGrayscale *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_GRAYSCALE,
GthFileToolGrayscalePrivate);
+ self->priv = gth_file_tool_grayscale_get_instance_private (self);
self->priv->preview = NULL;
self->priv->destination = NULL;
self->priv->builder = NULL;
diff --git a/extensions/file_tools/gth-file-tool-resize.c b/extensions/file_tools/gth-file-tool-resize.c
index 4a3a120b..12b326b4 100644
--- a/extensions/file_tools/gth-file-tool-resize.c
+++ b/extensions/file_tools/gth-file-tool-resize.c
@@ -33,9 +33,6 @@
#define PIXELS_UNIT_POSITION 0
-G_DEFINE_TYPE (GthFileToolResize, gth_file_tool_resize, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
struct _GthFileToolResizePrivate {
GSettings *settings;
cairo_surface_t *preview;
@@ -59,6 +56,12 @@ struct _GthFileToolResizePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolResize,
+ gth_file_tool_resize,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolResize))
+
+
static void update_image_size (GthFileToolResize *self);
@@ -810,8 +813,6 @@ gth_file_tool_resize_class_init (GthFileToolResizeClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolResizePrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_resize_finalize;
@@ -829,7 +830,7 @@ gth_file_tool_resize_class_init (GthFileToolResizeClass *klass)
static void
gth_file_tool_resize_init (GthFileToolResize *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_RESIZE, GthFileToolResizePrivate);
+ self->priv = gth_file_tool_resize_get_instance_private (self);
self->priv->settings = NULL;
self->priv->builder = NULL;
self->priv->preview = NULL;
diff --git a/extensions/file_tools/gth-file-tool-rotate.c b/extensions/file_tools/gth-file-tool-rotate.c
index a3884501..d5762c89 100644
--- a/extensions/file_tools/gth-file-tool-rotate.c
+++ b/extensions/file_tools/gth-file-tool-rotate.c
@@ -34,9 +34,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (GthFileToolRotate, gth_file_tool_rotate, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
struct _GthFileToolRotatePrivate {
GSettings *settings;
cairo_surface_t *image;
@@ -54,6 +51,12 @@ struct _GthFileToolRotatePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolRotate,
+ gth_file_tool_rotate,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolRotate))
+
+
static void
update_crop_parameters (GthFileToolRotate *self)
{
@@ -656,8 +659,6 @@ gth_file_tool_rotate_class_init (GthFileToolRotateClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolRotatePrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_rotate_finalize;
@@ -675,7 +676,7 @@ gth_file_tool_rotate_class_init (GthFileToolRotateClass *klass)
static void
gth_file_tool_rotate_init (GthFileToolRotate *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_ROTATE, GthFileToolRotatePrivate);
+ self->priv = gth_file_tool_rotate_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_ROTATE_SCHEMA);
gth_file_tool_construct (GTH_FILE_TOOL (self), "image-rotate-symbolic", _("Rotate"),
GTH_TOOLBOX_SECTION_ROTATION);
diff --git a/extensions/file_tools/gth-file-tool-sharpen.c b/extensions/file_tools/gth-file-tool-sharpen.c
index 2f993d4b..1865246e 100644
--- a/extensions/file_tools/gth-file-tool-sharpen.c
+++ b/extensions/file_tools/gth-file-tool-sharpen.c
@@ -31,9 +31,6 @@
#define DEFAULT_THRESHOLD 0.0
-G_DEFINE_TYPE (GthFileToolSharpen, gth_file_tool_sharpen, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
-
-
struct _GthFileToolSharpenPrivate {
GtkBuilder *builder;
GtkAdjustment *radius_adj;
@@ -47,6 +44,12 @@ struct _GthFileToolSharpenPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileToolSharpen,
+ gth_file_tool_sharpen,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolSharpen))
+
+
typedef struct {
int radius;
double amount;
@@ -405,8 +408,6 @@ gth_file_tool_sharpen_class_init (GthFileToolSharpenClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolSharpenPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_sharpen_finalize;
@@ -424,7 +425,7 @@ gth_file_tool_sharpen_class_init (GthFileToolSharpenClass *klass)
static void
gth_file_tool_sharpen_init (GthFileToolSharpen *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_SHARPEN,
GthFileToolSharpenPrivate);
+ self->priv = gth_file_tool_sharpen_get_instance_private (self);
self->priv->builder = NULL;
self->priv->show_preview = TRUE;
self->priv->preview_source = NULL;
diff --git a/extensions/file_tools/gth-image-line-tool.c b/extensions/file_tools/gth-image-line-tool.c
index d98af0df..74d3b2b4 100644
--- a/extensions/file_tools/gth-image-line-tool.c
+++ b/extensions/file_tools/gth-image-line-tool.c
@@ -69,8 +69,9 @@ static void gth_image_line_tool_gth_image_tool_interface_init (GthImageViewerToo
G_DEFINE_TYPE_WITH_CODE (GthImageLineTool,
gth_image_line_tool,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImageLineTool)
G_IMPLEMENT_INTERFACE (GTH_TYPE_IMAGE_VIEWER_TOOL,
- gth_image_line_tool_gth_image_tool_interface_init))
+ gth_image_line_tool_gth_image_tool_interface_init))
static void
@@ -334,8 +335,6 @@ gth_image_line_tool_class_init (GthImageLineToolClass *class)
{
GObjectClass *gobject_class;
- g_type_class_add_private (class, sizeof (GthImageLineToolPrivate));
-
gobject_class = (GObjectClass*) class;
gobject_class->finalize = gth_image_line_tool_finalize;
@@ -353,7 +352,7 @@ gth_image_line_tool_class_init (GthImageLineToolClass *class)
static void
gth_image_line_tool_init (GthImageLineTool *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_LINE_TOOL, GthImageLineToolPrivate);
+ self->priv = gth_image_line_tool_get_instance_private (self);
self->priv->preview_image = NULL;
self->priv->first_point_set = FALSE;
}
diff --git a/extensions/file_tools/gth-image-rotator.c b/extensions/file_tools/gth-image-rotator.c
index 88383f93..11788c77 100644
--- a/extensions/file_tools/gth-image-rotator.c
+++ b/extensions/file_tools/gth-image-rotator.c
@@ -48,14 +48,6 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void gth_image_rotator_gth_image_tool_interface_init (GthImageViewerToolInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthImageRotator,
- gth_image_rotator,
- G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_IMAGE_VIEWER_TOOL,
- gth_image_rotator_gth_image_tool_interface_init))
-
-
-
struct _GthImageRotatorPrivate {
GthImageViewer *viewer;
@@ -88,6 +80,14 @@ struct _GthImageRotatorPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImageRotator,
+ gth_image_rotator,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImageRotator)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_IMAGE_VIEWER_TOOL,
+ gth_image_rotator_gth_image_tool_interface_init))
+
+
static void
gth_image_rotator_set_viewer (GthImageViewerTool *base,
GthImageViewer *viewer)
@@ -639,8 +639,6 @@ gth_image_rotator_class_init (GthImageRotatorClass *class)
{
GObjectClass *gobject_class;
- g_type_class_add_private (class, sizeof (GthImageRotatorPrivate));
-
gobject_class = (GObjectClass*) class;
gobject_class->finalize = gth_image_rotator_finalize;
@@ -696,7 +694,7 @@ gth_image_rotator_gth_image_tool_interface_init (GthImageViewerToolInterface *if
static void
gth_image_rotator_init (GthImageRotator *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_ROTATOR, GthImageRotatorPrivate);
+ self->priv = gth_image_rotator_get_instance_private (self);
self->priv->preview_image = NULL;
self->priv->grid_type = GTH_GRID_NONE;
self->priv->resize = GTH_TRANSFORM_RESIZE_BOUNDING_BOX;
diff --git a/extensions/file_tools/gth-preview-tool.c b/extensions/file_tools/gth-preview-tool.c
index 6ee0b532..76f68984 100644
--- a/extensions/file_tools/gth-preview-tool.c
+++ b/extensions/file_tools/gth-preview-tool.c
@@ -29,14 +29,6 @@
static void gth_preview_tool_gth_image_tool_interface_init (GthImageViewerToolInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthPreviewTool,
- gth_preview_tool,
- G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_IMAGE_VIEWER_TOOL,
- gth_preview_tool_gth_image_tool_interface_init))
-
-
-
struct _GthPreviewToolPrivate {
GthImageViewer *viewer;
GthFit original_fit_mode;
@@ -47,6 +39,14 @@ struct _GthPreviewToolPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthPreviewTool,
+ gth_preview_tool,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthPreviewTool)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_IMAGE_VIEWER_TOOL,
+ gth_preview_tool_gth_image_tool_interface_init))
+
+
static void
gth_preview_tool_set_viewer (GthImageViewerTool *base,
GthImageViewer *viewer)
@@ -287,8 +287,6 @@ gth_preview_tool_class_init (GthPreviewToolClass *class)
{
GObjectClass *gobject_class;
- g_type_class_add_private (class, sizeof (GthPreviewToolPrivate));
-
gobject_class = (GObjectClass*) class;
gobject_class->finalize = gth_preview_tool_finalize;
}
@@ -316,7 +314,7 @@ gth_preview_tool_gth_image_tool_interface_init (GthImageViewerToolInterface *ifa
static void
gth_preview_tool_init (GthPreviewTool *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_PREVIEW_TOOL, GthPreviewToolPrivate);
+ self->priv = gth_preview_tool_get_instance_private (self);
self->priv->preview_image = NULL;
self->priv->background_color.red = 0.2;
self->priv->background_color.green = 0.2;
diff --git a/extensions/file_viewer/gth-file-viewer-page.c b/extensions/file_viewer/gth-file-viewer-page.c
index 81f353e2..0abf6135 100644
--- a/extensions/file_viewer/gth-file-viewer-page.c
+++ b/extensions/file_viewer/gth-file-viewer-page.c
@@ -22,9 +22,6 @@
#include "gth-file-viewer-page.h"
-#define GTH_FILE_VIEWER_PAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTH_TYPE_FILE_VIEWER_PAGE,
GthFileViewerPagePrivate))
-
-
struct _GthFileViewerPagePrivate {
GthBrowser *browser;
GtkWidget *viewer;
@@ -41,8 +38,9 @@ static void gth_viewer_page_interface_init (GthViewerPageInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GthFileViewerPage,
gth_file_viewer_page,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthFileViewerPage)
G_IMPLEMENT_INTERFACE (GTH_TYPE_VIEWER_PAGE,
- gth_viewer_page_interface_init))
+ gth_viewer_page_interface_init))
static gboolean
@@ -307,7 +305,6 @@ gth_file_viewer_page_finalize (GObject *obj)
static void
gth_file_viewer_page_class_init (GthFileViewerPageClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthFileViewerPagePrivate));
G_OBJECT_CLASS (klass)->finalize = gth_file_viewer_page_finalize;
}
@@ -333,7 +330,7 @@ gth_viewer_page_interface_init (GthViewerPageInterface *iface)
static void
gth_file_viewer_page_init (GthFileViewerPage *self)
{
- self->priv = GTH_FILE_VIEWER_PAGE_GET_PRIVATE (self);
+ self->priv = gth_file_viewer_page_get_instance_private (self);
self->priv->thumb_loader = NULL;
self->priv->file_data = NULL;
}
diff --git a/extensions/find_duplicates/gth-find-duplicates.c
b/extensions/find_duplicates/gth-find-duplicates.c
index 64bcf8af..6c046658 100644
--- a/extensions/find_duplicates/gth-find-duplicates.c
+++ b/extensions/find_duplicates/gth-find-duplicates.c
@@ -70,8 +70,7 @@ SelectCommand select_commands[] = {
};
-struct _GthFindDuplicatesPrivate
-{
+struct _GthFindDuplicatesPrivate {
GthBrowser *browser;
GtkWidget *dialog;
GFile *location;
@@ -103,7 +102,10 @@ struct _GthFindDuplicatesPrivate
};
-G_DEFINE_TYPE (GthFindDuplicates, gth_find_duplicates, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthFindDuplicates,
+ gth_find_duplicates,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthFindDuplicates))
typedef struct {
@@ -175,8 +177,6 @@ gth_find_duplicates_class_init (GthFindDuplicatesClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthFindDuplicatesPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_find_duplicates_finalize;
}
@@ -185,7 +185,7 @@ gth_find_duplicates_class_init (GthFindDuplicatesClass *klass)
static void
gth_find_duplicates_init (GthFindDuplicates *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FIND_DUPLICATES, GthFindDuplicatesPrivate);
+ self->priv = gth_find_duplicates_get_instance_private (self);
self->priv->test = NULL;
self->priv->builder = NULL;
self->priv->attributes = NULL;
diff --git a/extensions/find_duplicates/gth-folder-chooser-dialog.c
b/extensions/find_duplicates/gth-folder-chooser-dialog.c
index 964f3154..d0c7639c 100644
--- a/extensions/find_duplicates/gth-folder-chooser-dialog.c
+++ b/extensions/find_duplicates/gth-folder-chooser-dialog.c
@@ -33,14 +33,17 @@ enum {
};
-G_DEFINE_TYPE (GthFolderChooserDialog, gth_folder_chooser_dialog, GTK_TYPE_DIALOG)
-
-
struct _GthFolderChooserDialogPrivate {
GtkBuilder *builder;
};
+G_DEFINE_TYPE_WITH_CODE (GthFolderChooserDialog,
+ gth_folder_chooser_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthFolderChooserDialog))
+
+
static void
gth_folder_chooser_dialog_finalize (GObject *object)
{
@@ -59,8 +62,6 @@ gth_folder_chooser_dialog_class_init (GthFolderChooserDialogClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthFolderChooserDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_folder_chooser_dialog_finalize;
}
@@ -96,7 +97,7 @@ gth_folder_chooser_dialog_init (GthFolderChooserDialog *self)
{
GtkWidget *content;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FOLDER_CHOOSER_DIALOG,
GthFolderChooserDialogPrivate);
+ self->priv = gth_folder_chooser_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("find-duplicates-choose-folders.ui",
"find_duplicates");
gtk_window_set_resizable (GTK_WINDOW (self), TRUE);
diff --git a/extensions/flicker_utils/flickr-photo.c b/extensions/flicker_utils/flickr-photo.c
index da03ab9e..32deed18 100644
--- a/extensions/flicker_utils/flickr-photo.c
+++ b/extensions/flicker_utils/flickr-photo.c
@@ -48,8 +48,9 @@ static void flickr_photo_dom_domizable_interface_init (DomDomizableInterface *if
G_DEFINE_TYPE_WITH_CODE (FlickrPhoto,
flickr_photo,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (FlickrPhoto)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- flickr_photo_dom_domizable_interface_init))
+ flickr_photo_dom_domizable_interface_init))
static void
@@ -77,7 +78,6 @@ flickr_photo_finalize (GObject *obj)
static void
flickr_photo_class_init (FlickrPhotoClass *klass)
{
- g_type_class_add_private (klass, sizeof (FlickrPhotoPrivate));
G_OBJECT_CLASS (klass)->finalize = flickr_photo_finalize;
}
@@ -150,7 +150,7 @@ flickr_photo_init (FlickrPhoto *self)
{
int i;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, FLICKR_TYPE_PHOTO, FlickrPhotoPrivate);
+ self->priv = flickr_photo_get_instance_private (self);
self->priv->server = NULL;
self->id = NULL;
diff --git a/extensions/flicker_utils/flickr-service.c b/extensions/flicker_utils/flickr-service.c
index 4eb1ab66..db724b8e 100644
--- a/extensions/flicker_utils/flickr-service.c
+++ b/extensions/flicker_utils/flickr-service.c
@@ -34,9 +34,6 @@
#define RESPONSE_FORMAT "rest"
-G_DEFINE_TYPE (FlickrService, flickr_service, OAUTH_TYPE_SERVICE)
-
-
enum {
PROP_0,
PROP_SERVER
@@ -112,6 +109,12 @@ struct _FlickrServicePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (FlickrService,
+ flickr_service,
+ OAUTH_TYPE_SERVICE,
+ G_ADD_PRIVATE (FlickrService))
+
+
static void
flickr_service_set_property (GObject *object,
guint property_id,
@@ -716,8 +719,6 @@ flickr_service_class_init (FlickrServiceClass *klass)
GObjectClass *object_class;
WebServiceClass *service_class;
- g_type_class_add_private (klass, sizeof (FlickrServicePrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = flickr_service_set_property;
object_class->get_property = flickr_service_get_property;
@@ -741,7 +742,7 @@ flickr_service_class_init (FlickrServiceClass *klass)
static void
flickr_service_init (FlickrService *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, FLICKR_TYPE_SERVICE, FlickrServicePrivate);
+ self->priv = flickr_service_get_instance_private (self);
self->priv->post_photos = NULL;
self->priv->add_photos = NULL;
self->priv->server = NULL;
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c
b/extensions/gstreamer_tools/gth-media-viewer-page.c
index 43205e0d..4f2accaf 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -37,13 +37,6 @@
static void gth_viewer_page_interface_init (GthViewerPageInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthMediaViewerPage,
- gth_media_viewer_page,
- G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_VIEWER_PAGE,
- gth_viewer_page_interface_init))
-
-
struct _GthMediaViewerPagePrivate {
GthBrowser *browser;
GthFileData *file_data;
@@ -79,6 +72,14 @@ struct _GthMediaViewerPagePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthMediaViewerPage,
+ gth_media_viewer_page,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthMediaViewerPage)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_VIEWER_PAGE,
+ gth_viewer_page_interface_init))
+
+
static double default_rates[] = { 0.03, 0.06, 0.12, 0.25, 0.33, 0.50, 0.66, 1.0, 1.50, 2.0, 3.0, 4.0, 8.0,
16.0, 32.0 };
@@ -1332,8 +1333,6 @@ gth_media_viewer_page_finalize (GObject *obj)
static void
gth_media_viewer_page_class_init (GthMediaViewerPageClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthMediaViewerPagePrivate));
-
G_OBJECT_CLASS (klass)->finalize = gth_media_viewer_page_finalize;
}
@@ -1362,7 +1361,7 @@ gth_viewer_page_interface_init (GthViewerPageInterface *iface)
static void
gth_media_viewer_page_init (GthMediaViewerPage *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_MEDIA_VIEWER_PAGE,
GthMediaViewerPagePrivate);
+ self->priv = gth_media_viewer_page_get_instance_private (self);
self->priv->update_progress_id = 0;
self->priv->update_volume_id = 0;
self->priv->has_video = FALSE;
diff --git a/extensions/image_print/gth-image-print-job.c b/extensions/image_print/gth-image-print-job.c
index 14573843..aeb12b0e 100644
--- a/extensions/image_print/gth-image-print-job.c
+++ b/extensions/image_print/gth-image-print-job.c
@@ -33,9 +33,6 @@
#define GET_WIDGET(name) _gtk_builder_get_widget (self->priv->builder, (name))
-G_DEFINE_TYPE (GthImagePrintJob, gth_image_print_job, G_TYPE_OBJECT)
-
-
struct _GthImagePrintJobPrivate {
GSettings *settings;
GtkPrintOperationAction action;
@@ -90,6 +87,12 @@ struct _GthImagePrintJobPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImagePrintJob,
+ gth_image_print_job,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImagePrintJob))
+
+
static void
gth_image_print_job_finalize (GObject *base)
{
@@ -125,8 +128,6 @@ gth_image_print_job_class_init (GthImagePrintJobClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthImagePrintJobPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_image_print_job_finalize;
}
@@ -135,7 +136,7 @@ gth_image_print_job_class_init (GthImagePrintJobClass *klass)
static void
gth_image_print_job_init (GthImagePrintJob *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_PRINT_JOB, GthImagePrintJobPrivate);
+ self->priv = gth_image_print_job_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_PRINT_SCHEMA);
self->priv->event_name = NULL;
self->priv->builder = NULL;
diff --git a/extensions/image_print/gth-load-image-info-task.c
b/extensions/image_print/gth-load-image-info-task.c
index 57596178..a96b201f 100644
--- a/extensions/image_print/gth-load-image-info-task.c
+++ b/extensions/image_print/gth-load-image-info-task.c
@@ -32,7 +32,10 @@ struct _GthLoadImageInfoTaskPrivate {
};
-G_DEFINE_TYPE (GthLoadImageInfoTask, gth_load_image_info_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthLoadImageInfoTask,
+ gth_load_image_info_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthLoadImageInfoTask))
static void
@@ -210,8 +213,6 @@ gth_load_image_info_task_class_init (GthLoadImageInfoTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthLoadImageInfoTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_load_image_info_task_finalize;
@@ -224,7 +225,7 @@ gth_load_image_info_task_class_init (GthLoadImageInfoTaskClass *klass)
static void
gth_load_image_info_task_init (GthLoadImageInfoTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_LOAD_IMAGE_INFO_TASK,
GthLoadImageInfoTaskPrivate);
+ self->priv = gth_load_image_info_task_get_instance_private (self);
self->priv->loader = gth_image_loader_new (NULL, NULL);
}
diff --git a/extensions/image_rotation/gth-reset-orientation-task.c
b/extensions/image_rotation/gth-reset-orientation-task.c
index 7f076d55..52d2da99 100644
--- a/extensions/image_rotation/gth-reset-orientation-task.c
+++ b/extensions/image_rotation/gth-reset-orientation-task.c
@@ -23,9 +23,6 @@
#include "gth-reset-orientation-task.h"
-G_DEFINE_TYPE (GthResetOrientationTask, gth_reset_orientation_task, GTH_TYPE_TASK)
-
-
struct _GthResetOrientationTaskPrivate {
GthBrowser *browser;
GList *file_list;
@@ -36,6 +33,12 @@ struct _GthResetOrientationTaskPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthResetOrientationTask,
+ gth_reset_orientation_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthResetOrientationTask))
+
+
static void
gth_reset_orientation_task_finalize (GObject *object)
{
@@ -173,8 +176,6 @@ gth_reset_orientation_task_class_init (GthResetOrientationTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthResetOrientationTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_reset_orientation_task_finalize;
@@ -186,7 +187,7 @@ gth_reset_orientation_task_class_init (GthResetOrientationTaskClass *klass)
static void
gth_reset_orientation_task_init (GthResetOrientationTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_RESET_ORIENTATION_TASK,
GthResetOrientationTaskPrivate);
+ self->priv = gth_reset_orientation_task_get_instance_private (self);
self->priv->file_data = NULL;
}
diff --git a/extensions/image_rotation/gth-transform-task.c b/extensions/image_rotation/gth-transform-task.c
index dc47d12e..fa006f05 100644
--- a/extensions/image_rotation/gth-transform-task.c
+++ b/extensions/image_rotation/gth-transform-task.c
@@ -24,9 +24,6 @@
#include "rotation-utils.h"
-G_DEFINE_TYPE (GthTransformTask, gth_transform_task, GTH_TYPE_TASK)
-
-
struct _GthTransformTaskPrivate {
GthBrowser *browser;
GList *file_list;
@@ -39,6 +36,12 @@ struct _GthTransformTaskPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthTransformTask,
+ gth_transform_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthTransformTask))
+
+
static void
gth_transform_task_finalize (GObject *object)
{
@@ -200,8 +203,6 @@ gth_transform_task_class_init (GthTransformTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthTransformTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_transform_task_finalize;
@@ -213,7 +214,7 @@ gth_transform_task_class_init (GthTransformTaskClass *klass)
static void
gth_transform_task_init (GthTransformTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TRANSFORM_TASK, GthTransformTaskPrivate);
+ self->priv = gth_transform_task_get_instance_private (self);
self->priv->default_action = JPEG_MCU_ACTION_ABORT;
self->priv->file_data = NULL;
}
diff --git a/extensions/image_viewer/gth-image-histogram.c b/extensions/image_viewer/gth-image-histogram.c
index c6766b42..54032167 100644
--- a/extensions/image_viewer/gth-image-histogram.c
+++ b/extensions/image_viewer/gth-image-histogram.c
@@ -35,21 +35,22 @@ static void gth_image_histogram_gth_multipage_child_interface_init (GthMultipage
static void gth_image_histogram_gth_property_view_interface_init (GthPropertyViewInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthImageHistogram,
- gth_image_histogram,
- GTK_TYPE_BOX,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_MULTIPAGE_CHILD,
- gth_image_histogram_gth_multipage_child_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_PROPERTY_VIEW,
- gth_image_histogram_gth_property_view_interface_init))
-
-
struct _GthImageHistogramPrivate {
GthHistogram *histogram;
GtkWidget *histogram_view;
};
+G_DEFINE_TYPE_WITH_CODE (GthImageHistogram,
+ gth_image_histogram,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthImageHistogram)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_MULTIPAGE_CHILD,
+ gth_image_histogram_gth_multipage_child_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_PROPERTY_VIEW,
+ gth_image_histogram_gth_property_view_interface_init))
+
+
static void
gth_image_histogram_real_set_file (GthPropertyView *base,
GthFileData *file_data)
@@ -106,7 +107,6 @@ gth_image_histogram_finalize (GObject *base)
static void
gth_image_histogram_class_init (GthImageHistogramClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthImageHistogramPrivate));
G_OBJECT_CLASS (klass)->finalize = gth_image_histogram_finalize;
}
@@ -145,7 +145,7 @@ gth_image_histogram_init (GthImageHistogram *self)
{
GSettings *settings;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_HISTOGRAM, GthImageHistogramPrivate);
+ self->priv = gth_image_histogram_get_instance_private (self);
self->priv->histogram = gth_histogram_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
diff --git a/extensions/image_viewer/gth-image-viewer-page-tool.c
b/extensions/image_viewer/gth-image-viewer-page-tool.c
index c82b7ed4..a492e241 100644
--- a/extensions/image_viewer/gth-image-viewer-page-tool.c
+++ b/extensions/image_viewer/gth-image-viewer-page-tool.c
@@ -24,15 +24,18 @@
#include "gth-image-viewer-page-tool.h"
-G_DEFINE_TYPE (GthImageViewerPageTool, gth_image_viewer_page_tool, GTH_TYPE_FILE_TOOL)
-
-
struct _GthImageViewerPageToolPrivate {
cairo_surface_t *source;
GthTask *image_task;
};
+G_DEFINE_TYPE_WITH_CODE (GthImageViewerPageTool,
+ gth_image_viewer_page_tool,
+ GTH_TYPE_FILE_TOOL,
+ G_ADD_PRIVATE (GthImageViewerPageTool))
+
+
static void
original_image_task_completed_cb (GthTask *task,
GError *error,
@@ -147,8 +150,6 @@ gth_image_viewer_page_tool_class_init (GthImageViewerPageToolClass *klass)
GObjectClass *gobject_class;
GthFileToolClass *file_tool_class;
- g_type_class_add_private (klass, sizeof (GthImageViewerPageToolPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_image_viewer_page_tool_finalize;
@@ -165,7 +166,7 @@ gth_image_viewer_page_tool_class_init (GthImageViewerPageToolClass *klass)
static void
gth_image_viewer_page_tool_init (GthImageViewerPageTool *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
GthImageViewerPageToolPrivate);
+ self->priv = gth_image_viewer_page_tool_get_instance_private (self);
self->priv->source = NULL;
self->priv->image_task = NULL;
}
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index d78c18c0..f7714d82 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -45,13 +45,6 @@
static void gth_viewer_page_interface_init (GthViewerPageInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthImageViewerPage,
- gth_image_viewer_page,
- G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_VIEWER_PAGE,
- gth_viewer_page_interface_init))
-
-
static const GActionEntry actions[] = {
{ "image-zoom-in", gth_browser_activate_image_zoom_in },
{ "image-zoom-out", gth_browser_activate_image_zoom_out },
@@ -116,6 +109,14 @@ struct _GthImageViewerPagePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImageViewerPage,
+ gth_image_viewer_page,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImageViewerPage)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_VIEWER_PAGE,
+ gth_viewer_page_interface_init))
+
+
static void
gth_image_viewer_page_file_loaded (GthImageViewerPage *self,
gboolean success)
@@ -1899,8 +1900,6 @@ gth_image_viewer_page_finalize (GObject *obj)
static void
gth_image_viewer_page_class_init (GthImageViewerPageClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthImageViewerPagePrivate));
-
G_OBJECT_CLASS (klass)->finalize = gth_image_viewer_page_finalize;
}
@@ -1932,7 +1931,7 @@ gth_image_viewer_page_init (GthImageViewerPage *self)
{
int i;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_VIEWER_PAGE,
GthImageViewerPagePrivate);
+ self->priv = gth_image_viewer_page_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_VIEWER_SCHEMA);
self->priv->preloader = NULL;
self->priv->file_popup_merge_id = 0;
diff --git a/extensions/image_viewer/gth-image-viewer-task.c b/extensions/image_viewer/gth-image-viewer-task.c
index 8f803091..a4947624 100644
--- a/extensions/image_viewer/gth-image-viewer-task.c
+++ b/extensions/image_viewer/gth-image-viewer-task.c
@@ -33,7 +33,10 @@ struct _GthImageViewerTaskPrivate {
};
-G_DEFINE_TYPE (GthImageViewerTask, gth_image_viewer_task, GTH_TYPE_IMAGE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthImageViewerTask,
+ gth_image_viewer_task,
+ GTH_TYPE_IMAGE_TASK,
+ G_ADD_PRIVATE (GthImageViewerTask))
static void
@@ -119,8 +122,6 @@ gth_image_viewer_task_class_init (GthImageViewerTaskClass *class)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (class, sizeof (GthImageViewerTaskPrivate));
-
object_class = G_OBJECT_CLASS (class);
object_class->finalize = gth_image_viewer_task_finalize;
@@ -132,7 +133,7 @@ gth_image_viewer_task_class_init (GthImageViewerTaskClass *class)
static void
gth_image_viewer_task_init (GthImageViewerTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_VIEWER_TASK,
GthImageViewerTaskPrivate);
+ self->priv = gth_image_viewer_task_get_instance_private (self);
self->priv->viewer_page = NULL;
self->priv->original_image_task = NULL;
self->priv->load_original = TRUE;
diff --git a/extensions/importer/gth-import-destination-button.c
b/extensions/importer/gth-import-destination-button.c
index 3555a6ea..e4d59906 100644
--- a/extensions/importer/gth-import-destination-button.c
+++ b/extensions/importer/gth-import-destination-button.c
@@ -24,9 +24,6 @@
#include "gth-import-destination-button.h"
-G_DEFINE_TYPE (GthImportDestinationButton, gth_import_destination_button, GTK_TYPE_BUTTON)
-
-
struct _GthImportDestinationButtonPrivate {
GtkWidget *destination_icon;
GtkWidget *destination_label;
@@ -34,10 +31,16 @@ struct _GthImportDestinationButtonPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImportDestinationButton,
+ gth_import_destination_button,
+ GTK_TYPE_BUTTON,
+ G_ADD_PRIVATE (GthImportDestinationButton))
+
+
static void
gth_import_destination_button_class_init (GthImportDestinationButtonClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthImportDestinationButtonPrivate));
+ /* void */
}
@@ -47,7 +50,7 @@ gth_import_destination_button_init (GthImportDestinationButton *self)
GtkWidget *box;
GtkWidget *label_box;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMPORT_DESTINATION_BUTTON,
GthImportDestinationButtonPrivate);
+ self->priv = gth_import_destination_button_get_instance_private (self);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_show (box);
diff --git a/extensions/importer/gth-import-preferences-dialog.c
b/extensions/importer/gth-import-preferences-dialog.c
index b37de8dd..44d1e48c 100644
--- a/extensions/importer/gth-import-preferences-dialog.c
+++ b/extensions/importer/gth-import-preferences-dialog.c
@@ -30,9 +30,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (GthImportPreferencesDialog, gth_import_preferences_dialog, GTK_TYPE_DIALOG)
-
-
/* Signals */
enum {
DESTINATION_CHANGED,
@@ -53,6 +50,12 @@ struct _GthImportPreferencesDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImportPreferencesDialog,
+ gth_import_preferences_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthImportPreferencesDialog))
+
+
static void
gth_import_preferences_dialog_finalize (GObject *object)
{
@@ -73,8 +76,6 @@ gth_import_preferences_dialog_class_init (GthImportPreferencesDialogClass *klass
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthImportPreferencesDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_import_preferences_dialog_finalize;
@@ -310,7 +311,7 @@ gth_import_preferences_dialog_init (GthImportPreferencesDialog *self)
GthSubfolderType subfolder_type;
char *custom_format;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMPORT_PREFERENCES_DIALOG,
GthImportPreferencesDialogPrivate);
+ self->priv = gth_import_preferences_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("import-preferences.ui", "importer");
self->priv->settings = g_settings_new (GTHUMB_IMPORTER_SCHEMA);
self->priv->help_visible = FALSE;
diff --git a/extensions/importer/gth-import-task.c b/extensions/importer/gth-import-task.c
index fe2606fd..519e3956 100644
--- a/extensions/importer/gth-import-task.c
+++ b/extensions/importer/gth-import-task.c
@@ -31,9 +31,6 @@
#define IMPORTED_KEY "imported"
-G_DEFINE_TYPE (GthImportTask, gth_import_task, GTH_TYPE_TASK)
-
-
struct _GthImportTaskPrivate {
GthBrowser *browser;
GList *files;
@@ -65,6 +62,12 @@ struct _GthImportTaskPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImportTask,
+ gth_import_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthImportTask))
+
+
static void
gth_import_task_finalize (GObject *object)
{
@@ -759,8 +762,6 @@ gth_import_task_class_init (GthImportTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthImportTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_import_task_finalize;
@@ -772,7 +773,7 @@ gth_import_task_class_init (GthImportTaskClass *klass)
static void
gth_import_task_init (GthImportTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMPORT_TASK, GthImportTaskPrivate);
+ self->priv = gth_import_task_get_instance_private (self);
self->priv->catalogs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
self->priv->delete_not_supported = FALSE;
self->priv->destinations = g_hash_table_new_full (g_file_hash,
diff --git a/extensions/list_tools/gth-script-editor-dialog.c
b/extensions/list_tools/gth-script-editor-dialog.c
index dab45d6a..44a18b86 100644
--- a/extensions/list_tools/gth-script-editor-dialog.c
+++ b/extensions/list_tools/gth-script-editor-dialog.c
@@ -31,9 +31,6 @@
#define NO_SHORTCUT 0
-G_DEFINE_TYPE (GthScriptEditorDialog, gth_script_editor_dialog, GTK_TYPE_DIALOG)
-
-
enum {
SHORTCUT_NAME_COLUMN = 0,
SHORTCUT_SENSITIVE_COLUMN
@@ -51,6 +48,12 @@ struct _GthScriptEditorDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthScriptEditorDialog,
+ gth_script_editor_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthScriptEditorDialog))
+
+
static void
gth_script_editor_dialog_finalize (GObject *object)
{
@@ -58,12 +61,8 @@ gth_script_editor_dialog_finalize (GObject *object)
dialog = GTH_SCRIPT_EDITOR_DIALOG (object);
- if (dialog->priv != NULL) {
- g_object_unref (dialog->priv->builder);
- g_free (dialog->priv->script_id);
- g_free (dialog->priv);
- dialog->priv = NULL;
- }
+ g_object_unref (dialog->priv->builder);
+ g_free (dialog->priv->script_id);
G_OBJECT_CLASS (gth_script_editor_dialog_parent_class)->finalize (object);
}
@@ -82,7 +81,14 @@ gth_script_editor_dialog_class_init (GthScriptEditorDialogClass *class)
static void
gth_script_editor_dialog_init (GthScriptEditorDialog *dialog)
{
- dialog->priv = g_new0 (GthScriptEditorDialogPrivate, 1);
+ dialog->priv = gth_script_editor_dialog_get_instance_private (dialog);
+ dialog->priv->builder = NULL;
+ dialog->priv->accel_button = NULL;
+ dialog->priv->script_id = NULL;
+ dialog->priv->script_visible = FALSE;
+ dialog->priv->wait_command = FALSE;
+ dialog->priv->shell_script = FALSE;
+ dialog->priv->for_each_file = FALSE;
dialog->priv->help_visible = FALSE;
}
diff --git a/extensions/list_tools/gth-script-file.c b/extensions/list_tools/gth-script-file.c
index b5465b3c..a464fadc 100644
--- a/extensions/list_tools/gth-script-file.c
+++ b/extensions/list_tools/gth-script-file.c
@@ -48,7 +48,10 @@ static guint gth_script_file_signals[LAST_SIGNAL] = { 0 };
static GType gth_script_file_get_type (void);
-G_DEFINE_TYPE (GthScriptFile, gth_script_file, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthScriptFile,
+ gth_script_file,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthScriptFile))
static void
@@ -68,8 +71,6 @@ gth_script_file_class_init (GthScriptFileClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthScriptFilePrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_script_file_finalize;
@@ -88,7 +89,7 @@ gth_script_file_class_init (GthScriptFileClass *klass)
static void
gth_script_file_init (GthScriptFile *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SCRIPT_FILE, GthScriptFilePrivate);
+ self->priv = gth_script_file_get_instance_private (self);
self->priv->items = NULL;
self->priv->loaded = FALSE;
}
diff --git a/extensions/list_tools/gth-script-task.c b/extensions/list_tools/gth-script-task.c
index 09d0963c..ed689e84 100644
--- a/extensions/list_tools/gth-script-task.c
+++ b/extensions/list_tools/gth-script-task.c
@@ -23,9 +23,6 @@
#include "gth-script-task.h"
-G_DEFINE_TYPE (GthScriptTask, gth_script_task, GTH_TYPE_TASK)
-
-
struct _GthScriptTaskPrivate {
GthScript *script;
GtkWindow *parent;
@@ -38,6 +35,12 @@ struct _GthScriptTaskPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthScriptTask,
+ gth_script_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthScriptTask))
+
+
static void
gth_script_task_finalize (GObject *object)
{
@@ -258,8 +261,6 @@ gth_script_task_class_init (GthScriptTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthScriptTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_script_task_finalize;
@@ -272,7 +273,7 @@ gth_script_task_class_init (GthScriptTaskClass *klass)
static void
gth_script_task_init (GthScriptTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SCRIPT_TASK, GthScriptTaskPrivate);
+ self->priv = gth_script_task_get_instance_private (self);
self->priv->pid = 0;
}
diff --git a/extensions/list_tools/gth-script.c b/extensions/list_tools/gth-script.c
index 0296376d..debdcf5d 100644
--- a/extensions/list_tools/gth-script.c
+++ b/extensions/list_tools/gth-script.c
@@ -29,15 +29,6 @@ static void gth_script_dom_domizable_interface_init (DomDomizableInterface *ifac
static void gth_script_gth_duplicable_interface_init (GthDuplicableInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthScript,
- gth_script,
- G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_script_dom_domizable_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_script_gth_duplicable_interface_init))
-
-
enum {
PROP_0,
PROP_ID,
@@ -69,6 +60,16 @@ struct _GthScriptPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthScript,
+ gth_script,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthScript)
+ G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
+ gth_script_dom_domizable_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
+ gth_script_gth_duplicable_interface_init))
+
+
static DomElement*
gth_script_real_create_element (DomDomizable *base,
DomDocument *doc)
@@ -255,8 +256,6 @@ gth_script_class_init (GthScriptClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthScriptPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gth_script_set_property;
object_class->get_property = gth_script_get_property;
@@ -341,7 +340,7 @@ gth_script_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_script_init (GthScript *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SCRIPT, GthScriptPrivate);
+ self->priv = gth_script_get_instance_private (self);
self->priv->id = NULL;
self->priv->display_name = NULL;
self->priv->command = NULL;
diff --git a/extensions/map_view/gth-map-view.c b/extensions/map_view/gth-map-view.c
index f492b6ef..612f8ca2 100644
--- a/extensions/map_view/gth-map-view.c
+++ b/extensions/map_view/gth-map-view.c
@@ -28,21 +28,12 @@
#include <gthumb.h>
#include "gth-map-view.h"
-#define GTH_MAP_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTH_TYPE_MAP_VIEW, GthMapViewPrivate))
#define LABEL_MAX_WIDTH 200
static void gth_map_view_gth_multipage_child_interface_init (GthMultipageChildInterface *iface);
static void gth_map_view_gth_property_view_interface_init (GthPropertyViewInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthMapView,
- gth_map_view,
- GTK_TYPE_BOX,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_MULTIPAGE_CHILD,
- gth_map_view_gth_multipage_child_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_PROPERTY_VIEW,
- gth_map_view_gth_property_view_interface_init))
-
struct _GthMapViewPrivate {
GtkWidget *no_gps_label;
@@ -53,6 +44,16 @@ struct _GthMapViewPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthMapView,
+ gth_map_view,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthMapView)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_MULTIPAGE_CHILD,
+ gth_map_view_gth_multipage_child_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_PROPERTY_VIEW,
+ gth_map_view_gth_property_view_interface_init))
+
+
/* Exif format: %d/%d %d/%d %d/%d */
static double
exif_coordinate_to_decimal (const char *raw)
@@ -250,8 +251,6 @@ gth_map_view_class_init (GthMapViewClass *klass)
{
GtkWidgetClass *widget_class;
- g_type_class_add_private (klass, sizeof (GthMapViewPrivate));
-
G_OBJECT_CLASS (klass)->finalize = gth_map_view_finalize;
widget_class = GTK_WIDGET_CLASS (klass);
@@ -265,7 +264,7 @@ gth_map_view_init (GthMapView *self)
{
ClutterActor *scale;
- self->priv = GTH_MAP_VIEW_GET_PRIVATE (self);
+ self->priv = gth_map_view_get_instance_private (self);
gtk_box_set_spacing (GTK_BOX (self), 6);
gtk_container_set_border_width (GTK_CONTAINER (self), 2);
diff --git a/extensions/oauth/oauth-account-chooser-dialog.c b/extensions/oauth/oauth-account-chooser-dialog.c
index 3de7d40d..f32d0a4a 100644
--- a/extensions/oauth/oauth-account-chooser-dialog.c
+++ b/extensions/oauth/oauth-account-chooser-dialog.c
@@ -26,9 +26,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (OAuthAccountChooserDialog, oauth_account_chooser_dialog, GTK_TYPE_DIALOG)
-
-
enum {
ACCOUNT_DATA_COLUMN,
ACCOUNT_NAME_COLUMN,
@@ -42,6 +39,12 @@ struct _OAuthAccountChooserDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (OAuthAccountChooserDialog,
+ oauth_account_chooser_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (OAuthAccountChooserDialog))
+
+
static void
oauth_account_chooser_dialog_finalize (GObject *object)
{
@@ -60,8 +63,6 @@ oauth_account_chooser_dialog_class_init (OAuthAccountChooserDialogClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (OAuthAccountChooserDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = oauth_account_chooser_dialog_finalize;
}
@@ -111,7 +112,7 @@ oauth_account_chooser_dialog_init (OAuthAccountChooserDialog *self)
{
GtkWidget *content;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, OAUTH_TYPE_ACCOUNT_CHOOSER_DIALOG,
OAuthAccountChooserDialogPrivate);
+ self->priv = oauth_account_chooser_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("oauth-account-chooser.ui", "oauth");
content = _gtk_builder_get_widget (self->priv->builder, "account_chooser");
diff --git a/extensions/oauth/oauth-account-manager-dialog.c b/extensions/oauth/oauth-account-manager-dialog.c
index dab316c5..c521c5de 100644
--- a/extensions/oauth/oauth-account-manager-dialog.c
+++ b/extensions/oauth/oauth-account-manager-dialog.c
@@ -28,9 +28,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (OAuthAccountManagerDialog, oauth_account_manager_dialog, GTK_TYPE_DIALOG)
-
-
enum {
ACCOUNT_DATA_COLUMN,
ACCOUNT_NAME_COLUMN,
@@ -42,6 +39,12 @@ struct _OAuthAccountManagerDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (OAuthAccountManagerDialog,
+ oauth_account_manager_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (OAuthAccountManagerDialog))
+
+
static void
oauth_account_manager_dialog_finalize (GObject *object)
{
@@ -60,8 +63,6 @@ oauth_account_manager_dialog_class_init (OAuthAccountManagerDialogClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (OAuthAccountManagerDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = oauth_account_manager_dialog_finalize;
}
@@ -134,7 +135,7 @@ oauth_account_manager_dialog_init (OAuthAccountManagerDialog *self)
{
GtkWidget *content;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, OAUTH_TYPE_ACCOUNT_MANAGER_DIALOG,
OAuthAccountManagerDialogPrivate);
+ self->priv = oauth_account_manager_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("oauth-account-manager.ui", "oauth");
content = _gtk_builder_get_widget (self->priv->builder, "account_manager");
diff --git a/extensions/oauth/oauth-ask-authorization-dialog.c
b/extensions/oauth/oauth-ask-authorization-dialog.c
index e1370264..3d802ded 100644
--- a/extensions/oauth/oauth-ask-authorization-dialog.c
+++ b/extensions/oauth/oauth-ask-authorization-dialog.c
@@ -30,9 +30,6 @@
#define _WEB_VIEW_PAGE 0
-G_DEFINE_TYPE (OAuthAskAuthorizationDialog, oauth_ask_authorization_dialog, GTK_TYPE_DIALOG)
-
-
/* Signals */
enum {
LOAD_REQUEST,
@@ -51,6 +48,12 @@ struct _OAuthAskAuthorizationDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (OAuthAskAuthorizationDialog,
+ oauth_ask_authorization_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (OAuthAskAuthorizationDialog))
+
+
static void
oauth_ask_authorization_dialog_finalize (GObject *obj)
{
@@ -68,8 +71,6 @@ oauth_ask_authorization_dialog_class_init (OAuthAskAuthorizationDialogClass *kla
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (OAuthAskAuthorizationDialogPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = oauth_ask_authorization_dialog_finalize;
@@ -208,7 +209,7 @@ oauth_ask_authorization_dialog_init (OAuthAskAuthorizationDialog *self)
{
GtkWidget *dialog_content;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, OAUTH_TYPE_ASK_AUTHORIZATION_DIALOG,
OAuthAskAuthorizationDialogPrivate);
+ self->priv = oauth_ask_authorization_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("oauth-ask-authorization.ui", "oauth");
gtk_window_set_default_size (GTK_WINDOW (self), 500, 500);
diff --git a/extensions/oauth/oauth-service.c b/extensions/oauth/oauth-service.c
index d8c7107e..736cd201 100644
--- a/extensions/oauth/oauth-service.c
+++ b/extensions/oauth/oauth-service.c
@@ -33,9 +33,6 @@
#define OAUTH_CALLBACK "http://localhost/"
-G_DEFINE_TYPE (OAuthService, oauth_service, WEB_TYPE_SERVICE)
-
-
enum {
PROP_0,
PROP_CONSUMER
@@ -53,6 +50,12 @@ struct _OAuthServicePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (OAuthService,
+ oauth_service,
+ WEB_TYPE_SERVICE,
+ G_ADD_PRIVATE (OAuthService))
+
+
static void
oauth_service_set_property (GObject *object,
guint property_id,
@@ -375,8 +378,6 @@ oauth_service_class_init (OAuthServiceClass *klass)
GObjectClass *object_class;
WebServiceClass *service_class;
- g_type_class_add_private (klass, sizeof (OAuthServicePrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = oauth_service_set_property;
object_class->get_property = oauth_service_get_property;
@@ -399,7 +400,7 @@ oauth_service_class_init (OAuthServiceClass *klass)
static void
oauth_service_init (OAuthService *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, OAUTH_TYPE_SERVICE, OAuthServicePrivate);
+ self->priv = oauth_service_get_instance_private (self);
self->priv->consumer = NULL;
self->priv->timestamp = NULL;
self->priv->nonce = NULL;
diff --git a/extensions/oauth/web-service.c b/extensions/oauth/web-service.c
index c8dee389..2bba7df1 100644
--- a/extensions/oauth/web-service.c
+++ b/extensions/oauth/web-service.c
@@ -47,9 +47,6 @@ web_service_error_quark (void)
}
-G_DEFINE_TYPE (WebService, web_service, GTH_TYPE_TASK)
-
-
enum {
PROP_0,
PROP_SERVICE_NAME,
@@ -91,6 +88,12 @@ struct _WebServicePrivate
};
+G_DEFINE_TYPE_WITH_CODE (WebService,
+ web_service,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (WebService))
+
+
static void
web_service_finalize (GObject *object)
{
@@ -223,8 +226,6 @@ web_service_class_init (WebServiceClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (WebServicePrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = web_service_finalize;
object_class->set_property = web_service_set_property;
@@ -311,7 +312,7 @@ web_service_class_init (WebServiceClass *klass)
static void
web_service_init (WebService *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WEB_TYPE_SERVICE, WebServicePrivate);
+ self->priv = web_service_get_instance_private (self);
self->priv->service_name = NULL;
self->priv->service_address = NULL;
self->priv->service_protocol = NULL;
diff --git a/extensions/picasaweb/picasa-album-properties-dialog.c
b/extensions/picasaweb/picasa-album-properties-dialog.c
index dfbc31c9..c49e2313 100644
--- a/extensions/picasaweb/picasa-album-properties-dialog.c
+++ b/extensions/picasaweb/picasa-album-properties-dialog.c
@@ -27,14 +27,17 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (PicasaAlbumPropertiesDialog, picasa_album_properties_dialog, GTK_TYPE_DIALOG)
-
-
struct _PicasaAlbumPropertiesDialogPrivate {
GtkBuilder *builder;
};
+G_DEFINE_TYPE_WITH_CODE (PicasaAlbumPropertiesDialog,
+ picasa_album_properties_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (PicasaAlbumPropertiesDialog))
+
+
static void
picasa_album_properties_dialog_finalize (GObject *object)
{
@@ -52,8 +55,6 @@ picasa_album_properties_dialog_class_init (PicasaAlbumPropertiesDialogClass *kla
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (PicasaAlbumPropertiesDialogPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = picasa_album_properties_dialog_finalize;
}
@@ -64,7 +65,7 @@ picasa_album_properties_dialog_init (PicasaAlbumPropertiesDialog *self)
{
GtkWidget *content;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, PICASA_TYPE_ALBUM_PROPERTIES_DIALOG,
PicasaAlbumPropertiesDialogPrivate);
+ self->priv = picasa_album_properties_dialog_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("picasa-web-album-properties.ui", "picasaweb");
content = _gtk_builder_get_widget (self->priv->builder, "album_properties");
diff --git a/extensions/picasaweb/picasa-web-service.c b/extensions/picasaweb/picasa-web-service.c
index 217e3dc3..40e3b3a1 100644
--- a/extensions/picasaweb/picasa-web-service.c
+++ b/extensions/picasaweb/picasa-web-service.c
@@ -79,9 +79,6 @@ post_photos_data_free (PostPhotosData *post_photos)
/* -- picasa_web_service -- */
-G_DEFINE_TYPE (PicasaWebService, picasa_web_service, WEB_TYPE_SERVICE)
-
-
struct _PicasaWebServicePrivate {
char *access_token;
char *refresh_token;
@@ -92,6 +89,12 @@ struct _PicasaWebServicePrivate {
};
+G_DEFINE_TYPE_WITH_CODE (PicasaWebService,
+ picasa_web_service,
+ WEB_TYPE_SERVICE,
+ G_ADD_PRIVATE (PicasaWebService))
+
+
static void
picasa_web_service_finalize (GObject *object)
{
@@ -600,8 +603,6 @@ picasa_web_service_class_init (PicasaWebServiceClass *klass)
GObjectClass *object_class;
WebServiceClass *service_class;
- g_type_class_add_private (klass, sizeof (PicasaWebServicePrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = picasa_web_service_finalize;
@@ -614,7 +615,7 @@ picasa_web_service_class_init (PicasaWebServiceClass *klass)
static void
picasa_web_service_init (PicasaWebService *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, PICASA_TYPE_WEB_SERVICE, PicasaWebServicePrivate);
+ self->priv = picasa_web_service_get_instance_private (self);
self->priv->refresh_token = NULL;
self->priv->access_token = NULL;
self->priv->quota_limit = 0;
diff --git a/extensions/red_eye_removal/gth-file-tool-red-eye.c
b/extensions/red_eye_removal/gth-file-tool-red-eye.c
index 8e9db65a..11c20676 100644
--- a/extensions/red_eye_removal/gth-file-tool-red-eye.c
+++ b/extensions/red_eye_removal/gth-file-tool-red-eye.c
@@ -44,7 +44,10 @@ struct _GthFileToolRedEyePrivate {
};
-G_DEFINE_TYPE (GthFileToolRedEye, gth_file_tool_red_eye, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
+G_DEFINE_TYPE_WITH_CODE (GthFileToolRedEye,
+ gth_file_tool_red_eye,
+ GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL,
+ G_ADD_PRIVATE (GthFileToolRedEye))
static int
@@ -446,8 +449,6 @@ gth_file_tool_red_eye_class_init (GthFileToolRedEyeClass *klass)
GthFileToolClass *file_tool_class;
GthImageViewerPageToolClass *image_viewer_page_tool_class;
- g_type_class_add_private (klass, sizeof (GthFileToolRedEyePrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_red_eye_finalize;
@@ -464,7 +465,7 @@ gth_file_tool_red_eye_class_init (GthFileToolRedEyeClass *klass)
static void
gth_file_tool_red_eye_init (GthFileToolRedEye *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_RED_EYE, GthFileToolRedEyePrivate);
+ self->priv = gth_file_tool_red_eye_get_instance_private (self);
self->priv->new_pixbuf = NULL;
self->priv->is_red = NULL;
gth_file_tool_construct (GTH_FILE_TOOL (self), "image-red-eye-symbolic", _("Red Eye Removal"),
GTH_TOOLBOX_SECTION_COLORS);
diff --git a/extensions/rename_series/gth-rename-task.c b/extensions/rename_series/gth-rename-task.c
index 66a67092..4be302d1 100644
--- a/extensions/rename_series/gth-rename-task.c
+++ b/extensions/rename_series/gth-rename-task.c
@@ -23,9 +23,6 @@
#include "gth-rename-task.h"
-G_DEFINE_TYPE (GthRenameTask, gth_rename_task, GTH_TYPE_TASK)
-
-
struct _GthRenameTaskPrivate {
GList *old_files;
GList *new_files;
@@ -39,6 +36,12 @@ struct _GthRenameTaskPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthRenameTask,
+ gth_rename_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthRenameTask))
+
+
static void
gth_rename_task_finalize (GObject *object)
{
@@ -246,8 +249,6 @@ gth_rename_task_class_init (GthRenameTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthRenameTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_rename_task_finalize;
@@ -259,7 +260,7 @@ gth_rename_task_class_init (GthRenameTaskClass *klass)
static void
gth_rename_task_init (GthRenameTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_RENAME_TASK, GthRenameTaskPrivate);
+ self->priv = gth_rename_task_get_instance_private (self);
self->priv->default_response = GTH_OVERWRITE_RESPONSE_UNSPECIFIED;
}
diff --git a/extensions/rename_series/gth-template-editor-dialog.c
b/extensions/rename_series/gth-template-editor-dialog.c
index 9ec50f99..8673e51e 100644
--- a/extensions/rename_series/gth-template-editor-dialog.c
+++ b/extensions/rename_series/gth-template-editor-dialog.c
@@ -30,9 +30,6 @@
#define GET_WIDGET(name) _gtk_builder_get_widget (self->priv->builder, (name))
-G_DEFINE_TYPE (GthTemplateEditorDialog, gth_template_editor_dialog, GTK_TYPE_DIALOG)
-
-
struct _GthTemplateEditorDialogPrivate {
GtkWidget *content;
GRegex *re;
@@ -41,6 +38,12 @@ struct _GthTemplateEditorDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthTemplateEditorDialog,
+ gth_template_editor_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthTemplateEditorDialog))
+
+
static void
gth_template_editor_dialog_finalize (GObject *object)
{
@@ -48,12 +51,8 @@ gth_template_editor_dialog_finalize (GObject *object)
dialog = GTH_TEMPLATE_EDITOR_DIALOG (object);
- if (dialog->priv != NULL) {
- if (dialog->priv->re != NULL)
- g_regex_unref (dialog->priv->re);
- g_free (dialog->priv);
- dialog->priv = NULL;
- }
+ if (dialog->priv->re != NULL)
+ g_regex_unref (dialog->priv->re);
G_OBJECT_CLASS (gth_template_editor_dialog_parent_class)->finalize (object);
}
@@ -72,8 +71,11 @@ gth_template_editor_dialog_class_init (GthTemplateEditorDialogClass *class)
static void
gth_template_editor_dialog_init (GthTemplateEditorDialog *dialog)
{
- dialog->priv = g_new0 (GthTemplateEditorDialogPrivate, 1);
+ dialog->priv = gth_template_editor_dialog_get_instance_private (dialog);
+ dialog->priv->content = NULL;
dialog->priv->re = NULL;
+ dialog->priv->allowed_codes = NULL;
+ dialog->priv->n_codes = 0;
}
diff --git a/extensions/rename_series/gth-template-selector.c
b/extensions/rename_series/gth-template-selector.c
index 8ce2bb5b..bb4f0b69 100644
--- a/extensions/rename_series/gth-template-selector.c
+++ b/extensions/rename_series/gth-template-selector.c
@@ -28,9 +28,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
-G_DEFINE_TYPE (GthTemplateSelector, gth_template_selector, GTK_TYPE_BOX)
-
-
enum {
TYPE_DATA_COLUMN,
TYPE_NAME_COLUMN,
@@ -61,6 +58,13 @@ struct _GthTemplateSelectorPrivate {
GtkBuilder *builder;
};
+
+G_DEFINE_TYPE_WITH_CODE (GthTemplateSelector,
+ gth_template_selector,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthTemplateSelector))
+
+
static char * Date_Formats[] = { "%Y-%m-%d--%H.%M.%S", "%Y-%m-%d", "%x %X", "%x", NULL };
static guint gth_template_selector_signals[LAST_SIGNAL] = { 0 };
@@ -72,11 +76,7 @@ gth_template_selector_finalize (GObject *object)
selector = GTH_TEMPLATE_SELECTOR (object);
- if (selector->priv != NULL) {
- _g_object_unref (selector->priv->builder);
- g_free (selector->priv);
- selector->priv = NULL;
- }
+ _g_object_unref (selector->priv->builder);
G_OBJECT_CLASS (gth_template_selector_parent_class)->finalize (object);
}
@@ -113,7 +113,7 @@ gth_template_selector_class_init (GthTemplateSelectorClass *klass)
static void
gth_template_selector_init (GthTemplateSelector *self)
{
- self->priv = g_new0 (GthTemplateSelectorPrivate, 1);
+ self->priv = gth_template_selector_get_instance_private (self);
self->priv->builder = NULL;
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_HORIZONTAL);
diff --git a/extensions/search/gth-search-editor-dialog.c b/extensions/search/gth-search-editor-dialog.c
index 6713b891..8bff4c31 100644
--- a/extensions/search/gth-search-editor-dialog.c
+++ b/extensions/search/gth-search-editor-dialog.c
@@ -27,43 +27,29 @@
#include "gth-search-editor-dialog.h"
-G_DEFINE_TYPE (GthSearchEditorDialog, gth_search_editor_dialog, GTK_TYPE_DIALOG)
-
-
struct _GthSearchEditorDialogPrivate {
GtkWidget *search_editor;
};
-static void
-gth_search_editor_dialog_finalize (GObject *object)
-{
- GthSearchEditorDialog *dialog;
-
- dialog = GTH_SEARCH_EDITOR_DIALOG (object);
-
- if (dialog->priv != NULL) {
- g_free (dialog->priv);
- dialog->priv = NULL;
- }
+G_DEFINE_TYPE_WITH_CODE (GthSearchEditorDialog,
+ gth_search_editor_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthSearchEditorDialog))
- G_OBJECT_CLASS (gth_search_editor_dialog_parent_class)->finalize (object);
-}
static void
gth_search_editor_dialog_class_init (GthSearchEditorDialogClass *class)
{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) class;
- object_class->finalize = gth_search_editor_dialog_finalize;
+ /* void */
}
static void
gth_search_editor_dialog_init (GthSearchEditorDialog *dialog)
{
- dialog->priv = g_new0 (GthSearchEditorDialogPrivate, 1);
+ dialog->priv = gth_search_editor_dialog_get_instance_private (dialog);
+ dialog->priv->search_editor = NULL;
}
diff --git a/extensions/search/gth-search-editor.c b/extensions/search/gth-search-editor.c
index 7cc19633..c1f42b0a 100644
--- a/extensions/search/gth-search-editor.c
+++ b/extensions/search/gth-search-editor.c
@@ -29,9 +29,6 @@
#define GET_WIDGET(name) _gtk_builder_get_widget (self->priv->builder, (name))
-G_DEFINE_TYPE (GthSearchEditor, gth_search_editor, GTK_TYPE_BOX)
-
-
struct _GthSearchEditorPrivate {
GtkBuilder *builder;
GtkWidget *location_chooser;
@@ -39,6 +36,12 @@ struct _GthSearchEditorPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthSearchEditor,
+ gth_search_editor,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthSearchEditor))
+
+
static void
gth_search_editor_finalize (GObject *object)
{
@@ -46,11 +49,7 @@ gth_search_editor_finalize (GObject *object)
dialog = GTH_SEARCH_EDITOR (object);
- if (dialog->priv != NULL) {
- g_object_unref (dialog->priv->builder);
- g_free (dialog->priv);
- dialog->priv = NULL;
- }
+ _g_object_unref (dialog->priv->builder);
G_OBJECT_CLASS (gth_search_editor_parent_class)->finalize (object);
}
@@ -68,7 +67,10 @@ gth_search_editor_class_init (GthSearchEditorClass *class)
static void
gth_search_editor_init (GthSearchEditor *dialog)
{
- dialog->priv = g_new0 (GthSearchEditorPrivate, 1);
+ dialog->priv = gth_search_editor_get_instance_private (dialog);
+ dialog->priv->builder = NULL;
+ dialog->priv->location_chooser = NULL;
+ dialog->priv->match_type_combobox = NULL;
gtk_orientable_set_orientation (GTK_ORIENTABLE (dialog), GTK_ORIENTATION_VERTICAL);
}
diff --git a/extensions/search/gth-search-task.c b/extensions/search/gth-search-task.c
index 8b46c36d..1dd7dea3 100644
--- a/extensions/search/gth-search-task.c
+++ b/extensions/search/gth-search-task.c
@@ -27,11 +27,7 @@
#include "gth-search-task.h"
-G_DEFINE_TYPE (GthSearchTask, gth_search_task, GTH_TYPE_TASK)
-
-
-struct _GthSearchTaskPrivate
-{
+struct _GthSearchTaskPrivate {
GthBrowser *browser;
GthSearch *search;
GthTestChain *test;
@@ -46,6 +42,12 @@ struct _GthSearchTaskPrivate
};
+G_DEFINE_TYPE_WITH_CODE (GthSearchTask,
+ gth_search_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthSearchTask))
+
+
static void
browser_unref_cb (gpointer data,
GObject *browser)
@@ -61,16 +63,12 @@ gth_search_task_finalize (GObject *object)
task = GTH_SEARCH_TASK (object);
- if (task->priv != NULL) {
- g_object_unref (task->priv->file_source);
- g_object_unref (task->priv->search);
- g_object_unref (task->priv->test);
- g_object_unref (task->priv->search_catalog);
- if (task->priv->browser != NULL)
- g_object_weak_unref (G_OBJECT (task->priv->browser), browser_unref_cb, task);
- g_free (task->priv);
- task->priv = NULL;
- }
+ g_object_unref (task->priv->file_source);
+ g_object_unref (task->priv->search);
+ g_object_unref (task->priv->test);
+ g_object_unref (task->priv->search_catalog);
+ if (task->priv->browser != NULL)
+ g_object_weak_unref (G_OBJECT (task->priv->browser), browser_unref_cb, task);
G_OBJECT_CLASS (gth_search_task_parent_class)->finalize (object);
}
@@ -441,7 +439,18 @@ gth_search_task_class_init (GthSearchTaskClass *class)
static void
gth_search_task_init (GthSearchTask *task)
{
- task->priv = g_new0 (GthSearchTaskPrivate, 1);
+ task->priv = gth_search_task_get_instance_private (task);
+ task->priv->browser = NULL;
+ task->priv->search = NULL;
+ task->priv->test = NULL;
+ task->priv->search_catalog = NULL;
+ task->priv->show_hidden_files = FALSE;
+ task->priv->io_operation = FALSE;
+ task->priv->error = NULL;
+ task->priv->location_ready_id = 0;
+ task->priv->dialog = NULL;
+ task->priv->file_source = NULL;
+ task->priv->n_files = 0;
}
diff --git a/extensions/search/gth-search.c b/extensions/search/gth-search.c
index 7d1dd091..7a5bbc04 100644
--- a/extensions/search/gth-search.c
+++ b/extensions/search/gth-search.c
@@ -32,15 +32,6 @@ static void gth_search_dom_domizable_interface_init (DomDomizableInterface *ifac
static void gth_search_gth_duplicable_interface_init (GthDuplicableInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthSearch,
- gth_search,
- GTH_TYPE_CATALOG,
- G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_search_dom_domizable_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_search_gth_duplicable_interface_init))
-
-
struct _GthSearchPrivate {
GFile *folder;
gboolean recursive;
@@ -48,6 +39,16 @@ struct _GthSearchPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthSearch,
+ gth_search,
+ GTH_TYPE_CATALOG,
+ G_ADD_PRIVATE (GthSearch)
+ G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
+ gth_search_dom_domizable_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
+ gth_search_gth_duplicable_interface_init))
+
+
static DomDomizableInterface *dom_domizable_parent_iface = NULL;
static GthDuplicableInterface *gth_duplicable_parent_iface = NULL;
@@ -187,14 +188,10 @@ gth_search_finalize (GObject *object)
search = GTH_SEARCH (object);
- if (search->priv != NULL) {
- if (search->priv->folder != NULL)
- g_object_unref (search->priv->folder);
- if (search->priv->test != NULL)
- g_object_unref (search->priv->test);
- g_free (search->priv);
- search->priv = NULL;
- }
+ if (search->priv->folder != NULL)
+ g_object_unref (search->priv->folder);
+ if (search->priv->test != NULL)
+ g_object_unref (search->priv->test);
G_OBJECT_CLASS (gth_search_parent_class)->finalize (object);
}
@@ -236,7 +233,10 @@ gth_search_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_search_init (GthSearch *search)
{
- search->priv = g_new0 (GthSearchPrivate, 1);
+ search->priv = gth_search_get_instance_private (search);
+ search->priv->folder = NULL;
+ search->priv->recursive = FALSE;
+ search->priv->test = NULL;
}
diff --git a/extensions/selections/gth-file-source-selections.c
b/extensions/selections/gth-file-source-selections.c
index cf97e5a5..5fdae8a0 100644
--- a/extensions/selections/gth-file-source-selections.c
+++ b/extensions/selections/gth-file-source-selections.c
@@ -34,7 +34,10 @@ struct _GthFileSourceSelectionsPrivate {
};
-G_DEFINE_TYPE (GthFileSourceSelections, gth_file_source_selections, GTH_TYPE_FILE_SOURCE)
+G_DEFINE_TYPE_WITH_CODE (GthFileSourceSelections,
+ gth_file_source_selections,
+ GTH_TYPE_FILE_SOURCE,
+ G_ADD_PRIVATE (GthFileSourceSelections))
static GList *
@@ -289,29 +292,11 @@ gth_file_source_selections_shows_extra_widget (GthFileSource *file_source)
}
-static void
-gth_file_source_selections_finalize (GObject *object)
-{
- GthFileSourceSelections *self = GTH_FILE_SOURCE_SELECTIONS (object);
-
- if (self->priv != NULL) {
- g_free (self->priv);
- self->priv = NULL;
- }
-
- G_OBJECT_CLASS (gth_file_source_selections_parent_class)->finalize (object);
-}
-
-
static void
gth_file_source_selections_class_init (GthFileSourceSelectionsClass *class)
{
- GObjectClass *object_class;
GthFileSourceClass *file_source_class;
- object_class = (GObjectClass*) class;
- object_class->finalize = gth_file_source_selections_finalize;
-
file_source_class = (GthFileSourceClass*) class;
file_source_class->get_entry_points = get_entry_points;
file_source_class->to_gio_file = gth_file_source_selections_to_gio_file;
@@ -335,6 +320,7 @@ static void
gth_file_source_selections_init (GthFileSourceSelections *self)
{
gth_file_source_add_scheme (GTH_FILE_SOURCE (self), "selection");
-
- self->priv = g_new0 (GthFileSourceSelectionsPrivate, 1);
+ self->priv = gth_file_source_selections_get_instance_private (self);
+ self->priv->ready_func = NULL;
+ self->priv->ready_data = NULL;
}
diff --git a/extensions/selections/gth-selections-manager.c b/extensions/selections/gth-selections-manager.c
index 94a8e2f9..abbc6d48 100644
--- a/extensions/selections/gth-selections-manager.c
+++ b/extensions/selections/gth-selections-manager.c
@@ -36,9 +36,10 @@ struct _GthSelectionsManagerPrivate {
};
-G_DEFINE_TYPE (GthSelectionsManager,
- gth_selections_manager,
- G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthSelectionsManager,
+ gth_selections_manager,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthSelectionsManager))
static GthSelectionsManager *the_manager = NULL;
@@ -86,19 +87,18 @@ gth_selections_manager_class_init (GthSelectionsManagerClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthSelectionsManagerPrivate));
-
object_class = (GObjectClass*) klass;
object_class->constructor = gth_selections_manager_constructor;
object_class->finalize = gth_selections_manager_finalize;
}
+
static void
gth_selections_manager_init (GthSelectionsManager *self)
{
int i;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SELECTIONS_MANAGER,
GthSelectionsManagerPrivate);
+ self->priv = gth_selections_manager_get_instance_private (self);
g_mutex_init (&self->priv->mutex);
for (i = 0; i < GTH_SELECTIONS_MANAGER_N_SELECTIONS; i++) {
self->priv->files[i] = NULL;
diff --git a/extensions/slideshow/gth-slideshow-preferences.c
b/extensions/slideshow/gth-slideshow-preferences.c
index e7c8d1bc..7357af91 100644
--- a/extensions/slideshow/gth-slideshow-preferences.c
+++ b/extensions/slideshow/gth-slideshow-preferences.c
@@ -25,9 +25,6 @@
#include "gth-transition.h"
-G_DEFINE_TYPE (GthSlideshowPreferences, gth_slideshow_preferences, GTK_TYPE_BOX)
-
-
enum {
TRANSITION_COLUMN_ID,
TRANSITION_COLUMN_DISPLAY_NAME
@@ -47,6 +44,12 @@ struct _GthSlideshowPreferencesPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthSlideshowPreferences,
+ gth_slideshow_preferences,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthSlideshowPreferences))
+
+
static void
gth_slideshow_preferences_finalize (GObject *object)
{
@@ -62,8 +65,6 @@ gth_slideshow_preferences_class_init (GthSlideshowPreferencesClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthSlideshowPreferencesPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_slideshow_preferences_finalize;
}
@@ -72,7 +73,7 @@ gth_slideshow_preferences_class_init (GthSlideshowPreferencesClass *klass)
static void
gth_slideshow_preferences_init (GthSlideshowPreferences *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SLIDESHOW_PREFERENCES,
GthSlideshowPreferencesPrivate);
+ self->priv = gth_slideshow_preferences_get_instance_private (self);
self->priv->builder = NULL;
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
}
diff --git a/extensions/slideshow/gth-slideshow.c b/extensions/slideshow/gth-slideshow.c
index bd32ba4e..dd15ba4d 100644
--- a/extensions/slideshow/gth-slideshow.c
+++ b/extensions/slideshow/gth-slideshow.c
@@ -39,9 +39,6 @@
#define _GST_PLAY_FLAG_AUDIO (1 << 1)
-G_DEFINE_TYPE (GthSlideshow, gth_slideshow, GTK_TYPE_WINDOW)
-
-
typedef enum {
GTH_SLIDESHOW_DIRECTION_FORWARD,
GTH_SLIDESHOW_DIRECTION_BACKWARD
@@ -91,6 +88,12 @@ struct _GthSlideshowPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthSlideshow,
+ gth_slideshow,
+ GTK_TYPE_WINDOW,
+ G_ADD_PRIVATE (GthSlideshow))
+
+
static void
_gth_slideshow_close_cb (gpointer user_data)
{
@@ -339,8 +342,6 @@ gth_slideshow_class_init (GthSlideshowClass *klass)
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (GthSlideshowPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = gth_slideshow_finalize;
}
@@ -456,7 +457,7 @@ gth_slideshow_show_cb (GtkWidget *widget,
static void
gth_slideshow_init (GthSlideshow *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SLIDESHOW, GthSlideshowPrivate);
+ self->priv = gth_slideshow_get_instance_private (self);
self->priv->file_list = NULL;
self->priv->next_event = 0;
self->priv->delay = DEFAULT_DELAY;
diff --git a/extensions/slideshow/gth-transition.c b/extensions/slideshow/gth-transition.c
index 6b67c457..3b2f37d5 100644
--- a/extensions/slideshow/gth-transition.c
+++ b/extensions/slideshow/gth-transition.c
@@ -23,9 +23,6 @@
#include "gth-transition.h"
-G_DEFINE_TYPE (GthTransition, gth_transition, G_TYPE_OBJECT)
-
-
/* Properties */
enum {
PROP_0,
@@ -42,6 +39,12 @@ struct _GthTransitionPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthTransition,
+ gth_transition,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthTransition))
+
+
static void
gth_transition_finalize (GObject *object)
{
@@ -119,8 +122,6 @@ gth_transition_class_init (GthTransitionClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthTransitionPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = gth_transition_get_property;
object_class->set_property = gth_transition_set_property;
@@ -152,7 +153,7 @@ gth_transition_class_init (GthTransitionClass *klass)
static void
gth_transition_init (GthTransition *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TRANSITION, GthTransitionPrivate);
+ self->priv = gth_transition_get_instance_private (self);
self->priv->id = g_strdup ("");
self->priv->display_name = g_strdup ("");
self->priv->frame_func = NULL;
diff --git a/extensions/webalbums/gth-web-exporter.c b/extensions/webalbums/gth-web-exporter.c
index 37b8a6c8..c477cebf 100644
--- a/extensions/webalbums/gth-web-exporter.c
+++ b/extensions/webalbums/gth-web-exporter.c
@@ -41,9 +41,6 @@
#define SAVING_TIMEOUT 5
-G_DEFINE_TYPE (GthWebExporter, gth_web_exporter, GTH_TYPE_TASK)
-
-
typedef enum {
GTH_TEMPLATE_TYPE_INDEX,
GTH_TEMPLATE_TYPE_IMAGE,
@@ -165,6 +162,12 @@ struct _GthWebExporterPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthWebExporter,
+ gth_web_exporter,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthWebExporter))
+
+
static LoopInfo *
loop_info_new (void)
{
@@ -3143,8 +3146,6 @@ gth_web_exporter_class_init (GthWebExporterClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthWebExporterPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_web_exporter_finalize;
@@ -3157,7 +3158,7 @@ gth_web_exporter_class_init (GthWebExporterClass *klass)
static void
gth_web_exporter_init (GthWebExporter *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_WEB_EXPORTER, GthWebExporterPrivate);
+ self->priv = gth_web_exporter_get_instance_private (self);
self->priv->header = NULL;
self->priv->footer = NULL;
self->priv->image_page_header = NULL;
diff --git a/gthumb/dom.c b/gthumb/dom.c
index c745dec6..05bf0f01 100644
--- a/gthumb/dom.c
+++ b/gthumb/dom.c
@@ -615,7 +615,10 @@ dom_text_node_new (const char *a_data)
/* -- DomDocument -- */
-G_DEFINE_TYPE (DomDocument, dom_document, DOM_TYPE_ELEMENT)
+G_DEFINE_TYPE_WITH_CODE (DomDocument,
+ dom_document,
+ DOM_TYPE_ELEMENT,
+ G_ADD_PRIVATE (DomDocument))
static void
@@ -625,10 +628,7 @@ dom_document_finalize (GObject *obj)
self = DOM_DOCUMENT (obj);
- if (self->priv != NULL) {
- g_queue_free (self->priv->open_nodes);
- g_free (self->priv);
- }
+ g_queue_free (self->priv->open_nodes);
G_OBJECT_CLASS (dom_document_parent_class)->finalize (obj);
}
@@ -646,7 +646,7 @@ dom_document_init (DomDocument *self)
{
DOM_ELEMENT (self)->tag_name = g_strdup (XML_DOCUMENT_TAG_NAME);
- self->priv = g_new0 (DomDocumentPrivate, 1);
+ self->priv = dom_document_get_instance_private (self);
self->priv->open_nodes = g_queue_new ();
}
diff --git a/gthumb/gnome-desktop-thumbnail.c b/gthumb/gnome-desktop-thumbnail.c
index 71e4ef16..01e21cf3 100644
--- a/gthumb/gnome-desktop-thumbnail.c
+++ b/gthumb/gnome-desktop-thumbnail.c
@@ -87,14 +87,12 @@ static const char *appname = "gnome-thumbnail-factory";
static void gnome_desktop_thumbnail_factory_init (GnomeDesktopThumbnailFactory *factory);
static void gnome_desktop_thumbnail_factory_class_init (GnomeDesktopThumbnailFactoryClass *class);
-G_DEFINE_TYPE (GnomeDesktopThumbnailFactory,
- gnome_desktop_thumbnail_factory,
- G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GnomeDesktopThumbnailFactory,
+ gnome_desktop_thumbnail_factory,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GnomeDesktopThumbnailFactory))
#define parent_class gnome_desktop_thumbnail_factory_parent_class
-#define GNOME_DESKTOP_THUMBNAIL_FACTORY_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), GNOME_DESKTOP_TYPE_THUMBNAIL_FACTORY,
GnomeDesktopThumbnailFactoryPrivate))
-
typedef struct {
gint width;
gint height;
@@ -783,7 +781,7 @@ gnome_desktop_thumbnail_factory_finalize (GObject *object)
static void
gnome_desktop_thumbnail_factory_init (GnomeDesktopThumbnailFactory *factory)
{
- factory->priv = GNOME_DESKTOP_THUMBNAIL_FACTORY_GET_PRIVATE (factory);
+ factory->priv = gnome_desktop_thumbnail_factory_get_instance_private (factory);
factory->priv->size = GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL;
factory->priv->disabled_types = NULL;
g_mutex_init (&factory->priv->lock);
@@ -800,8 +798,6 @@ gnome_desktop_thumbnail_factory_class_init (GnomeDesktopThumbnailFactoryClass *c
gobject_class = G_OBJECT_CLASS (class);
gobject_class->finalize = gnome_desktop_thumbnail_factory_finalize;
-
- g_type_class_add_private (class, sizeof (GnomeDesktopThumbnailFactoryPrivate));
}
/**
diff --git a/gthumb/gth-accel-button.c b/gthumb/gth-accel-button.c
index d75a3b17..63345e4c 100644
--- a/gthumb/gth-accel-button.c
+++ b/gthumb/gth-accel-button.c
@@ -51,7 +51,10 @@ struct _GthAccelButtonPrivate {
static guint gth_accel_button_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthAccelButton, gth_accel_button, GTK_TYPE_BUTTON)
+G_DEFINE_TYPE_WITH_CODE (GthAccelButton,
+ gth_accel_button,
+ GTK_TYPE_BUTTON,
+ G_ADD_PRIVATE (GthAccelButton))
static void
@@ -118,8 +121,6 @@ gth_accel_button_class_init (GthAccelButtonClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthAccelButtonPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_accel_button_set_property;
object_class->get_property = gth_accel_button_get_property;
@@ -263,7 +264,7 @@ button_clicked_cb (GtkButton *button,
static void
gth_accel_button_init (GthAccelButton *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_ACCEL_BUTTON, GthAccelButtonPrivate);
+ self->priv = gth_accel_button_get_instance_private (self);
self->priv->keyval = 0;
self->priv->modifiers = 0;
self->priv->valid = FALSE;
diff --git a/gthumb/gth-async-task.c b/gthumb/gth-async-task.c
index b48ebec2..33614996 100644
--- a/gthumb/gth-async-task.c
+++ b/gthumb/gth-async-task.c
@@ -51,7 +51,10 @@ struct _GthAsyncTaskPrivate {
};
-G_DEFINE_TYPE (GthAsyncTask, gth_async_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthAsyncTask,
+ gth_async_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthAsyncTask))
static void
@@ -256,8 +259,6 @@ gth_async_task_class_init (GthAsyncTaskClass *class)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (class, sizeof (GthAsyncTaskPrivate));
-
object_class = G_OBJECT_CLASS (class);
object_class->set_property = gth_async_task_set_property;
object_class->get_property = gth_async_task_get_property;
@@ -303,7 +304,7 @@ gth_async_task_class_init (GthAsyncTaskClass *class)
static void
gth_async_task_init (GthAsyncTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_ASYNC_TASK, GthAsyncTaskPrivate);
+ self->priv = gth_async_task_get_instance_private (self);
self->priv->cancelled = FALSE;
self->priv->terminated = FALSE;
self->priv->progress_event = 0;
diff --git a/gthumb/gth-auto-paned.c b/gthumb/gth-auto-paned.c
index f14dc654..c77dca1e 100644
--- a/gthumb/gth-auto-paned.c
+++ b/gthumb/gth-auto-paned.c
@@ -24,15 +24,18 @@
#include "gth-auto-paned.h"
-G_DEFINE_TYPE (GthAutoPaned, gth_auto_paned, GTK_TYPE_PANED)
-
-
struct _GthAutoPanedPrivate {
gboolean child1_visible;
gboolean child2_visible;
};
+G_DEFINE_TYPE_WITH_CODE (GthAutoPaned,
+ gth_auto_paned,
+ GTK_TYPE_PANED,
+ G_ADD_PRIVATE (GthAutoPaned))
+
+
static gboolean
_gtk_widget_get_visible (GtkWidget *widget)
{
@@ -86,8 +89,6 @@ gth_auto_paned_class_init (GthAutoPanedClass *klass)
{
GtkWidgetClass *widget_class;
- g_type_class_add_private (klass, sizeof (GthAutoPanedPrivate));
-
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->size_allocate = gth_auto_paned_size_allocate;
}
@@ -96,7 +97,7 @@ gth_auto_paned_class_init (GthAutoPanedClass *klass)
static void
gth_auto_paned_init (GthAutoPaned *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_AUTO_PANED, GthAutoPanedPrivate);
+ self->priv = gth_auto_paned_get_instance_private (self);
self->priv->child1_visible = FALSE;
self->priv->child2_visible = FALSE;
}
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index d914b6b3..7df65018 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -79,9 +79,6 @@
#define AUTO_OPEN_FOLDER_DELAY 500
-G_DEFINE_TYPE (GthBrowser, gth_browser, GTH_TYPE_WINDOW)
-
-
enum {
LOCATION_READY,
LAST_SIGNAL
@@ -227,10 +224,15 @@ struct _GthBrowserPrivate {
GMenu *history_menu;
};
-
static guint gth_browser_signals[LAST_SIGNAL] = { 0 };
+G_DEFINE_TYPE_WITH_CODE (GthBrowser,
+ gth_browser,
+ GTH_TYPE_WINDOW,
+ G_ADD_PRIVATE (GthBrowser))
+
+
/* -- browser_state -- */
@@ -2618,8 +2620,6 @@ gth_browser_class_init (GthBrowserClass *klass)
GObjectClass *gobject_class;
GthWindowClass *window_class;
- g_type_class_add_private (klass, sizeof (GthBrowserPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = gth_browser_finalize;
@@ -4296,7 +4296,7 @@ gth_browser_init (GthBrowser *browser)
gtk_widget_add_events (GTK_WIDGET (browser), GDK_POINTER_MOTION_HINT_MASK);
- browser->priv = G_TYPE_INSTANCE_GET_PRIVATE (browser, GTH_TYPE_BROWSER, GthBrowserPrivate);
+ browser->priv = gth_browser_get_instance_private (browser);
browser->priv->viewer_pages = NULL;
browser->priv->viewer_page = NULL;
browser->priv->image_preloader = gth_image_preloader_new ();
diff --git a/gthumb/gth-color-manager.c b/gthumb/gth-color-manager.c
index c2958aed..fa92a8c7 100644
--- a/gthumb/gth-color-manager.c
+++ b/gthumb/gth-color-manager.c
@@ -84,7 +84,10 @@ struct _GthColorManagerPrivate {
static guint gth_color_manager_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthColorManager, gth_color_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthColorManager,
+ gth_color_manager,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthColorManager))
static void
@@ -107,8 +110,6 @@ gth_color_manager_class_init (GthColorManagerClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthColorManagerPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_color_manager_finalize;
@@ -129,7 +130,7 @@ gth_color_manager_class_init (GthColorManagerClass *klass)
static void
gth_color_manager_init (GthColorManager *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_COLOR_MANAGER, GthColorManagerPrivate);
+ self->priv = gth_color_manager_get_instance_private (self);
self->priv->profile_cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
self->priv->transform_cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
(GDestroyNotify) transform_data_free);
self->priv->cd_client = NULL;
diff --git a/gthumb/gth-color-scale.c b/gthumb/gth-color-scale.c
index 1d099dd5..550bd0e8 100644
--- a/gthumb/gth-color-scale.c
+++ b/gthumb/gth-color-scale.c
@@ -49,7 +49,10 @@ struct _GthColorScalePrivate {
};
-G_DEFINE_TYPE (GthColorScale, gth_color_scale, GTK_TYPE_SCALE)
+G_DEFINE_TYPE_WITH_CODE (GthColorScale,
+ gth_color_scale,
+ GTK_TYPE_SCALE,
+ G_ADD_PRIVATE (GthColorScale))
static void
@@ -440,8 +443,6 @@ gth_color_scale_class_init (GthColorScaleClass *class)
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (class, sizeof (GthColorScalePrivate));
-
object_class = G_OBJECT_CLASS (class);
object_class->set_property = gth_color_scale_set_property;
object_class->get_property = gth_color_scale_get_property;
@@ -508,7 +509,7 @@ notify_adjustment_cb (GObject *gobject,
static void
gth_color_scale_init (GthColorScale *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_COLOR_SCALE, GthColorScalePrivate);
+ self->priv = gth_color_scale_get_instance_private (self);
self->priv->surface = NULL;
self->priv->width = -1;
self->priv->height = -1;
diff --git a/gthumb/gth-delete-task.c b/gthumb/gth-delete-task.c
index f775699a..d728fe30 100644
--- a/gthumb/gth-delete-task.c
+++ b/gthumb/gth-delete-task.c
@@ -30,7 +30,10 @@ struct _GthDeleteTaskPrivate {
};
-G_DEFINE_TYPE (GthDeleteTask, gth_delete_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthDeleteTask,
+ gth_delete_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthDeleteTask))
static void
@@ -78,8 +81,6 @@ gth_delete_task_class_init (GthDeleteTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthDeleteTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_delete_task_finalize;
@@ -91,7 +92,7 @@ gth_delete_task_class_init (GthDeleteTaskClass *klass)
static void
gth_delete_task_init (GthDeleteTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_DELETE_TASK, GthDeleteTaskPrivate);
+ self->priv = gth_delete_task_get_instance_private (self);
}
diff --git a/gthumb/gth-empty-list.c b/gthumb/gth-empty-list.c
index 6918f5b0..815a5e8b 100644
--- a/gthumb/gth-empty-list.c
+++ b/gthumb/gth-empty-list.c
@@ -33,7 +33,10 @@ struct _GthEmptyListPrivate {
};
-G_DEFINE_TYPE (GthEmptyList, gth_empty_list, GTK_TYPE_WIDGET)
+G_DEFINE_TYPE_WITH_CODE (GthEmptyList,
+ gth_empty_list,
+ GTK_TYPE_WIDGET,
+ G_ADD_PRIVATE (GthEmptyList))
static void
@@ -253,8 +256,6 @@ gth_empty_list_class_init (GthEmptyListClass *klass)
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (klass, sizeof (GthEmptyListPrivate));
-
object_class = (GObjectClass*) (klass);
object_class->set_property = gth_empty_list_set_property;
object_class->get_property = gth_empty_list_get_property;
@@ -288,7 +289,7 @@ gth_empty_list_init (GthEmptyList *self)
gtk_widget_set_has_window (GTK_WIDGET (self), TRUE);
gtk_widget_set_can_focus (GTK_WIDGET (self), FALSE);
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EMPTY_LIST, GthEmptyListPrivate);
+ self->priv = gth_empty_list_get_instance_private (self);
self->priv->layout = NULL;
self->priv->text = NULL;
diff --git a/gthumb/gth-extensions.c b/gthumb/gth-extensions.c
index aa46c0ab..a83b719e 100644
--- a/gthumb/gth-extensions.c
+++ b/gthumb/gth-extensions.c
@@ -169,7 +169,10 @@ struct _GthExtensionModulePrivate {
};
-G_DEFINE_TYPE (GthExtensionModule, gth_extension_module, GTH_TYPE_EXTENSION)
+G_DEFINE_TYPE_WITH_CODE (GthExtensionModule,
+ gth_extension_module,
+ GTH_TYPE_EXTENSION,
+ G_ADD_PRIVATE (GthExtensionModule))
static gboolean
@@ -354,8 +357,6 @@ gth_extension_module_class_init (GthExtensionModuleClass *klass)
{
GthExtensionClass *elc;
- g_type_class_add_private (klass, sizeof (GthExtensionModulePrivate));
-
G_OBJECT_CLASS (klass)->finalize = gth_extension_module_finalize;
elc = GTH_EXTENSION_CLASS (klass);
@@ -371,7 +372,7 @@ gth_extension_module_class_init (GthExtensionModuleClass *klass)
static void
gth_extension_module_init (GthExtensionModule *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EXTENSION_MODULE, GthExtensionModulePrivate);
+ self->priv = gth_extension_module_get_instance_private (self);
}
@@ -396,7 +397,10 @@ struct _GthExtensionDescriptionPrivate {
};
-G_DEFINE_TYPE (GthExtensionDescription, gth_extension_description, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthExtensionDescription,
+ gth_extension_description,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthExtensionDescription))
static void
@@ -427,7 +431,6 @@ gth_extension_description_finalize (GObject *obj)
static void
gth_extension_description_class_init (GthExtensionDescriptionClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthExtensionDescriptionPrivate));
G_OBJECT_CLASS (klass)->finalize = gth_extension_description_finalize;
}
@@ -435,7 +438,7 @@ gth_extension_description_class_init (GthExtensionDescriptionClass *klass)
static void
gth_extension_description_init (GthExtensionDescription *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EXTENSION_DESCRIPTION,
GthExtensionDescriptionPrivate);
+ self->priv = gth_extension_description_get_instance_private (self);
self->priv->opened = FALSE;
self->priv->extension = NULL;
}
@@ -530,7 +533,10 @@ struct _GthExtensionManagerPrivate {
};
-G_DEFINE_TYPE (GthExtensionManager, gth_extension_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthExtensionManager,
+ gth_extension_manager,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthExtensionManager))
static void
@@ -550,7 +556,6 @@ gth_extension_manager_finalize (GObject *obj)
static void
gth_extension_manager_class_init (GthExtensionManagerClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthExtensionManagerPrivate));
G_OBJECT_CLASS (klass)->finalize = gth_extension_manager_finalize;
}
@@ -558,7 +563,7 @@ gth_extension_manager_class_init (GthExtensionManagerClass *klass)
static void
gth_extension_manager_init (GthExtensionManager *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_EXTENSION_MANAGER,
GthExtensionManagerPrivate);
+ self->priv = gth_extension_manager_get_instance_private (self);
self->priv->extensions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
}
diff --git a/gthumb/gth-extensions.h b/gthumb/gth-extensions.h
index 987aab3d..ee755e6f 100644
--- a/gthumb/gth-extensions.h
+++ b/gthumb/gth-extensions.h
@@ -39,7 +39,6 @@ G_BEGIN_DECLS
typedef struct _GthExtension GthExtension;
typedef struct _GthExtensionClass GthExtensionClass;
-typedef struct _GthExtensionPrivate GthExtensionPrivate;
#define GTH_TYPE_EXTENSION_MODULE (gth_extension_module_get_type ())
#define GTH_EXTENSION_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_EXTENSION_MODULE,
GthExtensionModule))
@@ -76,7 +75,6 @@ typedef struct _GthExtensionManagerPrivate GthExtensionManagerPrivate;
struct _GthExtension {
GObject parent_instance;
- GthExtensionPrivate *priv;
gboolean initialized;
gboolean active;
};
diff --git a/gthumb/gth-file-chooser-dialog.c b/gthumb/gth-file-chooser-dialog.c
index 89666083..9c88820d 100644
--- a/gthumb/gth-file-chooser-dialog.c
+++ b/gthumb/gth-file-chooser-dialog.c
@@ -33,9 +33,6 @@
#define FORMAT_KEY "gthumb-format"
-G_DEFINE_TYPE (GthFileChooserDialog, gth_file_chooser_dialog, GTK_TYPE_FILE_CHOOSER_DIALOG)
-
-
typedef struct {
GthImageSaver *saver;
char **extensions;
@@ -57,6 +54,12 @@ struct _GthFileChooserDialogPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthFileChooserDialog,
+ gth_file_chooser_dialog,
+ GTK_TYPE_FILE_CHOOSER_DIALOG,
+ G_ADD_PRIVATE (GthFileChooserDialog))
+
+
static void
gth_file_chooser_dialog_finalize (GObject *object)
{
@@ -93,8 +96,6 @@ gth_file_chooser_dialog_class_init (GthFileChooserDialogClass *class)
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (class, sizeof (GthFileChooserDialogPrivate));
-
object_class = (GObjectClass*) class;
object_class->finalize = gth_file_chooser_dialog_finalize;
@@ -106,7 +107,7 @@ gth_file_chooser_dialog_class_init (GthFileChooserDialogClass *class)
static void
gth_file_chooser_dialog_init (GthFileChooserDialog *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_CHOOSER_DIALOG,
GthFileChooserDialogPrivate);
+ self->priv = gth_file_chooser_dialog_get_instance_private (self);
self->priv->supported_formats = NULL;
}
diff --git a/gthumb/gth-file-data.c b/gthumb/gth-file-data.c
index 85de7767..2c421643 100644
--- a/gthumb/gth-file-data.c
+++ b/gthumb/gth-file-data.c
@@ -55,8 +55,9 @@ static void gth_file_data_gth_duplicable_interface_init (GthDuplicableInterface
G_DEFINE_TYPE_WITH_CODE (GthFileData,
gth_file_data,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthFileData)
G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_file_data_gth_duplicable_interface_init))
+ gth_file_data_gth_duplicable_interface_init))
static void
@@ -75,8 +76,6 @@ gth_file_data_finalize (GObject *obj)
static void
gth_file_data_class_init (GthFileDataClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthFileDataPrivate));
-
G_OBJECT_CLASS (klass)->finalize = gth_file_data_finalize;
}
@@ -98,7 +97,7 @@ gth_file_data_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_file_data_init (GthFileData *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_DATA, GthFileDataPrivate);
+ self->priv = gth_file_data_get_instance_private (self);
self->priv->dtime.tv_sec = 0;
self->priv->sort_key = NULL;
self->file = NULL;
diff --git a/gthumb/gth-file-list.c b/gthumb/gth-file-list.c
index 3b3dc504..0ba243d1 100644
--- a/gthumb/gth-file-list.c
+++ b/gthumb/gth-file-list.c
@@ -120,8 +120,7 @@ typedef struct {
} ThumbnailerState;
-struct _GthFileListPrivateData
-{
+struct _GthFileListPrivate {
GSettings *settings;
GthFileListMode type;
GtkAdjustment *vadj;
@@ -150,6 +149,12 @@ struct _GthFileListPrivateData
};
+G_DEFINE_TYPE_WITH_CODE (GthFileList,
+ gth_file_list,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthFileList))
+
+
/* OPs */
@@ -274,9 +279,6 @@ _gth_file_list_queue_op (GthFileList *file_list,
/* -- gth_file_list -- */
-G_DEFINE_TYPE (GthFileList, gth_file_list, GTK_TYPE_BOX)
-
-
static void
gth_file_list_finalize (GObject *object)
{
@@ -284,18 +286,13 @@ gth_file_list_finalize (GObject *object)
file_list = GTH_FILE_LIST (object);
- if (file_list->priv != NULL) {
- _gth_file_list_clear_queue (file_list);
- _g_object_unref (file_list->priv->thumb_loader);
- _g_object_list_unref (file_list->priv->visibles);
- g_hash_table_unref (file_list->priv->thumb_data);
- if (file_list->priv->icon_cache != NULL)
- gth_icon_cache_free (file_list->priv->icon_cache);
- g_object_unref (file_list->priv->settings);
-
- g_free (file_list->priv);
- file_list->priv = NULL;
- }
+ _gth_file_list_clear_queue (file_list);
+ _g_object_unref (file_list->priv->thumb_loader);
+ _g_object_list_unref (file_list->priv->visibles);
+ g_hash_table_unref (file_list->priv->thumb_data);
+ if (file_list->priv->icon_cache != NULL)
+ gth_icon_cache_free (file_list->priv->icon_cache);
+ g_object_unref (file_list->priv->settings);
G_OBJECT_CLASS (gth_file_list_parent_class)->finalize (object);
}
@@ -414,19 +411,32 @@ gth_file_list_init (GthFileList *file_list)
{
gtk_widget_set_can_focus (GTK_WIDGET (file_list), FALSE);
- file_list->priv = g_new0 (GthFileListPrivateData, 1);
+ file_list->priv = gth_file_list_get_instance_private (file_list);
file_list->priv->settings = g_settings_new (GTHUMB_BROWSER_SCHEMA);
- file_list->priv->thumb_data = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
g_object_unref, (GDestroyNotify) thumb_data_unref);
+ file_list->priv->type = GTH_FILE_LIST_MODE_NORMAL;
+ file_list->priv->vadj = NULL;
+ file_list->priv->notebook = NULL;
+ file_list->priv->view = NULL;
+ file_list->priv->message = NULL;
+ file_list->priv->scrolled_window = NULL;
+ file_list->priv->icon_cache = NULL;
+ file_list->priv->file_source = NULL;
+ file_list->priv->load_thumbs = TRUE;
file_list->priv->thumb_size = g_settings_get_int (file_list->priv->settings,
PREF_BROWSER_THUMBNAIL_SIZE);
file_list->priv->ignore_hidden_thumbs = FALSE;
- file_list->priv->load_thumbs = TRUE;
+ file_list->priv->thumb_data = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
g_object_unref, (GDestroyNotify) thumb_data_unref);
+ file_list->priv->thumb_loader = NULL;
+ file_list->priv->loading_thumbs = FALSE;
+ file_list->priv->dirty = FALSE;
+ file_list->priv->dirty_event = 0;
+ file_list->priv->restart_thumb_update = 0;
+ file_list->priv->queue = NULL;
+ file_list->priv->jobs = NULL;
file_list->priv->cancelling = FALSE;
file_list->priv->update_event = 0;
- file_list->priv->visibles = NULL;
file_list->priv->visibility_changed = FALSE;
+ file_list->priv->visibles = NULL;
file_list->priv->thumbnailer_state.phase = THUMBNAILER_PHASE_INITIALIZE;
- file_list->priv->dirty_event = 0;
- file_list->priv->restart_thumb_update = 0;
}
diff --git a/gthumb/gth-file-list.h b/gthumb/gth-file-list.h
index 779f4a2f..aaf1ca6e 100644
--- a/gthumb/gth-file-list.h
+++ b/gthumb/gth-file-list.h
@@ -50,11 +50,11 @@ typedef enum {
typedef struct _GthFileList GthFileList;
typedef struct _GthFileListClass GthFileListClass;
-typedef struct _GthFileListPrivateData GthFileListPrivateData;
+typedef struct _GthFileListPrivate GthFileListPrivate;
struct _GthFileList {
GtkBox __parent;
- GthFileListPrivateData *priv;
+ GthFileListPrivate *priv;
};
struct _GthFileListClass {
diff --git a/gthumb/gth-file-properties.c b/gthumb/gth-file-properties.c
index 0ab9a24e..3470c56d 100644
--- a/gthumb/gth-file-properties.c
+++ b/gthumb/gth-file-properties.c
@@ -31,7 +31,6 @@
#include "gtk-utils.h"
-#define GTH_FILE_PROPERTIES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTH_TYPE_FILE_PROPERTIES,
GthFilePropertiesPrivate))
#define FONT_SCALE (0.85)
#define MIN_HEIGHT 100
#define COMMENT_DEFAULT_HEIGHT 100
@@ -78,10 +77,11 @@ static void gth_file_properties_gth_property_view_interface_init (GthPropertyVie
G_DEFINE_TYPE_WITH_CODE (GthFileProperties,
gth_file_properties,
GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthFileProperties)
G_IMPLEMENT_INTERFACE (GTH_TYPE_MULTIPAGE_CHILD,
gth_file_properties_gth_multipage_child_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_PROPERTY_VIEW,
- gth_file_properties_gth_property_view_interface_init))
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_PROPERTY_VIEW,
+ gth_file_properties_gth_property_view_interface_init))
static char *
@@ -325,8 +325,6 @@ gth_file_properties_class_init (GthFilePropertiesClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthFilePropertiesPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gth_file_properties_set_property;
object_class->get_property = gth_file_properties_get_property;
@@ -433,7 +431,7 @@ gth_file_properties_init (GthFileProperties *self)
GtkTreeViewColumn *column;
- self->priv = GTH_FILE_PROPERTIES_GET_PRIVATE (self);
+ self->priv = gth_file_properties_get_instance_private (self);
self->priv->show_details = FALSE;
self->priv->last_file_data = NULL;
diff --git a/gthumb/gth-file-source-vfs.c b/gthumb/gth-file-source-vfs.c
index 043c3cd6..6713d81c 100644
--- a/gthumb/gth-file-source-vfs.c
+++ b/gthumb/gth-file-source-vfs.c
@@ -61,7 +61,10 @@ static guint mount_added_event_id = 0;
static guint mount_removed_event_id = 0;
-G_DEFINE_TYPE (GthFileSourceVfs, gth_file_source_vfs, GTH_TYPE_FILE_SOURCE)
+G_DEFINE_TYPE_WITH_CODE (GthFileSourceVfs,
+ gth_file_source_vfs,
+ GTH_TYPE_FILE_SOURCE,
+ G_ADD_PRIVATE (GthFileSourceVfs))
static GList *
@@ -881,27 +884,21 @@ static void
gth_file_source_vfs_finalize (GObject *object)
{
GthFileSourceVfs *file_source_vfs = GTH_FILE_SOURCE_VFS (object);
+ int i;
- if (file_source_vfs->priv != NULL) {
- int i;
-
- if (file_source_vfs->priv->monitor_update_id != 0) {
- g_source_remove (file_source_vfs->priv->monitor_update_id);
- file_source_vfs->priv->monitor_update_id = 0;
- }
+ if (file_source_vfs->priv->monitor_update_id != 0) {
+ g_source_remove (file_source_vfs->priv->monitor_update_id);
+ file_source_vfs->priv->monitor_update_id = 0;
+ }
- g_hash_table_destroy (file_source_vfs->priv->hidden_files);
- g_hash_table_destroy (file_source_vfs->priv->monitors);
+ g_hash_table_destroy (file_source_vfs->priv->hidden_files);
+ g_hash_table_destroy (file_source_vfs->priv->monitors);
- for (i = 0; i < GTH_MONITOR_N_EVENTS; i++) {
- _g_object_list_unref (file_source_vfs->priv->monitor_queue[i]);
- file_source_vfs->priv->monitor_queue[i] = NULL;
- }
- _g_object_list_unref (file_source_vfs->priv->files);
-
- g_free (file_source_vfs->priv);
- file_source_vfs->priv = NULL;
+ for (i = 0; i < GTH_MONITOR_N_EVENTS; i++) {
+ _g_object_list_unref (file_source_vfs->priv->monitor_queue[i]);
+ file_source_vfs->priv->monitor_queue[i] = NULL;
}
+ _g_object_list_unref (file_source_vfs->priv->files);
G_OBJECT_CLASS (gth_file_source_vfs_parent_class)->finalize (object);
}
@@ -934,10 +931,20 @@ gth_file_source_vfs_init (GthFileSourceVfs *file_source)
{
int i;
- file_source->priv = g_new0 (GthFileSourceVfsPrivate, 1);
- gth_file_source_add_scheme (GTH_FILE_SOURCE (file_source), "vfs+");
+ file_source->priv = gth_file_source_vfs_get_instance_private (file_source);
+ file_source->priv->files = NULL;
+ file_source->priv->list_ready_func = NULL;
+ file_source->priv->start_dir_func = NULL;
+ file_source->priv->for_each_file_func = NULL;
+ file_source->priv->ready_func = NULL;
+ file_source->priv->user_data = NULL;
file_source->priv->hidden_files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
file_source->priv->monitors = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
g_object_unref, g_object_unref);
for (i = 0; i < GTH_MONITOR_N_EVENTS; i++)
file_source->priv->monitor_queue[i] = NULL;
+ file_source->priv->monitor_update_id = 0;
+ file_source->priv->mount_monitor = NULL;
+ file_source->priv->check_hidden_files = FALSE;
+
+ gth_file_source_add_scheme (GTH_FILE_SOURCE (file_source), "vfs+");
}
diff --git a/gthumb/gth-file-source.c b/gthumb/gth-file-source.c
index 90a40ac4..c3860139 100644
--- a/gthumb/gth-file-source.c
+++ b/gthumb/gth-file-source.c
@@ -30,8 +30,7 @@
#include "gth-main.h"
-struct _GthFileSourcePrivate
-{
+struct _GthFileSourcePrivate {
GList *schemes;
gboolean active;
GList *queue;
@@ -39,7 +38,10 @@ struct _GthFileSourcePrivate
};
-G_DEFINE_TYPE (GthFileSource, gth_file_source, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthFileSource,
+ gth_file_source,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthFileSource))
/* -- queue -- */
@@ -904,14 +906,9 @@ gth_file_source_finalize (GObject *object)
{
GthFileSource *file_source = GTH_FILE_SOURCE (object);
- if (file_source->priv != NULL) {
- gth_file_source_clear_queue (file_source);
- _g_string_list_free (file_source->priv->schemes);
- _g_object_unref (file_source->priv->cancellable);
-
- g_free (file_source->priv);
- file_source->priv = NULL;
- }
+ gth_file_source_clear_queue (file_source);
+ _g_string_list_free (file_source->priv->schemes);
+ _g_object_unref (file_source->priv->cancellable);
G_OBJECT_CLASS (gth_file_source_parent_class)->finalize (object);
}
@@ -948,7 +945,10 @@ gth_file_source_class_init (GthFileSourceClass *class)
static void
gth_file_source_init (GthFileSource *file_source)
{
- file_source->priv = g_new0 (GthFileSourcePrivate, 1);
+ file_source->priv = gth_file_source_get_instance_private (file_source);
+ file_source->priv->schemes = NULL;
+ file_source->priv->active = FALSE;
+ file_source->priv->queue = NULL;
file_source->priv->cancellable = g_cancellable_new ();
}
diff --git a/gthumb/gth-file-store.c b/gthumb/gth-file-store.c
index f09f8c59..d59cffe0 100644
--- a/gthumb/gth-file-store.c
+++ b/gthumb/gth-file-store.c
@@ -59,8 +59,7 @@ typedef struct {
} GthFileRow;
-struct _GthFileStorePrivate
-{
+struct _GthFileStorePrivate {
GthFileRow **all_rows;
GthFileRow **rows;
guint size;
@@ -83,10 +82,11 @@ static void gtk_tree_drag_source_interface_init (GtkTreeDragSourceIface *iface);
G_DEFINE_TYPE_WITH_CODE (GthFileStore,
gth_file_store,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthFileStore)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
- gtk_tree_model_interface_init)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
- gtk_tree_drag_source_interface_init))
+ gtk_tree_model_interface_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
+ gtk_tree_drag_source_interface_init))
static GthFileRow *
@@ -240,8 +240,6 @@ gth_file_store_class_init (GthFileStoreClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthFileStorePrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_file_store_finalize;
@@ -271,7 +269,7 @@ gth_file_store_class_init (GthFileStoreClass *klass)
static void
gth_file_store_init (GthFileStore *file_store)
{
- file_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (file_store, GTH_TYPE_FILE_STORE, GthFileStorePrivate);
+ file_store->priv = gth_file_store_get_instance_private (file_store);
file_store->priv->all_rows = NULL;
file_store->priv->rows = NULL;
file_store->priv->size = 0;
diff --git a/gthumb/gth-file-tool.c b/gthumb/gth-file-tool.c
index 1f44d73f..5a27bfbf 100644
--- a/gthumb/gth-file-tool.c
+++ b/gthumb/gth-file-tool.c
@@ -44,7 +44,10 @@ struct _GthFileToolPrivate {
};
-G_DEFINE_TYPE (GthFileTool, gth_file_tool, GTK_TYPE_BUTTON)
+G_DEFINE_TYPE_WITH_CODE (GthFileTool,
+ gth_file_tool,
+ GTK_TYPE_BUTTON,
+ G_ADD_PRIVATE (GthFileTool))
static void
@@ -113,8 +116,6 @@ gth_file_tool_class_init (GthFileToolClass *klass)
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (GthFileToolPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_file_tool_finalize;
@@ -150,7 +151,7 @@ gth_file_tool_class_init (GthFileToolClass *klass)
static void
gth_file_tool_init (GthFileTool *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL, GthFileToolPrivate);
+ self->priv = gth_file_tool_get_instance_private (self);
self->priv->icon_name = NULL;
self->priv->options_title = NULL;
self->priv->cancelled = FALSE;
diff --git a/gthumb/gth-filter-editor-dialog.c b/gthumb/gth-filter-editor-dialog.c
index f3acbc3d..ba22a3a0 100644
--- a/gthumb/gth-filter-editor-dialog.c
+++ b/gthumb/gth-filter-editor-dialog.c
@@ -50,7 +50,10 @@ struct _GthFilterEditorDialogPrivate {
};
-G_DEFINE_TYPE (GthFilterEditorDialog, gth_filter_editor_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (GthFilterEditorDialog,
+ gth_filter_editor_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthFilterEditorDialog))
static void
@@ -60,12 +63,8 @@ gth_filter_editor_dialog_finalize (GObject *object)
dialog = GTH_FILTER_EDITOR_DIALOG (object);
- if (dialog->priv != NULL) {
- g_object_unref (dialog->priv->builder);
- g_free (dialog->priv->filter_id);
- g_free (dialog->priv);
- dialog->priv = NULL;
- }
+ g_object_unref (dialog->priv->builder);
+ g_free (dialog->priv->filter_id);
G_OBJECT_CLASS (gth_filter_editor_dialog_parent_class)->finalize (object);
}
@@ -84,7 +83,14 @@ gth_filter_editor_dialog_class_init (GthFilterEditorDialogClass *class)
static void
gth_filter_editor_dialog_init (GthFilterEditorDialog *dialog)
{
- dialog->priv = g_new0 (GthFilterEditorDialogPrivate, 1);
+ dialog->priv = gth_filter_editor_dialog_get_instance_private (dialog);
+ dialog->priv->builder = NULL;
+ dialog->priv->match_type_combobox = NULL;
+ dialog->priv->limit_object_combobox = NULL;
+ dialog->priv->selection_combobox = NULL;
+ dialog->priv->selection_order_combobox = NULL;
+ dialog->priv->filter_id = NULL;
+ dialog->priv->filter_visible = FALSE;
}
diff --git a/gthumb/gth-filter-grid.c b/gthumb/gth-filter-grid.c
index 413d760d..8c4a5a4d 100644
--- a/gthumb/gth-filter-grid.c
+++ b/gthumb/gth-filter-grid.c
@@ -103,7 +103,10 @@ struct _GthFilterGridPrivate {
static guint gth_filter_grid_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthFilterGrid, gth_filter_grid, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthFilterGrid,
+ gth_filter_grid,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthFilterGrid))
static void
@@ -192,8 +195,6 @@ gth_filter_grid_class_init (GthFilterGridClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthFilterGridPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_filter_grid_set_property;
object_class->get_property = gth_filter_grid_get_property;
@@ -229,7 +230,7 @@ gth_filter_grid_class_init (GthFilterGridClass *klass)
static void
gth_filter_grid_init (GthFilterGrid *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILTER_GRID, GthFilterGridPrivate);
+ self->priv = gth_filter_grid_get_instance_private (self);
self->priv->n_columns = DEFAULT_N_COLUMNS;
self->priv->filter_ids = NULL;
self->priv->cell_data = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)
cell_data_free);
diff --git a/gthumb/gth-filter.c b/gthumb/gth-filter.c
index 5468b9ec..c1586a1e 100644
--- a/gthumb/gth-filter.c
+++ b/gthumb/gth-filter.c
@@ -66,10 +66,11 @@ static void gth_filter_gth_duplicable_interface_init (GthDuplicableInterface *if
G_DEFINE_TYPE_WITH_CODE (GthFilter,
gth_filter,
GTH_TYPE_TEST,
+ G_ADD_PRIVATE (GthFilter)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_filter_dom_domizable_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_filter_gth_duplicable_interface_init))
+ gth_filter_dom_domizable_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
+ gth_filter_gth_duplicable_interface_init))
static DomElement*
@@ -445,8 +446,6 @@ gth_filter_class_init (GthFilterClass *klass)
GObjectClass *object_class;
GthTestClass *test_class;
- g_type_class_add_private (klass, sizeof (GthFilterPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_filter_finalize;
@@ -476,7 +475,7 @@ gth_filter_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_filter_init (GthFilter *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, GTH_TYPE_FILTER, GthFilterPrivate);
+ filter->priv = gth_filter_get_instance_private (filter);
filter->priv->test = NULL;
filter->priv->limit_type = GTH_LIMIT_TYPE_NONE;
filter->priv->limit = 0;
diff --git a/gthumb/gth-filterbar.c b/gthumb/gth-filterbar.c
index 4a580579..32cf422c 100644
--- a/gthumb/gth-filterbar.c
+++ b/gthumb/gth-filterbar.c
@@ -53,8 +53,7 @@ enum {
LAST_SIGNAL
};
-struct _GthFilterbarPrivate
-{
+struct _GthFilterbarPrivate {
GtkListStore *model;
GtkWidget *test_combo_box;
GthTest *test;
@@ -70,7 +69,10 @@ struct _GthFilterbarPrivate
static guint gth_filterbar_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthFilterbar, gth_filterbar, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthFilterbar,
+ gth_filterbar,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthFilterbar))
static void
@@ -80,14 +82,10 @@ gth_filterbar_finalize (GObject *object)
filterbar = GTH_FILTERBAR (object);
- if (filterbar->priv != NULL) {
- g_signal_handler_disconnect (gth_main_get_default_monitor (),
filterbar->priv->filters_changed_id);
- if (filterbar->priv->test != NULL) {
- g_signal_handler_disconnect (filterbar->priv->test, filterbar->priv->test_changed_id);
- g_object_unref (filterbar->priv->test);
- }
- g_free (filterbar->priv);
- filterbar->priv = NULL;
+ g_signal_handler_disconnect (gth_main_get_default_monitor (), filterbar->priv->filters_changed_id);
+ if (filterbar->priv->test != NULL) {
+ g_signal_handler_disconnect (filterbar->priv->test, filterbar->priv->test_changed_id);
+ g_object_unref (filterbar->priv->test);
}
G_OBJECT_CLASS (gth_filterbar_parent_class)->finalize (object);
@@ -135,7 +133,16 @@ gth_filterbar_class_init (GthFilterbarClass *class)
static void
gth_filterbar_init (GthFilterbar *filterbar)
{
- filterbar->priv = g_new0 (GthFilterbarPrivate, 1);
+ filterbar->priv = gth_filterbar_get_instance_private (filterbar);
+ filterbar->priv->model = NULL;
+ filterbar->priv->test_combo_box = NULL;
+ filterbar->priv->test = NULL;
+ filterbar->priv->control_box = NULL;
+ filterbar->priv->control = NULL;
+ filterbar->priv->extra_area = NULL;
+ filterbar->priv->filters_changed_id = 0;
+ filterbar->priv->test_changed_id = 0;
+
gtk_orientable_set_orientation (GTK_ORIENTABLE (filterbar), GTK_ORIENTATION_HORIZONTAL);
}
diff --git a/gthumb/gth-folder-tree.c b/gthumb/gth-folder-tree.c
index 9dcd83a3..73c15376 100644
--- a/gthumb/gth-folder-tree.c
+++ b/gthumb/gth-folder-tree.c
@@ -81,8 +81,7 @@ typedef struct {
} MonitorData;
-struct _GthFolderTreePrivate
-{
+struct _GthFolderTreePrivate {
GFile *root;
GHashTable *entry_points; /* An entry point is a root child */
gboolean recalc_entry_points;
@@ -111,7 +110,10 @@ struct _GthFolderTreePrivate
static guint gth_folder_tree_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthFolderTree, gth_folder_tree, GTK_TYPE_TREE_VIEW)
+G_DEFINE_TYPE_WITH_CODE (GthFolderTree,
+ gth_folder_tree,
+ GTK_TYPE_TREE_VIEW,
+ G_ADD_PRIVATE (GthFolderTree))
static void remove_all_locations_from_the_monitor (GthFolderTree *folder_tree);
@@ -124,26 +126,21 @@ gth_folder_tree_finalize (GObject *object)
folder_tree = GTH_FOLDER_TREE (object);
- if (folder_tree->priv != NULL) {
- if (folder_tree->priv->drag_target_list != NULL) {
- gtk_target_list_unref (folder_tree->priv->drag_target_list);
- folder_tree->priv->drag_target_list = NULL;
- }
- if (folder_tree->priv->monitor.update_id != 0) {
- g_source_remove (folder_tree->priv->monitor.update_id);
- folder_tree->priv->monitor.update_id = 0;
- }
- g_hash_table_unref (folder_tree->priv->entry_points);
- remove_all_locations_from_the_monitor (folder_tree);
- g_hash_table_unref (folder_tree->priv->monitor.locations);
- _g_object_list_unref (folder_tree->priv->monitor.sources);
- if (folder_tree->priv->root != NULL)
- g_object_unref (folder_tree->priv->root);
- g_object_unref (folder_tree->priv->tree_store);
-
- g_free (folder_tree->priv);
- folder_tree->priv = NULL;
+ if (folder_tree->priv->drag_target_list != NULL) {
+ gtk_target_list_unref (folder_tree->priv->drag_target_list);
+ folder_tree->priv->drag_target_list = NULL;
+ }
+ if (folder_tree->priv->monitor.update_id != 0) {
+ g_source_remove (folder_tree->priv->monitor.update_id);
+ folder_tree->priv->monitor.update_id = 0;
}
+ g_hash_table_unref (folder_tree->priv->entry_points);
+ remove_all_locations_from_the_monitor (folder_tree);
+ g_hash_table_unref (folder_tree->priv->monitor.locations);
+ _g_object_list_unref (folder_tree->priv->monitor.sources);
+ if (folder_tree->priv->root != NULL)
+ g_object_unref (folder_tree->priv->root);
+ g_object_unref (folder_tree->priv->tree_store);
G_OBJECT_CLASS (gth_folder_tree_parent_class)->finalize (object);
}
@@ -1266,17 +1263,10 @@ gth_folder_tree_init (GthFolderTree *folder_tree)
{
GtkTreeSelection *selection;
- folder_tree->priv = g_new0 (GthFolderTreePrivate, 1);
- folder_tree->priv->drag_source_enabled = FALSE;
- folder_tree->priv->dragging = FALSE;
- folder_tree->priv->drag_started = FALSE;
- folder_tree->priv->drag_target_list = NULL;
+ folder_tree->priv = gth_folder_tree_get_instance_private (folder_tree);
+ folder_tree->priv->root = NULL;
folder_tree->priv->entry_points = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
g_object_unref, NULL);
folder_tree->priv->recalc_entry_points = FALSE;
- folder_tree->priv->monitor.locations = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
g_object_unref, NULL);
- folder_tree->priv->monitor.sources = NULL;
- folder_tree->priv->monitor.update_id = 0;
-
folder_tree->priv->tree_store = gtk_tree_store_new (NUM_COLUMNS,
PANGO_TYPE_STYLE,
PANGO_TYPE_WEIGHT,
@@ -1289,6 +1279,22 @@ gth_folder_tree_init (GthFolderTree *folder_tree)
G_TYPE_STRING,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN);
+ folder_tree->priv->text_renderer = NULL;
+ folder_tree->priv->hover_path = NULL;
+
+ folder_tree->priv->drag_source_enabled = FALSE;
+ folder_tree->priv->drag_start_button_mask = 0;
+ folder_tree->priv->drag_target_list = NULL;
+ folder_tree->priv->drag_actions = 0;
+ folder_tree->priv->dragging = FALSE;
+ folder_tree->priv->drag_started = FALSE;
+ folder_tree->priv->drag_start_x = 0;
+ folder_tree->priv->drag_start_y = 0;
+
+ folder_tree->priv->monitor.locations = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
g_object_unref, NULL);
+ folder_tree->priv->monitor.sources = NULL;
+ folder_tree->priv->monitor.update_id = 0;
+
gtk_tree_view_set_model (GTK_TREE_VIEW (folder_tree), GTK_TREE_MODEL (folder_tree->priv->tree_store));
add_columns (folder_tree, GTK_TREE_VIEW (folder_tree));
diff --git a/gthumb/gth-grid-view.c b/gthumb/gth-grid-view.c
index f9cee67a..106fcedc 100644
--- a/gthumb/gth-grid-view.c
+++ b/gthumb/gth-grid-view.c
@@ -60,16 +60,6 @@ static void gth_grid_view_gth_file_selection_interface_init (GthFileSelectionInt
static void gth_grid_view_gth_file_view_interface_init (GthFileViewInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GthGridView,
- gth_grid_view,
- GTK_TYPE_WIDGET,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_FILE_SELECTION,
- gth_grid_view_gth_file_selection_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_FILE_VIEW,
- gth_grid_view_gth_file_view_interface_init)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
-
-
enum {
SELECT_ALL,
UNSELECT_ALL,
@@ -226,6 +216,17 @@ struct _GthGridViewPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthGridView,
+ gth_grid_view,
+ GTK_TYPE_WIDGET,
+ G_ADD_PRIVATE (GthGridView)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_FILE_SELECTION,
+ gth_grid_view_gth_file_selection_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_FILE_VIEW,
+ gth_grid_view_gth_file_view_interface_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
+
+
/* -- gth_grid_view_item -- */
@@ -3722,8 +3723,6 @@ gth_grid_view_class_init (GthGridViewClass *grid_view_class)
GtkWidgetClass *widget_class;
GtkBindingSet *binding_set;
- g_type_class_add_private (grid_view_class, sizeof (GthGridViewPrivate));
-
/* Methods */
gobject_class = (GObjectClass*) grid_view_class;
@@ -3938,7 +3937,7 @@ gth_grid_view_init (GthGridView *self)
gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE);
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_GRID_VIEW, GthGridViewPrivate);
+ self->priv = gth_grid_view_get_instance_private (self);
/* self->priv->model = NULL; */
self->priv->items = NULL;
diff --git a/gthumb/gth-histogram-view.c b/gthumb/gth-histogram-view.c
index 37c13293..5f8d22c2 100644
--- a/gthumb/gth-histogram-view.c
+++ b/gthumb/gth-histogram-view.c
@@ -67,7 +67,10 @@ struct _GthHistogramViewPrivate {
};
-G_DEFINE_TYPE (GthHistogramView, gth_histogram_view, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthHistogramView,
+ gth_histogram_view,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthHistogramView))
static void
@@ -150,8 +153,6 @@ gth_histogram_view_class_init (GthHistogramViewClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthHistogramViewPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_histogram_set_property;
object_class->get_property = gth_histogram_get_property;
@@ -809,7 +810,7 @@ gth_histogram_view_init (GthHistogramView *self)
GtkCellRenderer *renderer;
GtkTreeIter iter;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_HISTOGRAM_VIEW, GthHistogramViewPrivate);
+ self->priv = gth_histogram_view_get_instance_private (self);
self->priv->histogram = NULL;
self->priv->current_channel = GTH_HISTOGRAM_CHANNEL_VALUE;
self->priv->display_mode = GTH_HISTOGRAM_MODE_ONE_CHANNEL;
diff --git a/gthumb/gth-histogram.c b/gthumb/gth-histogram.c
index 75d7624f..6924ec08 100644
--- a/gthumb/gth-histogram.c
+++ b/gthumb/gth-histogram.c
@@ -46,7 +46,10 @@ struct _GthHistogramPrivate {
static guint gth_histogram_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthHistogram, gth_histogram, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthHistogram,
+ gth_histogram,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthHistogram))
static void
@@ -73,8 +76,6 @@ gth_histogram_class_init (GthHistogramClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthHistogramPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_histogram_finalize;
@@ -97,7 +98,7 @@ gth_histogram_init (GthHistogram *self)
{
int i;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_HISTOGRAM, GthHistogramPrivate);
+ self->priv = gth_histogram_get_instance_private (self);
self->priv->values = g_new0 (int *, GTH_HISTOGRAM_N_CHANNELS + 1);
for (i = 0; i < GTH_HISTOGRAM_N_CHANNELS + 1; i++)
self->priv->values[i] = g_new0 (int, 256);
diff --git a/gthumb/gth-icc-profile.c b/gthumb/gth-icc-profile.c
index 5c63d855..6869a3cf 100644
--- a/gthumb/gth-icc-profile.c
+++ b/gthumb/gth-icc-profile.c
@@ -40,8 +40,15 @@ struct _GthICCTransformPrivate {
};
-G_DEFINE_TYPE (GthICCProfile, gth_icc_profile, G_TYPE_OBJECT)
-G_DEFINE_TYPE (GthICCTransform, gth_icc_transform, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthICCProfile,
+ gth_icc_profile,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthICCProfile))
+
+G_DEFINE_TYPE_WITH_CODE (GthICCTransform,
+ gth_icc_transform,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthICCTransform))
void
@@ -89,8 +96,6 @@ gth_icc_profile_class_init (GthICCProfileClass *klass)
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (GthICCProfilePrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_icc_profile_finalize;
}
@@ -99,7 +104,7 @@ gth_icc_profile_class_init (GthICCProfileClass *klass)
static void
gth_icc_profile_init (GthICCProfile *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_ICC_PROFILE, GthICCProfilePrivate);
+ self->priv = gth_icc_profile_get_instance_private (self);
self->priv->cms_profile = NULL;
self->priv->id = NULL;
}
@@ -293,8 +298,6 @@ gth_icc_transform_class_init (GthICCTransformClass *klass)
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (GthICCTransformPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_icc_transform_finalize;
}
@@ -303,7 +306,7 @@ gth_icc_transform_class_init (GthICCTransformClass *klass)
static void
gth_icc_transform_init (GthICCTransform *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_ICC_TRANSFORM, GthICCTransformPrivate);
+ self->priv = gth_icc_transform_get_instance_private (self);
self->priv->cms_transform = NULL;
}
diff --git a/gthumb/gth-image-dragger.c b/gthumb/gth-image-dragger.c
index 36ccd72d..4d23c7af 100644
--- a/gthumb/gth-image-dragger.c
+++ b/gthumb/gth-image-dragger.c
@@ -57,8 +57,9 @@ static void gth_image_dragger_gth_image_tool_interface_init (GthImageViewerToolI
G_DEFINE_TYPE_WITH_CODE (GthImageDragger,
gth_image_dragger,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImageDragger)
G_IMPLEMENT_INTERFACE (GTH_TYPE_IMAGE_VIEWER_TOOL,
- gth_image_dragger_gth_image_tool_interface_init))
+ gth_image_dragger_gth_image_tool_interface_init))
static void
@@ -131,8 +132,6 @@ gth_image_dragger_class_init (GthImageDraggerClass *class)
{
GObjectClass *gobject_class;
- g_type_class_add_private (class, sizeof (GthImageDraggerPrivate));
-
gobject_class = (GObjectClass*) class;
gobject_class->finalize = gth_image_dragger_finalize;
gobject_class->set_property = gth_image_dragger_set_property;
@@ -153,7 +152,7 @@ gth_image_dragger_class_init (GthImageDraggerClass *class)
static void
gth_image_dragger_init (GthImageDragger *dragger)
{
- dragger->priv = G_TYPE_INSTANCE_GET_PRIVATE (dragger, GTH_TYPE_IMAGE_DRAGGER, GthImageDraggerPrivate);
+ dragger->priv = gth_image_dragger_get_instance_private (dragger);
dragger->priv->scaled = NULL;
dragger->priv->scaled_zoom = 0;
dragger->priv->scale_task = NULL;
diff --git a/gthumb/gth-image-history.c b/gthumb/gth-image-history.c
index 35ed066c..174f651b 100644
--- a/gthumb/gth-image-history.c
+++ b/gthumb/gth-image-history.c
@@ -27,9 +27,6 @@
#define MAX_UNDO_HISTORY_LEN 5
-G_DEFINE_TYPE (GthImageHistory, gth_image_history, G_TYPE_OBJECT)
-
-
/* GthImageData */
@@ -88,12 +85,6 @@ gth_image_data_list_free (GList *list)
/* GthImageHistory */
-struct _GthImageHistoryPrivate {
- GList *undo_history; /* GthImageData items */
- GList *redo_history; /* GthImageData items */
-};
-
-
enum {
CHANGED,
LAST_SIGNAL
@@ -103,6 +94,18 @@ enum {
static guint gth_image_history_signals[LAST_SIGNAL] = { 0 };
+struct _GthImageHistoryPrivate {
+ GList *undo_history; /* GthImageData items */
+ GList *redo_history; /* GthImageData items */
+};
+
+
+G_DEFINE_TYPE_WITH_CODE (GthImageHistory,
+ gth_image_history,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImageHistory))
+
+
static void
gth_image_history_finalize (GObject *object)
{
@@ -111,11 +114,7 @@ gth_image_history_finalize (GObject *object)
g_return_if_fail (GTH_IS_IMAGE_HISTORY (object));
history = GTH_IMAGE_HISTORY (object);
- if (history->priv != NULL) {
- gth_image_history_clear (history);
- g_free (history->priv);
- history->priv = NULL;
- }
+ gth_image_history_clear (history);
G_OBJECT_CLASS (gth_image_history_parent_class)->finalize (object);
}
@@ -143,7 +142,9 @@ gth_image_history_class_init (GthImageHistoryClass *class)
static void
gth_image_history_init (GthImageHistory *history)
{
- history->priv = g_new0 (GthImageHistoryPrivate, 1);
+ history->priv = gth_image_history_get_instance_private (history);
+ history->priv->undo_history = NULL;
+ history->priv->redo_history = NULL;
}
diff --git a/gthumb/gth-image-list-task.c b/gthumb/gth-image-list-task.c
index b477f089..4dc7f004 100644
--- a/gthumb/gth-image-list-task.c
+++ b/gthumb/gth-image-list-task.c
@@ -51,7 +51,10 @@ struct _GthImageListTaskPrivate {
};
-G_DEFINE_TYPE (GthImageListTask, gth_image_list_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthImageListTask,
+ gth_image_list_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthImageListTask))
static void
@@ -469,8 +472,6 @@ gth_image_list_task_class_init (GthImageListTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthImageListTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_list_task_finalize;
@@ -482,7 +483,7 @@ gth_image_list_task_class_init (GthImageListTaskClass *klass)
static void
gth_image_list_task_init (GthImageListTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_LIST_TASK, GthImageListTaskPrivate);
+ self->priv = gth_image_list_task_get_instance_private (self);
self->priv->original_image = NULL;
self->priv->new_image = NULL;
self->priv->destination_folder = NULL;
diff --git a/gthumb/gth-image-loader.c b/gthumb/gth-image-loader.c
index 945add48..2e0b089b 100644
--- a/gthumb/gth-image-loader.c
+++ b/gthumb/gth-image-loader.c
@@ -39,7 +39,10 @@ struct _GthImageLoaderPrivate {
};
-G_DEFINE_TYPE (GthImageLoader, gth_image_loader, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthImageLoader,
+ gth_image_loader,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImageLoader))
static void
@@ -58,8 +61,6 @@ gth_image_loader_class_init (GthImageLoaderClass *class)
{
GObjectClass *object_class;
- g_type_class_add_private (class, sizeof (GthImageLoaderPrivate));
-
object_class = G_OBJECT_CLASS (class);
object_class->finalize = gth_image_loader_finalize;
@@ -69,7 +70,7 @@ gth_image_loader_class_init (GthImageLoaderClass *class)
static void
gth_image_loader_init (GthImageLoader *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_LOADER, GthImageLoaderPrivate);
+ self->priv = gth_image_loader_get_instance_private (self);
self->priv->as_animation = FALSE;
self->priv->loader_func = NULL;
self->priv->loader_data = NULL;
diff --git a/gthumb/gth-image-navigator.c b/gthumb/gth-image-navigator.c
index d2ad6bec..d2c6f287 100644
--- a/gthumb/gth-image-navigator.c
+++ b/gthumb/gth-image-navigator.c
@@ -53,6 +53,12 @@ struct _GthImageNavigatorPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthImageNavigator,
+ gth_image_navigator,
+ GTK_TYPE_CONTAINER,
+ G_ADD_PRIVATE (GthImageNavigator))
+
+
static void
_gth_image_navigator_set_viewer (GthImageNavigator *self,
GtkWidget *viewer)
@@ -296,8 +302,6 @@ gth_image_navigator_class_init (GthImageNavigatorClass *klass)
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
- g_type_class_add_private (klass, sizeof (GthImageNavigatorPrivate));
-
object_class = (GObjectClass *) klass;
object_class->set_property = gth_image_navigator_set_property;
object_class->get_property = gth_image_navigator_get_property;
@@ -506,10 +510,9 @@ gth_image_navigator_init (GthImageNavigator *self)
{
GtkWidget *navigator_icon;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), GTH_TYPE_IMAGE_NAVIGATOR, GthImageNavigatorPrivate);
-
gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
+ self->priv = gth_image_navigator_get_instance_private (self);
self->priv->automatic_scrollbars = TRUE;
self->priv->hscrollbar_visible = FALSE;
self->priv->vscrollbar_visible = FALSE;
@@ -543,9 +546,6 @@ gth_image_navigator_init (GthImageNavigator *self)
}
-G_DEFINE_TYPE (GthImageNavigator, gth_image_navigator, GTK_TYPE_CONTAINER)
-
-
GtkWidget *
gth_image_navigator_new (GthImageViewer *viewer)
{
diff --git a/gthumb/gth-image-overview.c b/gthumb/gth-image-overview.c
index 72c316c2..cc80c9be 100644
--- a/gthumb/gth-image-overview.c
+++ b/gthumb/gth-image-overview.c
@@ -68,7 +68,9 @@ struct _GthImageOverviewPrivate {
};
-G_DEFINE_TYPE_WITH_CODE (GthImageOverview, gth_image_overview, GTK_TYPE_WIDGET,
+G_DEFINE_TYPE_WITH_CODE (GthImageOverview,
+ gth_image_overview,
+ GTK_TYPE_WIDGET,
G_ADD_PRIVATE (GthImageOverview))
diff --git a/gthumb/gth-image-preloader.c b/gthumb/gth-image-preloader.c
index f88254bd..8a2d4bdd 100644
--- a/gthumb/gth-image-preloader.c
+++ b/gthumb/gth-image-preloader.c
@@ -34,7 +34,6 @@
#undef DEBUG_PRELOADER
#undef RESIZE_TO_REQUESTED_SIZE
-#define GTH_IMAGE_PRELOADER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTH_TYPE_IMAGE_PRELOADER,
GthImagePreloaderPrivate))
#define LOAD_NEXT_FILE_DELAY 100
#define CACHE_MAX_SIZE 10
@@ -83,7 +82,10 @@ struct _GthImagePreloaderPrivate {
};
-G_DEFINE_TYPE (GthImagePreloader, gth_image_preloader, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthImagePreloader,
+ gth_image_preloader,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImagePreloader))
/* -- CacheData -- */
@@ -274,8 +276,6 @@ gth_image_preloader_class_init (GthImagePreloaderClass *class)
{
GObjectClass *object_class;
- g_type_class_add_private (class, sizeof (GthImagePreloaderPrivate));
-
object_class = G_OBJECT_CLASS (class);
object_class->finalize = gth_image_preloader_finalize;
}
@@ -284,7 +284,7 @@ gth_image_preloader_class_init (GthImagePreloaderClass *class)
static void
gth_image_preloader_init (GthImagePreloader *self)
{
- self->priv = GTH_IMAGE_PRELOADER_GET_PRIVATE (self);
+ self->priv = gth_image_preloader_get_instance_private (self);
self->priv->requests = NULL;
self->priv->current_request = NULL;
self->priv->last_request = NULL;
diff --git a/gthumb/gth-image-selector.c b/gthumb/gth-image-selector.c
index fd821594..f1ea0a5d 100644
--- a/gthumb/gth-image-selector.c
+++ b/gthumb/gth-image-selector.c
@@ -229,8 +229,9 @@ static void gth_image_selector_gth_image_tool_interface_init (GthImageViewerTool
G_DEFINE_TYPE_WITH_CODE (GthImageSelector,
gth_image_selector,
G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImageSelector)
G_IMPLEMENT_INTERFACE (GTH_TYPE_IMAGE_VIEWER_TOOL,
- gth_image_selector_gth_image_tool_interface_init))
+ gth_image_selector_gth_image_tool_interface_init))
static gboolean
@@ -1606,7 +1607,7 @@ gth_image_selector_zoom_changed (GthImageViewerTool *base)
static void
gth_image_selector_init (GthImageSelector *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SELECTOR, GthImageSelectorPrivate);
+ self->priv = gth_image_selector_get_instance_private (self);
self->priv->type = GTH_SELECTOR_TYPE_REGION;
self->priv->ratio = 1.0;
@@ -1638,8 +1639,6 @@ gth_image_selector_class_init (GthImageSelectorClass *class)
{
GObjectClass *gobject_class;
- g_type_class_add_private (class, sizeof (GthImageSelectorPrivate));
-
gobject_class = (GObjectClass*) class;
gobject_class->finalize = gth_image_selector_finalize;
diff --git a/gthumb/gth-image-task-chain.c b/gthumb/gth-image-task-chain.c
index 3c08565e..cde6da26 100644
--- a/gthumb/gth-image-task-chain.c
+++ b/gthumb/gth-image-task-chain.c
@@ -35,7 +35,10 @@ struct _GthImageTaskChainPrivate {
};
-G_DEFINE_TYPE (GthImageTaskChain, gth_image_task_chain, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthImageTaskChain,
+ gth_image_task_chain,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthImageTaskChain))
static void
@@ -164,8 +167,6 @@ gth_image_task_chain_class_init (GthImageTaskChainClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthImageTaskChainPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_task_chain_finalize;
@@ -177,7 +178,7 @@ gth_image_task_chain_class_init (GthImageTaskChainClass *klass)
static void
gth_image_task_chain_init (GthImageTaskChain *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_TASK_CHAIN, GthImageTaskChainPrivate);
+ self->priv = gth_image_task_chain_get_instance_private (self);
self->priv->tasks = NULL;
self->priv->task_completed = 0;
self->priv->task_dialog = 0;
diff --git a/gthumb/gth-image-task.c b/gthumb/gth-image-task.c
index 880c0096..105f13c7 100644
--- a/gthumb/gth-image-task.c
+++ b/gthumb/gth-image-task.c
@@ -30,7 +30,10 @@ struct _GthImageTaskPrivate {
};
-G_DEFINE_TYPE (GthImageTask, gth_image_task, GTH_TYPE_ASYNC_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthImageTask,
+ gth_image_task,
+ GTH_TYPE_ASYNC_TASK,
+ G_ADD_PRIVATE (GthImageTask))
static void
@@ -53,8 +56,6 @@ gth_image_task_class_init (GthImageTaskClass *class)
{
GObjectClass *object_class;
- g_type_class_add_private (class, sizeof (GthImageTaskPrivate));
-
object_class = G_OBJECT_CLASS (class);
object_class->finalize = gth_image_task_finalize;
}
@@ -63,7 +64,7 @@ gth_image_task_class_init (GthImageTaskClass *class)
static void
gth_image_task_init (GthImageTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_TASK, GthImageTaskPrivate);
+ self->priv = gth_image_task_get_instance_private (self);
self->priv->source = NULL;
self->priv->destination = NULL;
}
diff --git a/gthumb/gth-image-viewer.c b/gthumb/gth-image-viewer.c
index 7b481d7b..5391028a 100644
--- a/gthumb/gth-image-viewer.c
+++ b/gthumb/gth-image-viewer.c
@@ -43,12 +43,6 @@
#define BLACK_VALUE 0.2
-G_DEFINE_TYPE_WITH_CODE (GthImageViewer,
- gth_image_viewer,
- GTK_TYPE_WIDGET,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
-
-
enum {
PROP_0,
PROP_HADJUSTMENT,
@@ -125,6 +119,13 @@ struct _GthImageViewerPrivate {
static guint gth_image_viewer_signals[LAST_SIGNAL] = { 0 };
+G_DEFINE_TYPE_WITH_CODE (GthImageViewer,
+ gth_image_viewer,
+ GTK_TYPE_WIDGET,
+ G_ADD_PRIVATE (GthImageViewer)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
+
+
typedef struct {
GthImageViewerPaintFunc func;
gpointer user_data;
@@ -1239,8 +1240,6 @@ gth_image_viewer_class_init (GthImageViewerClass *class)
GtkWidgetClass *widget_class;
GtkBindingSet *binding_set;
- g_type_class_add_private (class, sizeof (GthImageViewerPrivate));
-
/* signals */
gth_image_viewer_signals[CLICKED] =
@@ -1518,7 +1517,7 @@ gth_image_viewer_init (GthImageViewer *self)
/* Initialize data. */
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_VIEWER, GthImageViewerPrivate);
+ self->priv = gth_image_viewer_get_instance_private (self);
self->priv->is_animation = FALSE;
self->priv->play_animation = TRUE;
diff --git a/gthumb/gth-image.c b/gthumb/gth-image.c
index ac96267d..cc3dd072 100644
--- a/gthumb/gth-image.c
+++ b/gthumb/gth-image.c
@@ -48,7 +48,10 @@ struct _GthImagePrivate {
};
-G_DEFINE_TYPE (GthImage, gth_image, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthImage,
+ gth_image,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthImage))
static void
@@ -120,8 +123,6 @@ gth_image_class_init (GthImageClass *klass)
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (GthImagePrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_image_finalize;
@@ -133,7 +134,7 @@ gth_image_class_init (GthImageClass *klass)
static void
gth_image_init (GthImage *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE, GthImagePrivate);
+ self->priv = gth_image_get_instance_private (self);
self->priv->format = GTH_IMAGE_FORMAT_CAIRO_SURFACE;
self->priv->data.surface = NULL;
self->priv->icc_data = NULL;
diff --git a/gthumb/gth-info-bar.c b/gthumb/gth-info-bar.c
index df91a979..c77d01b5 100644
--- a/gthumb/gth-info-bar.c
+++ b/gthumb/gth-info-bar.c
@@ -32,13 +32,16 @@ struct _GthInfoBarPrivate {
};
-G_DEFINE_TYPE (GthInfoBar, gth_info_bar, GTK_TYPE_INFO_BAR)
+G_DEFINE_TYPE_WITH_CODE (GthInfoBar,
+ gth_info_bar,
+ GTK_TYPE_INFO_BAR,
+ G_ADD_PRIVATE (GthInfoBar))
static void
gth_info_bar_class_init (GthInfoBarClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthInfoBarPrivate));
+ /* void */
}
@@ -65,7 +68,7 @@ gth_info_bar_init (GthInfoBar *self)
GtkWidget *secondary_label;
GtkWidget *area;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_INFO_BAR, GthInfoBarPrivate);
+ self->priv = gth_info_bar_get_instance_private (self);
hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_widget_show (hbox_content);
diff --git a/gthumb/gth-load-file-data-task.c b/gthumb/gth-load-file-data-task.c
index 52f4119b..1c5453ea 100644
--- a/gthumb/gth-load-file-data-task.c
+++ b/gthumb/gth-load-file-data-task.c
@@ -36,7 +36,10 @@ struct _GthLoadFileDataTaskPrivate {
};
-G_DEFINE_TYPE (GthLoadFileDataTask, gth_load_file_data_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthLoadFileDataTask,
+ gth_load_file_data_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthLoadFileDataTask))
static void
@@ -142,8 +145,6 @@ gth_load_file_data_task_class_init (GthLoadFileDataTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthLoadFileDataTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_load_file_data_task_finalize;
@@ -155,7 +156,7 @@ gth_load_file_data_task_class_init (GthLoadFileDataTaskClass *klass)
static void
gth_load_file_data_task_init (GthLoadFileDataTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_LOAD_FILE_DATA_TASK,
GthLoadFileDataTaskPrivate);
+ self->priv = gth_load_file_data_task_get_instance_private (self);
self->priv->file_data_list = NULL;
}
diff --git a/gthumb/gth-location-bar.c b/gthumb/gth-location-bar.c
index ef447dcb..ffac1f93 100644
--- a/gthumb/gth-location-bar.c
+++ b/gthumb/gth-location-bar.c
@@ -34,7 +34,9 @@ struct _GthLocationBarPrivate {
};
-G_DEFINE_TYPE_WITH_CODE (GthLocationBar, gth_location_bar, GTK_TYPE_BOX,
+G_DEFINE_TYPE_WITH_CODE (GthLocationBar,
+ gth_location_bar,
+ GTK_TYPE_BOX,
G_ADD_PRIVATE (GthLocationBar))
diff --git a/gthumb/gth-location-chooser.c b/gthumb/gth-location-chooser.c
index d9638ac4..245dcdf6 100644
--- a/gthumb/gth-location-chooser.c
+++ b/gthumb/gth-location-chooser.c
@@ -36,9 +36,6 @@
#define MIN_WIDTH 200
-G_DEFINE_TYPE (GthLocationChooser, gth_location_chooser, GTK_TYPE_BOX)
-
-
enum {
ITEM_TYPE_NONE,
ITEM_TYPE_SEPARATOR,
@@ -67,8 +64,8 @@ enum {
LAST_SIGNAL
};
-struct _GthLocationChooserPrivate
-{
+
+struct _GthLocationChooserPrivate {
GtkWidget *combo;
GtkTreeStore *model;
GFile *location;
@@ -85,6 +82,11 @@ struct _GthLocationChooserPrivate
static guint gth_location_chooser_signals[LAST_SIGNAL] = { 0 };
+G_DEFINE_TYPE_WITH_CODE (GthLocationChooser,
+ gth_location_chooser,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthLocationChooser))
+
static void
gth_location_chooser_set_property (GObject *object,
@@ -491,8 +493,6 @@ gth_location_chooser_class_init (GthLocationChooserClass *klass)
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (klass, sizeof (GthLocationChooserPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_location_chooser_set_property;
object_class->get_property = gth_location_chooser_get_property;
@@ -542,7 +542,7 @@ gth_location_chooser_init (GthLocationChooser *self)
gtk_widget_set_can_focus (GTK_WIDGET (self), FALSE);
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_HORIZONTAL);
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_LOCATION_CHOOSER, GthLocationChooserPrivate);
+ self->priv = gth_location_chooser_get_instance_private (self);
self->priv->entry_points_changed_id = 0;
self->priv->show_entry_points = TRUE;
self->priv->relief = GTK_RELIEF_NORMAL;
diff --git a/gthumb/gth-main.c b/gthumb/gth-main.c
index 63569c34..d3e588ef 100644
--- a/gthumb/gth-main.c
+++ b/gthumb/gth-main.c
@@ -92,8 +92,7 @@ gth_type_spec_create_object (GthTypeSpec *spec,
static GthMain *Main = NULL;
-struct _GthMainPrivate
-{
+struct _GthMainPrivate {
GList *file_sources;
GList *metadata_provider;
GPtrArray *metadata_category;
@@ -114,7 +113,10 @@ struct _GthMainPrivate
};
-G_DEFINE_TYPE (GthMain, gth_main, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthMain,
+ gth_main,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthMain))
static void
@@ -122,38 +124,33 @@ gth_main_finalize (GObject *object)
{
GthMain *gth_main = GTH_MAIN (object);
- if (gth_main->priv != NULL) {
- _g_object_list_unref (gth_main->priv->file_sources);
-
- g_hash_table_unref (gth_main->priv->metadata_info_hash);
- g_ptr_array_free (gth_main->priv->metadata_category, TRUE);
- g_ptr_array_free (gth_main->priv->metadata_info, TRUE);
- g_list_foreach (gth_main->priv->metadata_provider, (GFunc) g_object_unref, NULL);
- g_list_free (gth_main->priv->metadata_provider);
-
- if (gth_main->priv->sort_types != NULL)
- g_hash_table_unref (gth_main->priv->sort_types);
- if (gth_main->priv->image_loaders != NULL)
- g_hash_table_unref (gth_main->priv->image_loaders);
- if (gth_main->priv->types != NULL)
- g_hash_table_unref (gth_main->priv->types);
- if (gth_main->priv->classes != NULL)
- g_hash_table_unref (gth_main->priv->classes);
- if (gth_main->priv->objects_order != NULL)
- g_hash_table_unref (gth_main->priv->objects_order);
-
- if (gth_main->priv->bookmarks != NULL)
- g_bookmark_file_free (gth_main->priv->bookmarks);
-
- _g_object_unref (gth_main->priv->monitor);
- _g_object_unref (gth_main->priv->extension_manager);
- _g_object_unref (gth_main->priv->color_manager);
- gth_filter_file_free (gth_main->priv->filters);
- gth_tags_file_free (gth_main->priv->tags);
-
- g_free (gth_main->priv);
- gth_main->priv = NULL;
- }
+ _g_object_list_unref (gth_main->priv->file_sources);
+
+ g_hash_table_unref (gth_main->priv->metadata_info_hash);
+ g_ptr_array_free (gth_main->priv->metadata_category, TRUE);
+ g_ptr_array_free (gth_main->priv->metadata_info, TRUE);
+ g_list_foreach (gth_main->priv->metadata_provider, (GFunc) g_object_unref, NULL);
+ g_list_free (gth_main->priv->metadata_provider);
+
+ if (gth_main->priv->sort_types != NULL)
+ g_hash_table_unref (gth_main->priv->sort_types);
+ if (gth_main->priv->image_loaders != NULL)
+ g_hash_table_unref (gth_main->priv->image_loaders);
+ if (gth_main->priv->types != NULL)
+ g_hash_table_unref (gth_main->priv->types);
+ if (gth_main->priv->classes != NULL)
+ g_hash_table_unref (gth_main->priv->classes);
+ if (gth_main->priv->objects_order != NULL)
+ g_hash_table_unref (gth_main->priv->objects_order);
+
+ if (gth_main->priv->bookmarks != NULL)
+ g_bookmark_file_free (gth_main->priv->bookmarks);
+
+ _g_object_unref (gth_main->priv->monitor);
+ _g_object_unref (gth_main->priv->extension_manager);
+ _g_object_unref (gth_main->priv->color_manager);
+ gth_filter_file_free (gth_main->priv->filters);
+ gth_tags_file_free (gth_main->priv->tags);
G_OBJECT_CLASS (gth_main_parent_class)->finalize (object);
}
@@ -172,17 +169,27 @@ gth_main_class_init (GthMainClass *class)
static void
gth_main_init (GthMain *main)
{
- main->priv = g_new0 (GthMainPrivate, 1);
+ main->priv = gth_main_get_instance_private (main);
+ main->priv->file_sources = NULL;
+ main->priv->metadata_provider = NULL;
+ main->priv->metadata_category = g_ptr_array_new ();
+ main->priv->metadata_info = g_ptr_array_new ();
+ main->priv->metadata_info_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
+ main->priv->metadata_info_sorted = FALSE;
main->priv->sort_types = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
main->priv->image_loaders = g_hash_table_new_full (g_str_hash,
(GEqualFunc) g_content_type_equals,
g_free,
NULL);
- main->priv->metadata_category = g_ptr_array_new ();
- main->priv->metadata_info = g_ptr_array_new ();
- main->priv->metadata_info_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
- main->priv->metadata_info_sorted = FALSE;
+ main->priv->types = NULL;
+ main->priv->classes = NULL;
+ main->priv->objects_order = NULL;
+ main->priv->bookmarks = NULL;
+ main->priv->filters = NULL;
+ main->priv->tags = NULL;
+ main->priv->monitor = NULL;
main->priv->extension_manager = gth_extension_manager_new ();
+ main->priv->color_manager = NULL;
}
diff --git a/gthumb/gth-menu-manager.c b/gthumb/gth-menu-manager.c
index 1a1ea679..95d7b8cc 100644
--- a/gthumb/gth-menu-manager.c
+++ b/gthumb/gth-menu-manager.c
@@ -42,7 +42,10 @@ struct _GthMenuManagerPrivate {
};
-G_DEFINE_TYPE (GthMenuManager, gth_menu_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthMenuManager,
+ gth_menu_manager,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthMenuManager))
static void
@@ -116,8 +119,6 @@ gth_menu_manager_class_init (GthMenuManagerClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthMenuManagerPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_menu_manager_set_property;
object_class->get_property = gth_menu_manager_get_property;
@@ -138,7 +139,7 @@ gth_menu_manager_class_init (GthMenuManagerClass *klass)
static void
gth_menu_manager_init (GthMenuManager *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_MENU_MANAGER, GthMenuManagerPrivate);
+ self->priv = gth_menu_manager_get_instance_private (self);
self->priv->items = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
self->priv->last_id = 1;
self->priv->menu = NULL;
diff --git a/gthumb/gth-metadata-chooser.c b/gthumb/gth-metadata-chooser.c
index 2bc60f75..0eda2cc8 100644
--- a/gthumb/gth-metadata-chooser.c
+++ b/gthumb/gth-metadata-chooser.c
@@ -60,14 +60,15 @@ struct _GthMetadataChooserPrivate {
static guint gth_metadata_chooser_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthMetadataChooser, gth_metadata_chooser, GTK_TYPE_TREE_VIEW)
+G_DEFINE_TYPE_WITH_CODE (GthMetadataChooser,
+ gth_metadata_chooser,
+ GTK_TYPE_TREE_VIEW,
+ G_ADD_PRIVATE (GthMetadataChooser))
static void
gth_metadata_chooser_class_init (GthMetadataChooserClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthMetadataChooserPrivate));
-
/* signals */
gth_metadata_chooser_signals[CHANGED] =
@@ -300,7 +301,7 @@ gth_metadata_chooser_init (GthMetadataChooser *self)
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_METADATA_CHOOSER, GthMetadataChooserPrivate);
+ self->priv = gth_metadata_chooser_get_instance_private (self);
/* the list view */
diff --git a/gthumb/gth-metadata.c b/gthumb/gth-metadata.c
index f3d37b13..86a136e9 100644
--- a/gthumb/gth-metadata.c
+++ b/gthumb/gth-metadata.c
@@ -46,7 +46,10 @@ struct _GthMetadataPrivate {
};
-G_DEFINE_TYPE (GthMetadata, gth_metadata, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthMetadata,
+ gth_metadata,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthMetadata))
static void
@@ -142,8 +145,6 @@ gth_metadata_finalize (GObject *obj)
static void
gth_metadata_class_init (GthMetadataClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthMetadataPrivate));
-
G_OBJECT_CLASS (klass)->get_property = gth_metadata_get_property;
G_OBJECT_CLASS (klass)->set_property = gth_metadata_set_property;
G_OBJECT_CLASS (klass)->finalize = gth_metadata_finalize;
@@ -196,7 +197,7 @@ gth_metadata_class_init (GthMetadataClass *klass)
static void
gth_metadata_init (GthMetadata *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_METADATA, GthMetadataPrivate);
+ self->priv = gth_metadata_get_instance_private (self);
self->priv->data_type = GTH_METADATA_TYPE_STRING;
self->priv->id = NULL;
self->priv->description = NULL;
diff --git a/gthumb/gth-monitor.c b/gthumb/gth-monitor.c
index d292186d..c297fc1a 100644
--- a/gthumb/gth-monitor.c
+++ b/gthumb/gth-monitor.c
@@ -45,7 +45,7 @@ enum {
};
-struct _GthMonitorPrivateData {
+struct _GthMonitorPrivate {
gboolean active;
GHashTable *paused_files;
};
@@ -54,7 +54,10 @@ struct _GthMonitorPrivateData {
static guint monitor_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthMonitor, gth_monitor, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthMonitor,
+ gth_monitor,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthMonitor))
static void
@@ -71,7 +74,7 @@ gth_monitor_finalize (GObject *object)
static void
gth_monitor_init (GthMonitor *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_MONITOR, GthMonitorPrivateData);
+ self->priv = gth_monitor_get_instance_private (self);
self->priv->active = TRUE;
self->priv->paused_files = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
g_object_unref, NULL);
}
@@ -82,8 +85,6 @@ gth_monitor_class_init (GthMonitorClass *class)
{
GObjectClass *gobject_class;
- g_type_class_add_private (class, sizeof (GthMonitorPrivateData));
-
gobject_class = (GObjectClass*) class;
gobject_class->finalize = gth_monitor_finalize;
diff --git a/gthumb/gth-monitor.h b/gthumb/gth-monitor.h
index e046d946..8ffd3ad4 100644
--- a/gthumb/gth-monitor.h
+++ b/gthumb/gth-monitor.h
@@ -45,12 +45,12 @@ typedef enum {
typedef struct _GthMonitor GthMonitor;
typedef struct _GthMonitorClass GthMonitorClass;
-typedef struct _GthMonitorPrivateData GthMonitorPrivateData;
+typedef struct _GthMonitorPrivate GthMonitorPrivate;
struct _GthMonitor
{
GObject __parent;
- GthMonitorPrivateData *priv;
+ GthMonitorPrivate *priv;
};
struct _GthMonitorClass
diff --git a/gthumb/gth-multipage.c b/gthumb/gth-multipage.c
index 348c45aa..a4a96b12 100644
--- a/gthumb/gth-multipage.c
+++ b/gthumb/gth-multipage.c
@@ -25,9 +25,6 @@
#include "gth-multipage.h"
-#define GTH_MULTIPAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTH_TYPE_MULTIPAGE,
GthMultipagePrivate))
-
-
enum {
CHANGED,
LAST_SIGNAL
@@ -45,7 +42,10 @@ struct _GthMultipagePrivate {
};
-G_DEFINE_TYPE (GthMultipage, gth_multipage, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthMultipage,
+ gth_multipage,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthMultipage))
static void
@@ -67,8 +67,6 @@ gth_multipage_class_init (GthMultipageClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthMultipagePrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_multipage_finalize;
@@ -132,7 +130,7 @@ gth_multipage_init (GthMultipage *multipage)
{
GtkWidget *switcher_box;
- multipage->priv = GTH_MULTIPAGE_GET_PRIVATE (multipage);
+ multipage->priv = gth_multipage_get_instance_private (multipage);
multipage->priv->children = NULL;
multipage->priv->boxes = NULL;
diff --git a/gthumb/gth-overwrite-dialog.c b/gthumb/gth-overwrite-dialog.c
index 0fda5d6a..a1bd0bf1 100644
--- a/gthumb/gth-overwrite-dialog.c
+++ b/gthumb/gth-overwrite-dialog.c
@@ -47,7 +47,10 @@ struct _GthOverwriteDialogPrivate {
};
-G_DEFINE_TYPE (GthOverwriteDialog, gth_overwrite_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (GthOverwriteDialog,
+ gth_overwrite_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthOverwriteDialog))
static void
@@ -73,7 +76,6 @@ gth_overwrite_dialog_finalize (GObject *object)
static void
gth_overwrite_dialog_class_init (GthOverwriteDialogClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthOverwriteDialogPrivate));
G_OBJECT_CLASS (klass)->finalize = gth_overwrite_dialog_finalize;
}
@@ -81,7 +83,7 @@ gth_overwrite_dialog_class_init (GthOverwriteDialogClass *klass)
static void
gth_overwrite_dialog_init (GthOverwriteDialog *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_OVERWRITE_DIALOG, GthOverwriteDialogPrivate);
+ self->priv = gth_overwrite_dialog_get_instance_private (self);
self->priv->source_data = NULL;
self->priv->destination_data = NULL;
}
diff --git a/gthumb/gth-paned.c b/gthumb/gth-paned.c
index 58a1de6c..d4d1e0d3 100644
--- a/gthumb/gth-paned.c
+++ b/gthumb/gth-paned.c
@@ -24,9 +24,6 @@
#include "gth-paned.h"
-G_DEFINE_TYPE (GthPaned, gth_paned, GTK_TYPE_PANED)
-
-
enum {
PROP_0,
PROP_POSITION2
@@ -39,6 +36,12 @@ struct _GthPanedPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthPaned,
+ gth_paned,
+ GTK_TYPE_PANED,
+ G_ADD_PRIVATE (GthPaned))
+
+
static void
gth_paned_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -110,8 +113,6 @@ gth_paned_class_init (GthPanedClass *paned_class)
GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (paned_class, sizeof (GthPanedPrivate));
-
gobject_class = (GObjectClass*) paned_class;
gobject_class->set_property = gth_paned_set_property;
gobject_class->get_property = gth_paned_get_property;
@@ -138,7 +139,7 @@ gth_paned_init (GthPaned *self)
{
gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE);
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_PANED, GthPanedPrivate);
+ self->priv = gth_paned_get_instance_private (self);
self->priv->position2_set = FALSE;
self->priv->child2_size = 0;
}
diff --git a/gthumb/gth-progress-dialog.c b/gthumb/gth-progress-dialog.c
index 6a37e28a..7a9655c4 100644
--- a/gthumb/gth-progress-dialog.c
+++ b/gthumb/gth-progress-dialog.c
@@ -263,7 +263,10 @@ struct _GthProgressDialogPrivate {
};
-G_DEFINE_TYPE (GthProgressDialog, gth_progress_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (GthProgressDialog,
+ gth_progress_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthProgressDialog))
static void
@@ -283,8 +286,6 @@ gth_progress_dialog_finalize (GObject *base)
static void
gth_progress_dialog_class_init (GthProgressDialogClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthProgressDialogPrivate));
-
G_OBJECT_CLASS (klass)->finalize = gth_progress_dialog_finalize;
}
@@ -302,7 +303,7 @@ progress_dialog_response_cb (GtkDialog *dialog,
static void
gth_progress_dialog_init (GthProgressDialog *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_PROGRESS_DIALOG, GthProgressDialogPrivate);
+ self->priv = gth_progress_dialog_get_instance_private (self);
self->priv->custom_dialog_opened = FALSE;
self->priv->destroy_with_tasks = FALSE;
diff --git a/gthumb/gth-request-dialog.c b/gthumb/gth-request-dialog.c
index fa6caecc..572aa897 100644
--- a/gthumb/gth-request-dialog.c
+++ b/gthumb/gth-request-dialog.c
@@ -35,20 +35,23 @@ struct _GthRequestDialogPrivate {
};
-G_DEFINE_TYPE (GthRequestDialog, gth_request_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (GthRequestDialog,
+ gth_request_dialog,
+ GTK_TYPE_DIALOG,
+ G_ADD_PRIVATE (GthRequestDialog))
static void
gth_request_dialog_class_init (GthRequestDialogClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthRequestDialogPrivate));
+ /* void */
}
static void
gth_request_dialog_init (GthRequestDialog *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_REQUEST_DIALOG, GthRequestDialogPrivate);
+ self->priv = gth_request_dialog_get_instance_private (self);
gtk_window_set_title (GTK_WINDOW (self), "");
}
diff --git a/gthumb/gth-save-file-data-task.c b/gthumb/gth-save-file-data-task.c
index 3631799d..b19573c8 100644
--- a/gthumb/gth-save-file-data-task.c
+++ b/gthumb/gth-save-file-data-task.c
@@ -35,7 +35,10 @@ struct _GthSaveFileDataTaskPrivate {
};
-G_DEFINE_TYPE (GthSaveFileDataTask, gth_save_file_data_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthSaveFileDataTask,
+ gth_save_file_data_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthSaveFileDataTask))
static void
@@ -136,8 +139,6 @@ gth_save_file_data_task_class_init (GthSaveFileDataTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthSaveFileDataTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_save_file_data_task_finalize;
@@ -149,7 +150,7 @@ gth_save_file_data_task_class_init (GthSaveFileDataTaskClass *klass)
static void
gth_save_file_data_task_init (GthSaveFileDataTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SAVE_FILE_DATA_TASK,
GthSaveFileDataTaskPrivate);
+ self->priv = gth_save_file_data_task_get_instance_private (self);
self->priv->file_data_list = NULL;
self->priv->attributes = NULL;
}
diff --git a/gthumb/gth-save-image-task.c b/gthumb/gth-save-image-task.c
index 191f5a45..f0c6f357 100644
--- a/gthumb/gth-save-image-task.c
+++ b/gthumb/gth-save-image-task.c
@@ -33,7 +33,10 @@ struct _GthSaveImageTaskPrivate {
};
-G_DEFINE_TYPE (GthSaveImageTask, gth_save_image_task, GTH_TYPE_IMAGE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthSaveImageTask,
+ gth_save_image_task,
+ GTH_TYPE_IMAGE_TASK,
+ G_ADD_PRIVATE (GthSaveImageTask))
static void
@@ -186,8 +189,6 @@ gth_save_image_task_class_init (GthSaveImageTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthSaveImageTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_save_image_task_finalize;
@@ -199,7 +200,7 @@ gth_save_image_task_class_init (GthSaveImageTaskClass *klass)
static void
gth_save_image_task_init (GthSaveImageTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SAVE_IMAGE_TASK, GthSaveImageTaskPrivate);
+ self->priv = gth_save_image_task_get_instance_private (self);
self->priv->mime_type = NULL;
self->priv->file_data = NULL;
}
diff --git a/gthumb/gth-screensaver.c b/gthumb/gth-screensaver.c
index 5acb77fb..f7842c8b 100644
--- a/gthumb/gth-screensaver.c
+++ b/gthumb/gth-screensaver.c
@@ -38,7 +38,10 @@ struct _GthScreensaverPrivate {
};
-G_DEFINE_TYPE (GthScreensaver, gth_screensaver, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthScreensaver,
+ gth_screensaver,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthScreensaver))
static void
@@ -103,8 +106,6 @@ gth_screensaver_class_init (GthScreensaverClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthScreensaverPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_screensaver_set_property;
object_class->get_property = gth_screensaver_get_property;
@@ -125,7 +126,7 @@ gth_screensaver_class_init (GthScreensaverClass *klass)
static void
gth_screensaver_init (GthScreensaver *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_SCREENSAVER, GthScreensaverPrivate);
+ self->priv = gth_screensaver_get_instance_private (self);
self->priv->application = NULL;
self->priv->cookie = 0;
}
diff --git a/gthumb/gth-sidebar.c b/gthumb/gth-sidebar.c
index bfc17b52..13beda41 100644
--- a/gthumb/gth-sidebar.c
+++ b/gthumb/gth-sidebar.c
@@ -29,7 +29,6 @@
#include "gtk-utils.h"
-#define GTH_SIDEBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTH_TYPE_SIDEBAR, GthSidebarPrivate))
#define GTH_SIDEBAR_PAGE_PROPERTIES "GthSidebar.Properties"
#define GTH_SIDEBAR_PAGE_TOOLS "GthSidebar.Tools"
@@ -42,7 +41,10 @@ struct _GthSidebarPrivate {
};
-G_DEFINE_TYPE (GthSidebar, gth_sidebar, GTK_TYPE_STACK)
+G_DEFINE_TYPE_WITH_CODE (GthSidebar,
+ gth_sidebar,
+ GTK_TYPE_STACK,
+ G_ADD_PRIVATE (GthSidebar))
static void
@@ -95,8 +97,6 @@ gth_sidebar_class_init (GthSidebarClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthSidebarPrivate));
-
object_class = (GObjectClass *) klass;
object_class->finalize = gth_sidebar_finalize;
}
@@ -105,7 +105,7 @@ gth_sidebar_class_init (GthSidebarClass *klass)
static void
gth_sidebar_init (GthSidebar *sidebar)
{
- sidebar->priv = GTH_SIDEBAR_GET_PRIVATE (sidebar);
+ sidebar->priv = gth_sidebar_get_instance_private (sidebar);
sidebar->priv->dirty = NULL;
sidebar->priv->file_data = NULL;
}
diff --git a/gthumb/gth-source-tree.c b/gthumb/gth-source-tree.c
index 6674a32c..3cb48c4c 100644
--- a/gthumb/gth-source-tree.c
+++ b/gthumb/gth-source-tree.c
@@ -37,7 +37,10 @@ struct _GthSourceTreePrivate {
};
-G_DEFINE_TYPE (GthSourceTree, gth_source_tree, GTH_TYPE_FOLDER_TREE)
+G_DEFINE_TYPE_WITH_CODE (GthSourceTree,
+ gth_source_tree,
+ GTH_TYPE_FOLDER_TREE,
+ G_ADD_PRIVATE (GthSourceTree))
/* -- monitor_event_data -- */
@@ -285,7 +288,8 @@ monitor_file_renamed_cb (GthMonitor *monitor,
static void
gth_source_tree_init (GthSourceTree *source_tree)
{
- source_tree->priv = g_new0 (GthSourceTreePrivate, 1);
+ source_tree->priv = gth_source_tree_get_instance_private (source_tree);
+ source_tree->priv->file_source = NULL;
g_signal_connect (source_tree,
"list_children",
@@ -295,6 +299,7 @@ gth_source_tree_init (GthSourceTree *source_tree)
"rename",
G_CALLBACK (source_tree_rename_cb),
source_tree);
+
source_tree->priv->monitor_folder_changed_id =
g_signal_connect (gth_main_get_default_monitor (),
"folder-changed",
@@ -313,15 +318,11 @@ gth_source_tree_finalize (GObject *object)
{
GthSourceTree *source_tree = GTH_SOURCE_TREE (object);
- if (source_tree->priv != NULL) {
- g_signal_handler_disconnect (gth_main_get_default_monitor (),
source_tree->priv->monitor_folder_changed_id);
- g_signal_handler_disconnect (gth_main_get_default_monitor (),
source_tree->priv->monitor_file_renamed_id);
+ g_signal_handler_disconnect (gth_main_get_default_monitor (),
source_tree->priv->monitor_folder_changed_id);
+ g_signal_handler_disconnect (gth_main_get_default_monitor (),
source_tree->priv->monitor_file_renamed_id);
- if (source_tree->priv->file_source != NULL)
- g_object_unref (source_tree->priv->file_source);
- g_free (source_tree->priv);
- source_tree->priv = NULL;
- }
+ if (source_tree->priv->file_source != NULL)
+ g_object_unref (source_tree->priv->file_source);
G_OBJECT_CLASS (gth_source_tree_parent_class)->finalize (object);
}
diff --git a/gthumb/gth-statusbar.c b/gthumb/gth-statusbar.c
index 62f82253..d62b6f5f 100644
--- a/gthumb/gth-statusbar.c
+++ b/gthumb/gth-statusbar.c
@@ -36,7 +36,10 @@ struct _GthStatusbarPrivate {
};
-G_DEFINE_TYPE (GthStatusbar, gth_statusbar, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthStatusbar,
+ gth_statusbar,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthStatusbar))
static void
@@ -61,8 +64,6 @@ gth_statusbar_class_init (GthStatusbarClass *klass)
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthStatusbarPrivate));
-
object_class = (GObjectClass*) klass;
object_class->finalize = gth_statusbar_finalize;
}
@@ -71,7 +72,7 @@ gth_statusbar_class_init (GthStatusbarClass *klass)
static void
gth_statusbar_init (GthStatusbar *statusbar)
{
- statusbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (statusbar, GTH_TYPE_STATUSBAR, GthStatusbarPrivate);
+ statusbar->priv = gth_statusbar_get_instance_private (statusbar);
statusbar->priv->hide_secondary_text_id = 0;
gtk_box_set_spacing (GTK_BOX (statusbar), 6);
diff --git a/gthumb/gth-string-list.c b/gthumb/gth-string-list.c
index ab1cb8dc..c2bc70c9 100644
--- a/gthumb/gth-string-list.c
+++ b/gthumb/gth-string-list.c
@@ -29,7 +29,10 @@ struct _GthStringListPrivate {
};
-G_DEFINE_TYPE (GthStringList, gth_string_list, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthStringList,
+ gth_string_list,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthStringList))
static void
@@ -48,14 +51,13 @@ gth_string_list_finalize (GObject *obj)
static void
gth_string_list_class_init (GthStringListClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthStringListPrivate));
G_OBJECT_CLASS (klass)->finalize = gth_string_list_finalize;
}
static void
gth_string_list_init (GthStringList *self) {
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_STRING_LIST, GthStringListPrivate);
+ self->priv = gth_string_list_get_instance_private (self);
self->priv->list = NULL;
}
diff --git a/gthumb/gth-tags-entry.c b/gthumb/gth-tags-entry.c
index ec181cf4..b4636c46 100644
--- a/gthumb/gth-tags-entry.c
+++ b/gthumb/gth-tags-entry.c
@@ -109,7 +109,10 @@ struct _GthTagsEntryPrivate {
static guint signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthTagsEntry, gth_tags_entry, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthTagsEntry,
+ gth_tags_entry,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthTagsEntry))
static void
@@ -206,8 +209,6 @@ gth_tags_entry_class_init (GthTagsEntryClass *klass)
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (klass, sizeof (GthTagsEntryPrivate));
-
object_class = (GObjectClass*) (klass);
object_class->set_property = gth_tags_entry_set_property;
object_class->get_property = gth_tags_entry_get_property;
@@ -1118,7 +1119,7 @@ gth_tags_entry_init (GthTagsEntry *self)
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
gtk_box_set_spacing (GTK_BOX (self), 3);
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TAGS_ENTRY, GthTagsEntryPrivate);
+ self->priv = gth_tags_entry_get_instance_private (self);
self->priv->mode = GTH_TAGS_ENTRY_MODE_INLINE;
self->priv->expanded_list.last_used = g_new0 (char *, 1);
self->priv->expanded = FALSE;
diff --git a/gthumb/gth-task.c b/gthumb/gth-task.c
index 5fe2e66c..917330ec 100644
--- a/gthumb/gth-task.c
+++ b/gthumb/gth-task.c
@@ -41,8 +41,7 @@ enum {
LAST_SIGNAL
};
-struct _GthTaskPrivate
-{
+struct _GthTaskPrivate {
char *description;
gboolean running;
GCancellable *cancellable;
@@ -53,6 +52,13 @@ struct _GthTaskPrivate
static guint gth_task_signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE_WITH_CODE (GthTask,
+ gth_task,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthTask))
+
+
GQuark
gth_task_error_quark (void)
{
@@ -60,9 +66,6 @@ gth_task_error_quark (void)
}
-G_DEFINE_TYPE (GthTask, gth_task, G_TYPE_OBJECT)
-
-
static void
gth_task_finalize (GObject *object)
{
@@ -142,8 +145,6 @@ gth_task_class_init (GthTaskClass *class)
{
GObjectClass *object_class;
- g_type_class_add_private (class, sizeof (GthTaskPrivate));
-
object_class = (GObjectClass*) class;
object_class->set_property = gth_task_set_property;
object_class->get_property = gth_task_get_property;
@@ -206,7 +207,7 @@ gth_task_class_init (GthTaskClass *class)
static void
gth_task_init (GthTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TASK, GthTaskPrivate);
+ self->priv = gth_task_get_instance_private (self);
self->priv->running = FALSE;
self->priv->cancellable = NULL;
self->priv->cancellable_cancelled = 0;
diff --git a/gthumb/gth-test-aspect-ratio.c b/gthumb/gth-test-aspect-ratio.c
index 1bbba2e0..ef0c199b 100644
--- a/gthumb/gth-test-aspect-ratio.c
+++ b/gthumb/gth-test-aspect-ratio.c
@@ -72,8 +72,7 @@ GthOpData aspect_ratio_op_data[] = {
};
-struct _GthTestAspectRatioPrivate
-{
+struct _GthTestAspectRatioPrivate {
GthTestOp op;
gboolean negative;
double aspect_ratio;
@@ -96,26 +95,11 @@ static void gth_test_aspect_ratio_gth_duplicable_interface_init (GthDuplicableIn
G_DEFINE_TYPE_WITH_CODE (GthTestAspectRatio,
gth_test_aspect_ratio,
GTH_TYPE_TEST,
+ G_ADD_PRIVATE (GthTestAspectRatio)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_test_aspect_ratio_dom_domizable_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_test_aspect_ratio_gth_duplicable_interface_init))
-
-
-static void
-gth_test_aspect_ratio_finalize (GObject *object)
-{
- GthTestAspectRatio *test;
-
- test = GTH_TEST_ASPECT_RATIO (object);
-
- if (test->priv != NULL) {
- g_free (test->priv);
- test->priv = NULL;
- }
-
- G_OBJECT_CLASS (gth_test_aspect_ratio_parent_class)->finalize (object);
-}
+ gth_test_aspect_ratio_dom_domizable_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
+ gth_test_aspect_ratio_gth_duplicable_interface_init))
static void
@@ -426,12 +410,8 @@ gth_test_aspect_ratio_real_duplicate (GthDuplicable *duplicable)
static void
gth_test_aspect_ratio_class_init (GthTestAspectRatioClass *class)
{
- GObjectClass *object_class;
GthTestClass *test_class;
- object_class = (GObjectClass*) class;
- object_class->finalize = gth_test_aspect_ratio_finalize;
-
test_class = (GthTestClass *) class;
test_class->create_control = gth_test_aspect_ratio_real_create_control;
test_class->update_from_control = gth_test_aspect_ratio_real_update_from_control;
@@ -460,8 +440,13 @@ gth_test_aspect_ratio_gth_duplicable_interface_init (GthDuplicableInterface *ifa
static void
gth_test_aspect_ratio_init (GthTestAspectRatio *self)
{
- self->priv = g_new0 (GthTestAspectRatioPrivate, 1);
- self->priv->aspect_ratio = 1.0;
+ self->priv = gth_test_aspect_ratio_get_instance_private (self);
self->priv->op = GTH_TEST_OP_EQUAL;
self->priv->negative = FALSE;
+ self->priv->aspect_ratio = 1.0;
+ self->priv->custom_ratio_idx = 0;
+ self->priv->op_combo_box = NULL;
+ self->priv->ratio_combobox = NULL;
+ self->priv->ratio_spinbutton = NULL;
+ self->priv->custom_ratio_box = NULL;
}
diff --git a/gthumb/gth-test-category.c b/gthumb/gth-test-category.c
index 19b3fad9..288ba707 100644
--- a/gthumb/gth-test-category.c
+++ b/gthumb/gth-test-category.c
@@ -50,8 +50,7 @@ GthOpData category_op_data[] = {
};
-struct _GthTestCategoryPrivate
-{
+struct _GthTestCategoryPrivate {
char *category;
GthTestOp op;
gboolean negative;
@@ -75,10 +74,11 @@ static void gth_test_category_gth_duplicable_interface_init (GthDuplicableInterf
G_DEFINE_TYPE_WITH_CODE (GthTestCategory,
gth_test_category,
GTH_TYPE_TEST,
+ G_ADD_PRIVATE (GthTestCategory)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_test_category_dom_domizable_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_test_category_gth_duplicable_interface_init))
+ gth_test_category_dom_domizable_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
+ gth_test_category_gth_duplicable_interface_init))
static void
@@ -88,15 +88,11 @@ gth_test_category_finalize (GObject *object)
test = GTH_TEST_CATEGORY (object);
- if (test->priv != NULL) {
- if (test->priv->monitor_events != 0) {
- g_signal_handler_disconnect (gth_main_get_default_monitor (),
test->priv->monitor_events);
- test->priv->monitor_events = 0;
- }
- g_free (test->priv->category);
- g_free (test->priv);
- test->priv = NULL;
+ if (test->priv->monitor_events != 0) {
+ g_signal_handler_disconnect (gth_main_get_default_monitor (), test->priv->monitor_events);
+ test->priv->monitor_events = 0;
}
+ g_free (test->priv->category);
G_OBJECT_CLASS (gth_test_category_parent_class)->finalize (object);
}
@@ -497,7 +493,15 @@ gth_test_category_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_test_category_init (GthTestCategory *test)
{
- test->priv = g_new0 (GthTestCategoryPrivate, 1);
+ test->priv = gth_test_category_get_instance_private (test);
+ test->priv->category = NULL;
+ test->priv->op = GTH_TEST_OP_NONE;
+ test->priv->negative = FALSE;
+ test->priv->has_focus = FALSE;
+ test->priv->tag_store = NULL;
+ test->priv->combo_entry = NULL;
+ test->priv->text_entry = NULL;
+ test->priv->op_combo_box = NULL;
test->priv->monitor_events = 0;
}
diff --git a/gthumb/gth-test-chain.c b/gthumb/gth-test-chain.c
index 9ce6f54d..99130637 100644
--- a/gthumb/gth-test-chain.c
+++ b/gthumb/gth-test-chain.c
@@ -28,8 +28,7 @@
#include "gth-test-chain.h"
-struct _GthTestChainPrivate
-{
+struct _GthTestChainPrivate {
GthMatchType match_type;
GList *tests;
GString *attributes;
@@ -47,10 +46,11 @@ static void gth_test_chain_gth_duplicable_interface_init (GthDuplicableInterface
G_DEFINE_TYPE_WITH_CODE (GthTestChain,
gth_test_chain,
GTH_TYPE_TEST,
+ G_ADD_PRIVATE (GthTestChain)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_test_chain_dom_domizable_interface_init)
- G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_test_chain_gth_duplicable_interface_init))
+ gth_test_chain_dom_domizable_interface_init)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
+ gth_test_chain_gth_duplicable_interface_init))
static void
@@ -60,13 +60,9 @@ gth_test_chain_finalize (GObject *object)
test = GTH_TEST_CHAIN (object);
- if (test->priv != NULL) {
- _g_object_list_unref (test->priv->tests);
- if (test->priv->attributes != NULL)
- g_string_free (test->priv->attributes, TRUE);
- g_free (test->priv);
- test->priv = NULL;
- }
+ _g_object_list_unref (test->priv->tests);
+ if (test->priv->attributes != NULL)
+ g_string_free (test->priv->attributes, TRUE);
G_OBJECT_CLASS (gth_test_chain_parent_class)->finalize (object);
}
@@ -245,7 +241,10 @@ gth_test_chain_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_test_chain_init (GthTestChain *test)
{
- test->priv = g_new0 (GthTestChainPrivate, 1);
+ test->priv = gth_test_chain_get_instance_private (test);
+ test->priv->match_type = GTH_MATCH_TYPE_NONE;
+ test->priv->tests = NULL;
+ test->priv->attributes = NULL;
}
diff --git a/gthumb/gth-test-selector.c b/gthumb/gth-test-selector.c
index 04953d1a..96c9e5cc 100644
--- a/gthumb/gth-test-selector.c
+++ b/gthumb/gth-test-selector.c
@@ -55,7 +55,10 @@ struct _GthTestSelectorPrivate {
static guint gth_test_selector_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthTestSelector, gth_test_selector, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthTestSelector,
+ gth_test_selector,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthTestSelector))
static void
@@ -65,12 +68,8 @@ gth_test_selector_finalize (GObject *object)
selector = GTH_TEST_SELECTOR (object);
- if (selector->priv != NULL) {
- if (selector->priv->test != NULL)
- g_object_unref (selector->priv->test);
- g_free (selector->priv);
- selector->priv = NULL;
- }
+ if (selector->priv->test != NULL)
+ g_object_unref (selector->priv->test);
G_OBJECT_CLASS (gth_test_selector_parent_class)->finalize (object);
}
@@ -107,7 +106,14 @@ gth_test_selector_class_init (GthTestSelectorClass *klass)
static void
gth_test_selector_init (GthTestSelector *self)
{
- self->priv = g_new0 (GthTestSelectorPrivate, 1);
+ self->priv = gth_test_selector_get_instance_private (self);
+ self->priv->test = NULL;
+ self->priv->model = NULL;
+ self->priv->test_combo_box = NULL;
+ self->priv->control_box = NULL;
+ self->priv->control = NULL;
+ self->priv->add_button = NULL;
+ self->priv->remove_button = NULL;
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_HORIZONTAL);
}
diff --git a/gthumb/gth-test-simple.c b/gthumb/gth-test-simple.c
index 08bff451..194b0f60 100644
--- a/gthumb/gth-test-simple.c
+++ b/gthumb/gth-test-simple.c
@@ -96,8 +96,7 @@ enum {
};
-struct _GthTestSimplePrivate
-{
+struct _GthTestSimplePrivate {
GthTestDataType data_type;
union {
char *s;
@@ -133,10 +132,11 @@ static void gth_test_simple_gth_duplicable_interface_init (GthDuplicableInterfac
G_DEFINE_TYPE_WITH_CODE (GthTestSimple,
gth_test_simple,
GTH_TYPE_TEST,
+ G_ADD_PRIVATE (GthTestSimple)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
- gth_test_simple_dom_domizable_interface_init)
+ gth_test_simple_dom_domizable_interface_init)
G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_test_simple_gth_duplicable_interface_init))
+ gth_test_simple_gth_duplicable_interface_init))
static void
@@ -172,13 +172,9 @@ gth_test_simple_finalize (GObject *object)
test = GTH_TEST_SIMPLE (object);
- if (test->priv != NULL) {
- _gth_test_simple_free_data (test);
- if (test->priv->pattern != NULL)
- g_pattern_spec_free (test->priv->pattern);
- g_free (test->priv);
- test->priv = NULL;
- }
+ _gth_test_simple_free_data (test);
+ if (test->priv->pattern != NULL)
+ g_pattern_spec_free (test->priv->pattern);
G_OBJECT_CLASS (gth_test_simple_parent_class)->finalize (object);
}
@@ -1442,8 +1438,22 @@ gth_test_simple_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_test_simple_init (GthTestSimple *test)
{
- test->priv = g_new0 (GthTestSimplePrivate, 1);
+ test->priv = gth_test_simple_get_instance_private (test);
test->priv->data_type = GTH_TEST_DATA_TYPE_NONE;
+ test->priv->get_data = NULL;
+ test->priv->op = GTH_TEST_OP_NONE;
+ test->priv->negative = FALSE;
+ test->priv->max_int = 0;
+ test->priv->max_double = 0;
+ test->priv->pattern = NULL;
+ test->priv->has_focus = FALSE;
+ test->priv->text_entry = NULL;
+ test->priv->text_op_combo_box = NULL;
+ test->priv->size_op_combo_box = NULL;
+ test->priv->date_op_combo_box = NULL;
+ test->priv->size_combo_box = NULL;
+ test->priv->time_selector = NULL;
+ test->priv->spinbutton = NULL;
}
diff --git a/gthumb/gth-test.c b/gthumb/gth-test.c
index 2900eab6..f7568b2b 100644
--- a/gthumb/gth-test.c
+++ b/gthumb/gth-test.c
@@ -56,6 +56,17 @@ static GthDuplicableInterface *gth_duplicable_parent_iface = NULL;
static guint gth_test_signals[LAST_SIGNAL] = { 0 };
+static void gth_test_gth_duplicable_interface_init (GthDuplicableInterface *iface);
+
+
+G_DEFINE_TYPE_WITH_CODE (GthTest,
+ gth_test,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthTest)
+ G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
+ gth_test_gth_duplicable_interface_init))
+
+
GQuark
gth_test_error_quark (void)
{
@@ -63,16 +74,6 @@ gth_test_error_quark (void)
}
-static void gth_test_gth_duplicable_interface_init (GthDuplicableInterface *iface);
-
-
-G_DEFINE_TYPE_WITH_CODE (GthTest,
- gth_test,
- G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
- gth_test_gth_duplicable_interface_init))
-
-
static void
gth_test_finalize (GObject *object)
{
@@ -267,8 +268,6 @@ gth_test_class_init (GthTestClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (GthTestPrivate));
-
object_class = (GObjectClass*) klass;
object_class->set_property = gth_test_set_property;
object_class->get_property = gth_test_get_property;
@@ -338,7 +337,7 @@ gth_test_gth_duplicable_interface_init (GthDuplicableInterface *iface)
static void
gth_test_init (GthTest *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TEST, GthTestPrivate);
+ self->priv = gth_test_get_instance_private (self);
self->priv->id = g_strdup ("");
self->priv->attributes = g_strdup ("");
self->priv->display_name = g_strdup ("");
diff --git a/gthumb/gth-thumb-loader.c b/gthumb/gth-thumb-loader.c
index 3938c5d1..6fc60353 100644
--- a/gthumb/gth-thumb-loader.c
+++ b/gthumb/gth-thumb-loader.c
@@ -50,8 +50,14 @@
#define MAX_THUMBNAILER_LIFETIME 4000 /* kill the thumbnailer after this amount of time*/
#define CHECK_CANCELLABLE_DELAY 200
-struct _GthThumbLoaderPrivate
-{
+
+enum {
+ READY,
+ LAST_SIGNAL
+};
+
+
+struct _GthThumbLoaderPrivate {
GthImageLoader *iloader;
GthImageLoader *tloader;
guint use_cache : 1;
@@ -69,13 +75,10 @@ struct _GthThumbLoaderPrivate
};
-enum {
- READY,
- LAST_SIGNAL
-};
-
-
-G_DEFINE_TYPE (GthThumbLoader, gth_thumb_loader, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GthThumbLoader,
+ gth_thumb_loader,
+ G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GthThumbLoader))
static void
@@ -96,8 +99,6 @@ gth_thumb_loader_class_init (GthThumbLoaderClass *class)
{
GObjectClass *object_class;
- g_type_class_add_private (class, sizeof (GthThumbLoaderPrivate));
-
object_class = G_OBJECT_CLASS (class);
object_class->finalize = gth_thumb_loader_finalize;
}
@@ -106,10 +107,16 @@ gth_thumb_loader_class_init (GthThumbLoaderClass *class)
static void
gth_thumb_loader_init (GthThumbLoader *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_THUMB_LOADER, GthThumbLoaderPrivate);
+ self->priv = gth_thumb_loader_get_instance_private (self);
+ self->priv->iloader = NULL;
+ self->priv->tloader = NULL;
self->priv->use_cache = TRUE;
self->priv->save_thumbnails = TRUE;
+ self->priv->requested_size = 0;
+ self->priv->cache_max_size = 0;
self->priv->max_file_size = 0;
+ self->priv->thumb_size = GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL;
+ self->priv->thumb_factory = NULL;
}
diff --git a/gthumb/gth-time-selector.c b/gthumb/gth-time-selector.c
index 4788eaf0..4802248d 100644
--- a/gthumb/gth-time-selector.c
+++ b/gthumb/gth-time-selector.c
@@ -37,8 +37,7 @@ enum {
};
-struct _GthTimeSelectorPrivate
-{
+struct _GthTimeSelectorPrivate {
GthDateTime *date_time;
GtkWidget *date_entry;
GtkWidget *calendar_button;
@@ -59,7 +58,10 @@ struct _GthTimeSelectorPrivate
static guint gth_time_selector_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthTimeSelector, gth_time_selector, GTK_TYPE_BOX);
+G_DEFINE_TYPE_WITH_CODE (GthTimeSelector,
+ gth_time_selector,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthTimeSelector));
static void
@@ -109,8 +111,6 @@ gth_time_selector_class_init (GthTimeSelectorClass *class)
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (class, sizeof (GthTimeSelectorPrivate));
-
object_class = (GObjectClass*) class;
object_class->finalize = gth_time_selector_finalize;
@@ -164,7 +164,7 @@ _gth_time_selector_grab_broken_event (GtkWidget *widget,
static void
gth_time_selector_init (GthTimeSelector *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TIME_SELECTOR, GthTimeSelectorPrivate);
+ self->priv = gth_time_selector_get_instance_private (self);
self->priv->date_time = gth_datetime_new ();
self->priv->use_time = TRUE;
self->priv->grab_pointer = NULL;
diff --git a/gthumb/gth-toolbox.c b/gthumb/gth-toolbox.c
index d548ea8b..a37b7066 100644
--- a/gthumb/gth-toolbox.c
+++ b/gthumb/gth-toolbox.c
@@ -56,7 +56,11 @@ struct _GthToolboxPrivate {
static guint gth_toolbox_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthToolbox, gth_toolbox, GTK_TYPE_STACK)
+
+G_DEFINE_TYPE_WITH_CODE (GthToolbox,
+ gth_toolbox,
+ GTK_TYPE_STACK,
+ G_ADD_PRIVATE (GthToolbox))
static void
@@ -110,8 +114,6 @@ gth_toolbox_class_init (GthToolboxClass *klass)
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (GthToolboxPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->finalize = gth_toolbox_finalize;
gobject_class->set_property = gth_toolbox_set_property;
@@ -177,7 +179,7 @@ gth_toolbox_init (GthToolbox *toolbox)
GtkWidget *close_button;
GtkWidget *ok_button;
- toolbox->priv = G_TYPE_INSTANCE_GET_PRIVATE (toolbox, GTH_TYPE_TOOLBOX, GthToolboxPrivate);
+ toolbox->priv = gth_toolbox_get_instance_private (toolbox);
/* tool list page */
diff --git a/gthumb/gth-trash-task.c b/gthumb/gth-trash-task.c
index 19edfc17..79421ee3 100644
--- a/gthumb/gth-trash-task.c
+++ b/gthumb/gth-trash-task.c
@@ -30,7 +30,10 @@ struct _GthTrashTaskPrivate {
};
-G_DEFINE_TYPE (GthTrashTask, gth_trash_task, GTH_TYPE_TASK)
+G_DEFINE_TYPE_WITH_CODE (GthTrashTask,
+ gth_trash_task,
+ GTH_TYPE_TASK,
+ G_ADD_PRIVATE (GthTrashTask))
static void
@@ -76,8 +79,6 @@ gth_trash_task_class_init (GthTrashTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
- g_type_class_add_private (klass, sizeof (GthTrashTaskPrivate));
-
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_trash_task_finalize;
@@ -89,7 +90,7 @@ gth_trash_task_class_init (GthTrashTaskClass *klass)
static void
gth_trash_task_init (GthTrashTask *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TRASH_TASK, GthTrashTaskPrivate);
+ self->priv = gth_trash_task_get_instance_private (self);
}
diff --git a/gthumb/gth-uri-list.c b/gthumb/gth-uri-list.c
index d86b87f2..1fb3977e 100644
--- a/gthumb/gth-uri-list.c
+++ b/gthumb/gth-uri-list.c
@@ -54,7 +54,10 @@ struct _GthUriListPrivate {
static guint uri_list_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GthUriList, gth_uri_list, GTK_TYPE_TREE_VIEW)
+G_DEFINE_TYPE_WITH_CODE (GthUriList,
+ gth_uri_list,
+ GTK_TYPE_TREE_VIEW,
+ G_ADD_PRIVATE (GthUriList))
static void
@@ -133,7 +136,7 @@ row_inserted_cb (GtkTreeModel *tree_model,
static void
gth_uri_list_init (GthUriList *uri_list)
{
- uri_list->priv = g_new0 (GthUriListPrivate, 1);
+ uri_list->priv = gth_uri_list_get_instance_private (uri_list);
uri_list->priv->list_store = gtk_list_store_new (URI_LIST_NUM_COLUMNS,
GDK_TYPE_PIXBUF,
@@ -162,29 +165,9 @@ gth_uri_list_init (GthUriList *uri_list)
}
-static void
-gth_uri_list_finalize (GObject *object)
-{
- GthUriList *uri_list = GTH_URI_LIST (object);
-
- if (uri_list->priv != NULL) {
- g_free (uri_list->priv);
- uri_list->priv = NULL;
- }
-
- G_OBJECT_CLASS (gth_uri_list_parent_class)->finalize (object);
-}
-
-
static void
gth_uri_list_class_init (GthUriListClass *klass)
{
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
-
- gobject_class->finalize = gth_uri_list_finalize;
-
uri_list_signals[ORDER_CHANGED] =
g_signal_new ("order-changed",
G_TYPE_FROM_CLASS (klass),
diff --git a/gthumb/gth-window-title.c b/gthumb/gth-window-title.c
index 7ebcd252..7ba39a7e 100644
--- a/gthumb/gth-window-title.c
+++ b/gthumb/gth-window-title.c
@@ -34,22 +34,23 @@ struct _GthWindowTitlePrivate {
};
-G_DEFINE_TYPE (GthWindowTitle,
- gth_window_title,
- GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (GthWindowTitle,
+ gth_window_title,
+ GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GthWindowTitle))
static void
gth_window_title_class_init (GthWindowTitleClass *klass)
{
- g_type_class_add_private (klass, sizeof (GthWindowTitlePrivate));
+ /* void */
}
static void
gth_window_title_init (GthWindowTitle *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_WINDOW_TITLE, GthWindowTitlePrivate);
+ self->priv = gth_window_title_get_instance_private (self);
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_HORIZONTAL);
gtk_box_set_spacing (GTK_BOX (self), 10);
diff --git a/gthumb/gth-window.c b/gthumb/gth-window.c
index 3b86ee1c..5cba0c47 100644
--- a/gthumb/gth-window.c
+++ b/gthumb/gth-window.c
@@ -27,9 +27,6 @@
#include "main.h"
-G_DEFINE_TYPE (GthWindow, gth_window, GTK_TYPE_APPLICATION_WINDOW)
-
-
enum {
PROP_0,
PROP_N_PAGES,
@@ -60,6 +57,12 @@ struct _GthWindowPrivate {
};
+G_DEFINE_TYPE_WITH_CODE (GthWindow,
+ gth_window,
+ GTK_TYPE_APPLICATION_WINDOW,
+ G_ADD_PRIVATE (GthWindow))
+
+
static gboolean
overlay_get_child_position_cb (GtkOverlay *overlay,
GtkWidget *widget,
@@ -343,8 +346,6 @@ gth_window_class_init (GthWindowClass *klass)
GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
- g_type_class_add_private (klass, sizeof (GthWindowPrivate));
-
gobject_class = (GObjectClass*) klass;
gobject_class->set_property = gth_window_set_property;
gobject_class->get_property = gth_window_get_property;
@@ -379,7 +380,7 @@ gth_window_class_init (GthWindowClass *klass)
static void
gth_window_init (GthWindow *window)
{
- window->priv = G_TYPE_INSTANCE_GET_PRIVATE (window, GTH_TYPE_WINDOW, GthWindowPrivate);
+ window->priv = gth_window_get_instance_private (window);
window->priv->grid = NULL;
window->priv->contents = NULL;
window->priv->pages = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]