Commit 3ad6a97e authored by Noah Levitt's avatar Noah Levitt

added unicode category to unicode_info

parent 557c74f0
gcc -Wall -ansi -g `pkg-config --cflags gtk+-2.0` unicode_info.c charmap.c main.c `pkg-config --libs gtk+-2.0`
Codepoint: U+0058 Character: X General Category: Letter, Uppercase
Name: LATIN CAPITAL LETTER X
kDefinition:
kCantonese: kKorean: kJapaneseOn: kTang: kMandarin:
Canonical Decomposition: X
Lu Letter, Uppercase
Ll Letter, Lowercase
Lt Letter, Titlecase
Lm Letter, Modifier
Lo Letter, Other
Mn Mark, Non-Spacing
Mc Mark, Spacing Combining
Me Mark, Enclosing
Nd Number, Decimal Digit
Nl Number, Letter
No Number, Other
Pc Punctuation, Connector
Pd Punctuation, Dash
Ps Punctuation, Open
Pe Punctuation, Close
Pi Punctuation, Initial quote
Pf Punctuation, Final quote
Po Punctuation, Other
Sm Symbol, Math
Sc Symbol, Currency
Sk Symbol, Modifier
So Symbol, Other
Zs Separator, Space
Zl Separator, Line
Zp Separator, Paragraph
Cc Other, Control
Cf Other, Format
Cs Other, Surrogate
Co Other, Private Use
Cn Other, Not Assigned
......@@ -82,7 +82,7 @@ set_caption (Charmap *charmap)
escaped_utf8_buf = g_markup_escape_text (
unichar_to_printable_utf8 (charmap->active_char), -1);
escaped_unicode_info = g_markup_escape_text (
get_unicode_info (charmap->active_char), -1);
get_unicode_name (charmap->active_char), -1);
/* n.b. the string below has utf8 quotes in it */
caption_markup = g_strdup_printf (
......
......@@ -28,15 +28,16 @@ extern "C" {
#define CHARMAP(obj) GTK_CHECK_CAST (obj, charmap_get_type (), Charmap)
#define CHARMAP_CLASS(clazz) GTK_CHECK_CLASS_CAST (clazz, charmap_get_type (), \
#define CHARMAP_CLASS(clazz) GTK_CHECK_CLASS_CAST (clazz, charmap_get_type (),\
CharmapClass)
#define IS_CHARMAP(obj) GTK_CHECK_TYPE (obj, charmap_get_type ())
#define CHARMAP_ROWS 8
#define CHARMAP_ROWS 12
#define CHARMAP_COLS 16
/* largest legal unicode character */
#define UNICHAR_MAX 0x0010ffff
/* #define UNICHAR_MAX 0x0010ffff XXX: gtk has problems */
#define UNICHAR_MAX 0x0000ffff
typedef struct _Charmap Charmap;
......
This diff is collapsed.
......@@ -28,9 +28,43 @@
extern "C" {
#endif /* __cplusplus */
typedef enum {
UNICODE_CATEGORY_Lu = 101, /* Letter, Uppercase */
UNICODE_CATEGORY_Ll, /* Letter, Lowercase */
UNICODE_CATEGORY_Lt, /* Letter, Titlecase */
UNICODE_CATEGORY_Lm, /* Letter, Modifier */
UNICODE_CATEGORY_Lo, /* Letter, Other */
UNICODE_CATEGORY_Mn, /* Mark, Non-Spacing */
UNICODE_CATEGORY_Mc, /* Mark, Spacing Combining */
UNICODE_CATEGORY_Me, /* Mark, Enclosing */
UNICODE_CATEGORY_Nd, /* Number, Decimal Digit */
UNICODE_CATEGORY_Nl, /* Number, Letter */
UNICODE_CATEGORY_No, /* Number, Other */
UNICODE_CATEGORY_Pc, /* Punctuation, Connector */
UNICODE_CATEGORY_Pd, /* Punctuation, Dash */
UNICODE_CATEGORY_Ps, /* Punctuation, Open */
UNICODE_CATEGORY_Pe, /* Punctuation, Close */
UNICODE_CATEGORY_Pi, /* Punctuation, Initial quote */
UNICODE_CATEGORY_Pf, /* Punctuation, Final quote */
UNICODE_CATEGORY_Po, /* Punctuation, Other */
UNICODE_CATEGORY_Sm, /* Symbol, Math */
UNICODE_CATEGORY_Sc, /* Symbol, Currency */
UNICODE_CATEGORY_Sk, /* Symbol, Modifier */
UNICODE_CATEGORY_So, /* Symbol, Other */
UNICODE_CATEGORY_Zs, /* Separator, Space */
UNICODE_CATEGORY_Zl, /* Separator, Line */
UNICODE_CATEGORY_Zp, /* Separator, Paragraph */
UNICODE_CATEGORY_Cc, /* Other, Control */
UNICODE_CATEGORY_Cf, /* Other, Format */
UNICODE_CATEGORY_Cs, /* Other, Surrogate */
UNICODE_CATEGORY_Co, /* Other, Private Use */
UNICODE_CATEGORY_Cn, /* Other, Not Assigned */
} unicode_category_t;
/* return value is read-only */
gchar * get_unicode_info (gunichar uc);
/* return values are read-only */
gchar * get_unicode_name (gunichar uc);
gchar * get_unicode_category_name (gunichar uc);
#ifdef __cplusplus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment