Commit 6012f096 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Convert GailTreeView to GtkTreeViewAccessible

Mostly code rearrangement and cleanup, but also a memory
leak fix in gtk_tree_view_accessible_get_column_description().
parent b0915a69
......@@ -46,7 +46,7 @@ gail_c_sources = \
gtktextviewaccessible.c \
gtktogglebuttonaccessible.c \
gailtoplevel.c \
gailtreeview.c \
gtktreeviewaccessible.c \
gailutil.c \
gailwidget.c \
gailwindow.c
......@@ -97,7 +97,7 @@ gail_private_h_sources = \
gtktextviewaccessible.h \
gtktogglebuttonaccessible.h \
gailtoplevel.h \
gailtreeview.h \
gtktreeviewaccessible.h \
gailutil.h \
gailwindow.h
......
......@@ -40,7 +40,6 @@
#include "gailstatusbar.h"
#include "gailtextcell.h"
#include "gailtoplevel.h"
#include "gailtreeview.h"
#include "gailutil.h"
#include "gailwidget.h"
#include "gailwindow.h"
......@@ -100,7 +99,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU, GailMenu, gail_menu, GTK_TYPE_MENU)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WINDOW, GailWindow, gail_window, GTK_TYPE_BIN)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_CHECK_MENU_ITEM, GailCheckMenuItem, gail_check_menu_item, gail_check_menu_item_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_RADIO_MENU_ITEM, GailRadioMenuItem, gail_radio_menu_item, gail_radio_menu_item_new)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_EXPANDER, GailExpander, gail_expander, GTK_TYPE_EXPANDER)
......@@ -857,7 +855,6 @@ gail_accessibility_module_init (void)
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WINDOW, gail_window);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_STATUSBAR, gail_statusbar);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_NOTEBOOK, gail_notebook);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_TREE_VIEW, gail_tree_view);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
......
......@@ -17,8 +17,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GAIL_TREE_VIEW_H__
#define __GAIL_TREE_VIEW_H__
#ifndef __GTK_TREE_VIEW_ACCESSIBLE_H__
#define __GTK_TREE_VIEW_ACCESSIBLE_H__
#include <gtk/gtk.h>
#include "gailcontainer.h"
......@@ -26,45 +26,44 @@
G_BEGIN_DECLS
#define GAIL_TYPE_TREE_VIEW (gail_tree_view_get_type ())
#define GAIL_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_TREE_VIEW, GailTreeView))
#define GAIL_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_TREE_VIEW, GailTreeViewClass))
#define GAIL_IS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_TREE_VIEW))
#define GAIL_IS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_TREE_VIEW))
#define GAIL_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_TREE_VIEW, GailTreeViewClass))
#define GTK_TYPE_TREE_VIEW_ACCESSIBLE (gtk_tree_view_accessible_get_type ())
#define GTK_TREE_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_VIEW_ACCESSIBLE, GtkTreeViewAccessible))
#define GTK_TREE_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW_ACCESSIBLE, GtkTreeViewAccessibleClass))
#define GTK_IS_TREE_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_VIEW_ACCESSIBLE))
#define GTK_IS_TREE_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW_ACCESSIBLE))
#define GTK_TREE_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW_ACCESSIBLE, GtkTreeViewAccessibleClass))
typedef struct _GailTreeView GailTreeView;
typedef struct _GailTreeViewClass GailTreeViewClass;
typedef struct _GtkTreeViewAccessible GtkTreeViewAccessible;
typedef struct _GtkTreeViewAccessibleClass GtkTreeViewAccessibleClass;
struct _GailTreeView
struct _GtkTreeViewAccessible
{
GailContainer parent;
gint n_children_deleted;
gint n_rows;
gint n_cols;
GArray* col_data;
gint n_children_deleted;
gint n_rows;
gint n_cols;
GArray* col_data;
GHashTable *cell_info_by_index;
GtkTreeModel *tree_model;
AtkObject *focus_cell;
GtkAdjustment *old_hadj;
GtkAdjustment *old_vadj;
guint idle_expand_id;
guint idle_garbage_collect_id;
guint idle_cursor_changed_id;
guint idle_expand_id;
guint idle_garbage_collect_id;
guint idle_cursor_changed_id;
GtkTreePath *idle_expand_path;
gboolean garbage_collection_pending;
gboolean garbage_collection_pending;
};
GType gail_tree_view_get_type (void);
struct _GailTreeViewClass
struct _GtkTreeViewAccessibleClass
{
GailContainerClass parent_class;
};
AtkObject* gail_tree_view_ref_focus_cell (GtkTreeView *treeview);
GType gtk_tree_view_accessible_get_type (void);
AtkObject *gtk_tree_view_accessible_ref_focus_cell (GtkTreeView *treeview);
G_END_DECLS
#endif /* __GAIL_TREE_VIEW_H__ */
#endif /* __GTK_TREE_VIEW_ACCESSIBLE_H__ */
......@@ -50,6 +50,7 @@
#include "gtkentryprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtktypebuiltins.h"
#include "a11y/gtktreeviewaccessible.h"
/**
......@@ -1695,6 +1696,8 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
gtk_binding_entry_add_signal (binding_set, GDK_KEY_F, GDK_CONTROL_MASK, "start-interactive-search", 0);
g_type_class_add_private (o_class, sizeof (GtkTreeViewPrivate));
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_TREE_VIEW_ACCESSIBLE);
}
static void
......
......@@ -91,7 +91,7 @@ window1
<AtkComponent>
layer: widget
alpha: 1
unnamed-GailTreeView-5
unnamed-GtkTreeViewAccessible-5
"table"
parent: unnamed-GtkScrolledWindowAccessible-4
index: 0
......@@ -108,7 +108,7 @@ window1
<column 0 header>
"table column header"
parent: unnamed-GailTreeView-5
parent: unnamed-GtkTreeViewAccessible-5
index: 0
name:
state: enabled focusable selectable sensitive
......@@ -154,7 +154,7 @@ window1
action 0 name: click
"table column header"
parent: unnamed-GailTreeView-5
parent: unnamed-GtkTreeViewAccessible-5
index: 0
name:
state: enabled focusable selectable sensitive
......@@ -200,7 +200,7 @@ window1
action 0 name: click
unnamed-GailContainerCell-6
"table cell"
parent: unnamed-GailTreeView-5
parent: unnamed-GtkTreeViewAccessible-5
index: 1
state: enabled focusable focused selectable sensitive transient visible
<AtkComponent>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment