Commit 0ff8439a authored by Sébastien Wilmet's avatar Sébastien Wilmet
parent 365758fd
......@@ -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;
}
......
......@@ -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 */
......
......@@ -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",
......
......@@ -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
......
......@@ -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");
......
......@@ -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;
......
......@@ -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;
......
......@@ -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");
......
......@@ -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;
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
}
......
......@@ -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));
......
......@@ -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;
......
......@@ -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,
......
......@@ -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);
}
/**
......
......@@ -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;
......
......@@ -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"));
......
......@@ -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");
......
......@@ -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 *
......
......@@ -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);
......
......@@ -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)