Commit e1d61bb7 authored by Marco Trevisan's avatar Marco Trevisan 🎺

Merge branch 'wip/muktupavels/g-type-class-add-private' into 'master'

don't use the deprecated g_type_class_add_private

See merge request !1
parents 626b6291 f2ddae4b
...@@ -77,8 +77,7 @@ struct _WnckApplicationPrivate ...@@ -77,8 +77,7 @@ struct _WnckApplicationPrivate
guint need_emit_icon_changed : 1; guint need_emit_icon_changed : 1;
}; };
G_DEFINE_TYPE (WnckApplication, wnck_application, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE (WnckApplication, wnck_application, G_TYPE_OBJECT);
#define WNCK_APPLICATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_APPLICATION, WnckApplicationPrivate))
enum { enum {
NAME_CHANGED, NAME_CHANGED,
...@@ -109,7 +108,7 @@ _wnck_application_shutdown_all (void) ...@@ -109,7 +108,7 @@ _wnck_application_shutdown_all (void)
static void static void
wnck_application_init (WnckApplication *application) wnck_application_init (WnckApplication *application)
{ {
application->priv = WNCK_APPLICATION_GET_PRIVATE (application); application->priv = wnck_application_get_instance_private (application);
application->priv->icon_cache = _wnck_icon_cache_new (); application->priv->icon_cache = _wnck_icon_cache_new ();
_wnck_icon_cache_set_want_fallback (application->priv->icon_cache, FALSE); _wnck_icon_cache_set_want_fallback (application->priv->icon_cache, FALSE);
...@@ -120,8 +119,6 @@ wnck_application_class_init (WnckApplicationClass *klass) ...@@ -120,8 +119,6 @@ wnck_application_class_init (WnckApplicationClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckApplicationPrivate));
object_class->finalize = wnck_application_finalize; object_class->finalize = wnck_application_finalize;
/** /**
......
...@@ -58,8 +58,7 @@ struct _WnckClassGroupPrivate { ...@@ -58,8 +58,7 @@ struct _WnckClassGroupPrivate {
GdkPixbuf *mini_icon; GdkPixbuf *mini_icon;
}; };
G_DEFINE_TYPE (WnckClassGroup, wnck_class_group, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE (WnckClassGroup, wnck_class_group, G_TYPE_OBJECT);
#define WNCK_CLASS_GROUP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_CLASS_GROUP, WnckClassGroupPrivate))
/* Hash table that maps res_class strings -> WnckClassGroup instances */ /* Hash table that maps res_class strings -> WnckClassGroup instances */
static GHashTable *class_group_hash = NULL; static GHashTable *class_group_hash = NULL;
...@@ -89,8 +88,6 @@ wnck_class_group_class_init (WnckClassGroupClass *class) ...@@ -89,8 +88,6 @@ wnck_class_group_class_init (WnckClassGroupClass *class)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (class); GObjectClass *gobject_class = G_OBJECT_CLASS (class);
g_type_class_add_private (class, sizeof (WnckClassGroupPrivate));
gobject_class->finalize = wnck_class_group_finalize; gobject_class->finalize = wnck_class_group_finalize;
/** /**
...@@ -124,7 +121,7 @@ wnck_class_group_class_init (WnckClassGroupClass *class) ...@@ -124,7 +121,7 @@ wnck_class_group_class_init (WnckClassGroupClass *class)
static void static void
wnck_class_group_init (WnckClassGroup *class_group) wnck_class_group_init (WnckClassGroup *class_group)
{ {
class_group->priv = WNCK_CLASS_GROUP_GET_PRIVATE (class_group); class_group->priv = wnck_class_group_get_instance_private (class_group);
} }
static void static void
......
...@@ -88,8 +88,7 @@ struct _WnckPagerPrivate ...@@ -88,8 +88,7 @@ struct _WnckPagerPrivate
guint dnd_time; /* time of last event during dnd (for delayed workspace activation) */ guint dnd_time; /* time of last event during dnd (for delayed workspace activation) */
}; };
G_DEFINE_TYPE (WnckPager, wnck_pager, GTK_TYPE_WIDGET); G_DEFINE_TYPE_WITH_PRIVATE (WnckPager, wnck_pager, GTK_TYPE_WIDGET);
#define WNCK_PAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_PAGER, WnckPagerPrivate))
enum enum
{ {
...@@ -209,7 +208,7 @@ wnck_pager_init (WnckPager *pager) ...@@ -209,7 +208,7 @@ wnck_pager_init (WnckPager *pager)
{ (gchar *) "application/x-wnck-window-id", 0, 0} { (gchar *) "application/x-wnck-window-id", 0, 0}
}; };
pager->priv = WNCK_PAGER_GET_PRIVATE (pager); pager->priv = wnck_pager_get_instance_private (pager);
pager->priv->n_rows = 1; pager->priv->n_rows = 1;
pager->priv->display_mode = WNCK_PAGER_DISPLAY_CONTENT; pager->priv->display_mode = WNCK_PAGER_DISPLAY_CONTENT;
...@@ -239,8 +238,6 @@ wnck_pager_class_init (WnckPagerClass *klass) ...@@ -239,8 +238,6 @@ wnck_pager_class_init (WnckPagerClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckPagerPrivate));
object_class->finalize = wnck_pager_finalize; object_class->finalize = wnck_pager_finalize;
widget_class->realize = wnck_pager_realize; widget_class->realize = wnck_pager_realize;
......
...@@ -129,8 +129,7 @@ struct _WnckScreenPrivate ...@@ -129,8 +129,7 @@ struct _WnckScreenPrivate
guint need_update_wm : 1; guint need_update_wm : 1;
}; };
G_DEFINE_TYPE (WnckScreen, wnck_screen, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE (WnckScreen, wnck_screen, G_TYPE_OBJECT);
#define WNCK_SCREEN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_SCREEN, WnckScreenPrivate))
enum { enum {
ACTIVE_WINDOW_CHANGED, ACTIVE_WINDOW_CHANGED,
...@@ -196,7 +195,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; ...@@ -196,7 +195,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void static void
wnck_screen_init (WnckScreen *screen) wnck_screen_init (WnckScreen *screen)
{ {
screen->priv = WNCK_SCREEN_GET_PRIVATE (screen); screen->priv = wnck_screen_get_instance_private (screen);
screen->priv->number = -1; screen->priv->number = -1;
screen->priv->starting_corner = WNCK_LAYOUT_CORNER_TOPLEFT; screen->priv->starting_corner = WNCK_LAYOUT_CORNER_TOPLEFT;
...@@ -211,8 +210,6 @@ wnck_screen_class_init (WnckScreenClass *klass) ...@@ -211,8 +210,6 @@ wnck_screen_class_init (WnckScreenClass *klass)
_wnck_init (); _wnck_init ();
g_type_class_add_private (klass, sizeof (WnckScreenPrivate));
object_class->finalize = wnck_screen_finalize; object_class->finalize = wnck_screen_finalize;
/** /**
......
...@@ -61,8 +61,7 @@ struct _WnckSelectorPrivate { ...@@ -61,8 +61,7 @@ struct _WnckSelectorPrivate {
GHashTable *window_hash; GHashTable *window_hash;
}; };
G_DEFINE_TYPE (WnckSelector, wnck_selector, GTK_TYPE_MENU_BAR); G_DEFINE_TYPE_WITH_PRIVATE (WnckSelector, wnck_selector, GTK_TYPE_MENU_BAR);
#define WNCK_SELECTOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_SELECTOR, WnckSelectorPrivate))
static GObject *wnck_selector_constructor (GType type, static GObject *wnck_selector_constructor (GType type,
guint n_construct_properties, guint n_construct_properties,
...@@ -1148,7 +1147,7 @@ wnck_selector_init (WnckSelector *selector) ...@@ -1148,7 +1147,7 @@ wnck_selector_init (WnckSelector *selector)
atk_object_set_name (atk_obj, _("Window Selector")); atk_object_set_name (atk_obj, _("Window Selector"));
atk_object_set_description (atk_obj, _("Tool to switch between windows")); atk_object_set_description (atk_obj, _("Tool to switch between windows"));
selector->priv = WNCK_SELECTOR_GET_PRIVATE (selector); selector->priv = wnck_selector_get_instance_private (selector);
gtk_widget_add_events (GTK_WIDGET (selector), GDK_SCROLL_MASK); gtk_widget_add_events (GTK_WIDGET (selector), GDK_SCROLL_MASK);
} }
...@@ -1159,8 +1158,6 @@ wnck_selector_class_init (WnckSelectorClass *klass) ...@@ -1159,8 +1158,6 @@ wnck_selector_class_init (WnckSelectorClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckSelectorPrivate));
object_class->constructor = wnck_selector_constructor; object_class->constructor = wnck_selector_constructor;
object_class->dispose = wnck_selector_dispose; object_class->dispose = wnck_selector_dispose;
object_class->finalize = wnck_selector_finalize; object_class->finalize = wnck_selector_finalize;
......
...@@ -238,8 +238,7 @@ struct _WnckTasklistPrivate ...@@ -238,8 +238,7 @@ struct _WnckTasklistPrivate
static GType wnck_task_get_type (void); static GType wnck_task_get_type (void);
G_DEFINE_TYPE (WnckTask, wnck_task, G_TYPE_OBJECT); G_DEFINE_TYPE (WnckTask, wnck_task, G_TYPE_OBJECT);
G_DEFINE_TYPE (WnckTasklist, wnck_tasklist, GTK_TYPE_CONTAINER); G_DEFINE_TYPE_WITH_PRIVATE (WnckTasklist, wnck_tasklist, GTK_TYPE_CONTAINER);
#define WNCK_TASKLIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_TASKLIST, WnckTasklistPrivate))
static void wnck_task_finalize (GObject *object); static void wnck_task_finalize (GObject *object);
...@@ -580,7 +579,7 @@ wnck_tasklist_init (WnckTasklist *tasklist) ...@@ -580,7 +579,7 @@ wnck_tasklist_init (WnckTasklist *tasklist)
gtk_widget_set_has_window (widget, FALSE); gtk_widget_set_has_window (widget, FALSE);
tasklist->priv = WNCK_TASKLIST_GET_PRIVATE (tasklist); tasklist->priv = wnck_tasklist_get_instance_private (tasklist);
tasklist->priv->class_group_hash = g_hash_table_new (NULL, NULL); tasklist->priv->class_group_hash = g_hash_table_new (NULL, NULL);
tasklist->priv->win_hash = g_hash_table_new (NULL, NULL); tasklist->priv->win_hash = g_hash_table_new (NULL, NULL);
...@@ -612,8 +611,6 @@ wnck_tasklist_class_init (WnckTasklistClass *klass) ...@@ -612,8 +611,6 @@ wnck_tasklist_class_init (WnckTasklistClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckTasklistPrivate));
object_class->finalize = wnck_tasklist_finalize; object_class->finalize = wnck_tasklist_finalize;
widget_class->get_preferred_width = wnck_tasklist_get_preferred_width; widget_class->get_preferred_width = wnck_tasklist_get_preferred_width;
......
...@@ -97,8 +97,7 @@ enum { ...@@ -97,8 +97,7 @@ enum {
PROP_WINDOW PROP_WINDOW
}; };
G_DEFINE_TYPE (WnckActionMenu, wnck_action_menu, GTK_TYPE_MENU); G_DEFINE_TYPE_WITH_PRIVATE (WnckActionMenu, wnck_action_menu, GTK_TYPE_MENU);
#define WNCK_ACTION_MENU_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_ACTION_MENU, WnckActionMenuPrivate))
static void wnck_action_menu_dispose (GObject *object); static void wnck_action_menu_dispose (GObject *object);
...@@ -925,7 +924,7 @@ wnck_action_menu_set_property (GObject *object, ...@@ -925,7 +924,7 @@ wnck_action_menu_set_property (GObject *object,
static void static void
wnck_action_menu_init (WnckActionMenu *menu) wnck_action_menu_init (WnckActionMenu *menu)
{ {
menu->priv = WNCK_ACTION_MENU_GET_PRIVATE (menu); menu->priv = wnck_action_menu_get_instance_private (menu);
menu->priv->window = NULL; menu->priv->window = NULL;
menu->priv->minimize_item = NULL; menu->priv->minimize_item = NULL;
...@@ -1109,8 +1108,6 @@ wnck_action_menu_class_init (WnckActionMenuClass *klass) ...@@ -1109,8 +1108,6 @@ wnck_action_menu_class_init (WnckActionMenuClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckActionMenuPrivate));
object_class->constructor = wnck_action_menu_constructor; object_class->constructor = wnck_action_menu_constructor;
object_class->get_property = wnck_action_menu_get_property; object_class->get_property = wnck_action_menu_get_property;
object_class->set_property = wnck_action_menu_set_property; object_class->set_property = wnck_action_menu_set_property;
......
...@@ -166,8 +166,7 @@ struct _WnckWindowPrivate ...@@ -166,8 +166,7 @@ struct _WnckWindowPrivate
guint need_emit_type_changed : 1; guint need_emit_type_changed : 1;
}; };
G_DEFINE_TYPE (WnckWindow, wnck_window, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE (WnckWindow, wnck_window, G_TYPE_OBJECT);
#define WNCK_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_WINDOW, WnckWindowPrivate))
enum { enum {
NAME_CHANGED, NAME_CHANGED,
...@@ -232,7 +231,7 @@ _wnck_window_shutdown_all (void) ...@@ -232,7 +231,7 @@ _wnck_window_shutdown_all (void)
static void static void
wnck_window_init (WnckWindow *window) wnck_window_init (WnckWindow *window)
{ {
window->priv = WNCK_WINDOW_GET_PRIVATE (window); window->priv = wnck_window_get_instance_private (window);
window->priv->icon_cache = _wnck_icon_cache_new (); window->priv->icon_cache = _wnck_icon_cache_new ();
window->priv->icon_geometry.width = -1; /* invalid cached value */ window->priv->icon_geometry.width = -1; /* invalid cached value */
...@@ -248,8 +247,6 @@ wnck_window_class_init (WnckWindowClass *klass) ...@@ -248,8 +247,6 @@ wnck_window_class_init (WnckWindowClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckWindowPrivate));
object_class->finalize = wnck_window_finalize; object_class->finalize = wnck_window_finalize;
/** /**
......
...@@ -72,8 +72,7 @@ struct _WnckWorkspacePrivate ...@@ -72,8 +72,7 @@ struct _WnckWorkspacePrivate
gboolean is_virtual; gboolean is_virtual;
}; };
G_DEFINE_TYPE (WnckWorkspace, wnck_workspace, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE (WnckWorkspace, wnck_workspace, G_TYPE_OBJECT);
#define WNCK_WORKSPACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_WORKSPACE, WnckWorkspacePrivate))
enum { enum {
NAME_CHANGED, NAME_CHANGED,
...@@ -89,7 +88,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; ...@@ -89,7 +88,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void static void
wnck_workspace_init (WnckWorkspace *workspace) wnck_workspace_init (WnckWorkspace *workspace)
{ {
workspace->priv = WNCK_WORKSPACE_GET_PRIVATE (workspace); workspace->priv = wnck_workspace_get_instance_private (workspace);
workspace->priv->number = -1; workspace->priv->number = -1;
} }
...@@ -99,8 +98,6 @@ wnck_workspace_class_init (WnckWorkspaceClass *klass) ...@@ -99,8 +98,6 @@ wnck_workspace_class_init (WnckWorkspaceClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckWorkspacePrivate));
object_class->finalize = wnck_workspace_finalize; object_class->finalize = wnck_workspace_finalize;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment