File: | _build/../libvnck/workspace-accessible.c |
Warning: | line 151, column 11 The right operand of '>' is a garbage value |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* | |||
2 | * Copyright 2002 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 <libvnck/libvnck.h> | |||
19 | #include <ctk/ctk.h> | |||
20 | #include <errno(*__errno_location ()).h> | |||
21 | #include <unistd.h> | |||
22 | #include "workspace-accessible.h" | |||
23 | #include "private.h" | |||
24 | ||||
25 | static const char* vnck_workspace_accessible_get_name (AtkObject *obj); | |||
26 | static const char* vnck_workspace_accessible_get_description (AtkObject *obj); | |||
27 | static int vnck_workspace_accessible_get_index_in_parent (AtkObject *obj); | |||
28 | static void atk_component_interface_init (AtkComponentIface *iface); | |||
29 | static void vnck_workspace_accessible_get_extents (AtkComponent *component, | |||
30 | int *x, | |||
31 | int *y, | |||
32 | int *width, | |||
33 | int *height, | |||
34 | AtkCoordType coords); | |||
35 | static void vnck_workspace_accessible_get_position (AtkComponent *component, | |||
36 | int *x, | |||
37 | int *y, | |||
38 | AtkCoordType coords); | |||
39 | static gboolean vnck_workspace_accessible_contains (AtkComponent *component, | |||
40 | int x, | |||
41 | int y, | |||
42 | AtkCoordType coords); | |||
43 | static void vnck_workspace_accessible_get_size (AtkComponent *component, | |||
44 | int *width, | |||
45 | int *height); | |||
46 | ||||
47 | G_DEFINE_TYPE_WITH_CODE (VnckWorkspaceAccessible,static void vnck_workspace_accessible_init (VnckWorkspaceAccessible *self); static void vnck_workspace_accessible_class_init (VnckWorkspaceAccessibleClass *klass); static GType vnck_workspace_accessible_get_type_once (void); static gpointer vnck_workspace_accessible_parent_class = ((void*)0); static gint VnckWorkspaceAccessible_private_offset ; static void vnck_workspace_accessible_class_intern_init (gpointer klass) { vnck_workspace_accessible_parent_class = g_type_class_peek_parent (klass); if (VnckWorkspaceAccessible_private_offset != 0) g_type_class_adjust_private_offset (klass, &VnckWorkspaceAccessible_private_offset); vnck_workspace_accessible_class_init ((VnckWorkspaceAccessibleClass*) klass); } __attribute__ ((__unused__ )) static inline gpointer vnck_workspace_accessible_get_instance_private (VnckWorkspaceAccessible *self) { return (((gpointer) ((guint8 *) (self) + (glong) (VnckWorkspaceAccessible_private_offset)) )); } GType vnck_workspace_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 = vnck_workspace_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 vnck_workspace_accessible_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple ((atk_gobject_accessible_get_type ()), g_intern_static_string ("VnckWorkspaceAccessible"), sizeof (VnckWorkspaceAccessibleClass ), (GClassInitFunc)(void (*)(void)) vnck_workspace_accessible_class_intern_init , sizeof (VnckWorkspaceAccessible), (GInstanceInitFunc)(void ( *)(void)) vnck_workspace_accessible_init, (GTypeFlags) 0); { { { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) atk_component_interface_init, ((void*)0), ( (void*)0) }; g_type_add_interface_static (g_define_type_id, ( atk_component_get_type ()), &g_implement_interface_info); };} } return g_define_type_id; } | |||
48 | vnck_workspace_accessible,static void vnck_workspace_accessible_init (VnckWorkspaceAccessible *self); static void vnck_workspace_accessible_class_init (VnckWorkspaceAccessibleClass *klass); static GType vnck_workspace_accessible_get_type_once (void); static gpointer vnck_workspace_accessible_parent_class = ((void*)0); static gint VnckWorkspaceAccessible_private_offset ; static void vnck_workspace_accessible_class_intern_init (gpointer klass) { vnck_workspace_accessible_parent_class = g_type_class_peek_parent (klass); if (VnckWorkspaceAccessible_private_offset != 0) g_type_class_adjust_private_offset (klass, &VnckWorkspaceAccessible_private_offset); vnck_workspace_accessible_class_init ((VnckWorkspaceAccessibleClass*) klass); } __attribute__ ((__unused__ )) static inline gpointer vnck_workspace_accessible_get_instance_private (VnckWorkspaceAccessible *self) { return (((gpointer) ((guint8 *) (self) + (glong) (VnckWorkspaceAccessible_private_offset)) )); } GType vnck_workspace_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 = vnck_workspace_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 vnck_workspace_accessible_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple ((atk_gobject_accessible_get_type ()), g_intern_static_string ("VnckWorkspaceAccessible"), sizeof (VnckWorkspaceAccessibleClass ), (GClassInitFunc)(void (*)(void)) vnck_workspace_accessible_class_intern_init , sizeof (VnckWorkspaceAccessible), (GInstanceInitFunc)(void ( *)(void)) vnck_workspace_accessible_init, (GTypeFlags) 0); { { { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) atk_component_interface_init, ((void*)0), ( (void*)0) }; g_type_add_interface_static (g_define_type_id, ( atk_component_get_type ()), &g_implement_interface_info); };} } return g_define_type_id; } | |||
49 | ATK_TYPE_GOBJECT_ACCESSIBLE,static void vnck_workspace_accessible_init (VnckWorkspaceAccessible *self); static void vnck_workspace_accessible_class_init (VnckWorkspaceAccessibleClass *klass); static GType vnck_workspace_accessible_get_type_once (void); static gpointer vnck_workspace_accessible_parent_class = ((void*)0); static gint VnckWorkspaceAccessible_private_offset ; static void vnck_workspace_accessible_class_intern_init (gpointer klass) { vnck_workspace_accessible_parent_class = g_type_class_peek_parent (klass); if (VnckWorkspaceAccessible_private_offset != 0) g_type_class_adjust_private_offset (klass, &VnckWorkspaceAccessible_private_offset); vnck_workspace_accessible_class_init ((VnckWorkspaceAccessibleClass*) klass); } __attribute__ ((__unused__ )) static inline gpointer vnck_workspace_accessible_get_instance_private (VnckWorkspaceAccessible *self) { return (((gpointer) ((guint8 *) (self) + (glong) (VnckWorkspaceAccessible_private_offset)) )); } GType vnck_workspace_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 = vnck_workspace_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 vnck_workspace_accessible_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple ((atk_gobject_accessible_get_type ()), g_intern_static_string ("VnckWorkspaceAccessible"), sizeof (VnckWorkspaceAccessibleClass ), (GClassInitFunc)(void (*)(void)) vnck_workspace_accessible_class_intern_init , sizeof (VnckWorkspaceAccessible), (GInstanceInitFunc)(void ( *)(void)) vnck_workspace_accessible_init, (GTypeFlags) 0); { { { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) atk_component_interface_init, ((void*)0), ( (void*)0) }; g_type_add_interface_static (g_define_type_id, ( atk_component_get_type ()), &g_implement_interface_info); };} } return g_define_type_id; } | |||
50 | G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT,static void vnck_workspace_accessible_init (VnckWorkspaceAccessible *self); static void vnck_workspace_accessible_class_init (VnckWorkspaceAccessibleClass *klass); static GType vnck_workspace_accessible_get_type_once (void); static gpointer vnck_workspace_accessible_parent_class = ((void*)0); static gint VnckWorkspaceAccessible_private_offset ; static void vnck_workspace_accessible_class_intern_init (gpointer klass) { vnck_workspace_accessible_parent_class = g_type_class_peek_parent (klass); if (VnckWorkspaceAccessible_private_offset != 0) g_type_class_adjust_private_offset (klass, &VnckWorkspaceAccessible_private_offset); vnck_workspace_accessible_class_init ((VnckWorkspaceAccessibleClass*) klass); } __attribute__ ((__unused__ )) static inline gpointer vnck_workspace_accessible_get_instance_private (VnckWorkspaceAccessible *self) { return (((gpointer) ((guint8 *) (self) + (glong) (VnckWorkspaceAccessible_private_offset)) )); } GType vnck_workspace_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 = vnck_workspace_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 vnck_workspace_accessible_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple ((atk_gobject_accessible_get_type ()), g_intern_static_string ("VnckWorkspaceAccessible"), sizeof (VnckWorkspaceAccessibleClass ), (GClassInitFunc)(void (*)(void)) vnck_workspace_accessible_class_intern_init , sizeof (VnckWorkspaceAccessible), (GInstanceInitFunc)(void ( *)(void)) vnck_workspace_accessible_init, (GTypeFlags) 0); { { { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) atk_component_interface_init, ((void*)0), ( (void*)0) }; g_type_add_interface_static (g_define_type_id, ( atk_component_get_type ()), &g_implement_interface_info); };} } return g_define_type_id; } | |||
51 | atk_component_interface_init))static void vnck_workspace_accessible_init (VnckWorkspaceAccessible *self); static void vnck_workspace_accessible_class_init (VnckWorkspaceAccessibleClass *klass); static GType vnck_workspace_accessible_get_type_once (void); static gpointer vnck_workspace_accessible_parent_class = ((void*)0); static gint VnckWorkspaceAccessible_private_offset ; static void vnck_workspace_accessible_class_intern_init (gpointer klass) { vnck_workspace_accessible_parent_class = g_type_class_peek_parent (klass); if (VnckWorkspaceAccessible_private_offset != 0) g_type_class_adjust_private_offset (klass, &VnckWorkspaceAccessible_private_offset); vnck_workspace_accessible_class_init ((VnckWorkspaceAccessibleClass*) klass); } __attribute__ ((__unused__ )) static inline gpointer vnck_workspace_accessible_get_instance_private (VnckWorkspaceAccessible *self) { return (((gpointer) ((guint8 *) (self) + (glong) (VnckWorkspaceAccessible_private_offset)) )); } GType vnck_workspace_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 = vnck_workspace_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 vnck_workspace_accessible_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple ((atk_gobject_accessible_get_type ()), g_intern_static_string ("VnckWorkspaceAccessible"), sizeof (VnckWorkspaceAccessibleClass ), (GClassInitFunc)(void (*)(void)) vnck_workspace_accessible_class_intern_init , sizeof (VnckWorkspaceAccessible), (GInstanceInitFunc)(void ( *)(void)) vnck_workspace_accessible_init, (GTypeFlags) 0); { { { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) atk_component_interface_init, ((void*)0), ( (void*)0) }; g_type_add_interface_static (g_define_type_id, ( atk_component_get_type ()), &g_implement_interface_info); };} } return g_define_type_id; } | |||
52 | ||||
53 | static void | |||
54 | atk_component_interface_init (AtkComponentIface *iface) | |||
55 | { | |||
56 | g_return_if_fail (iface != NULL)do { if ((iface != ((void*)0))) { } else { g_return_if_fail_warning ("Vnck", ((const char*) (__func__)), "iface != NULL"); return ; } } while (0); | |||
57 | ||||
58 | iface->get_extents = vnck_workspace_accessible_get_extents; | |||
59 | iface->get_size = vnck_workspace_accessible_get_size; | |||
60 | iface->get_position = vnck_workspace_accessible_get_position; | |||
61 | iface->contains = vnck_workspace_accessible_contains; | |||
62 | } | |||
63 | ||||
64 | static void | |||
65 | vnck_workspace_accessible_get_extents (AtkComponent *component, | |||
66 | int *x, | |||
67 | int *y, | |||
68 | int *width, | |||
69 | int *height, | |||
70 | AtkCoordType coords) | |||
71 | { | |||
72 | AtkGObjectAccessible *atk_gobj; | |||
73 | VnckPager *pager; | |||
74 | CdkRectangle rect; | |||
75 | CtkWidget *widget; | |||
76 | AtkObject *parent; | |||
77 | GObject *g_obj; | |||
78 | int px, py; | |||
79 | ||||
80 | g_return_if_fail (VNCK_IS_WORKSPACE_ACCESSIBLE (component))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((component)); GType __t = ((vnck_workspace_accessible_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; })))))) { } else { g_return_if_fail_warning ("Vnck", (( const char*) (__func__)), "VNCK_IS_WORKSPACE_ACCESSIBLE (component)" ); return; } } while (0); | |||
81 | ||||
82 | atk_gobj = ATK_GOBJECT_ACCESSIBLE (component)((((AtkGObjectAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((component)), ((atk_gobject_accessible_get_type ())))))); | |||
83 | g_obj = atk_gobject_accessible_get_object (atk_gobj); | |||
84 | if (g_obj == NULL((void*)0)) | |||
85 | return; | |||
86 | ||||
87 | g_return_if_fail (VNCK_IS_WORKSPACE (g_obj))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((g_obj)); GType __t = ((vnck_workspace_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; })))))) { } else { g_return_if_fail_warning ("Vnck", ((const char*) (__func__ )), "VNCK_IS_WORKSPACE (g_obj)"); return; } } while (0); | |||
88 | ||||
89 | parent = atk_object_get_parent (ATK_OBJECT(component)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((component)), ((atk_object_get_type ()))))))); | |||
90 | widget = ctk_accessible_get_widget (CTK_ACCESSIBLE (parent)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((parent)), ((ctk_accessible_get_type ()))))))); | |||
91 | ||||
92 | if (widget == NULL((void*)0)) | |||
93 | { | |||
94 | /* | |||
95 | *State is defunct | |||
96 | */ | |||
97 | return; | |||
98 | } | |||
99 | ||||
100 | g_return_if_fail (VNCK_IS_PAGER (widget))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((widget)); GType __t = ((vnck_pager_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; })))))) { } else { g_return_if_fail_warning ("Vnck", ((const char*) (__func__ )), "VNCK_IS_PAGER (widget)"); return; } } while (0); | |||
101 | pager = VNCK_PAGER (widget)((((VnckPager*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((widget)), ((vnck_pager_get_type ())))))); | |||
102 | ||||
103 | g_return_if_fail (VNCK_IS_PAGER (pager))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((pager)); GType __t = ((vnck_pager_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; })))))) { } else { g_return_if_fail_warning ("Vnck", ((const char*) (__func__ )), "VNCK_IS_PAGER (pager)"); return; } } while (0); | |||
104 | ||||
105 | atk_component_get_extents (ATK_COMPONENT (parent)(((AtkComponent*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((parent)), ((atk_component_get_type ()))))), &px, &py, NULL((void*)0), NULL((void*)0), coords); | |||
106 | ||||
107 | _vnck_pager_get_workspace_rect (pager, VNCK_WORKSPACE_ACCESSIBLE (component)((((VnckWorkspaceAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((component)), ((vnck_workspace_accessible_get_type ()))))))->index, &rect); | |||
108 | ||||
109 | *x = rect.x + px; | |||
110 | *y = rect.y + py; | |||
111 | *height = rect.height; | |||
112 | *width = rect.width; | |||
113 | } | |||
114 | ||||
115 | static void | |||
116 | vnck_workspace_accessible_get_size (AtkComponent *component, | |||
117 | int *width, | |||
118 | int *height) | |||
119 | { | |||
120 | AtkCoordType coords = ATK_XY_SCREEN; | |||
121 | int x, y; | |||
122 | ||||
123 | /* FIXME: Value for initialization of coords picked randomly to please gcc */ | |||
124 | ||||
125 | vnck_workspace_accessible_get_extents (component, &x, &y, width, height, coords); | |||
126 | } | |||
127 | ||||
128 | static void | |||
129 | vnck_workspace_accessible_get_position (AtkComponent *component, | |||
130 | int *x, | |||
131 | int *y, | |||
132 | AtkCoordType coords) | |||
133 | { | |||
134 | int width, height; | |||
135 | vnck_workspace_accessible_get_extents (component, x, y, &width, &height, coords); | |||
136 | } | |||
137 | ||||
138 | static gboolean | |||
139 | vnck_workspace_accessible_contains (AtkComponent *component, | |||
140 | int x, | |||
141 | int y, | |||
142 | AtkCoordType coords) | |||
143 | { | |||
144 | int lx, ly, width, height; | |||
| ||||
145 | ||||
146 | vnck_workspace_accessible_get_extents (component, &lx, &ly, &width, &height, coords); | |||
147 | ||||
148 | /* | |||
149 | * Check if the specified co-ordinates fall within the workspace. | |||
150 | */ | |||
151 | if ( (x > lx) && ((lx + width) >= x) && (y > ly) && ((ly + height) >= ly) ) | |||
| ||||
152 | return TRUE(!(0)); | |||
153 | else | |||
154 | return FALSE(0); | |||
155 | } | |||
156 | ||||
157 | static void | |||
158 | vnck_workspace_accessible_class_init (VnckWorkspaceAccessibleClass *klass) | |||
159 | { | |||
160 | AtkObjectClass *class = ATK_OBJECT_CLASS (klass)((((AtkObjectClass*) (void *) g_type_check_class_cast ((GTypeClass *) ((klass)), ((atk_object_get_type ())))))); | |||
161 | ||||
162 | class->get_name = vnck_workspace_accessible_get_name; | |||
163 | class->get_description = vnck_workspace_accessible_get_description; | |||
164 | class->get_index_in_parent = vnck_workspace_accessible_get_index_in_parent; | |||
165 | } | |||
166 | ||||
167 | static void | |||
168 | vnck_workspace_accessible_init (VnckWorkspaceAccessible *accessible G_GNUC_UNUSED__attribute__ ((__unused__))) | |||
169 | { | |||
170 | } | |||
171 | ||||
172 | AtkObject* | |||
173 | vnck_workspace_accessible_new (GObject *obj) | |||
174 | { | |||
175 | GObject *object; | |||
176 | AtkObject *atk_object; | |||
177 | ||||
178 | g_return_val_if_fail (VNCK_IS_WORKSPACE (obj), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((obj)); GType __t = ((vnck_workspace_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; })))))) { } else { g_return_if_fail_warning ("Vnck", ((const char*) (__func__ )), "VNCK_IS_WORKSPACE (obj)"); return (((void*)0)); } } while (0); | |||
179 | ||||
180 | object = g_object_new (VNCK_WORKSPACE_TYPE_ACCESSIBLE(vnck_workspace_accessible_get_type ()), NULL((void*)0)); | |||
181 | atk_object = ATK_OBJECT (object)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((object)), ((atk_object_get_type ())))))); | |||
182 | atk_object_initialize (atk_object, obj); | |||
183 | ||||
184 | g_return_val_if_fail (ATK_IS_OBJECT (atk_object), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((atk_object)); GType __t = ((atk_object_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; })))))) { } else { g_return_if_fail_warning ("Vnck", ((const char*) (__func__ )), "ATK_IS_OBJECT (atk_object)"); return (((void*)0)); } } while (0); | |||
185 | ||||
186 | VNCK_WORKSPACE_ACCESSIBLE (atk_object)((((VnckWorkspaceAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((atk_object)), ((vnck_workspace_accessible_get_type ()))))))->index = | |||
187 | vnck_workspace_get_number (VNCK_WORKSPACE (obj)((((VnckWorkspace*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((obj)), ((vnck_workspace_get_type ()))))))); | |||
188 | ||||
189 | return atk_object; | |||
190 | } | |||
191 | ||||
192 | static const char* | |||
193 | vnck_workspace_accessible_get_name (AtkObject *obj) | |||
194 | { | |||
195 | g_return_val_if_fail (VNCK_IS_WORKSPACE_ACCESSIBLE (obj), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((obj)); GType __t = ((vnck_workspace_accessible_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; })))))) { } else { g_return_if_fail_warning ("Vnck", (( const char*) (__func__)), "VNCK_IS_WORKSPACE_ACCESSIBLE (obj)" ); return (((void*)0)); } } while (0); | |||
196 | ||||
197 | if (obj->name != NULL((void*)0)) | |||
198 | { | |||
199 | return obj->name; | |||
200 | } | |||
201 | else | |||
202 | return NULL((void*)0); | |||
203 | } | |||
204 | ||||
205 | static const char* | |||
206 | vnck_workspace_accessible_get_description (AtkObject *obj) | |||
207 | { | |||
208 | g_return_val_if_fail (VNCK_IS_WORKSPACE_ACCESSIBLE (obj), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((obj)); GType __t = ((vnck_workspace_accessible_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; })))))) { } else { g_return_if_fail_warning ("Vnck", (( const char*) (__func__)), "VNCK_IS_WORKSPACE_ACCESSIBLE (obj)" ); return (((void*)0)); } } while (0); | |||
209 | ||||
210 | if (obj->description != NULL((void*)0)) | |||
211 | { | |||
212 | return obj->description; | |||
213 | } | |||
214 | else | |||
215 | return NULL((void*)0); | |||
216 | } | |||
217 | ||||
218 | static gint | |||
219 | vnck_workspace_accessible_get_index_in_parent (AtkObject *obj) | |||
220 | { | |||
221 | g_return_val_if_fail (VNCK_IS_WORKSPACE_ACCESSIBLE (obj), -1)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((obj)); GType __t = ((vnck_workspace_accessible_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; })))))) { } else { g_return_if_fail_warning ("Vnck", (( const char*) (__func__)), "VNCK_IS_WORKSPACE_ACCESSIBLE (obj)" ); return (-1); } } while (0); | |||
222 | ||||
223 | return VNCK_WORKSPACE_ACCESSIBLE (obj)((((VnckWorkspaceAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((obj)), ((vnck_workspace_accessible_get_type ()))))))->index; | |||
224 | } |