6 static gint _test_paned (gpointer data);
7 static void _check_paned (AtkObject *obj);
9 static void _property_change_handler (AtkObject *obj,
10 AtkPropertyValues *values);
12 #define NUM_VALID_ROLES 1
13 static gint last_position;
15 static void _property_change_handler (AtkObject *obj,
16 AtkPropertyValues *values)
18 G_CONST_RETURN gchar *type_name = g_type_name (G_TYPE_FROM_INSTANCE (obj));
19 G_CONST_RETURN gchar *name = atk_object_get_name (obj);
21 g_print ("_property_change_handler: Accessible Type: %s\n",
22 type_name ? type_name : "NULL");
23 g_print ("_property_change_handler: Accessible name: %s\n",
24 name ? name : "NULL");
25 g_print ("_property_change_handler: PropertyName: %s\n",
26 values->property_name ? values->property_name: "NULL");
27 if (strcmp (values->property_name, "accessible-value") == 0)
33 memset (value, 0, sizeof (GValue));
34 atk_value_get_current_value (ATK_VALUE (obj), value);
35 g_return_if_fail (G_VALUE_HOLDS_INT (value));
36 position = g_value_get_int (value);
37 g_print ("Position is %d previous position was %d\n",
38 position, last_position);
39 last_position = position;
40 atk_value_get_minimum_value (ATK_VALUE (obj), value);
41 g_return_if_fail (G_VALUE_HOLDS_INT (value));
42 position = g_value_get_int (value);
43 g_print ("Minimum Value is %d\n", position);
44 atk_value_get_maximum_value (ATK_VALUE (obj), value);
45 g_return_if_fail (G_VALUE_HOLDS_INT (value));
46 position = g_value_get_int (value);
47 g_print ("Maximum Value is %d\n", position);
51 static gint _test_paned (gpointer data)
53 AtkObject *obj = ATK_OBJECT (data);
54 AtkRole role = atk_object_get_role (obj);
55 static gint times = 0;
57 if (role == ATK_ROLE_SPLIT_PANE)
63 memset (value, 0, sizeof (GValue));
64 atk_value_get_current_value (ATK_VALUE (obj), value);
65 g_return_val_if_fail (G_VALUE_HOLDS_INT (value), FALSE);
66 position = g_value_get_int (value);
67 g_print ("Position is : %d\n", position);
68 last_position = position;
70 g_value_set_int (value, position);
71 atk_value_set_current_value (ATK_VALUE (obj), value);
80 static void _check_paned (AtkObject *obj)
82 static gboolean done_paned = FALSE;
85 role = atk_object_get_role (obj);
87 if (role == ATK_ROLE_FRAME)
89 AtkRole roles[NUM_VALID_ROLES];
95 roles[0] = ATK_ROLE_SPLIT_PANE;
97 paned_obj = find_object_by_role (obj, roles, NUM_VALID_ROLES);
105 atk_object_connect_property_change_handler (paned_obj,
106 (AtkPropertyChangeHandler*) _property_change_handler);
107 g_timeout_add (2000, _test_paned, paned_obj);
112 if (role != ATK_ROLE_COMBO_BOX)
117 _create_event_watcher (void)
119 atk_add_focus_tracker (_check_paned);
123 gtk_module_init(gint argc, char* argv[])
125 g_print("testpaned Module loaded\n");
127 _create_event_watcher();