empathy r1082 - in trunk: libempathy libempathy-gtk megaphone/src python/pyempathy src
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1082 - in trunk: libempathy libempathy-gtk megaphone/src python/pyempathy src
- Date: Mon, 5 May 2008 21:34:43 +0100 (BST)
Author: xclaesse
Date: Mon May 5 20:34:41 2008
New Revision: 1082
URL: http://svn.gnome.org/viewvc/empathy?rev=1082&view=rev
Log:
Keep a priv pointer in the object struct instead of using G_TYPE_INSTANCE_GET_PRIVATE all the time.
Modified:
trunk/libempathy-gtk/empathy-account-chooser.c
trunk/libempathy-gtk/empathy-account-chooser.h
trunk/libempathy-gtk/empathy-avatar-chooser.c
trunk/libempathy-gtk/empathy-avatar-chooser.h
trunk/libempathy-gtk/empathy-avatar-image.c
trunk/libempathy-gtk/empathy-avatar-image.h
trunk/libempathy-gtk/empathy-cell-renderer-expander.c
trunk/libempathy-gtk/empathy-cell-renderer-expander.h
trunk/libempathy-gtk/empathy-cell-renderer-text.c
trunk/libempathy-gtk/empathy-cell-renderer-text.h
trunk/libempathy-gtk/empathy-chat-view.c
trunk/libempathy-gtk/empathy-chat-view.h
trunk/libempathy-gtk/empathy-chat.c
trunk/libempathy-gtk/empathy-chat.h
trunk/libempathy-gtk/empathy-conf.c
trunk/libempathy-gtk/empathy-conf.h
trunk/libempathy-gtk/empathy-contact-list-store.c
trunk/libempathy-gtk/empathy-contact-list-store.h
trunk/libempathy-gtk/empathy-contact-list-view.c
trunk/libempathy-gtk/empathy-contact-list-view.h
trunk/libempathy-gtk/empathy-presence-chooser.c
trunk/libempathy-gtk/empathy-presence-chooser.h
trunk/libempathy-gtk/empathy-smiley-manager.c
trunk/libempathy-gtk/empathy-smiley-manager.h
trunk/libempathy-gtk/empathy-theme-boxes.c
trunk/libempathy-gtk/empathy-theme-boxes.h
trunk/libempathy-gtk/empathy-theme-irc.c
trunk/libempathy-gtk/empathy-theme-irc.h
trunk/libempathy-gtk/empathy-theme-manager.c
trunk/libempathy-gtk/empathy-theme-manager.h
trunk/libempathy-gtk/empathy-theme.c
trunk/libempathy-gtk/empathy-theme.h
trunk/libempathy/empathy-chatroom-manager.c
trunk/libempathy/empathy-chatroom-manager.h
trunk/libempathy/empathy-chatroom.c
trunk/libempathy/empathy-chatroom.h
trunk/libempathy/empathy-contact-factory.c
trunk/libempathy/empathy-contact-factory.h
trunk/libempathy/empathy-contact-manager.c
trunk/libempathy/empathy-contact-manager.h
trunk/libempathy/empathy-contact.c
trunk/libempathy/empathy-contact.h
trunk/libempathy/empathy-idle.c
trunk/libempathy/empathy-idle.h
trunk/libempathy/empathy-irc-network-manager.c
trunk/libempathy/empathy-irc-network-manager.h
trunk/libempathy/empathy-irc-network.c
trunk/libempathy/empathy-irc-network.h
trunk/libempathy/empathy-irc-server.c
trunk/libempathy/empathy-irc-server.h
trunk/libempathy/empathy-log-manager.c
trunk/libempathy/empathy-log-manager.h
trunk/libempathy/empathy-message.c
trunk/libempathy/empathy-message.h
trunk/libempathy/empathy-tp-call.c
trunk/libempathy/empathy-tp-call.h
trunk/libempathy/empathy-tp-chat.c
trunk/libempathy/empathy-tp-chat.h
trunk/libempathy/empathy-tp-contact-factory.c
trunk/libempathy/empathy-tp-contact-factory.h
trunk/libempathy/empathy-tp-contact-list.c
trunk/libempathy/empathy-tp-contact-list.h
trunk/libempathy/empathy-tp-group.c
trunk/libempathy/empathy-tp-group.h
trunk/libempathy/empathy-tp-roomlist.c
trunk/libempathy/empathy-tp-roomlist.h
trunk/libempathy/empathy-tp-tube.c
trunk/libempathy/empathy-tp-tube.h
trunk/libempathy/empathy-utils.h
trunk/megaphone/src/megaphone-applet.c
trunk/megaphone/src/megaphone-applet.h
trunk/python/pyempathy/pyempathy.defs
trunk/src/empathy-chat-window.c
trunk/src/empathy-chat-window.h
trunk/src/empathy-filter.c
trunk/src/empathy-filter.h
trunk/src/empathy-status-icon.c
trunk/src/empathy-status-icon.h
Modified: trunk/libempathy-gtk/empathy-account-chooser.c
==============================================================================
--- trunk/libempathy-gtk/empathy-account-chooser.c (original)
+++ trunk/libempathy-gtk/empathy-account-chooser.c Mon May 5 20:34:41 2008
@@ -38,8 +38,7 @@
#include "empathy-ui-utils.h"
#include "empathy-account-chooser.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserPriv))
-
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountChooser)
typedef struct {
MissionControl *mc;
McAccountMonitor *monitor;
@@ -130,8 +129,10 @@
static void
empathy_account_chooser_init (EmpathyAccountChooser *chooser)
{
- EmpathyAccountChooserPriv *priv = GET_PRIV (chooser);
+ EmpathyAccountChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
+ EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserPriv);
+ chooser->priv = priv;
priv->set_active_item = FALSE;
priv->filter = NULL;
priv->filter_data = NULL;
Modified: trunk/libempathy-gtk/empathy-account-chooser.h
==============================================================================
--- trunk/libempathy-gtk/empathy-account-chooser.h (original)
+++ trunk/libempathy-gtk/empathy-account-chooser.h Mon May 5 20:34:41 2008
@@ -47,6 +47,7 @@
struct _EmpathyAccountChooser {
GtkComboBox parent;
+ gpointer priv;
};
struct _EmpathyAccountChooserClass {
Modified: trunk/libempathy-gtk/empathy-avatar-chooser.c
==============================================================================
--- trunk/libempathy-gtk/empathy-avatar-chooser.c (original)
+++ trunk/libempathy-gtk/empathy-avatar-chooser.c Mon May 5 20:34:41 2008
@@ -29,6 +29,7 @@
#include <gtk/gtk.h>
#include <gio/gio.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-avatar-chooser.h"
#include "empathy-conf.h"
#include "empathy-ui-utils.h"
@@ -36,12 +37,11 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_AVATAR_CHOOSER, EmpathyAvatarChooserPriv))
-
#define AVATAR_SIZE_SAVE 96
#define AVATAR_SIZE_VIEW 64
#define DEFAULT_DIR DATADIR"/pixmaps/faces"
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAvatarChooser)
typedef struct {
gchar *image_data;
gsize image_data_size;
@@ -122,10 +122,10 @@
static void
empathy_avatar_chooser_init (EmpathyAvatarChooser *chooser)
{
- EmpathyAvatarChooserPriv *priv;
-
- priv = GET_PRIV (chooser);
+ EmpathyAvatarChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
+ EMPATHY_TYPE_AVATAR_CHOOSER, EmpathyAvatarChooserPriv);
+ chooser->priv = priv;
gtk_drag_dest_set (GTK_WIDGET (chooser),
GTK_DEST_DEFAULT_ALL,
drop_types,
Modified: trunk/libempathy-gtk/empathy-avatar-chooser.h
==============================================================================
--- trunk/libempathy-gtk/empathy-avatar-chooser.h (original)
+++ trunk/libempathy-gtk/empathy-avatar-chooser.h Mon May 5 20:34:41 2008
@@ -38,10 +38,10 @@
typedef struct _EmpathyAvatarChooser EmpathyAvatarChooser;
typedef struct _EmpathyAvatarChooserClass EmpathyAvatarChooserClass;
-typedef struct _EmpathyAvatarChooserPrivate EmpathyAvatarChooserPrivate;
struct _EmpathyAvatarChooser {
GtkButton parent;
+ gpointer priv;
};
struct _EmpathyAvatarChooserClass {
Modified: trunk/libempathy-gtk/empathy-avatar-image.c
==============================================================================
--- trunk/libempathy-gtk/empathy-avatar-image.c (original)
+++ trunk/libempathy-gtk/empathy-avatar-image.c Mon May 5 20:34:41 2008
@@ -29,14 +29,14 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-avatar-image.h"
#include "empathy-ui-utils.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_AVATAR_IMAGE, EmpathyAvatarImagePriv))
-
#define MAX_SMALL 64
#define MAX_LARGE 400
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAvatarImage)
typedef struct {
GtkWidget *image;
GtkWidget *popup;
@@ -73,10 +73,10 @@
static void
empathy_avatar_image_init (EmpathyAvatarImage *avatar_image)
{
- EmpathyAvatarImagePriv *priv;
-
- priv = GET_PRIV (avatar_image);
+ EmpathyAvatarImagePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (avatar_image,
+ EMPATHY_TYPE_AVATAR_IMAGE, EmpathyAvatarImagePriv);
+ avatar_image->priv = priv;
priv->image = gtk_image_new ();
gtk_container_add (GTK_CONTAINER (avatar_image), priv->image);
empathy_avatar_image_set (avatar_image, NULL);
Modified: trunk/libempathy-gtk/empathy-avatar-image.h
==============================================================================
--- trunk/libempathy-gtk/empathy-avatar-image.h (original)
+++ trunk/libempathy-gtk/empathy-avatar-image.h Mon May 5 20:34:41 2008
@@ -42,6 +42,7 @@
struct _EmpathyAvatarImage {
GtkEventBox parent;
+ gpointer priv;
};
struct _EmpathyAvatarImageClass {
Modified: trunk/libempathy-gtk/empathy-cell-renderer-expander.c
==============================================================================
--- trunk/libempathy-gtk/empathy-cell-renderer-expander.c (original)
+++ trunk/libempathy-gtk/empathy-cell-renderer-expander.c Mon May 5 20:34:41 2008
@@ -31,12 +31,31 @@
#include <gtk/gtktreeview.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-cell-renderer-expander.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderPriv))
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCellRendererExpander)
+typedef struct {
+ GtkExpanderStyle expander_style;
+ gint expander_size;
+
+ GtkTreeView *animation_view;
+ GtkTreeRowReference *animation_node;
+ GtkExpanderStyle animation_style;
+ guint animation_timeout;
+ GdkRectangle animation_area;
+
+ guint activatable : 1;
+ guint animation_expanding : 1;
+} EmpathyCellRendererExpanderPriv;
+
+enum {
+ PROP_0,
+ PROP_EXPANDER_STYLE,
+ PROP_EXPANDER_SIZE,
+ PROP_ACTIVATABLE
+};
-static void empathy_cell_renderer_expander_init (EmpathyCellRendererExpander *expander);
-static void empathy_cell_renderer_expander_class_init (EmpathyCellRendererExpanderClass *klass);
static void empathy_cell_renderer_expander_get_property (GObject *object,
guint param_id,
GValue *value,
@@ -68,38 +87,15 @@
GdkRectangle *cell_area,
GtkCellRendererState flags);
-enum {
- PROP_0,
- PROP_EXPANDER_STYLE,
- PROP_EXPANDER_SIZE,
- PROP_ACTIVATABLE
-};
-
-typedef struct _EmpathyCellRendererExpanderPriv EmpathyCellRendererExpanderPriv;
-
-struct _EmpathyCellRendererExpanderPriv {
- GtkExpanderStyle expander_style;
- gint expander_size;
-
- GtkTreeView *animation_view;
- GtkTreeRowReference *animation_node;
- GtkExpanderStyle animation_style;
- guint animation_timeout;
- GdkRectangle animation_area;
-
- guint activatable : 1;
- guint animation_expanding : 1;
-};
-
G_DEFINE_TYPE (EmpathyCellRendererExpander, empathy_cell_renderer_expander, GTK_TYPE_CELL_RENDERER)
static void
empathy_cell_renderer_expander_init (EmpathyCellRendererExpander *expander)
{
- EmpathyCellRendererExpanderPriv *priv;
-
- priv = GET_PRIV (expander);
+ EmpathyCellRendererExpanderPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (expander,
+ EMPATHY_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderPriv);
+ expander->priv = priv;
priv->expander_style = GTK_EXPANDER_COLLAPSED;
priv->expander_size = 12;
priv->activatable = TRUE;
Modified: trunk/libempathy-gtk/empathy-cell-renderer-expander.h
==============================================================================
--- trunk/libempathy-gtk/empathy-cell-renderer-expander.h (original)
+++ trunk/libempathy-gtk/empathy-cell-renderer-expander.h Mon May 5 20:34:41 2008
@@ -39,6 +39,7 @@
struct _EmpathyCellRendererExpander {
GtkCellRenderer parent;
+ gpointer priv;
};
struct _EmpathyCellRendererExpanderClass {
Modified: trunk/libempathy-gtk/empathy-cell-renderer-text.c
==============================================================================
--- trunk/libempathy-gtk/empathy-cell-renderer-text.c (original)
+++ trunk/libempathy-gtk/empathy-cell-renderer-text.c Mon May 5 20:34:41 2008
@@ -24,11 +24,11 @@
#include <string.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-cell-renderer-text.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CELL_RENDERER_TEXT, EmpathyCellRendererTextPriv))
-
-struct _EmpathyCellRendererTextPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCellRendererText)
+typedef struct {
gchar *name;
gchar *status;
gboolean is_group;
@@ -37,10 +37,8 @@
gboolean is_selected;
gboolean show_status;
-};
+} EmpathyCellRendererTextPriv;
-static void empathy_cell_renderer_text_class_init (EmpathyCellRendererTextClass *klass);
-static void empathy_cell_renderer_text_init (EmpathyCellRendererText *cell);
static void cell_renderer_text_finalize (GObject *object);
static void cell_renderer_text_get_property (GObject *object,
guint param_id,
@@ -131,10 +129,10 @@
static void
empathy_cell_renderer_text_init (EmpathyCellRendererText *cell)
{
- EmpathyCellRendererTextPriv *priv;
-
- priv = GET_PRIV (cell);
+ EmpathyCellRendererTextPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
+ EMPATHY_TYPE_CELL_RENDERER_TEXT, EmpathyCellRendererTextPriv);
+ cell->priv = priv;
g_object_set (cell,
"ellipsize", PANGO_ELLIPSIZE_END,
NULL);
Modified: trunk/libempathy-gtk/empathy-cell-renderer-text.h
==============================================================================
--- trunk/libempathy-gtk/empathy-cell-renderer-text.h (original)
+++ trunk/libempathy-gtk/empathy-cell-renderer-text.h Mon May 5 20:34:41 2008
@@ -36,12 +36,10 @@
typedef struct _EmpathyCellRendererText EmpathyCellRendererText;
typedef struct _EmpathyCellRendererTextClass EmpathyCellRendererTextClass;
-typedef struct _EmpathyCellRendererTextPriv EmpathyCellRendererTextPriv;
struct _EmpathyCellRendererText {
- GtkCellRendererText parent;
-
- EmpathyCellRendererTextPriv *priv;
+ GtkCellRendererText parent;
+ gpointer priv;
};
struct _EmpathyCellRendererTextClass {
Modified: trunk/libempathy-gtk/empathy-chat-view.c
==============================================================================
--- trunk/libempathy-gtk/empathy-chat-view.c (original)
+++ trunk/libempathy-gtk/empathy-chat-view.c Mon May 5 20:34:41 2008
@@ -61,9 +61,8 @@
#define MAX_SCROLL_TIME 0.4 /* seconds */
#define SCROLL_DELAY 33 /* milliseconds */
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHAT_VIEW, EmpathyChatViewPriv))
-
-struct _EmpathyChatViewPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatView)
+typedef struct {
GtkTextBuffer *buffer;
EmpathyTheme *theme;
@@ -86,10 +85,8 @@
guint notify_system_fonts_id;
guint notify_show_avatars_id;
-};
+} EmpathyChatViewPriv;
-static void empathy_chat_view_class_init (EmpathyChatViewClass *klass);
-static void empathy_chat_view_init (EmpathyChatView *view);
static void chat_view_finalize (GObject *object);
static gboolean chat_view_drag_motion (GtkWidget *widget,
GdkDragContext *context,
@@ -148,11 +145,11 @@
static void
empathy_chat_view_init (EmpathyChatView *view)
{
- EmpathyChatViewPriv *priv;
- gboolean show_avatars;
-
- priv = GET_PRIV (view);
+ gboolean show_avatars;
+ EmpathyChatViewPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
+ EMPATHY_TYPE_CHAT_VIEW, EmpathyChatViewPriv);
+ view->priv = priv;
priv->buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
priv->last_timestamp = 0;
priv->allow_scrolling = TRUE;
Modified: trunk/libempathy-gtk/empathy-chat-view.h
==============================================================================
--- trunk/libempathy-gtk/empathy-chat-view.h (original)
+++ trunk/libempathy-gtk/empathy-chat-view.h Mon May 5 20:34:41 2008
@@ -41,12 +41,12 @@
typedef struct _EmpathyChatView EmpathyChatView;
typedef struct _EmpathyChatViewClass EmpathyChatViewClass;
-typedef struct _EmpathyChatViewPriv EmpathyChatViewPriv;
#include "empathy-theme.h"
struct _EmpathyChatView {
GtkTextView parent;
+ gpointer priv;
};
struct _EmpathyChatViewClass {
Modified: trunk/libempathy-gtk/empathy-chat.c
==============================================================================
--- trunk/libempathy-gtk/empathy-chat.c (original)
+++ trunk/libempathy-gtk/empathy-chat.c Mon May 5 20:34:41 2008
@@ -53,15 +53,14 @@
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHAT, EmpathyChatPriv))
-
#define CHAT_DIR_CREATE_MODE (S_IRUSR | S_IWUSR | S_IXUSR)
#define CHAT_FILE_CREATE_MODE (S_IRUSR | S_IWUSR)
#define IS_ENTER(v) (v == GDK_Return || v == GDK_ISO_Enter || v == GDK_KP_Enter)
#define MAX_INPUT_HEIGHT 150
#define COMPOSING_STOP_TIMEOUT 5
-struct _EmpathyChatPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChat)
+typedef struct {
EmpathyTpChat *tp_chat;
McAccount *account;
gchar *id;
@@ -92,10 +91,7 @@
GtkWidget *hbox_topic;
GtkWidget *label_topic;
GtkWidget *contact_list_view;
-};
-
-static void empathy_chat_class_init (EmpathyChatClass *klass);
-static void empathy_chat_init (EmpathyChat *chat);
+} EmpathyChatPriv;
enum {
COMPOSING,
@@ -1532,8 +1528,10 @@
static void
empathy_chat_init (EmpathyChat *chat)
{
- EmpathyChatPriv *priv = GET_PRIV (chat);
+ EmpathyChatPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chat,
+ EMPATHY_TYPE_CHAT, EmpathyChatPriv);
+ chat->priv = priv;
priv->log_manager = empathy_log_manager_new ();
priv->contacts_width = -1;
priv->sent_messages = NULL;
Modified: trunk/libempathy-gtk/empathy-chat.h
==============================================================================
--- trunk/libempathy-gtk/empathy-chat.h (original)
+++ trunk/libempathy-gtk/empathy-chat.h Mon May 5 20:34:41 2008
@@ -47,10 +47,10 @@
typedef struct _EmpathyChat EmpathyChat;
typedef struct _EmpathyChatClass EmpathyChatClass;
-typedef struct _EmpathyChatPriv EmpathyChatPriv;
struct _EmpathyChat {
GtkBin parent;
+ gpointer priv;
/* Protected */
EmpathyChatView *view;
Modified: trunk/libempathy-gtk/empathy-conf.c
==============================================================================
--- trunk/libempathy-gtk/empathy-conf.c (original)
+++ trunk/libempathy-gtk/empathy-conf.c Mon May 5 20:34:41 2008
@@ -26,6 +26,7 @@
#include <gconf/gconf-client.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-conf.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
@@ -34,8 +35,7 @@
#define EMPATHY_CONF_ROOT "/apps/empathy"
#define DESKTOP_INTERFACE_ROOT "/desktop/gnome/interface"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONF, EmpathyConfPriv))
-
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyConf)
typedef struct {
GConfClient *gconf_client;
} EmpathyConfPriv;
@@ -67,10 +67,10 @@
static void
empathy_conf_init (EmpathyConf *conf)
{
- EmpathyConfPriv *priv;
-
- priv = GET_PRIV (conf);
+ EmpathyConfPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (conf,
+ EMPATHY_TYPE_CONF, EmpathyConfPriv);
+ conf->priv = priv;
priv->gconf_client = gconf_client_get_default ();
gconf_client_add_dir (priv->gconf_client,
Modified: trunk/libempathy-gtk/empathy-conf.h
==============================================================================
--- trunk/libempathy-gtk/empathy-conf.h (original)
+++ trunk/libempathy-gtk/empathy-conf.h Mon May 5 20:34:41 2008
@@ -37,6 +37,7 @@
struct _EmpathyConf {
GObject parent;
+ gpointer priv;
};
struct _EmpathyConfClass {
Modified: trunk/libempathy-gtk/empathy-contact-list-store.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-store.c (original)
+++ trunk/libempathy-gtk/empathy-contact-list-store.c Mon May 5 20:34:41 2008
@@ -32,6 +32,7 @@
#include <telepathy-glib/util.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-contact-list-store.h"
#include "empathy-ui-utils.h"
#include "empathy-gtk-enum-types.h"
@@ -49,8 +50,7 @@
/* Time in seconds after connecting which we wait before active users are enabled */
#define ACTIVE_USER_WAIT_TO_ENABLE_TIME 5
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONTACT_LIST_STORE, EmpathyContactListStorePriv))
-
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContactListStore)
typedef struct {
EmpathyContactList *list;
gboolean show_offline;
@@ -80,8 +80,6 @@
gboolean remove;
} ShowActiveData;
-static void empathy_contact_list_store_class_init (EmpathyContactListStoreClass *klass);
-static void empathy_contact_list_store_init (EmpathyContactListStore *list);
static void contact_list_store_finalize (GObject *object);
static void contact_list_store_get_property (GObject *object,
guint param_id,
@@ -272,10 +270,10 @@
static void
empathy_contact_list_store_init (EmpathyContactListStore *store)
{
- EmpathyContactListStorePriv *priv;
-
- priv = GET_PRIV (store);
+ EmpathyContactListStorePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (store,
+ EMPATHY_TYPE_CONTACT_LIST_STORE, EmpathyContactListStorePriv);
+ store->priv = priv;
priv->show_avatars = TRUE;
priv->show_groups = TRUE;
priv->inhibit_active = g_timeout_add_seconds (ACTIVE_USER_WAIT_TO_ENABLE_TIME,
Modified: trunk/libempathy-gtk/empathy-contact-list-store.h
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-store.h (original)
+++ trunk/libempathy-gtk/empathy-contact-list-store.h Mon May 5 20:34:41 2008
@@ -66,6 +66,7 @@
struct _EmpathyContactListStore {
GtkTreeStore parent;
+ gpointer priv;
};
struct _EmpathyContactListStoreClass {
Modified: trunk/libempathy-gtk/empathy-contact-list-view.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-view.c (original)
+++ trunk/libempathy-gtk/empathy-contact-list-view.c Mon May 5 20:34:41 2008
@@ -58,8 +58,7 @@
* (e.g. online, offline or from normal to a busy state).
*/
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONTACT_LIST_VIEW, EmpathyContactListViewPriv))
-
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContactListView)
typedef struct {
EmpathyContactListStore *store;
GtkTreeRowReference *drag_row;
@@ -1014,6 +1013,10 @@
static void
empathy_contact_list_view_init (EmpathyContactListView *view)
{
+ EmpathyContactListViewPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
+ EMPATHY_TYPE_CONTACT_LIST_VIEW, EmpathyContactListViewPriv);
+
+ view->priv = priv;
/* Get saved group states. */
empathy_contact_groups_get_all ();
Modified: trunk/libempathy-gtk/empathy-contact-list-view.h
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-view.h (original)
+++ trunk/libempathy-gtk/empathy-contact-list-view.h Mon May 5 20:34:41 2008
@@ -57,11 +57,12 @@
} EmpathyContactListFeatureFlags;
struct _EmpathyContactListView {
- GtkTreeView parent;
+ GtkTreeView parent;
+ gpointer priv;
};
struct _EmpathyContactListViewClass {
- GtkTreeViewClass parent_class;
+ GtkTreeViewClass parent_class;
};
GType empathy_contact_list_view_get_type (void) G_GNUC_CONST;
Modified: trunk/libempathy-gtk/empathy-presence-chooser.c
==============================================================================
--- trunk/libempathy-gtk/empathy-presence-chooser.c (original)
+++ trunk/libempathy-gtk/empathy-presence-chooser.c Mon May 5 20:34:41 2008
@@ -42,11 +42,10 @@
#include "empathy-images.h"
#include "empathy-presence-chooser.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_PRESENCE_CHOOSER, EmpathyPresenceChooserPriv))
-
/* Flashing delay for icons (milliseconds). */
#define FLASH_TIMEOUT 500
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyPresenceChooser)
typedef struct {
EmpathyIdle *idle;
@@ -97,8 +96,6 @@
MC_PRESENCE_HIDDEN, FALSE,
MC_PRESENCE_OFFLINE, FALSE};
-static void empathy_presence_chooser_class_init (EmpathyPresenceChooserClass *klass);
-static void empathy_presence_chooser_init (EmpathyPresenceChooser *chooser);
static void presence_chooser_finalize (GObject *object);
static void presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser);
static void presence_chooser_reset_scroll_timeout (EmpathyPresenceChooser *chooser);
@@ -159,12 +156,12 @@
static void
empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
{
- EmpathyPresenceChooserPriv *priv;
- GtkWidget *arrow;
- GtkWidget *alignment;
-
- priv = GET_PRIV (chooser);
+ GtkWidget *arrow;
+ GtkWidget *alignment;
+ EmpathyPresenceChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
+ EMPATHY_TYPE_PRESENCE_CHOOSER, EmpathyPresenceChooserPriv);
+ chooser->priv = priv;
gtk_button_set_relief (GTK_BUTTON (chooser), GTK_RELIEF_NONE);
gtk_button_set_focus_on_click (GTK_BUTTON (chooser), FALSE);
Modified: trunk/libempathy-gtk/empathy-presence-chooser.h
==============================================================================
--- trunk/libempathy-gtk/empathy-presence-chooser.h (original)
+++ trunk/libempathy-gtk/empathy-presence-chooser.h Mon May 5 20:34:41 2008
@@ -41,6 +41,7 @@
struct _EmpathyPresenceChooser {
GtkToggleButton parent;
+ gpointer priv;
};
struct _EmpathyPresenceChooserClass {
Modified: trunk/libempathy-gtk/empathy-smiley-manager.c
==============================================================================
--- trunk/libempathy-gtk/empathy-smiley-manager.c (original)
+++ trunk/libempathy-gtk/empathy-smiley-manager.c Mon May 5 20:34:41 2008
@@ -24,26 +24,24 @@
#include <string.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-smiley-manager.h"
#include "empathy-ui-utils.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_SMILEY_MANAGER, EmpathySmileyManagerPriv))
+typedef struct _SmileyManagerTree SmileyManagerTree;
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathySmileyManager)
typedef struct {
+ SmileyManagerTree *tree;
+ GSList *smileys;
+} EmpathySmileyManagerPriv;
+
+struct _SmileyManagerTree {
gunichar c;
GdkPixbuf *pixbuf;
GSList *childrens;
-} SmileyManagerTree;
-
-struct _EmpathySmileyManagerPriv {
- SmileyManagerTree *tree;
- GSList *smileys;
};
-static void empathy_smiley_manager_class_init (EmpathySmileyManagerClass *klass);
-static void empathy_smiley_manager_init (EmpathySmileyManager *manager);
-
G_DEFINE_TYPE (EmpathySmileyManager, empathy_smiley_manager, G_TYPE_OBJECT);
static SmileyManagerTree *
@@ -130,8 +128,10 @@
static void
empathy_smiley_manager_init (EmpathySmileyManager *manager)
{
- EmpathySmileyManagerPriv *priv = GET_PRIV (manager);
+ EmpathySmileyManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
+ EMPATHY_TYPE_SMILEY_MANAGER, EmpathySmileyManagerPriv);
+ manager->priv = priv;
priv->tree = smiley_manager_tree_new ('\0');
priv->smileys = NULL;
}
Modified: trunk/libempathy-gtk/empathy-smiley-manager.h
==============================================================================
--- trunk/libempathy-gtk/empathy-smiley-manager.h (original)
+++ trunk/libempathy-gtk/empathy-smiley-manager.h Mon May 5 20:34:41 2008
@@ -37,10 +37,10 @@
typedef struct _EmpathySmileyManager EmpathySmileyManager;
typedef struct _EmpathySmileyManagerClass EmpathySmileyManagerClass;
-typedef struct _EmpathySmileyManagerPriv EmpathySmileyManagerPriv;
struct _EmpathySmileyManager {
GObject parent;
+ gpointer priv;
};
struct _EmpathySmileyManagerClass {
Modified: trunk/libempathy-gtk/empathy-theme-boxes.c
==============================================================================
--- trunk/libempathy-gtk/empathy-theme-boxes.c (original)
+++ trunk/libempathy-gtk/empathy-theme-boxes.c Mon May 5 20:34:41 2008
@@ -25,6 +25,7 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-ui-utils.h"
#include "empathy-theme-boxes.h"
@@ -34,11 +35,8 @@
#define MARGIN 4
#define HEADER_PADDING 2
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_THEME_BOXES, EmpathyThemeBoxesPriv))
-
-typedef struct _EmpathyThemeBoxesPriv EmpathyThemeBoxesPriv;
-
-struct _EmpathyThemeBoxesPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyThemeBoxes)
+typedef struct {
gchar *header_foreground;
gchar *header_background;
gchar *header_line_background;
@@ -50,7 +48,7 @@
gchar *event_foreground;
gchar *invite_foreground;
gchar *link_foreground;
-};
+} EmpathyThemeBoxesPriv;
static void theme_boxes_finalize (GObject *object);
static void theme_boxes_get_property (GObject *object,
@@ -215,9 +213,10 @@
static void
empathy_theme_boxes_init (EmpathyThemeBoxes *theme)
{
- EmpathyThemeBoxesPriv *priv;
+ EmpathyThemeBoxesPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (theme,
+ EMPATHY_TYPE_THEME_BOXES, EmpathyThemeBoxesPriv);
- priv = GET_PRIV (theme);
+ theme->priv = priv;
}
static void
@@ -672,7 +671,7 @@
sender = empathy_message_get_sender (message);
- if (empathy_message_get_type (message) == EMPATHY_MESSAGE_TYPE_ACTION) {
+ if (empathy_message_get_tptype (message) == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION) {
gchar *body;
body = g_strdup_printf (" * %s %s",
Modified: trunk/libempathy-gtk/empathy-theme-boxes.h
==============================================================================
--- trunk/libempathy-gtk/empathy-theme-boxes.h (original)
+++ trunk/libempathy-gtk/empathy-theme-boxes.h Mon May 5 20:34:41 2008
@@ -39,6 +39,7 @@
struct _EmpathyThemeBoxes {
EmpathyTheme parent;
+ gpointer priv;
};
struct _EmpathyThemeBoxesClass {
Modified: trunk/libempathy-gtk/empathy-theme-irc.c
==============================================================================
--- trunk/libempathy-gtk/empathy-theme-irc.c (original)
+++ trunk/libempathy-gtk/empathy-theme-irc.c Mon May 5 20:34:41 2008
@@ -22,17 +22,15 @@
#include <glib/gi18n.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-chat.h"
#include "empathy-ui-utils.h"
#include "empathy-theme-irc.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_THEME_IRC, EmpathyThemeIrcPriv))
-
-typedef struct _EmpathyThemeIrcPriv EmpathyThemeIrcPriv;
-
-struct _EmpathyThemeIrcPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyThemeIrc)
+typedef struct {
gint my_prop;
-};
+} EmpathyThemeIrcPriv;
static void theme_irc_finalize (GObject *object);
static void theme_irc_update_view (EmpathyTheme *theme,
@@ -80,11 +78,12 @@
}
static void
-empathy_theme_irc_init (EmpathyThemeIrc *presence)
+empathy_theme_irc_init (EmpathyThemeIrc *theme)
{
- EmpathyThemeIrcPriv *priv;
+ EmpathyThemeIrcPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (theme,
+ EMPATHY_TYPE_THEME_IRC, EmpathyThemeIrcPriv);
- priv = GET_PRIV (presence);
+ theme->priv = priv;
}
static void
@@ -192,7 +191,7 @@
contact = empathy_message_get_sender (message);
name = empathy_contact_get_name (contact);
- if (empathy_message_get_type (message) == EMPATHY_MESSAGE_TYPE_ACTION) {
+ if (empathy_message_get_tptype (message) == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION) {
if (empathy_contact_is_user (contact)) {
body_tag = "irc-action-self";
} else {
Modified: trunk/libempathy-gtk/empathy-theme-irc.h
==============================================================================
--- trunk/libempathy-gtk/empathy-theme-irc.h (original)
+++ trunk/libempathy-gtk/empathy-theme-irc.h Mon May 5 20:34:41 2008
@@ -39,6 +39,7 @@
struct _EmpathyThemeIrc {
EmpathyTheme parent;
+ gpointer priv;
};
struct _EmpathyThemeIrcClass {
Modified: trunk/libempathy-gtk/empathy-theme-manager.c
==============================================================================
--- trunk/libempathy-gtk/empathy-theme-manager.c (original)
+++ trunk/libempathy-gtk/empathy-theme-manager.c Mon May 5 20:34:41 2008
@@ -34,8 +34,7 @@
#include "empathy-theme-irc.h"
#include "empathy-theme-manager.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_THEME_MANAGER, EmpathyThemeManagerPriv))
-
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyThemeManager)
typedef struct {
gchar *name;
guint name_notify_id;
@@ -211,10 +210,10 @@
static void
empathy_theme_manager_init (EmpathyThemeManager *manager)
{
- EmpathyThemeManagerPriv *priv;
-
- priv = GET_PRIV (manager);
+ EmpathyThemeManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
+ EMPATHY_TYPE_THEME_MANAGER, EmpathyThemeManagerPriv);
+ manager->priv = priv;
priv->name_notify_id =
empathy_conf_notify_add (empathy_conf_get (),
EMPATHY_PREFS_CHAT_THEME,
Modified: trunk/libempathy-gtk/empathy-theme-manager.h
==============================================================================
--- trunk/libempathy-gtk/empathy-theme-manager.h (original)
+++ trunk/libempathy-gtk/empathy-theme-manager.h Mon May 5 20:34:41 2008
@@ -36,7 +36,8 @@
typedef struct _EmpathyThemeManagerClass EmpathyThemeManagerClass;
struct _EmpathyThemeManager {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyThemeManagerClass {
Modified: trunk/libempathy-gtk/empathy-theme.c
==============================================================================
--- trunk/libempathy-gtk/empathy-theme.c (original)
+++ trunk/libempathy-gtk/empathy-theme.c Mon May 5 20:34:41 2008
@@ -34,14 +34,11 @@
/* Number of seconds between timestamps when using normal mode, 5 minutes. */
#define TIMESTAMP_INTERVAL 300
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_THEME, EmpathyThemePriv))
-
-typedef struct _EmpathyThemePriv EmpathyThemePriv;
-
-struct _EmpathyThemePriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTheme)
+typedef struct {
EmpathySmileyManager *smiley_manager;
gboolean show_avatars;
-};
+} EmpathyThemePriv;
static void theme_finalize (GObject *object);
static void theme_get_property (GObject *object,
@@ -89,12 +86,12 @@
}
static void
-empathy_theme_init (EmpathyTheme *presence)
+empathy_theme_init (EmpathyTheme *theme)
{
- EmpathyThemePriv *priv;
-
- priv = GET_PRIV (presence);
+ EmpathyThemePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (theme,
+ EMPATHY_TYPE_THEME, EmpathyThemePriv);
+ theme->priv = priv;
priv->smiley_manager = empathy_smiley_manager_new ();
}
Modified: trunk/libempathy-gtk/empathy-theme.h
==============================================================================
--- trunk/libempathy-gtk/empathy-theme.h (original)
+++ trunk/libempathy-gtk/empathy-theme.h Mon May 5 20:34:41 2008
@@ -40,6 +40,7 @@
struct _EmpathyTheme {
GObject parent;
+ gpointer priv;
};
struct _EmpathyThemeClass {
Modified: trunk/libempathy/empathy-chatroom-manager.c
==============================================================================
--- trunk/libempathy/empathy-chatroom-manager.c (original)
+++ trunk/libempathy/empathy-chatroom-manager.c Mon May 5 20:34:41 2008
@@ -37,17 +37,14 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHATROOM_MANAGER, EmpathyChatroomManagerPriv))
-
#define CHATROOMS_XML_FILENAME "chatrooms.xml"
#define CHATROOMS_DTD_FILENAME "empathy-chatroom-manager.dtd"
-struct _EmpathyChatroomManagerPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatroomManager)
+typedef struct {
GList *chatrooms;
-};
+} EmpathyChatroomManagerPriv;
-static void empathy_chatroom_manager_class_init (EmpathyChatroomManagerClass *klass);
-static void empathy_chatroom_manager_init (EmpathyChatroomManager *manager);
static void chatroom_manager_finalize (GObject *object);
static gboolean chatroom_manager_get_all (EmpathyChatroomManager *manager);
static gboolean chatroom_manager_file_parse (EmpathyChatroomManager *manager,
@@ -99,9 +96,10 @@
static void
empathy_chatroom_manager_init (EmpathyChatroomManager *manager)
{
- EmpathyChatroomManagerPriv *priv;
+ EmpathyChatroomManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
+ EMPATHY_TYPE_CHATROOM_MANAGER, EmpathyChatroomManagerPriv);
- priv = GET_PRIV (manager);
+ manager->priv = priv;
}
static void
Modified: trunk/libempathy/empathy-chatroom-manager.h
==============================================================================
--- trunk/libempathy/empathy-chatroom-manager.h (original)
+++ trunk/libempathy/empathy-chatroom-manager.h Mon May 5 20:34:41 2008
@@ -42,10 +42,10 @@
typedef struct _EmpathyChatroomManager EmpathyChatroomManager;
typedef struct _EmpathyChatroomManagerClass EmpathyChatroomManagerClass;
-typedef struct _EmpathyChatroomManagerPriv EmpathyChatroomManagerPriv;
struct _EmpathyChatroomManager {
GObject parent;
+ gpointer priv;
};
struct _EmpathyChatroomManagerClass {
Modified: trunk/libempathy/empathy-chatroom.c
==============================================================================
--- trunk/libempathy/empathy-chatroom.c (original)
+++ trunk/libempathy/empathy-chatroom.c Mon May 5 20:34:41 2008
@@ -28,17 +28,15 @@
#include "empathy-chatroom.h"
#include "empathy-utils.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHATROOM, EmpathyChatroomPriv))
-
-struct _EmpathyChatroomPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatroom)
+typedef struct {
McAccount *account;
gchar *room;
gchar *name;
gboolean auto_connect;
-};
+} EmpathyChatroomPriv;
+
-static void empathy_chatroom_class_init (EmpathyChatroomClass *klass);
-static void empathy_chatroom_init (EmpathyChatroom *chatroom);
static void chatroom_finalize (GObject *object);
static void chatroom_get_property (GObject *object,
guint param_id,
@@ -107,6 +105,10 @@
static void
empathy_chatroom_init (EmpathyChatroom *chatroom)
{
+ EmpathyChatroomPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chatroom,
+ EMPATHY_TYPE_CHATROOM, EmpathyChatroomPriv);
+
+ chatroom->priv = priv;
}
static void
Modified: trunk/libempathy/empathy-chatroom.h
==============================================================================
--- trunk/libempathy/empathy-chatroom.h (original)
+++ trunk/libempathy/empathy-chatroom.h Mon May 5 20:34:41 2008
@@ -39,10 +39,10 @@
typedef struct _EmpathyChatroom EmpathyChatroom;
typedef struct _EmpathyChatroomClass EmpathyChatroomClass;
-typedef struct _EmpathyChatroomPriv EmpathyChatroomPriv;
struct _EmpathyChatroom {
GObject parent;
+ gpointer priv;
};
struct _EmpathyChatroomClass {
Modified: trunk/libempathy/empathy-contact-factory.c
==============================================================================
--- trunk/libempathy/empathy-contact-factory.c (original)
+++ trunk/libempathy/empathy-contact-factory.c Mon May 5 20:34:41 2008
@@ -24,15 +24,10 @@
#include "empathy-contact-factory.h"
#include "empathy-utils.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_CONTACT_FACTORY, EmpathyContactFactoryPriv))
-
-struct _EmpathyContactFactoryPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContactFactory)
+typedef struct {
GHashTable *accounts;
-};
-
-static void empathy_contact_factory_class_init (EmpathyContactFactoryClass *klass);
-static void empathy_contact_factory_init (EmpathyContactFactory *factory);
+} EmpathyContactFactoryPriv;
G_DEFINE_TYPE (EmpathyContactFactory, empathy_contact_factory, G_TYPE_OBJECT);
@@ -153,8 +148,10 @@
static void
empathy_contact_factory_init (EmpathyContactFactory *factory)
{
- EmpathyContactFactoryPriv *priv = GET_PRIV (factory);
+ EmpathyContactFactoryPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (factory,
+ EMPATHY_TYPE_CONTACT_FACTORY, EmpathyContactFactoryPriv);
+ factory->priv = priv;
priv->accounts = g_hash_table_new_full (empathy_account_hash,
empathy_account_equal,
g_object_unref,
Modified: trunk/libempathy/empathy-contact-factory.h
==============================================================================
--- trunk/libempathy/empathy-contact-factory.h (original)
+++ trunk/libempathy/empathy-contact-factory.h Mon May 5 20:34:41 2008
@@ -40,10 +40,10 @@
typedef struct _EmpathyContactFactory EmpathyContactFactory;
typedef struct _EmpathyContactFactoryClass EmpathyContactFactoryClass;
-typedef struct _EmpathyContactFactoryPriv EmpathyContactFactoryPriv;
struct _EmpathyContactFactory {
GObject parent;
+ gpointer priv;
};
struct _EmpathyContactFactoryClass {
Modified: trunk/libempathy/empathy-contact-manager.c
==============================================================================
--- trunk/libempathy/empathy-contact-manager.c (original)
+++ trunk/libempathy/empathy-contact-manager.c Mon May 5 20:34:41 2008
@@ -32,17 +32,13 @@
#define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_CONTACT_MANAGER, EmpathyContactManagerPriv))
-
-struct _EmpathyContactManagerPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContactManager)
+typedef struct {
GHashTable *lists;
MissionControl *mc;
gpointer token;
-};
+} EmpathyContactManagerPriv;
-static void empathy_contact_manager_class_init (EmpathyContactManagerClass *klass);
-static void empathy_contact_manager_init (EmpathyContactManager *manager);
static void contact_manager_iface_init (EmpathyContactListIface *iface);
G_DEFINE_TYPE_WITH_CODE (EmpathyContactManager, empathy_contact_manager, G_TYPE_OBJECT,
@@ -208,11 +204,11 @@
static void
empathy_contact_manager_init (EmpathyContactManager *manager)
{
- EmpathyContactManagerPriv *priv;
GSList *accounts, *l;
+ EmpathyContactManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
+ EMPATHY_TYPE_CONTACT_MANAGER, EmpathyContactManagerPriv);
- priv = GET_PRIV (manager);
-
+ manager->priv = priv;
priv->lists = g_hash_table_new_full (empathy_account_hash,
empathy_account_equal,
(GDestroyNotify) g_object_unref,
Modified: trunk/libempathy/empathy-contact-manager.h
==============================================================================
--- trunk/libempathy/empathy-contact-manager.h (original)
+++ trunk/libempathy/empathy-contact-manager.h Mon May 5 20:34:41 2008
@@ -40,10 +40,10 @@
typedef struct _EmpathyContactManager EmpathyContactManager;
typedef struct _EmpathyContactManagerClass EmpathyContactManagerClass;
-typedef struct _EmpathyContactManagerPriv EmpathyContactManagerPriv;
struct _EmpathyContactManager {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyContactManagerClass {
Modified: trunk/libempathy/empathy-contact.c
==============================================================================
--- trunk/libempathy/empathy-contact.c (original)
+++ trunk/libempathy/empathy-contact.c Mon May 5 20:34:41 2008
@@ -38,11 +38,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONTACT, EmpathyContactPriv))
-
-typedef struct _EmpathyContactPriv EmpathyContactPriv;
-
-struct _EmpathyContactPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContact)
+typedef struct {
gchar *id;
gchar *name;
EmpathyAvatar *avatar;
@@ -54,10 +51,8 @@
gboolean is_user;
guint hash;
EmpathyContactReady ready;
-};
+} EmpathyContactPriv;
-static void empathy_contact_class_init (EmpathyContactClass *class);
-static void empathy_contact_init (EmpathyContact *contact);
static void contact_finalize (GObject *object);
static void contact_get_property (GObject *object,
guint param_id,
@@ -186,6 +181,10 @@
static void
empathy_contact_init (EmpathyContact *contact)
{
+ EmpathyContactPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (contact,
+ EMPATHY_TYPE_CONTACT, EmpathyContactPriv);
+
+ contact->priv = priv;
}
static void
Modified: trunk/libempathy/empathy-contact.h
==============================================================================
--- trunk/libempathy/empathy-contact.h (original)
+++ trunk/libempathy/empathy-contact.h Mon May 5 20:34:41 2008
@@ -47,6 +47,7 @@
struct _EmpathyContact {
GObject parent;
+ gpointer priv;
};
struct _EmpathyContactClass {
Modified: trunk/libempathy/empathy-idle.c
==============================================================================
--- trunk/libempathy/empathy-idle.c (original)
+++ trunk/libempathy/empathy-idle.c Mon May 5 20:34:41 2008
@@ -36,21 +36,11 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_IDLE, EmpathyIdlePriv))
-
/* Number of seconds before entering extended autoaway. */
#define EXT_AWAY_TIME (30*60)
-typedef enum {
- NM_STATE_UNKNOWN,
- NM_STATE_ASLEEP,
- NM_STATE_CONNECTING,
- NM_STATE_CONNECTED,
- NM_STATE_DISCONNECTED
-} NMState;
-
-struct _EmpathyIdlePriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIdle)
+typedef struct {
MissionControl *mc;
DBusGProxy *gs_proxy;
DBusGProxy *nm_proxy;
@@ -69,10 +59,16 @@
gboolean is_idle;
gboolean nm_connected;
guint ext_away_timeout;
-};
+} EmpathyIdlePriv;
+
+typedef enum {
+ NM_STATE_UNKNOWN,
+ NM_STATE_ASLEEP,
+ NM_STATE_CONNECTING,
+ NM_STATE_CONNECTED,
+ NM_STATE_DISCONNECTED
+} NMState;
-static void empathy_idle_class_init (EmpathyIdleClass *klass);
-static void empathy_idle_init (EmpathyIdle *idle);
static void idle_finalize (GObject *object);
static void idle_get_property (GObject *object,
guint param_id,
@@ -162,12 +158,12 @@
static void
empathy_idle_init (EmpathyIdle *idle)
{
- EmpathyIdlePriv *priv;
DBusGConnection *system_bus;
GError *error = NULL;
+ EmpathyIdlePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (idle,
+ EMPATHY_TYPE_IDLE, EmpathyIdlePriv);
- priv = GET_PRIV (idle);
-
+ idle->priv = priv;
priv->is_idle = FALSE;
priv->mc = empathy_mission_control_new ();
priv->state = mission_control_get_presence_actual (priv->mc, NULL);
Modified: trunk/libempathy/empathy-idle.h
==============================================================================
--- trunk/libempathy/empathy-idle.h (original)
+++ trunk/libempathy/empathy-idle.h Mon May 5 20:34:41 2008
@@ -37,10 +37,10 @@
typedef struct _EmpathyIdle EmpathyIdle;
typedef struct _EmpathyIdleClass EmpathyIdleClass;
-typedef struct _EmpathyIdlePriv EmpathyIdlePriv;
struct _EmpathyIdle {
GObject parent;
+ gpointer priv;
};
struct _EmpathyIdleClass {
Modified: trunk/libempathy/empathy-irc-network-manager.c
==============================================================================
--- trunk/libempathy/empathy-irc-network-manager.c (original)
+++ trunk/libempathy/empathy-irc-network-manager.c Mon May 5 20:34:41 2008
@@ -36,21 +36,8 @@
#define IRC_NETWORKS_DTD_FILENAME "empathy-irc-networks.dtd"
#define SAVE_TIMER 4
-G_DEFINE_TYPE (EmpathyIrcNetworkManager, empathy_irc_network_manager,
- G_TYPE_OBJECT);
-
-/* properties */
-enum
-{
- PROP_GLOBAL_FILE = 1,
- PROP_USER_FILE,
- LAST_PROPERTY
-};
-
-typedef struct _EmpathyIrcNetworkManagerPrivate
- EmpathyIrcNetworkManagerPrivate;
-
-struct _EmpathyIrcNetworkManagerPrivate {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcNetworkManager)
+typedef struct {
GHashTable *networks;
gchar *global_file;
@@ -63,10 +50,18 @@
gboolean loading;
/* source id of the autosave timer */
gint save_timer_id;
+} EmpathyIrcNetworkManagerPriv;
+
+/* properties */
+enum
+{
+ PROP_GLOBAL_FILE = 1,
+ PROP_USER_FILE,
+ LAST_PROPERTY
};
-#define EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE(obj)\
- ((EmpathyIrcNetworkManagerPrivate *) obj->priv)
+G_DEFINE_TYPE (EmpathyIrcNetworkManager, empathy_irc_network_manager,
+ G_TYPE_OBJECT);
static void irc_network_manager_load_servers (
EmpathyIrcNetworkManager *manager);
@@ -83,8 +78,7 @@
GParamSpec *pspec)
{
EmpathyIrcNetworkManager *self = EMPATHY_IRC_NETWORK_MANAGER (object);
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -107,8 +101,7 @@
GParamSpec *pspec)
{
EmpathyIrcNetworkManager *self = EMPATHY_IRC_NETWORK_MANAGER (object);
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -148,8 +141,7 @@
empathy_irc_network_manager_finalize (GObject *object)
{
EmpathyIrcNetworkManager *self = EMPATHY_IRC_NETWORK_MANAGER (object);
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
if (priv->save_timer_id > 0)
{
@@ -172,8 +164,8 @@
static void
empathy_irc_network_manager_init (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
- EMPATHY_TYPE_IRC_NETWORK_MANAGER, EmpathyIrcNetworkManagerPrivate);
+ EmpathyIrcNetworkManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+ EMPATHY_TYPE_IRC_NETWORK_MANAGER, EmpathyIrcNetworkManagerPriv);
self->priv = priv;
@@ -197,8 +189,7 @@
object_class->get_property = empathy_irc_network_manager_get_property;
object_class->set_property = empathy_irc_network_manager_set_property;
- g_type_class_add_private (object_class,
- sizeof (EmpathyIrcNetworkManagerPrivate));
+ g_type_class_add_private (object_class, sizeof (EmpathyIrcNetworkManagerPriv));
object_class->finalize = empathy_irc_network_manager_finalize;
@@ -255,8 +246,7 @@
static gboolean
save_timeout (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
priv->save_timer_id = 0;
irc_network_manager_file_save (self);
@@ -267,8 +257,7 @@
static void
reset_save_timeout (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
if (priv->save_timer_id > 0)
{
@@ -283,8 +272,7 @@
network_modified (EmpathyIrcNetwork *network,
EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
network->user_defined = TRUE;
@@ -300,8 +288,7 @@
EmpathyIrcNetwork *network,
const gchar *id)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
g_hash_table_insert (priv->networks, g_strdup (id), g_object_ref (network));
@@ -320,13 +307,13 @@
empathy_irc_network_manager_add (EmpathyIrcNetworkManager *self,
EmpathyIrcNetwork *network)
{
- EmpathyIrcNetworkManagerPrivate *priv;
+ EmpathyIrcNetworkManagerPriv *priv;
gchar *id = NULL;
g_return_if_fail (EMPATHY_IS_IRC_NETWORK_MANAGER (self));
g_return_if_fail (EMPATHY_IS_IRC_NETWORK (network));
- priv = EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
/* generate an id for this network */
do
@@ -365,12 +352,12 @@
empathy_irc_network_manager_remove (EmpathyIrcNetworkManager *self,
EmpathyIrcNetwork *network)
{
- EmpathyIrcNetworkManagerPrivate *priv;
+ EmpathyIrcNetworkManagerPriv *priv;
g_return_if_fail (EMPATHY_IS_IRC_NETWORK_MANAGER (self));
g_return_if_fail (EMPATHY_IS_IRC_NETWORK (network));
- priv = EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
network->user_defined = TRUE;
network->dropped = TRUE;
@@ -402,12 +389,12 @@
GSList *
empathy_irc_network_manager_get_networks (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv;
+ EmpathyIrcNetworkManagerPriv *priv;
GSList *irc_networks = NULL;
g_return_val_if_fail (EMPATHY_IS_IRC_NETWORK_MANAGER (self), NULL);
- priv = EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
g_hash_table_foreach (priv->networks, (GHFunc) append_network_to_list,
&irc_networks);
@@ -422,8 +409,7 @@
static void
load_global_file (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
if (priv->global_file == NULL)
return;
@@ -440,8 +426,7 @@
static void
load_user_file (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
if (priv->user_file == NULL)
return;
@@ -458,8 +443,7 @@
static void
irc_network_manager_load_servers (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
priv->loading = TRUE;
@@ -523,8 +507,7 @@
xmlNodePtr node,
gboolean user_defined)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
EmpathyIrcNetwork *network;
xmlNodePtr child;
gchar *str;
@@ -594,13 +577,13 @@
const gchar *filename,
gboolean user_defined)
{
- EmpathyIrcNetworkManagerPrivate *priv;
+ EmpathyIrcNetworkManagerPriv *priv;
xmlParserCtxtPtr ctxt;
xmlDocPtr doc;
xmlNodePtr networks;
xmlNodePtr node;
- priv = EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
DEBUG ("Attempting to parse file:'%s'...", filename);
@@ -707,8 +690,7 @@
static gboolean
irc_network_manager_file_save (EmpathyIrcNetworkManager *self)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
xmlDocPtr doc;
xmlNodePtr root;
@@ -785,8 +767,7 @@
EmpathyIrcNetworkManager *self,
const gchar *address)
{
- EmpathyIrcNetworkManagerPrivate *priv =
- EMPATHY_IRC_NETWORK_MANAGER_GET_PRIVATE (self);
+ EmpathyIrcNetworkManagerPriv *priv = GET_PRIV (self);
EmpathyIrcNetwork *network;
g_return_val_if_fail (address != NULL, NULL);
Modified: trunk/libempathy/empathy-irc-network-manager.h
==============================================================================
--- trunk/libempathy/empathy-irc-network-manager.h (original)
+++ trunk/libempathy/empathy-irc-network-manager.h Mon May 5 20:34:41 2008
@@ -33,7 +33,6 @@
struct _EmpathyIrcNetworkManager
{
GObject parent;
-
gpointer priv;
};
Modified: trunk/libempathy/empathy-irc-network.c
==============================================================================
--- trunk/libempathy/empathy-irc-network.c (original)
+++ trunk/libempathy/empathy-irc-network.c Mon May 5 20:34:41 2008
@@ -29,8 +29,15 @@
#include "empathy-marshal.h"
#include "empathy-irc-network.h"
+#include "empathy-utils.h"
-G_DEFINE_TYPE (EmpathyIrcNetwork, empathy_irc_network, G_TYPE_OBJECT);
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcNetwork)
+typedef struct
+{
+ gchar *name;
+ gchar *charset;
+ GSList *servers;
+} EmpathyIrcNetworkPriv;
/* properties */
enum
@@ -49,17 +56,7 @@
static guint signals[LAST_SIGNAL] = {0};
-typedef struct _EmpathyIrcNetworkPrivate EmpathyIrcNetworkPrivate;
-
-struct _EmpathyIrcNetworkPrivate
-{
- gchar *name;
- gchar *charset;
- GSList *servers;
-};
-
-#define EMPATHY_IRC_NETWORK_GET_PRIVATE(obj)\
- ((EmpathyIrcNetworkPrivate *) obj->priv)
+G_DEFINE_TYPE (EmpathyIrcNetwork, empathy_irc_network, G_TYPE_OBJECT);
static void
server_modified_cb (EmpathyIrcServer *server,
@@ -75,7 +72,7 @@
GParamSpec *pspec)
{
EmpathyIrcNetwork *self = EMPATHY_IRC_NETWORK (object);
- EmpathyIrcNetworkPrivate *priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ EmpathyIrcNetworkPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -98,7 +95,7 @@
GParamSpec *pspec)
{
EmpathyIrcNetwork *self = EMPATHY_IRC_NETWORK (object);
- EmpathyIrcNetworkPrivate *priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ EmpathyIrcNetworkPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -128,7 +125,7 @@
empathy_irc_network_dispose (GObject *object)
{
EmpathyIrcNetwork *self = EMPATHY_IRC_NETWORK (object);
- EmpathyIrcNetworkPrivate *priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ EmpathyIrcNetworkPriv *priv = GET_PRIV (self);
GSList *l;
for (l = priv->servers; l != NULL; l = g_slist_next (l))
@@ -145,7 +142,7 @@
empathy_irc_network_finalize (GObject *object)
{
EmpathyIrcNetwork *self = EMPATHY_IRC_NETWORK (object);
- EmpathyIrcNetworkPrivate *priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ EmpathyIrcNetworkPriv *priv = GET_PRIV (self);
g_slist_free (priv->servers);
g_free (priv->name);
@@ -157,8 +154,8 @@
static void
empathy_irc_network_init (EmpathyIrcNetwork *self)
{
- EmpathyIrcNetworkPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
- EMPATHY_TYPE_IRC_NETWORK, EmpathyIrcNetworkPrivate);
+ EmpathyIrcNetworkPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+ EMPATHY_TYPE_IRC_NETWORK, EmpathyIrcNetworkPriv);
self->priv = priv;
@@ -177,8 +174,7 @@
object_class->get_property = empathy_irc_network_get_property;
object_class->set_property = empathy_irc_network_set_property;
- g_type_class_add_private (object_class,
- sizeof (EmpathyIrcNetworkPrivate));
+ g_type_class_add_private (object_class, sizeof (EmpathyIrcNetworkPriv));
object_class->dispose = empathy_irc_network_dispose;
object_class->finalize = empathy_irc_network_finalize;
@@ -253,11 +249,11 @@
GSList *
empathy_irc_network_get_servers (EmpathyIrcNetwork *self)
{
- EmpathyIrcNetworkPrivate *priv;
+ EmpathyIrcNetworkPriv *priv;
GSList *servers = NULL, *l;
g_return_val_if_fail (EMPATHY_IS_IRC_NETWORK (self), NULL);
- priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
for (l = priv->servers; l != NULL; l = g_slist_next (l))
{
@@ -280,12 +276,12 @@
empathy_irc_network_append_server (EmpathyIrcNetwork *self,
EmpathyIrcServer *server)
{
- EmpathyIrcNetworkPrivate *priv;
+ EmpathyIrcNetworkPriv *priv;
g_return_if_fail (EMPATHY_IS_IRC_NETWORK (self));
g_return_if_fail (server != NULL && EMPATHY_IS_IRC_SERVER (server));
- priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
g_return_if_fail (g_slist_find (priv->servers, server) == NULL);
@@ -309,13 +305,13 @@
empathy_irc_network_remove_server (EmpathyIrcNetwork *self,
EmpathyIrcServer *server)
{
- EmpathyIrcNetworkPrivate *priv;
+ EmpathyIrcNetworkPriv *priv;
GSList *l;
g_return_if_fail (EMPATHY_IS_IRC_NETWORK (self));
g_return_if_fail (server != NULL && EMPATHY_IS_IRC_SERVER (server));
- priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
l = g_slist_find (priv->servers, server);
if (l == NULL)
@@ -346,13 +342,13 @@
EmpathyIrcServer *server,
gint pos)
{
- EmpathyIrcNetworkPrivate *priv;
+ EmpathyIrcNetworkPriv *priv;
GSList *l;
g_return_if_fail (EMPATHY_IS_IRC_NETWORK (self));
g_return_if_fail (server != NULL && EMPATHY_IS_IRC_SERVER (server));
- priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
+ priv = GET_PRIV (self);
l = g_slist_find (priv->servers, server);
if (l == NULL)
Modified: trunk/libempathy/empathy-irc-network.h
==============================================================================
--- trunk/libempathy/empathy-irc-network.h (original)
+++ trunk/libempathy/empathy-irc-network.h Mon May 5 20:34:41 2008
@@ -32,12 +32,11 @@
struct _EmpathyIrcNetwork
{
- GObject parent;
+ GObject parent;
+ gpointer priv;
- gpointer priv;
-
- gboolean user_defined;
- gboolean dropped;
+ gboolean user_defined;
+ gboolean dropped;
};
struct _EmpathyIrcNetworkClass
Modified: trunk/libempathy/empathy-irc-server.c
==============================================================================
--- trunk/libempathy/empathy-irc-server.c (original)
+++ trunk/libempathy/empathy-irc-server.c Mon May 5 20:34:41 2008
@@ -28,8 +28,15 @@
#include "empathy-marshal.h"
#include "empathy-irc-server.h"
+#include "empathy-utils.h"
-G_DEFINE_TYPE (EmpathyIrcServer, empathy_irc_server, G_TYPE_OBJECT);
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcServer)
+typedef struct
+{
+ gchar *address;
+ gint port;
+ gboolean ssl;
+} EmpathyIrcServerPriv;
/* properties */
enum
@@ -49,17 +56,7 @@
static guint signals[LAST_SIGNAL] = {0};
-typedef struct _EmpathyIrcServerPrivate EmpathyIrcServerPrivate;
-
-struct _EmpathyIrcServerPrivate
-{
- gchar *address;
- gint port;
- gboolean ssl;
-};
-
-#define EMPATHY_IRC_SERVER_GET_PRIVATE(obj)\
- ((EmpathyIrcServerPrivate *) obj->priv)
+G_DEFINE_TYPE (EmpathyIrcServer, empathy_irc_server, G_TYPE_OBJECT);
static void
empathy_irc_server_get_property (GObject *object,
@@ -68,7 +65,7 @@
GParamSpec *pspec)
{
EmpathyIrcServer *self = EMPATHY_IRC_SERVER (object);
- EmpathyIrcServerPrivate *priv = EMPATHY_IRC_SERVER_GET_PRIVATE (self);
+ EmpathyIrcServerPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -94,7 +91,7 @@
GParamSpec *pspec)
{
EmpathyIrcServer *self = EMPATHY_IRC_SERVER (object);
- EmpathyIrcServerPrivate *priv = EMPATHY_IRC_SERVER_GET_PRIVATE (self);
+ EmpathyIrcServerPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -130,7 +127,7 @@
empathy_irc_server_finalize (GObject *object)
{
EmpathyIrcServer *self = EMPATHY_IRC_SERVER (object);
- EmpathyIrcServerPrivate *priv = EMPATHY_IRC_SERVER_GET_PRIVATE (self);
+ EmpathyIrcServerPriv *priv = GET_PRIV (self);
g_free (priv->address);
@@ -140,8 +137,8 @@
static void
empathy_irc_server_init (EmpathyIrcServer *self)
{
- EmpathyIrcServerPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
- EMPATHY_TYPE_IRC_SERVER, EmpathyIrcServerPrivate);
+ EmpathyIrcServerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+ EMPATHY_TYPE_IRC_SERVER, EmpathyIrcServerPriv);
self->priv = priv;
}
@@ -155,8 +152,7 @@
object_class->get_property = empathy_irc_server_get_property;
object_class->set_property = empathy_irc_server_set_property;
- g_type_class_add_private (object_class,
- sizeof (EmpathyIrcServerPrivate));
+ g_type_class_add_private (object_class, sizeof (EmpathyIrcServerPriv));
object_class->finalize = empathy_irc_server_finalize;
Modified: trunk/libempathy/empathy-irc-server.h
==============================================================================
--- trunk/libempathy/empathy-irc-server.h (original)
+++ trunk/libempathy/empathy-irc-server.h Mon May 5 20:34:41 2008
@@ -30,9 +30,8 @@
struct _EmpathyIrcServer
{
- GObject parent;
-
- gpointer priv;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyIrcServerClass
Modified: trunk/libempathy/empathy-log-manager.c
==============================================================================
--- trunk/libempathy/empathy-log-manager.c (original)
+++ trunk/libempathy/empathy-log-manager.c Mon May 5 20:34:41 2008
@@ -36,9 +36,6 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_LOG_MANAGER, EmpathyLogManagerPriv))
-
#define LOG_DIR_CREATE_MODE (S_IRUSR | S_IWUSR | S_IXUSR)
#define LOG_FILE_CREATE_MODE (S_IRUSR | S_IWUSR)
#define LOG_DIR_CHATROOMS "chatrooms"
@@ -53,12 +50,11 @@
#define LOG_FOOTER \
"</log>\n"
-struct _EmpathyLogManagerPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyLogManager)
+typedef struct {
gchar *basedir;
-};
+} EmpathyLogManagerPriv;
-static void empathy_log_manager_class_init (EmpathyLogManagerClass *klass);
-static void empathy_log_manager_init (EmpathyLogManager *manager);
static void log_manager_finalize (GObject *object);
static const gchar * log_manager_get_basedir (EmpathyLogManager *manager);
static GList * log_manager_get_all_files (EmpathyLogManager *manager,
@@ -100,6 +96,10 @@
static void
empathy_log_manager_init (EmpathyLogManager *manager)
{
+ EmpathyLogManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
+ EMPATHY_TYPE_LOG_MANAGER, EmpathyLogManagerPriv);
+
+ manager->priv = priv;
}
static void
@@ -146,7 +146,7 @@
gchar *timestamp;
gchar *contact_name;
gchar *contact_id;
- EmpathyMessageType msg_type;
+ TpChannelTextMessageType msg_type;
g_return_if_fail (EMPATHY_IS_LOG_MANAGER (manager));
g_return_if_fail (chat_id != NULL);
@@ -155,7 +155,7 @@
sender = empathy_message_get_sender (message);
account = empathy_contact_get_account (sender);
body_str = empathy_message_get_body (message);
- msg_type = empathy_message_get_type (message);
+ msg_type = empathy_message_get_tptype (message);
if (G_STR_EMPTY (body_str)) {
return;
@@ -347,7 +347,7 @@
gchar *is_user_str;
gboolean is_user = FALSE;
gchar *msg_type_str;
- EmpathyMessageType msg_type = EMPATHY_MESSAGE_TYPE_NORMAL;
+ TpChannelTextMessageType msg_type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL;
if (strcmp (node->name, "message") != 0) {
continue;
@@ -383,7 +383,7 @@
message = empathy_message_new (body);
empathy_message_set_sender (message, sender);
empathy_message_set_timestamp (message, t);
- empathy_message_set_type (message, msg_type);
+ empathy_message_set_tptype (message, msg_type);
messages = g_list_append (messages, message);
Modified: trunk/libempathy/empathy-log-manager.h
==============================================================================
--- trunk/libempathy/empathy-log-manager.h (original)
+++ trunk/libempathy/empathy-log-manager.h Mon May 5 20:34:41 2008
@@ -41,11 +41,11 @@
typedef struct _EmpathyLogManager EmpathyLogManager;
typedef struct _EmpathyLogManagerClass EmpathyLogManagerClass;
-typedef struct _EmpathyLogManagerPriv EmpathyLogManagerPriv;
typedef struct _EmpathyLogSearchHit EmpathyLogSearchHit;
struct _EmpathyLogManager {
GObject parent;
+ gpointer priv;
};
struct _EmpathyLogManagerClass {
Modified: trunk/libempathy/empathy-message.c
==============================================================================
--- trunk/libempathy/empathy-message.c (original)
+++ trunk/libempathy/empathy-message.c Mon May 5 20:34:41 2008
@@ -29,20 +29,15 @@
#include "empathy-message.h"
#include "empathy-enum-types.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_MESSAGE, EmpathyMessagePriv))
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyMessage)
+typedef struct {
+ TpChannelTextMessageType type;
+ EmpathyContact *sender;
+ EmpathyContact *receiver;
+ gchar *body;
+ time_t timestamp;
+} EmpathyMessagePriv;
-typedef struct _EmpathyMessagePriv EmpathyMessagePriv;
-
-struct _EmpathyMessagePriv {
- EmpathyMessageType type;
- EmpathyContact *sender;
- EmpathyContact *receiver;
- gchar *body;
- time_t timestamp;
-};
-
-static void empathy_message_class_init (EmpathyMessageClass *class);
-static void empathy_message_init (EmpathyMessage *message);
static void empathy_message_finalize (GObject *object);
static void message_get_property (GObject *object,
guint param_id,
@@ -53,6 +48,8 @@
const GValue *value,
GParamSpec *pspec);
+G_DEFINE_TYPE (EmpathyMessage, empathy_message, G_TYPE_OBJECT);
+
enum {
PROP_0,
PROP_TYPE,
@@ -62,53 +59,24 @@
PROP_TIMESTAMP,
};
-static gpointer parent_class = NULL;
-
-GType
-empathy_message_get_gtype (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EmpathyMessageClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) empathy_message_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EmpathyMessage),
- 0, /* n_preallocs */
- (GInstanceInitFunc) empathy_message_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "EmpathyMessage",
- &info, 0);
- }
-
- return type;
-}
-
static void
empathy_message_class_init (EmpathyMessageClass *class)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = empathy_message_finalize;
object_class->get_property = message_get_property;
object_class->set_property = message_set_property;
g_object_class_install_property (object_class,
PROP_TYPE,
- g_param_spec_enum ("type",
+ g_param_spec_uint ("type",
"Message Type",
"The type of message",
- EMPATHY_TYPE_MESSAGE_TYPE,
- EMPATHY_MESSAGE_TYPE_NORMAL,
+ TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
+ TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY,
+ TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SENDER,
@@ -149,10 +117,10 @@
static void
empathy_message_init (EmpathyMessage *message)
{
- EmpathyMessagePriv *priv;
-
- priv = GET_PRIV (message);
+ EmpathyMessagePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (message,
+ EMPATHY_TYPE_MESSAGE, EmpathyMessagePriv);
+ message->priv = priv;
priv->timestamp = empathy_time_get_current ();
}
@@ -172,7 +140,7 @@
g_free (priv->body);
- (G_OBJECT_CLASS (parent_class)->finalize) (object);
+ G_OBJECT_CLASS (empathy_message_parent_class)->finalize (object);
}
static void
@@ -187,7 +155,7 @@
switch (param_id) {
case PROP_TYPE:
- g_value_set_enum (value, priv->type);
+ g_value_set_uint (value, priv->type);
break;
case PROP_SENDER:
g_value_set_object (value, priv->sender);
@@ -216,8 +184,8 @@
switch (param_id) {
case PROP_TYPE:
- empathy_message_set_type (EMPATHY_MESSAGE (object),
- g_value_get_enum (value));
+ empathy_message_set_tptype (EMPATHY_MESSAGE (object),
+ g_value_get_uint (value));
break;
case PROP_SENDER:
empathy_message_set_sender (EMPATHY_MESSAGE (object),
@@ -245,13 +213,13 @@
NULL);
}
-EmpathyMessageType
-empathy_message_get_type (EmpathyMessage *message)
+TpChannelTextMessageType
+empathy_message_get_tptype (EmpathyMessage *message)
{
EmpathyMessagePriv *priv;
g_return_val_if_fail (EMPATHY_IS_MESSAGE (message),
- EMPATHY_MESSAGE_TYPE_NORMAL);
+ TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL);
priv = GET_PRIV (message);
@@ -259,8 +227,8 @@
}
void
-empathy_message_set_type (EmpathyMessage *message,
- EmpathyMessageType type)
+empathy_message_set_tptype (EmpathyMessage *message,
+ TpChannelTextMessageType type)
{
EmpathyMessagePriv *priv;
@@ -353,21 +321,19 @@
void
empathy_message_set_body (EmpathyMessage *message,
- const gchar *body)
+ const gchar *body)
{
- EmpathyMessagePriv *priv;
- EmpathyMessageType type;
+ EmpathyMessagePriv *priv = GET_PRIV (message);
+ TpChannelTextMessageType type;
g_return_if_fail (EMPATHY_IS_MESSAGE (message));
- priv = GET_PRIV (message);
-
g_free (priv->body);
priv->body = NULL;
- type = EMPATHY_MESSAGE_TYPE_NORMAL;
+ type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL;
if (g_str_has_prefix (body, "/me")) {
- type = EMPATHY_MESSAGE_TYPE_ACTION;
+ type = TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION;
body += 4;
}
else if (g_str_has_prefix (body, "/say")) {
@@ -379,7 +345,7 @@
}
if (type != priv->type) {
- empathy_message_set_type (message, type);
+ empathy_message_set_tptype (message, type);
}
g_object_notify (G_OBJECT (message), "body");
@@ -498,34 +464,34 @@
return ret_val;
}
-EmpathyMessageType
+TpChannelTextMessageType
empathy_message_type_from_str (const gchar *type_str)
{
if (strcmp (type_str, "normal") == 0) {
- return EMPATHY_MESSAGE_TYPE_NORMAL;
+ return TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL;
}
if (strcmp (type_str, "action") == 0) {
- return EMPATHY_MESSAGE_TYPE_ACTION;
+ return TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION;
}
else if (strcmp (type_str, "notice") == 0) {
- return EMPATHY_MESSAGE_TYPE_NOTICE;
+ return TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE;
}
else if (strcmp (type_str, "auto-reply") == 0) {
- return EMPATHY_MESSAGE_TYPE_AUTO_REPLY;
+ return TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY;
}
- return EMPATHY_MESSAGE_TYPE_NORMAL;
+ return TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL;
}
const gchar *
-empathy_message_type_to_str (EmpathyMessageType type)
+empathy_message_type_to_str (TpChannelTextMessageType type)
{
switch (type) {
- case EMPATHY_MESSAGE_TYPE_ACTION:
+ case TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION:
return "action";
- case EMPATHY_MESSAGE_TYPE_NOTICE:
+ case TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE:
return "notice";
- case EMPATHY_MESSAGE_TYPE_AUTO_REPLY:
+ case TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY:
return "auto-reply";
default:
return "normal";
Modified: trunk/libempathy/empathy-message.h
==============================================================================
--- trunk/libempathy/empathy-message.h (original)
+++ trunk/libempathy/empathy-message.h Mon May 5 20:34:41 2008
@@ -32,7 +32,7 @@
G_BEGIN_DECLS
-#define EMPATHY_TYPE_MESSAGE (empathy_message_get_gtype ())
+#define EMPATHY_TYPE_MESSAGE (empathy_message_get_type ())
#define EMPATHY_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_MESSAGE, EmpathyMessage))
#define EMPATHY_MESSAGE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_MESSAGE, EmpathyMessageClass))
#define EMPATHY_IS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_MESSAGE))
@@ -44,42 +44,35 @@
struct _EmpathyMessage {
GObject parent;
+ gpointer priv;
};
struct _EmpathyMessageClass {
GObjectClass parent_class;
};
-typedef enum {
- EMPATHY_MESSAGE_TYPE_NORMAL,
- EMPATHY_MESSAGE_TYPE_ACTION,
- EMPATHY_MESSAGE_TYPE_NOTICE,
- EMPATHY_MESSAGE_TYPE_AUTO_REPLY,
- EMPATHY_MESSAGE_TYPE_LAST
-} EmpathyMessageType;
-
-GType empathy_message_get_gtype (void) G_GNUC_CONST;
-EmpathyMessage * empathy_message_new (const gchar *body);
-EmpathyMessageType empathy_message_get_type (EmpathyMessage *message);
-void empathy_message_set_type (EmpathyMessage *message,
- EmpathyMessageType type);
-EmpathyContact * empathy_message_get_sender (EmpathyMessage *message);
-void empathy_message_set_sender (EmpathyMessage *message,
- EmpathyContact *contact);
-EmpathyContact * empathy_message_get_receiver (EmpathyMessage *message);
-void empathy_message_set_receiver (EmpathyMessage *message,
- EmpathyContact *contact);
-const gchar * empathy_message_get_body (EmpathyMessage *message);
-void empathy_message_set_body (EmpathyMessage *message,
- const gchar *body);
-time_t empathy_message_get_timestamp (EmpathyMessage *message);
-void empathy_message_set_timestamp (EmpathyMessage *message,
- time_t timestamp);
-GDate * empathy_message_get_date_and_time (EmpathyMessage *message,
- time_t *timestamp);
-gboolean empathy_message_should_highlight (EmpathyMessage *message);
-EmpathyMessageType empathy_message_type_from_str (const gchar *type_str);
-const gchar * empathy_message_type_to_str (EmpathyMessageType type);
+GType empathy_message_get_type (void) G_GNUC_CONST;
+EmpathyMessage * empathy_message_new (const gchar *body);
+TpChannelTextMessageType empathy_message_get_tptype (EmpathyMessage *message);
+void empathy_message_set_tptype (EmpathyMessage *message,
+ TpChannelTextMessageType type);
+EmpathyContact * empathy_message_get_sender (EmpathyMessage *message);
+void empathy_message_set_sender (EmpathyMessage *message,
+ EmpathyContact *contact);
+EmpathyContact * empathy_message_get_receiver (EmpathyMessage *message);
+void empathy_message_set_receiver (EmpathyMessage *message,
+ EmpathyContact *contact);
+const gchar * empathy_message_get_body (EmpathyMessage *message);
+void empathy_message_set_body (EmpathyMessage *message,
+ const gchar *body);
+time_t empathy_message_get_timestamp (EmpathyMessage *message);
+void empathy_message_set_timestamp (EmpathyMessage *message,
+ time_t timestamp);
+GDate * empathy_message_get_date_and_time (EmpathyMessage *message,
+ time_t *timestamp);
+gboolean empathy_message_should_highlight (EmpathyMessage *message);
+TpChannelTextMessageType empathy_message_type_from_str (const gchar *type_str);
+const gchar * empathy_message_type_to_str (TpChannelTextMessageType type);
G_END_DECLS
Modified: trunk/libempathy/empathy-tp-call.c
==============================================================================
--- trunk/libempathy/empathy-tp-call.c (original)
+++ trunk/libempathy/empathy-tp-call.c Mon May 5 20:34:41 2008
@@ -27,24 +27,20 @@
#include <telepathy-glib/dbus.h>
#include <extensions/extensions.h>
-#include <libempathy/empathy-contact-factory.h>
-#include <libempathy/empathy-tp-group.h>
-#include <libempathy/empathy-utils.h>
#include "empathy-tp-call.h"
+#include "empathy-contact-factory.h"
+#include "empathy-tp-group.h"
+#include "empathy-utils.h"
#define DEBUG_FLAG EMPATHY_DEBUG_TP
#include "empathy-debug.h"
-#define GET_PRIV(object) (G_TYPE_INSTANCE_GET_PRIVATE \
- ((object), EMPATHY_TYPE_TP_CALL, EmpathyTpCallPriv))
-
#define STREAM_ENGINE_BUS_NAME "org.freedesktop.Telepathy.StreamEngine"
#define STREAM_ENGINE_OBJECT_PATH "/org/freedesktop/Telepathy/StreamEngine"
-typedef struct _EmpathyTpCallPriv EmpathyTpCallPriv;
-
-struct _EmpathyTpCallPriv
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpCall)
+typedef struct
{
TpChannel *channel;
TpProxy *stream_engine;
@@ -57,7 +53,7 @@
EmpathyTpCallStream *audio;
EmpathyTpCallStream *video;
-};
+} EmpathyTpCallPriv;
enum
{
@@ -629,8 +625,10 @@
static void
empathy_tp_call_init (EmpathyTpCall *call)
{
- EmpathyTpCallPriv *priv = GET_PRIV (call);
+ EmpathyTpCallPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (call,
+ EMPATHY_TYPE_TP_CALL, EmpathyTpCallPriv);
+ call->priv = priv;
priv->status = EMPATHY_TP_CALL_STATUS_READYING;
priv->contact = NULL;
priv->stream_engine_running = FALSE;
Modified: trunk/libempathy/empathy-tp-call.h
==============================================================================
--- trunk/libempathy/empathy-tp-call.h (original)
+++ trunk/libempathy/empathy-tp-call.h Mon May 5 20:34:41 2008
@@ -45,11 +45,12 @@
typedef struct _EmpathyTpCallClass EmpathyTpCallClass;
struct _EmpathyTpCall {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyTpCallClass {
- GObjectClass parent_class;
+ GObjectClass parent_class;
};
typedef enum
Modified: trunk/libempathy/empathy-tp-chat.c
==============================================================================
--- trunk/libempathy/empathy-tp-chat.c (original)
+++ trunk/libempathy/empathy-tp-chat.c Mon May 5 20:34:41 2008
@@ -37,10 +37,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TP | EMPATHY_DEBUG_CHAT
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_TP_CHAT, EmpathyTpChatPriv))
-
-struct _EmpathyTpChatPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpChat)
+typedef struct {
EmpathyContactFactory *factory;
EmpathyContact *user;
EmpathyContact *remote_contact;
@@ -55,7 +53,7 @@
GPtrArray *properties;
gboolean ready;
guint members_count;
-};
+} EmpathyTpChatPriv;
typedef struct {
gchar *name;
@@ -64,8 +62,6 @@
GValue *value;
} TpChatProperty;
-static void empathy_tp_chat_class_init (EmpathyTpChatClass *klass);
-static void empathy_tp_chat_init (EmpathyTpChat *chat);
static void tp_chat_iface_init (EmpathyContactListIface *iface);
enum {
@@ -274,7 +270,7 @@
}
message = empathy_message_new (message_body);
- empathy_message_set_type (message, type);
+ empathy_message_set_tptype (message, type);
empathy_message_set_sender (message, sender);
empathy_message_set_receiver (message, priv->user);
empathy_message_set_timestamp (message, timestamp);
@@ -1060,6 +1056,10 @@
static void
empathy_tp_chat_init (EmpathyTpChat *chat)
{
+ EmpathyTpChatPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chat,
+ EMPATHY_TYPE_TP_CHAT, EmpathyTpChatPriv);
+
+ chat->priv = priv;
}
static void
@@ -1172,16 +1172,16 @@
empathy_tp_chat_send (EmpathyTpChat *chat,
EmpathyMessage *message)
{
- EmpathyTpChatPriv *priv = GET_PRIV (chat);
- const gchar *message_body;
- EmpathyMessageType message_type;
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+ const gchar *message_body;
+ TpChannelTextMessageType message_type;
g_return_if_fail (EMPATHY_IS_TP_CHAT (chat));
g_return_if_fail (EMPATHY_IS_MESSAGE (message));
g_return_if_fail (priv->ready);
message_body = empathy_message_get_body (message);
- message_type = empathy_message_get_type (message);
+ message_type = empathy_message_get_tptype (message);
DEBUG ("Sending message: %s", message_body);
tp_cli_channel_type_text_call_send (priv->channel, -1,
Modified: trunk/libempathy/empathy-tp-chat.h
==============================================================================
--- trunk/libempathy/empathy-tp-chat.h (original)
+++ trunk/libempathy/empathy-tp-chat.h Mon May 5 20:34:41 2008
@@ -42,10 +42,10 @@
typedef struct _EmpathyTpChat EmpathyTpChat;
typedef struct _EmpathyTpChatClass EmpathyTpChatClass;
-typedef struct _EmpathyTpChatPriv EmpathyTpChatPriv;
struct _EmpathyTpChat {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyTpChatClass {
Modified: trunk/libempathy/empathy-tp-contact-factory.c
==============================================================================
--- trunk/libempathy/empathy-tp-contact-factory.c (original)
+++ trunk/libempathy/empathy-tp-contact-factory.c Mon May 5 20:34:41 2008
@@ -33,10 +33,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TP | EMPATHY_DEBUG_CONTACT
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_TP_CONTACT_FACTORY, EmpathyTpContactFactoryPriv))
-
-struct _EmpathyTpContactFactoryPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpContactFactory)
+typedef struct {
MissionControl *mc;
McAccount *account;
TpConnection *connection;
@@ -45,10 +43,7 @@
GList *contacts;
EmpathyContact *user;
gpointer token;
-};
-
-static void empathy_tp_contact_factory_class_init (EmpathyTpContactFactoryClass *klass);
-static void empathy_tp_contact_factory_init (EmpathyTpContactFactory *factory);
+} EmpathyTpContactFactoryPriv;
G_DEFINE_TYPE (EmpathyTpContactFactory, empathy_tp_contact_factory, G_TYPE_OBJECT);
@@ -1276,8 +1271,10 @@
static void
empathy_tp_contact_factory_init (EmpathyTpContactFactory *tp_factory)
{
- EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory);
+ EmpathyTpContactFactoryPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (tp_factory,
+ EMPATHY_TYPE_TP_CONTACT_FACTORY, EmpathyTpContactFactoryPriv);
+ tp_factory->priv = priv;
priv->mc = empathy_mission_control_new ();
priv->token = empathy_connect_to_account_status_changed (priv->mc,
G_CALLBACK (tp_contact_factory_status_changed_cb),
Modified: trunk/libempathy/empathy-tp-contact-factory.h
==============================================================================
--- trunk/libempathy/empathy-tp-contact-factory.h (original)
+++ trunk/libempathy/empathy-tp-contact-factory.h Mon May 5 20:34:41 2008
@@ -39,10 +39,10 @@
typedef struct _EmpathyTpContactFactory EmpathyTpContactFactory;
typedef struct _EmpathyTpContactFactoryClass EmpathyTpContactFactoryClass;
-typedef struct _EmpathyTpContactFactoryPriv EmpathyTpContactFactoryPriv;
struct _EmpathyTpContactFactory {
GObject parent;
+ gpointer priv;
};
struct _EmpathyTpContactFactoryClass {
Modified: trunk/libempathy/empathy-tp-contact-list.c
==============================================================================
--- trunk/libempathy/empathy-tp-contact-list.c (original)
+++ trunk/libempathy/empathy-tp-contact-list.c Mon May 5 20:34:41 2008
@@ -38,10 +38,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TP | EMPATHY_DEBUG_CONTACT
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_TP_CONTACT_LIST, EmpathyTpContactListPriv))
-
-struct _EmpathyTpContactListPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpContactList)
+typedef struct {
McAccount *account;
TpConnection *connection;
const gchar *protocol_group;
@@ -54,7 +52,7 @@
GList *groups;
GHashTable *contacts_groups;
-};
+} EmpathyTpContactListPriv;
typedef enum {
TP_CONTACT_LIST_TYPE_PUBLISH,
@@ -62,8 +60,6 @@
TP_CONTACT_LIST_TYPE_UNKNOWN
} TpContactListType;
-static void empathy_tp_contact_list_class_init (EmpathyTpContactListClass *klass);
-static void empathy_tp_contact_list_init (EmpathyTpContactList *list);
static void tp_contact_list_iface_init (EmpathyContactListIface *iface);
enum {
@@ -742,8 +738,10 @@
static void
empathy_tp_contact_list_init (EmpathyTpContactList *list)
{
- EmpathyTpContactListPriv *priv = GET_PRIV (list);
+ EmpathyTpContactListPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (list,
+ EMPATHY_TYPE_TP_CONTACT_LIST, EmpathyTpContactListPriv);
+ list->priv = priv;
priv->contacts_groups = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
(GDestroyNotify) g_object_unref,
Modified: trunk/libempathy/empathy-tp-contact-list.h
==============================================================================
--- trunk/libempathy/empathy-tp-contact-list.h (original)
+++ trunk/libempathy/empathy-tp-contact-list.h Mon May 5 20:34:41 2008
@@ -38,10 +38,10 @@
typedef struct _EmpathyTpContactList EmpathyTpContactList;
typedef struct _EmpathyTpContactListClass EmpathyTpContactListClass;
-typedef struct _EmpathyTpContactListPriv EmpathyTpContactListPriv;
struct _EmpathyTpContactList {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyTpContactListClass {
Modified: trunk/libempathy/empathy-tp-group.c
==============================================================================
--- trunk/libempathy/empathy-tp-group.c (original)
+++ trunk/libempathy/empathy-tp-group.c Mon May 5 20:34:41 2008
@@ -36,10 +36,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TP
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_TP_GROUP, EmpathyTpGroupPriv))
-
-struct _EmpathyTpGroupPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpGroup)
+typedef struct {
TpChannel *channel;
gboolean ready;
@@ -50,10 +48,7 @@
GList *members;
GList *local_pendings;
GList *remote_pendings;
-};
-
-static void empathy_tp_group_class_init (EmpathyTpGroupClass *klass);
-static void empathy_tp_group_init (EmpathyTpGroup *group);
+} EmpathyTpGroupPriv;
enum {
MEMBER_ADDED,
@@ -714,6 +709,10 @@
static void
empathy_tp_group_init (EmpathyTpGroup *group)
{
+ EmpathyTpGroupPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (group,
+ EMPATHY_TYPE_TP_GROUP, EmpathyTpGroupPriv);
+
+ group->priv = priv;
}
EmpathyTpGroup *
Modified: trunk/libempathy/empathy-tp-group.h
==============================================================================
--- trunk/libempathy/empathy-tp-group.h (original)
+++ trunk/libempathy/empathy-tp-group.h Mon May 5 20:34:41 2008
@@ -40,10 +40,10 @@
typedef struct _EmpathyTpGroup EmpathyTpGroup;
typedef struct _EmpathyTpGroupClass EmpathyTpGroupClass;
-typedef struct _EmpathyTpGroupPriv EmpathyTpGroupPriv;
struct _EmpathyTpGroup {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyTpGroupClass {
Modified: trunk/libempathy/empathy-tp-roomlist.c
==============================================================================
--- trunk/libempathy/empathy-tp-roomlist.c (original)
+++ trunk/libempathy/empathy-tp-roomlist.c Mon May 5 20:34:41 2008
@@ -36,18 +36,13 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TP
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_TP_ROOMLIST, EmpathyTpRoomlistPriv))
-
-struct _EmpathyTpRoomlistPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpRoomlist)
+typedef struct {
TpConnection *connection;
TpChannel *channel;
McAccount *account;
gboolean is_listing;
-};
-
-static void empathy_tp_roomlist_class_init (EmpathyTpRoomlistClass *klass);
-static void empathy_tp_roomlist_init (EmpathyTpRoomlist *chat);
+} EmpathyTpRoomlistPriv;
enum {
NEW_ROOM,
@@ -338,6 +333,10 @@
static void
empathy_tp_roomlist_init (EmpathyTpRoomlist *list)
{
+ EmpathyTpRoomlistPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (list,
+ EMPATHY_TYPE_TP_ROOMLIST, EmpathyTpRoomlistPriv);
+
+ list->priv = priv;
}
EmpathyTpRoomlist *
Modified: trunk/libempathy/empathy-tp-roomlist.h
==============================================================================
--- trunk/libempathy/empathy-tp-roomlist.h (original)
+++ trunk/libempathy/empathy-tp-roomlist.h Mon May 5 20:34:41 2008
@@ -38,10 +38,10 @@
typedef struct _EmpathyTpRoomlist EmpathyTpRoomlist;
typedef struct _EmpathyTpRoomlistClass EmpathyTpRoomlistClass;
-typedef struct _EmpathyTpRoomlistPriv EmpathyTpRoomlistPriv;
struct _EmpathyTpRoomlist {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyTpRoomlistClass {
Modified: trunk/libempathy/empathy-tp-tube.c
==============================================================================
--- trunk/libempathy/empathy-tp-tube.c (original)
+++ trunk/libempathy/empathy-tp-tube.c Mon May 5 20:34:41 2008
@@ -32,12 +32,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TP
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_TP_TUBE, \
- EmpathyTpTubePriv))
-
-typedef struct _EmpathyTpTubePriv EmpathyTpTubePriv;
-
-struct _EmpathyTpTubePriv
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpTube)
+typedef struct
{
TpChannel *channel;
guint id;
@@ -48,7 +44,7 @@
guint state;
EmpathyContact *initiator_contact;
EmpathyContactFactory *factory;
-};
+} EmpathyTpTubePriv;
enum
{
@@ -350,7 +346,10 @@
static void
empathy_tp_tube_init (EmpathyTpTube *tube)
{
- EmpathyTpTubePriv *priv = GET_PRIV (tube);
+ EmpathyTpTubePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (tube,
+ EMPATHY_TYPE_TP_TUBE, EmpathyTpTubePriv);
+
+ tube->priv = priv;
priv->factory = empathy_contact_factory_new ();
}
Modified: trunk/libempathy/empathy-tp-tube.h
==============================================================================
--- trunk/libempathy/empathy-tp-tube.h (original)
+++ trunk/libempathy/empathy-tp-tube.h Mon May 5 20:34:41 2008
@@ -47,6 +47,7 @@
struct _EmpathyTpTube {
GObject parent;
+ gpointer priv;
};
struct _EmpathyTpTubeClass {
Modified: trunk/libempathy/empathy-utils.h
==============================================================================
--- trunk/libempathy/empathy-utils.h (original)
+++ trunk/libempathy/empathy-utils.h Mon May 5 20:34:41 2008
@@ -39,6 +39,7 @@
G_BEGIN_DECLS
+#define EMPATHY_GET_PRIV(obj,type) ((type##Priv*) ((type*)obj)->priv)
#define G_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
typedef enum {
Modified: trunk/megaphone/src/megaphone-applet.c
==============================================================================
--- trunk/megaphone/src/megaphone-applet.c (original)
+++ trunk/megaphone/src/megaphone-applet.c Mon May 5 20:34:41 2008
@@ -51,18 +51,15 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MEGAPHONE_TYPE_APPLET, MegaphoneAppletPriv))
-
-typedef struct _MegaphoneAppletPriv MegaphoneAppletPriv;
-
-struct _MegaphoneAppletPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, MegaphoneApplet)
+typedef struct {
EmpathyContactFactory *factory;
GtkWidget *image;
gint image_size;
EmpathyContact *contact;
GConfClient *gconf;
guint gconf_cnxn;
-};
+} MegaphoneAppletPriv;
static void megaphone_applet_finalize (GObject *object);
static void megaphone_applet_size_allocate_cb (GtkWidget *widget,
@@ -111,8 +108,10 @@
static void
megaphone_applet_init (MegaphoneApplet *applet)
{
- MegaphoneAppletPriv *priv = GET_PRIV (applet);
+ MegaphoneAppletPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (applet,
+ MEGAPHONE_TYPE_APPLET, MegaphoneAppletPriv);
+ applet->priv = priv;
priv->factory = empathy_contact_factory_new ();
priv->gconf = gconf_client_get_default ();
Modified: trunk/megaphone/src/megaphone-applet.h
==============================================================================
--- trunk/megaphone/src/megaphone-applet.h (original)
+++ trunk/megaphone/src/megaphone-applet.h Mon May 5 20:34:41 2008
@@ -40,6 +40,7 @@
struct _MegaphoneApplet {
PanelApplet applet;
+ gpointer priv;
};
struct _MegaphoneAppletClass {
Modified: trunk/python/pyempathy/pyempathy.defs
==============================================================================
--- trunk/python/pyempathy/pyempathy.defs (original)
+++ trunk/python/pyempathy/pyempathy.defs Mon May 5 20:34:41 2008
@@ -172,19 +172,6 @@
)
)
-(define-enum MessageType
- (in-module "Empathy")
- (c-name "EmpathyMessageType")
- (gtype-id "EMPATHY_TYPE_MESSAGE_TYPE")
- (values
- '("normal" "EMPATHY_MESSAGE_TYPE_NORMAL")
- '("action" "EMPATHY_MESSAGE_TYPE_ACTION")
- '("notice" "EMPATHY_MESSAGE_TYPE_NOTICE")
- '("auto-reply" "EMPATHY_MESSAGE_TYPE_AUTO_REPLY")
- '("last" "EMPATHY_MESSAGE_TYPE_LAST")
- )
-)
-
(define-flags Capabilities
(in-module "Empathy")
(c-name "EmpathyCapabilities")
@@ -622,8 +609,8 @@
;; From empathy-message.h
-(define-function empathy_message_get_gtype
- (c-name "empathy_message_get_gtype")
+(define-function empathy_message_get_type
+ (c-name "empathy_message_get_type")
(return-type "GType")
)
@@ -636,18 +623,18 @@
)
)
-(define-method get_type
+(define-method get_tptype
(of-object "EmpathyMessage")
- (c-name "empathy_message_get_type")
- (return-type "EmpathyMessageType")
+ (c-name "empathy_message_get_tptype")
+ (return-type "TpChannelTextMessageType")
)
-(define-method set_type
+(define-method set_tptype
(of-object "EmpathyMessage")
- (c-name "empathy_message_set_type")
+ (c-name "empathy_message_set_tptype")
(return-type "none")
(parameters
- '("EmpathyMessageType" "type")
+ '("TpChannelTextMessageType" "type")
)
)
@@ -728,16 +715,18 @@
(define-function empathy_message_type_from_str
(c-name "empathy_message_type_from_str")
- (return-type "EmpathyMessageType")
+ (return-type "TpChannelTextMessageType")
(parameters
'("const-gchar*" "type_str")
)
)
-(define-method to_str
- (of-object "EmpathyMessageType")
+(define-function empathy_message_type_to_str
(c-name "empathy_message_type_to_str")
(return-type "const-gchar*")
+ (parameters
+ '("TpChannelTextMessageType" "type")
+ )
)
@@ -1808,6 +1797,21 @@
)
)
+(define-method start_tone
+ (of-object "EmpathyTpCall")
+ (c-name "empathy_tp_call_start_tone")
+ (return-type "none")
+ (parameters
+ '("TpDTMFEvent" "event")
+ )
+)
+
+(define-method stop_tone
+ (of-object "EmpathyTpCall")
+ (c-name "empathy_tp_call_stop_tone")
+ (return-type "none")
+)
+
;; From empathy-tp-tube.h
Modified: trunk/src/empathy-chat-window.c
==============================================================================
--- trunk/src/empathy-chat-window.c (original)
+++ trunk/src/empathy-chat-window.c Mon May 5 20:34:41 2008
@@ -55,9 +55,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHAT_WINDOW, EmpathyChatWindowPriv))
-
-struct _EmpathyChatWindowPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatWindow)
+typedef struct {
EmpathyChat *current_chat;
GList *chats;
GList *chats_new_msg;
@@ -86,7 +85,7 @@
GtkWidget *menu_help_contents;
GtkWidget *menu_help_about;
-};
+} EmpathyChatWindowPriv;
static GList *chat_windows = NULL;
@@ -1090,18 +1089,18 @@
static void
empathy_chat_window_init (EmpathyChatWindow *window)
{
- EmpathyChatWindowPriv *priv;
- GladeXML *glade;
- GtkAccelGroup *accel_group;
- GClosure *closure;
- GtkWidget *menu_conv;
- GtkWidget *menu;
- gint i;
- GtkWidget *chat_vbox;
- gchar *filename;
-
- priv = GET_PRIV (window);
+ GladeXML *glade;
+ GtkAccelGroup *accel_group;
+ GClosure *closure;
+ GtkWidget *menu_conv;
+ GtkWidget *menu;
+ gint i;
+ GtkWidget *chat_vbox;
+ gchar *filename;
+ EmpathyChatWindowPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (window,
+ EMPATHY_TYPE_CHAT_WINDOW, EmpathyChatWindowPriv);
+ window->priv = priv;
filename = empathy_file_lookup ("empathy-chat-window.glade", "src");
glade = empathy_glade_get_file (filename,
"chat_window",
Modified: trunk/src/empathy-chat-window.h
==============================================================================
--- trunk/src/empathy-chat-window.h (original)
+++ trunk/src/empathy-chat-window.h Mon May 5 20:34:41 2008
@@ -45,10 +45,10 @@
typedef struct _EmpathyChatWindow EmpathyChatWindow;
typedef struct _EmpathyChatWindowClass EmpathyChatWindowClass;
-typedef struct _EmpathyChatWindowPriv EmpathyChatWindowPriv;
struct _EmpathyChatWindow {
GObject parent;
+ gpointer priv;
};
struct _EmpathyChatWindowClass {
Modified: trunk/src/empathy-filter.c
==============================================================================
--- trunk/src/empathy-filter.c (original)
+++ trunk/src/empathy-filter.c Mon May 5 20:34:41 2008
@@ -55,19 +55,14 @@
#define DEBUG_FLAG EMPATHY_DEBUG_FILTER
#include <libempathy/empathy-debug.h>
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_FILTER, EmpathyFilterPriv))
-
-struct _EmpathyFilterPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyFilter)
+typedef struct {
GSList *events;
GHashTable *accounts;
gpointer token;
MissionControl *mc;
GHashTable *tubes;
-};
-
-static void empathy_filter_class_init (EmpathyFilterClass *klass);
-static void empathy_filter_init (EmpathyFilter *filter);
+} EmpathyFilterPriv;
G_DEFINE_TYPE (EmpathyFilter, empathy_filter, G_TYPE_OBJECT);
@@ -963,9 +958,11 @@
static void
empathy_filter_init (EmpathyFilter *filter)
{
- EmpathyFilterPriv *priv = GET_PRIV (filter);
GList *accounts, *l;
+ EmpathyFilterPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (filter,
+ EMPATHY_TYPE_FILTER, EmpathyFilterPriv);
+ filter->priv = priv;
priv->tubes = g_hash_table_new_full (filter_channel_hash,
filter_channel_equal,
g_object_unref, NULL);
Modified: trunk/src/empathy-filter.h
==============================================================================
--- trunk/src/empathy-filter.h (original)
+++ trunk/src/empathy-filter.h Mon May 5 20:34:41 2008
@@ -35,10 +35,10 @@
typedef struct _EmpathyFilter EmpathyFilter;
typedef struct _EmpathyFilterClass EmpathyFilterClass;
-typedef struct _EmpathyFilterPriv EmpathyFilterPriv;
struct _EmpathyFilter {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyFilterClass {
Modified: trunk/src/empathy-status-icon.c
==============================================================================
--- trunk/src/empathy-status-icon.c (original)
+++ trunk/src/empathy-status-icon.c Mon May 5 20:34:41 2008
@@ -44,15 +44,11 @@
#define DEBUG_FLAG EMPATHY_DEBUG_FILTER
#include <libempathy/empathy-debug.h>
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_STATUS_ICON, EmpathyStatusIconPriv))
-
/* Number of ms to wait when blinking */
#define BLINK_TIMEOUT 500
-typedef struct _StatusIconEvent StatusIconEvent;
-
-struct _EmpathyStatusIconPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyStatusIcon)
+typedef struct {
GtkStatusIcon *icon;
EmpathyIdle *idle;
MissionControl *mc;
@@ -67,7 +63,7 @@
GtkWidget *show_window_item;
GtkWidget *message_item;
GtkWidget *status_item;
-};
+} EmpathyStatusIconPriv;
G_DEFINE_TYPE (EmpathyStatusIcon, empathy_status_icon, G_TYPE_OBJECT);
@@ -369,8 +365,10 @@
static void
empathy_status_icon_init (EmpathyStatusIcon *icon)
{
- EmpathyStatusIconPriv *priv = GET_PRIV (icon);
+ EmpathyStatusIconPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (icon,
+ EMPATHY_TYPE_STATUS_ICON, EmpathyStatusIconPriv);
+ icon->priv = priv;
priv->icon = gtk_status_icon_new ();
priv->mc = empathy_mission_control_new ();
priv->idle = empathy_idle_new ();
Modified: trunk/src/empathy-status-icon.h
==============================================================================
--- trunk/src/empathy-status-icon.h (original)
+++ trunk/src/empathy-status-icon.h Mon May 5 20:34:41 2008
@@ -35,10 +35,10 @@
typedef struct _EmpathyStatusIcon EmpathyStatusIcon;
typedef struct _EmpathyStatusIconClass EmpathyStatusIconClass;
-typedef struct _EmpathyStatusIconPriv EmpathyStatusIconPriv;
struct _EmpathyStatusIcon {
- GObject parent;
+ GObject parent;
+ gpointer priv;
};
struct _EmpathyStatusIconClass {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]