[gtk+] Convert GailCellParent to GtkCellAccessibleParent
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Convert GailCellParent to GtkCellAccessibleParent
- Date: Sun, 10 Jul 2011 03:58:27 +0000 (UTC)
commit ddfa756ac702c996e54802ce38b6173b7c6ad151
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 9 23:56:42 2011 -0400
Convert GailCellParent to GtkCellAccessibleParent
gtk/a11y/Makefile.am | 4 +-
gtk/a11y/gailcellparent.h | 84 --------------------
gtk/a11y/gtkcellaccessible.c | 9 +-
...{gailcellparent.c => gtkcellaccessibleparent.c} | 50 ++++++------
gtk/a11y/gtkcellaccessibleparent.h | 80 +++++++++++++++++++
gtk/a11y/gtktextcellaccessible.c | 16 ++--
gtk/a11y/gtktextcellaccessible.h | 2 +-
gtk/a11y/gtktreeviewaccessible.c | 39 +++++-----
8 files changed, 142 insertions(+), 142 deletions(-)
---
diff --git a/gtk/a11y/Makefile.am b/gtk/a11y/Makefile.am
index 5b16442..4d31bce 100644
--- a/gtk/a11y/Makefile.am
+++ b/gtk/a11y/Makefile.am
@@ -9,7 +9,7 @@ gail_c_sources = \
gtkboxaccessible.c \
gtkbuttonaccessible.c \
gtkcellaccessible.c \
- gailcellparent.c \
+ gtkcellaccessibleparent.c \
gtkcheckmenuitemaccessible.c \
gtkchecksubmenuitemaccessible.c \
gtkcomboboxaccessible.c \
@@ -61,7 +61,7 @@ gail_private_h_sources = \
gtkboxaccessible.h \
gtkbuttonaccessible.h \
gtkcellaccessible.h \
- gailcellparent.h \
+ gtkcellaccessibleparent.h \
gtkcheckmenuitemaccessible.h \
gtkchecksubmenuitemaccessible.h \
gtkcomboboxaccessible.h \
diff --git a/gtk/a11y/gtkcellaccessible.c b/gtk/a11y/gtkcellaccessible.c
index 6d12d60..a526023 100644
--- a/gtk/a11y/gtkcellaccessible.c
+++ b/gtk/a11y/gtkcellaccessible.c
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
#include "gtkcontainercellaccessible.h"
#include "gtkcellaccessible.h"
-#include "gailcellparent.h"
+#include "gtkcellaccessibleparent.h"
typedef struct _ActionInfo ActionInfo;
struct _ActionInfo {
@@ -399,8 +399,9 @@ gtk_cell_accessible_get_extents (AtkComponent *component,
cell = GTK_CELL_ACCESSIBLE (component);
parent = gtk_widget_get_accessible (cell->widget);
- gail_cell_parent_get_cell_extents (GAIL_CELL_PARENT (parent),
- cell, x, y, width, height, coord_type);
+ _gtk_cell_accessible_parent_get_cell_extents (GTK_CELL_ACCESSIBLE_PARENT (parent),
+ cell,
+ x, y, width, height, coord_type);
}
static gboolean
@@ -412,7 +413,7 @@ gtk_cell_accessible_grab_focus (AtkComponent *component)
cell = GTK_CELL_ACCESSIBLE (component);
parent = gtk_widget_get_accessible (cell->widget);
- return gail_cell_parent_grab_focus (GAIL_CELL_PARENT (parent), cell);
+ return _gtk_cell_accessible_parent_grab_focus (GTK_CELL_ACCESSIBLE_PARENT (parent), cell);
}
static void
diff --git a/gtk/a11y/gailcellparent.c b/gtk/a11y/gtkcellaccessibleparent.c
similarity index 52%
rename from gtk/a11y/gailcellparent.c
rename to gtk/a11y/gtkcellaccessibleparent.c
index f63eaba..b63e5af 100644
--- a/gtk/a11y/gailcellparent.c
+++ b/gtk/a11y/gtkcellaccessibleparent.c
@@ -21,10 +21,10 @@
#include "config.h"
#include <gtk/gtk.h>
-#include "gailcellparent.h"
+#include "gtkcellaccessibleparent.h"
GType
-gail_cell_parent_get_type (void)
+_gtk_cell_accessible_parent_get_type (void)
{
static volatile gsize g_define_type_id__volatile = 0;
@@ -32,8 +32,8 @@ gail_cell_parent_get_type (void)
{
GType g_define_type_id =
g_type_register_static_simple (G_TYPE_INTERFACE,
- "GailCellParent",
- sizeof (GailCellParentIface),
+ "GtkCellAccessibleParent",
+ sizeof (GtkCellAccessibleParentIface),
NULL,
0,
NULL,
@@ -46,49 +46,49 @@ gail_cell_parent_get_type (void)
}
void
-gail_cell_parent_get_cell_extents (GailCellParent *parent,
- GtkCellAccessible *cell,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
+_gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ AtkCoordType coord_type)
{
- GailCellParentIface *iface;
+ GtkCellAccessibleParentIface *iface;
- g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
+ g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- iface = GAIL_CELL_PARENT_GET_IFACE (parent);
+ iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_cell_extents)
(iface->get_cell_extents) (parent, cell, x, y, width, height, coord_type);
}
void
-gail_cell_parent_get_cell_area (GailCellParent *parent,
- GtkCellAccessible *cell,
- GdkRectangle *cell_rect)
+_gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ GdkRectangle *cell_rect)
{
- GailCellParentIface *iface;
+ GtkCellAccessibleParentIface *iface;
- g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
+ g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (cell_rect);
- iface = GAIL_CELL_PARENT_GET_IFACE (parent);
+ iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_cell_area)
(iface->get_cell_area) (parent, cell, cell_rect);
}
gboolean
-gail_cell_parent_grab_focus (GailCellParent *parent,
- GtkCellAccessible *cell)
+_gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell)
{
- GailCellParentIface *iface;
+ GtkCellAccessibleParentIface *iface;
- g_return_val_if_fail (GAIL_IS_CELL_PARENT (parent), FALSE);
+ g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
- iface = GAIL_CELL_PARENT_GET_IFACE (parent);
+ iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->grab_focus)
return (iface->grab_focus) (parent, cell);
diff --git a/gtk/a11y/gtkcellaccessibleparent.h b/gtk/a11y/gtkcellaccessibleparent.h
new file mode 100644
index 0000000..7969a8b
--- /dev/null
+++ b/gtk/a11y/gtkcellaccessibleparent.h
@@ -0,0 +1,80 @@
+/* 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_CELL_ACCESSIBLE_PARENT_H__
+#define __GTK_CELL_ACCESSIBLE_PARENT_H__
+
+#include <atk/atk.h>
+#include "gtkcellaccessible.h"
+
+G_BEGIN_DECLS
+
+/*
+ * The GtkCellAccessibleParent interface should be supported by any object
+ * which contains children which are flyweights, i.e. do not have corresponding
+ * widgets and the children need help from their parent to provide
+ * functionality. One example is GtkTreeViewAccessible where the children
+ * GtkCellAccessible need help from the GtkTreeViewAccessible in order to
+ * implement atk_component_get_extents().
+ */
+
+#define GTK_TYPE_CELL_ACCESSIBLE_PARENT (_gtk_cell_accessible_parent_get_type ())
+#define GTK_IS_CELL_ACCESSIBLE_PARENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT)
+#define GTK_CELL_ACCESSIBLE_PARENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT, GtkCellAccessibleParent)
+#define GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT, GtkCellAccessibleParentIface))
+
+typedef struct _GtkCellAccessibleParent GtkCellAccessibleParent;
+typedef struct _GtkCellAccessibleParentIface GtkCellAccessibleParentIface;
+
+struct _GtkCellAccessibleParentIface
+{
+ GTypeInterface parent;
+ void ( *get_cell_extents) (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ AtkCoordType coord_type);
+ void ( *get_cell_area) (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ GdkRectangle *cell_rect);
+ gboolean ( *grab_focus) (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell);
+};
+
+GType _gtk_cell_accessible_parent_get_type (void);
+
+void _gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ AtkCoordType coord_type);
+void _gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ GdkRectangle *cell_rect);
+gboolean _gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell);
+
+G_END_DECLS
+
+#endif /* __GTK_CELL_ACCESSIBLE_PARENT_H__ */
diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c
index 67f8831..01f1456 100644
--- a/gtk/a11y/gtktextcellaccessible.c
+++ b/gtk/a11y/gtktextcellaccessible.c
@@ -23,7 +23,7 @@
#include "../gtkpango.h"
#include "gtktextcellaccessible.h"
#include "gtkcontainercellaccessible.h"
-#include "gailcellparent.h"
+#include "gtkcellaccessibleparent.h"
static const gchar* gtk_text_cell_accessible_get_name (AtkObject *atk_obj);
@@ -611,9 +611,10 @@ gtk_text_cell_accessible_get_character_extents (AtkText *text,
if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
parent = atk_object_get_parent (parent);
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
- gail_cell_parent_get_cell_area (GAIL_CELL_PARENT (parent), GTK_CELL_ACCESSIBLE (text),
- &rendered_rect);
+ g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
+ _gtk_cell_accessible_parent_get_cell_area (GTK_CELL_ACCESSIBLE_PARENT (parent),
+ GTK_CELL_ACCESSIBLE (text),
+ &rendered_rect);
gtk_cell_renderer_get_preferred_size (GTK_CELL_RENDERER (gtk_renderer),
widget,
@@ -696,9 +697,10 @@ gtk_text_cell_accessible_get_offset_at_point (AtkText *text,
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- g_return_val_if_fail (GAIL_IS_CELL_PARENT (parent), -1);
- gail_cell_parent_get_cell_area (GAIL_CELL_PARENT (parent), GTK_CELL_ACCESSIBLE (text),
- &rendered_rect);
+ g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), -1);
+ _gtk_cell_accessible_parent_get_cell_area (GTK_CELL_ACCESSIBLE_PARENT (parent),
+ GTK_CELL_ACCESSIBLE (text),
+ &rendered_rect);
gtk_cell_renderer_get_preferred_size (GTK_CELL_RENDERER (gtk_renderer),
widget,
diff --git a/gtk/a11y/gtktextcellaccessible.h b/gtk/a11y/gtktextcellaccessible.h
index 536aef8..fd656d5 100644
--- a/gtk/a11y/gtktextcellaccessible.h
+++ b/gtk/a11y/gtktextcellaccessible.h
@@ -25,7 +25,7 @@
G_BEGIN_DECLS
-#define GTK_TYPE_TEXT_CELL_ACCESSIBLE (gtk_text_cell_accessible_get_type ())
+#define GTK_TYPE_TEXT_CELL_ACCESSIBLE (_gtk_text_cell_accessible_get_type ())
#define GTK_TEXT_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_CELL_ACCESSIBLE, GtkTextCellAccessible))
#define GTK_TEXT_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TEXT_CELL_ACCESSIBLE, GtkTextCellAccessibleClass))
#define GTK_IS_TEXT_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_CELL_ACCESSIBLE))
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index fad9bf9..257ade7 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -30,7 +30,7 @@
#include "gtkimagecellaccessible.h"
#include "gtkcontainercellaccessible.h"
#include "gtktextcellaccessible.h"
-#include "gailcellparent.h"
+#include "gtkcellaccessibleparent.h"
typedef struct _GtkTreeViewAccessibleCellInfo GtkTreeViewAccessibleCellInfo;
struct _GtkTreeViewAccessibleCellInfo
@@ -156,16 +156,16 @@ static AtkObject * get_header_from_column (GtkTreeViewColumn
static gboolean idle_garbage_collect_cell_data (gpointer data);
-static void atk_table_interface_init (AtkTableIface *iface);
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void gail_cell_parent_interface_init (GailCellParentIface *iface);
+static void atk_table_interface_init (AtkTableIface *iface);
+static void atk_selection_interface_init (AtkSelectionIface *iface);
+static void atk_component_interface_init (AtkComponentIface *iface);
+static void gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkTreeViewAccessible, _gtk_tree_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE, atk_table_interface_init)
G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init)
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
- G_IMPLEMENT_INTERFACE (GAIL_TYPE_CELL_PARENT, gail_cell_parent_interface_init))
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_ACCESSIBLE_PARENT, gtk_cell_accessible_parent_interface_init))
static void
@@ -1332,9 +1332,9 @@ static void atk_selection_interface_init (AtkSelectionIface *iface)
#define EXTRA_EXPANDER_PADDING 4
static void
-gtk_tree_view_accessible_get_cell_area (GailCellParent *parent,
- GtkCellAccessible *cell,
- GdkRectangle *cell_rect)
+gtk_tree_view_accessible_get_cell_area (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ GdkRectangle *cell_rect)
{
GtkWidget *widget;
GtkTreeView *tree_view;
@@ -1413,13 +1413,13 @@ gtk_tree_view_accessible_get_cell_area (GailCellParent *parent,
}
static void
-gtk_tree_view_accessible_get_cell_extents (GailCellParent *parent,
- GtkCellAccessible *cell,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
+gtk_tree_view_accessible_get_cell_extents (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ AtkCoordType coord_type)
{
GtkWidget *widget;
GtkTreeView *tree_view;
@@ -1463,8 +1463,8 @@ gtk_tree_view_accessible_get_cell_extents (GailCellParent *parent,
}
static gboolean
-gtk_tree_view_accessible_grab_cell_focus (GailCellParent *parent,
- GtkCellAccessible *cell)
+gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent,
+ GtkCellAccessible *cell)
{
GtkWidget *widget;
GtkTreeView *tree_view;
@@ -1532,7 +1532,8 @@ gtk_tree_view_accessible_grab_cell_focus (GailCellParent *parent,
return FALSE;
}
-static void gail_cell_parent_interface_init (GailCellParentIface *iface)
+static void
+gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface)
{
iface->get_cell_extents = gtk_tree_view_accessible_get_cell_extents;
iface->get_cell_area = gtk_tree_view_accessible_get_cell_area;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]