diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2009-02-05 10:39:56 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2009-02-05 10:39:56 +0800 |
commit | aedad1ea0a7fef604aa27f4b58433fd8f2ece29e (patch) | |
tree | ffcb531d8474bde18b90341bcd4eb639edd74525 /src/test-lookuptable.c | |
parent | 41ad46305a88637dd99f00a2d2a3f455505d357b (diff) | |
download | ibus-aedad1ea0a7fef604aa27f4b58433fd8f2ece29e.tar.gz ibus-aedad1ea0a7fef604aa27f4b58433fd8f2ece29e.tar.xz ibus-aedad1ea0a7fef604aa27f4b58433fd8f2ece29e.zip |
re-implement ibus in c language.
Diffstat (limited to 'src/test-lookuptable.c')
-rw-r--r-- | src/test-lookuptable.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test-lookuptable.c b/src/test-lookuptable.c new file mode 100644 index 0000000..ec56811 --- /dev/null +++ b/src/test-lookuptable.c @@ -0,0 +1,39 @@ +#include "ibus.h" + +int main() +{ + g_type_init (); + IBusLookupTable *table, *table1; + IBusMessage *message; + IBusError *error; + gboolean retval; + + table = ibus_lookup_table_new (9, TRUE); + ibus_lookup_table_append_candidate (table, ibus_text_new_from_static_string ("Hello")); + ibus_lookup_table_append_candidate (table, ibus_text_new_from_static_string ("Cool")); + + message = ibus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL); + + retval = ibus_message_append_args (message, + IBUS_TYPE_LOOKUP_TABLE, &table, + IBUS_TYPE_LOOKUP_TABLE, &table, + G_TYPE_INVALID); + g_assert (retval); + + g_object_unref (table); + table = table1 = NULL; + + retval = ibus_message_get_args (message, + &error, + IBUS_TYPE_LOOKUP_TABLE, &table, + IBUS_TYPE_LOOKUP_TABLE, &table1, + G_TYPE_INVALID); + g_assert (retval); + g_assert (table); + g_assert (table1); + + g_object_unref (table); + g_object_unref (table1); + + return 0; +} |