[go: up one dir, main page]

File: test-text.c

package info (click to toggle)
ibus 1.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 9,616 kB
  • ctags: 10,909
  • sloc: ansic: 33,920; sh: 10,485; python: 6,705; makefile: 1,043; cpp: 170
file content (42 lines) | stat: -rw-r--r-- 942 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "ibus.h"

int main()
{
	g_type_init ();

	IBusText *text1;
	IBusText *text2;
	IBusMessage *message;
	IBusError *error;
	gboolean retval;

	text1 = ibus_text_new_from_string ("Hello");
	text2 = ibus_text_new_from_static_string ("Hello");

	message = ibus_message_new_signal ("/org/freedesktop/IBus",
									   "org.freedesktop.IBus",
									   "Test");

	retval = ibus_message_append_args (message,
									   IBUS_TYPE_SERIALIZABLE, &text1,
									   IBUS_TYPE_SERIALIZABLE, &text2,
									   G_TYPE_INVALID);
	g_assert (retval);
	g_object_unref (text1);
	g_object_unref (text2);

	retval = ibus_message_get_args (message,
									&error,
									IBUS_TYPE_SERIALIZABLE, &text1,
									IBUS_TYPE_SERIALIZABLE, &text2,
									G_TYPE_INVALID);
	g_assert (retval);
	g_assert_cmpstr (text1->text, ==, "Hello");
	g_assert_cmpstr (text2->text, ==, "Hello");

	g_object_unref (text1);
	g_object_unref (text2);

	return 0;

}