/pidgin/main: 98ec68212b1f: Move PurpleIconScaleRules to BuddyIc...

Jorge Villase?or salinasv at pidgin.im
Tue Dec 15 02:30:12 EST 2015


Changeset: 98ec68212b1f6da18e2d60de3bd95915c55582e6
Author:	 Jorge Villase?or <salinasv at pidgin.im>
Date:	 2015-12-09 22:29 -0800
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/98ec68212b1f

Description:

Move PurpleIconScaleRules to BuddyIcon API
Move PurpleIconScaleRules to a more sensible place

Moved from protocols.h to buddyicon.h
Changed name from PurpleIconScaleRules to PurpleBuddyIconScaleFlags

diffstat:

 ChangeLog.API         |   1 +
 libpurple/Makefile.am |   1 +
 libpurple/buddyicon.c |   2 +-
 libpurple/buddyicon.h |  16 ++++++++++++++--
 libpurple/protocols.h |  12 ------------
 pidgin/gtkutils.c     |   2 +-
 pidgin/gtkutils.h     |   2 +-
 7 files changed, 19 insertions(+), 17 deletions(-)

diffs (120 lines):

diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -275,6 +275,7 @@ version 3.0.0 (??/??/????):
 		* purple_conversation_get_gc renamed to
 		  purple_conversation_get_connection
 		* purple_dnsquery_a now takes a PurpleAccount as the first parameter
+		* PurpleIconScaleRules renamed to PurpleBuddyIconScaleFlags
 		* purple_imgstore_add renamed to purple_imgstore_new
 		* purple_imgstore_add_with_id renamed to purple_imgstore_new_with_id
 		* purple_network_listen now takes the protocol family as the second
diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -253,6 +253,7 @@ purple_builtheaders = purple.h version.h
 
 purple_enumheaders = \
 	$(srcdir)/account.h \
+	$(srcdir)/buddyicon.h \
 	$(srcdir)/cipher.h \
 	$(srcdir)/connection.h \
 	$(srcdir)/conversation.h \
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -1129,7 +1129,7 @@ purple_buddy_icon_get_type(void)
 PurpleBuddyIconSpec *
 purple_buddy_icon_spec_new(char *format, int min_width, int min_height,
 		int max_width, int max_height, size_t max_filesize,
-		PurpleIconScaleRules scale_rules)
+		PurpleBuddyIconScaleFlags scale_rules)
 {
 	PurpleBuddyIconSpec *icon_spec;
 
diff --git a/libpurple/buddyicon.h b/libpurple/buddyicon.h
--- a/libpurple/buddyicon.h
+++ b/libpurple/buddyicon.h
@@ -51,6 +51,18 @@ typedef struct _PurpleBuddyIconSpec Purp
 #include "util.h"
 
 /**
+ * PurpleBuddyIconScaleFlags:
+ * @PURPLE_ICON_SCALE_DISPLAY: We scale the icon when we display it
+ * @PURPLE_ICON_SCALE_SEND:    We scale the icon before we send it to the server
+ */
+typedef enum  /*< flags >*/
+{
+	PURPLE_ICON_SCALE_DISPLAY = 0x01,
+	PURPLE_ICON_SCALE_SEND    = 0x02
+
+} PurpleBuddyIconScaleFlags;
+
+/**
  * PurpleBuddyIconSpec:
  * @format: This is a comma-delimited list of image formats or %NULL if icons
  *          are not supported.  Neither the core nor the protocol will actually
@@ -75,7 +87,7 @@ struct _PurpleBuddyIconSpec {
 	int max_width;
 	int max_height;
 	size_t max_filesize;
-	PurpleIconScaleRules scale_rules;
+	PurpleBuddyIconScaleFlags scale_rules;
 };
 
 G_BEGIN_DECLS
@@ -482,7 +494,7 @@ GType purple_buddy_icon_spec_get_type(vo
  */
 PurpleBuddyIconSpec *purple_buddy_icon_spec_new(char *format, int min_width,
 		int min_height, int max_width, int max_height, size_t max_filesize,
-		PurpleIconScaleRules scale_rules);
+		PurpleBuddyIconScaleFlags scale_rules);
 
 /**
  * purple_buddy_icon_spec_get_scaled_size:
diff --git a/libpurple/protocols.h b/libpurple/protocols.h
--- a/libpurple/protocols.h
+++ b/libpurple/protocols.h
@@ -50,18 +50,6 @@ typedef struct _PurpleAttentionType Purp
 /* Basic Protocol Information                                             */
 /**************************************************************************/
 
-/**
- * PurpleIconScaleRules:
- * @PURPLE_ICON_SCALE_DISPLAY: We scale the icon when we display it
- * @PURPLE_ICON_SCALE_SEND:    We scale the icon before we send it to the server
- */
-typedef enum  /*< flags >*/
-{
-	PURPLE_ICON_SCALE_DISPLAY = 0x01,
-	PURPLE_ICON_SCALE_SEND    = 0x02
-	
-} PurpleIconScaleRules;
-
 typedef struct _PurpleProtocolChatEntry PurpleProtocolChatEntry;
 
 /**
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -1622,7 +1622,7 @@ pidgin_dnd_file_manage(GtkSelectionData 
 	g_free(basename);
 }
 
-void pidgin_buddy_icon_get_scale_size(GdkPixbuf *buf, PurpleBuddyIconSpec *spec, PurpleIconScaleRules rules, int *width, int *height)
+void pidgin_buddy_icon_get_scale_size(GdkPixbuf *buf, PurpleBuddyIconSpec *spec, PurpleBuddyIconScaleFlags rules, int *width, int *height)
 {
 	*width = gdk_pixbuf_get_width(buf);
 	*height = gdk_pixbuf_get_height(buf);
diff --git a/pidgin/gtkutils.h b/pidgin/gtkutils.h
--- a/pidgin/gtkutils.h
+++ b/pidgin/gtkutils.h
@@ -535,7 +535,7 @@ void pidgin_dnd_file_manage(GtkSelection
  *
  * Convenience wrapper for purple_buddy_icon_spec_get_scaled_size
  */
-void pidgin_buddy_icon_get_scale_size(GdkPixbuf *buf, PurpleBuddyIconSpec *spec, PurpleIconScaleRules rules, int *width, int *height);
+void pidgin_buddy_icon_get_scale_size(GdkPixbuf *buf, PurpleBuddyIconSpec *spec, PurpleBuddyIconScaleFlags rules, int *width, int *height);
 
 /**
  * pidgin_create_protocol_icon:



More information about the Commits mailing list