/pidgin/main: 106beb1d59d8: Remove gtksourceiter.
Mark Doliner
mark at kingant.net
Sun Feb 9 11:15:13 EST 2014
Changeset: 106beb1d59d8d783382c9bf02ecd48d27c684c43
Author: Mark Doliner <mark at kingant.net>
Date: 2014-02-09 08:15 -0800
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/106beb1d59d8
Description:
Remove gtksourceiter.
Was only used by gtkimhtml, which is no more.
4 files changed, 830 deletions(-)
diffstat:
pidgin/Makefile.am | 2 -
pidgin/Makefile.mingw | 1 -
pidgin/gtksourceiter.c | 766 -------------------------------------------------
pidgin/gtksourceiter.h | 61 ---
4 files changed, 0 insertions(+), 830 deletions(-)
diffs (truncated from 867 to 300 lines):
diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -77,7 +77,6 @@ pidgin_SOURCES = \
gtksession.c \
gtksmiley.c \
gtksound.c \
- gtksourceiter.c \
gtksourceundomanager.c \
gtksourceview-marshal.c \
gtkstatus-icon-theme.c \
@@ -129,7 +128,6 @@ pidgin_headers = \
gtksession.h \
gtksmiley.h \
gtksound.h \
- gtksourceiter.h \
gtksourceundomanager.h \
gtksourceview-marshal.h \
gtkstatus-icon-theme.h \
diff --git a/pidgin/Makefile.mingw b/pidgin/Makefile.mingw
--- a/pidgin/Makefile.mingw
+++ b/pidgin/Makefile.mingw
@@ -92,7 +92,6 @@ PIDGIN_C_SRC = \
gtkscrollbook.c \
gtksmiley.c \
gtksound.c \
- gtksourceiter.c \
gtksourceundomanager.c \
gtkstatus-icon-theme.c \
gtkstatusbox.c \
diff --git a/pidgin/gtksourceiter.c b/pidgin/gtksourceiter.c
deleted file mode 100644
--- a/pidgin/gtksourceiter.c
+++ /dev/null
@@ -1,766 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * gtksourceiter.c
- *
- * 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.
- *
- * The following copyright notice applies to this file:
- *
- * Copyright (C) 2000 - 2005 Paolo Maggi
- * Copyright (C) 2002, 2003 Jeroen Zwartepoorte
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/*
- * Parts of this file are copied from the gedit and glimmer project.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "gtksourceiter.h"
-
-#define GTK_TEXT_UNKNOWN_CHAR 0xFFFC
-
-/* this function acts like g_utf8_offset_to_pointer() except that if it finds a
- * decomposable character it consumes the decomposition length from the given
- * offset. So it's useful when the offset was calculated for the normalized
- * version of str, but we need a pointer to str itself. */
-static const gchar *
-pointer_from_offset_skipping_decomp (const gchar *str, gint offset)
-{
- gchar *casefold, *normal;
- const gchar *p, *q;
-
- p = str;
- while (offset > 0)
- {
- q = g_utf8_next_char (p);
- casefold = g_utf8_casefold (p, q - p);
- normal = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD);
- offset -= g_utf8_strlen (normal, -1);
- g_free (casefold);
- g_free (normal);
- p = q;
- }
- return p;
-}
-
-static const gchar *
-g_utf8_strcasestr (const gchar *haystack, const gchar *needle)
-{
- gsize needle_len;
- gsize haystack_len;
- const gchar *ret = NULL;
- gchar *p;
- gchar *casefold;
- gchar *caseless_haystack;
- gint i;
-
- g_return_val_if_fail (haystack != NULL, NULL);
- g_return_val_if_fail (needle != NULL, NULL);
-
- casefold = g_utf8_casefold (haystack, -1);
- caseless_haystack = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD);
- g_free (casefold);
-
- needle_len = g_utf8_strlen (needle, -1);
- haystack_len = g_utf8_strlen (caseless_haystack, -1);
-
- if (needle_len == 0)
- {
- ret = (gchar *)haystack;
- goto finally_1;
- }
-
- if (haystack_len < needle_len)
- {
- ret = NULL;
- goto finally_1;
- }
-
- p = (gchar*)caseless_haystack;
- needle_len = strlen (needle);
- i = 0;
-
- while (*p)
- {
- if ((strncmp (p, needle, needle_len) == 0))
- {
- ret = pointer_from_offset_skipping_decomp (haystack, i);
- goto finally_1;
- }
-
- p = g_utf8_next_char (p);
- i++;
- }
-
-finally_1:
- g_free (caseless_haystack);
-
- return ret;
-}
-
-static const gchar *
-g_utf8_strrcasestr (const gchar *haystack, const gchar *needle)
-{
- gsize needle_len;
- gsize haystack_len;
- const gchar *ret = NULL;
- gchar *p;
- gchar *casefold;
- gchar *caseless_haystack;
- gint i;
-
- g_return_val_if_fail (haystack != NULL, NULL);
- g_return_val_if_fail (needle != NULL, NULL);
-
- casefold = g_utf8_casefold (haystack, -1);
- caseless_haystack = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD);
- g_free (casefold);
-
- needle_len = g_utf8_strlen (needle, -1);
- haystack_len = g_utf8_strlen (caseless_haystack, -1);
-
- if (needle_len == 0)
- {
- ret = (gchar *)haystack;
- goto finally_1;
- }
-
- if (haystack_len < needle_len)
- {
- ret = NULL;
- goto finally_1;
- }
-
- i = haystack_len - needle_len;
- p = g_utf8_offset_to_pointer (caseless_haystack, i);
- needle_len = strlen (needle);
-
- while (1)
- {
- if (strncmp (p, needle, needle_len) == 0)
- {
- ret = pointer_from_offset_skipping_decomp (haystack, i);
- goto finally_1;
- }
-
- if (p > caseless_haystack)
- p = g_utf8_prev_char (p);
- else
- goto finally_1;
-
- i--;
- }
-
-finally_1:
- g_free (caseless_haystack);
-
- return ret;
-}
-
-static gboolean
-g_utf8_caselessnmatch (const char *s1, const char *s2,
- gssize n1, gssize n2)
-{
- gchar *casefold;
- gchar *normalized_s1;
- gchar *normalized_s2;
- gint len_s1;
- gint len_s2;
- gboolean ret = FALSE;
-
- g_return_val_if_fail (s1 != NULL, FALSE);
- g_return_val_if_fail (s2 != NULL, FALSE);
- g_return_val_if_fail (n1 > 0, FALSE);
- g_return_val_if_fail (n2 > 0, FALSE);
-
- casefold = g_utf8_casefold (s1, n1);
- normalized_s1 = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD);
- g_free (casefold);
-
- casefold = g_utf8_casefold (s2, n2);
- normalized_s2 = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD);
- g_free (casefold);
-
- len_s1 = strlen (normalized_s1);
- len_s2 = strlen (normalized_s2);
-
- if (len_s1 < len_s2)
- goto finally_2;
-
- ret = (strncmp (normalized_s1, normalized_s2, len_s2) == 0);
-
-finally_2:
- g_free (normalized_s1);
- g_free (normalized_s2);
-
- return ret;
-}
-
-static void
-forward_chars_with_skipping (GtkTextIter *iter,
- gint count,
- gboolean skip_invisible,
- gboolean skip_nontext,
- gboolean skip_decomp)
-{
- gint i;
-
- g_return_if_fail (count >= 0);
-
- i = count;
-
- while (i > 0)
- {
- gboolean ignored = FALSE;
-
- /* minimal workaround to avoid the infinite loop of bug #168247.
- * It doesn't fix the problemjust the symptom...
- */
- if (gtk_text_iter_is_end (iter))
- return;
-
- if (skip_nontext && gtk_text_iter_get_char (iter) == GTK_TEXT_UNKNOWN_CHAR)
- ignored = TRUE;
-
-#if 0
- if (!ignored && skip_invisible &&
- /* _gtk_text_btree_char_is_invisible (iter)*/ FALSE)
- ignored = TRUE;
-#endif
-
- if (!ignored && skip_decomp)
- {
- /* being UTF8 correct sucks; this accounts for extra
- offsets coming from canonical decompositions of
- UTF8 characters (e.g. accented characters) which
- g_utf8_normalize() performs */
- gchar *normal;
- gchar buffer[6];
- gint buffer_len;
-
- buffer_len = g_unichar_to_utf8 (gtk_text_iter_get_char (iter), buffer);
- normal = g_utf8_normalize (buffer, buffer_len, G_NORMALIZE_NFD);
- i -= (g_utf8_strlen (normal, -1) - 1);
- g_free (normal);
- }
-
More information about the Commits
mailing list