changeset 22317:2ab289f312d0

Hide PurpleSmiley internals.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 25 Feb 2008 02:43:06 +0000
parents 01e181575f27
children d1bcb54920f8
files libpurple/smiley.c libpurple/smiley.h pidgin/gtksmiley.c
diffstat 3 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/smiley.c	Tue Feb 19 20:02:14 2008 +0000
+++ b/libpurple/smiley.c	Mon Feb 25 02:43:06 2008 +0000
@@ -36,6 +36,16 @@
 /* Main structures, members and constants                                 */
 /**************************************************************************/
 
+struct _PurpleSmiley
+{
+        PurpleStoredImage *img;        /**< The id of the stored image with the
+                                        the smiley data.        */
+        char *shortcut;                /**< Shortcut associated with the custom
+                                        smiley. This field will work as a
+                                        unique key by this API. */
+        char *checksum;                /**< The smiley checksum.        */
+};
+
 static GHashTable *smiley_data_index = NULL;
 static GHashTable *smiley_shortcut_index = NULL;
 static GHashTable *smiley_checksum_index = NULL;
--- a/libpurple/smiley.h	Tue Feb 19 20:02:14 2008 +0000
+++ b/libpurple/smiley.h	Mon Feb 25 02:43:06 2008 +0000
@@ -36,14 +36,7 @@
  * This contains everything Purple will ever need to know about a custom smiley.
  * Everything.
  */
-typedef struct _PurpleSmiley {
-        PurpleStoredImage *img;        /**< The id of the stored image with the
-                                        the smiley data.        */
-        char *shortcut;                /**< Shortcut associated with the custom
-                                        smiley. This field will work as a
-                                        unique key by this API. */
-        char *checksum;                /**< The smiley checksum.        */
-} PurpleSmiley;
+typedef struct _PurpleSmiley PurpleSmiley;
 
 #ifdef __cplusplus
 extern "C" {
--- a/pidgin/gtksmiley.c	Tue Feb 19 20:02:14 2008 +0000
+++ b/pidgin/gtksmiley.c	Mon Feb 25 02:43:06 2008 +0000
@@ -86,12 +86,12 @@
 	gchar *filename;
 	const gchar *file;
 
-	file = purple_imgstore_get_filename(smiley->img);
+	file = purple_imgstore_get_filename(purple_smiley_get_stored_image(smiley));
 
 	filename = g_build_filename(purple_smileys_get_storing_dir(),file, NULL);
 
 	gtksmiley = g_new0(GtkIMHtmlSmiley,1);
-	gtksmiley->smile = g_strdup(smiley->shortcut);
+	gtksmiley->smile = g_strdup(purple_smiley_get_shortcut(smiley));
 	gtksmiley->hidden = FALSE;
 	gtksmiley->file = filename;
 	gtksmiley->flags = GTK_IMHTML_SMILEY_CUSTOM;
@@ -128,7 +128,7 @@
 	for (; list; list = list->next) {
 		gtksmiley = (GtkIMHtmlSmiley*)list->data;
 
-		if (strcmp(gtksmiley->smile, smiley->shortcut))
+		if (strcmp(gtksmiley->smile, purple_smiley_get_shortcut(smiley)))
 			continue;
 
 		destroy_gtksmiley(gtksmiley);
@@ -417,7 +417,7 @@
 
 	gtk_list_store_set(smiley_manager->model, &iter,
 			ICON, sized_smiley,
-			SHORTCUT, smiley->shortcut,
+			SHORTCUT, purple_smiley_get_shortcut(smiley),
 			DATA, NULL,
 			-1);