Bug Summary

File:ctk/a11y/ctkcellaccessible.c
Warning:line 295, column 22
Value stored to 'cell' during its initialization 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 ctkcellaccessible.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/ctkcellaccessible.c
1/* CTK+ - accessibility implementations
2 * Copyright 2001 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 <glib/gi18n-lib.h>
21#include <ctk/ctk.h>
22#include "ctkcontainercellaccessible.h"
23#include "ctkcellaccessibleprivate.h"
24#include "ctkcellaccessibleparent.h"
25
26struct _CtkCellAccessiblePrivate
27{
28 AtkObject *parent;
29};
30
31static const struct {
32 AtkState atk_state;
33 CtkCellRendererState renderer_state;
34 gboolean invert;
35} state_map[] = {
36 { ATK_STATE_SENSITIVE, CTK_CELL_RENDERER_INSENSITIVE, TRUE(!(0)) },
37 { ATK_STATE_ENABLED, CTK_CELL_RENDERER_INSENSITIVE, TRUE(!(0)) },
38 { ATK_STATE_SELECTED, CTK_CELL_RENDERER_SELECTED, FALSE(0) },
39 /* XXX: why do we map ACTIVE here? */
40 { ATK_STATE_ACTIVE, CTK_CELL_RENDERER_FOCUSED, FALSE(0) },
41 { ATK_STATE_FOCUSED, CTK_CELL_RENDERER_FOCUSED, FALSE(0) },
42 { ATK_STATE_EXPANDABLE,CTK_CELL_RENDERER_EXPANDABLE, FALSE(0) },
43 { ATK_STATE_EXPANDED, CTK_CELL_RENDERER_EXPANDED, FALSE(0) },
44};
45
46static CtkCellRendererState ctk_cell_accessible_get_state (CtkCellAccessible *cell);
47static void atk_action_interface_init (AtkActionIface *iface);
48static void atk_component_interface_init (AtkComponentIface *iface);
49static void atk_table_cell_interface_init (AtkTableCellIface *iface);
50
51G_DEFINE_TYPE_WITH_CODE (CtkCellAccessible, ctk_cell_accessible, CTK_TYPE_ACCESSIBLE,static void ctk_cell_accessible_init (CtkCellAccessible *self
); static void ctk_cell_accessible_class_init (CtkCellAccessibleClass
*klass); static GType ctk_cell_accessible_get_type_once (void
); static gpointer ctk_cell_accessible_parent_class = ((void*
)0); static gint CtkCellAccessible_private_offset; static void
ctk_cell_accessible_class_intern_init (gpointer klass) { ctk_cell_accessible_parent_class
= g_type_class_peek_parent (klass); if (CtkCellAccessible_private_offset
!= 0) g_type_class_adjust_private_offset (klass, &CtkCellAccessible_private_offset
); ctk_cell_accessible_class_init ((CtkCellAccessibleClass*) klass
); } __attribute__ ((__unused__)) static inline gpointer ctk_cell_accessible_get_instance_private
(CtkCellAccessible *self) { return (((gpointer) ((guint8*) (
self) + (glong) (CtkCellAccessible_private_offset)))); } GType
ctk_cell_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_cell_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_cell_accessible_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((ctk_accessible_get_type ()), g_intern_static_string ("CtkCellAccessible"
), sizeof (CtkCellAccessibleClass), (GClassInitFunc)(void (*)
(void)) ctk_cell_accessible_class_intern_init, sizeof (CtkCellAccessible
), (GInstanceInitFunc)(void (*)(void)) ctk_cell_accessible_init
, (GTypeFlags) 0); { {{ CtkCellAccessible_private_offset = g_type_add_instance_private
(g_define_type_id, sizeof (CtkCellAccessiblePrivate)); } { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
)(void (*)(void)) atk_action_interface_init, ((void*)0), ((void
*)0) }; g_type_add_interface_static (g_define_type_id, (atk_action_get_type
()), &g_implement_interface_info); } { 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); } { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc)(void (*)
(void)) atk_table_cell_interface_init, ((void*)0), ((void*)0)
}; g_type_add_interface_static (g_define_type_id, (atk_table_cell_get_type
()), &g_implement_interface_info); };} } return g_define_type_id
; }
52 G_ADD_PRIVATE (CtkCellAccessible)static void ctk_cell_accessible_init (CtkCellAccessible *self
); static void ctk_cell_accessible_class_init (CtkCellAccessibleClass
*klass); static GType ctk_cell_accessible_get_type_once (void
); static gpointer ctk_cell_accessible_parent_class = ((void*
)0); static gint CtkCellAccessible_private_offset; static void
ctk_cell_accessible_class_intern_init (gpointer klass) { ctk_cell_accessible_parent_class
= g_type_class_peek_parent (klass); if (CtkCellAccessible_private_offset
!= 0) g_type_class_adjust_private_offset (klass, &CtkCellAccessible_private_offset
); ctk_cell_accessible_class_init ((CtkCellAccessibleClass*) klass
); } __attribute__ ((__unused__)) static inline gpointer ctk_cell_accessible_get_instance_private
(CtkCellAccessible *self) { return (((gpointer) ((guint8*) (
self) + (glong) (CtkCellAccessible_private_offset)))); } GType
ctk_cell_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_cell_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_cell_accessible_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((ctk_accessible_get_type ()), g_intern_static_string ("CtkCellAccessible"
), sizeof (CtkCellAccessibleClass), (GClassInitFunc)(void (*)
(void)) ctk_cell_accessible_class_intern_init, sizeof (CtkCellAccessible
), (GInstanceInitFunc)(void (*)(void)) ctk_cell_accessible_init
, (GTypeFlags) 0); { {{ CtkCellAccessible_private_offset = g_type_add_instance_private
(g_define_type_id, sizeof (CtkCellAccessiblePrivate)); } { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
)(void (*)(void)) atk_action_interface_init, ((void*)0), ((void
*)0) }; g_type_add_interface_static (g_define_type_id, (atk_action_get_type
()), &g_implement_interface_info); } { 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); } { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc)(void (*)
(void)) atk_table_cell_interface_init, ((void*)0), ((void*)0)
}; g_type_add_interface_static (g_define_type_id, (atk_table_cell_get_type
()), &g_implement_interface_info); };} } return g_define_type_id
; }
53 G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)static void ctk_cell_accessible_init (CtkCellAccessible *self
); static void ctk_cell_accessible_class_init (CtkCellAccessibleClass
*klass); static GType ctk_cell_accessible_get_type_once (void
); static gpointer ctk_cell_accessible_parent_class = ((void*
)0); static gint CtkCellAccessible_private_offset; static void
ctk_cell_accessible_class_intern_init (gpointer klass) { ctk_cell_accessible_parent_class
= g_type_class_peek_parent (klass); if (CtkCellAccessible_private_offset
!= 0) g_type_class_adjust_private_offset (klass, &CtkCellAccessible_private_offset
); ctk_cell_accessible_class_init ((CtkCellAccessibleClass*) klass
); } __attribute__ ((__unused__)) static inline gpointer ctk_cell_accessible_get_instance_private
(CtkCellAccessible *self) { return (((gpointer) ((guint8*) (
self) + (glong) (CtkCellAccessible_private_offset)))); } GType
ctk_cell_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_cell_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_cell_accessible_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((ctk_accessible_get_type ()), g_intern_static_string ("CtkCellAccessible"
), sizeof (CtkCellAccessibleClass), (GClassInitFunc)(void (*)
(void)) ctk_cell_accessible_class_intern_init, sizeof (CtkCellAccessible
), (GInstanceInitFunc)(void (*)(void)) ctk_cell_accessible_init
, (GTypeFlags) 0); { {{ CtkCellAccessible_private_offset = g_type_add_instance_private
(g_define_type_id, sizeof (CtkCellAccessiblePrivate)); } { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
)(void (*)(void)) atk_action_interface_init, ((void*)0), ((void
*)0) }; g_type_add_interface_static (g_define_type_id, (atk_action_get_type
()), &g_implement_interface_info); } { 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); } { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc)(void (*)
(void)) atk_table_cell_interface_init, ((void*)0), ((void*)0)
}; g_type_add_interface_static (g_define_type_id, (atk_table_cell_get_type
()), &g_implement_interface_info); };} } return g_define_type_id
; }
54 G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)static void ctk_cell_accessible_init (CtkCellAccessible *self
); static void ctk_cell_accessible_class_init (CtkCellAccessibleClass
*klass); static GType ctk_cell_accessible_get_type_once (void
); static gpointer ctk_cell_accessible_parent_class = ((void*
)0); static gint CtkCellAccessible_private_offset; static void
ctk_cell_accessible_class_intern_init (gpointer klass) { ctk_cell_accessible_parent_class
= g_type_class_peek_parent (klass); if (CtkCellAccessible_private_offset
!= 0) g_type_class_adjust_private_offset (klass, &CtkCellAccessible_private_offset
); ctk_cell_accessible_class_init ((CtkCellAccessibleClass*) klass
); } __attribute__ ((__unused__)) static inline gpointer ctk_cell_accessible_get_instance_private
(CtkCellAccessible *self) { return (((gpointer) ((guint8*) (
self) + (glong) (CtkCellAccessible_private_offset)))); } GType
ctk_cell_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_cell_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_cell_accessible_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((ctk_accessible_get_type ()), g_intern_static_string ("CtkCellAccessible"
), sizeof (CtkCellAccessibleClass), (GClassInitFunc)(void (*)
(void)) ctk_cell_accessible_class_intern_init, sizeof (CtkCellAccessible
), (GInstanceInitFunc)(void (*)(void)) ctk_cell_accessible_init
, (GTypeFlags) 0); { {{ CtkCellAccessible_private_offset = g_type_add_instance_private
(g_define_type_id, sizeof (CtkCellAccessiblePrivate)); } { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
)(void (*)(void)) atk_action_interface_init, ((void*)0), ((void
*)0) }; g_type_add_interface_static (g_define_type_id, (atk_action_get_type
()), &g_implement_interface_info); } { 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); } { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc)(void (*)
(void)) atk_table_cell_interface_init, ((void*)0), ((void*)0)
}; g_type_add_interface_static (g_define_type_id, (atk_table_cell_get_type
()), &g_implement_interface_info); };} } return g_define_type_id
; }
55 G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE_CELL, atk_table_cell_interface_init))static void ctk_cell_accessible_init (CtkCellAccessible *self
); static void ctk_cell_accessible_class_init (CtkCellAccessibleClass
*klass); static GType ctk_cell_accessible_get_type_once (void
); static gpointer ctk_cell_accessible_parent_class = ((void*
)0); static gint CtkCellAccessible_private_offset; static void
ctk_cell_accessible_class_intern_init (gpointer klass) { ctk_cell_accessible_parent_class
= g_type_class_peek_parent (klass); if (CtkCellAccessible_private_offset
!= 0) g_type_class_adjust_private_offset (klass, &CtkCellAccessible_private_offset
); ctk_cell_accessible_class_init ((CtkCellAccessibleClass*) klass
); } __attribute__ ((__unused__)) static inline gpointer ctk_cell_accessible_get_instance_private
(CtkCellAccessible *self) { return (((gpointer) ((guint8*) (
self) + (glong) (CtkCellAccessible_private_offset)))); } GType
ctk_cell_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_cell_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_cell_accessible_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((ctk_accessible_get_type ()), g_intern_static_string ("CtkCellAccessible"
), sizeof (CtkCellAccessibleClass), (GClassInitFunc)(void (*)
(void)) ctk_cell_accessible_class_intern_init, sizeof (CtkCellAccessible
), (GInstanceInitFunc)(void (*)(void)) ctk_cell_accessible_init
, (GTypeFlags) 0); { {{ CtkCellAccessible_private_offset = g_type_add_instance_private
(g_define_type_id, sizeof (CtkCellAccessiblePrivate)); } { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
)(void (*)(void)) atk_action_interface_init, ((void*)0), ((void
*)0) }; g_type_add_interface_static (g_define_type_id, (atk_action_get_type
()), &g_implement_interface_info); } { 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); } { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc)(void (*)
(void)) atk_table_cell_interface_init, ((void*)0), ((void*)0)
}; g_type_add_interface_static (g_define_type_id, (atk_table_cell_get_type
()), &g_implement_interface_info); };} } return g_define_type_id
; }
56
57static gint
58ctk_cell_accessible_get_index_in_parent (AtkObject *obj)
59{
60 CtkCellAccessible *cell;
61 AtkObject *parent;
62
63 cell = CTK_CELL_ACCESSIBLE (obj)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((obj)), ((ctk_cell_accessible_get_type ()))
))))
;
64
65 if (CTK_IS_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(cell->priv->parent)); GType __t = ((ctk_container_cell_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; }))))
)
66 return g_list_index (ctk_container_cell_accessible_get_children (CTK_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent)((((CtkContainerCellAccessible*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((cell->priv->parent)), ((ctk_container_cell_accessible_get_type
()))))))
), obj);
67
68 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
69 if (parent == NULL((void*)0))
70 return -1;
71
72 return ctk_cell_accessible_parent_get_child_index (CTK_CELL_ACCESSIBLE_PARENT (cell->priv->parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((cell->priv->parent)), ((ctk_cell_accessible_parent_get_type
())))))
, cell);
73}
74
75static AtkRelationSet *
76ctk_cell_accessible_ref_relation_set (AtkObject *object)
77{
78 CtkCellAccessible *cell;
79 AtkRelationSet *relationset;
80 AtkObject *parent;
81
82 relationset = ATK_OBJECT_CLASS (ctk_cell_accessible_parent_class)((((AtkObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((ctk_cell_accessible_parent_class)), ((atk_object_get_type
()))))))
->ref_relation_set (object);
83 if (relationset == NULL((void*)0))
84 relationset = atk_relation_set_new ();
85
86 cell = CTK_CELL_ACCESSIBLE (object)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((object)), ((ctk_cell_accessible_get_type (
)))))))
;
87 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
88
89 ctk_cell_accessible_parent_update_relationset (CTK_CELL_ACCESSIBLE_PARENT (parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((parent)), ((ctk_cell_accessible_parent_get_type
())))))
,
90 cell,
91 relationset);
92
93 return relationset;
94}
95
96static AtkStateSet *
97ctk_cell_accessible_ref_state_set (AtkObject *accessible)
98{
99 CtkCellAccessible *cell_accessible;
100 AtkStateSet *state_set;
101 CtkCellRendererState flags;
102 guint i;
103
104 cell_accessible = CTK_CELL_ACCESSIBLE (accessible)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((accessible)), ((ctk_cell_accessible_get_type
()))))))
;
105
106 state_set = atk_state_set_new ();
107
108 if (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell_accessible)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell_accessible)), ((ctk_accessible_get_type ()))))))
) == NULL((void*)0))
109 {
110 atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
111 return state_set;
112 }
113
114 flags = ctk_cell_accessible_get_state (cell_accessible);
115
116 atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
117 atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
118 atk_state_set_add_state (state_set, ATK_STATE_TRANSIENT);
119 atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);
120
121 for (i = 0; i < G_N_ELEMENTS (state_map)(sizeof (state_map) / sizeof ((state_map)[0])); i++)
122 {
123 if (flags & state_map[i].renderer_state)
124 {
125 if (!state_map[i].invert)
126 atk_state_set_add_state (state_set, state_map[i].atk_state);
127 }
128 else
129 {
130 if (state_map[i].invert)
131 atk_state_set_add_state (state_set, state_map[i].atk_state);
132 }
133 }
134
135 if (ctk_widget_get_mapped (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell_accessible)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell_accessible)), ((ctk_accessible_get_type ()))))))
)))
136 atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
137
138 return state_set;
139}
140
141static AtkObject *
142ctk_cell_accessible_get_parent (AtkObject *object)
143{
144 CtkCellAccessible *cell = CTK_CELL_ACCESSIBLE (object)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((object)), ((ctk_cell_accessible_get_type (
)))))))
;
145
146 return cell->priv->parent;
147}
148
149static void
150ctk_cell_accessible_class_init (CtkCellAccessibleClass *klass)
151{
152 AtkObjectClass *class = ATK_OBJECT_CLASS (klass)((((AtkObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), ((atk_object_get_type ()))))))
;
153
154 class->get_index_in_parent = ctk_cell_accessible_get_index_in_parent;
155 class->ref_state_set = ctk_cell_accessible_ref_state_set;
156 class->ref_relation_set = ctk_cell_accessible_ref_relation_set;
157 class->get_parent = ctk_cell_accessible_get_parent;
158}
159
160static void
161ctk_cell_accessible_init (CtkCellAccessible *cell)
162{
163 cell->priv = ctk_cell_accessible_get_instance_private (cell);
164}
165
166void
167_ctk_cell_accessible_initialize (CtkCellAccessible *cell,
168 CtkWidget *widget,
169 AtkObject *parent)
170{
171 ctk_accessible_set_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
, widget);
172 cell->priv->parent = parent;
173}
174
175gboolean
176_ctk_cell_accessible_add_state (CtkCellAccessible *cell,
177 AtkStateType state_type,
178 gboolean emit_signal)
179{
180 /* The signal should only be generated if the value changed,
181 * not when the cell is set up. So states that are set
182 * initially should pass FALSE as the emit_signal argument.
183 */
184 if (emit_signal)
185 {
186 atk_object_notify_state_change (ATK_OBJECT (cell)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((atk_object_get_type ()))))))
, state_type, TRUE(!(0)));
187 /* If state_type is ATK_STATE_VISIBLE, additional notification */
188 if (state_type == ATK_STATE_VISIBLE)
189 g_signal_emit_by_name (cell, "visible-data-changed");
190 }
191
192 /* If the parent is a flyweight container cell, propagate the state
193 * change to it also
194 */
195 if (CTK_IS_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(cell->priv->parent)); GType __t = ((ctk_container_cell_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; }))))
)
196 _ctk_cell_accessible_add_state (CTK_CELL_ACCESSIBLE (cell->priv->parent)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((cell->priv->parent)), ((ctk_cell_accessible_get_type
()))))))
, state_type, emit_signal);
197
198 return TRUE(!(0));
199}
200
201gboolean
202_ctk_cell_accessible_remove_state (CtkCellAccessible *cell,
203 AtkStateType state_type,
204 gboolean emit_signal)
205{
206 /* The signal should only be generated if the value changed,
207 * not when the cell is set up. So states that are set
208 * initially should pass FALSE as the emit_signal argument.
209 */
210 if (emit_signal)
211 {
212 atk_object_notify_state_change (ATK_OBJECT (cell)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((atk_object_get_type ()))))))
, state_type, FALSE(0));
213 /* If state_type is ATK_STATE_VISIBLE, additional notification */
214 if (state_type == ATK_STATE_VISIBLE)
215 g_signal_emit_by_name (cell, "visible-data-changed");
216 }
217
218 /* If the parent is a flyweight container cell, propagate the state
219 * change to it also
220 */
221 if (CTK_IS_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(cell->priv->parent)); GType __t = ((ctk_container_cell_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; }))))
)
222 _ctk_cell_accessible_remove_state (CTK_CELL_ACCESSIBLE (cell->priv->parent)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((cell->priv->parent)), ((ctk_cell_accessible_get_type
()))))))
, state_type, emit_signal);
223
224 return TRUE(!(0));
225}
226
227static gint
228ctk_cell_accessible_action_get_n_actions (AtkAction *action G_GNUC_UNUSED__attribute__ ((__unused__)))
229{
230 return 3;
231}
232
233static const gchar *
234ctk_cell_accessible_action_get_name (AtkAction *action G_GNUC_UNUSED__attribute__ ((__unused__)),
235 gint index)
236{
237 switch (index)
238 {
239 case 0:
240 return "expand or contract";
241 case 1:
242 return "edit";
243 case 2:
244 return "activate";
245 default:
246 return NULL((void*)0);
247 }
248}
249
250static const gchar *
251ctk_cell_accessible_action_get_localized_name (AtkAction *action G_GNUC_UNUSED__attribute__ ((__unused__)),
252 gint index)
253{
254 switch (index)
255 {
256 case 0:
257 return C_("Action name", "Expand or contract")g_dpgettext ("ctk30", "Action name" "\004" "Expand or contract"
, strlen ("Action name") + 1)
;
258 case 1:
259 return C_("Action name", "Edit")g_dpgettext ("ctk30", "Action name" "\004" "Edit", strlen ("Action name"
) + 1)
;
260 case 2:
261 return C_("Action name", "Activate")g_dpgettext ("ctk30", "Action name" "\004" "Activate", strlen
("Action name") + 1)
;
262 default:
263 return NULL((void*)0);
264 }
265}
266
267static const gchar *
268ctk_cell_accessible_action_get_description (AtkAction *action G_GNUC_UNUSED__attribute__ ((__unused__)),
269 gint index)
270{
271 switch (index)
272 {
273 case 0:
274 return C_("Action description", "Expands or contracts the row in the tree view containing this cell")g_dpgettext ("ctk30", "Action description" "\004" "Expands or contracts the row in the tree view containing this cell"
, strlen ("Action description") + 1)
;
275 case 1:
276 return C_("Action description", "Creates a widget in which the contents of the cell can be edited")g_dpgettext ("ctk30", "Action description" "\004" "Creates a widget in which the contents of the cell can be edited"
, strlen ("Action description") + 1)
;
277 case 2:
278 return C_("Action description", "Activates the cell")g_dpgettext ("ctk30", "Action description" "\004" "Activates the cell"
, strlen ("Action description") + 1)
;
279 default:
280 return NULL((void*)0);
281 }
282}
283
284static const gchar *
285ctk_cell_accessible_action_get_keybinding (AtkAction *action G_GNUC_UNUSED__attribute__ ((__unused__)),
286 gint index G_GNUC_UNUSED__attribute__ ((__unused__)))
287{
288 return NULL((void*)0);
289}
290
291static gboolean
292ctk_cell_accessible_action_do_action (AtkAction *action,
293 gint index)
294{
295 CtkCellAccessible *cell = CTK_CELL_ACCESSIBLE (action)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((action)), ((ctk_cell_accessible_get_type (
)))))))
;
Value stored to 'cell' during its initialization is never read
296 CtkCellAccessibleParent *parent;
297
298 cell = CTK_CELL_ACCESSIBLE (action)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((action)), ((ctk_cell_accessible_get_type (
)))))))
;
299 if (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
) == NULL((void*)0))
300 return FALSE(0);
301
302 parent = CTK_CELL_ACCESSIBLE_PARENT (ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell))))(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((ctk_widget_get_accessible (ctk_accessible_get_widget
(((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ())))))))))), ((ctk_cell_accessible_parent_get_type
())))))
;
303
304 switch (index)
305 {
306 case 0:
307 ctk_cell_accessible_parent_expand_collapse (parent, cell);
308 break;
309 case 1:
310 ctk_cell_accessible_parent_edit (parent, cell);
311 break;
312 case 2:
313 ctk_cell_accessible_parent_activate (parent, cell);
314 break;
315 default:
316 return FALSE(0);
317 }
318
319 return TRUE(!(0));
320}
321
322static void
323atk_action_interface_init (AtkActionIface *iface)
324{
325 iface->get_n_actions = ctk_cell_accessible_action_get_n_actions;
326 iface->do_action = ctk_cell_accessible_action_do_action;
327 iface->get_name = ctk_cell_accessible_action_get_name;
328 iface->get_localized_name = ctk_cell_accessible_action_get_localized_name;
329 iface->get_description = ctk_cell_accessible_action_get_description;
330 iface->get_keybinding = ctk_cell_accessible_action_get_keybinding;
331}
332
333static void
334ctk_cell_accessible_get_extents (AtkComponent *component,
335 gint *x,
336 gint *y,
337 gint *width,
338 gint *height,
339 AtkCoordType coord_type)
340{
341 CtkCellAccessible *cell;
342 AtkObject *parent;
343
344 cell = CTK_CELL_ACCESSIBLE (component)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((component)), ((ctk_cell_accessible_get_type
()))))))
;
345 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
346
347 ctk_cell_accessible_parent_get_cell_extents (CTK_CELL_ACCESSIBLE_PARENT (parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((parent)), ((ctk_cell_accessible_parent_get_type
())))))
,
348 cell,
349 x, y, width, height, coord_type);
350}
351
352static gboolean
353ctk_cell_accessible_grab_focus (AtkComponent *component)
354{
355 CtkCellAccessible *cell;
356 AtkObject *parent;
357
358 cell = CTK_CELL_ACCESSIBLE (component)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((component)), ((ctk_cell_accessible_get_type
()))))))
;
359 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
360
361 return ctk_cell_accessible_parent_grab_focus (CTK_CELL_ACCESSIBLE_PARENT (parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((parent)), ((ctk_cell_accessible_parent_get_type
())))))
, cell);
362}
363
364static void
365atk_component_interface_init (AtkComponentIface *iface)
366{
367 iface->get_extents = ctk_cell_accessible_get_extents;
368 iface->grab_focus = ctk_cell_accessible_grab_focus;
369}
370
371static int
372ctk_cell_accessible_get_column_span (AtkTableCell *table_cell G_GNUC_UNUSED__attribute__ ((__unused__)))
373{
374 return 1;
375}
376
377static GPtrArray *
378ctk_cell_accessible_get_column_header_cells (AtkTableCell *table_cell)
379{
380 CtkCellAccessible *cell;
381 AtkObject *parent;
382
383 cell = CTK_CELL_ACCESSIBLE (table_cell)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((table_cell)), ((ctk_cell_accessible_get_type
()))))))
;
384 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
385
386 return ctk_cell_accessible_parent_get_column_header_cells (CTK_CELL_ACCESSIBLE_PARENT (parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((parent)), ((ctk_cell_accessible_parent_get_type
())))))
,
387 cell);
388}
389
390static gboolean
391ctk_cell_accessible_get_position (AtkTableCell *table_cell,
392 gint *row,
393 gint *column)
394{
395 CtkCellAccessible *cell;
396 AtkObject *parent;
397
398 cell = CTK_CELL_ACCESSIBLE (table_cell)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((table_cell)), ((ctk_cell_accessible_get_type
()))))))
;
399 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
400
401 ctk_cell_accessible_parent_get_cell_position (CTK_CELL_ACCESSIBLE_PARENT (parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((parent)), ((ctk_cell_accessible_parent_get_type
())))))
,
402 cell,
403 row, column);
404 return ((row && *row > 0) || (column && *column > 0));
405}
406
407static int
408ctk_cell_accessible_get_row_span (AtkTableCell *table_cell G_GNUC_UNUSED__attribute__ ((__unused__)))
409{
410 return 1;
411}
412
413static GPtrArray *
414ctk_cell_accessible_get_row_header_cells (AtkTableCell *table_cell)
415{
416 CtkCellAccessible *cell;
417 AtkObject *parent;
418
419 cell = CTK_CELL_ACCESSIBLE (table_cell)((((CtkCellAccessible*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((table_cell)), ((ctk_cell_accessible_get_type
()))))))
;
420 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
421
422 return ctk_cell_accessible_parent_get_row_header_cells (CTK_CELL_ACCESSIBLE_PARENT (parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((parent)), ((ctk_cell_accessible_parent_get_type
())))))
,
423 cell);
424}
425
426static AtkObject *
427ctk_cell_accessible_get_table (AtkTableCell *table_cell)
428{
429 AtkObject *obj;
430
431 obj = ATK_OBJECT (table_cell)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((table_cell)), ((atk_object_get_type ()))))))
;
432 do
433 {
434 AtkRole role;
435 obj = atk_object_get_parent (obj);
436 role = atk_object_get_role (obj);
437 if (role == ATK_ROLE_TABLE || role == ATK_ROLE_TREE_TABLE)
438 break;
439 }
440 while (obj);
441 return obj;
442}
443
444static void
445atk_table_cell_interface_init (AtkTableCellIface *iface)
446{
447 iface->get_column_span = ctk_cell_accessible_get_column_span;
448 iface->get_column_header_cells = ctk_cell_accessible_get_column_header_cells;
449 iface->get_position = ctk_cell_accessible_get_position;
450 iface->get_row_span = ctk_cell_accessible_get_row_span;
451 iface->get_row_header_cells = ctk_cell_accessible_get_row_header_cells;
452 iface->get_table = ctk_cell_accessible_get_table;
453}
454
455static CtkCellRendererState
456ctk_cell_accessible_get_state (CtkCellAccessible *cell)
457{
458 AtkObject *parent;
459
460 g_return_val_if_fail (CTK_IS_CELL_ACCESSIBLE (cell), 0)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((cell)); GType __t = ((ctk_cell_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 ("Ctk", ((const char
*) (__func__)), "CTK_IS_CELL_ACCESSIBLE (cell)"); return (0);
} } while (0)
;
461
462 parent = ctk_widget_get_accessible (ctk_accessible_get_widget (CTK_ACCESSIBLE (cell)((((CtkAccessible*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((ctk_accessible_get_type ()))))))
));
463 if (parent == NULL((void*)0))
464 return 0;
465
466 return ctk_cell_accessible_parent_get_renderer_state (CTK_CELL_ACCESSIBLE_PARENT (parent)(((CtkCellAccessibleParent*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((parent)), ((ctk_cell_accessible_parent_get_type
())))))
, cell);
467}
468
469/*
470 * ctk_cell_accessible_state_changed:
471 * @cell: a #CtkCellAccessible
472 * @added: the flags that were added from @cell
473 * @removed: the flags that were removed from @cell
474 *
475 * Notifies @cell of state changes. Multiple states may be added
476 * or removed at the same time. A state that is @added may not be
477 * @removed at the same time.
478 **/
479void
480_ctk_cell_accessible_state_changed (CtkCellAccessible *cell,
481 CtkCellRendererState added,
482 CtkCellRendererState removed)
483{
484 AtkObject *object;
485 guint i;
486
487 g_return_if_fail (CTK_IS_CELL_ACCESSIBLE (cell))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((cell)); GType __t = ((ctk_cell_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 ("Ctk", ((const char
*) (__func__)), "CTK_IS_CELL_ACCESSIBLE (cell)"); return; } }
while (0)
;
488 g_return_if_fail ((added & removed) == 0)do { if (((added & removed) == 0)) { } else { g_return_if_fail_warning
("Ctk", ((const char*) (__func__)), "(added & removed) == 0"
); return; } } while (0)
;
489
490 object = ATK_OBJECT (cell)((((AtkObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cell)), ((atk_object_get_type ()))))))
;
491
492 for (i = 0; i < G_N_ELEMENTS (state_map)(sizeof (state_map) / sizeof ((state_map)[0])); i++)
493 {
494 if (added & state_map[i].renderer_state)
495 atk_object_notify_state_change (object,
496 state_map[i].atk_state,
497 !state_map[i].invert);
498 if (removed & state_map[i].renderer_state)
499 atk_object_notify_state_change (object,
500 state_map[i].atk_state,
501 state_map[i].invert);
502 }
503}
504
505/*
506 * ctk_cell_accessible_update_cache:
507 * @cell: the cell that is changed
508 * @emit_signal: whether or not to notify the ATK bridge
509 *
510 * Notifies the cell that the values in the data in the row that
511 * is used to feed the cell renderer with has changed. The
512 * cell_changed function of @cell is called to send update
513 * notifications for the properties it takes from its cell
514 * renderer. If @emit_signal is TRUE, also notify the ATK bridge
515 * of the change. The bridge should be notified when an existing
516 * cell changes; not when a newly-created cell is being set up.
517 *
518 * Note that there is no higher granularity available about which
519 * properties changed, so you will need to make do with this
520 * function.
521 **/
522void
523_ctk_cell_accessible_update_cache (CtkCellAccessible *cell,
524 gboolean emit_signal)
525{
526 CtkCellAccessibleClass *klass;
527
528 g_return_if_fail (CTK_CELL_ACCESSIBLE (cell))do { if ((((((CtkCellAccessible*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((cell)), ((ctk_cell_accessible_get_type (
))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const
char*) (__func__)), "CTK_CELL_ACCESSIBLE (cell)"); return; }
} while (0)
;
529
530 klass = CTK_CELL_ACCESSIBLE_GET_CLASS (cell)((((CtkCellAccessibleClass*) (((GTypeInstance*) ((cell)))->
g_class))))
;
531
532 if (klass->update_cache)
533 klass->update_cache (cell, emit_signal);
534}