Commit f2ddae4b authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

don't use the deprecated g_type_class_add_private

parent 626b6291
......@@ -77,8 +77,7 @@ struct _WnckApplicationPrivate
guint need_emit_icon_changed : 1;
};
G_DEFINE_TYPE (WnckApplication, wnck_application, G_TYPE_OBJECT);
#define WNCK_APPLICATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_APPLICATION, WnckApplicationPrivate))
G_DEFINE_TYPE_WITH_PRIVATE (WnckApplication, wnck_application, G_TYPE_OBJECT);
enum {
NAME_CHANGED,
......@@ -109,7 +108,7 @@ _wnck_application_shutdown_all (void)
static void
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 ();
_wnck_icon_cache_set_want_fallback (application->priv->icon_cache, FALSE);
......@@ -120,8 +119,6 @@ wnck_application_class_init (WnckApplicationClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckApplicationPrivate));
object_class->finalize = wnck_application_finalize;
/**
......
......@@ -58,8 +58,7 @@ struct _WnckClassGroupPrivate {
GdkPixbuf *mini_icon;
};
G_DEFINE_TYPE (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))
G_DEFINE_TYPE_WITH_PRIVATE (WnckClassGroup, wnck_class_group, G_TYPE_OBJECT);
/* Hash table that maps res_class strings -> WnckClassGroup instances */
static GHashTable *class_group_hash = NULL;
......@@ -89,8 +88,6 @@ wnck_class_group_class_init (WnckClassGroupClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
g_type_class_add_private (class, sizeof (WnckClassGroupPrivate));
gobject_class->finalize = wnck_class_group_finalize;
/**
......@@ -124,7 +121,7 @@ wnck_class_group_class_init (WnckClassGroupClass *class)
static void
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
......
......@@ -88,8 +88,7 @@ struct _WnckPagerPrivate
guint dnd_time; /* time of last event during dnd (for delayed workspace activation) */
};
G_DEFINE_TYPE (WnckPager, wnck_pager, GTK_TYPE_WIDGET);
#define WNCK_PAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_PAGER, WnckPagerPrivate))
G_DEFINE_TYPE_WITH_PRIVATE (WnckPager, wnck_pager, GTK_TYPE_WIDGET);
enum
{
......@@ -209,7 +208,7 @@ wnck_pager_init (WnckPager *pager)
{ (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->display_mode = WNCK_PAGER_DISPLAY_CONTENT;
......@@ -239,8 +238,6 @@ wnck_pager_class_init (WnckPagerClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckPagerPrivate));
object_class->finalize = wnck_pager_finalize;
widget_class->realize = wnck_pager_realize;
......
......@@ -129,8 +129,7 @@ struct _WnckScreenPrivate
guint need_update_wm : 1;
};
G_DEFINE_TYPE (WnckScreen, wnck_screen, G_TYPE_OBJECT);
#define WNCK_SCREEN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_SCREEN, WnckScreenPrivate))
G_DEFINE_TYPE_WITH_PRIVATE (WnckScreen, wnck_screen, G_TYPE_OBJECT);
enum {
ACTIVE_WINDOW_CHANGED,
......@@ -196,7 +195,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void
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->starting_corner = WNCK_LAYOUT_CORNER_TOPLEFT;
......@@ -211,8 +210,6 @@ wnck_screen_class_init (WnckScreenClass *klass)
_wnck_init ();
g_type_class_add_private (klass, sizeof (WnckScreenPrivate));
object_class->finalize = wnck_screen_finalize;
/**
......
......@@ -61,8 +61,7 @@ struct _WnckSelectorPrivate {
GHashTable *window_hash;
};
G_DEFINE_TYPE (WnckSelector, wnck_selector, GTK_TYPE_MENU_BAR);
#define WNCK_SELECTOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_SELECTOR, WnckSelectorPrivate))
G_DEFINE_TYPE_WITH_PRIVATE (WnckSelector, wnck_selector, GTK_TYPE_MENU_BAR);
static GObject *wnck_selector_constructor (GType type,
guint n_construct_properties,
......@@ -1148,7 +1147,7 @@ wnck_selector_init (WnckSelector *selector)
atk_object_set_name (atk_obj, _("Window Selector"));
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);
}
......@@ -1159,8 +1158,6 @@ wnck_selector_class_init (WnckSelectorClass *klass)
GObjectClass *object_class = G_OBJECT_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->dispose = wnck_selector_dispose;
object_class->finalize = wnck_selector_finalize;
......
......@@ -238,8 +238,7 @@ struct _WnckTasklistPrivate
static GType wnck_task_get_type (void);
G_DEFINE_TYPE (WnckTask, wnck_task, G_TYPE_OBJECT);
G_DEFINE_TYPE (WnckTasklist, wnck_tasklist, GTK_TYPE_CONTAINER);
#define WNCK_TASKLIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_TASKLIST, WnckTasklistPrivate))
G_DEFINE_TYPE_WITH_PRIVATE (WnckTasklist, wnck_tasklist, GTK_TYPE_CONTAINER);
static void wnck_task_finalize (GObject *object);
......@@ -580,7 +579,7 @@ wnck_tasklist_init (WnckTasklist *tasklist)
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->win_hash = g_hash_table_new (NULL, NULL);
......@@ -612,8 +611,6 @@ wnck_tasklist_class_init (WnckTasklistClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckTasklistPrivate));
object_class->finalize = wnck_tasklist_finalize;
widget_class->get_preferred_width = wnck_tasklist_get_preferred_width;
......
......@@ -97,8 +97,7 @@ enum {
PROP_WINDOW
};
G_DEFINE_TYPE (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))
G_DEFINE_TYPE_WITH_PRIVATE (WnckActionMenu, wnck_action_menu, GTK_TYPE_MENU);
static void wnck_action_menu_dispose (GObject *object);
......@@ -925,7 +924,7 @@ wnck_action_menu_set_property (GObject *object,
static void
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->minimize_item = NULL;
......@@ -1109,8 +1108,6 @@ wnck_action_menu_class_init (WnckActionMenuClass *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->get_property = wnck_action_menu_get_property;
object_class->set_property = wnck_action_menu_set_property;
......
......@@ -166,8 +166,7 @@ struct _WnckWindowPrivate
guint need_emit_type_changed : 1;
};
G_DEFINE_TYPE (WnckWindow, wnck_window, G_TYPE_OBJECT);
#define WNCK_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_WINDOW, WnckWindowPrivate))
G_DEFINE_TYPE_WITH_PRIVATE (WnckWindow, wnck_window, G_TYPE_OBJECT);
enum {
NAME_CHANGED,
......@@ -232,7 +231,7 @@ _wnck_window_shutdown_all (void)
static void
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_geometry.width = -1; /* invalid cached value */
......@@ -248,8 +247,6 @@ wnck_window_class_init (WnckWindowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckWindowPrivate));
object_class->finalize = wnck_window_finalize;
/**
......
......@@ -72,8 +72,7 @@ struct _WnckWorkspacePrivate
gboolean is_virtual;
};
G_DEFINE_TYPE (WnckWorkspace, wnck_workspace, G_TYPE_OBJECT);
#define WNCK_WORKSPACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_WORKSPACE, WnckWorkspacePrivate))
G_DEFINE_TYPE_WITH_PRIVATE (WnckWorkspace, wnck_workspace, G_TYPE_OBJECT);
enum {
NAME_CHANGED,
......@@ -89,7 +88,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void
wnck_workspace_init (WnckWorkspace *workspace)
{
workspace->priv = WNCK_WORKSPACE_GET_PRIVATE (workspace);
workspace->priv = wnck_workspace_get_instance_private (workspace);
workspace->priv->number = -1;
}
......@@ -99,8 +98,6 @@ wnck_workspace_class_init (WnckWorkspaceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (WnckWorkspacePrivate));
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