/pidgin/main: 424f080c23e8: Remove GtkIMHtml
Tomasz Wasilczyk
twasilczyk at pidgin.im
Sat Feb 1 20:12:08 EST 2014
Changeset: 424f080c23e8b391c3566f50483356d9e4830f25
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2014-02-02 02:11 +0100
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/424f080c23e8
Description:
Remove GtkIMHtml
diffstat:
pidgin/Makefile.am | 4 -
pidgin/Makefile.mingw | 2 -
pidgin/gtkimhtml.c | 6092 ---------------------------------------------
pidgin/gtkimhtml.h | 831 ------
pidgin/gtkimhtmltoolbar.c | 1606 -----------
pidgin/gtkimhtmltoolbar.h | 97 -
6 files changed, 0 insertions(+), 8632 deletions(-)
diffs (truncated from 8679 to 300 lines):
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/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) {
- const char *header;
- const char *begin, *end;
- gint start = 0;
- gint finish = 0;
- gchar *html;
- gchar **split;
- int clipboard_length = 0;
-
-#if 0 /* Debugging for Windows clipboard */
- FILE *fd;
-
- purple_debug_info("imhtml clipboard", "from clipboard: %s\n", clipboard);
-
- fd = g_fopen("c:\\purplecb.txt", "wb");
- fprintf(fd, "%s", clipboard);
- fclose(fd);
-#endif
-
- clipboard_length = strlen(clipboard);
-
- if (!(header = strstr(clipboard, "StartFragment:")) || (header - clipboard) >= clipboard_length)
- return NULL;
- sscanf(header, "StartFragment:%d", &start);
-
- if (!(header = strstr(clipboard, "EndFragment:")) || (header - clipboard) >= clipboard_length)
- return NULL;
- sscanf(header, "EndFragment:%d", &finish);
-
- if (finish > clipboard_length)
- finish = clipboard_length;
-
More information about the Commits
mailing list