Remove gtkconv.[ch]

Sat, 30 Dec 2023 20:04:22 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Sat, 30 Dec 2023 20:04:22 -0600
changeset 42553
0622b87a3b8f
parent 42552
7e9e07a3b9cf
child 42554
32dc4a2380b4

Remove gtkconv.[ch]

The only thing still using this is the unity plugin which will need to be
updated to the new api when it is finalized. In the meantime, I just disabled
it by default so we can remove all of this.

Testing Done:
Ran with the turtles and did a quick connectivity check.

Reviewed at https://reviews.imfreedom.org/r/2895/

ChangeLog.API file | annotate | diff | comparison | revisions
doc/reference/pidgin/meson.build file | annotate | diff | comparison | revisions
doc/reference/pidgin/pidgin.toml.in file | annotate | diff | comparison | revisions
doc/reference/pidgin/signals_gtkconv.md file | annotate | diff | comparison | revisions
meson_options.txt file | annotate | diff | comparison | revisions
pidgin/gtkconv.c file | annotate | diff | comparison | revisions
pidgin/gtkconv.h file | annotate | diff | comparison | revisions
pidgin/gtkdialogs.c file | annotate | diff | comparison | revisions
pidgin/meson.build file | annotate | diff | comparison | revisions
pidgin/pidgindisplaywindow.c file | annotate | diff | comparison | revisions
pidgin/pidginui.c file | annotate | diff | comparison | revisions
po/POTFILES.in file | annotate | diff | comparison | revisions
--- a/ChangeLog.API	Sat Dec 30 19:38:20 2023 -0600
+++ b/ChangeLog.API	Sat Dec 30 20:04:22 2023 -0600
@@ -1046,6 +1046,10 @@
 		* pidgin_conv_update_buddy_icon
 		* pidgin_conv_update_buttons_by_protocol
 		* pidgin_conversations_fill_menu
+		* pidgin_conversations_get_conv_ui_ops
+		* pidgin_conversations_get_handle
+		* pidgin_conversations_init
+		* pidgin_conversations_uninit
 		* pidgin_conversations_get_unseen_all
 		* pidgin_convert_buddy_icon
 		* pidgin_create_dialog, use pidgin_dialog_new instead.
--- a/doc/reference/pidgin/meson.build	Sat Dec 30 19:38:20 2023 -0600
+++ b/doc/reference/pidgin/meson.build	Sat Dec 30 20:04:22 2023 -0600
@@ -1,5 +1,4 @@
 pidgin_doc_content_files = [
-	'signals_gtkconv.md',
 ]
 
 if get_option('doc')
--- a/doc/reference/pidgin/pidgin.toml.in	Sat Dec 30 19:38:20 2023 -0600
+++ b/doc/reference/pidgin/pidgin.toml.in	Sat Dec 30 20:04:22 2023 -0600
@@ -52,7 +52,6 @@
 [extra]
 # The same order will be used when generating the index
 content_files = [
-	"signals_gtkconv.md",
 ]
 content_images = [
 ]
--- a/doc/reference/pidgin/signals_gtkconv.md	Sat Dec 30 19:38:20 2023 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-Title: Conversation Signals
-Slug: conversation-signals
-
-## Conversation signals
-
-### displaying-im-msg
-
-```c
-gboolean
-user_function(PurpleAccount *account,
-              const gchar *who,
-              gchar **message,
-              PurpleConversation *conv,
-              PurpleMessageFlags flags,
-              gpointer user_data);
-```
-
-Emitted just before a message is displayed in an IM conversation. `message` is
-a pointer to a string, so the plugin can replace the message that will be
-displayed. This can also be used to cancel displaying a message by returning
-`TRUE`.
-
-> **NOTE:** Make sure to free `*message` before you replace it!
-
-**Parameters:**
-
-**account**
-: The account.
-
-**who**
-: The name of the user.
-
-**message**
-: A pointer to the message.
-
-**conv**
-: The conversation.
-
-**flags**
-: Flags for this message.
-
-**user_data**
-: User data set when the signal handler was connected.
-
-**Returns:**
-
-`TRUE` if the message should be canceled, or `FALSE` otherwise.
-
-## displayed-im-msg
-
-```c
-void
-user_function(PurpleAccount *account,
-              const gchar *who,
-              gchar *message,
-              PurpleConversation *conv,
-              PurpleMessageFlags flags,
-              gpointer user_data);
-```
-
-Emitted after a message is displayed in an IM conversation.
-
-**Parameters:**
-
-**account**
-: The account.
-
-**who**
-: The name of the user.
-
-**message**
-: The message.
-
-**conv**
-: The conversation.
-
-**flags**
-: Flags for this message.
-
-**user_data**
-: User data set when the signal handler was connected.
-
-### displaying-chat-msg
-
-```c
-gboolean
-user_function(PurpleAccount *account,
-              const gchar *who,
-              gchar **message,
-              PurpleConversation *conv,
-              PurpleMessageFlags flags,
-              gpointer user_data);
-```
-
-Emitted just before a message is displayed in a chat. `message` is a pointer to
-a string, so the plugin can replace the message that will be displayed. This
-can also be used to cancel displaying a message by returning `TRUE`.
-
-> **NOTE:** Make sure to free `*message` before you replace it!
-
-**Parameters:**
-
-**account**
-: The account the message is being displayed and sent on.
-
-**who**
-: The name of the user.
-
-**message**
-: A pointer to the message that will be displayed and sent.
-
-**conv**
-: The conversation the message is being displayed and sent on.
-
-**flags**
-: Flags for this message.
-
-**user_data**
-: User data set when the signal handler was connected.
-
-**Returns:**
-
-`TRUE` if the message should be canceled, or `FALSE` otherwise.
-
-### displayed-chat-msg
-
-```c
-void
-user_function(PurpleAccount *account,
-              const gchar *who,
-              gchar *message,
-              PurpleConversation *conv,
-              PurpleMessageFlags flags,
-              gpointer user_data);
-```
-
-Emitted after a message is displayed in a chat conversation.
-
-**Parameters:**
-
-**account**
-: The account the message is being displayed and sent on.
-
-**who**
-: The name of the user.
-
-**message**
-: A pointer to the message that will be displayed and sent.
-
-**conv**
-: The conversation the message is being displayed and sent on.
-
-**flags**
-: Flags for this message.
-
-**user_data**
-: User data set when the signal handler was connected.
-
-
-### conversation-displayed
-
-```c
-void user_function(PidginConversation *gtkconv, gpointer user_data);
-```
-
-Emitted right after the Pidgin UI is attached to a new conversation.
-
-**Parameters:**
-
-**gtkconv**
-: The PidginConversation.
-
-**user_data**
-: User data set when the signal handler was connected.
--- a/meson_options.txt	Sat Dec 30 19:38:20 2023 -0600
+++ b/meson_options.txt	Sat Dec 30 20:04:22 2023 -0600
@@ -46,7 +46,7 @@
 option('gtkui', type : 'boolean', value : true,
        description : 'compile with GTK+ user interface')
 
-option('unity-integration', type : 'feature',
+option('unity-integration', type : 'feature', value : 'disabled',
        description : 'compile with support for unity integration plugin')
 
 ##############################################################################
--- a/pidgin/gtkconv.c	Sat Dec 30 19:38:20 2023 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/* 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 <purpleconfig.h>
-
-#include <purple.h>
-
-#include "gtkconv.h"
-#include "pidgincore.h"
-#include "pidgindisplaywindow.h"
-
-/**************************************************************************
- * Conversation UI operations
- **************************************************************************/
-static void
-conversation_create(PurpleConversation *conv) {
-	GtkWidget *window = NULL;
-
-	window = pidgin_display_window_get_default();
-	pidgin_display_window_add(PIDGIN_DISPLAY_WINDOW(window), conv);
-}
-
-static PurpleConversationUiOps conversation_ui_ops =
-{
-	.create_conversation = conversation_create,
-};
-
-PurpleConversationUiOps *
-pidgin_conversations_get_conv_ui_ops(void)
-{
-	return &conversation_ui_ops;
-}
-
-/**************************************************************************
- * Public conversation utility functions
- **************************************************************************/
-void *
-pidgin_conversations_get_handle(void)
-{
-	static int handle;
-
-	return &handle;
-}
-
-void
-pidgin_conversations_init(void)
-{
-	void *handle = pidgin_conversations_get_handle();
-
-	/* Conversations */
-	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations");
-	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", TRUE);
-	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", 2);
-
-	/**********************************************************************
-	 * Register signals
-	 **********************************************************************/
-	purple_signal_register(handle, "displaying-im-msg",
-		purple_marshal_BOOLEAN__POINTER_POINTER,
-		G_TYPE_BOOLEAN, 2, PURPLE_TYPE_CONVERSATION, PURPLE_TYPE_MESSAGE);
-
-	purple_signal_register(handle, "displayed-im-msg",
-		purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
-		PURPLE_TYPE_CONVERSATION, PURPLE_TYPE_MESSAGE);
-
-	purple_signal_register(handle, "displaying-chat-msg",
-		purple_marshal_BOOLEAN__POINTER_POINTER,
-		G_TYPE_BOOLEAN, 2, PURPLE_TYPE_CONVERSATION, PURPLE_TYPE_MESSAGE);
-
-	purple_signal_register(handle, "displayed-chat-msg",
-		purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
-		PURPLE_TYPE_CONVERSATION, PURPLE_TYPE_MESSAGE);
-
-	purple_signal_register(handle, "conversation-displayed",
-						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
-						 G_TYPE_POINTER); /* (PidginConversationOld *) */
-
-	purple_conversations_set_ui_ops(&conversation_ui_ops);
-}
-
-void
-pidgin_conversations_uninit(void)
-{
-	purple_prefs_disconnect_by_handle(pidgin_conversations_get_handle());
-	purple_signals_disconnect_by_handle(pidgin_conversations_get_handle());
-	purple_signals_unregister_by_instance(pidgin_conversations_get_handle());
-}
--- a/pidgin/gtkconv.h	Sat Dec 30 19:38:20 2023 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/* 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
- */
-
-#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
-# error "only <pidgin.h> may be included directly"
-#endif
-
-#ifndef _PIDGIN_CONVERSATION_H_
-#define _PIDGIN_CONVERSATION_H_
-
-#include <gtk/gtk.h>
-
-typedef struct _PidginConversationOld PidginConversationOld;
-
-#define PIDGIN_CONVERSATION_OLD(conv) \
-	((PidginConversationOld *)g_object_get_data(G_OBJECT(conv), "pidgin"))
-
-#define PIDGIN_IS_PIDGIN_CONVERSATION_OLD(conv) \
-	(purple_conversation_get_ui_ops(conv) == \
-	 pidgin_conversations_get_conv_ui_ops())
-
-#include <purple.h>
-
-#include "pidginversion.h"
-
-/**************************************************************************
- * Structures
- **************************************************************************/
-
-/**
- * PidginConversationOld:
- *
- * A GTK conversation pane.
- */
-struct _PidginConversationOld
-{
-	PurpleConversation *active_conv;
-	GList *convs;
-
-	GtkWidget *tab_cont;
-
-	GtkAdjustment *vadjustment;
-	GtkWidget *history;
-
-	GtkWidget *editor;
-	GtkWidget *entry;
-
-	GtkWidget *infopane;
-};
-
-G_BEGIN_DECLS
-
-/**************************************************************************
- * GTK Conversation API
- **************************************************************************/
-
-/**
- * pidgin_conversations_get_conv_ui_ops:
- *
- * Returns the UI operations structure for GTK conversations.
- *
- * Returns: The GTK conversation operations structure.
- *
- * Since: 2.0.0
- */
-PIDGIN_AVAILABLE_IN_ALL
-PurpleConversationUiOps *pidgin_conversations_get_conv_ui_ops(void);
-
-/**************************************************************************/
-/* GTK Conversations Subsystem                                            */
-/**************************************************************************/
-
-/**
- * pidgin_conversations_get_handle:
- *
- * Returns the gtk conversations subsystem handle.
- *
- * Returns: The conversations subsystem handle.
- *
- * Since: 2.0.0
- */
-PIDGIN_AVAILABLE_IN_ALL
-void *pidgin_conversations_get_handle(void);
-
-/**
- * pidgin_conversations_init:
- *
- * Initializes the GTK conversations subsystem.
- *
- * Since: 2.0.0
- */
-PIDGIN_AVAILABLE_IN_ALL
-void pidgin_conversations_init(void);
-
-/**
- * pidgin_conversations_uninit:
- *
- * Uninitialized the GTK conversation subsystem.
- *
- * Since: 2.0.0
- */
-PIDGIN_AVAILABLE_IN_ALL
-void pidgin_conversations_uninit(void);
-
-G_END_DECLS
-
-#endif /* _PIDGIN_CONVERSATION_H_ */
--- a/pidgin/gtkdialogs.c	Sat Dec 30 19:38:20 2023 -0600
+++ b/pidgin/gtkdialogs.c	Sat Dec 30 20:04:22 2023 -0600
@@ -27,7 +27,6 @@
 
 #include <purple.h>
 
-#include "gtkconv.h"
 #include "gtkdialogs.h"
 #include "gtkutils.h"
 #include "pidgincore.h"
--- a/pidgin/meson.build	Sat Dec 30 19:38:20 2023 -0600
+++ b/pidgin/meson.build	Sat Dec 30 20:04:22 2023 -0600
@@ -3,7 +3,6 @@
 endif
 
 libpidgin_SOURCES = [
-	'gtkconv.c',
 	'gtkdialogs.c',
 	'gtkidle.c',
 	'gtkmedia.c',
@@ -63,7 +62,6 @@
 ]
 
 libpidgin_headers = [
-	'gtkconv.h',
 	'gtkdialogs.h',
 	'gtkidle.h',
 	'gtkmedia.h',
--- a/pidgin/pidgindisplaywindow.c	Sat Dec 30 19:38:20 2023 -0600
+++ b/pidgin/pidgindisplaywindow.c	Sat Dec 30 20:04:22 2023 -0600
@@ -26,7 +26,6 @@
 
 #include "pidgindisplaywindow.h"
 
-#include "gtkconv.h"
 #include "gtkdialogs.h"
 #include "gtkutils.h"
 #include "pidginconversation.h"
--- a/pidgin/pidginui.c	Sat Dec 30 19:38:20 2023 -0600
+++ b/pidgin/pidginui.c	Sat Dec 30 20:04:22 2023 -0600
@@ -30,7 +30,6 @@
 
 #include "pidginui.h"
 
-#include "gtkconv.h"
 #include "gtkidle.h"
 #include "gtkmedia.h"
 #include "gtknotify.h"
@@ -133,7 +132,6 @@
 	purple_idle_set_ui(pidgin_idle_new());
 
 	pidgin_request_init();
-	pidgin_conversations_init();
 	pidgin_commands_init();
 	pidgin_roomlist_init();
 	pidgin_medias_init();
@@ -149,7 +147,6 @@
 	 * shut down. */
 	pidgin_notify_uninit();
 	pidgin_commands_uninit();
-	pidgin_conversations_uninit();
 	pidgin_request_uninit();
 	pidgin_debug_window_hide();
 	pidgin_debug_uninit();
--- a/po/POTFILES.in	Sat Dec 30 19:38:20 2023 -0600
+++ b/po/POTFILES.in	Sat Dec 30 20:04:22 2023 -0600
@@ -232,7 +232,6 @@
 libpurple/win32/win32dep.c
 libpurple/xmlnode.c
 pidgin/data/im.pidgin.Pidgin3.metainfo.xml
-pidgin/gtkconv.c
 pidgin/gtkdialogs.c
 pidgin/gtkidle.c
 pidgin/gtkmedia.c

mercurial