pidgin/pidgin

fd7447005dea
Parents 9dadde8529a8
Children 2bab0b4de137
Convert PurpleNotifySearchButton to a GBoxed type
--- a/libpurple/notify.c Wed Dec 09 23:57:54 2015 -0800
+++ b/libpurple/notify.c Thu Dec 10 22:53:13 2015 -0800
@@ -860,6 +860,33 @@
return type;
}
+static PurpleNotifySearchButton *
+purple_notify_search_button_copy(PurpleNotifySearchButton *button)
+{
+ PurpleNotifySearchButton *button_new;
+
+ g_return_val_if_fail(button != NULL, NULL);
+
+ button_new = g_new(PurpleNotifySearchButton, 1);
+ *button_new = *button;
+
+ return button_new;
+}
+
+GType
+purple_notify_search_button_get_type(void)
+{
+ static GType type = 0;
+
+ if (type == 0) {
+ type = g_boxed_type_register_static("PurpleNotifySearchButton",
+ (GBoxedCopyFunc)purple_notify_search_button_copy,
+ (GBoxedFreeFunc)g_free);
+ }
+
+ return type;
+}
+
void
purple_notify_set_ui_ops(PurpleNotifyUiOps *ops)
{
--- a/libpurple/notify.h Wed Dec 09 23:57:54 2015 -0800
+++ b/libpurple/notify.h Thu Dec 10 22:53:13 2015 -0800
@@ -38,6 +38,9 @@
#define PURPLE_TYPE_NOTIFY_USER_INFO (purple_notify_user_info_get_type())
typedef struct _PurpleNotifyUserInfo PurpleNotifyUserInfo;
+#define PURPLE_TYPE_NOTIFY_SEARCH_BUTTON (purple_notify_search_button_get_type())
+typedef struct _PurpleNotifySearchButton PurpleNotifySearchButton;
+
/**
* PurpleNotifySearchColumn:
*
@@ -166,17 +169,18 @@
/**
* PurpleNotifySearchButton:
+ * @type: The type of search button that will be used.
* @callback: Function to be called when clicked.
* @label: only for PURPLE_NOTIFY_BUTTON_LABELED
*
* Definition of a button.
*/
-typedef struct
+struct _PurpleNotifySearchButton
{
PurpleNotifySearchButtonType type;
PurpleNotifySearchResultsCallback callback;
char *label;
-} PurpleNotifySearchButton;
+};
/**
@@ -489,6 +493,13 @@
gpointer user_data);
/**
+ * purple_notify_search_button_get_type:
+ *
+ * Returns: The #GType for #PurpleNotifiySearchButton boxed structure.
+ */
+GType purple_notify_search_button_get_type(void);
+
+/**
* purple_notify_user_info_get_type:
*
* Returns: The #GType for the #PurpleNotifyUserInfo boxed structure.