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-attribute.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-attribute.c')
-rw-r--r-- | src/test-attribute.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/test-attribute.c b/src/test-attribute.c new file mode 100644 index 0000000..b2ab4e5 --- /dev/null +++ b/src/test-attribute.c @@ -0,0 +1,44 @@ +#include "ibus.h" +#include "stdio.h" + +int main() +{ + g_type_init (); + IBusAttrList *list; + IBusMessage *message; + gboolean retval; + IBusError *error; + + list = ibus_attr_list_new (); + ibus_attr_list_append (list, ibus_attribute_new (1, 1, 1, 2)); + ibus_attr_list_append (list, ibus_attribute_new (2, 1, 1, 2)); + ibus_attr_list_append (list, ibus_attribute_new (3, 1, 1, 2)); + ibus_attr_list_append (list, ibus_attribute_new (3, 1, 1, 2)); + + message = ibus_message_new_signal ("/org/freedesktop/IBus", + "org.freedesktop.IBus", + "Test"); + + IBusSerializable *p = ibus_serializable_new (); + retval = ibus_message_append_args (message, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + G_TYPE_INVALID); + g_assert (retval); + + retval = ibus_message_get_args (message, + &error, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + IBUS_TYPE_SERIALIZABLE, &p, + G_TYPE_INVALID); + g_assert (retval); + + return 0; + +} |