Debian Codegraph @

testsuite/gdk/seat.c

raw symbols SCIP
1 #cxx . . $ `<file>/testsuite/gdk/seat.c`/include <gtk/gtk.h>cxx . . $ `<file>/gtk/gtk.h`/
2
3 static void
4 test_list_seatscxx . . $ test_list_seats(49f6e7a06ebc5aa8). (void)
5 {
6 GdkDisplaycxx . . $ GdkDisplay# *display;
7 GdkSeatcxx . . $ GdkSeat# *seat0, *seat;
8 GListcxx . . $ GList# *list, *l;
9 gbooleancxx . . $ gboolean# found_default;
10
11 display = gdk_display_get_defaultcxx . . $ gdk_display_get_default(b31d93ef98fc5572). ();
12 seat0 = gdk_display_get_default_seatcxx . . $ gdk_display_get_default_seat(b8d4640ca7588d07). (display);
13 if (seat0 != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
14 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat0));
15
16 found_default = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
17 list = gdk_display_list_seatscxx . . $ gdk_display_list_seats(f8a723861129c8ad). (display);
18
19 for (l = list; l; l = l->nextcxx . . $ _GList#next.)
20 {
21 seat = l->datacxx . . $ _GList#data.;
22
23 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat));
24 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_seat_get_display (seat) == display);
25
26 if (seat == seat0)
27 found_default = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
28 }
29
30 if (seat0 != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
31 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (found_default);
32 else
33 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (list == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
34
35 g_list_freecxx . . $ g_list_free(d1b6ff1ff9a6d4b6). (list);
36 }
37
38 static void
39 test_default_seatcxx . . $ test_default_seat(49f6e7a06ebc5aa8). (void)
40 {
41 GdkDisplaycxx . . $ GdkDisplay# *display, *d;
42 GdkSeatcxx . . $ GdkSeat# *seat0;
43 GdkSeatCapabilitiescxx . . $ GdkSeatCapabilities# caps;
44 GdkDevicecxx . . $ GdkDevice# *pointer0, *keyboard0, *device;
45 GListcxx . . $ GList# *physical_devices, *tools, *l;
46 GdkDeviceToolcxx . . $ GdkDeviceTool# *tool;
47
48 display = gdk_display_get_defaultcxx . . $ gdk_display_get_default(b31d93ef98fc5572). ();
49 seat0 = gdk_display_get_default_seatcxx . . $ gdk_display_get_default_seat(b8d4640ca7588d07). (display);
50
51 if (seat0 == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
52 {
53 g_test_skipcxx . . $ g_test_skip(85c52e162fed56f9). ("Display has no seats");
54 return;
55 }
56
57 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat0));
58
59 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_seat_get_display (seat0) == display);
60 g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d). (seat0, "display", &d, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
61 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (display == d);
62 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (d);
63
64 caps = gdk_seat_get_capabilitiescxx . . $ gdk_seat_get_capabilities(2ca3cb027cb5cc44). (seat0);
65
66 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (caps != GDK_SEAT_CAPABILITY_NONE);
67
68 pointer0 = gdk_seat_get_pointercxx . . $ gdk_seat_get_pointer(bcf9d88e6a2df60a). (seat0);
69 physical_devices = gdk_seat_get_devicescxx . . $ gdk_seat_get_devices(135afe3d61e95f28). (seat0, GDK_SEAT_CAPABILITY_POINTERcxx . . $ GDK_SEAT_CAPABILITY_POINTER.);
70
71 if ((caps & GDK_SEAT_CAPABILITY_POINTERcxx . . $ GDK_SEAT_CAPABILITY_POINTER.) != 0)
72 {
73 g_assert_nonnullcxx . . $ `<external>/15287032793271088244/gtestutils.h:254:9`! (pointer0);
74 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_display (pointer0) == display);
75 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_seat (pointer0) == seat0);
76
77 for (l = physical_devices; l; l = l->nextcxx . . $ _GList#next.)
78 {
79 device = l->datacxx . . $ _GList#data.;
80 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_display (device) == display);
81 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_seat (device) == seat0);
82 }
83 g_list_freecxx . . $ g_list_free(d1b6ff1ff9a6d4b6). (physical_devices);
84 }
85 else
86 {
87 g_assert_nullcxx . . $ `<external>/15287032793271088244/gtestutils.h:250:9`! (pointer0);
88 g_assert_nullcxx . . $ `<external>/15287032793271088244/gtestutils.h:250:9`! (physical_devices);
89 }
90
91 keyboard0 = gdk_seat_get_keyboardcxx . . $ gdk_seat_get_keyboard(bcf9d88e6a2df60a). (seat0);
92 physical_devices = gdk_seat_get_devicescxx . . $ gdk_seat_get_devices(135afe3d61e95f28). (seat0, GDK_SEAT_CAPABILITY_KEYBOARDcxx . . $ GDK_SEAT_CAPABILITY_KEYBOARD.);
93
94 if ((caps & GDK_SEAT_CAPABILITY_KEYBOARDcxx . . $ GDK_SEAT_CAPABILITY_KEYBOARD.) != 0)
95 {
96 g_assert_nonnullcxx . . $ `<external>/15287032793271088244/gtestutils.h:254:9`! (keyboard0);
97 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_display (keyboard0) == display);
98 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_seat (keyboard0) == seat0);
99 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_source (keyboard0) == GDK_SOURCE_KEYBOARD);
100
101 for (l = physical_devices; l; l = l->nextcxx . . $ _GList#next.)
102 {
103 device = l->datacxx . . $ _GList#data.;
104 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_display (device) == display);
105 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_seat (device) == seat0);
106 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD);
107 }
108 g_list_freecxx . . $ g_list_free(d1b6ff1ff9a6d4b6). (physical_devices);
109 }
110 else
111 {
112 g_assert_nullcxx . . $ `<external>/15287032793271088244/gtestutils.h:250:9`! (keyboard0);
113 g_assert_nullcxx . . $ `<external>/15287032793271088244/gtestutils.h:250:9`! (physical_devices);
114 }
115
116 tools = gdk_seat_get_toolscxx . . $ gdk_seat_get_tools(77f306e6b47c8790). (seat0);
117 for (l = tools; l; l = l->nextcxx . . $ _GList#next.)
118 {
119 tool = l->datacxx . . $ _GList#data.;
120 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (GDK_IS_DEVICE_TOOLcxx . . $ `gdk/gdkdevicetool.h:30:9`! (tool));
121 }
122 g_list_freecxx . . $ g_list_free(d1b6ff1ff9a6d4b6). (tools);
123 }
124
125 int
126 maincxx . . $ main(afcd3168fc1188a4). (int argc, char *argv[])
127 {
128 (g_test_initcxx . . $ g_test_init(b91bcc5cc1349d78).) (&argc, &argv, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
129
130 gtk_initcxx . . $ gtk_init(49f6e7a06ebc5aa8). ();
131
132 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/seat/list", test_list_seatscxx . . $ test_list_seats(49f6e7a06ebc5aa8).);
133 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/seat/default", test_default_seatcxx . . $ test_default_seat(49f6e7a06ebc5aa8).);
134
135 return g_test_runcxx . . $ g_test_run(b126dc7c1de90089). ();
136 }