/pidgin/main: c651682dada0: Clean merge.

Mark Doliner mark at kingant.net
Sat Feb 1 20:41:11 EST 2014


Changeset: c651682dada06f963a0c480c0a10797c16f34c73
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2014-02-01 17:41 -0800
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/c651682dada0

Description:

Clean merge.

diffstat:

 libpurple/http.c          |     3 +-
 pidgin/Makefile.am        |     4 -
 pidgin/Makefile.mingw     |     2 -
 pidgin/gtkconv.c          |     2 +-
 pidgin/gtkimhtml.c        |  6092 ---------------------------------------------
 pidgin/gtkimhtml.h        |   831 ------
 pidgin/gtkimhtmltoolbar.c |  1606 -----------
 pidgin/gtkimhtmltoolbar.h |    97 -
 pidgin/gtksmiley.c        |    62 +-
 pidgin/gtksmiley.h        |    10 +-
 pidgin/gtkwebview.c       |     4 +-
 pidgin/smileyparser.c     |     4 +-
 12 files changed, 53 insertions(+), 8664 deletions(-)

diffs (truncated from 8942 to 300 lines):

diff --git a/libpurple/http.c b/libpurple/http.c
--- a/libpurple/http.c
+++ b/libpurple/http.c
@@ -305,13 +305,14 @@ static time_t purple_http_rfc1123_to_tim
 		g_match_info_free(match_info);
 		return 0;
 	}
-	g_match_info_free(match_info);
 
 	d_date = g_match_info_fetch(match_info, 1);
 	d_month = g_match_info_fetch(match_info, 2);
 	d_year = g_match_info_fetch(match_info, 3);
 	d_time = g_match_info_fetch(match_info, 4);
 
+	g_match_info_free(match_info);
+
 	month = 0;
 	while (months[month] != NULL)
 	{
diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -60,8 +60,6 @@ pidgin_SOURCES = \
 	gtkicon-theme.c \
 	gtkicon-theme-loader.c \
 	gtkidle.c \
-	gtkimhtml.c \
-	gtkimhtmltoolbar.c \
 	gtklog.c \
 	gtkmain.c \
 	gtkmedia.c \
@@ -114,8 +112,6 @@ pidgin_headers = \
 	gtkicon-theme.h \
 	gtkicon-theme-loader.h \
 	gtkidle.h \
-	gtkimhtml.h \
-	gtkimhtmltoolbar.h \
 	gtklog.h \
 	gtkmedia.h \
 	gtkmenutray.h \
diff --git a/pidgin/Makefile.mingw b/pidgin/Makefile.mingw
--- a/pidgin/Makefile.mingw
+++ b/pidgin/Makefile.mingw
@@ -76,8 +76,6 @@ PIDGIN_C_SRC =	\
 			gtkicon-theme-loader.c \
 			gtkicon-theme.c \
 			gtkidle.c \
-			gtkimhtml.c \
-			gtkimhtmltoolbar.c \
 			gtklog.c \
 			gtkmain.c \
 			gtkmedia.c \
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -2445,7 +2445,7 @@ pidgin_conv_switch_active_conversation(P
 	{
 		/* This is done in default_formatize, which is called from clear_formatting_cb,
 		 * which is (obviously) a clear_formatting signal handler.  However, if we're
-		 * here, we didn't call gtk_imhtml_clear_formatting() (because we want to
+		 * here, we didn't call gtk_webview_clear_formatting() (because we want to
 		 * preserve the formatting exactly as it is), so we have to do this now. */
 		gtk_webview_set_whole_buffer_formatting_only(entry,
 			(features & PURPLE_CONNECTION_FLAG_FORMATTING_WBFO));
diff --git a/pidgin/gtkimhtml.c b/pidgin/gtkimhtml.c
deleted file mode 100644
--- a/pidgin/gtkimhtml.c
+++ /dev/null
@@ -1,6092 +0,0 @@
-/*
- * @file gtkimhtml.c GTK+ IMHtml
- * @ingroup pidgin
- */
-
-/* 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
- * 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
- *
- */
-#define _PIDGIN_GTKIMHTML_C_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "internal.h"
-#include "pidgin.h"
-#include "pidginstock.h"
-#include "gtkutils.h"
-#include "smiley.h"
-#include "imgstore.h"
-
-#include "debug.h"
-#include "util.h"
-#include "gtkimhtml.h"
-#include "gtksmiley.h"
-#include "gtksourceiter.h"
-#include "gtksourceundomanager.h"
-#include "gtksourceview-marshal.h"
-#include <gtk/gtk.h>
-#include <glib.h>
-#include <gdk/gdkkeysyms.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#ifdef HAVE_LANGINFO_CODESET
-#include <langinfo.h>
-#include <locale.h>
-#endif
-#ifdef _WIN32
-#include <gdk/gdkwin32.h>
-#include <windows.h>
-#endif
-
-#include <pango/pango-font.h>
-
-#define TOOLTIP_TIMEOUT 500
-
-#include "gtk3compat.h"
-
-static GtkTextViewClass *parent_class = NULL;
-
-struct scalable_data {
-	GtkIMHtmlScalable *scalable;
-	GtkTextMark *mark;
-};
-
-typedef struct {
-	GtkIMHtmlScalable *image;
-	gpointer data;
-	gsize datasize;
-} GtkIMHtmlImageSave;
-
-struct im_image_data {
-	int id;
-	GtkTextMark *mark;
-};
-
-struct _GtkIMHtmlScalable {
-	void (*scale)(struct _GtkIMHtmlScalable *, int, int);
-	void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *);
-	void (*free)(struct _GtkIMHtmlScalable *);
-};
-
-struct _GtkIMHtmlHr {
-	GtkIMHtmlScalable scalable;
-	GtkWidget *sep;
-};
-
-struct _GtkIMHtmlImage {
-	GtkIMHtmlScalable scalable;
-	GtkImage *image; /**< Contains the scaled version of this pixbuf. */
-	GdkPixbuf *pixbuf; /**< The original pixbuf, before any scaling. */
-	GtkTextMark *mark;
-	gchar *filename;
-	int width;
-	int height;
-	int id;
-	GtkWidget *filesel;
-};
-
-struct _GtkIMHtmlAnimation {
-	GtkIMHtmlImage imhtmlimage;
-	GdkPixbufAnimation *anim; /**< The original animation, before any scaling. */
-	GdkPixbufAnimationIter *iter;
-	guint timer;
-};
-
-struct _GtkIMHtmlLink
-{
-	GtkIMHtml *imhtml;
-	gchar *url;
-	GtkTextTag *tag;
-};
-
-struct _GtkSmileyTree {
-	GString *values;
-	GtkSmileyTree **children;
-	GtkIMHtmlSmiley *image;
-};
-
-typedef struct {
-	char *name;
-	int length;
-
-	gboolean (*activate)(GtkIMHtml *imhtml, GtkIMHtmlLink *link);
-	gboolean (*context_menu)(GtkIMHtml *imhtml, GtkIMHtmlLink *link, GtkWidget *menu);
-} GtkIMHtmlProtocol;
-
-/* The five elements contained in a FONT tag */
-typedef struct {
-	gushort size;
-	gchar *face;
-	gchar *fore;
-	gchar *back;
-	gchar *bg;
-	gchar *sml;
-	gboolean underline;
-	gboolean strike;
-	gshort bold;
-} GtkIMHtmlFontDetail;
-
-static gboolean
-gtk_text_view_drag_motion (GtkWidget        *widget,
-                           GdkDragContext   *context,
-                           gint              x,
-                           gint              y,
-                           guint             time);
-
-static void preinsert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml);
-static void insert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml);
-static void delete_cb(GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextIter *end, GtkIMHtml *imhtml);
-static void insert_ca_cb(GtkTextBuffer *buffer, GtkTextIter *arg1, GtkTextChildAnchor *arg2, gpointer user_data);
-static void gtk_imhtml_apply_tags_on_insert(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *end);
-void gtk_imhtml_close_tags(GtkIMHtml *imhtml, GtkTextIter *iter);
-static void gtk_imhtml_link_drop_cb(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer user_data);
-static void gtk_imhtml_link_drag_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, guint info, guint t, GtkIMHtml *imhtml);
-static void mark_set_cb(GtkTextBuffer *buffer, GtkTextIter *arg1, GtkTextMark *mark, GtkIMHtml *imhtml);
-static void hijack_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data);
-static void paste_received_cb (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data);
-static void paste_plaintext_received_cb (GtkClipboard *clipboard, const gchar *text, gpointer data);
-static void imhtml_paste_insert(GtkIMHtml *imhtml, const char *text, gboolean plaintext);
-static void imhtml_toggle_bold(GtkIMHtml *imhtml);
-static void imhtml_toggle_italic(GtkIMHtml *imhtml);
-static void imhtml_toggle_strike(GtkIMHtml *imhtml);
-static void imhtml_toggle_underline(GtkIMHtml *imhtml);
-static void imhtml_font_grow(GtkIMHtml *imhtml);
-static void imhtml_font_shrink(GtkIMHtml *imhtml);
-static void imhtml_clear_formatting(GtkIMHtml *imhtml);
-static int gtk_imhtml_is_protocol(const char *text);
-static void gtk_imhtml_activate_tag(GtkIMHtml *imhtml, GtkTextTag *tag);
-static void gtk_imhtml_link_destroy(GtkIMHtmlLink *link);
-
-/* POINT_SIZE converts from AIM font sizes to a point size scale factor. */
-#define MAX_FONT_SIZE 7
-#define POINT_SIZE(x) (_point_sizes [MIN ((x > 0 ? x : 1), MAX_FONT_SIZE) - 1])
-static const gdouble _point_sizes [] = { .85, .95, 1, 1.2, 1.44, 1.728, 2.0736};
-
-enum {
-	TARGET_HTML,
-	TARGET_UTF8_STRING,
-	TARGET_COMPOUND_TEXT,
-	TARGET_STRING,
-	TARGET_TEXT
-};
-
-enum {
-	URL_CLICKED,
-	BUTTONS_UPDATE,
-	TOGGLE_FORMAT,
-	CLEAR_FORMAT,
-	UPDATE_FORMAT,
-	MESSAGE_SEND,
-	UNDO,
-	REDO,
-	PASTE,
-	LAST_SIGNAL
-};
-static guint signals [LAST_SIGNAL] = { 0 };
-
-static char *html_clipboard = NULL;
-static char *text_clipboard = NULL;
-static GtkClipboard *clipboard_selection = NULL;
-
-static const GtkTargetEntry selection_targets[] = {
-#ifndef _WIN32
-	{ "text/html", 0, TARGET_HTML },
-#else
-	{ "HTML Format", 0, TARGET_HTML },
-#endif
-	{ "UTF8_STRING", 0, TARGET_UTF8_STRING },
-	{ "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT },
-	{ "STRING", 0, TARGET_STRING },
-	{ "TEXT", 0, TARGET_TEXT}};
-
-static const GtkTargetEntry link_drag_drop_targets[] = {
-	GTK_IMHTML_DND_TARGETS
-};
-
-#ifdef _WIN32
-static gchar *
-clipboard_win32_to_html(char *clipboard) {



More information about the Commits mailing list