summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/configuration.c4
-rw-r--r--common/configuration.h2
-rw-r--r--common/user-list.c8
-rw-r--r--liblightdm-gobject/greeter.c4
-rw-r--r--liblightdm-gobject/language.c4
-rw-r--r--liblightdm-gobject/layout.c4
-rw-r--r--liblightdm-gobject/session.c4
-rw-r--r--liblightdm-gobject/user.c8
-rw-r--r--src/accounts.c4
-rw-r--r--src/display-manager-service.c4
-rw-r--r--src/display-manager.c4
-rw-r--r--src/display-server.c3
-rw-r--r--src/greeter-session.c4
-rw-r--r--src/greeter-socket.c4
-rw-r--r--src/greeter.c4
-rw-r--r--src/login1.c8
-rw-r--r--src/process.c4
-rw-r--r--src/seat-local.c4
-rw-r--r--src/seat-unity.c4
-rw-r--r--src/seat-xdmcp-session.c4
-rw-r--r--src/seat-xvnc.c6
-rw-r--r--src/seat.c3
-rw-r--r--src/session-config.c4
-rw-r--r--src/session.c3
-rw-r--r--src/shared-data-manager.c4
-rw-r--r--src/unity-system-compositor.c3
-rw-r--r--src/vnc-server.c4
-rw-r--r--src/wayland-session.c4
-rw-r--r--src/x-authority.c4
-rw-r--r--src/x-server-local.c3
-rw-r--r--src/x-server-remote.c4
-rw-r--r--src/x-server-xmir.c4
-rw-r--r--src/x-server-xvnc.c4
-rw-r--r--src/x-server.c4
-rw-r--r--src/xdmcp-server.c4
-rw-r--r--src/xdmcp-session.c4
-rw-r--r--tests/src/x-authority.c6
-rw-r--r--tests/src/x-server.c12
-rw-r--r--tests/src/xdmcp-client.c7
39 files changed, 52 insertions, 124 deletions
diff --git a/common/configuration.c b/common/configuration.c
index a1b30dad..db699c44 100644
--- a/common/configuration.c
+++ b/common/configuration.c
@@ -32,7 +32,7 @@ typedef enum
KEY_DEPRECATED
} KeyStatus;
-G_DEFINE_TYPE (Configuration, config, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (Configuration, config, G_TYPE_OBJECT)
static Configuration *configuration_instance = NULL;
@@ -429,6 +429,4 @@ config_class_init (ConfigurationClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = config_finalize;
-
- g_type_class_add_private (klass, sizeof (ConfigurationPrivate));
}
diff --git a/common/configuration.h b/common/configuration.h
index 56005eff..fe7df901 100644
--- a/common/configuration.h
+++ b/common/configuration.h
@@ -23,7 +23,7 @@ typedef struct ConfigurationPrivate ConfigurationPrivate;
typedef struct
{
- GObject parent_instance;
+ GObject parent_instance;
ConfigurationPrivate *priv;
} Configuration;
diff --git a/common/user-list.c b/common/user-list.c
index ca48b4ba..ffd8646c 100644
--- a/common/user-list.c
+++ b/common/user-list.c
@@ -153,8 +153,8 @@ typedef struct
GObjectClass parent_class;
} CommonSessionClass;
-G_DEFINE_TYPE (CommonUserList, common_user_list, G_TYPE_OBJECT)
-G_DEFINE_TYPE (CommonUser, common_user, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (CommonUserList, common_user_list, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (CommonUser, common_user, G_TYPE_OBJECT)
#define COMMON_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), common_session_get_type (), CommonSession))
GType common_session_get_type (void);
G_DEFINE_TYPE (CommonSession, common_session, G_TYPE_OBJECT)
@@ -1058,8 +1058,6 @@ common_user_list_class_init (CommonUserListClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CommonUserListPrivate));
-
object_class->set_property = common_user_list_set_property;
object_class->get_property = common_user_list_get_property;
object_class->finalize = common_user_list_finalize;
@@ -1582,8 +1580,6 @@ common_user_class_init (CommonUserClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CommonUserPrivate));
-
object_class->set_property = common_user_set_property;
object_class->get_property = common_user_get_property;
object_class->finalize = common_user_finalize;
diff --git a/liblightdm-gobject/greeter.c b/liblightdm-gobject/greeter.c
index 21b43739..fd1763c0 100644
--- a/liblightdm-gobject/greeter.c
+++ b/liblightdm-gobject/greeter.c
@@ -166,7 +166,7 @@ typedef struct
gboolean cancelling_authentication;
} LightDMGreeterPrivate;
-G_DEFINE_TYPE (LightDMGreeter, lightdm_greeter, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (LightDMGreeter, lightdm_greeter, G_TYPE_OBJECT)
#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_GREETER, LightDMGreeterPrivate)
@@ -1897,8 +1897,6 @@ lightdm_greeter_class_init (LightDMGreeterClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (LightDMGreeterPrivate));
-
object_class->set_property = lightdm_greeter_set_property;
object_class->get_property = lightdm_greeter_get_property;
object_class->finalize = lightdm_greeter_finalize;
diff --git a/liblightdm-gobject/language.c b/liblightdm-gobject/language.c
index dbbc3829..3d4fa961 100644
--- a/liblightdm-gobject/language.c
+++ b/liblightdm-gobject/language.c
@@ -50,7 +50,7 @@ typedef struct
gchar *territory;
} LightDMLanguagePrivate;
-G_DEFINE_TYPE (LightDMLanguage, lightdm_language, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (LightDMLanguage, lightdm_language, G_TYPE_OBJECT)
#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_LANGUAGE, LightDMLanguagePrivate)
@@ -356,8 +356,6 @@ lightdm_language_class_init (LightDMLanguageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (LightDMLanguagePrivate));
-
object_class->set_property = lightdm_language_set_property;
object_class->get_property = lightdm_language_get_property;
diff --git a/liblightdm-gobject/layout.c b/liblightdm-gobject/layout.c
index f5764c47..27b9f1c1 100644
--- a/liblightdm-gobject/layout.c
+++ b/liblightdm-gobject/layout.c
@@ -47,7 +47,7 @@ typedef struct
gchar *description;
} LightDMLayoutPrivate;
-G_DEFINE_TYPE (LightDMLayout, lightdm_layout, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (LightDMLayout, lightdm_layout, G_TYPE_OBJECT)
#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_LAYOUT, LightDMLayoutPrivate)
@@ -319,8 +319,6 @@ lightdm_layout_class_init (LightDMLayoutClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (LightDMLayoutPrivate));
-
object_class->set_property = lightdm_layout_set_property;
object_class->get_property = lightdm_layout_get_property;
object_class->finalize = lightdm_layout_finalize;
diff --git a/liblightdm-gobject/session.c b/liblightdm-gobject/session.c
index e1343b44..8608c41f 100644
--- a/liblightdm-gobject/session.c
+++ b/liblightdm-gobject/session.c
@@ -49,7 +49,7 @@ typedef struct
gchar *comment;
} LightDMSessionPrivate;
-G_DEFINE_TYPE (LightDMSession, lightdm_session, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (LightDMSession, lightdm_session, G_TYPE_OBJECT)
#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_SESSION, LightDMSessionPrivate)
@@ -355,8 +355,6 @@ lightdm_session_class_init (LightDMSessionClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (LightDMSessionPrivate));
-
object_class->set_property = lightdm_session_set_property;
object_class->get_property = lightdm_session_get_property;
object_class->finalize = lightdm_session_finalize;
diff --git a/liblightdm-gobject/user.c b/liblightdm-gobject/user.c
index 7fd2ff7a..56dc93b3 100644
--- a/liblightdm-gobject/user.c
+++ b/liblightdm-gobject/user.c
@@ -112,8 +112,8 @@ typedef struct
CommonUser *common_user;
} LightDMUserPrivate;
-G_DEFINE_TYPE (LightDMUserList, lightdm_user_list, G_TYPE_OBJECT)
-G_DEFINE_TYPE (LightDMUser, lightdm_user, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (LightDMUserList, lightdm_user_list, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (LightDMUser, lightdm_user, G_TYPE_OBJECT)
#define GET_LIST_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_USER_LIST, LightDMUserListPrivate)
#define GET_USER_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_USER, LightDMUserPrivate)
@@ -320,8 +320,6 @@ lightdm_user_list_class_init (LightDMUserListClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (LightDMUserListPrivate));
-
object_class->set_property = lightdm_user_list_set_property;
object_class->get_property = lightdm_user_list_get_property;
object_class->finalize = lightdm_user_list_finalize;
@@ -689,8 +687,6 @@ lightdm_user_class_init (LightDMUserClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (LightDMUserPrivate));
-
object_class->set_property = lightdm_user_set_property;
object_class->get_property = lightdm_user_get_property;
object_class->finalize = lightdm_user_finalize;
diff --git a/src/accounts.c b/src/accounts.c
index 968bd235..ee5ec8e0 100644
--- a/src/accounts.c
+++ b/src/accounts.c
@@ -22,7 +22,7 @@ struct UserPrivate
CommonUser *common_user;
};
-G_DEFINE_TYPE (User, user, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (User, user, G_TYPE_OBJECT)
User *
accounts_get_user_by_name (const gchar *username)
@@ -133,6 +133,4 @@ user_class_init (UserClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = user_finalize;
-
- g_type_class_add_private (klass, sizeof (UserPrivate));
}
diff --git a/src/display-manager-service.c b/src/display-manager-service.c
index 6e3e1c5c..c3f14e99 100644
--- a/src/display-manager-service.c
+++ b/src/display-manager-service.c
@@ -47,7 +47,7 @@ struct DisplayManagerServicePrivate
GHashTable *session_bus_entries;
};
-G_DEFINE_TYPE (DisplayManagerService, display_manager_service, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (DisplayManagerService, display_manager_service, G_TYPE_OBJECT)
typedef struct
{
@@ -677,8 +677,6 @@ display_manager_service_class_init (DisplayManagerServiceClass *klass)
object_class->finalize = display_manager_service_finalize;
- g_type_class_add_private (klass, sizeof (DisplayManagerServicePrivate));
-
signals[READY] =
g_signal_new (DISPLAY_MANAGER_SERVICE_SIGNAL_READY,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/display-manager.c b/src/display-manager.c
index 8f3dd320..7cc64af9 100644
--- a/src/display-manager.c
+++ b/src/display-manager.c
@@ -42,7 +42,7 @@ struct DisplayManagerPrivate
gboolean stopped;
};
-G_DEFINE_TYPE (DisplayManager, display_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (DisplayManager, display_manager, G_TYPE_OBJECT)
DisplayManager *
display_manager_new (void)
@@ -185,8 +185,6 @@ display_manager_class_init (DisplayManagerClass *klass)
object_class->finalize = display_manager_finalize;
- g_type_class_add_private (klass, sizeof (DisplayManagerPrivate));
-
signals[SEAT_ADDED] =
g_signal_new (DISPLAY_MANAGER_SIGNAL_SEAT_ADDED,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/display-server.c b/src/display-server.c
index 21c176c2..b746affc 100644
--- a/src/display-server.c
+++ b/src/display-server.c
@@ -35,6 +35,7 @@ struct DisplayServerPrivate
static void display_server_logger_iface_init (LoggerInterface *iface);
G_DEFINE_TYPE_WITH_CODE (DisplayServer, display_server, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (DisplayServer)
G_IMPLEMENT_INTERFACE (LOGGER_TYPE, display_server_logger_iface_init))
const gchar *
@@ -168,8 +169,6 @@ display_server_class_init (DisplayServerClass *klass)
klass->disconnect_session = display_server_real_disconnect_session;
klass->stop = display_server_real_stop;
- g_type_class_add_private (klass, sizeof (DisplayServerPrivate));
-
signals[READY] =
g_signal_new (DISPLAY_SERVER_SIGNAL_READY,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/greeter-session.c b/src/greeter-session.c
index ac637c0d..93552f51 100644
--- a/src/greeter-session.c
+++ b/src/greeter-session.c
@@ -23,7 +23,7 @@ struct GreeterSessionPrivate
Greeter *greeter;
};
-G_DEFINE_TYPE (GreeterSession, greeter_session, SESSION_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (GreeterSession, greeter_session, SESSION_TYPE)
GreeterSession *
greeter_session_new (void)
@@ -112,6 +112,4 @@ greeter_session_class_init (GreeterSessionClass *klass)
session_class->start = greeter_session_start;
session_class->stop = greeter_session_stop;
object_class->finalize = greeter_session_finalize;
-
- g_type_class_add_private (klass, sizeof (GreeterSessionPrivate));
}
diff --git a/src/greeter-socket.c b/src/greeter-socket.c
index 34793640..94ba1d19 100644
--- a/src/greeter-socket.c
+++ b/src/greeter-socket.c
@@ -41,7 +41,7 @@ struct GreeterSocketPrivate
Greeter *greeter;
};
-G_DEFINE_TYPE (GreeterSocket, greeter_socket, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GreeterSocket, greeter_socket, G_TYPE_OBJECT)
GreeterSocket *
greeter_socket_new (const gchar *path)
@@ -162,6 +162,4 @@ greeter_socket_class_init (GreeterSocketClass *klass)
NULL,
NULL,
GREETER_TYPE, 0);
-
- g_type_class_add_private (klass, sizeof (GreeterSocketPrivate));
}
diff --git a/src/greeter.c b/src/greeter.c
index bf725ac3..c3423967 100644
--- a/src/greeter.c
+++ b/src/greeter.c
@@ -83,7 +83,7 @@ struct GreeterPrivate
guint from_greeter_watch;
};
-G_DEFINE_TYPE (Greeter, greeter, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (Greeter, greeter, G_TYPE_OBJECT)
#define API_VERSION 1
@@ -1124,6 +1124,4 @@ greeter_class_init (GreeterClass *klass)
"Active username",
NULL,
G_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GreeterPrivate));
}
diff --git a/src/login1.c b/src/login1.c
index d00031e4..4eefb889 100644
--- a/src/login1.c
+++ b/src/login1.c
@@ -69,8 +69,8 @@ struct Login1SeatPrivate
gboolean can_multi_session;
};
-G_DEFINE_TYPE (Login1Service, login1_service, G_TYPE_OBJECT)
-G_DEFINE_TYPE (Login1Seat, login1_seat, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (Login1Service, login1_service, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (Login1Seat, login1_seat, G_TYPE_OBJECT)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Login1Seat, g_object_unref)
@@ -457,8 +457,6 @@ login1_service_class_init (Login1ServiceClass *klass)
object_class->finalize = login1_service_finalize;
- g_type_class_add_private (klass, sizeof (Login1ServicePrivate));
-
service_signals[SEAT_ADDED] =
g_signal_new (LOGIN1_SERVICE_SIGNAL_SEAT_ADDED,
G_TYPE_FROM_CLASS (klass),
@@ -524,8 +522,6 @@ login1_seat_class_init (Login1SeatClass *klass)
object_class->finalize = login1_seat_finalize;
- g_type_class_add_private (klass, sizeof (Login1SeatPrivate));
-
seat_signals[CAN_GRAPHICAL_CHANGED] =
g_signal_new (LOGIN1_SEAT_SIGNAL_CAN_GRAPHICAL_CHANGED,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/process.c b/src/process.c
index 549ccd94..24416671 100644
--- a/src/process.c
+++ b/src/process.c
@@ -66,7 +66,7 @@ struct ProcessPrivate
guint watch;
};
-G_DEFINE_TYPE (Process, process, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (Process, process, G_TYPE_OBJECT)
static Process *current_process = NULL;
static GHashTable *processes = NULL;
@@ -412,8 +412,6 @@ process_class_init (ProcessClass *klass)
klass->stopped = process_stopped;
object_class->finalize = process_finalize;
- g_type_class_add_private (klass, sizeof (ProcessPrivate));
-
signals[GOT_DATA] =
g_signal_new (PROCESS_SIGNAL_GOT_DATA,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/seat-local.c b/src/seat-local.c
index 9d83ca97..a83da26e 100644
--- a/src/seat-local.c
+++ b/src/seat-local.c
@@ -35,7 +35,7 @@ struct SeatLocalPrivate
XServerLocal *xdmcp_x_server;
};
-G_DEFINE_TYPE (SeatLocal, seat_local, SEAT_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (SeatLocal, seat_local, SEAT_TYPE)
static XServerLocal *create_x_server (SeatLocal *seat);
@@ -462,6 +462,4 @@ seat_local_class_init (SeatLocalClass *klass)
seat_class->set_next_session = seat_local_set_next_session;
seat_class->run_script = seat_local_run_script;
seat_class->stop = seat_local_stop;
-
- g_type_class_add_private (klass, sizeof (SeatLocalPrivate));
}
diff --git a/src/seat-unity.c b/src/seat-unity.c
index 8563f7ad..5d6d4ce1 100644
--- a/src/seat-unity.c
+++ b/src/seat-unity.c
@@ -37,7 +37,7 @@ struct SeatUnityPrivate
DisplayServer *active_display_server;
};
-G_DEFINE_TYPE (SeatUnity, seat_unity, SEAT_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (SeatUnity, seat_unity, SEAT_TYPE)
static XServerXmir *create_x_server (Seat *seat);
@@ -395,6 +395,4 @@ seat_unity_class_init (SeatUnityClass *klass)
seat_class->set_next_session = seat_unity_set_next_session;
seat_class->run_script = seat_unity_run_script;
seat_class->stop = seat_unity_stop;
-
- g_type_class_add_private (klass, sizeof (SeatUnityPrivate));
}
diff --git a/src/seat-xdmcp-session.c b/src/seat-xdmcp-session.c
index 903a26ff..38431083 100644
--- a/src/seat-xdmcp-session.c
+++ b/src/seat-xdmcp-session.c
@@ -23,7 +23,7 @@ struct SeatXDMCPSessionPrivate
XServerRemote *x_server;
};
-G_DEFINE_TYPE (SeatXDMCPSession, seat_xdmcp_session, SEAT_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (SeatXDMCPSession, seat_xdmcp_session, SEAT_TYPE)
SeatXDMCPSession *
seat_xdmcp_session_new (XDMCPSession *session)
@@ -77,6 +77,4 @@ seat_xdmcp_session_class_init (SeatXDMCPSessionClass *klass)
seat_class->create_display_server = seat_xdmcp_session_create_display_server;
object_class->finalize = seat_xdmcp_session_finalize;
-
- g_type_class_add_private (klass, sizeof (SeatXDMCPSessionPrivate));
}
diff --git a/src/seat-xvnc.c b/src/seat-xvnc.c
index 232bcc72..17e50448 100644
--- a/src/seat-xvnc.c
+++ b/src/seat-xvnc.c
@@ -15,8 +15,6 @@
#include "x-server-xvnc.h"
#include "configuration.h"
-G_DEFINE_TYPE (SeatXVNC, seat_xvnc, SEAT_TYPE)
-
struct SeatXVNCPrivate
{
/* VNC connection */
@@ -26,6 +24,8 @@ struct SeatXVNCPrivate
XServerXVNC *x_server;
};
+G_DEFINE_TYPE_WITH_PRIVATE (SeatXVNC, seat_xvnc, SEAT_TYPE)
+
SeatXVNC *seat_xvnc_new (GSocket *connection)
{
SeatXVNC *seat = g_object_new (SEAT_XVNC_TYPE, NULL);
@@ -125,6 +125,4 @@ seat_xvnc_class_init (SeatXVNCClass *klass)
seat_class->create_display_server = seat_xvnc_create_display_server;
seat_class->run_script = seat_xvnc_run_script;
object_class->finalize = seat_xvnc_session_finalize;
-
- g_type_class_add_private (klass, sizeof (SeatXVNCPrivate));
}
diff --git a/src/seat.c b/src/seat.c
index d1ce4e4d..7e6c4462 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -73,6 +73,7 @@ struct SeatPrivate
static void seat_logger_iface_init (LoggerInterface *iface);
G_DEFINE_TYPE_WITH_CODE (Seat, seat, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (Seat)
G_IMPLEMENT_INTERFACE (
LOGGER_TYPE, seat_logger_iface_init))
@@ -1872,8 +1873,6 @@ seat_class_init (SeatClass *klass)
object_class->finalize = seat_finalize;
- g_type_class_add_private (klass, sizeof (SeatPrivate));
-
signals[SESSION_ADDED] =
g_signal_new (SEAT_SIGNAL_SESSION_ADDED,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/session-config.c b/src/session-config.c
index e1b56f0e..04b0f974 100644
--- a/src/session-config.c
+++ b/src/session-config.c
@@ -26,7 +26,7 @@ struct SessionConfigPrivate
gboolean allow_greeter;
};
-G_DEFINE_TYPE (SessionConfig, session_config, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (SessionConfig, session_config, G_TYPE_OBJECT)
SessionConfig *
session_config_new_from_file (const gchar *filename, const gchar *default_session_type, GError **error)
@@ -120,6 +120,4 @@ session_config_class_init (SessionConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = session_config_finalize;
-
- g_type_class_add_private (klass, sizeof (SessionConfigPrivate));
}
diff --git a/src/session.c b/src/session.c
index c1f44204..43b9d382 100644
--- a/src/session.c
+++ b/src/session.c
@@ -127,6 +127,7 @@ struct SessionPrivate
static void session_logger_iface_init (LoggerInterface *iface);
G_DEFINE_TYPE_WITH_CODE (Session, session, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (Session)
G_IMPLEMENT_INTERFACE (
LOGGER_TYPE, session_logger_iface_init))
@@ -966,8 +967,6 @@ session_class_init (SessionClass *klass)
klass->stop = session_real_stop;
object_class->finalize = session_finalize;
- g_type_class_add_private (klass, sizeof (SessionPrivate));
-
signals[CREATE_GREETER] =
g_signal_new (SESSION_SIGNAL_CREATE_GREETER,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/shared-data-manager.c b/src/shared-data-manager.c
index e493e584..79a551b3 100644
--- a/src/shared-data-manager.c
+++ b/src/shared-data-manager.c
@@ -34,7 +34,7 @@ struct OwnerInfo
guint32 uid;
};
-G_DEFINE_TYPE (SharedDataManager, shared_data_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (SharedDataManager, shared_data_manager, G_TYPE_OBJECT)
static SharedDataManager *singleton = NULL;
@@ -236,6 +236,4 @@ shared_data_manager_class_init (SharedDataManagerClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = shared_data_manager_finalize;
-
- g_type_class_add_private (klass, sizeof (SharedDataManagerPrivate));
}
diff --git a/src/unity-system-compositor.c b/src/unity-system-compositor.c
index 81270276..e75f1bf9 100644
--- a/src/unity-system-compositor.c
+++ b/src/unity-system-compositor.c
@@ -67,6 +67,7 @@ struct UnitySystemCompositorPrivate
static void unity_system_compositor_logger_iface_init (LoggerInterface *iface);
G_DEFINE_TYPE_WITH_CODE (UnitySystemCompositor, unity_system_compositor, DISPLAY_SERVER_TYPE,
+ G_ADD_PRIVATE (UnitySystemCompositor)
G_IMPLEMENT_INTERFACE (LOGGER_TYPE, unity_system_compositor_logger_iface_init))
typedef enum
@@ -502,8 +503,6 @@ unity_system_compositor_class_init (UnitySystemCompositorClass *klass)
display_server_class->start = unity_system_compositor_start;
display_server_class->stop = unity_system_compositor_stop;
object_class->finalize = unity_system_compositor_finalize;
-
- g_type_class_add_private (klass, sizeof (UnitySystemCompositorPrivate));
}
static gint
diff --git a/src/vnc-server.c b/src/vnc-server.c
index b68745b5..e5612b2f 100644
--- a/src/vnc-server.c
+++ b/src/vnc-server.c
@@ -31,7 +31,7 @@ struct VNCServerPrivate
GSocket *socket, *socket6;
};
-G_DEFINE_TYPE (VNCServer, vnc_server, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (VNCServer, vnc_server, G_TYPE_OBJECT)
VNCServer *
vnc_server_new (void)
@@ -175,8 +175,6 @@ vnc_server_class_init (VNCServerClass *klass)
object_class->finalize = vnc_server_finalize;
- g_type_class_add_private (klass, sizeof (VNCServerPrivate));
-
signals[NEW_CONNECTION] =
g_signal_new (VNC_SERVER_SIGNAL_NEW_CONNECTION,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/wayland-session.c b/src/wayland-session.c
index 46d41af2..576b2e60 100644
--- a/src/wayland-session.c
+++ b/src/wayland-session.c
@@ -19,7 +19,7 @@ struct WaylandSessionPrivate
gboolean have_vt_ref;
};
-G_DEFINE_TYPE (WaylandSession, wayland_session, DISPLAY_SERVER_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (WaylandSession, wayland_session, DISPLAY_SERVER_TYPE)
WaylandSession *
wayland_session_new (void)
@@ -98,6 +98,4 @@ wayland_session_class_init (WaylandSessionClass *klass)
display_server_class->connect_session = wayland_session_connect_session;
display_server_class->disconnect_session = wayland_session_disconnect_session;
object_class->finalize = wayland_session_finalize;
-
- g_type_class_add_private (klass, sizeof (WaylandSessionPrivate));
}
diff --git a/src/x-authority.c b/src/x-authority.c
index a9a4089f..6f4a06b5 100644
--- a/src/x-authority.c
+++ b/src/x-authority.c
@@ -39,7 +39,7 @@ struct XAuthorityPrivate
gsize authorization_data_length;
};
-G_DEFINE_TYPE (XAuthority, x_authority, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (XAuthority, x_authority, G_TYPE_OBJECT)
XAuthority *
x_authority_new (guint16 family, const guint8 *address, gsize address_length, const gchar *number, const gchar *name, const guint8 *data, gsize data_length)
@@ -374,6 +374,4 @@ x_authority_class_init (XAuthorityClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = x_authority_finalize;
-
- g_type_class_add_private (klass, sizeof (XAuthorityPrivate));
}
diff --git a/src/x-server-local.c b/src/x-server-local.c
index 80e0ab0d..223593e1 100644
--- a/src/x-server-local.c
+++ b/src/x-server-local.c
@@ -71,6 +71,7 @@ struct XServerLocalPrivate
static void x_server_local_logger_iface_init (LoggerInterface *iface);
G_DEFINE_TYPE_WITH_CODE (XServerLocal, x_server_local, X_SERVER_TYPE,
+ G_ADD_PRIVATE (XServerLocal)
G_IMPLEMENT_INTERFACE (LOGGER_TYPE, x_server_local_logger_iface_init))
static gchar *version = NULL;
@@ -577,8 +578,6 @@ x_server_local_class_init (XServerLocalClass *klass)
display_server_class->start = klass->start = x_server_local_start;
display_server_class->stop = x_server_local_stop;
object_class->finalize = x_server_local_finalize;
-
- g_type_class_add_private (klass, sizeof (XServerLocalPrivate));
}
static gint
diff --git a/src/x-server-remote.c b/src/x-server-remote.c
index c870bedf..675e3f80 100644
--- a/src/x-server-remote.c
+++ b/src/x-server-remote.c
@@ -19,7 +19,7 @@ struct XServerRemotePrivate
guint display_number;
};
-G_DEFINE_TYPE (XServerRemote, x_server_remote, X_SERVER_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (XServerRemote, x_server_remote, X_SERVER_TYPE)
XServerRemote *
x_server_remote_new (const gchar *hostname, guint number, XAuthority *authority)
@@ -52,6 +52,4 @@ x_server_remote_class_init (XServerRemoteClass *klass)
XServerClass *x_server_class = X_SERVER_CLASS (klass);
x_server_class->get_display_number = x_server_remote_get_display_number;
-
- g_type_class_add_private (klass, sizeof (XServerRemotePrivate));
}
diff --git a/src/x-server-xmir.c b/src/x-server-xmir.c
index df37bad4..05e6ccc0 100644
--- a/src/x-server-xmir.c
+++ b/src/x-server-xmir.c
@@ -27,7 +27,7 @@ struct XServerXmirPrivate
gchar *mir_socket;
};
-G_DEFINE_TYPE (XServerXmir, x_server_xmir, X_SERVER_LOCAL_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (XServerXmir, x_server_xmir, X_SERVER_LOCAL_TYPE)
static void
compositor_ready_cb (UnitySystemCompositor *compositor, XServerXmir *server)
@@ -157,6 +157,4 @@ x_server_xmir_class_init (XServerXmirClass *klass)
display_server_class->get_vt = x_server_xmir_get_vt;
display_server_class->start = x_server_xmir_start;
object_class->finalize = x_server_xmir_finalize;
-
- g_type_class_add_private (klass, sizeof (XServerXmirPrivate));
}
diff --git a/src/x-server-xvnc.c b/src/x-server-xvnc.c
index 82de7823..601240ef 100644
--- a/src/x-server-xvnc.c
+++ b/src/x-server-xvnc.c
@@ -29,7 +29,7 @@ struct XServerXVNCPrivate
gint width, height, depth;
};
-G_DEFINE_TYPE (XServerXVNC, x_server_xvnc, X_SERVER_LOCAL_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (XServerXVNC, x_server_xvnc, X_SERVER_LOCAL_TYPE)
XServerXVNC *
x_server_xvnc_new (void)
@@ -134,6 +134,4 @@ x_server_xvnc_class_init (XServerXVNCClass *klass)
x_server_local_class->get_log_stdout = x_server_xvnc_get_log_stdout;
x_server_local_class->add_args = x_server_xvnc_add_args;
display_server_class->get_can_share = x_server_xvnc_get_can_share;
-
- g_type_class_add_private (klass, sizeof (XServerXVNCPrivate));
}
diff --git a/src/x-server.c b/src/x-server.c
index d6267ae0..dc99d837 100644
--- a/src/x-server.c
+++ b/src/x-server.c
@@ -31,7 +31,7 @@ struct XServerPrivate
xcb_connection_t *connection;
};
-G_DEFINE_TYPE (XServer, x_server, DISPLAY_SERVER_TYPE)
+G_DEFINE_TYPE_WITH_PRIVATE (XServer, x_server, DISPLAY_SERVER_TYPE)
void
x_server_set_hostname (XServer *server, const gchar *hostname)
@@ -208,6 +208,4 @@ x_server_class_init (XServerClass *klass)
display_server_class->connect_session = x_server_connect_session;
display_server_class->disconnect_session = x_server_disconnect_session;
object_class->finalize = x_server_finalize;
-
- g_type_class_add_private (klass, sizeof (XServerPrivate));
}
diff --git a/src/xdmcp-server.c b/src/xdmcp-server.c
index f1d351a0..ca7f14db 100644
--- a/src/xdmcp-server.c
+++ b/src/xdmcp-server.c
@@ -51,7 +51,7 @@ struct XDMCPServerPrivate
GHashTable *sessions;
};
-G_DEFINE_TYPE (XDMCPServer, xdmcp_server, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (XDMCPServer, xdmcp_server, G_TYPE_OBJECT)
/* Maximum number of milliseconds client will resend manage requests before giving up */
#define MANAGE_TIMEOUT 126000
@@ -818,8 +818,6 @@ xdmcp_server_class_init (XDMCPServerClass *klass)
object_class->finalize = xdmcp_server_finalize;
- g_type_class_add_private (klass, sizeof (XDMCPServerPrivate));
-
signals[NEW_SESSION] =
g_signal_new (XDMCP_SERVER_SIGNAL_NEW_SESSION,
G_TYPE_FROM_CLASS (klass),
diff --git a/src/xdmcp-session.c b/src/xdmcp-session.c
index 4f75e8bc..10724119 100644
--- a/src/xdmcp-session.c
+++ b/src/xdmcp-session.c
@@ -12,7 +12,7 @@
#include "xdmcp-session.h"
#include "xdmcp-session-private.h"
-G_DEFINE_TYPE (XDMCPSession, xdmcp_session, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (XDMCPSession, xdmcp_session, G_TYPE_OBJECT)
XDMCPSession *
xdmcp_session_new (guint16 id)
@@ -93,6 +93,4 @@ xdmcp_session_class_init (XDMCPSessionClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = xdmcp_session_finalize;
-
- g_type_class_add_private (klass, sizeof (XDMCPSessionPrivate));
}
diff --git a/tests/src/x-authority.c b/tests/src/x-authority.c
index adba92c4..8c0aa508 100644
--- a/tests/src/x-authority.c
+++ b/tests/src/x-authority.c
@@ -19,8 +19,8 @@ struct XAuthorityRecordPrivate
guint8 *authorization_data;
};
-G_DEFINE_TYPE (XAuthority, x_authority, G_TYPE_OBJECT)
-G_DEFINE_TYPE (XAuthorityRecord, x_authority_record, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (XAuthority, x_authority, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (XAuthorityRecord, x_authority_record, G_TYPE_OBJECT)
XAuthority *
x_authority_new (void)
@@ -158,7 +158,6 @@ x_authority_class_init (XAuthorityClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = x_authority_finalize;
- g_type_class_add_private (klass, sizeof (XAuthorityPrivate));
}
guint16
@@ -210,5 +209,4 @@ x_authority_record_class_init (XAuthorityRecordClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = x_authority_record_finalize;
- g_type_class_add_private (klass, sizeof (XAuthorityRecordPrivate));
}
diff --git a/tests/src/x-server.c b/tests/src/x-server.c
index e1537e83..e603fc03 100644
--- a/tests/src/x-server.c
+++ b/tests/src/x-server.c
@@ -12,9 +12,6 @@
#include "x-server.h"
-G_DEFINE_TYPE (XServer, x_server, G_TYPE_OBJECT)
-G_DEFINE_TYPE (XClient, x_client, G_TYPE_OBJECT)
-
#define MAXIMUM_REQUEST_LENGTH 65535
enum {
@@ -35,6 +32,8 @@ struct XServerPrivate
GHashTable *clients;
};
+G_DEFINE_TYPE_WITH_PRIVATE (XServer, x_server, G_TYPE_OBJECT)
+
struct XClientPrivate
{
XServer *server;
@@ -42,6 +41,8 @@ struct XClientPrivate
GIOChannel *channel;
};
+G_DEFINE_TYPE_WITH_PRIVATE (XClient, x_client, G_TYPE_OBJECT)
+
enum
{
X_CLIENT_DISCONNECTED,
@@ -82,8 +83,6 @@ x_client_init (XClient *client)
static void
x_client_class_init (XClientClass *klass)
{
- g_type_class_add_private (klass, sizeof (XClientPrivate));
-
x_client_signals[X_CLIENT_DISCONNECTED] =
g_signal_new (X_CLIENT_SIGNAL_DISCONNECTED,
G_TYPE_FROM_CLASS (klass),
@@ -198,8 +197,9 @@ static void
x_server_class_init (XServerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
object_class->finalize = x_server_finalize;
- g_type_class_add_private (klass, sizeof (XServerPrivate));
+
x_server_signals[X_SERVER_CLIENT_CONNECTED] =
g_signal_new (X_SERVER_SIGNAL_CLIENT_CONNECTED,
G_TYPE_FROM_CLASS (klass),
diff --git a/tests/src/xdmcp-client.c b/tests/src/xdmcp-client.c
index 99d789d8..de40702b 100644
--- a/tests/src/xdmcp-client.c
+++ b/tests/src/xdmcp-client.c
@@ -9,8 +9,6 @@
#include "x-common.h"
#include "xdmcp-client.h"
-G_DEFINE_TYPE (XDMCPClient, xdmcp_client, G_TYPE_OBJECT)
-
#define MAXIMUM_REQUEST_LENGTH 65535
typedef enum
@@ -42,6 +40,8 @@ struct XDMCPClientPrivate
guint8 *authorization_data;
};
+G_DEFINE_TYPE_WITH_PRIVATE (XDMCPClient, xdmcp_client, G_TYPE_OBJECT)
+
enum {
XDMCP_CLIENT_WILLING,
XDMCP_CLIENT_UNWILLING,
@@ -469,8 +469,9 @@ static void
xdmcp_client_class_init (XDMCPClientClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
object_class->finalize = xdmcp_client_finalize;
- g_type_class_add_private (klass, sizeof (XDMCPClientPrivate));
+
xdmcp_client_signals[XDMCP_CLIENT_WILLING] =
g_signal_new (XDMCP_CLIENT_SIGNAL_WILLING,
G_TYPE_FROM_CLASS (klass),