Bug Summary

File:ctk/a11y/ctktoplevelaccessible.c
Warning:line 118, column 3
Value stored to 'obj' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name ctktoplevelaccessible.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/ctk -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I .. -D G_LOG_DOMAIN="Ctk" -D G_LOG_USE_STRUCTURED=1 -D CTK_VERSION="3.25.5" -D CTK_BINARY_VERSION="3.0.0" -D CTK_COMPILATION -D CTK_PRINT_BACKEND_ENABLE_UNSUPPORTED -D CTK_LIBDIR="/usr/lib" -D CTK_LOCALEDIR="/usr/share/locale" -D CTK_DATADIR="/usr/share" -D CTK_DATA_PREFIX="/usr" -D CTK_SYSCONFDIR="/usr/etc" -D CTK_HOST="x86_64-pc-linux-gnu" -D CTK_PRINT_BACKENDS="file,cups" -D X11_DATA_PREFIX="/usr" -D ISO_CODES_PREFIX="" -I .. -I ../ctk -I .. -I ../cdk -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -D G_ENABLE_DEBUG -D G_ENABLE_CONSISTENCY_CHECKS -D GLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_66 -D GLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_66 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/atk-1.0 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/gio-unix-2.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/pango-1.0 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -D PIC -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/rootdir/ctk -ferror-limit 19 -fvisibility=hidden -fgnuc-version=4.2.1 -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-09-19-171502-43637-1 -x c a11y/ctktoplevelaccessible.c
1/* CTK+ - accessibility implementations
2 * Copyright 2001, 2002, 2003 Sun Microsystems Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "config.h"
19
20#include <stdlib.h>
21#include <string.h>
22
23#include <ctk/ctkeventbox.h>
24#include <ctk/ctkscrolledwindow.h>
25#include <ctk/ctkframe.h>
26#include <ctk/ctkmenu.h>
27#include <ctk/ctkmenuitem.h>
28#include <ctk/ctkbutton.h>
29#include <ctk/ctkplug.h>
30#include <ctk/ctkwindow.h>
31
32#include "ctktoplevelaccessible.h"
33
34struct _CtkToplevelAccessiblePrivate
35{
36 GList *window_list;
37};
38
39G_DEFINE_TYPE_WITH_PRIVATE (CtkToplevelAccessible, ctk_toplevel_accessible, ATK_TYPE_OBJECT)static void ctk_toplevel_accessible_init (CtkToplevelAccessible
*self); static void ctk_toplevel_accessible_class_init (CtkToplevelAccessibleClass
*klass); static GType ctk_toplevel_accessible_get_type_once (
void); static gpointer ctk_toplevel_accessible_parent_class =
((void*)0); static gint CtkToplevelAccessible_private_offset
; static void ctk_toplevel_accessible_class_intern_init (gpointer
klass) { ctk_toplevel_accessible_parent_class = g_type_class_peek_parent
(klass); if (CtkToplevelAccessible_private_offset != 0) g_type_class_adjust_private_offset
(klass, &CtkToplevelAccessible_private_offset); ctk_toplevel_accessible_class_init
((CtkToplevelAccessibleClass*) klass); } __attribute__ ((__unused__
)) static inline gpointer ctk_toplevel_accessible_get_instance_private
(CtkToplevelAccessible *self) { return (((gpointer) ((guint8
*) (self) + (glong) (CtkToplevelAccessible_private_offset))))
; } GType ctk_toplevel_accessible_get_type (void) { static GType
static_g_define_type_id = 0; if ((__extension__ ({ _Static_assert
(sizeof *(&static_g_define_type_id) == sizeof (gpointer)
, "Expression evaluates to false"); (void) (0 ? (gpointer) * (
&static_g_define_type_id) : ((void*)0)); (!(__extension__
({ _Static_assert (sizeof *(&static_g_define_type_id) ==
sizeof (gpointer), "Expression evaluates to false"); __typeof__
(*(&static_g_define_type_id)) gapg_temp_newval; __typeof__
((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id
); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)
; gapg_temp_newval; })) && g_once_init_enter_pointer (
&static_g_define_type_id)); })) ) { GType g_define_type_id
= ctk_toplevel_accessible_get_type_once (); (__extension__ (
{ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof
(gpointer), "Expression evaluates to false"); 0 ? (void) (*(
&static_g_define_type_id) = (g_define_type_id)) : (void) 0
; g_once_init_leave_pointer ((&static_g_define_type_id), (
gpointer) (guintptr) (g_define_type_id)); })) ; } return static_g_define_type_id
; } __attribute__ ((__noinline__)) static GType ctk_toplevel_accessible_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((atk_object_get_type ()), g_intern_static_string ("CtkToplevelAccessible"
), sizeof (CtkToplevelAccessibleClass), (GClassInitFunc)(void
(*)(void)) ctk_toplevel_accessible_class_intern_init, sizeof
(CtkToplevelAccessible), (GInstanceInitFunc)(void (*)(void))
ctk_toplevel_accessible_init, (GTypeFlags) 0); { {{ CtkToplevelAccessible_private_offset
= g_type_add_instance_private (g_define_type_id, sizeof (CtkToplevelAccessiblePrivate
)); };} } return g_define_type_id; }
40
41static void
42ctk_toplevel_accessible_initialize (AtkObject *accessible,
43 gpointer data)
44{
45 ATK_OBJECT_CLASS (ctk_toplevel_accessible_parent_class)((((AtkObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((ctk_toplevel_accessible_parent_class)), ((atk_object_get_type
()))))))
->initialize (accessible, data);
46
47 accessible->role = ATK_ROLE_APPLICATION;
48 accessible->accessible_parent = NULL((void*)0);
49}
50
51static void
52ctk_toplevel_accessible_object_finalize (GObject *obj)
53{
54 CtkToplevelAccessible *toplevel = CTK_TOPLEVEL_ACCESSIBLE (obj)((((CtkToplevelAccessible*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((obj)), ((ctk_toplevel_accessible_get_type
()))))))
;
55
56 if (toplevel->priv->window_list)
57 g_list_free (toplevel->priv->window_list);
58
59 G_OBJECT_CLASS (ctk_toplevel_accessible_parent_class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((ctk_toplevel_accessible_parent_class)), (((GType) ((20) <<
(2))))))))
->finalize (obj);
60}
61
62static gint
63ctk_toplevel_accessible_get_n_children (AtkObject *obj)
64{
65 CtkToplevelAccessible *toplevel = CTK_TOPLEVEL_ACCESSIBLE (obj)((((CtkToplevelAccessible*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((obj)), ((ctk_toplevel_accessible_get_type
()))))))
;
66
67 return g_list_length (toplevel->priv->window_list);
68}
69
70static AtkObject *
71ctk_toplevel_accessible_ref_child (AtkObject *obj,
72 gint i)
73{
74 CtkToplevelAccessible *toplevel;
75 CtkWidget *widget;
76 AtkObject *atk_obj;
77
78 toplevel = CTK_TOPLEVEL_ACCESSIBLE (obj)((((CtkToplevelAccessible*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((obj)), ((ctk_toplevel_accessible_get_type
()))))))
;
79 widget = g_list_nth_data (toplevel->priv->window_list, i);
80 if (!widget)
81 return NULL((void*)0);
82
83 atk_obj = ctk_widget_get_accessible (widget);
84
85 g_object_ref (atk_obj)((__typeof__ (atk_obj)) (g_object_ref) (atk_obj));
86
87 return atk_obj;
88}
89
90static const char *
91ctk_toplevel_accessible_get_name (AtkObject *obj G_GNUC_UNUSED__attribute__ ((__unused__)))
92{
93 return g_get_prgname ();
94}
95
96static gboolean
97is_combo_window (CtkWidget *widget)
98{
99 CtkWidget *child;
100 AtkObject *obj;
101
102 child = ctk_bin_get_child (CTK_BIN (widget)((((CtkBin*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((widget)), ((ctk_bin_get_type ()))))))
);
103
104 if (!CTK_IS_EVENT_BOX (child)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(child)); GType __t = ((ctk_event_box_get_type ())); gboolean
__r; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
)
105 return FALSE(0);
106
107 child = ctk_bin_get_child (CTK_BIN (child)((((CtkBin*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((child)), ((ctk_bin_get_type ()))))))
);
108
109 if (!CTK_IS_FRAME (child)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(child)); GType __t = ((ctk_frame_get_type ())); gboolean __r
; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
)
110 return FALSE(0);
111
112 child = ctk_bin_get_child (CTK_BIN (child)((((CtkBin*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((child)), ((ctk_bin_get_type ()))))))
);
113
114 if (!CTK_IS_SCROLLED_WINDOW (child)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(child)); GType __t = ((ctk_scrolled_window_get_type ())); gboolean
__r; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
)
115 return FALSE(0);
116
117 obj = ctk_widget_get_accessible (child);
118 obj = atk_object_get_parent (obj);
Value stored to 'obj' is never read
119
120 return FALSE(0);
121}
122
123static gboolean
124is_attached_menu_window (CtkWidget *widget)
125{
126 CtkWidget *child;
127
128 child = ctk_bin_get_child (CTK_BIN (widget)((((CtkBin*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((widget)), ((ctk_bin_get_type ()))))))
);
129 if (CTK_IS_MENU (child)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(child)); GType __t = ((ctk_menu_get_type ())); gboolean __r;
if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
)
130 {
131 CtkWidget *attach;
132
133 attach = ctk_menu_get_attach_widget (CTK_MENU (child)((((CtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((child)), ((ctk_menu_get_type ()))))))
);
134 /* Allow for menu belonging to the Panel Menu, which is a CtkButton */
135 if (CTK_IS_MENU_ITEM (attach)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(attach)); GType __t = ((ctk_menu_item_get_type ())); gboolean
__r; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
|| CTK_IS_BUTTON (attach)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(attach)); GType __t = ((ctk_button_get_type ())); gboolean __r
; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
)
136 return TRUE(!(0));
137 }
138
139 return FALSE(0);
140}
141
142static void
143ctk_toplevel_accessible_class_init (CtkToplevelAccessibleClass *klass)
144{
145 AtkObjectClass *class = ATK_OBJECT_CLASS(klass)((((AtkObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), ((atk_object_get_type ()))))))
;
146 GObjectClass *g_object_class = G_OBJECT_CLASS(klass)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), (((GType) ((20) << (2))))))))
;
147
148 class->initialize = ctk_toplevel_accessible_initialize;
149 class->get_n_children = ctk_toplevel_accessible_get_n_children;
150 class->ref_child = ctk_toplevel_accessible_ref_child;
151 class->get_parent = NULL((void*)0);
152 class->get_name = ctk_toplevel_accessible_get_name;
153
154 g_object_class->finalize = ctk_toplevel_accessible_object_finalize;
155}
156
157static void
158remove_child (CtkToplevelAccessible *toplevel,
159 CtkWindow *window)
160{
161 AtkObject *atk_obj = ATK_OBJECT (toplevel)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((toplevel)), ((atk_object_get_type ()))))))
;
162 GList *l;
163 guint window_count = 0;
164
165 if (toplevel->priv->window_list)
166 {
167 for (l = toplevel->priv->window_list; l; l = l->next)
168 {
169 CtkWindow *tmp_window;
170
171 tmp_window = CTK_WINDOW (l->data)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((l->data)), ((ctk_window_get_type ()))))))
;
172
173 if (window == tmp_window)
174 {
175 AtkObject *child;
176
177 /* Remove the window from the window_list & emit the signal */
178 toplevel->priv->window_list = g_list_delete_link (toplevel->priv->window_list, l);
179 child = ctk_widget_get_accessible (CTK_WIDGET (window)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((window)), ((ctk_widget_get_type ()))))))
);
180 g_signal_emit_by_name (atk_obj, "children-changed::remove",
181 window_count, child, NULL((void*)0));
182 atk_object_set_parent (child, NULL((void*)0));
183 break;
184 }
185
186 window_count++;
187 }
188 }
189}
190
191static gboolean
192show_event_watcher (GSignalInvocationHint *ihint G_GNUC_UNUSED__attribute__ ((__unused__)),
193 guint n_param_values G_GNUC_UNUSED__attribute__ ((__unused__)),
194 const GValue *param_values,
195 gpointer data)
196{
197 CtkToplevelAccessible *toplevel = CTK_TOPLEVEL_ACCESSIBLE (data)((((CtkToplevelAccessible*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((data)), ((ctk_toplevel_accessible_get_type
()))))))
;
198 AtkObject *atk_obj = ATK_OBJECT (toplevel)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((toplevel)), ((atk_object_get_type ()))))))
;
199 GObject *object;
200 CtkWidget *widget;
201 gint n_children;
202 AtkObject *child;
203
204 object = g_value_get_object (param_values + 0);
205
206 if (!CTK_IS_WINDOW (object)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(object)); GType __t = ((ctk_window_get_type ())); gboolean __r
; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
)
207 return TRUE(!(0));
208
209 widget = CTK_WIDGET (object)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((object)), ((ctk_widget_get_type ()))))))
;
210 if (ctk_widget_get_parent (widget) ||
211 is_attached_menu_window (widget) ||
212#ifdef CDK_WINDOWING_X11
213 CTK_IS_PLUG (widget)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(widget)); GType __t = ((ctk_plug_get_type ())); gboolean __r
; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
||
214#endif
215 is_combo_window (widget))
216 return TRUE(!(0));
217
218 child = ctk_widget_get_accessible (widget);
219 if (atk_object_get_role (child) == ATK_ROLE_REDUNDANT_OBJECT ||
220 atk_object_get_role (child) == ATK_ROLE_TOOL_TIP)
221 return TRUE(!(0));
222
223 /* Add the window to the list & emit the signal */
224 toplevel->priv->window_list = g_list_append (toplevel->priv->window_list, widget);
225 n_children = g_list_length (toplevel->priv->window_list);
226
227 atk_object_set_parent (child, atk_obj);
228 g_signal_emit_by_name (atk_obj, "children-changed::add",
229 n_children - 1, child, NULL((void*)0));
230
231 g_signal_connect_swapped (G_OBJECT(object), "destroy",g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((object)), (((GType) ((20) << (2)))
)))))), ("destroy"), (((GCallback) (remove_child))), (toplevel
), ((void*)0), G_CONNECT_SWAPPED)
232 G_CALLBACK (remove_child), toplevel)g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((object)), (((GType) ((20) << (2)))
)))))), ("destroy"), (((GCallback) (remove_child))), (toplevel
), ((void*)0), G_CONNECT_SWAPPED)
;
233
234 return TRUE(!(0));
235}
236
237static gboolean
238hide_event_watcher (GSignalInvocationHint *ihint G_GNUC_UNUSED__attribute__ ((__unused__)),
239 guint n_param_values G_GNUC_UNUSED__attribute__ ((__unused__)),
240 const GValue *param_values,
241 gpointer data)
242{
243 CtkToplevelAccessible *toplevel = CTK_TOPLEVEL_ACCESSIBLE (data)((((CtkToplevelAccessible*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((data)), ((ctk_toplevel_accessible_get_type
()))))))
;
244 GObject *object;
245
246 object = g_value_get_object (param_values + 0);
247
248 if (!CTK_IS_WINDOW (object)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(object)); GType __t = ((ctk_window_get_type ())); gboolean __r
; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
)
249 return TRUE(!(0));
250
251 remove_child (toplevel, CTK_WINDOW (object)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((object)), ((ctk_window_get_type ()))))))
);
252 return TRUE(!(0));
253}
254
255static void
256ctk_toplevel_accessible_init (CtkToplevelAccessible *toplevel)
257{
258 CtkWindow *window;
259 CtkWidget *widget;
260 GList *l;
261 guint signal_id;
262
263 toplevel->priv = ctk_toplevel_accessible_get_instance_private (toplevel);
264
265 l = toplevel->priv->window_list = ctk_window_list_toplevels ();
266
267 while (l)
268 {
269 window = CTK_WINDOW (l->data)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((l->data)), ((ctk_window_get_type ()))))))
;
270 widget = CTK_WIDGET (window)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((window)), ((ctk_widget_get_type ()))))))
;
271 if (!window ||
272 !ctk_widget_get_visible (widget) ||
273 is_attached_menu_window (widget) ||
274#ifdef CDK_WINDOWING_X11
275 CTK_IS_PLUG (window)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(window)); GType __t = ((ctk_plug_get_type ())); gboolean __r
; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
||
276#endif
277 ctk_widget_get_parent (CTK_WIDGET (window)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((window)), ((ctk_widget_get_type ()))))))
))
278 {
279 GList *temp_l = l->next;
280
281 toplevel->priv->window_list = g_list_delete_link (toplevel->priv->window_list, l);
282 l = temp_l;
283 }
284 else
285 {
286 g_signal_connect_swapped (G_OBJECT (window), "destroy",g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((window)), (((GType) ((20) << (2)))
)))))), ("destroy"), (((GCallback) (remove_child))), (toplevel
), ((void*)0), G_CONNECT_SWAPPED)
287 G_CALLBACK (remove_child), toplevel)g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((window)), (((GType) ((20) << (2)))
)))))), ("destroy"), (((GCallback) (remove_child))), (toplevel
), ((void*)0), G_CONNECT_SWAPPED)
;
288 l = l->next;
289 }
290 }
291
292 g_type_class_ref (CTK_TYPE_WINDOW(ctk_window_get_type ()));
293
294 signal_id = g_signal_lookup ("show", CTK_TYPE_WINDOW(ctk_window_get_type ()));
295 g_signal_add_emission_hook (signal_id, 0,
296 show_event_watcher, toplevel, (GDestroyNotify) NULL((void*)0));
297
298 signal_id = g_signal_lookup ("hide", CTK_TYPE_WINDOW(ctk_window_get_type ()));
299 g_signal_add_emission_hook (signal_id, 0,
300 hide_event_watcher, toplevel, (GDestroyNotify) NULL((void*)0));
301}
302
303/**
304 * ctk_toplevel_accessible_get_children:
305 *
306 * Returns: (transfer none) (element-type Ctk.Window): List of
307 * children.
308 */
309GList *
310ctk_toplevel_accessible_get_children (CtkToplevelAccessible *accessible)
311{
312 return accessible->priv->window_list;
313}