Commit 15570951 authored by Xavier Claessens's avatar Xavier Claessens

Keep a priv pointer in the object struct instead of using G_TYPE_INSTANCE_GET_PRIVATE all the time.

svn path=/trunk/; revision=1082
parent 62828fac
......@@ -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 @@ empathy_account_chooser_class_init (EmpathyAccountChooserClass *klass)
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;
......
......@@ -47,6 +47,7 @@ typedef struct _EmpathyAccountChooserClass EmpathyAccountChooserClass;
struct _EmpathyAccountChooser {
GtkComboBox parent;
gpointer priv;
};
struct _EmpathyAccountChooserClass {
......
......@@ -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 @@ empathy_avatar_chooser_class_init (EmpathyAvatarChooserClass *klass)
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,
......
......@@ -38,10 +38,10 @@ G_BEGIN_DECLS
typedef struct _EmpathyAvatarChooser EmpathyAvatarChooser;
typedef struct _EmpathyAvatarChooserClass EmpathyAvatarChooserClass;
typedef struct _EmpathyAvatarChooserPrivate EmpathyAvatarChooserPrivate;
struct _EmpathyAvatarChooser {
GtkButton parent;
gpointer priv;
};
struct _EmpathyAvatarChooserClass {
......
......@@ -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 @@ empathy_avatar_image_class_init (EmpathyAvatarImageClass *klass)
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);
......
......@@ -42,6 +42,7 @@ typedef struct _EmpathyAvatarImageClass EmpathyAvatarImageClass;
struct _EmpathyAvatarImage {
GtkEventBox parent;
gpointer priv;
};
struct _EmpathyAvatarImageClass {
......
......@@ -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 @@ static gboolean empathy_cell_renderer_expander_activate (GtkCellRenderer
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;
......
......@@ -39,6 +39,7 @@ typedef struct _EmpathyCellRendererExpanderClass EmpathyCellRendererExpanderClas
struct _EmpathyCellRendererExpander {
GtkCellRenderer parent;
gpointer priv;
};
struct _EmpathyCellRendererExpanderClass {
......
......@@ -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 @@ struct _EmpathyCellRendererTextPriv {
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 @@ empathy_cell_renderer_text_class_init (EmpathyCellRendererTextClass *klass)
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);
......
......@@ -36,12 +36,10 @@ G_BEGIN_DECLS
typedef struct _EmpathyCellRendererText EmpathyCellRendererText;
typedef struct _EmpathyCellRendererTextClass EmpathyCellRendererTextClass;
typedef struct _EmpathyCellRendererTextPriv EmpathyCellRendererTextPriv;
struct _EmpathyCellRendererText {
GtkCellRendererText parent;
EmpathyCellRendererTextPriv *priv;
GtkCellRendererText parent;
gpointer priv;
};
struct _EmpathyCellRendererTextClass {
......
......@@ -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 @@ struct _EmpathyChatViewPriv {
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 @@ empathy_chat_view_class_init (EmpathyChatViewClass *klass)
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;
......
......@@ -41,12 +41,12 @@ G_BEGIN_DECLS
typedef struct _EmpathyChatView EmpathyChatView;
typedef struct _EmpathyChatViewClass EmpathyChatViewClass;
typedef struct _EmpathyChatViewPriv EmpathyChatViewPriv;
#include "empathy-theme.h"
struct _EmpathyChatView {
GtkTextView parent;
gpointer priv;
};
struct _EmpathyChatViewClass {
......
......@@ -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 @@ struct _EmpathyChatPriv {
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 @@ chat_block_events_timeout_cb (gpointer data)
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;
......
......@@ -47,10 +47,10 @@ G_BEGIN_DECLS
typedef struct _EmpathyChat EmpathyChat;
typedef struct _EmpathyChatClass EmpathyChatClass;
typedef struct _EmpathyChatPriv EmpathyChatPriv;
struct _EmpathyChat {
GtkBin parent;
gpointer priv;
/* Protected */
EmpathyChatView *view;
......
......@@ -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 @@ empathy_conf_class_init (EmpathyConfClass *class)
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,
......
......@@ -37,6 +37,7 @@ typedef struct _EmpathyConfClass EmpathyConfClass;
struct _EmpathyConf {
GObject parent;
gpointer priv;
};
struct _EmpathyConfClass {
......
......@@ -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 @@ typedef struct {
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 @@ empathy_contact_list_store_class_init (EmpathyContactListStoreClass *klass)
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,
......
......@@ -66,6 +66,7 @@ typedef enum {
struct _EmpathyContactListStore {
GtkTreeStore parent;
gpointer priv;
};
struct _EmpathyContactListStoreClass {
......
......@@ -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 @@ empathy_contact_list_view_class_init (EmpathyContactListViewClass *klass)
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 ();
......
......@@ -57,11 +57,12 @@ typedef enum {
} 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;
......
......@@ -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 @@ static guint states[] = {MC_PRESENCE_AVAILABLE, TRUE,
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 @@ empathy_presence_chooser_class_init (EmpathyPresenceChooserClass *klass)
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);
......
......@@ -41,6 +41,7 @@ typedef struct _EmpathyPresenceChooserClass EmpathyPresenceChooserClass;
struct _EmpathyPresenceChooser {
GtkToggleButton parent;
gpointer priv;
};
struct _EmpathyPresenceChooserClass {
......
......@@ -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 @@ empathy_smiley_manager_class_init (EmpathySmileyManagerClass *klass)
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;
}
......
......@@ -37,10 +37,10 @@ G_BEGIN_DECLS
typedef struct _EmpathySmileyManager EmpathySmileyManager;
typedef struct _EmpathySmileyManagerClass EmpathySmileyManagerClass;
typedef struct _EmpathySmileyManagerPriv EmpathySmileyManagerPriv;
struct _EmpathySmileyManager {
GObject parent;
gpointer priv;
};
struct _EmpathySmileyManagerClass {
......
......@@ -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 @@ struct _EmpathyThemeBoxesPriv {
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 @@ empathy_theme_boxes_class_init (EmpathyThemeBoxesClass *class)
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 @@ theme_boxes_append_message (EmpathyTheme *theme,
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",
......
......@@ -39,6 +39,7 @@ typedef struct _EmpathyThemeBoxesClass EmpathyThemeBoxesClass;
struct _EmpathyThemeBoxes {
EmpathyTheme parent;
gpointer priv;
};
struct _EmpathyThemeBoxesClass {
......
......@@ -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 @@ empathy_theme_irc_class_init (EmpathyThemeIrcClass *class)
}
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 @@ theme_irc_append_message (EmpathyTheme *theme,
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 {
......
......@@ -39,6 +39,7 @@ typedef struct _EmpathyThemeIrcClass EmpathyThemeIrcClass;
struct _EmpathyThemeIrc {
EmpathyTheme parent;
gpointer priv;