[gedit/wip/3.14-osx: 1/5] Use G_ADD_PRIVATE for plugins
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/3.14-osx: 1/5] Use G_ADD_PRIVATE for plugins
- Date: Tue, 26 Aug 2014 12:33:51 +0000 (UTC)
commit d5c3b382ca8a4ebc39a76d012b07e2b6b09fe36d
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Tue Aug 26 13:22:29 2014 +0200
Use G_ADD_PRIVATE for plugins
plugins/checkupdate/gedit-check-update-plugin.c | 24 ++++++-----------
plugins/docinfo/gedit-docinfo-plugin.c | 9 ++----
.../gedit-file-browser-message-activation.c | 14 +++++-----
.../gedit-file-browser-message-activation.h | 2 +-
.../gedit-file-browser-message-add-filter.c | 14 +++++-----
.../gedit-file-browser-message-add-filter.h | 2 +-
...edit-file-browser-message-extend-context-menu.c | 13 +++++----
...edit-file-browser-message-extend-context-menu.h | 1 +
.../messages/gedit-file-browser-message-get-root.c | 14 +++++-----
.../messages/gedit-file-browser-message-get-root.h | 2 +-
.../messages/gedit-file-browser-message-get-view.c | 14 +++++-----
.../messages/gedit-file-browser-message-get-view.h | 2 +-
.../gedit-file-browser-message-id-location.c | 14 +++++-----
.../gedit-file-browser-message-id-location.h | 3 +-
.../messages/gedit-file-browser-message-id.c | 14 +++++-----
.../messages/gedit-file-browser-message-id.h | 2 +-
.../gedit-file-browser-message-set-emblem.c | 14 +++++-----
.../gedit-file-browser-message-set-emblem.h | 2 +-
.../gedit-file-browser-message-set-markup.c | 13 +++++----
.../gedit-file-browser-message-set-markup.h | 1 +
.../messages/gedit-file-browser-message-set-root.c | 14 +++++-----
.../messages/gedit-file-browser-message-set-root.h | 2 +-
plugins/modelines/gedit-modeline-plugin.c | 9 ++----
plugins/sort/gedit-sort-plugin.c | 27 ++++++++-----------
plugins/spell/gedit-spell-plugin.c | 25 ++++++-----------
plugins/time/gedit-time-plugin.c | 11 ++------
tools/generate-message.py | 21 +++++++++------
27 files changed, 131 insertions(+), 152 deletions(-)
---
diff --git a/plugins/checkupdate/gedit-check-update-plugin.c b/plugins/checkupdate/gedit-check-update-plugin.c
index d44ab6e..4086589 100644
--- a/plugins/checkupdate/gedit-check-update-plugin.c
+++ b/plugins/checkupdate/gedit-check-update-plugin.c
@@ -47,20 +47,8 @@
#include "gedit/gedit-app-osx.h"
#endif
-#define GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_CHECK_UPDATE_PLUGIN, \
- GeditCheckUpdatePluginPrivate))
-
static void gedit_window_activatable_iface_init (GeditWindowActivatableInterface *iface);
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditCheckUpdatePlugin,
- gedit_check_update_plugin,
- PEAS_TYPE_EXTENSION_BASE,
- 0,
- G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
- gedit_window_activatable_iface_init))
-
struct _GeditCheckUpdatePluginPrivate
{
@@ -80,10 +68,18 @@ enum
PROP_WINDOW
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditCheckUpdatePlugin,
+ gedit_check_update_plugin,
+ PEAS_TYPE_EXTENSION_BASE,
+ 0,
+ G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
+ gedit_window_activatable_iface_init)
+ G_ADD_PRIVATE_DYNAMIC (GeditCheckUpdatePlugin))
+
static void
gedit_check_update_plugin_init (GeditCheckUpdatePlugin *plugin)
{
- plugin->priv = GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE (plugin);
+ plugin->priv = gedit_check_update_plugin_get_instance_private (plugin);
gedit_debug_message (DEBUG_PLUGINS,
"GeditCheckUpdatePlugin initializing");
@@ -623,8 +619,6 @@ gedit_check_update_plugin_class_init (GeditCheckUpdatePluginClass *klass)
object_class->get_property = gedit_check_update_plugin_get_property;
g_object_class_override_property (object_class, PROP_WINDOW, "window");
-
- g_type_class_add_private (object_class, sizeof (GeditCheckUpdatePluginPrivate));
}
static void
diff --git a/plugins/docinfo/gedit-docinfo-plugin.c b/plugins/docinfo/gedit-docinfo-plugin.c
index 983139c..3bf0509 100644
--- a/plugins/docinfo/gedit-docinfo-plugin.c
+++ b/plugins/docinfo/gedit-docinfo-plugin.c
@@ -85,7 +85,8 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditDocinfoPlugin,
G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_APP_ACTIVATABLE,
gedit_app_activatable_iface_init)
G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
- gedit_window_activatable_iface_init))
+ gedit_window_activatable_iface_init)
+ G_ADD_PRIVATE_DYNAMIC (GeditDocinfoPlugin))
static void
calculate_info (GeditDocument *doc,
@@ -429,9 +430,7 @@ gedit_docinfo_plugin_init (GeditDocinfoPlugin *plugin)
{
gedit_debug_message (DEBUG_PLUGINS, "GeditDocinfoPlugin initializing");
- plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
- GEDIT_TYPE_DOCINFO_PLUGIN,
- GeditDocinfoPluginPrivate);
+ plugin->priv = gedit_docinfo_plugin_get_instance_private (plugin);
}
static void
@@ -602,8 +601,6 @@ gedit_docinfo_plugin_class_init (GeditDocinfoPluginClass *klass)
g_object_class_override_property (object_class, PROP_WINDOW, "window");
g_object_class_override_property (object_class, PROP_APP, "app");
-
- g_type_class_add_private (klass, sizeof (GeditDocinfoPluginPrivate));
}
static void
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-activation.c
b/plugins/filebrowser/messages/gedit-file-browser-message-activation.c
index 29b293d..93f6cbd 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-activation.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-activation.c
@@ -3,7 +3,7 @@
* gedit-file-browser-message-activation.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
#include "gedit-file-browser-message-activation.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_ACTIVATION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_ACTIVATION, GeditFileBrowserMessageActivationPrivate))
-
enum
{
PROP_0,
@@ -41,7 +39,11 @@ struct _GeditFileBrowserMessageActivationPrivate
gboolean active;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageActivation, gedit_file_browser_message_activation, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageActivation,
+ gedit_file_browser_message_activation,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageActivation))
static void
gedit_file_browser_message_activation_get_property (GObject *obj,
@@ -96,12 +98,10 @@ gedit_file_browser_message_activation_class_init (GeditFileBrowserMessageActivat
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageActivationPrivate));
}
static void
gedit_file_browser_message_activation_init (GeditFileBrowserMessageActivation *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_ACTIVATION_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_activation_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-activation.h
b/plugins/filebrowser/messages/gedit-file-browser-message-activation.h
index a30453f..d9c56e5 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-activation.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-activation.h
@@ -3,7 +3,7 @@
* gedit-file-browser-message-activation.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.c
b/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.c
index 52b606c..8c4be90 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.c
@@ -3,7 +3,7 @@
* gedit-file-browser-message-add-filter.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
#include "gedit-file-browser-message-add-filter.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_ADD_FILTER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_ADD_FILTER, GeditFileBrowserMessageAddFilterPrivate))
-
enum
{
PROP_0,
@@ -45,7 +43,11 @@ struct _GeditFileBrowserMessageAddFilterPrivate
guint id;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageAddFilter, gedit_file_browser_message_add_filter, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageAddFilter,
+ gedit_file_browser_message_add_filter,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageAddFilter))
static void
gedit_file_browser_message_add_filter_finalize (GObject *obj)
@@ -153,12 +155,10 @@ gedit_file_browser_message_add_filter_class_init (GeditFileBrowserMessageAddFilt
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageAddFilterPrivate));
}
static void
gedit_file_browser_message_add_filter_init (GeditFileBrowserMessageAddFilter *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_ADD_FILTER_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_add_filter_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.h
b/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.h
index 8c4cc5f..b66fb76 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-add-filter.h
@@ -3,7 +3,7 @@
* gedit-file-browser-message-add-filter.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.c
b/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.c
index b4dc47d..542dcd7 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.c
@@ -4,6 +4,7 @@
* This file is part of gedit
*
* Copyright (C) 2014 - Paolo Borelli
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,8 +29,6 @@
#include "gedit-file-browser-message-extend-context-menu.h"
#include <gedit/gedit-menu-extension.h>
-#define
GEDIT_FILE_BROWSER_MESSAGE_EXTEND_CONTEXT_MENU_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_EXTEND_CONTEXT_MENU, GeditFileBrowserMessageExtendContextMenuPrivate))
-
enum
{
PROP_0,
@@ -42,7 +41,11 @@ struct _GeditFileBrowserMessageExtendContextMenuPrivate
GeditMenuExtension *extension;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageExtendContextMenu, gedit_file_browser_message_extend_context_menu,
GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageExtendContextMenu,
+ gedit_file_browser_message_extend_context_menu,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageExtendContextMenu))
static void
gedit_file_browser_message_extend_context_menu_finalize (GObject *obj)
@@ -118,12 +121,10 @@ gedit_file_browser_message_extend_context_menu_class_init (GeditFileBrowserMessa
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageExtendContextMenuPrivate));
}
static void
gedit_file_browser_message_extend_context_menu_init (GeditFileBrowserMessageExtendContextMenu *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_EXTEND_CONTEXT_MENU_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_extend_context_menu_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.h
b/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.h
index dc363ab..66df0c6 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-extend-context-menu.h
@@ -4,6 +4,7 @@
* This file is part of gedit
*
* Copyright (C) 2014 - Paolo Borelli
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-get-root.c
b/plugins/filebrowser/messages/gedit-file-browser-message-get-root.c
index 720ecf2..ae0da3e 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-get-root.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-get-root.c
@@ -3,7 +3,7 @@
* gedit-file-browser-message-get-root.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,8 +28,6 @@
#include "gedit-file-browser-message-get-root.h"
#include "gio/gio.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_GET_ROOT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_GET_ROOT, GeditFileBrowserMessageGetRootPrivate))
-
enum
{
PROP_0,
@@ -42,7 +40,11 @@ struct _GeditFileBrowserMessageGetRootPrivate
GFile *location;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageGetRoot, gedit_file_browser_message_get_root, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageGetRoot,
+ gedit_file_browser_message_get_root,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageGetRoot))
static void
gedit_file_browser_message_get_root_finalize (GObject *obj)
@@ -118,12 +120,10 @@ gedit_file_browser_message_get_root_class_init (GeditFileBrowserMessageGetRootCl
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageGetRootPrivate));
}
static void
gedit_file_browser_message_get_root_init (GeditFileBrowserMessageGetRoot *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_GET_ROOT_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_get_root_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-get-root.h
b/plugins/filebrowser/messages/gedit-file-browser-message-get-root.h
index b7b9b96..ee44d90 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-get-root.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-get-root.h
@@ -3,7 +3,7 @@
* gedit-file-browser-message-get-root.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-get-view.c
b/plugins/filebrowser/messages/gedit-file-browser-message-get-view.c
index f331cae..3050a5c 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-get-view.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-get-view.c
@@ -3,7 +3,7 @@
* gedit-file-browser-message-get-view.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,8 +28,6 @@
#include "gedit-file-browser-message-get-view.h"
#include "plugins/filebrowser/gedit-file-browser-view.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_GET_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_GET_VIEW, GeditFileBrowserMessageGetViewPrivate))
-
enum
{
PROP_0,
@@ -42,7 +40,11 @@ struct _GeditFileBrowserMessageGetViewPrivate
GeditFileBrowserView *view;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageGetView, gedit_file_browser_message_get_view, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageGetView,
+ gedit_file_browser_message_get_view,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageGetView))
static void
gedit_file_browser_message_get_view_finalize (GObject *obj)
@@ -118,12 +120,10 @@ gedit_file_browser_message_get_view_class_init (GeditFileBrowserMessageGetViewCl
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageGetViewPrivate));
}
static void
gedit_file_browser_message_get_view_init (GeditFileBrowserMessageGetView *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_GET_VIEW_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_get_view_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-get-view.h
b/plugins/filebrowser/messages/gedit-file-browser-message-get-view.h
index fb5baf3..c3ab4a0 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-get-view.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-get-view.h
@@ -3,7 +3,7 @@
* gedit-file-browser-message-get-view.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-id-location.c
b/plugins/filebrowser/messages/gedit-file-browser-message-id-location.c
index 4da1762..07c0a78 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-id-location.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-id-location.c
@@ -3,8 +3,8 @@
* gedit-file-browser-message-id-location.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
* Copyright (C) 2013 - Garrett Regier
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,8 +29,6 @@
#include "gedit-file-browser-message-id-location.h"
#include "gio/gio.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_ID_LOCATION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_ID_LOCATION, GeditFileBrowserMessageIdLocationPrivate))
-
enum
{
PROP_0,
@@ -49,7 +47,11 @@ struct _GeditFileBrowserMessageIdLocationPrivate
gboolean is_directory;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageIdLocation, gedit_file_browser_message_id_location, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageIdLocation,
+ gedit_file_browser_message_id_location,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageIdLocation))
static void
gedit_file_browser_message_id_location_finalize (GObject *obj)
@@ -181,12 +183,10 @@ gedit_file_browser_message_id_location_class_init (GeditFileBrowserMessageIdLoca
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageIdLocationPrivate));
}
static void
gedit_file_browser_message_id_location_init (GeditFileBrowserMessageIdLocation *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_ID_LOCATION_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_id_location_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-id-location.h
b/plugins/filebrowser/messages/gedit-file-browser-message-id-location.h
index 176963c..0442364 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-id-location.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-id-location.h
@@ -3,7 +3,8 @@
* gedit-file-browser-message-id-location.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2013 - Garrett Regier
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-id.c
b/plugins/filebrowser/messages/gedit-file-browser-message-id.c
index 10e4e5a..13565e0 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-id.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-id.c
@@ -3,7 +3,7 @@
* gedit-file-browser-message-id.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
#include "gedit-file-browser-message-id.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_ID_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_ID, GeditFileBrowserMessageIdPrivate))
-
enum
{
PROP_0,
@@ -41,7 +39,11 @@ struct _GeditFileBrowserMessageIdPrivate
guint id;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageId, gedit_file_browser_message_id, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageId,
+ gedit_file_browser_message_id,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageId))
static void
gedit_file_browser_message_id_get_property (GObject *obj,
@@ -98,12 +100,10 @@ gedit_file_browser_message_id_class_init (GeditFileBrowserMessageIdClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageIdPrivate));
}
static void
gedit_file_browser_message_id_init (GeditFileBrowserMessageId *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_ID_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_id_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-id.h
b/plugins/filebrowser/messages/gedit-file-browser-message-id.h
index fe1c559..91f095d 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-id.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-id.h
@@ -3,7 +3,7 @@
* gedit-file-browser-message-id.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.c
b/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.c
index bd64e0e..cd087d5 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.c
@@ -3,7 +3,7 @@
* gedit-file-browser-message-set-emblem.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
#include "gedit-file-browser-message-set-emblem.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_SET_EMBLEM_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_EMBLEM, GeditFileBrowserMessageSetEmblemPrivate))
-
enum
{
PROP_0,
@@ -43,7 +41,11 @@ struct _GeditFileBrowserMessageSetEmblemPrivate
gchar *emblem;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageSetEmblem, gedit_file_browser_message_set_emblem, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageSetEmblem,
+ gedit_file_browser_message_set_emblem,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageSetEmblem))
static void
gedit_file_browser_message_set_emblem_finalize (GObject *obj)
@@ -133,12 +135,10 @@ gedit_file_browser_message_set_emblem_class_init (GeditFileBrowserMessageSetEmbl
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageSetEmblemPrivate));
}
static void
gedit_file_browser_message_set_emblem_init (GeditFileBrowserMessageSetEmblem *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_SET_EMBLEM_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_set_emblem_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.h
b/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.h
index 4832d42..c9bf9c4 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-emblem.h
@@ -3,7 +3,7 @@
* gedit-file-browser-message-set-emblem.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.c
b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.c
index 1bb7c2d..2546f41 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.c
@@ -4,6 +4,7 @@
* This file is part of gedit
*
* Copyright (C) 2013 - Garrett Regier
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,8 +28,6 @@
#include "gedit-file-browser-message-set-markup.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP, GeditFileBrowserMessageSetMarkupPrivate))
-
enum
{
PROP_0,
@@ -43,7 +42,11 @@ struct _GeditFileBrowserMessageSetMarkupPrivate
gchar *markup;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageSetMarkup, gedit_file_browser_message_set_markup, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageSetMarkup,
+ gedit_file_browser_message_set_markup,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageSetMarkup))
static void
gedit_file_browser_message_set_markup_finalize (GObject *obj)
@@ -133,12 +136,10 @@ gedit_file_browser_message_set_markup_class_init (GeditFileBrowserMessageSetMark
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageSetMarkupPrivate));
}
static void
gedit_file_browser_message_set_markup_init (GeditFileBrowserMessageSetMarkup *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_set_markup_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.h
b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.h
index 41b3f83..f8e6437 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.h
@@ -4,6 +4,7 @@
* This file is part of gedit
*
* Copyright (C) 2013 - Garrett Regier
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-root.c
b/plugins/filebrowser/messages/gedit-file-browser-message-set-root.c
index 4898c0c..1b9995c 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-set-root.c
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-root.c
@@ -3,7 +3,7 @@
* gedit-file-browser-message-set-root.c
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,8 +28,6 @@
#include "gedit-file-browser-message-set-root.h"
#include "gio/gio.h"
-#define GEDIT_FILE_BROWSER_MESSAGE_SET_ROOT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),
GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_ROOT, GeditFileBrowserMessageSetRootPrivate))
-
enum
{
PROP_0,
@@ -44,7 +42,11 @@ struct _GeditFileBrowserMessageSetRootPrivate
gchar *virtual;
};
-G_DEFINE_TYPE (GeditFileBrowserMessageSetRoot, gedit_file_browser_message_set_root, GEDIT_TYPE_MESSAGE)
+G_DEFINE_TYPE_EXTENDED (GeditFileBrowserMessageSetRoot,
+ gedit_file_browser_message_set_root,
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE (GeditFileBrowserMessageSetRoot))
static void
gedit_file_browser_message_set_root_finalize (GObject *obj)
@@ -140,12 +142,10 @@ gedit_file_browser_message_set_root_class_init (GeditFileBrowserMessageSetRootCl
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageSetRootPrivate));
}
static void
gedit_file_browser_message_set_root_init (GeditFileBrowserMessageSetRoot *message)
{
- message->priv = GEDIT_FILE_BROWSER_MESSAGE_SET_ROOT_GET_PRIVATE (message);
+ message->priv = gedit_file_browser_message_set_root_get_instance_private (message);
}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-root.h
b/plugins/filebrowser/messages/gedit-file-browser-message-set-root.h
index 028c9e6..7a17157 100644
--- a/plugins/filebrowser/messages/gedit-file-browser-message-set-root.h
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-root.h
@@ -3,7 +3,7 @@
* gedit-file-browser-message-set-root.h
* This file is part of gedit
*
- * Copyright (C) 2011 - Jesse van den Kieboom
+ * Copyright (C) 2014 - Jesse van den Kieboom
*
* gedit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/modelines/gedit-modeline-plugin.c b/plugins/modelines/gedit-modeline-plugin.c
index 07b0a23..83590d4 100644
--- a/plugins/modelines/gedit-modeline-plugin.c
+++ b/plugins/modelines/gedit-modeline-plugin.c
@@ -52,7 +52,8 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditModelinePlugin,
PEAS_TYPE_EXTENSION_BASE,
0,
G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_VIEW_ACTIVATABLE,
- gedit_view_activatable_iface_init))
+ gedit_view_activatable_iface_init)
+ G_ADD_PRIVATE_DYNAMIC (GeditModelinePlugin))
static void
gedit_modeline_plugin_constructed (GObject *object)
@@ -73,9 +74,7 @@ gedit_modeline_plugin_init (GeditModelinePlugin *plugin)
{
gedit_debug_message (DEBUG_PLUGINS, "GeditModelinePlugin initializing");
- plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
- GEDIT_TYPE_MODELINE_PLUGIN,
- GeditModelinePluginPrivate);
+ plugin->priv = gedit_modeline_plugin_get_instance_private (plugin);
}
@@ -200,8 +199,6 @@ gedit_modeline_plugin_class_init (GeditModelinePluginClass *klass)
object_class->get_property = gedit_modeline_plugin_get_property;
g_object_class_override_property (object_class, PROP_VIEW, "view");
-
- g_type_class_add_private (klass, sizeof (GeditModelinePluginPrivate));
}
static void
diff --git a/plugins/sort/gedit-sort-plugin.c b/plugins/sort/gedit-sort-plugin.c
index 4b7eff9..3967e5f 100644
--- a/plugins/sort/gedit-sort-plugin.c
+++ b/plugins/sort/gedit-sort-plugin.c
@@ -34,20 +34,9 @@
#include <gedit/gedit-app-activatable.h>
#include <gedit/gedit-window-activatable.h>
-#define GEDIT_SORT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_SORT_PLUGIN,
GeditSortPluginPrivate))
-
static void gedit_app_activatable_iface_init (GeditAppActivatableInterface *iface);
static void gedit_window_activatable_iface_init (GeditWindowActivatableInterface *iface);
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditSortPlugin,
- gedit_sort_plugin,
- PEAS_TYPE_EXTENSION_BASE,
- 0,
- G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_APP_ACTIVATABLE,
- gedit_app_activatable_iface_init)
- G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
- gedit_window_activatable_iface_init))
-
struct _GeditSortPluginPrivate
{
GeditWindow *window;
@@ -81,6 +70,16 @@ enum
PROP_APP
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditSortPlugin,
+ gedit_sort_plugin,
+ PEAS_TYPE_EXTENSION_BASE,
+ 0,
+ G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_APP_ACTIVATABLE,
+ gedit_app_activatable_iface_init)
+ G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
+ gedit_window_activatable_iface_init)
+ G_ADD_PRIVATE_DYNAMIC (GeditSortPlugin))
+
static void sort_real (GeditSortPlugin *plugin);
static void
@@ -488,9 +487,7 @@ gedit_sort_plugin_init (GeditSortPlugin *plugin)
{
gedit_debug_message (DEBUG_PLUGINS, "GeditSortPlugin initializing");
- plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
- GEDIT_TYPE_SORT_PLUGIN,
- GeditSortPluginPrivate);
+ plugin->priv = gedit_sort_plugin_get_instance_private (plugin);
}
static void
@@ -573,8 +570,6 @@ gedit_sort_plugin_class_init (GeditSortPluginClass *klass)
g_object_class_override_property (object_class, PROP_WINDOW, "window");
g_object_class_override_property (object_class, PROP_APP, "app");
-
- g_type_class_add_private (klass, sizeof (GeditSortPluginPrivate));
}
static void
diff --git a/plugins/spell/gedit-spell-plugin.c b/plugins/spell/gedit-spell-plugin.c
index dde1e13..125fbf7 100644
--- a/plugins/spell/gedit-spell-plugin.c
+++ b/plugins/spell/gedit-spell-plugin.c
@@ -52,19 +52,8 @@
#define GEDIT_AUTOMATIC_SPELL_VIEW "GeditAutomaticSpellView"
-#define GEDIT_SPELL_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_SPELL_PLUGIN, \
- GeditSpellPluginPrivate))
-
static void gedit_window_activatable_iface_init (GeditWindowActivatableInterface *iface);
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditSpellPlugin,
- gedit_spell_plugin,
- PEAS_TYPE_EXTENSION_BASE,
- 0,
- G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
- gedit_window_activatable_iface_init))
-
struct _GeditSpellPluginPrivate
{
GeditWindow *window;
@@ -93,6 +82,14 @@ enum
PROP_WINDOW
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditSpellPlugin,
+ gedit_spell_plugin,
+ PEAS_TYPE_EXTENSION_BASE,
+ 0,
+ G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
+ gedit_window_activatable_iface_init)
+ G_ADD_PRIVATE_DYNAMIC (GeditSpellPlugin))
+
static void spell_cb (GSimpleAction *action, GVariant *parameter, gpointer data);
static void set_language_cb (GSimpleAction *action, GVariant *parameter, gpointer data);
static void auto_spell_cb (GSimpleAction *action, GVariant *state, gpointer data);
@@ -112,9 +109,7 @@ gedit_spell_plugin_init (GeditSpellPlugin *plugin)
{
gedit_debug_message (DEBUG_PLUGINS, "GeditSpellPlugin initializing");
- plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
- GEDIT_TYPE_SPELL_PLUGIN,
- GeditSpellPluginPrivate);
+ plugin->priv = gedit_spell_plugin_get_instance_private (plugin);
}
static void
@@ -1174,8 +1169,6 @@ gedit_spell_plugin_class_init (GeditSpellPluginClass *klass)
check_range_id = g_quark_from_string ("CheckRangeID");
g_object_class_override_property (object_class, PROP_WINDOW, "window");
-
- g_type_class_add_private (klass, sizeof (GeditSpellPluginPrivate));
}
static void
diff --git a/plugins/time/gedit-time-plugin.c b/plugins/time/gedit-time-plugin.c
index e763ddd..45bec51 100644
--- a/plugins/time/gedit-time-plugin.c
+++ b/plugins/time/gedit-time-plugin.c
@@ -33,10 +33,6 @@
#include <gedit/gedit-app.h>
#include "gedit-time-plugin.h"
-#define GEDIT_TIME_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_TIME_PLUGIN, \
- GeditTimePluginPrivate))
-
/* gsettings keys */
#define TIME_BASE_SETTINGS "org.gnome.gedit.plugins.time"
#define PROMPT_TYPE_KEY "prompt-type"
@@ -169,7 +165,8 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditTimePlugin,
G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_WINDOW_ACTIVATABLE,
gedit_window_activatable_iface_init)
G_IMPLEMENT_INTERFACE_DYNAMIC (PEAS_GTK_TYPE_CONFIGURABLE,
- peas_gtk_configurable_iface_init))
+ peas_gtk_configurable_iface_init)
+ G_ADD_PRIVATE_DYNAMIC (GeditTimePlugin))
static void time_cb (GAction *action, GVariant *parameter, GeditTimePlugin *plugin);
@@ -178,7 +175,7 @@ gedit_time_plugin_init (GeditTimePlugin *plugin)
{
gedit_debug_message (DEBUG_PLUGINS, "GeditTimePlugin initializing");
- plugin->priv = GEDIT_TIME_PLUGIN_GET_PRIVATE (plugin);
+ plugin->priv = gedit_time_plugin_get_instance_private (plugin);
plugin->priv->settings = g_settings_new (TIME_BASE_SETTINGS);
}
@@ -1041,8 +1038,6 @@ gedit_time_plugin_class_init (GeditTimePluginClass *klass)
g_object_class_override_property (object_class, PROP_WINDOW, "window");
g_object_class_override_property (object_class, PROP_APP, "app");
-
- g_type_class_add_private (object_class, sizeof (GeditTimePluginPrivate));
}
static void
diff --git a/tools/generate-message.py b/tools/generate-message.py
index 9cb8633..04bd09f 100755
--- a/tools/generate-message.py
+++ b/tools/generate-message.py
@@ -596,9 +596,6 @@ class Message:
self._write('%s', inc)
self._write()
- self._write('#define %s_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), %s, %sPrivate))',
- self.cname_upper, self.ctype, self.cobj)
- self._write()
self._write('enum')
self._write('{')
@@ -623,10 +620,14 @@ class Message:
self._write('\t%s%s;', ct, prop.cname())
self._write('};')
- self._write()
- self._write('G_DEFINE_TYPE (%s, %s, GEDIT_TYPE_MESSAGE)', self.cobj, self.cname_lower)
- self._write()
+ self._write('''
+G_DEFINE_TYPE_EXTENDED ({0},
+ {1},
+ GEDIT_TYPE_MESSAGE,
+ 0,
+ G_ADD_PRIVATE ({0}))
+'''.format(self.cobj, self.cname_lower))
if self.needs_finalize():
self._write('static void')
@@ -719,27 +720,29 @@ class Message:
self._write('\tobject_class->get_property = %s_get_property;', self.cname_lower)
self._write('\tobject_class->set_property = %s_set_property;', self.cname_lower)
- self._write()
pp = 'g_object_class_install_property ('
prefix = '\t%s' % (' ' * len(pp),)
for prop in self.properties:
+ self._write()
+
out = str(prop)
out = ("\n%s" % (prefix,)).join(out.splitlines())
self._write('\tg_object_class_install_property (object_class,\n%s%s,', prefix, prop.prop_enum())
self._write('%s%s);', prefix, out)
+
+ if len(self.properties) == 0:
self._write()
- self._write('\tg_type_class_add_private (object_class, sizeof (%sPrivate));', self.cobj)
self._write('}')
self._write()
self._write('static void')
self._write('%s_init (%s *message)', self.cname_lower, self.cobj)
self._write('{')
- self._write('\tmessage->priv = %s_GET_PRIVATE (message);', self.cname_upper)
+ self._write('\tmessage->priv = %s_get_instance_private (message);', self.cname_lower)
self._write('}')
self.f.close()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]