Convert GailTreeView to GtkTreeViewAccessible

Mostly code rearrangement and cleanup, but also a memory
leak fix in gtk_tree_view_accessible_get_column_description().
This commit is contained in:
Matthias Clasen 2011-06-29 20:50:50 -04:00
parent b0915a69de
commit 6012f096c9
7 changed files with 1431 additions and 1781 deletions

View File

@ -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

View File

@ -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);

View File

@ -1,70 +0,0 @@
/* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GAIL_TREE_VIEW_H__
#define __GAIL_TREE_VIEW_H__
#include <gtk/gtk.h>
#include "gailcontainer.h"
#include "gailcell.h"
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))
typedef struct _GailTreeView GailTreeView;
typedef struct _GailTreeViewClass GailTreeViewClass;
struct _GailTreeView
{
GailContainer parent;
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;
GtkTreePath *idle_expand_path;
gboolean garbage_collection_pending;
};
GType gail_tree_view_get_type (void);
struct _GailTreeViewClass
{
GailContainerClass parent_class;
};
AtkObject* gail_tree_view_ref_focus_cell (GtkTreeView *treeview);
G_END_DECLS
#endif /* __GAIL_TREE_VIEW_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
/* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_VIEW_ACCESSIBLE_H__
#define __GTK_TREE_VIEW_ACCESSIBLE_H__
#include <gtk/gtk.h>
#include "gailcontainer.h"
#include "gailcell.h"
G_BEGIN_DECLS
#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 _GtkTreeViewAccessible GtkTreeViewAccessible;
typedef struct _GtkTreeViewAccessibleClass GtkTreeViewAccessibleClass;
struct _GtkTreeViewAccessible
{
GailContainer parent;
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;
GtkTreePath *idle_expand_path;
gboolean garbage_collection_pending;
};
struct _GtkTreeViewAccessibleClass
{
GailContainerClass parent_class;
};
GType gtk_tree_view_accessible_get_type (void);
AtkObject *gtk_tree_view_accessible_ref_focus_cell (GtkTreeView *treeview);
G_END_DECLS
#endif /* __GTK_TREE_VIEW_ACCESSIBLE_H__ */

View File

@ -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

View File

@ -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>