aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-04-24 04:02:27 +0800
committerDan Winship <danw@src.gnome.org>2001-04-24 04:02:27 +0800
commit70353ea6c6e991f8dc2696ccef1cc351e85a675e (patch)
tree88cb2b8834f4bdca89c7c82518f78122d0c0bbb2
parent4c11daf49e24e7b4c25a392aabee449c880dc149 (diff)
downloadgsoc2013-evolution-70353ea6c6e991f8dc2696ccef1cc351e85a675e.tar.gz
gsoc2013-evolution-70353ea6c6e991f8dc2696ccef1cc351e85a675e.tar.zst
gsoc2013-evolution-70353ea6c6e991f8dc2696ccef1cc351e85a675e.zip
Remove UNICODE_CFLAGS (e_text_test_LDADD, e_entry_test_LDADD,
* gal/e-text/Makefile.am (INCLUDES): Remove UNICODE_CFLAGS (e_text_test_LDADD, e_entry_test_LDADD, e_text_model_test_LDADD, e_completion_test_LDADD): remove -lunicode, add libunicode.la * gal/e-text/e-text.c: Remove <unicode.h>, use gunicode functions. svn path=/trunk/; revision=9516
-rw-r--r--widgets/text/e-text.c85
1 files changed, 42 insertions, 43 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index e9b6e3272f..55053b979f 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -23,7 +23,6 @@
#include <math.h>
#include <ctype.h>
-#include <unicode.h>
#include <string.h>
#include <gdk/gdkx.h> /* for BlackPixel */
#include <gtk/gtkinvisible.h>
@@ -820,7 +819,7 @@ calc_line_widths (EText *text)
clip_width >= 0) {
if (text->font) {
lines->ellipsis_length = 0;
- for (p = lines->text; p && *p && (p - lines->text) < lines->length; p = unicode_next_utf8 (p)) {
+ for (p = lines->text; p && *p && (p - lines->text) < lines->length; p = g_utf8_next_char (p)) {
gint text_width = text_width_with_objects (text->model,
text->font, text->style,
lines->text, p - lines->text);
@@ -912,7 +911,7 @@ text_draw_with_objects (ETextModel *model,
}
}
-#define IS_BREAKCHAR(text,c) ((text)->break_characters && unicode_strchr ((text)->break_characters, (c)))
+#define IS_BREAKCHAR(text,c) ((text)->break_characters && g_utf8_strchr ((text)->break_characters, (c)))
/* Splits the text of the text item into lines */
static void
split_into_lines (EText *text)
@@ -925,7 +924,7 @@ split_into_lines (EText *text)
const char *lastend;
const char *linestart;
double clip_width;
- unicode_char_t unival;
+ gunichar unival;
/* Free old array of lines */
e_text_free_lines(text);
@@ -948,9 +947,9 @@ split_into_lines (EText *text)
cp = text->text;
- for (p = unicode_get_utf8 (cp, &unival); (unival && p); cp = p, p = unicode_get_utf8 (p, &unival)) {
+ for (p = e_unicode_get_utf8 (cp, &unival); (unival && p); cp = p, p = e_unicode_get_utf8 (p, &unival)) {
if (text->line_wrap
- && (unicode_isspace (unival) || unival == '\n')
+ && (g_unichar_isspace (unival) || unival == '\n')
&& e_text_model_get_object_at_pointer (text->model, cp) == -1) { /* don't break mid-object */
if (laststart != lastend
&& clip_width < text_width_with_objects (text->model,
@@ -961,7 +960,7 @@ split_into_lines (EText *text)
linestart = laststart;
laststart = p;
lastend = cp;
- } else if (unicode_isspace (unival)) {
+ } else if (g_unichar_isspace (unival)) {
laststart = p;
lastend = cp;
}
@@ -969,7 +968,7 @@ split_into_lines (EText *text)
&& IS_BREAKCHAR (text, unival)) {
if (laststart != lastend
- && unicode_index_to_offset (linestart, cp - linestart) != 1
+ && g_utf8_pointer_to_offset (linestart, cp) != 1
&& clip_width < text_width_with_objects (text->model,
text->font, text->style,
linestart, p - linestart)) {
@@ -1018,13 +1017,13 @@ split_into_lines (EText *text)
cp = text->text;
- for (p = unicode_get_utf8 (cp, &unival); p && unival && line_num < text->num_lines; cp = p, p = unicode_get_utf8 (p, &unival)) {
+ for (p = e_unicode_get_utf8 (cp, &unival); p && unival && line_num < text->num_lines; cp = p, p = e_unicode_get_utf8 (p, &unival)) {
gboolean handled = FALSE;
if (len == 0)
lines->text = cp;
if (text->line_wrap
- && (unicode_isspace (unival) || unival == '\n')
+ && (g_unichar_isspace (unival) || unival == '\n')
&& e_text_model_get_object_at_pointer (text->model, cp) == -1) { /* don't break mid-object */
if (clip_width < text_width_with_objects (text->model,
text->font, text->style,
@@ -1039,7 +1038,7 @@ split_into_lines (EText *text)
lines->text = laststart;
laststart = p;
lastend = cp;
- } else if (unicode_isspace (unival)) {
+ } else if (g_unichar_isspace (unival)) {
laststart = p;
lastend = cp;
len ++;
@@ -1049,7 +1048,7 @@ split_into_lines (EText *text)
&& IS_BREAKCHAR(text, unival)
&& e_text_model_get_object_at_pointer (text->model, cp) == -1) {
if (laststart != lastend
- && unicode_index_to_offset (lines->text, cp - lines->text) != 1
+ && g_utf8_pointer_to_offset (lines->text, cp) != 1
&& clip_width < text_width_with_objects (text->model,
text->font, text->style,
lines->text, p - lines->text)) {
@@ -2519,7 +2518,7 @@ _get_position_from_xy (EText *text, gint x, gint y)
int xpos;
double xd, yd;
const char *p;
- unicode_char_t unival;
+ gunichar unival;
gint font_ht, adjust=0;
struct line *lines;
@@ -2570,7 +2569,7 @@ _get_position_from_xy (EText *text, gint x, gint y)
x += text->xofs_edit;
xpos = get_line_xpos_item_relative (text, lines);
- for (i = 0, p = lines->text; p && i < lines->length; i++, p = unicode_get_utf8 (p, &unival)) {
+ for (i = 0, p = lines->text; p && i < lines->length; i++, p = e_unicode_get_utf8 (p, &unival)) {
int charwidth;
int step1, step2;
@@ -3179,7 +3178,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
{
int length, obj_num;
int x, y;
- unicode_char_t unival;
+ gunichar unival;
char *p = NULL;
gint new_pos = 0;
@@ -3198,7 +3197,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
break;
case E_TEP_END_OF_BUFFER:
- new_pos = unicode_strlen (text->text, -1);
+ new_pos = g_utf8_strlen (text->text, -1);
break;
case E_TEP_START_OF_LINE:
@@ -3207,14 +3206,14 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
if (text->selection_end >= 1) {
- p = unicode_previous_utf8 (text->text, text->text + text->selection_end);
+ p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
if (p != text->text) {
- p = unicode_previous_utf8 (text->text, p);
+ p = g_utf8_find_prev_char (text->text, p);
while (p && p > text->text && !new_pos) {
if (*p == '\n')
new_pos = p - text->text + 1;
- p = unicode_previous_utf8 (text->text, p);
+ p = g_utf8_find_prev_char (text->text, p);
}
}
}
@@ -3229,14 +3228,14 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
new_pos = length;
} else {
- p = unicode_next_utf8 (text->text + text->selection_end);
+ p = g_utf8_next_char (text->text + text->selection_end);
while (p && *p) {
if (*p == '\n') {
new_pos = p - text->text;
p = NULL;
} else
- p = unicode_next_utf8 (p);
+ p = g_utf8_next_char (p);
}
}
@@ -3251,7 +3250,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
if (text->selection_end >= length) {
new_pos = length;
} else {
- p = unicode_next_utf8 (text->text + text->selection_end);
+ p = g_utf8_next_char (text->text + text->selection_end);
new_pos = p - text->text;
}
@@ -3260,7 +3259,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
case E_TEP_BACKWARD_CHARACTER:
new_pos = 0;
if (text->selection_end >= 1) {
- p = unicode_previous_utf8 (text->text, text->text + text->selection_end);
+ p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
if (p != NULL)
new_pos = p - text->text;
@@ -3276,15 +3275,15 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
new_pos = length;
} else {
- p = unicode_next_utf8 (text->text + text->selection_end);
+ p = g_utf8_next_char (text->text + text->selection_end);
while (p && *p) {
- unicode_get_utf8 (p, &unival);
- if (unicode_isspace (unival)) {
+ unival = g_utf8_get_char (p);
+ if (g_unichar_isspace (unival)) {
new_pos = p - text->text;
p = NULL;
} else
- p = unicode_next_utf8 (p);
+ p = g_utf8_next_char (p);
}
}
@@ -3296,17 +3295,17 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
case E_TEP_BACKWARD_WORD:
new_pos = 0;
if (text->selection_end >= 1) {
- p = unicode_previous_utf8 (text->text, text->text + text->selection_end);
+ p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
if (p != text->text) {
- p = unicode_previous_utf8 (text->text, p);
+ p = g_utf8_find_prev_char (text->text, p);
while (p && p > text->text) {
- unicode_get_utf8 (p, &unival);
- if (unicode_isspace (unival)) {
- new_pos = unicode_next_utf8 (p) - text->text;
+ unival = g_utf8_get_char (p);
+ if (g_unichar_isspace (unival)) {
+ new_pos = g_utf8_next_char (p) - text->text;
p = NULL;
} else
- p = unicode_previous_utf8 (text->text, p);
+ p = g_utf8_find_prev_char (text->text, p);
}
}
}
@@ -3346,20 +3345,20 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
break;
}
- p = unicode_previous_utf8 (text->text, text->text + text->selection_end);
+ p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
if (p == text->text) {
new_pos = 0;
break;
}
- p = unicode_previous_utf8 (text->text, p);
+ p = g_utf8_find_prev_char (text->text, p);
while (p && p > text->text) {
- unicode_get_utf8 (p, &unival);
- if (unicode_isspace (unival)) {
- p = unicode_next_utf8 (p);
+ unival = g_utf8_get_char (p);
+ if (g_unichar_isspace (unival)) {
+ p = g_utf8_next_char (p);
break;
}
- p = unicode_previous_utf8 (text->text, p);
+ p = g_utf8_find_prev_char (text->text, p);
}
if (!p)
@@ -3376,15 +3375,15 @@ _get_position(EText *text, ETextEventProcessorCommand *command)
break;
}
- p = unicode_next_utf8 (text->text + text->selection_end);
+ p = g_utf8_next_char (text->text + text->selection_end);
while (p && *p) {
- unicode_get_utf8 (p, &unival);
- if (unicode_isspace (unival)) {
+ unival = g_utf8_get_char (p);
+ if (g_unichar_isspace (unival)) {
new_pos = p - text->text;
p = NULL;
} else
- p = unicode_next_utf8 (p);
+ p = g_utf8_next_char (p);
}
if (p)
n> * - Connect deskutils/libopensync-plugin-evolution2-devel to the buildmiwi2008-08-071-0/+1 * - Update to 0.36miwi2008-08-074-27/+23 * - Update to 1.12.0miwi2008-08-064-23/+22 * Update to 0.3.13.1.marcus2008-08-062-4/+4 * Strigi is a daemon which uses a very fast and efficient crawler that can indexmiwi2008-08-055-0/+146 * - Fix build after qt 4.4.1 updatemiwi2008-08-051-0/+1 * Mark BROKEN: does not build.erwin2008-08-051-0/+2 * Update to 0.3.13.marcus2008-08-053-4/+48 * Update to 2.22.3.1.marcus2008-08-042-4/+4 * Try to fix the reported build problemsarved2008-08-011-1/+2 * Add missing build dependenciesarved2008-08-011-8/+5 * Hermes is a time-tracking application integrated with the Horde Framework. Itbeech2008-07-315-0/+162 * Add Launchy, handly utility to access your applications, files, and bookmarksdanfe2008-07-305-0/+130 * - connect msynctool-develmiwi2008-07-281-0/+1 * - Update to 0.36miwi2008-07-282-15/+13 * - Chase databases/xapian-core updaterafan2008-07-272-2/+4 * - Update to 1.6.0lwhsu2008-07-263-578/+102 * - Pass maintainership to submittermiwi2008-07-265-5/+5 * - Update maintainer mail addressmiwi2008-07-261-1/+1 * - Remove duplicates from MAKE_ENV after inclusion of CC and CXX in default MA...pav2008-07-253-4/+2 * - Fix build: ${LIB_BZ2} is undefined, replace it with ${LIBBZ2} frompav2008-07-243-6/+9 * - Chase lang/guile share library version bump (.18 -> .19)rafan2008-07-211-2/+2 * Upgrade to 0.87.thierry2008-07-213-5/+6 * - Update to 0.10.0miwi2008-07-215-37/+45 * Update to 0.3.12.marcus2008-07-203-5/+33 * This plugin is based on vformat.{c,h} which got adapted from evolution e-vcardmiwi2008-07-195-0/+49 * A python module for the OpenSync framework.miwi2008-07-195-0/+41 * A python module for the OpenSync framework.miwi2008-07-195-0/+37 * This plugin allows applications using OpenSync to synchronise to and frommiwi2008-07-1911-0/+101 * - fix plist with -DNOPORTDOCSitetcu2008-07-162-8/+7 * - Update to 2.4.1miwi2008-07-123-36/+35 * - Upgrade to 1.4.004.kuriyama2008-07-123-7230/+5811 * A command line client for the OpenSync framework.miwi2008-07-117-0/+71 * - fixx depend on p5-ZConf (is in net/, not devel/) and unbreak INDEXitetcu2008-07-102-2/+4 * Remove a leftover directory.marcus2008-07-092-1/+2 * New ports: deskutils/zbgset-admin A tool for managing the settings for zbgset.edwin2008-07-094-0/+45 * New port: deskutils/zbgset A desktop BG management system.edwin2008-07-094-0/+62 * Add a missing dependency on libgtop.marcus2008-07-091-1/+3 * Add missing dependencies.marcus2008-07-091-1/+2 * Add gnome-main-menu, a tool to organize GNOME applications into onemarcus2008-07-0810-0/+353 * Update to 0.3.11.2.marcus2008-07-073-26/+88 * - simplify dependenciesleeym2008-07-051-8/+7 * It disappeared from master site and take over by alacarte.mezz2008-07-046-87/+0 * It disappeared from master site.mezz2008-07-049-361/+0 * Update to 2.22.3.mezz2008-07-012-5/+4 * Update to 2.22.3.marcus2008-06-302-5/+4 * - Update to 1.9.3gahr2008-06-303-18/+8 * - Update to 2.2 (release)beech2008-06-296-10/+30 * - Update to 2.2 (release)beech2008-06-296-10/+24 * - Update to 2.2 (release)beech2008-06-296-14/+22 * - Update to 5.0.0fmiwi2008-06-283-4/+7 * - Update to version 1.0.3markus2008-06-272-6/+7 * - Update to 0.14.3bland2008-06-254-74/+82 * - fix build for gnstep-base 1.15dinoex2008-06-251-0/+10 * Upgrade to 0.8.6.thierry2008-06-233-6/+4 * - File has been re-rolled (author fixed some spelling mistakes)miwi2008-06-222-3/+6 * jjclient - A command line client for posting JustJournal entriesmiwi2008-06-214-0/+34 * - Chase taglib bumptabthorpe2008-06-201-2/+2 * - Update to 0.9.3.lippe2008-06-204-63/+9 * - update to 1.2dinoex2008-06-172-5/+4 * - Update to version 1.0.3lwhsu2008-06-152-12/+5 * - Fix build on 6.x and minor changespav2008-06-134-7/+119 * Add google-gadgets 0.9.2, google Desktop Gadgets.ahze2008-06-0913-0/+593 * Update to 1.10.2wxs2008-06-073-5/+5 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-06