[Xfce4-commits] [apps/xfdashboard] 05/09: plugins: update for g_type_class_add_private() deprecation
noreply at xfce.org
noreply at xfce.org
Wed Aug 21 15:20:41 CEST 2019
This is an automated email from the git hooks/post-receive script.
n o m a d p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfdashboard.
commit 7cade62603e2981fc9bde05b5b7fd0d34f5302f2
Author: Stephan Haller <nomad at froevel.de>
Date: Wed Aug 21 14:28:21 2019 +0200
plugins: update for g_type_class_add_private() deprecation
---
plugins/clock-view/clock-view-settings.c | 25 ++++++++-----------
plugins/clock-view/clock-view.c | 28 +++++++++-------------
.../gnome-shell-search-provider.c | 25 ++++++++-----------
plugins/hot-corner/hot-corner-settings.c | 25 ++++++++-----------
plugins/hot-corner/hot-corner.c | 24 +++++++------------
.../middle-click-window-close.c | 24 +++++++------------
6 files changed, 59 insertions(+), 92 deletions(-)
diff --git a/plugins/clock-view/clock-view-settings.c b/plugins/clock-view/clock-view-settings.c
index 26c7c5d..7bcd659 100644
--- a/plugins/clock-view/clock-view-settings.c
+++ b/plugins/clock-view/clock-view-settings.c
@@ -34,17 +34,6 @@
/* Define this class in GObject system */
-G_DEFINE_DYNAMIC_TYPE(XfdashboardClockViewSettings,
- xfdashboard_clock_view_settings,
- G_TYPE_OBJECT)
-
-/* Define this class in this plugin */
-XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_clock_view_settings);
-
-/* Private structure - access only by public API if needed */
-#define XFDASHBOARD_CLOCK_VIEW_SETTINGS_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), XFDASHBOARD_TYPE_CLOCK_VIEW_SETTINGS, XfdashboardClockViewSettingsPrivate))
-
struct _XfdashboardClockViewSettingsPrivate
{
/* Properties related */
@@ -61,6 +50,15 @@ struct _XfdashboardClockViewSettingsPrivate
guint xfconfBackgroundColorBindingID;
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(XfdashboardClockViewSettings,
+ xfdashboard_clock_view_settings,
+ G_TYPE_OBJECT,
+ 0,
+ G_ADD_PRIVATE_DYNAMIC(XfdashboardClockViewSettings))
+
+/* Define this class in this plugin */
+XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_clock_view_settings);
+
/* Properties */
enum
{
@@ -224,9 +222,6 @@ void xfdashboard_clock_view_settings_class_init(XfdashboardClockViewSettingsClas
gobjectClass->set_property=_xfdashboard_clock_view_settings_set_property;
gobjectClass->get_property=_xfdashboard_clock_view_settings_get_property;
- /* Set up private structure */
- g_type_class_add_private(klass, sizeof(XfdashboardClockViewSettingsPrivate));
-
/* Define properties */
XfdashboardClockViewSettingsProperties[PROP_HOUR_COLOR]=
clutter_param_spec_color("hour-color",
@@ -271,7 +266,7 @@ void xfdashboard_clock_view_settings_init(XfdashboardClockViewSettings *self)
{
XfdashboardClockViewSettingsPrivate *priv;
- self->priv=priv=XFDASHBOARD_CLOCK_VIEW_SETTINGS_GET_PRIVATE(self);
+ self->priv=priv=xfdashboard_clock_view_settings_get_instance_private(self);
/* Set up default values */
priv->hourColor=clutter_color_copy(CLUTTER_COLOR_LightChameleon);
diff --git a/plugins/clock-view/clock-view.c b/plugins/clock-view/clock-view.c
index adb8fa8..2bf516e 100644
--- a/plugins/clock-view/clock-view.c
+++ b/plugins/clock-view/clock-view.c
@@ -36,17 +36,6 @@
/* Define this class in GObject system */
-G_DEFINE_DYNAMIC_TYPE(XfdashboardClockView,
- xfdashboard_clock_view,
- XFDASHBOARD_TYPE_VIEW)
-
-/* Define this class in this plugin */
-XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_clock_view);
-
-/* Private structure - access only by public API if needed */
-#define XFDASHBOARD_CLOCK_VIEW_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), XFDASHBOARD_TYPE_CLOCK_VIEW, XfdashboardClockViewPrivate))
-
struct _XfdashboardClockViewPrivate
{
/* Instance related */
@@ -57,6 +46,14 @@ struct _XfdashboardClockViewPrivate
XfdashboardClockViewSettings *settings;
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(XfdashboardClockView,
+ xfdashboard_clock_view,
+ XFDASHBOARD_TYPE_VIEW,
+ 0,
+ G_ADD_PRIVATE_DYNAMIC(XfdashboardClockView))
+
+/* Define this class in this plugin */
+XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_clock_view);
/* IMPLEMENTATION: Private variables and methods */
@@ -258,7 +255,7 @@ static void _xfdashboard_clock_view_dispose(GObject *inObject)
* Override functions in parent classes and define properties
* and signals
*/
-void xfdashboard_clock_view_class_init(XfdashboardClockViewClass *klass)
+static void xfdashboard_clock_view_class_init(XfdashboardClockViewClass *klass)
{
XfdashboardViewClass *viewClass=XFDASHBOARD_VIEW_CLASS(klass);
ClutterActorClass *actorClass=CLUTTER_ACTOR_CLASS(klass);
@@ -271,13 +268,10 @@ void xfdashboard_clock_view_class_init(XfdashboardClockViewClass *klass)
viewClass->activated=_xfdashboard_clock_view_activated;
viewClass->deactivating=_xfdashboard_clock_view_deactivating;
-
- /* Set up private structure */
- g_type_class_add_private(klass, sizeof(XfdashboardClockViewPrivate));
}
/* Class finalization */
-void xfdashboard_clock_view_class_finalize(XfdashboardClockViewClass *klass)
+static void xfdashboard_clock_view_class_finalize(XfdashboardClockViewClass *klass)
{
}
@@ -288,7 +282,7 @@ void xfdashboard_clock_view_init(XfdashboardClockView *self)
{
XfdashboardClockViewPrivate *priv;
- self->priv=priv=XFDASHBOARD_CLOCK_VIEW_GET_PRIVATE(self);
+ self->priv=priv=xfdashboard_clock_view_get_instance_private(self);
/* Set up default values */
priv->timeoutID=0;
diff --git a/plugins/gnome-shell-search-provider/gnome-shell-search-provider.c b/plugins/gnome-shell-search-provider/gnome-shell-search-provider.c
index 63f6669..cf8b7bb 100644
--- a/plugins/gnome-shell-search-provider/gnome-shell-search-provider.c
+++ b/plugins/gnome-shell-search-provider/gnome-shell-search-provider.c
@@ -33,17 +33,6 @@
/* Define this class in GObject system */
-G_DEFINE_DYNAMIC_TYPE(XfdashboardGnomeShellSearchProvider,
- xfdashboard_gnome_shell_search_provider,
- XFDASHBOARD_TYPE_SEARCH_PROVIDER)
-
-/* Define this class in this plugin */
-XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_gnome_shell_search_provider);
-
-/* Private structure - access only by public API if needed */
-#define XFDASHBOARD_GNOME_SHELL_SEARCH_PROVIDER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), XFDASHBOARD_TYPE_GNOME_SHELL_SEARCH_PROVIDER, XfdashboardGnomeShellSearchProviderPrivate))
-
struct _XfdashboardGnomeShellSearchProviderPrivate
{
/* Instance related */
@@ -60,6 +49,15 @@ struct _XfdashboardGnomeShellSearchProviderPrivate
gchar *providerIcon;
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(XfdashboardGnomeShellSearchProvider,
+ xfdashboard_gnome_shell_search_provider,
+ XFDASHBOARD_TYPE_SEARCH_PROVIDER,
+ 0,
+ G_ADD_PRIVATE_DYNAMIC(XfdashboardGnomeShellSearchProvider))
+
+/* Define this class in this plugin */
+XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_gnome_shell_search_provider);
+
/* IMPLEMENTATION: Private variables and methods */
#define XFDASHBOARD_GNOME_SHELL_SEARCH_PROVIDER_KEYFILE_GROUP "Shell Search Provider"
@@ -1069,9 +1067,6 @@ void xfdashboard_gnome_shell_search_provider_class_init(XfdashboardGnomeShellSea
providerClass->create_result_actor=_xfdashboard_gnome_shell_search_provider_create_result_actor;
providerClass->activate_result=_xfdashboard_gnome_shell_search_provider_activate_result;
providerClass->launch_search=_xfdashboard_gnome_shell_search_provider_launch_search;
-
- /* Set up private structure */
- g_type_class_add_private(klass, sizeof(XfdashboardGnomeShellSearchProviderPrivate));
}
/* Class finalization */
@@ -1086,7 +1081,7 @@ void xfdashboard_gnome_shell_search_provider_init(XfdashboardGnomeShellSearchPro
{
XfdashboardGnomeShellSearchProviderPrivate *priv;
- self->priv=priv=XFDASHBOARD_GNOME_SHELL_SEARCH_PROVIDER_GET_PRIVATE(self);
+ self->priv=priv=xfdashboard_gnome_shell_search_provider_get_instance_private(self);
/* Set up default values */
priv->gnomeShellID=NULL;
diff --git a/plugins/hot-corner/hot-corner-settings.c b/plugins/hot-corner/hot-corner-settings.c
index 84c3a0b..8b32e5f 100644
--- a/plugins/hot-corner/hot-corner-settings.c
+++ b/plugins/hot-corner/hot-corner-settings.c
@@ -34,17 +34,6 @@
/* Define this class in GObject system */
-G_DEFINE_DYNAMIC_TYPE(XfdashboardHotCornerSettings,
- xfdashboard_hot_corner_settings,
- G_TYPE_OBJECT)
-
-/* Define this class in this plugin */
-XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_hot_corner_settings);
-
-/* Private structure - access only by public API if needed */
-#define XFDASHBOARD_HOT_CORNER_SETTINGS_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), XFDASHBOARD_TYPE_HOT_CORNER_SETTINGS, XfdashboardHotCornerSettingsPrivate))
-
struct _XfdashboardHotCornerSettingsPrivate
{
/* Properties related */
@@ -59,6 +48,15 @@ struct _XfdashboardHotCornerSettingsPrivate
guint xfconfActivationDurationBindingID;
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(XfdashboardHotCornerSettings,
+ xfdashboard_hot_corner_settings,
+ G_TYPE_OBJECT,
+ 0,
+ G_ADD_PRIVATE_DYNAMIC(XfdashboardHotCornerSettings))
+
+/* Define this class in this plugin */
+XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_hot_corner_settings);
+
/* Properties */
enum
{
@@ -227,9 +225,6 @@ void xfdashboard_hot_corner_settings_class_init(XfdashboardHotCornerSettingsClas
gobjectClass->set_property=_xfdashboard_hot_corner_settings_set_property;
gobjectClass->get_property=_xfdashboard_hot_corner_settings_get_property;
- /* Set up private structure */
- g_type_class_add_private(klass, sizeof(XfdashboardHotCornerSettingsPrivate));
-
/* Define properties */
XfdashboardHotCornerSettingsProperties[PROP_ACTIVATION_CORNER]=
g_param_spec_enum("activation-corner",
@@ -270,7 +265,7 @@ void xfdashboard_hot_corner_settings_init(XfdashboardHotCornerSettings *self)
{
XfdashboardHotCornerSettingsPrivate *priv;
- self->priv=priv=XFDASHBOARD_HOT_CORNER_SETTINGS_GET_PRIVATE(self);
+ self->priv=priv=xfdashboard_hot_corner_settings_get_instance_private(self);
/* Set up default values */
priv->activationCorner=DEFAULT_ACTIVATION_CORNER;
diff --git a/plugins/hot-corner/hot-corner.c b/plugins/hot-corner/hot-corner.c
index fe79791..7d44c5e 100644
--- a/plugins/hot-corner/hot-corner.c
+++ b/plugins/hot-corner/hot-corner.c
@@ -36,17 +36,6 @@
/* Define this class in GObject system */
-G_DEFINE_DYNAMIC_TYPE(XfdashboardHotCorner,
- xfdashboard_hot_corner,
- G_TYPE_OBJECT)
-
-/* Define this class in this plugin */
-XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_hot_corner);
-
-/* Private structure - access only by public API if needed */
-#define XFDASHBOARD_HOT_CORNER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), XFDASHBOARD_TYPE_HOT_CORNER, XfdashboardHotCornerPrivate))
-
struct _XfdashboardHotCornerPrivate
{
/* Instance related */
@@ -66,6 +55,14 @@ struct _XfdashboardHotCornerPrivate
XfdashboardHotCornerSettings *settings;
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(XfdashboardHotCorner,
+ xfdashboard_hot_corner,
+ G_TYPE_OBJECT,
+ 0,
+ G_ADD_PRIVATE_DYNAMIC(XfdashboardHotCorner))
+
+/* Define this class in this plugin */
+XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_hot_corner);
/* IMPLEMENTATION: Enum XFDASHBOARD_TYPE_HOT_CORNER_ACTIVATION_CORNER */
@@ -338,9 +335,6 @@ void xfdashboard_hot_corner_class_init(XfdashboardHotCornerClass *klass)
/* Override functions */
gobjectClass->dispose=_xfdashboard_hot_corner_dispose;
-
- /* Set up private structure */
- g_type_class_add_private(klass, sizeof(XfdashboardHotCornerPrivate));
}
/* Class finalization */
@@ -357,7 +351,7 @@ void xfdashboard_hot_corner_init(XfdashboardHotCorner *self)
GdkScreen *screen;
GdkDisplay *display;
- self->priv=priv=XFDASHBOARD_HOT_CORNER_GET_PRIVATE(self);
+ self->priv=priv=xfdashboard_hot_corner_get_instance_private(self);
/* Set up default values */
priv->application=xfdashboard_application_get_default();
diff --git a/plugins/middle-click-window-close/middle-click-window-close.c b/plugins/middle-click-window-close/middle-click-window-close.c
index d5aad9d..5d38b71 100644
--- a/plugins/middle-click-window-close/middle-click-window-close.c
+++ b/plugins/middle-click-window-close/middle-click-window-close.c
@@ -34,17 +34,6 @@
/* Define this class in GObject system */
-G_DEFINE_DYNAMIC_TYPE(XfdashboardMiddleClickWindowClose,
- xfdashboard_middle_click_window_close,
- G_TYPE_OBJECT)
-
-/* Define this class in this plugin */
-XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_middle_click_window_close);
-
-/* Private structure - access only by public API if needed */
-#define XFDASHBOARD_MIDDLE_CLICK_WINDOW_CLOSE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), XFDASHBOARD_TYPE_MIDDLE_CLICK_WINDOW_CLOSE, XfdashboardMiddleClickWindowClosePrivate))
-
struct _XfdashboardMiddleClickWindowClosePrivate
{
/* Instance related */
@@ -55,6 +44,14 @@ struct _XfdashboardMiddleClickWindowClosePrivate
XfdashboardCssSelector *liveWindowSelector;
};
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(XfdashboardMiddleClickWindowClose,
+ xfdashboard_middle_click_window_close,
+ G_TYPE_OBJECT,
+ 0,
+ G_ADD_PRIVATE_DYNAMIC(XfdashboardMiddleClickWindowClose))
+
+/* Define this class in this plugin */
+XFDASHBOARD_DEFINE_PLUGIN_TYPE(xfdashboard_middle_click_window_close);
/* IMPLEMENTATION: Private variables and methods */
#define DEFAULT_WINDOW_CLOSE_BUTTON XFDASHBOARD_CLICK_ACTION_MIDDLE_BUTTON
@@ -251,9 +248,6 @@ void xfdashboard_middle_click_window_close_class_init(XfdashboardMiddleClickWind
/* Override functions */
gobjectClass->dispose=_xfdashboard_middle_click_window_close_dispose;
-
- /* Set up private structure */
- g_type_class_add_private(klass, sizeof(XfdashboardMiddleClickWindowClosePrivate));
}
/* Class finalization */
@@ -268,7 +262,7 @@ void xfdashboard_middle_click_window_close_init(XfdashboardMiddleClickWindowClos
{
XfdashboardMiddleClickWindowClosePrivate *priv;
- self->priv=priv=XFDASHBOARD_MIDDLE_CLICK_WINDOW_CLOSE_GET_PRIVATE(self);
+ self->priv=priv=xfdashboard_middle_click_window_close_get_instance_private(self);
/* Set up default values */
priv->stage=xfdashboard_application_get_stage(NULL);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list