[gedit] The King is Dead (for gedit core)
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] The King is Dead (for gedit core)
- Date: Sun, 28 Jul 2013 14:52:45 +0000 (UTC)
commit 0ff8439aaa698a7c7b9495c8d8b0523e92e57d9b
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jul 28 16:10:22 2013 +0200
The King is Dead (for gedit core)
http://blogs.gnome.org/ebassi/2013/06/21/the-king-is-dead/
gedit/gedit-app-x11.c | 10 ----------
gedit/gedit-app.c | 8 ++------
gedit/gedit-close-confirmation-dialog.c | 10 ++--------
gedit/gedit-document-input-stream.c | 11 +++--------
gedit/gedit-document-loader.c | 11 ++---------
gedit/gedit-document-output-stream.c | 10 ++--------
gedit/gedit-document-saver.c | 10 ++--------
gedit/gedit-document.c | 8 ++------
gedit/gedit-documents-panel.c | 10 ++--------
gedit/gedit-encodings-combo-box.c | 10 ++--------
gedit/gedit-encodings-dialog.c | 10 ++--------
gedit/gedit-file-chooser-dialog.c | 8 ++------
gedit/gedit-highlight-mode-dialog.c | 16 ++--------------
gedit/gedit-history-entry.c | 10 ++--------
gedit/gedit-message-bus.c | 8 ++------
gedit/gedit-message.c | 7 ++-----
gedit/gedit-multi-notebook.c | 10 ++--------
gedit/gedit-notebook-popup-menu.c | 8 ++------
gedit/gedit-notebook.c | 8 ++------
gedit/gedit-open-tool-button.c | 9 ++-------
gedit/gedit-panel.c | 8 ++------
gedit/gedit-plugins-engine.c | 10 +++-------
gedit/gedit-preferences-dialog.c | 13 ++-----------
gedit/gedit-print-job.c | 11 ++---------
gedit/gedit-print-preview.c | 9 ++-------
gedit/gedit-progress-info-bar.c | 11 ++---------
gedit/gedit-replace-dialog.c | 7 ++-----
gedit/gedit-settings.c | 8 ++------
gedit/gedit-statusbar.c | 10 ++--------
gedit/gedit-tab-label.c | 8 ++------
gedit/gedit-tab.c | 8 ++------
gedit/gedit-view.c | 8 ++------
gedit/gedit-window.c | 10 ++--------
33 files changed, 66 insertions(+), 247 deletions(-)
---
diff --git a/gedit/gedit-app-x11.c b/gedit/gedit-app-x11.c
index 6ee415c..ee57507 100644
--- a/gedit/gedit-app-x11.c
+++ b/gedit/gedit-app-x11.c
@@ -26,16 +26,8 @@
#include <gdk/gdkx.h>
#endif
-#define GEDIT_APP_X11_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_APP_X11,
GeditAppX11Private))
-
G_DEFINE_TYPE (GeditAppX11, gedit_app_x11, GEDIT_TYPE_APP)
-static void
-gedit_app_x11_finalize (GObject *object)
-{
- G_OBJECT_CLASS (gedit_app_x11_parent_class)->finalize (object);
-}
-
/* This should go in GtkApplication at some point... */
#include <X11/Xatom.h>
@@ -100,10 +92,8 @@ gedit_app_add_platform_data (GApplication *app,
static void
gedit_app_x11_class_init (GeditAppX11Class *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
GApplicationClass *app_class = G_APPLICATION_CLASS (klass);
- object_class->finalize = gedit_app_x11_finalize;
app_class->add_platform_data = gedit_app_add_platform_data;
}
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 6aea16e..29553cf 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -66,8 +66,6 @@
#define GEDIT_PAGE_SETUP_FILE "gedit-page-setup"
#define GEDIT_PRINT_SETTINGS_FILE "gedit-print-settings"
-#define GEDIT_APP_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_APP,
GeditAppPrivate))
-
/* Properties */
enum
{
@@ -187,7 +185,7 @@ static const GOptionEntry options[] =
{NULL}
};
-G_DEFINE_ABSTRACT_TYPE(GeditApp, gedit_app, GTK_TYPE_APPLICATION)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GeditApp, gedit_app, GTK_TYPE_APPLICATION)
static void
gedit_app_dispose (GObject *object)
@@ -1175,8 +1173,6 @@ gedit_app_class_init (GeditAppClass *klass)
0,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditAppPrivate));
}
static void
@@ -1244,7 +1240,7 @@ load_print_settings (GeditApp *app)
static void
gedit_app_init (GeditApp *app)
{
- app->priv = GEDIT_APP_GET_PRIVATE (app);
+ app->priv = gedit_app_get_instance_private (app);
}
/* Generates a unique string for a window role */
diff --git a/gedit/gedit-close-confirmation-dialog.c b/gedit/gedit-close-confirmation-dialog.c
index 8a32b9c..cd3b2bd 100644
--- a/gedit/gedit-close-confirmation-dialog.c
+++ b/gedit/gedit-close-confirmation-dialog.c
@@ -70,15 +70,11 @@ struct _GeditCloseConfirmationDialogPrivate
gboolean disable_save_to_disk;
};
-#define GEDIT_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
- GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG, \
- GeditCloseConfirmationDialogPrivate))
-
#define GET_MODE(priv) (((priv->unsaved_documents != NULL) && \
(priv->unsaved_documents->next == NULL)) ? \
SINGLE_DOC_MODE : MULTIPLE_DOCS_MODE)
-G_DEFINE_TYPE(GeditCloseConfirmationDialog, gedit_close_confirmation_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditCloseConfirmationDialog, gedit_close_confirmation_dialog, GTK_TYPE_DIALOG)
static void set_unsaved_document (GeditCloseConfirmationDialog *dlg,
const GList *list);
@@ -129,7 +125,7 @@ gedit_close_confirmation_dialog_init (GeditCloseConfirmationDialog *dlg)
GeditLockdownMask lockdown;
AtkObject *atk_obj;
- dlg->priv = GEDIT_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE (dlg);
+ dlg->priv = gedit_close_confirmation_dialog_get_instance_private (dlg);
lockdown = gedit_app_get_lockdown (GEDIT_APP (g_application_get_default ()));
@@ -226,8 +222,6 @@ gedit_close_confirmation_dialog_class_init (GeditCloseConfirmationDialogClass *k
gobject_class->get_property = gedit_close_confirmation_dialog_get_property;
gobject_class->finalize = gedit_close_confirmation_dialog_finalize;
- g_type_class_add_private (klass, sizeof (GeditCloseConfirmationDialogPrivate));
-
g_object_class_install_property (gobject_class,
PROP_UNSAVED_DOCUMENTS,
g_param_spec_pointer ("unsaved_documents",
diff --git a/gedit/gedit-document-input-stream.c b/gedit/gedit-document-input-stream.c
index b4d53c2..e54ab50 100644
--- a/gedit/gedit-document-input-stream.c
+++ b/gedit/gedit-document-input-stream.c
@@ -34,9 +34,6 @@
* there is no I/O involved and should be accessed only by the main
* thread */
-
-G_DEFINE_TYPE (GeditDocumentInputStream, gedit_document_input_stream, G_TYPE_INPUT_STREAM);
-
struct _GeditDocumentInputStreamPrivate
{
GtkTextBuffer *buffer;
@@ -58,6 +55,8 @@ enum
PROP_ENSURE_TRAILING_NEWLINE
};
+G_DEFINE_TYPE_WITH_PRIVATE (GeditDocumentInputStream, gedit_document_input_stream, G_TYPE_INPUT_STREAM);
+
static gssize gedit_document_input_stream_read (GInputStream *stream,
void *buffer,
gsize count,
@@ -129,8 +128,6 @@ gedit_document_input_stream_class_init (GeditDocumentInputStreamClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GeditDocumentInputStreamPrivate));
-
gobject_class->get_property = gedit_document_input_stream_get_property;
gobject_class->set_property = gedit_document_input_stream_set_property;
@@ -185,9 +182,7 @@ gedit_document_input_stream_class_init (GeditDocumentInputStreamClass *klass)
static void
gedit_document_input_stream_init (GeditDocumentInputStream *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
- GEDIT_TYPE_DOCUMENT_INPUT_STREAM,
- GeditDocumentInputStreamPrivate);
+ stream->priv = gedit_document_input_stream_get_instance_private (stream);
}
static gsize
diff --git a/gedit/gedit-document-loader.c b/gedit/gedit-document-loader.c
index 008fc3b..e4b8674 100644
--- a/gedit/gedit-document-loader.c
+++ b/gedit/gedit-document-loader.c
@@ -89,11 +89,6 @@ enum
G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "," \
GEDIT_METADATA_ATTRIBUTE_ENCODING
-#define GEDIT_DOCUMENT_LOADER_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_DOCUMENT_LOADER, \
- GeditDocumentLoaderPrivate))
-
static void open_async_read (AsyncData *async);
struct _GeditDocumentLoaderPrivate
@@ -124,7 +119,7 @@ struct _GeditDocumentLoaderPrivate
gboolean guess_content_type_from_content;
};
-G_DEFINE_TYPE(GeditDocumentLoader, gedit_document_loader, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditDocumentLoader, gedit_document_loader, G_TYPE_OBJECT)
static void
gedit_document_loader_set_property (GObject *object,
@@ -303,14 +298,12 @@ gedit_document_loader_class_init (GeditDocumentLoaderClass *klass)
2,
G_TYPE_BOOLEAN,
G_TYPE_POINTER);
-
- g_type_class_add_private (object_class, sizeof (GeditDocumentLoaderPrivate));
}
static void
gedit_document_loader_init (GeditDocumentLoader *loader)
{
- loader->priv = GEDIT_DOCUMENT_LOADER_GET_PRIVATE (loader);
+ loader->priv = gedit_document_loader_get_instance_private (loader);
loader->priv->enc_settings = g_settings_new ("org.gnome.gedit.preferences.encodings");
loader->priv->editor_settings = g_settings_new ("org.gnome.gedit.preferences.editor");
diff --git a/gedit/gedit-document-output-stream.c b/gedit/gedit-document-output-stream.c
index 4043945..dd5a95d 100644
--- a/gedit/gedit-document-output-stream.c
+++ b/gedit/gedit-document-output-stream.c
@@ -43,10 +43,6 @@
* in other to be able to mark characters as invalid if there was some
* specific problem on the conversion */
-#define GEDIT_DOCUMENT_OUTPUT_STREAM_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),\
- GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM,\
- GeditDocumentOutputStreamPrivate))
-
#define MAX_UNICHAR_LEN 6
struct _GeditDocumentOutputStreamPrivate
@@ -86,7 +82,7 @@ enum
PROP_ENSURE_TRAILING_NEWLINE
};
-G_DEFINE_TYPE (GeditDocumentOutputStream, gedit_document_output_stream, G_TYPE_OUTPUT_STREAM)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditDocumentOutputStream, gedit_document_output_stream, G_TYPE_OUTPUT_STREAM)
static gssize gedit_document_output_stream_write (GOutputStream *stream,
const void *buffer,
@@ -237,14 +233,12 @@ gedit_document_output_stream_class_init (GeditDocumentOutputStreamClass *klass)
G_PARAM_STATIC_NAME |
G_PARAM_STATIC_BLURB |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (GeditDocumentOutputStreamPrivate));
}
static void
gedit_document_output_stream_init (GeditDocumentOutputStream *stream)
{
- stream->priv = GEDIT_DOCUMENT_OUTPUT_STREAM_GET_PRIVATE (stream);
+ stream->priv = gedit_document_output_stream_get_instance_private (stream);
stream->priv->buffer = NULL;
stream->priv->buflen = 0;
diff --git a/gedit/gedit-document-saver.c b/gedit/gedit-document-saver.c
index 9f203dd..1cffdc4 100644
--- a/gedit/gedit-document-saver.c
+++ b/gedit/gedit-document-saver.c
@@ -82,10 +82,6 @@ typedef struct
#define REMOTE_QUERY_ATTRIBUTES G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," \
G_FILE_ATTRIBUTE_TIME_MODIFIED
-#define GEDIT_DOCUMENT_SAVER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_DOCUMENT_SAVER, \
- GeditDocumentSaverPrivate))
-
static void check_modified_async (AsyncData *async);
struct _GeditDocumentSaverPrivate
@@ -117,7 +113,7 @@ struct _GeditDocumentSaverPrivate
GError *error;
};
-G_DEFINE_TYPE(GeditDocumentSaver, gedit_document_saver, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditDocumentSaver, gedit_document_saver, G_TYPE_OBJECT)
static void
gedit_document_saver_set_property (GObject *object,
@@ -328,14 +324,12 @@ gedit_document_saver_class_init (GeditDocumentSaverClass *klass)
2,
G_TYPE_BOOLEAN,
G_TYPE_POINTER);
-
- g_type_class_add_private (object_class, sizeof (GeditDocumentSaverPrivate));
}
static void
gedit_document_saver_init (GeditDocumentSaver *saver)
{
- saver->priv = GEDIT_DOCUMENT_SAVER_GET_PRIVATE (saver);
+ saver->priv = gedit_document_saver_get_instance_private (saver);
saver->priv->cancellable = g_cancellable_new ();
saver->priv->error = NULL;
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 8499b92..7527cb2 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -73,8 +73,6 @@ PROFILE (static GTimer *timer = NULL)
#define GEDIT_MAX_PATH_LEN 2048
#endif
-#define GEDIT_DOCUMENT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_DOCUMENT,
GeditDocumentPrivate))
-
static void gedit_document_load_real (GeditDocument *doc,
GFile *location,
const GeditEncoding *encoding,
@@ -167,7 +165,7 @@ enum {
static guint document_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE(GeditDocument, gedit_document, GTK_SOURCE_TYPE_BUFFER)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditDocument, gedit_document, GTK_SOURCE_TYPE_BUFFER)
GQuark
gedit_document_error_quark (void)
@@ -727,8 +725,6 @@ gedit_document_class_init (GeditDocumentClass *klass)
2,
GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE,
GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- g_type_class_add_private (object_class, sizeof (GeditDocumentPrivate));
}
static void
@@ -969,7 +965,7 @@ gedit_document_init (GeditDocument *doc)
gedit_debug (DEBUG_DOCUMENT);
- doc->priv = GEDIT_DOCUMENT_GET_PRIVATE (doc);
+ doc->priv = gedit_document_get_instance_private (doc);
priv = doc->priv;
priv->editor_settings = g_settings_new ("org.gnome.gedit.preferences.editor");
diff --git a/gedit/gedit-documents-panel.c b/gedit/gedit-documents-panel.c
index 30a49f5..85c58f3 100644
--- a/gedit/gedit-documents-panel.c
+++ b/gedit/gedit-documents-panel.c
@@ -42,10 +42,6 @@
#include <glib/gi18n.h>
-#define GEDIT_DOCUMENTS_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_DOCUMENTS_PANEL, \
- GeditDocumentsPanelPrivate))
-
struct _GeditDocumentsPanelPrivate
{
GeditWindow *window;
@@ -62,7 +58,7 @@ struct _GeditDocumentsPanelPrivate
guint setting_active_notebook : 1;
};
-G_DEFINE_TYPE(GeditDocumentsPanel, gedit_documents_panel, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditDocumentsPanel, gedit_documents_panel, GTK_TYPE_BOX)
enum
{
@@ -731,8 +727,6 @@ gedit_documents_panel_class_init (GeditDocumentsPanelClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditDocumentsPanelPrivate));
}
static GtkTreePath *
@@ -1097,7 +1091,7 @@ gedit_documents_panel_init (GeditDocumentsPanel *panel)
gedit_debug (DEBUG_PANEL);
- panel->priv = GEDIT_DOCUMENTS_PANEL_GET_PRIVATE (panel);
+ panel->priv = gedit_documents_panel_get_instance_private (panel);
panel->priv->adding_tab = FALSE;
panel->priv->is_reodering = FALSE;
diff --git a/gedit/gedit-encodings-combo-box.c b/gedit/gedit-encodings-combo-box.c
index ea5cfe1..cfab000 100644
--- a/gedit/gedit-encodings-combo-box.c
+++ b/gedit/gedit-encodings-combo-box.c
@@ -43,10 +43,6 @@
#define ENCODING_KEY "Enconding"
-#define GEDIT_ENCODINGS_COMBO_BOX_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_ENCODINGS_COMBO_BOX, \
- GeditEncodingsComboBoxPrivate))
-
struct _GeditEncodingsComboBoxPrivate
{
GSettings *enc_settings;
@@ -75,7 +71,7 @@ enum
};
-G_DEFINE_TYPE(GeditEncodingsComboBox, gedit_encodings_combo_box, GTK_TYPE_COMBO_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditEncodingsComboBox, gedit_encodings_combo_box, GTK_TYPE_COMBO_BOX)
static void update_menu (GeditEncodingsComboBox *combo_box);
@@ -173,8 +169,6 @@ gedit_encodings_combo_box_class_init (GeditEncodingsComboBoxClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditEncodingsComboBoxPrivate));
}
static void
@@ -399,7 +393,7 @@ update_menu (GeditEncodingsComboBox *menu)
static void
gedit_encodings_combo_box_init (GeditEncodingsComboBox *menu)
{
- menu->priv = GEDIT_ENCODINGS_COMBO_BOX_GET_PRIVATE (menu);
+ menu->priv = gedit_encodings_combo_box_get_instance_private (menu);
menu->priv->enc_settings = g_settings_new ("org.gnome.gedit.preferences.encodings");
diff --git a/gedit/gedit-encodings-dialog.c b/gedit/gedit-encodings-dialog.c
index 7bc90e1..38e2db7 100644
--- a/gedit/gedit-encodings-dialog.c
+++ b/gedit/gedit-encodings-dialog.c
@@ -45,10 +45,6 @@
#include "gedit-dirs.h"
#include "gedit-settings.h"
-#define GEDIT_ENCODINGS_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_ENCODINGS_DIALOG, \
- GeditEncodingsDialogPrivate))
-
struct _GeditEncodingsDialogPrivate
{
GSettings *enc_settings;
@@ -65,7 +61,7 @@ struct _GeditEncodingsDialogPrivate
GSList *show_in_menu_list;
};
-G_DEFINE_TYPE(GeditEncodingsDialog, gedit_encodings_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditEncodingsDialog, gedit_encodings_dialog, GTK_TYPE_DIALOG)
static void
gedit_encodings_dialog_finalize (GObject *object)
@@ -141,8 +137,6 @@ gedit_encodings_dialog_class_init (GeditEncodingsDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditEncodingsDialog, displayed_treeview);
gtk_widget_class_bind_template_child_private (widget_class, GeditEncodingsDialog,
displayed_liststore);
gtk_widget_class_bind_template_child_private (widget_class, GeditEncodingsDialog, sort_displayed);
-
- g_type_class_add_private (object_class, sizeof (GeditEncodingsDialogPrivate));
}
enum {
@@ -340,7 +334,7 @@ gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
const GeditEncoding *enc;
int i;
- dlg->priv = GEDIT_ENCODINGS_DIALOG_GET_PRIVATE (dlg);
+ dlg->priv = gedit_encodings_dialog_get_instance_private (dlg);
dlg->priv->enc_settings = g_settings_new ("org.gnome.gedit.preferences.encodings");
diff --git a/gedit/gedit-file-chooser-dialog.c b/gedit/gedit-file-chooser-dialog.c
index c21736f..3273c51 100644
--- a/gedit/gedit-file-chooser-dialog.c
+++ b/gedit/gedit-file-chooser-dialog.c
@@ -47,8 +47,6 @@
#include "gedit-enum-types.h"
#include "gedit-settings.h"
-#define GEDIT_FILE_CHOOSER_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),
GEDIT_TYPE_FILE_CHOOSER_DIALOG, GeditFileChooserDialogPrivate))
-
#define ALL_FILES _("All Files")
#define ALL_TEXT_FILES _("All Text Files")
@@ -64,7 +62,7 @@ struct _GeditFileChooserDialogPrivate
GtkListStore *newline_store;
};
-G_DEFINE_TYPE(GeditFileChooserDialog, gedit_file_chooser_dialog, GTK_TYPE_FILE_CHOOSER_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditFileChooserDialog, gedit_file_chooser_dialog, GTK_TYPE_FILE_CHOOSER_DIALOG)
static void
gedit_file_chooser_dialog_dispose (GObject *object)
@@ -82,8 +80,6 @@ gedit_file_chooser_dialog_class_init (GeditFileChooserDialogClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gedit_file_chooser_dialog_dispose;
-
- g_type_class_add_private (object_class, sizeof (GeditFileChooserDialogPrivate));
}
static void
@@ -358,7 +354,7 @@ all_text_files_filter (const GtkFileFilterInfo *filter_info,
static void
gedit_file_chooser_dialog_init (GeditFileChooserDialog *dialog)
{
- dialog->priv = GEDIT_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
+ dialog->priv = gedit_file_chooser_dialog_get_instance_private (dialog);
dialog->priv->filter_settings = g_settings_new ("org.gnome.gedit.state.file-filter");
}
diff --git a/gedit/gedit-highlight-mode-dialog.c b/gedit/gedit-highlight-mode-dialog.c
index 919a46b..d0bd533 100644
--- a/gedit/gedit-highlight-mode-dialog.c
+++ b/gedit/gedit-highlight-mode-dialog.c
@@ -50,13 +50,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GeditHighlightModeDialog, gedit_highlight_mode_dialog, GTK_TYPE_DIALOG)
-
-static void
-gedit_highlight_mode_dialog_finalize (GObject *object)
-{
- G_OBJECT_CLASS (gedit_highlight_mode_dialog_parent_class)->finalize (object);
-}
+G_DEFINE_TYPE_WITH_PRIVATE (GeditHighlightModeDialog, gedit_highlight_mode_dialog, GTK_TYPE_DIALOG)
static void
gedit_highlight_mode_dialog_response (GtkDialog *dialog,
@@ -94,8 +88,6 @@ gedit_highlight_mode_dialog_class_init (GeditHighlightModeDialogClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
- object_class->finalize = gedit_highlight_mode_dialog_finalize;
-
dialog_class->response = gedit_highlight_mode_dialog_response;
signals[LANGUAGE_SELECTED] =
@@ -117,8 +109,6 @@ gedit_highlight_mode_dialog_class_init (GeditHighlightModeDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditHighlightModeDialog, liststore);
gtk_widget_class_bind_template_child_private (widget_class, GeditHighlightModeDialog,
treemodelfilter);
gtk_widget_class_bind_template_child_private (widget_class, GeditHighlightModeDialog,
treeview_selection);
-
- g_type_class_add_private (object_class, sizeof (GeditHighlightModeDialogPrivate));
}
static gboolean
@@ -277,9 +267,7 @@ gedit_highlight_mode_dialog_init (GeditHighlightModeDialog *dlg)
gint i;
GtkTreeIter iter;
- dlg->priv = G_TYPE_INSTANCE_GET_PRIVATE (dlg,
- GEDIT_TYPE_HIGHLIGHT_MODE_DIALOG,
- GeditHighlightModeDialogPrivate);
+ dlg->priv = gedit_highlight_mode_dialog_get_instance_private (dlg);
priv = dlg->priv;
gtk_widget_init_template (GTK_WIDGET (dlg));
diff --git a/gedit/gedit-history-entry.c b/gedit/gedit-history-entry.c
index 4f9820b..08b28da 100644
--- a/gedit/gedit-history-entry.c
+++ b/gedit/gedit-history-entry.c
@@ -49,10 +49,6 @@ enum {
#define GEDIT_HISTORY_ENTRY_HISTORY_LENGTH_DEFAULT 10
-#define GEDIT_HISTORY_ENTRY_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_HISTORY_ENTRY, \
- GeditHistoryEntryPrivate))
-
struct _GeditHistoryEntryPrivate
{
gchar *history_id;
@@ -63,7 +59,7 @@ struct _GeditHistoryEntryPrivate
GSettings *settings;
};
-G_DEFINE_TYPE(GeditHistoryEntry, gedit_history_entry, GTK_TYPE_COMBO_BOX_TEXT)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditHistoryEntry, gedit_history_entry, GTK_TYPE_COMBO_BOX_TEXT)
static void
gedit_history_entry_set_property (GObject *object,
@@ -213,8 +209,6 @@ gedit_history_entry_class_init (GeditHistoryEntryClass *klass)
TRUE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditHistoryEntryPrivate));
}
static GtkListStore *
@@ -411,7 +405,7 @@ gedit_history_entry_init (GeditHistoryEntry *entry)
{
GeditHistoryEntryPrivate *priv;
- priv = GEDIT_HISTORY_ENTRY_GET_PRIVATE (entry);
+ priv = gedit_history_entry_get_instance_private (entry);
entry->priv = priv;
priv->history_id = NULL;
diff --git a/gedit/gedit-message-bus.c b/gedit/gedit-message-bus.c
index e19104a..52faa29 100644
--- a/gedit/gedit-message-bus.c
+++ b/gedit/gedit-message-bus.c
@@ -114,8 +114,6 @@
*
*/
-#define GEDIT_MESSAGE_BUS_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_MESSAGE_BUS,
GeditMessageBusPrivate))
-
typedef struct
{
gchar *object_path;
@@ -174,7 +172,7 @@ static guint message_bus_signals[LAST_SIGNAL];
static void gedit_message_bus_dispatch_real (GeditMessageBus *bus,
GeditMessage *message);
-G_DEFINE_TYPE(GeditMessageBus, gedit_message_bus, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditMessageBus, gedit_message_bus, G_TYPE_OBJECT)
static MessageIdentifier *
message_identifier_new (const gchar *object_path,
@@ -338,8 +336,6 @@ gedit_message_bus_class_init (GeditMessageBusClass *klass)
2,
G_TYPE_STRING,
G_TYPE_STRING);
-
- g_type_class_add_private (object_class, sizeof (GeditMessageBusPrivate));
}
static Message *
@@ -593,7 +589,7 @@ free_type (gpointer data)
static void
gedit_message_bus_init (GeditMessageBus *self)
{
- self->priv = GEDIT_MESSAGE_BUS_GET_PRIVATE (self);
+ self->priv = gedit_message_bus_get_instance_private (self);
self->priv->messages = g_hash_table_new_full (message_identifier_hash,
message_identifier_equal,
diff --git a/gedit/gedit-message.c b/gedit/gedit-message.c
index 09e4a00..efff11e 100644
--- a/gedit/gedit-message.c
+++ b/gedit/gedit-message.c
@@ -41,7 +41,6 @@
* Since: 2.25.3
*
*/
-#define GEDIT_MESSAGE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_MESSAGE,
GeditMessagePrivate))
enum
{
@@ -57,7 +56,7 @@ struct _GeditMessagePrivate
gchar *method;
};
-G_DEFINE_TYPE (GeditMessage, gedit_message, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditMessage, gedit_message, G_TYPE_OBJECT)
static void
gedit_message_finalize (GObject *object)
@@ -159,14 +158,12 @@ gedit_message_class_init (GeditMessageClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditMessagePrivate));
}
static void
gedit_message_init (GeditMessage *self)
{
- self->priv = GEDIT_MESSAGE_GET_PRIVATE (self);
+ self->priv = gedit_message_get_instance_private (self);
}
/**
diff --git a/gedit/gedit-multi-notebook.c b/gedit/gedit-multi-notebook.c
index 0ed584f..3e36c70 100644
--- a/gedit/gedit-multi-notebook.c
+++ b/gedit/gedit-multi-notebook.c
@@ -20,13 +20,9 @@
* Boston, MA 02110-1301 USA
*/
-
#include "gedit-multi-notebook.h"
#include "gedit-marshal.h"
-
-#define GEDIT_MULTI_NOTEBOOK_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_MULTI_NOTEBOOK, GeditMultiNotebookPrivate))
-
struct _GeditMultiNotebookPrivate
{
GtkWidget *active_notebook;
@@ -62,7 +58,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GeditMultiNotebook, gedit_multi_notebook, GTK_TYPE_GRID)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditMultiNotebook, gedit_multi_notebook, GTK_TYPE_GRID)
static void remove_notebook (GeditMultiNotebook *mnb,
GtkWidget *notebook);
@@ -109,8 +105,6 @@ gedit_multi_notebook_class_init (GeditMultiNotebookClass *klass)
object_class->finalize = gedit_multi_notebook_finalize;
object_class->get_property = gedit_multi_notebook_get_property;
- g_type_class_add_private (object_class, sizeof (GeditMultiNotebookPrivate));
-
signals[NOTEBOOK_ADDED] =
g_signal_new ("notebook-added",
G_OBJECT_CLASS_TYPE (object_class),
@@ -562,7 +556,7 @@ remove_notebook (GeditMultiNotebook *mnb,
static void
gedit_multi_notebook_init (GeditMultiNotebook *mnb)
{
- mnb->priv = GEDIT_MULTI_NOTEBOOK_GET_PRIVATE (mnb);
+ mnb->priv = gedit_multi_notebook_get_instance_private (mnb);
mnb->priv->removing_notebook = FALSE;
diff --git a/gedit/gedit-notebook-popup-menu.c b/gedit/gedit-notebook-popup-menu.c
index 0e351c2..634588a 100644
--- a/gedit/gedit-notebook-popup-menu.c
+++ b/gedit/gedit-notebook-popup-menu.c
@@ -36,7 +36,7 @@ enum
PROP_TAB
};
-G_DEFINE_TYPE (GeditNotebookPopupMenu, gedit_notebook_popup_menu, GTK_TYPE_MENU)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditNotebookPopupMenu, gedit_notebook_popup_menu, GTK_TYPE_MENU)
static void
gedit_notebook_popup_menu_set_property (GObject *object,
@@ -118,8 +118,6 @@ gedit_notebook_popup_menu_class_init (GeditNotebookPopupMenuClass *klass)
GEDIT_TYPE_TAB,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (GeditNotebookPopupMenuPrivate));
}
static void
@@ -163,9 +161,7 @@ gedit_notebook_popup_menu_init (GeditNotebookPopupMenu *menu)
{
GtkWidget *menu_item;
- menu->priv = G_TYPE_INSTANCE_GET_PRIVATE (menu,
- GEDIT_TYPE_NOTEBOOK_POPUP_MENU,
- GeditNotebookPopupMenuPrivate);
+ menu->priv = gedit_notebook_popup_menu_get_instance_private (menu);
/* Keep in sync with the respective GtkActions */
menu_item = gtk_menu_item_new_with_mnemonic (_("_Move to New Window"));
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index d65b29a..041babe 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -51,8 +51,6 @@
#include "gedit-settings.h"
#include "gedit-marshal.h"
-#define GEDIT_NOTEBOOK_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_NOTEBOOK,
GeditNotebookPrivate))
-
#define GEDIT_NOTEBOOK_GROUP_NAME "GeditNotebookGroup"
struct _GeditNotebookPrivate
@@ -67,7 +65,7 @@ struct _GeditNotebookPrivate
guint ignore_focused_page_update : 1;
};
-G_DEFINE_TYPE(GeditNotebook, gedit_notebook, GTK_TYPE_NOTEBOOK)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditNotebook, gedit_notebook, GTK_TYPE_NOTEBOOK)
/* Properties */
enum
@@ -530,8 +528,6 @@ gedit_notebook_class_init (GeditNotebookClass *klass)
2,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE,
GEDIT_TYPE_TAB);
-
- g_type_class_add_private (object_class, sizeof (GeditNotebookPrivate));
}
/**
@@ -552,7 +548,7 @@ gedit_notebook_init (GeditNotebook *notebook)
{
GeditNotebookPrivate *priv;
- notebook->priv = GEDIT_NOTEBOOK_GET_PRIVATE (notebook);
+ notebook->priv = gedit_notebook_get_instance_private (notebook);
priv = notebook->priv;
priv->ui_settings = g_settings_new ("org.gnome.gedit.preferences.ui");
diff --git a/gedit/gedit-open-tool-button.c b/gedit/gedit-open-tool-button.c
index 5f849c5..c7f8859 100644
--- a/gedit/gedit-open-tool-button.c
+++ b/gedit/gedit-open-tool-button.c
@@ -38,7 +38,7 @@ enum
PROP_LIMIT
};
-G_DEFINE_TYPE (GeditOpenToolButton, gedit_open_tool_button, GTK_TYPE_MENU_TOOL_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditOpenToolButton, gedit_open_tool_button, GTK_TYPE_MENU_TOOL_BUTTON)
static void
set_recent_menu (GeditOpenToolButton *button)
@@ -129,10 +129,7 @@ gedit_open_tool_button_constructed (GObject *object)
static void
gedit_open_tool_button_init (GeditOpenToolButton *button)
{
- button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
- GEDIT_TYPE_OPEN_TOOL_BUTTON,
- GeditOpenToolButtonPrivate);
-
+ button->priv = gedit_open_tool_button_get_instance_private (button);
button->priv->limit = 10;
}
@@ -155,8 +152,6 @@ gedit_open_tool_button_class_init (GeditOpenToolButtonClass *klass)
10,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditOpenToolButtonPrivate));
}
GtkToolItem *
diff --git a/gedit/gedit-panel.c b/gedit/gedit-panel.c
index 5800f09..7d46704 100644
--- a/gedit/gedit-panel.c
+++ b/gedit/gedit-panel.c
@@ -45,8 +45,6 @@
#define PANEL_ITEM_KEY "GeditPanelItemKey"
-#define GEDIT_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_PANEL,
GeditPanelPrivate))
-
struct _GeditPanelPrivate
{
GtkOrientation orientation;
@@ -89,7 +87,7 @@ static guint signals[LAST_SIGNAL];
static void gedit_panel_constructed (GObject *object);
-G_DEFINE_TYPE(GeditPanel, gedit_panel, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditPanel, gedit_panel, GTK_TYPE_BIN)
static void
gedit_panel_finalize (GObject *object)
@@ -246,8 +244,6 @@ gedit_panel_class_init (GeditPanelClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GeditPanelPrivate));
-
object_class->constructed = gedit_panel_constructed;
object_class->finalize = gedit_panel_finalize;
object_class->get_property = gedit_panel_get_property;
@@ -453,7 +449,7 @@ panel_show (GeditPanel *panel,
static void
gedit_panel_init (GeditPanel *panel)
{
- panel->priv = GEDIT_PANEL_GET_PRIVATE (panel);
+ panel->priv = gedit_panel_get_instance_private (panel);
panel->priv->main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (panel->priv->main_box);
diff --git a/gedit/gedit-plugins-engine.c b/gedit/gedit-plugins-engine.c
index 0ffd606..6085af5 100644
--- a/gedit/gedit-plugins-engine.c
+++ b/gedit/gedit-plugins-engine.c
@@ -45,13 +45,13 @@
#include "gedit-settings.h"
#include "gedit-utils.h"
-G_DEFINE_TYPE(GeditPluginsEngine, gedit_plugins_engine, PEAS_TYPE_ENGINE)
-
struct _GeditPluginsEnginePrivate
{
GSettings *plugin_settings;
};
+G_DEFINE_TYPE_WITH_PRIVATE (GeditPluginsEngine, gedit_plugins_engine, PEAS_TYPE_ENGINE)
+
GeditPluginsEngine *default_engine = NULL;
static void
@@ -62,9 +62,7 @@ gedit_plugins_engine_init (GeditPluginsEngine *engine)
gedit_debug (DEBUG_PLUGINS);
- engine->priv = G_TYPE_INSTANCE_GET_PRIVATE (engine,
- GEDIT_TYPE_PLUGINS_ENGINE,
- GeditPluginsEnginePrivate);
+ engine->priv = gedit_plugins_engine_get_instance_private (engine);
peas_engine_enable_loader (PEAS_ENGINE (engine), "python3");
@@ -133,8 +131,6 @@ gedit_plugins_engine_class_init (GeditPluginsEngineClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gedit_plugins_engine_dispose;
-
- g_type_class_add_private (klass, sizeof (GeditPluginsEnginePrivate));
}
GeditPluginsEngine *
diff --git a/gedit/gedit-preferences-dialog.c b/gedit/gedit-preferences-dialog.c
index 74da971..4c10afd 100644
--- a/gedit/gedit-preferences-dialog.c
+++ b/gedit/gedit-preferences-dialog.c
@@ -70,11 +70,6 @@ enum
NUM_COLUMNS
};
-
-#define GEDIT_PREFERENCES_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_PREFERENCES_DIALOG, \
- GeditPreferencesDialogPrivate))
-
struct _GeditPreferencesDialogPrivate
{
GSettings *editor;
@@ -129,9 +124,7 @@ struct _GeditPreferencesDialogPrivate
GtkWidget *plugin_manager_place_holder;
};
-
-G_DEFINE_TYPE(GeditPreferencesDialog, gedit_preferences_dialog, GTK_TYPE_DIALOG)
-
+G_DEFINE_TYPE_WITH_PRIVATE (GeditPreferencesDialog, gedit_preferences_dialog, GTK_TYPE_DIALOG)
static void
gedit_preferences_dialog_dispose (GObject *object)
@@ -204,8 +197,6 @@ gedit_preferences_dialog_class_init (GeditPreferencesDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditPreferencesDialog,
uninstall_scheme_button);
gtk_widget_class_bind_template_child_private (widget_class, GeditPreferencesDialog, schemes_toolbar);
gtk_widget_class_bind_template_child_private (widget_class, GeditPreferencesDialog,
plugin_manager_place_holder);
-
- g_type_class_add_private (object_class, sizeof (GeditPreferencesDialogPrivate));
}
static void
@@ -1105,7 +1096,7 @@ gedit_preferences_dialog_init (GeditPreferencesDialog *dlg)
{
gedit_debug (DEBUG_PREFS);
- dlg->priv = GEDIT_PREFERENCES_DIALOG_GET_PRIVATE (dlg);
+ dlg->priv = gedit_preferences_dialog_get_instance_private (dlg);
dlg->priv->editor = g_settings_new ("org.gnome.gedit.preferences.editor");
gtk_widget_init_template (GTK_WIDGET (dlg));
diff --git a/gedit/gedit-print-job.c b/gedit/gedit-print-job.c
index 238949c..8c49bda 100644
--- a/gedit/gedit-print-job.c
+++ b/gedit/gedit-print-job.c
@@ -44,11 +44,6 @@
#include "gedit-dirs.h"
#include "gedit-settings.h"
-
-#define GEDIT_PRINT_JOB_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_PRINT_JOB, \
- GeditPrintJobPrivate))
-
struct _GeditPrintJobPrivate
{
GSettings *print_settings;
@@ -105,7 +100,7 @@ enum
static guint print_job_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GeditPrintJob, gedit_print_job, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditPrintJob, gedit_print_job, G_TYPE_OBJECT)
static void end_print_cb (GtkPrintOperation *operation,
GtkPrintContext *context,
@@ -246,8 +241,6 @@ gedit_print_job_class_init (GeditPrintJobClass *klass)
2,
G_TYPE_UINT,
G_TYPE_POINTER);
-
- g_type_class_add_private (object_class, sizeof (GeditPrintJobPrivate));
}
static void
@@ -834,7 +827,7 @@ gedit_print_job_print (GeditPrintJob *job,
static void
gedit_print_job_init (GeditPrintJob *job)
{
- job->priv = GEDIT_PRINT_JOB_GET_PRIVATE (job);
+ job->priv = gedit_print_job_get_instance_private (job);
job->priv->print_settings = g_settings_new ("org.gnome.gedit.preferences.print");
diff --git a/gedit/gedit-print-preview.c b/gedit/gedit-print-preview.c
index dd42791..3f70cce 100644
--- a/gedit/gedit-print-preview.c
+++ b/gedit/gedit-print-preview.c
@@ -82,7 +82,7 @@ struct _GeditPrintPreviewPrivate
guint cur_page;
};
-G_DEFINE_TYPE (GeditPrintPreview, gedit_print_preview, GTK_TYPE_GRID)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditPrintPreview, gedit_print_preview, GTK_TYPE_GRID)
static void
gedit_print_preview_get_property (GObject *object,
@@ -163,8 +163,6 @@ gedit_print_preview_class_init (GeditPrintPreviewClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditPrintPreview, zoom_out);
gtk_widget_class_bind_template_child_private (widget_class, GeditPrintPreview, close);
gtk_widget_class_bind_template_child_private (widget_class, GeditPrintPreview, layout);
-
- g_type_class_add_private (object_class, sizeof (GeditPrintPreviewPrivate));
}
static void
@@ -790,10 +788,7 @@ gedit_print_preview_init (GeditPrintPreview *preview)
{
GeditPrintPreviewPrivate *priv;
- priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
- GEDIT_TYPE_PRINT_PREVIEW,
- GeditPrintPreviewPrivate);
-
+ priv = gedit_print_preview_get_instance_private (preview);
preview->priv = priv;
priv->operation = NULL;
diff --git a/gedit/gedit-progress-info-bar.c b/gedit/gedit-progress-info-bar.c
index 1323767..fe7c749 100644
--- a/gedit/gedit-progress-info-bar.c
+++ b/gedit/gedit-progress-info-bar.c
@@ -35,9 +35,6 @@ enum {
PROP_HAS_CANCEL_BUTTON
};
-
-#define GEDIT_PROGRESS_INFO_BAR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),
GEDIT_TYPE_PROGRESS_INFO_BAR, GeditProgressInfoBarPrivate))
-
struct _GeditProgressInfoBarPrivate
{
GtkWidget *image;
@@ -45,7 +42,7 @@ struct _GeditProgressInfoBarPrivate
GtkWidget *progress;
};
-G_DEFINE_TYPE(GeditProgressInfoBar, gedit_progress_info_bar, GTK_TYPE_INFO_BAR)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditProgressInfoBar, gedit_progress_info_bar, GTK_TYPE_INFO_BAR)
static void
gedit_progress_info_bar_set_has_cancel_button (GeditProgressInfoBar *bar,
@@ -103,16 +100,12 @@ gedit_progress_info_bar_class_init (GeditProgressInfoBarClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditProgressInfoBar, image);
gtk_widget_class_bind_template_child_private (widget_class, GeditProgressInfoBar, label);
gtk_widget_class_bind_template_child_private (widget_class, GeditProgressInfoBar, progress);
-
- g_type_class_add_private (gobject_class, sizeof (GeditProgressInfoBarPrivate));
}
static void
gedit_progress_info_bar_init (GeditProgressInfoBar *bar)
{
- bar->priv = G_TYPE_INSTANCE_GET_PRIVATE (bar,
- GEDIT_TYPE_PROGRESS_INFO_BAR,
- GeditProgressInfoBarPrivate);
+ bar->priv = gedit_progress_info_bar_get_instance_private (bar);
gtk_widget_init_template (GTK_WIDGET (bar));
}
diff --git a/gedit/gedit-replace-dialog.c b/gedit/gedit-replace-dialog.c
index 165625c..afe70e7 100644
--- a/gedit/gedit-replace-dialog.c
+++ b/gedit/gedit-replace-dialog.c
@@ -51,7 +51,7 @@ struct _GeditReplaceDialogPrivate
gboolean ui_error;
};
-G_DEFINE_TYPE(GeditReplaceDialog, gedit_replace_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditReplaceDialog, gedit_replace_dialog, GTK_TYPE_DIALOG)
void
gedit_replace_dialog_present_with_time (GeditReplaceDialog *dialog,
@@ -115,7 +115,6 @@ gedit_replace_dialog_response (GtkDialog *dialog,
static void
gedit_replace_dialog_class_init (GeditReplaceDialogClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
@@ -132,8 +131,6 @@ gedit_replace_dialog_class_init (GeditReplaceDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog,
entire_word_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog,
backwards_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog,
wrap_around_checkbutton);
-
- g_type_class_add_private (object_class, sizeof (GeditReplaceDialogPrivate));
}
static void
@@ -202,7 +199,7 @@ search_text_entry_changed (GtkEditable *editable,
static void
gedit_replace_dialog_init (GeditReplaceDialog *dlg)
{
- dlg->priv = G_TYPE_INSTANCE_GET_PRIVATE (dlg, GEDIT_TYPE_REPLACE_DIALOG, GeditReplaceDialogPrivate);
+ dlg->priv = gedit_replace_dialog_get_instance_private (dlg);
gtk_widget_init_template (GTK_WIDGET (dlg));
diff --git a/gedit/gedit-settings.c b/gedit/gedit-settings.c
index 0d78ba7..7191004 100644
--- a/gedit/gedit-settings.c
+++ b/gedit/gedit-settings.c
@@ -46,8 +46,6 @@
#define GEDIT_SETTINGS_SYSTEM_FONT "monospace-font-name"
-#define GEDIT_SETTINGS_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_SETTINGS,
GeditSettingsPrivate))
-
struct _GeditSettingsPrivate
{
GSettings *lockdown;
@@ -58,7 +56,7 @@ struct _GeditSettingsPrivate
gchar *old_scheme;
};
-G_DEFINE_TYPE (GeditSettings, gedit_settings, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditSettings, gedit_settings, G_TYPE_OBJECT)
static void
gedit_settings_finalize (GObject *object)
@@ -345,7 +343,7 @@ on_syntax_highlighting_changed (GSettings *settings,
static void
gedit_settings_init (GeditSettings *gs)
{
- gs->priv = GEDIT_SETTINGS_GET_PRIVATE (gs);
+ gs->priv = gedit_settings_get_instance_private (gs);
gs->priv->old_scheme = NULL;
gs->priv->editor = g_settings_new ("org.gnome.gedit.preferences.editor");
@@ -400,8 +398,6 @@ gedit_settings_class_init (GeditSettingsClass *klass)
object_class->finalize = gedit_settings_finalize;
object_class->dispose = gedit_settings_dispose;
-
- g_type_class_add_private (object_class, sizeof (GeditSettingsPrivate));
}
GObject *
diff --git a/gedit/gedit-statusbar.c b/gedit/gedit-statusbar.c
index 3f1af50..4254481 100644
--- a/gedit/gedit-statusbar.c
+++ b/gedit/gedit-statusbar.c
@@ -38,10 +38,6 @@
#include "gedit-statusbar.h"
-#define GEDIT_STATUSBAR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),\
- GEDIT_TYPE_STATUSBAR,\
- GeditStatusbarPrivate))
-
struct _GeditStatusbarPrivate
{
GtkWidget *overwrite_mode_label;
@@ -61,7 +57,7 @@ struct _GeditStatusbarPrivate
guint flash_message_id;
};
-G_DEFINE_TYPE(GeditStatusbar, gedit_statusbar, GTK_TYPE_STATUSBAR)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditStatusbar, gedit_statusbar, GTK_TYPE_STATUSBAR)
static gchar *
get_overwrite_mode_string (gboolean overwrite)
@@ -96,8 +92,6 @@ gedit_statusbar_class_init (GeditStatusbarClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gedit_statusbar_dispose;
-
- g_type_class_add_private (object_class, sizeof (GeditStatusbarPrivate));
}
#define CURSOR_POSITION_LABEL_WIDTH_CHARS 18
@@ -108,7 +102,7 @@ gedit_statusbar_init (GeditStatusbar *statusbar)
GtkWidget *hbox;
GtkWidget *error_image;
- statusbar->priv = GEDIT_STATUSBAR_GET_PRIVATE (statusbar);
+ statusbar->priv = gedit_statusbar_get_instance_private (statusbar);
statusbar->priv->overwrite_mode_label = gtk_label_new (NULL);
gtk_label_set_width_chars (GTK_LABEL (statusbar->priv->overwrite_mode_label),
diff --git a/gedit/gedit-tab-label.c b/gedit/gedit-tab-label.c
index efb4220..22c446b 100644
--- a/gedit/gedit-tab-label.c
+++ b/gedit/gedit-tab-label.c
@@ -29,8 +29,6 @@
#include "gedit-tab-label.h"
#include "gedit-close-button.h"
-#define GEDIT_TAB_LABEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_TAB_LABEL,
GeditTabLabelPrivate))
-
/* Signals */
enum
{
@@ -59,7 +57,7 @@ struct _GeditTabLabelPrivate
static guint signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GeditTabLabel, gedit_tab_label, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditTabLabel, gedit_tab_label, GTK_TYPE_BOX)
static void
gedit_tab_label_finalize (GObject *object)
@@ -249,8 +247,6 @@ gedit_tab_label_class_init (GeditTabLabelClass *klass)
GEDIT_TYPE_TAB,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (GeditTabLabelPrivate));
}
static void
@@ -264,7 +260,7 @@ gedit_tab_label_init (GeditTabLabel *tab_label)
GtkWidget *label;
GtkWidget *dummy_label;
- tab_label->priv = GEDIT_TAB_LABEL_GET_PRIVATE (tab_label);
+ tab_label->priv = gedit_tab_label_get_instance_private (tab_label);
tab_label->priv->close_button_sensitive = TRUE;
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 53da2b0..2dce78c 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -46,8 +46,6 @@
#include "gedit-settings.h"
#include "gedit-view-frame.h"
-#define GEDIT_TAB_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_TAB,
GeditTabPrivate))
-
#define GEDIT_TAB_KEY "GEDIT_TAB_KEY"
struct _GeditTabPrivate
@@ -85,7 +83,7 @@ struct _GeditTabPrivate
gint ask_if_externally_modified : 1;
};
-G_DEFINE_TYPE(GeditTab, gedit_tab, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditTab, gedit_tab, GTK_TYPE_BOX)
enum
{
@@ -364,8 +362,6 @@ gedit_tab_class_init (GeditTabClass *klass)
G_TYPE_NONE,
1,
G_TYPE_STRV);
-
- g_type_class_add_private (object_class, sizeof (GeditTabPrivate));
}
/**
@@ -1668,7 +1664,7 @@ gedit_tab_init (GeditTab *tab)
GeditDocument *doc;
GeditView *view;
- tab->priv = GEDIT_TAB_GET_PRIVATE (tab);
+ tab->priv = gedit_tab_get_instance_private (tab);
tab->priv->editor = g_settings_new ("org.gnome.gedit.preferences.editor");
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index 62c7e71..d191410 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -54,8 +54,6 @@
#define GEDIT_VIEW_SCROLL_MARGIN 0.02
-#define GEDIT_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_VIEW,
GeditViewPrivate))
-
enum
{
TARGET_URI_LIST = 100,
@@ -69,7 +67,7 @@ struct _GeditViewPrivate
PeasExtensionSet *extensions;
};
-G_DEFINE_TYPE(GeditView, gedit_view, GTK_SOURCE_TYPE_VIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditView, gedit_view, GTK_SOURCE_TYPE_VIEW)
/* Signals */
enum
@@ -135,7 +133,7 @@ gedit_view_init (GeditView *view)
gedit_debug (DEBUG_VIEW);
- view->priv = GEDIT_VIEW_GET_PRIVATE (view);
+ view->priv = gedit_view_get_instance_private (view);
view->priv->editor_settings = g_settings_new ("org.gnome.gedit.preferences.editor");
@@ -742,8 +740,6 @@ gedit_view_class_init (GeditViewClass *klass)
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, G_TYPE_STRV);
- g_type_class_add_private (klass, sizeof (GeditViewPrivate));
-
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set,
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 538775b..e6cfefc 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -68,10 +68,6 @@
#define LANGUAGE_DATA "GeditWindowLanguageData"
#define FULLSCREEN_ANIMATION_SPEED 4
-#define GEDIT_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),\
- GEDIT_TYPE_WINDOW, \
- GeditWindowPrivate))
-
/* Signals */
enum
{
@@ -96,7 +92,7 @@ enum
TARGET_URI_LIST = 100
};
-G_DEFINE_TYPE(GeditWindow, gedit_window, GTK_TYPE_APPLICATION_WINDOW)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditWindow, gedit_window, GTK_TYPE_APPLICATION_WINDOW)
static void recent_manager_changed (GtkRecentManager *manager,
GeditWindow *window);
@@ -436,8 +432,6 @@ gedit_window_class_init (GeditWindowClass *klass)
GEDIT_WINDOW_STATE_NORMAL,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditWindowPrivate));
}
static void
@@ -3690,7 +3684,7 @@ gedit_window_init (GeditWindow *window)
gedit_debug (DEBUG_WINDOW);
- window->priv = GEDIT_WINDOW_GET_PRIVATE (window);
+ window->priv = gedit_window_get_instance_private (window);
window->priv->removing_tabs = FALSE;
window->priv->state = GEDIT_WINDOW_STATE_NORMAL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]