13 Commits

Author SHA1 Message Date
David Herrmann
d0672030ff unicode: implement ucs4 to utf8 encoding
This is the last glib dependency so add a short conversion helper and we
can finally drop glib. Anyway, the pango libs still depend on glib so
there is currently still a glib dependency, but it is no longer direct and
we can always choose the freetype font renderer to drop it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 16:29:34 +02:00
David Herrmann
a97c580afd unicode: use kmscon_array instead of GArray
Replace the glib dependency with the new in-house dynamic-array
implementation. Now there is only one utf8 glib dependency left that we
need to convert so we can drop glib-dependency.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-15 14:45:19 +02:00
David Herrmann
485b6b352c unicode: replace glib types with native types
There is really no need to use these glib types here. They are relicts
from the time when we used the glib hashtable so we can safely replace
them now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 19:35:16 +02:00
David Herrmann
25b81425ef misc: change hashtable compare function to return bool
It really doesn't make sense to expect an integer here as memcmp() and
friends use an integer, too, but in reversed logic. So use bool to avoid
confusion.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 19:29:33 +02:00
David Herrmann
f1326b2728 static: move statically linked subsystems to static_*
Small stuff that is not worth putting into a separate library is no moved
into the "static" library which is statically linked into all our
subsystems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 20:35:22 +02:00
David Herrmann
277edee2dc unicode: introduce kmscon_utf8_mach_reset()
Sometimes we need to reset the UTF8 state-machine, for instance when
resetting the VTE. This function simply resets the internal state to
KMSCON_UTF8_START so we start all over on the next input character.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 11:13:49 +02:00
David Herrmann
f091b2b763 misc: replace all GHashTable with kmscon_hashtable
We use a new wrapper to move all glib deps to central points so we can
replace them easily.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-30 18:49:04 +02:00
David Herrmann
c9ea08d9b5 unicode: use static global symbol table
A symbol table should never be created twice therefore we can make it
static and global. We add locks so it is totally thread-safe, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-29 16:17:55 +02:00
David Herrmann
a31455a10b unicode: fix logging messages
Use new logging style in unicode layer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-28 17:20:13 +02:00
David Herrmann
046d397987 unicode: add utf8 state machine
The state machine is used to convert a stream of UTF8 data into UCS4
characters. It is slightly based on the machine found in the
wayland-compositor demos.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-29 14:19:49 +01:00
David Herrmann
bd09f38a4d log: move log_warning to log_warn
log_warn is much shorter and we already use log_err instead of log_error
so this is more consistent now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-24 15:29:55 +01:00
David Herrmann
4eca3ef714 unicode: provide utf8 converter
Allow converting a ucs4 string into a utf8 string. Also export the default
symbol so other subsystems may use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-01 17:42:57 +01:00
David Herrmann
39f90a4536 Add faster kmscon_char replacement
Instead of allocating big buffers with kmscon_char's for every character we now
reduce a single character to an integer. This integer is either the Unicode
codepoint or an ID to an internally allocated string.

The so called kmscon_symbol_t integer can now be used as if it were a classic
"char" value without bothering with combining marks etc.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-01 16:47:06 +01:00