/soc/2013/ankitkv/gobjectification: 9b7ba353b1b3: Merged default...

Ankit Vani a at nevitus.org
Sun Feb 2 07:44:19 EST 2014


Changeset: 9b7ba353b1b3789c8727481f01f7ea93163f7720
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-02 18:11 +0530
Branch:	 gtkdoc-conversion
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/9b7ba353b1b3

Description:

Merged default branch

diffstat:

 pidgin/plugins/Makefile.am  |    4 -
 pidgin/plugins/convcolors.c |  464 --------------------------------------------
 2 files changed, 0 insertions(+), 468 deletions(-)

diffs (truncated from 504 to 300 lines):

diff --git a/pidgin/plugins/Makefile.am b/pidgin/plugins/Makefile.am
--- a/pidgin/plugins/Makefile.am
+++ b/pidgin/plugins/Makefile.am
@@ -31,7 +31,6 @@ SUBDIRS = \
 
 plugindir = $(libdir)/pidgin
 
-convcolors_la_LDFLAGS       = -module -avoid-version
 contact_priority_la_LDFLAGS = -module -avoid-version
 extplacement_la_LDFLAGS     = -module -avoid-version
 gtk_signals_test_la_LDFLAGS = -module -avoid-version
@@ -52,7 +51,6 @@ xmppconsole_la_LDFLAGS      = -module -a
 if PLUGINS
 
 plugin_LTLIBRARIES = \
-	convcolors.la       \
 	extplacement.la     \
 	gtkbuddynote.la     \
 	history.la          \
@@ -75,7 +73,6 @@ noinst_LTLIBRARIES = \
 	contact_priority.la \
 	gtk_signals_test.la
 
-convcolors_la_SOURCES       = convcolors.c
 contact_priority_la_SOURCES = contact_priority.c
 extplacement_la_SOURCES     = extplacement.c
 gtk_signals_test_la_SOURCES = gtk-signals-test.c
@@ -93,7 +90,6 @@ unity_la_SOURCES            = unity.c
 webkit_la_SOURCES           = webkit.c
 xmppconsole_la_SOURCES      = xmppconsole.c
 
-convcolors_la_LIBADD        = $(GTK_LIBS)
 contact_priority_la_LIBADD  = $(GTK_LIBS)
 extplacement_la_LIBADD      = $(GTK_LIBS)
 gtk_signals_test_la_LIBADD  = $(GTK_LIBS)
diff --git a/pidgin/plugins/convcolors.c b/pidgin/plugins/convcolors.c
deleted file mode 100644
--- a/pidgin/plugins/convcolors.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * Conversation Colors
- * Copyright (C) 2006
- *
- * 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 "internal.h"
-
-#define PLUGIN_ID			"gtk-plugin_pack-convcolors"
-#define PLUGIN_NAME			N_("Conversation Colors")
-#define PLUGIN_STATIC_NAME	ConversationColors
-#define PLUGIN_SUMMARY		N_("Customize colors in the conversation window")
-#define PLUGIN_DESCRIPTION	N_("Customize colors in the conversation window")
-#define PLUGIN_AUTHOR		"Sadrul H Chowdhury <sadrul at users.sourceforge.net>"
-
-/* System headers */
-#include <gdk/gdk.h>
-#include <glib.h>
-#include <gtk/gtk.h>
-
-/* Purple headers */
-#include <gtkplugin.h>
-#include <version.h>
-
-#include <conversation.h>
-#include <gtkconv.h>
-#include <gtkprefs.h>
-#include <gtkutils.h>
-
-#define	PREF_PREFIX	"/plugins/gtk/" PLUGIN_ID
-#define PREF_IGNORE	PREF_PREFIX "/ignore_incoming"
-#define PREF_CHATS	PREF_PREFIX "/chats"
-#define PREF_IMS	PREF_PREFIX "/ims"
-
-#define	PREF_SEND	PREF_PREFIX "/send"
-#define	PREF_SEND_C	PREF_SEND "/color"
-#define	PREF_SEND_F	PREF_SEND "/format"
-#define	PREF_SEND_E	PREF_SEND "/enabled"
-
-#define PREF_RECV	PREF_PREFIX "/recv"
-#define	PREF_RECV_C	PREF_RECV "/color"
-#define	PREF_RECV_F	PREF_RECV "/format"
-#define	PREF_RECV_E	PREF_RECV "/enabled"
-
-#define PREF_SYSTEM	PREF_PREFIX "/system"
-#define	PREF_SYSTEM_C	PREF_SYSTEM "/color"
-#define	PREF_SYSTEM_F	PREF_SYSTEM "/format"
-#define	PREF_SYSTEM_E	PREF_SYSTEM "/enabled"
-
-#define PREF_ERROR	PREF_PREFIX "/error"
-#define	PREF_ERROR_C	PREF_ERROR "/color"
-#define	PREF_ERROR_F	PREF_ERROR "/format"
-#define	PREF_ERROR_E	PREF_ERROR "/enabled"
-
-#define PREF_NICK	PREF_PREFIX "/nick"
-#define	PREF_NICK_C	PREF_NICK "/color"
-#define	PREF_NICK_F	PREF_NICK "/format"
-#define	PREF_NICK_E	PREF_NICK "/enabled"
-
-enum
-{
-	FONT_BOLD		= 1 << 0,
-	FONT_ITALIC		= 1 << 1,
-	FONT_UNDERLINE	= 1 << 2
-};
-
-static struct
-{
-	PurpleMessageFlags flag;
-	char *prefix;
-	const char *text;
-} formats[] =
-{
-	{PURPLE_MESSAGE_ERROR, PREF_ERROR, N_("Error Messages")},
-	{PURPLE_MESSAGE_NICK, PREF_NICK, N_("Highlighted Messages")},
-	{PURPLE_MESSAGE_SYSTEM, PREF_SYSTEM, N_("System Messages")},
-	{PURPLE_MESSAGE_SEND, PREF_SEND, N_("Sent Messages")},
-	{PURPLE_MESSAGE_RECV, PREF_RECV, N_("Received Messages")},
-	{0, NULL, NULL}
-};
-
-static gboolean
-displaying_msg(PurpleAccount *account, const char *who, char **displaying,
-				PurpleConversation *conv, PurpleMessageFlags flags)
-{
-	int i;
-	char tmp[128], *t;
-	gboolean bold, italic, underline;
-	int f;
-	const char *color;
-	gboolean rtl = FALSE;
-
-	for (i = 0; formats[i].prefix; i++)
-		if (flags & formats[i].flag)
-			break;
-
-	if (!formats[i].prefix)
-		return FALSE;
-
-	g_snprintf(tmp, sizeof(tmp), "%s/enabled", formats[i].prefix);
-
-	if (!purple_prefs_get_bool(tmp) ||
-			(PURPLE_IS_IM_CONVERSATION(conv) && !purple_prefs_get_bool(PREF_IMS)) ||
-			(PURPLE_IS_CHAT_CONVERSATION(conv) && !purple_prefs_get_bool(PREF_CHATS)))
-		return FALSE;
-
-	g_snprintf(tmp, sizeof(tmp), "%s/color", formats[i].prefix);
-	color = purple_prefs_get_string(tmp);
-
-	g_snprintf(tmp, sizeof(tmp), "%s/format", formats[i].prefix);
-	f = purple_prefs_get_int(tmp);
-	bold = (f & FONT_BOLD);
-	italic = (f & FONT_ITALIC);
-	underline = (f & FONT_UNDERLINE);
-	rtl = purple_markup_is_rtl(*displaying);
-
-	if (purple_prefs_get_bool(PREF_IGNORE))
-	{
-		/* This seems to be necessary, especially for received messages. */
-		t = *displaying;
-		*displaying = purple_strreplace(t, "\n", "<br>");
-		g_free(t);
-
-		t = *displaying;
-		*displaying = purple_markup_strip_html(t);
-		g_free(t);
-
-		t = *displaying;
-		*displaying = g_markup_escape_text(t, -1);
-		g_free(t);
-
-		/* Restore the links */
-		t = *displaying;
-		*displaying = purple_markup_linkify(t);
-		g_free(t);
-	}
-
-	if (color && *color)
-	{
-		t = *displaying;
-		*displaying = g_strdup_printf("<FONT COLOR=\"%s\">%s</FONT>", color, t);
-		g_free(t);
-	}
-
-	t = *displaying;
-	*displaying = g_strdup_printf("%s%s%s%s%s%s%s%s%s",
-						bold ? "<B>" : "</B>",
-						italic ? "<I>" : "</I>",
-						underline ? "<U>" : "</U>",
-						rtl ? "<SPAN style=\"direction:rtl;text-align:right;\">" : "",
-						t,
-						rtl ? "</SPAN>" : "",
-						bold ? "</B>" : "<B>",
-						italic ? "</I>" : "<I>",
-						underline ? "</U>" : "<U>"
-			);
-	g_free(t);
-
-	return FALSE;
-}
-
-static gboolean
-plugin_load(PurplePlugin *plugin)
-{
-	purple_signal_connect(pidgin_conversations_get_handle(),
-					"displaying-im-msg", plugin,
-					PURPLE_CALLBACK(displaying_msg), NULL);
-	purple_signal_connect(pidgin_conversations_get_handle(),
-					"displaying-chat-msg", plugin,
-					PURPLE_CALLBACK(displaying_msg), NULL);
-	return TRUE;
-}
-
-static gboolean
-plugin_unload(PurplePlugin *plugin)
-{
-	return TRUE;
-}
-
-/* Ripped from PurpleRC */
-static void
-color_response(GtkDialog *color_dialog, gint response, const char *data)
-{
-	if (response == GTK_RESPONSE_OK)
-	{
-		GtkWidget *colorsel =
-			gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog));
-		GdkColor color;
-		char colorstr[8];
-		char tmp[128];
-
-		gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color);
-
-		g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X",
-		           color.red/256, color.green/256, color.blue/256);
-
-		g_snprintf(tmp, sizeof(tmp), "%s/color", data);
-
-		purple_prefs_set_string(tmp, colorstr);
-	}
-
-	gtk_widget_destroy(GTK_WIDGET(color_dialog));
-}
-
-static void
-set_color(GtkWidget *widget, const char *data)
-{
-	GtkWidget *color_dialog = NULL;
-	GdkColor color;
-	char title[128];
-	char tmp[128];
-
-	g_snprintf(title, sizeof(title), _("Select Color for %s"), _(data));
-	color_dialog = gtk_color_selection_dialog_new(title);
-	g_signal_connect(G_OBJECT(color_dialog), "response",
-	                 G_CALLBACK(color_response), (gpointer)data);
-
-	g_snprintf(tmp, sizeof(tmp), "%s/color", data);
-	if (gdk_color_parse(purple_prefs_get_string(tmp), &color))
-	{
-		gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
-			gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))),
-			&color);
-	}
-
-	gtk_window_present(GTK_WINDOW(color_dialog));
-}
-
-static void
-toggle_enabled(GtkWidget *widget, gpointer data)
-{
-	const char *prefix = (char *)data;
-	gboolean e;
-	char tmp[128];
-
-	g_snprintf(tmp, sizeof(tmp), "%s/enabled", prefix);
-	e = purple_prefs_get_bool(tmp);
-	purple_prefs_set_bool(tmp, !e);
-}
-
-static void
-toggle_something(const char *prefix, int format)
-{
-	int f;
-	char tmp[128];
-
-	g_snprintf(tmp, sizeof(tmp), "%s/format", prefix);



More information about the Commits mailing list