pidgin/pidgin

8c277214ce6f
Parents 106ae46b290b
Children 29ebd938c592
Move PurpleProtocolChatEntry to purpleprotocolchat.h

Also remove the boxed code as nothing was using it as a boxed type anyways.

Testing Done:
Compiled

Reviewed at https://reviews.imfreedom.org/r/2067/
--- a/libpurple/protocols.c Wed Nov 16 22:36:02 2022 -0600
+++ b/libpurple/protocols.c Wed Nov 16 22:37:33 2022 -0600
@@ -38,37 +38,6 @@
#include "server.h"
#include "util.h"
-/**************************************************************************
- * GBoxed code for PurpleProtocolChatEntry
- **************************************************************************/
-
-static PurpleProtocolChatEntry *
-purple_protocol_chat_entry_copy(PurpleProtocolChatEntry *pce)
-{
- PurpleProtocolChatEntry *pce_copy;
-
- g_return_val_if_fail(pce != NULL, NULL);
-
- pce_copy = g_new(PurpleProtocolChatEntry, 1);
- *pce_copy = *pce;
-
- return pce_copy;
-}
-
-GType
-purple_protocol_chat_entry_get_type(void)
-{
- static GType type = 0;
-
- if (type == 0) {
- type = g_boxed_type_register_static("PurpleProtocolChatEntry",
- (GBoxedCopyFunc)purple_protocol_chat_entry_copy,
- (GBoxedFreeFunc)g_free);
- }
-
- return type;
-}
-
/**************************************************************************/
/* Protocol API */
/**************************************************************************/
--- a/libpurple/protocols.h Wed Nov 16 22:36:02 2022 -0600
+++ b/libpurple/protocols.h Wed Nov 16 22:37:33 2022 -0600
@@ -30,55 +30,13 @@
/* Basic Protocol Information */
/**************************************************************************/
-typedef struct _PurpleProtocolChatEntry PurpleProtocolChatEntry;
-
#include "media.h"
#include "purpleprotocol.h"
#include "status.h"
-#define PURPLE_TYPE_PROTOCOL_CHAT_ENTRY (purple_protocol_chat_entry_get_type())
-
-/**
- * PurpleProtocolChatEntry:
- * @label: User-friendly name of the entry
- * @identifier: Used by the protocol to identify the option
- * @required: True if it's required
- * @is_int: True if the entry expects an integer
- * @min: Minimum value in case of integer
- * @max: Maximum value in case of integer
- * @secret: True if the entry is secret (password)
- *
- * Represents an entry containing information that must be supplied by the
- * user when joining a chat.
- */
-struct _PurpleProtocolChatEntry {
- const char *label;
- const char *identifier;
- gboolean required;
- gboolean is_int;
- int min;
- int max;
- gboolean secret;
-};
-
G_BEGIN_DECLS
/**************************************************************************/
-/* Attention Type API */
-/**************************************************************************/
-
-/**************************************************************************/
-/* Protocol Chat Entry API */
-/**************************************************************************/
-
-/**
- * purple_protocol_chat_entry_get_type:
- *
- * Returns: The #GType for the #PurpleProtocolChatEntry boxed structure.
- */
-GType purple_protocol_chat_entry_get_type(void);
-
-/**************************************************************************/
/* Protocol API */
/**************************************************************************/
--- a/libpurple/purpleprotocolchat.h Wed Nov 16 22:36:02 2022 -0600
+++ b/libpurple/purpleprotocolchat.h Wed Nov 16 22:37:33 2022 -0600
@@ -47,6 +47,31 @@
G_DECLARE_INTERFACE(PurpleProtocolChat, purple_protocol_chat, PURPLE,
PROTOCOL_CHAT, PurpleProtocol)
+typedef struct _PurpleProtocolChatEntry PurpleProtocolChatEntry;
+
+/**
+ * PurpleProtocolChatEntry:
+ * @label: User-friendly name of the entry
+ * @identifier: Used by the protocol to identify the option
+ * @required: True if it's required
+ * @is_int: True if the entry expects an integer
+ * @min: Minimum value in case of integer
+ * @max: Maximum value in case of integer
+ * @secret: True if the entry is secret (password)
+ *
+ * Represents an entry containing information that must be supplied by the
+ * user when joining a chat.
+ */
+struct _PurpleProtocolChatEntry {
+ const char *label;
+ const char *identifier;
+ gboolean required;
+ gboolean is_int;
+ int min;
+ int max;
+ gboolean secret;
+};
+
G_BEGIN_DECLS
/**