summaryrefslogtreecommitdiff
path: root/examples/viewer.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-06-21 16:13:42 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-06-21 16:13:42 +0000
commit0e6409a158d9dd76a31b9eccf7c4f26c5466d082 (patch)
treedc120946f7efa23c6c91c64aee2686d2637e3970 /examples/viewer.c
parent197a2a68c145d3568cd4f0f2fee3d3b55570134f (diff)
downloadpango-0e6409a158d9dd76a31b9eccf7c4f26c5466d082.tar.gz
Remove tests for libunicode
Wed Jun 21 12:11:56 2000 Owen Taylor <otaylor@redhat.com> * configure.in: Remove tests for libunicode * pango/utils.[ch]: Removed. The functions from here are now in GLib. * **.[ch]: Removed use of libunicode and utils.c in favor of Unicode functions in GLib. Requires latest GLib from CVS.
Diffstat (limited to 'examples/viewer.c')
-rw-r--r--examples/viewer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/viewer.c b/examples/viewer.c
index 84b7b25d..65a251e7 100644
--- a/examples/viewer.c
+++ b/examples/viewer.c
@@ -26,7 +26,6 @@
#include <pango/pango.h>
#include <pango/pangox.h>
-#include <unicode.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -113,14 +112,16 @@ static GList *
split_paragraphs (char *text)
{
char *p = text;
- unicode_char_t wc;
+ char *next;
+ gunichar wc;
GList *result = NULL;
char *last_para = text;
while (*p)
{
- char *next = unicode_get_utf8 (p, &wc);
- if (!next)
+ wc = g_utf8_get_char (p);
+ next = g_utf8_next_char (p);
+ if (wc == (gunichar)-1)
{
fprintf (stderr, "gscript-viewer: Invalid character in input\n");
g_list_foreach (result, (GFunc)g_free, NULL);
@@ -344,9 +345,9 @@ button_press (GtkWidget *layout, GdkEventButton *event)
if (para)
{
- unicode_char_t wc;
+ gunichar wc;
- unicode_get_utf8 (para->text + offset, &wc);
+ wc = g_utf8_get_char (para->text + offset);
message = g_strdup_printf ("Current char: U%04x", wc);
xor_char (layout, NULL, highlight_para, highlight_offset);