/dev/tomkiewicz/new-smileys: aa22dcef8913: Initial PidginSmileyT...
Tomasz Wasilczyk
twasilczyk at pidgin.im
Mon Mar 31 07:26:19 EDT 2014
Changeset: aa22dcef891360e09b4bd6439f9b7811dba9c2c1
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2014-03-31 13:26 +0200
Branch: default
URL: https://hg.pidgin.im/dev/tomkiewicz/new-smileys/rev/aa22dcef8913
Description:
Initial PidginSmileyTheme implementation
diffstat:
libpurple/smiley-theme.c | 3 -
libpurple/smiley-theme.h | 2 +-
pidgin/Makefile.am | 2 +
pidgin/gtksmiley-theme.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++
pidgin/gtksmiley-theme.h | 77 ++++++++++++++++++++++++++++++++++++++++
pidgin/libpidgin.c | 2 +
6 files changed, 174 insertions(+), 4 deletions(-)
diffs (240 lines):
diff --git a/libpurple/smiley-theme.c b/libpurple/smiley-theme.c
--- a/libpurple/smiley-theme.c
+++ b/libpurple/smiley-theme.c
@@ -21,9 +21,6 @@
#include "smiley-theme.h"
-#include "dbus-maybe.h"
-#include "debug.h"
-
static PurpleSmileyTheme *current = NULL;
/*******************************************************************************
diff --git a/libpurple/smiley-theme.h b/libpurple/smiley-theme.h
--- a/libpurple/smiley-theme.h
+++ b/libpurple/smiley-theme.h
@@ -86,5 +86,5 @@ purple_smiley_theme_uninit(void);
G_END_DECLS
-#endif /* _PURPLE_SMILEY_H_ */
+#endif /* _PURPLE_SMILEY_THEME_H_ */
diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -75,6 +75,7 @@ libpidgin_la_SOURCES = \
gtksavedstatuses.c \
gtkscrollbook.c \
gtksession.c \
+ gtksmiley-theme.c \
gtksmiley.c \
gtksound.c \
gtkstatus-icon-theme.c \
@@ -125,6 +126,7 @@ libpidgin_la_headers = \
gtksavedstatuses.h \
gtkscrollbook.h \
gtksession.h \
+ gtksmiley-theme.h \
gtksmiley.h \
gtksound.h \
gtkstatus-icon-theme.h \
diff --git a/pidgin/gtksmiley-theme.c b/pidgin/gtksmiley-theme.c
new file mode 100644
--- /dev/null
+++ b/pidgin/gtksmiley-theme.c
@@ -0,0 +1,92 @@
+/* pidgin
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ */
+
+#include "gtksmiley-theme.h"
+
+#define PIDGIN_SMILEY_THEME_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), PIDGIN_TYPE_SMILEY_THEME, \
+ PurpleSmileyThemePrivate))
+
+typedef struct
+{
+} PurpleSmileyThemePrivate;
+
+static GObjectClass *parent_class;
+
+/*******************************************************************************
+ * API implementation
+ ******************************************************************************/
+
+static PurpleSmileyList *
+pidgin_smiley_theme_get_smileys_impl(PurpleSmileyTheme *theme, gpointer ui_data)
+{
+ return NULL;
+}
+
+void
+pidgin_smiley_theme_init(void)
+{
+}
+
+
+/*******************************************************************************
+ * Object stuff
+ ******************************************************************************/
+
+static void
+pidgin_smiley_theme_finalize(GObject *obj)
+{
+ G_OBJECT_CLASS(parent_class)->finalize(obj);
+}
+
+static void
+pidgin_smiley_theme_class_init(PurpleSmileyListClass *klass)
+{
+ GObjectClass *gobj_class = G_OBJECT_CLASS(klass);
+ PurpleSmileyThemeClass *pst_class = PURPLE_SMILEY_THEME_CLASS(klass);
+
+ parent_class = g_type_class_peek_parent(klass);
+
+ g_type_class_add_private(klass, sizeof(PurpleSmileyThemePrivate));
+
+ gobj_class->finalize = pidgin_smiley_theme_finalize;
+
+ pst_class->get_smileys = pidgin_smiley_theme_get_smileys_impl;
+}
+
+GType
+purple_smiley_theme_get_type(void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY(type == 0)) {
+ static const GTypeInfo info = {
+ .class_size = sizeof(PurpleSmileyThemeClass),
+ .class_init = (GClassInitFunc)pidgin_smiley_theme_class_init,
+ .instance_size = sizeof(PurpleSmileyTheme),
+ };
+
+ type = g_type_register_static(G_TYPE_OBJECT,
+ "PurpleSmileyTheme", &info, G_TYPE_FLAG_ABSTRACT);
+ }
+
+ return type;
+}
diff --git a/pidgin/gtksmiley-theme.h b/pidgin/gtksmiley-theme.h
new file mode 100644
--- /dev/null
+++ b/pidgin/gtksmiley-theme.h
@@ -0,0 +1,77 @@
+/* pidgin
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ */
+
+#ifndef _PIDGIN_SMILEY_THEME_H_
+#define _PIDGIN_SMILEY_THEME_H_
+
+#include <glib-object.h>
+
+#include "smiley-theme.h"
+
+typedef struct _PidginSmileyTheme PidginSmileyTheme;
+typedef struct _PidginSmileyThemeClass PidginSmileyThemeClass;
+
+#define PIDGIN_TYPE_SMILEY_THEME (pidgin_smiley_theme_get_type())
+#define PIDGIN_SMILEY_THEME(smiley) (G_TYPE_CHECK_INSTANCE_CAST((smiley), PIDGIN_TYPE_SMILEY_THEME, PidginSmileyTheme))
+#define PIDGIN_SMILEY_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PIDGIN_TYPE_SMILEY_THEME, PidginSmileyThemeClass))
+#define PIDGIN_IS_SMILEY_THEME(smiley) (G_TYPE_CHECK_INSTANCE_TYPE((smiley), PIDGIN_TYPE_SMILEY_THEME))
+#define PIDGIN_IS_SMILEY_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PIDGIN_TYPE_SMILEY_THEME))
+#define PIDGIN_SMILEY_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PIDGIN_TYPE_SMILEY_THEME, PidginSmileyThemeClass))
+
+/**
+ * PidginSmileyTheme:
+ *
+ * A list of smileys.
+ */
+struct _PidginSmileyTheme
+{
+ /*< private >*/
+ PurpleSmileyTheme parent;
+};
+
+struct _PidginSmileyThemeClass
+{
+ /*< private >*/
+ PurpleSmileyThemeClass parent_class;
+
+ void (*pidgin_reserved1)(void);
+ void (*pidgin_reserved2)(void);
+ void (*pidgin_reserved3)(void);
+ void (*pidgin_reserved4)(void);
+};
+
+G_BEGIN_DECLS
+
+/**
+ * pidgin_smiley_theme_get_type:
+ *
+ * Returns: The #GType for a smiley list.
+ */
+GType
+pidgin_smiley_theme_get_type(void);
+
+void
+pidgin_smiley_theme_init(void);
+
+G_END_DECLS
+
+#endif /* _PIDGIN_SMILEY_THEME_H_ */
+
diff --git a/pidgin/libpidgin.c b/pidgin/libpidgin.c
--- a/pidgin/libpidgin.c
+++ b/pidgin/libpidgin.c
@@ -65,6 +65,7 @@
#include "gtksavedstatuses.h"
#include "gtksession.h"
#include "gtksmiley.h"
+#include "gtksmiley-theme.h"
#include "gtksound.h"
#include "gtkthemes.h"
#include "gtkutils.h"
@@ -287,6 +288,7 @@ pidgin_ui_init(void)
pidgin_log_init();
pidgin_docklet_init();
pidgin_smileys_init();
+ pidgin_smiley_theme_init();
pidgin_utils_init();
pidgin_medias_init();
pidgin_notify_init();
More information about the Commits
mailing list