aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-04-09 03:48:41 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-04-09 03:48:41 +0800
commit122470e9bebdeb3de701fd5f537741a0075a2230 (patch)
tree1d34fbdb676f870271d1b6ace5d0fb37752586f1 /widgets/misc
parentf146a1feb59ccb1a35ff748051b3c0127da72f61 (diff)
downloadgsoc2013-evolution-122470e9bebdeb3de701fd5f537741a0075a2230.tar
gsoc2013-evolution-122470e9bebdeb3de701fd5f537741a0075a2230.tar.gz
gsoc2013-evolution-122470e9bebdeb3de701fd5f537741a0075a2230.tar.bz2
gsoc2013-evolution-122470e9bebdeb3de701fd5f537741a0075a2230.tar.lz
gsoc2013-evolution-122470e9bebdeb3de701fd5f537741a0075a2230.tar.xz
gsoc2013-evolution-122470e9bebdeb3de701fd5f537741a0075a2230.tar.zst
gsoc2013-evolution-122470e9bebdeb3de701fd5f537741a0075a2230.zip
remove e-font.[ch], test-e-font, and test-font-loading. kill
2003-04-08 Mike Kestner <mkestner@ximian.com> * gal/widgets/Makefile.am : remove e-font.[ch], test-e-font, and test-font-loading. * gal/widgets/e-unicode.[ch] (e_utf8_from_gtk_string): kill (e_utf8_from_gtk_string_sized): kill (e_utf8_to_gtk_string): kill (e_utf8_to_gtk_string_sized): kill (e_utf8_gtk_menu_item_new_with_label): kill (e_utf8_gtk_clist_set_text): kill (e_utf8_gtk_clist_append): kill * e-categories-master-list-option-menu.c (ecmlom_ecml_changed): don't use e_utf8_to_gtk_string. * e-categories-master-list-combo (ecmlc_ecml_changed): don't use e_utf8_to_gtk_string. 2003-04-08 Mike Kestner <mkestner@ximian.com> * e-cell-text.c : break e-font dependency svn path=/trunk/; revision=20766
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/e-unicode.c217
-rw-r--r--widgets/misc/e-unicode.h18
2 files changed, 0 insertions, 235 deletions
diff --git a/widgets/misc/e-unicode.c b/widgets/misc/e-unicode.c
index fb81db1798..d7bd33caa7 100644
--- a/widgets/misc/e-unicode.c
+++ b/widgets/misc/e-unicode.c
@@ -38,7 +38,6 @@
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkmenuitem.h>
-#include "e-font.h"
#include <libxml/xmlmemory.h>
#include <stdlib.h>
#include "gal/util/e-iconv.h"
@@ -406,173 +405,6 @@ e_utf8_to_charset_string (const gchar *charset, const gchar *string)
}
gchar *
-e_utf8_from_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *new, *ob;
- const char *ib;
- size_t ibl, obl;
-
- g_return_val_if_fail (widget != NULL, NULL);
- g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
- if (!string) return NULL;
-
- g_return_val_if_fail (widget, NULL);
-
- ic = e_iconv_from_gdk_font (gtk_style_get_font (widget->style));
- if (ic == (iconv_t) -1) {
- XFontStruct *xfs;
- /* If iconv is missing we assume either iso-10646 or iso-8859-1 */
- xfs = GDK_FONT_XFONT (gtk_style_get_font (widget->style));
- if (gtk_style_get_font (widget->style)->type == GDK_FONT_FONTSET || ((xfs->min_byte1 != 0) || (xfs->max_byte1 != 0))) {
- gint i;
- const guchar *ib;
- guchar * ob, * new;
- /* iso-10646 */
- ib = string;
- new = ob = g_new (unsigned char, bytes * 6 + 1);
- for (i = 0; i < (bytes - 1); i += 2) {
- ob += e_unichar_to_utf8 (ib[i] * 256 + ib[i + 1], ob);
- }
- *ob = '\0';
- return new;
- } else {
- gint i;
- /* iso-8859-1 */
- ib = (char *) string;
- new = ob = g_new (unsigned char, bytes * 2 + 1);
- for (i = 0; i < (bytes); i ++) {
- ob += e_unichar_to_utf8 (ib[i], ob);
- }
- *ob = '\0';
- return new;
- }
- }
-
- ib = string;
- ibl = bytes;
- new = ob = g_new (gchar, ibl * 6 + 1);
- obl = ibl * 6;
-
- while (ibl > 0) {
- e_iconv (ic, &ib, &ibl, &ob, &obl);
- if (ibl > 0) {
- gint len;
- if ((*ib & 0x80) == 0x00) len = 1;
- else if ((*ib &0xe0) == 0xc0) len = 2;
- else if ((*ib &0xf0) == 0xe0) len = 3;
- else if ((*ib &0xf8) == 0xf0) len = 4;
- else {
- g_warning ("Invalid UTF-8 sequence");
- break;
- }
- ib += len;
- ibl = bytes - (ib - string);
- if (ibl > bytes) ibl = 0;
- *ob++ = '_';
- obl--;
- }
- }
-
- *ob = '\0';
-
- e_iconv_close(ic);
-
- return new;
-}
-
-gchar *
-e_utf8_from_gtk_string (GtkWidget *widget, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_from_gtk_string_sized (widget, string, strlen (string));
-}
-
-gchar *
-e_utf8_to_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *new, *ob;
- const char *ib;
- size_t ibl, obl;
-
- if (!string) return NULL;
-
- g_return_val_if_fail (widget, NULL);
-
- gtk_widget_ensure_style (widget);
- ic = e_iconv_to_gdk_font (gtk_style_get_font (widget->style));
- if (ic == (iconv_t) -1) {
- XFontStruct *xfs;
- gboolean twobyte;
- gint len;
- const gchar *u;
- gunichar uc;
- /* If iconv is missing we assume either iso-10646 or iso-8859-1 */
- xfs = GDK_FONT_XFONT (gtk_style_get_font (widget->style));
- twobyte = (gtk_style_get_font (widget->style)->type == GDK_FONT_FONTSET || ((xfs->min_byte1 != 0) || (xfs->max_byte1 != 0)));
-
- new = g_new (unsigned char, bytes * 4 + 2);
- u = string;
- len = 0;
-
- while ((u) && (u - string < bytes)) {
- u = e_unicode_get_utf8 (u, &uc);
- if (twobyte) {
- new[len++] = (uc & 0xff00) >> 8;
- }
- new[len++] = uc & 0xff;
- }
-
- new[len++] = '\0';
- if (twobyte)
- new[len] = '\0';
-
- return new;
- }
-
- ib = string;
- ibl = bytes;
- new = ob = g_new (gchar, ibl * 4 + 4);
- obl = ibl * 4;
-
- while (ibl > 0) {
- e_iconv (ic, &ib, &ibl, &ob, &obl);
- if (ibl > 0) {
- gint len;
- if ((*ib & 0x80) == 0x00) len = 1;
- else if ((*ib &0xe0) == 0xc0) len = 2;
- else if ((*ib &0xf0) == 0xe0) len = 3;
- else if ((*ib &0xf8) == 0xf0) len = 4;
- else {
- g_warning ("Invalid UTF-8 sequence");
- break;
- }
- ib += len;
- ibl = bytes - (ib - string);
- if (ibl > bytes) ibl = 0;
- *ob++ = '_';
- obl--;
- }
- }
-
- /* Make sure to terminate with plenty of padding */
- memset (ob, 0, 4);
-
- e_iconv_close(ic);
-
- return new;
-}
-
-gchar *
-e_utf8_to_gtk_string (GtkWidget *widget, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_to_gtk_string_sized (widget, string, strlen (string));
-}
-
-gchar *
e_utf8_from_locale_string_sized (const gchar *string, gint bytes)
{
iconv_t ic;
@@ -673,55 +505,6 @@ e_utf8_gtk_entry_set_text (GtkEntry *entry, const gchar *text)
gtk_entry_set_text (entry, text);
}
-GtkWidget *
-e_utf8_gtk_menu_item_new_with_label (GtkMenu *menu, const gchar *label)
-{
- GtkWidget *w;
- gchar *s;
-
- if (!label) return NULL;
-
- s = e_utf8_to_gtk_string ((GtkWidget *) menu, label);
- w = gtk_menu_item_new_with_label (s);
-
- g_free (s);
-
- return w;
-}
-
-void
-e_utf8_gtk_clist_set_text (GtkCList *clist, gint row, gint col, const gchar *text)
-{
- gchar *s;
-
- if (!text) return;
-
- s = e_utf8_to_gtk_string ((GtkWidget *) clist, text);
- gtk_clist_set_text (clist, row, col, s);
-
- if (s) g_free (s);
-}
-
-gint
-e_utf8_gtk_clist_append (GtkCList *clist, gchar *text[])
-{
- gint row, i;
- gchar **v;
-
- if (!text) return 0;
-
- v = g_new (gchar *, clist->columns);
- for (i = 0; i < clist->columns; i++)
- v[i] = e_utf8_to_gtk_string ((GtkWidget *) clist, text[i]);
-
- row = gtk_clist_append (clist, v);
-
- for (i = 0; i < clist->columns; i++)
- if (v[i]) g_free (v[i]);
-
- return row;
-}
-
/*
* Translate \U+XXXX\ sequences to utf8 chars
*/
diff --git a/widgets/misc/e-unicode.h b/widgets/misc/e-unicode.h
index 0a3b3ccafe..12c9ef3aa2 100644
--- a/widgets/misc/e-unicode.h
+++ b/widgets/misc/e-unicode.h
@@ -73,16 +73,6 @@ gchar *e_utf8_to_charset_string (const gchar *char
gchar *e_utf8_to_charset_string_sized (const gchar *charset,
const gchar *string,
gint bytes);
-gchar *e_utf8_from_gtk_string (GtkWidget *widget,
- const gchar *string);
-gchar *e_utf8_from_gtk_string_sized (GtkWidget *widget,
- const gchar *string,
- gint bytes);
-gchar *e_utf8_to_gtk_string (GtkWidget *widget,
- const gchar *string);
-gchar *e_utf8_to_gtk_string_sized (GtkWidget *widget,
- const gchar *string,
- gint bytes);
gchar *e_utf8_from_locale_string (const gchar *string);
gchar *e_utf8_from_locale_string_sized (const gchar *string,
gint bytes);
@@ -108,14 +98,6 @@ void e_utf8_gtk_editable_insert_text (GtkEditable *edit
const gchar *text,
gint length,
gint *position);
-GtkWidget *e_utf8_gtk_menu_item_new_with_label (GtkMenu *menu,
- const gchar *label);
-void e_utf8_gtk_clist_set_text (GtkCList *clist,
- gint row,
- gint col,
- const gchar *text);
-gint e_utf8_gtk_clist_append (GtkCList *clist,
- gchar *text[]);
gchar *e_utf8_xml1_decode (const gchar *text);
gchar *e_utf8_xml1_encode (const gchar *text);
gint e_unichar_to_utf8 (gint c,