forked from AuroraMiddleware/gtk
Convert GailRendererCell to GtkRendererCellAccessible
This commit is contained in:
parent
3688c1a2d3
commit
920c1c4c83
@ -33,7 +33,7 @@ gail_c_sources = \
|
||||
gtkradiomenuitemaccessible.c \
|
||||
gtkradiosubmenuitemaccessible.c \
|
||||
gtkrangeaccessible.c \
|
||||
gailrenderercell.c \
|
||||
gtkrenderercellaccessible.c \
|
||||
gtkscaleaccessible.c \
|
||||
gtkscalebuttonaccessible.c \
|
||||
gtkscrollbaraccessible.c \
|
||||
@ -85,7 +85,7 @@ gail_private_h_sources = \
|
||||
gtkradiomenuitemaccessible.h \
|
||||
gtkradiosubmenuitemaccessible.h \
|
||||
gtkrangeaccessible.h \
|
||||
gailrenderercell.h \
|
||||
gtkrenderercellaccessible.h \
|
||||
gtkscaleaccessible.h \
|
||||
gtkscalebuttonaccessible.h \
|
||||
gtkscrollbaraccessible.h \
|
||||
|
@ -43,7 +43,7 @@ static void gail_image_cell_get_image_size (AtkImage *image,
|
||||
|
||||
/* Misc */
|
||||
|
||||
static gboolean gail_image_cell_update_cache (GailRendererCell *cell,
|
||||
static gboolean gail_image_cell_update_cache (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal);
|
||||
|
||||
// FIXMEchpe static!!!
|
||||
@ -52,14 +52,14 @@ gchar *gail_image_cell_property_list[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GailImageCell, gail_image_cell, GAIL_TYPE_RENDERER_CELL,
|
||||
G_DEFINE_TYPE_WITH_CODE (GailImageCell, gail_image_cell, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
|
||||
|
||||
static void
|
||||
gail_image_cell_class_init (GailImageCellClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
GailRendererCellClass *renderer_cell_class = GAIL_RENDERER_CELL_CLASS(klass);
|
||||
GtkRendererCellAccessibleClass *renderer_cell_class = GTK_RENDERER_CELL_ACCESSIBLE_CLASS (klass);
|
||||
|
||||
gobject_class->finalize = gail_image_cell_finalize;
|
||||
|
||||
@ -72,7 +72,7 @@ gail_image_cell_new (void)
|
||||
{
|
||||
GObject *object;
|
||||
AtkObject *atk_object;
|
||||
GailRendererCell *cell;
|
||||
GtkRendererCellAccessible *cell;
|
||||
|
||||
object = g_object_new (GAIL_TYPE_IMAGE_CELL, NULL);
|
||||
|
||||
@ -81,7 +81,7 @@ gail_image_cell_new (void)
|
||||
atk_object = ATK_OBJECT (object);
|
||||
atk_object->role = ATK_ROLE_TABLE_CELL;
|
||||
|
||||
cell = GAIL_RENDERER_CELL(object);
|
||||
cell = GTK_RENDERER_CELL_ACCESSIBLE (object);
|
||||
|
||||
cell->renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
g_object_ref_sink (cell->renderer);
|
||||
@ -105,7 +105,7 @@ gail_image_cell_finalize (GObject *object)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gail_image_cell_update_cache (GailRendererCell *cell,
|
||||
gail_image_cell_update_cache (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal)
|
||||
{
|
||||
return FALSE;
|
||||
@ -162,7 +162,7 @@ gail_image_cell_get_image_size (AtkImage *image,
|
||||
GtkCellRenderer *cell_renderer;
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
|
||||
cell_renderer = GAIL_RENDERER_CELL (cell)->renderer;
|
||||
cell_renderer = GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer;
|
||||
g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer), "pixbuf", &pixbuf, NULL);
|
||||
|
||||
if (pixbuf)
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define __GAIL_IMAGE_CELL_H__
|
||||
|
||||
#include <atk/atk.h>
|
||||
#include "gailrenderercell.h"
|
||||
#include "gtkrenderercellaccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -37,7 +37,7 @@ typedef struct _GailImageCellClass GailImageCellClass;
|
||||
|
||||
struct _GailImageCell
|
||||
{
|
||||
GailRendererCell parent;
|
||||
GtkRendererCellAccessible parent;
|
||||
|
||||
gchar *image_description;
|
||||
gint x, y;
|
||||
@ -47,7 +47,7 @@ GType gail_image_cell_get_type (void);
|
||||
|
||||
struct _GailImageCellClass
|
||||
{
|
||||
GailRendererCellClass parent_class;
|
||||
GtkRendererCellAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
AtkObject *gail_image_cell_new (void);
|
||||
|
@ -1,60 +0,0 @@
|
||||
/* GAIL - The GNOME Accessibility Enabling 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_RENDERER_CELL_H__
|
||||
#define __GAIL_RENDERER_CELL_H__
|
||||
|
||||
#include <atk/atk.h>
|
||||
#include "gtkcellaccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GAIL_TYPE_RENDERER_CELL (gail_renderer_cell_get_type ())
|
||||
#define GAIL_RENDERER_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_RENDERER_CELL, GailRendererCell))
|
||||
#define GAIL_RENDERER_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_RENDERER_CELL, GailRendererCellClass))
|
||||
#define GAIL_IS_RENDERER_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_RENDERER_CELL))
|
||||
#define GAIL_IS_RENDERER_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_RENDERER_CELL))
|
||||
#define GAIL_RENDERER_CELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_RENDERER_CELL, GailRendererCellClass))
|
||||
|
||||
typedef struct _GailRendererCell GailRendererCell;
|
||||
typedef struct _GailRendererCellClass GailRendererCellClass;
|
||||
|
||||
struct _GailRendererCell
|
||||
{
|
||||
GtkCellAccessible parent;
|
||||
GtkCellRenderer *renderer;
|
||||
};
|
||||
|
||||
struct _GailRendererCellClass
|
||||
{
|
||||
GtkCellAccessibleClass parent_class;
|
||||
gchar **property_list;
|
||||
gboolean (*update_cache) (GailRendererCell *cell,
|
||||
gboolean emit_change_signal);
|
||||
};
|
||||
|
||||
GType gail_renderer_cell_get_type (void);
|
||||
|
||||
AtkObject *gail_renderer_cell_new (void);
|
||||
gboolean gail_renderer_cell_update_cache (GailRendererCell *cell,
|
||||
gboolean emit_change_signal);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GAIL_TEXT_CELL_H__ */
|
@ -22,7 +22,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "../gtkpango.h"
|
||||
#include "gailtextcell.h"
|
||||
#include "gailcontainercell.h"
|
||||
#include "gtkcontainercellaccessible.h"
|
||||
#include "gailcellparent.h"
|
||||
|
||||
static void gail_text_cell_class_init (GailTextCellClass *klass);
|
||||
@ -85,7 +85,7 @@ static void add_attr (PangoAttrList *attr_li
|
||||
|
||||
/* Misc */
|
||||
|
||||
static gboolean gail_text_cell_update_cache (GailRendererCell *cell,
|
||||
static gboolean gail_text_cell_update_cache (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal);
|
||||
|
||||
gchar *gail_text_cell_property_list[] = {
|
||||
@ -125,7 +125,7 @@ gchar *gail_text_cell_property_list[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GailTextCell, gail_text_cell, GAIL_TYPE_RENDERER_CELL,
|
||||
G_DEFINE_TYPE_WITH_CODE (GailTextCell, gail_text_cell, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init))
|
||||
|
||||
static void
|
||||
@ -133,7 +133,7 @@ gail_text_cell_class_init (GailTextCellClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
|
||||
GailRendererCellClass *renderer_cell_class = GAIL_RENDERER_CELL_CLASS (klass);
|
||||
GtkRendererCellAccessibleClass *renderer_cell_class = GTK_RENDERER_CELL_ACCESSIBLE_CLASS (klass);
|
||||
|
||||
renderer_cell_class->update_cache = gail_text_cell_update_cache;
|
||||
renderer_cell_class->property_list = gail_text_cell_property_list;
|
||||
@ -160,7 +160,7 @@ gail_text_cell_new (void)
|
||||
{
|
||||
GObject *object;
|
||||
AtkObject *atk_object;
|
||||
GailRendererCell *cell;
|
||||
GtkRendererCellAccessible *cell;
|
||||
|
||||
object = g_object_new (GAIL_TYPE_TEXT_CELL, NULL);
|
||||
|
||||
@ -169,7 +169,7 @@ gail_text_cell_new (void)
|
||||
atk_object = ATK_OBJECT (object);
|
||||
atk_object->role = ATK_ROLE_TABLE_CELL;
|
||||
|
||||
cell = GAIL_RENDERER_CELL(object);
|
||||
cell = GTK_RENDERER_CELL_ACCESSIBLE(object);
|
||||
|
||||
cell->renderer = gtk_cell_renderer_text_new ();
|
||||
g_object_ref_sink (cell->renderer);
|
||||
@ -200,7 +200,7 @@ gail_text_cell_get_name (AtkObject *atk_obj)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gail_text_cell_update_cache (GailRendererCell *cell,
|
||||
gail_text_cell_update_cache (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal)
|
||||
{
|
||||
GailTextCell *text_cell = GAIL_TEXT_CELL (cell);
|
||||
@ -451,7 +451,7 @@ get_widget (GailTextCell *text)
|
||||
AtkObject *parent;
|
||||
|
||||
parent = atk_object_get_parent (ATK_OBJECT (text));
|
||||
if (GAIL_IS_CONTAINER_CELL (parent))
|
||||
if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
|
||||
parent = atk_object_get_parent (parent);
|
||||
|
||||
return gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
|
||||
@ -477,10 +477,10 @@ create_pango_layout (GailTextCell *text)
|
||||
gchar *renderer_text;
|
||||
gdouble scale;
|
||||
gint rise;
|
||||
GailRendererCell *gail_renderer;
|
||||
GtkRendererCellAccessible *gail_renderer;
|
||||
GtkCellRendererText *gtk_renderer;
|
||||
|
||||
gail_renderer = GAIL_RENDERER_CELL (text);
|
||||
gail_renderer = GTK_RENDERER_CELL_ACCESSIBLE (text);
|
||||
gtk_renderer = GTK_CELL_RENDERER_TEXT (gail_renderer->renderer);
|
||||
|
||||
g_object_get (gtk_renderer,
|
||||
@ -603,7 +603,7 @@ gail_text_cell_get_character_extents (AtkText *text,
|
||||
gint *height,
|
||||
AtkCoordType coords)
|
||||
{
|
||||
GailRendererCell *gail_renderer;
|
||||
GtkRendererCellAccessible *gail_renderer;
|
||||
GtkRequisition min_size;
|
||||
GtkCellRendererText *gtk_renderer;
|
||||
GdkRectangle rendered_rect;
|
||||
@ -627,7 +627,7 @@ gail_text_cell_get_character_extents (AtkText *text,
|
||||
*x = *y = *height = *width = 0;
|
||||
return;
|
||||
}
|
||||
gail_renderer = GAIL_RENDERER_CELL (text);
|
||||
gail_renderer = GTK_RENDERER_CELL_ACCESSIBLE (text);
|
||||
gtk_renderer = GTK_CELL_RENDERER_TEXT (gail_renderer->renderer);
|
||||
/*
|
||||
* Thus would be inconsistent with the cache
|
||||
@ -640,7 +640,7 @@ gail_text_cell_get_character_extents (AtkText *text,
|
||||
}
|
||||
|
||||
parent = atk_object_get_parent (ATK_OBJECT (text));
|
||||
if (GAIL_IS_CONTAINER_CELL (parent))
|
||||
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));
|
||||
@ -695,7 +695,7 @@ gail_text_cell_get_offset_at_point (AtkText *text,
|
||||
AtkCoordType coords)
|
||||
{
|
||||
AtkObject *parent;
|
||||
GailRendererCell *gail_renderer;
|
||||
GtkRendererCellAccessible *gail_renderer;
|
||||
GtkCellRendererText *gtk_renderer;
|
||||
GtkRequisition min_size;
|
||||
GtkWidget *widget;
|
||||
@ -713,7 +713,7 @@ gail_text_cell_get_offset_at_point (AtkText *text,
|
||||
if (!GAIL_TEXT_CELL (text)->cell_text)
|
||||
return -1;
|
||||
|
||||
gail_renderer = GAIL_RENDERER_CELL (text);
|
||||
gail_renderer = GTK_RENDERER_CELL_ACCESSIBLE (text);
|
||||
gtk_renderer = GTK_CELL_RENDERER_TEXT (gail_renderer->renderer);
|
||||
parent = atk_object_get_parent (ATK_OBJECT (text));
|
||||
|
||||
@ -724,7 +724,7 @@ gail_text_cell_get_offset_at_point (AtkText *text,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (GAIL_IS_CONTAINER_CELL (parent))
|
||||
if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
|
||||
parent = atk_object_get_parent (parent);
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define __GAIL_TEXT_CELL_H__
|
||||
|
||||
#include <atk/atk.h>
|
||||
#include "gailrenderercell.h"
|
||||
#include "gtkrenderercellaccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -37,7 +37,7 @@ typedef struct _GailTextCellClass GailTextCellClass;
|
||||
|
||||
struct _GailTextCell
|
||||
{
|
||||
GailRendererCell parent;
|
||||
GtkRendererCellAccessible parent;
|
||||
gchar *cell_text;
|
||||
gint caret_pos;
|
||||
gint cell_length;
|
||||
@ -45,7 +45,7 @@ struct _GailTextCell
|
||||
|
||||
struct _GailTextCellClass
|
||||
{
|
||||
GailRendererCellClass parent_class;
|
||||
GtkRendererCellAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
GType gail_text_cell_get_type (void);
|
||||
|
@ -30,12 +30,12 @@ static gchar *property_list[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkBooleanCellAccessible, _gtk_boolean_cell_accessible, GAIL_TYPE_RENDERER_CELL)
|
||||
G_DEFINE_TYPE (GtkBooleanCellAccessible, _gtk_boolean_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE)
|
||||
|
||||
|
||||
static gboolean
|
||||
gtk_boolean_cell_accessible_update_cache (GailRendererCell *cell,
|
||||
gboolean emit_change_signal)
|
||||
gtk_boolean_cell_accessible_update_cache (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal)
|
||||
{
|
||||
GtkBooleanCellAccessible *boolean_cell = GTK_BOOLEAN_CELL_ACCESSIBLE (cell);
|
||||
gboolean rv = FALSE;
|
||||
@ -75,7 +75,7 @@ gtk_boolean_cell_accessible_update_cache (GailRendererCell *cell,
|
||||
static void
|
||||
_gtk_boolean_cell_accessible_class_init (GtkBooleanCellAccessibleClass *klass)
|
||||
{
|
||||
GailRendererCellClass *renderer_cell_class = GAIL_RENDERER_CELL_CLASS (klass);
|
||||
GtkRendererCellAccessibleClass *renderer_cell_class = GTK_RENDERER_CELL_ACCESSIBLE_CLASS (klass);
|
||||
|
||||
renderer_cell_class->update_cache = gtk_boolean_cell_accessible_update_cache;
|
||||
renderer_cell_class->property_list = property_list;
|
||||
@ -91,7 +91,7 @@ _gtk_boolean_cell_accessible_new (void)
|
||||
{
|
||||
GObject *object;
|
||||
AtkObject *atk_object;
|
||||
GailRendererCell *cell;
|
||||
GtkRendererCellAccessible *cell;
|
||||
GtkBooleanCellAccessible *boolean_cell;
|
||||
|
||||
object = g_object_new (GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, NULL);
|
||||
@ -99,7 +99,7 @@ _gtk_boolean_cell_accessible_new (void)
|
||||
atk_object = ATK_OBJECT (object);
|
||||
atk_object->role = ATK_ROLE_TABLE_CELL;
|
||||
|
||||
cell = GAIL_RENDERER_CELL (object);
|
||||
cell = GTK_RENDERER_CELL_ACCESSIBLE (object);
|
||||
cell->renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_ref_sink (cell->renderer);
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define __GTK_BOOLEAN_CELL_ACCESSIBLE_H__
|
||||
|
||||
#include <atk/atk.h>
|
||||
#include "gailrenderercell.h"
|
||||
#include "gtkrenderercellaccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -37,14 +37,14 @@ typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass;
|
||||
|
||||
struct _GtkBooleanCellAccessible
|
||||
{
|
||||
GailRendererCell parent;
|
||||
GtkRendererCellAccessible parent;
|
||||
gboolean cell_value;
|
||||
gboolean cell_sensitive;
|
||||
};
|
||||
|
||||
struct _GtkBooleanCellAccessibleClass
|
||||
{
|
||||
GailRendererCellClass parent_class;
|
||||
GtkRendererCellAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
GType _gtk_boolean_cell_accessible_get_type (void);
|
||||
|
@ -20,47 +20,44 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gailrenderercell.h"
|
||||
#include "gtkrenderercellaccessible.h"
|
||||
|
||||
static void gail_renderer_cell_class_init (GailRendererCellClass *klass);
|
||||
static void gail_renderer_cell_init (GailRendererCell *renderer_cell);
|
||||
|
||||
static void gail_renderer_cell_finalize (GObject *object);
|
||||
G_DEFINE_TYPE (GtkRendererCellAccessible, _gtk_renderer_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
|
||||
|
||||
G_DEFINE_TYPE (GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_ACCESSIBLE)
|
||||
|
||||
static void
|
||||
gail_renderer_cell_class_init (GailRendererCellClass *klass)
|
||||
gtk_renderer_cell_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkRendererCellAccessible *renderer_cell = GTK_RENDERER_CELL_ACCESSIBLE (object);
|
||||
|
||||
if (renderer_cell->renderer)
|
||||
g_object_unref (renderer_cell->renderer);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_renderer_cell_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_renderer_cell_accessible_class_init (GtkRendererCellAccessibleClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
klass->property_list = NULL;
|
||||
|
||||
gobject_class->finalize = gail_renderer_cell_finalize;
|
||||
gobject_class->finalize = gtk_renderer_cell_accessible_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gail_renderer_cell_init (GailRendererCell *renderer_cell)
|
||||
_gtk_renderer_cell_accessible_init (GtkRendererCellAccessible *renderer_cell)
|
||||
{
|
||||
renderer_cell->renderer = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gail_renderer_cell_finalize (GObject *object)
|
||||
{
|
||||
GailRendererCell *renderer_cell = GAIL_RENDERER_CELL (object);
|
||||
|
||||
if (renderer_cell->renderer)
|
||||
g_object_unref (renderer_cell->renderer);
|
||||
|
||||
G_OBJECT_CLASS (gail_renderer_cell_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gail_renderer_cell_update_cache (GailRendererCell *cell,
|
||||
gboolean emit_change_signal)
|
||||
_gtk_renderer_cell_accessible_update_cache (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal)
|
||||
{
|
||||
GailRendererCellClass *class = GAIL_RENDERER_CELL_GET_CLASS (cell);
|
||||
GtkRendererCellAccessibleClass *class = GTK_RENDERER_CELL_ACCESSIBLE_GET_CLASS (cell);
|
||||
|
||||
if (class->update_cache)
|
||||
return (class->update_cache) (cell, emit_change_signal);
|
||||
@ -69,14 +66,12 @@ gail_renderer_cell_update_cache (GailRendererCell *cell,
|
||||
}
|
||||
|
||||
AtkObject *
|
||||
gail_renderer_cell_new (void)
|
||||
_gtk_renderer_cell_accessible_new (void)
|
||||
{
|
||||
GObject *object;
|
||||
AtkObject *atk_object;
|
||||
|
||||
object = g_object_new (GAIL_TYPE_RENDERER_CELL, NULL);
|
||||
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
object = g_object_new (GTK_TYPE_RENDERER_CELL_ACCESSIBLE, NULL);
|
||||
|
||||
atk_object = ATK_OBJECT (object);
|
||||
atk_object->role = ATK_ROLE_TABLE_CELL;
|
60
gtk/a11y/gtkrenderercellaccessible.h
Normal file
60
gtk/a11y/gtkrenderercellaccessible.h
Normal file
@ -0,0 +1,60 @@
|
||||
/* GAIL - The GNOME Accessibility Enabling 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_RENDERER_CELL_ACCESSIBLE_H__
|
||||
#define __GTK_RENDERER_CELL_ACCESSIBLE_H__
|
||||
|
||||
#include <atk/atk.h>
|
||||
#include "gtkcellaccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_RENDERER_CELL_ACCESSIBLE (_gtk_renderer_cell_accessible_get_type ())
|
||||
#define GTK_RENDERER_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RENDERER_CELL_ACCESSIBLE, GtkRendererCellAccessible))
|
||||
#define GTK_RENDERER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RENDERER_CELL_ACCESSIBLE, GtkRendererCellAccessibleClass))
|
||||
#define GTK_IS_RENDERER_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RENDERER_CELL_ACCESSIBLE))
|
||||
#define GTK_IS_RENDERER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RENDERER_CELL_ACCESSIBLE))
|
||||
#define GTK_RENDERER_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RENDERER_CELL_ACCESSIBLE, GtkRendererCellAccessibleClass))
|
||||
|
||||
typedef struct _GtkRendererCellAccessible GtkRendererCellAccessible;
|
||||
typedef struct _GtkRendererCellAccessibleClass GtkRendererCellAccessibleClass;
|
||||
|
||||
struct _GtkRendererCellAccessible
|
||||
{
|
||||
GtkCellAccessible parent;
|
||||
GtkCellRenderer *renderer;
|
||||
};
|
||||
|
||||
struct _GtkRendererCellAccessibleClass
|
||||
{
|
||||
GtkCellAccessibleClass parent_class;
|
||||
gchar **property_list;
|
||||
gboolean (*update_cache) (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal);
|
||||
};
|
||||
|
||||
GType _gtk_renderer_cell_accessible_get_type (void);
|
||||
|
||||
AtkObject *_gtk_renderer_cell_accessible_new (void);
|
||||
gboolean _gtk_renderer_cell_accessible_update_cache (GtkRendererCellAccessible *cell,
|
||||
gboolean emit_change_signal);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_RENDERER_CELL_ACCESSIBLE_H__ */
|
@ -25,7 +25,7 @@
|
||||
#include <gdk/x11/gdkx.h>
|
||||
#endif
|
||||
#include "gtktreeviewaccessible.h"
|
||||
#include "gailrenderercell.h"
|
||||
#include "gtkrenderercellaccessible.h"
|
||||
#include "gtkbooleancellaccessible.h"
|
||||
#include "gailimagecell.h"
|
||||
#include "gtkcontainercellaccessible.h"
|
||||
@ -95,7 +95,7 @@ static void traverse_cells (GtkTreeViewAccessible
|
||||
GtkTreePath *tree_path,
|
||||
gboolean set_stale,
|
||||
gboolean inc_row);
|
||||
static gboolean update_cell_value (GailRendererCell *renderer_cell,
|
||||
static gboolean update_cell_value (GtkRendererCellAccessible *renderer_cell,
|
||||
GtkTreeViewAccessible *accessible,
|
||||
gboolean emit_change_signal);
|
||||
static void set_cell_visibility (GtkTreeView *tree_view,
|
||||
@ -484,7 +484,7 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
|
||||
GList *renderer_list;
|
||||
GList *l;
|
||||
GtkContainerCellAccessible *container = NULL;
|
||||
GailRendererCell *renderer_cell;
|
||||
GtkRendererCellAccessible *renderer_cell;
|
||||
gboolean is_expander, is_expanded, retval;
|
||||
gboolean editable = FALSE;
|
||||
gint focus_index;
|
||||
@ -580,7 +580,7 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
|
||||
fake_renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, NULL);
|
||||
child = gail_text_cell_new ();
|
||||
cell = GTK_CELL_ACCESSIBLE (child);
|
||||
renderer_cell = GAIL_RENDERER_CELL (child);
|
||||
renderer_cell = GTK_RENDERER_CELL_ACCESSIBLE (child);
|
||||
renderer_cell->renderer = fake_renderer;
|
||||
|
||||
/* Create the GtkTreeViewAccessibleCellInfo structure for this cell */
|
||||
@ -614,10 +614,10 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
|
||||
else if (GTK_IS_CELL_RENDERER_PIXBUF (renderer))
|
||||
child = gail_image_cell_new ();
|
||||
else
|
||||
child = gail_renderer_cell_new ();
|
||||
child = _gtk_renderer_cell_accessible_new ();
|
||||
|
||||
cell = GTK_CELL_ACCESSIBLE (child);
|
||||
renderer_cell = GAIL_RENDERER_CELL (child);
|
||||
renderer_cell = GTK_RENDERER_CELL_ACCESSIBLE (child);
|
||||
|
||||
/* Create the GtkTreeViewAccessibleCellInfo for this cell */
|
||||
cell_info_new (accessible, tree_model, path, tv_col, cell);
|
||||
@ -1999,8 +1999,8 @@ model_row_changed (GtkTreeModel *tree_model,
|
||||
{
|
||||
if (path && gtk_tree_path_compare (cell_path, path) == 0)
|
||||
{
|
||||
if (GAIL_IS_RENDERER_CELL (cell_info->cell))
|
||||
update_cell_value (GAIL_RENDERER_CELL (cell_info->cell),
|
||||
if (GTK_IS_RENDERER_CELL_ACCESSIBLE (cell_info->cell))
|
||||
update_cell_value (GTK_RENDERER_CELL_ACCESSIBLE (cell_info->cell),
|
||||
accessible, TRUE);
|
||||
}
|
||||
gtk_tree_path_free (cell_path);
|
||||
@ -2041,7 +2041,7 @@ column_visibility_changed (GObject *object,
|
||||
{
|
||||
GtkTreePath *row_path;
|
||||
row_path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
|
||||
if (GAIL_IS_RENDERER_CELL (cell_info->cell))
|
||||
if (GTK_IS_RENDERER_CELL_ACCESSIBLE (cell_info->cell))
|
||||
{
|
||||
if (gtk_tree_view_column_get_visible (tv_col))
|
||||
set_cell_visibility (tree_view,
|
||||
@ -2346,7 +2346,7 @@ is_cell_showing (GtkTreeView *tree_view,
|
||||
* signal when emit_change_signal is set to TRUE
|
||||
*/
|
||||
static gboolean
|
||||
update_cell_value (GailRendererCell *renderer_cell,
|
||||
update_cell_value (GtkRendererCellAccessible *renderer_cell,
|
||||
GtkTreeViewAccessible *accessible,
|
||||
gboolean emit_change_signal)
|
||||
{
|
||||
@ -2357,20 +2357,20 @@ update_cell_value (GailRendererCell *renderer_cell,
|
||||
GtkTreeIter iter;
|
||||
GList *renderers, *cur_renderer;
|
||||
GParamSpec *spec;
|
||||
GailRendererCellClass *gail_renderer_cell_class;
|
||||
GtkRendererCellAccessibleClass *renderer_cell_class;
|
||||
GtkCellRendererClass *gtk_cell_renderer_class;
|
||||
GtkCellAccessible *cell;
|
||||
gchar **prop_list;
|
||||
AtkObject *parent;
|
||||
gboolean is_expander, is_expanded;
|
||||
|
||||
gail_renderer_cell_class = GAIL_RENDERER_CELL_GET_CLASS (renderer_cell);
|
||||
renderer_cell_class = GTK_RENDERER_CELL_ACCESSIBLE_GET_CLASS (renderer_cell);
|
||||
if (renderer_cell->renderer)
|
||||
gtk_cell_renderer_class = GTK_CELL_RENDERER_GET_CLASS (renderer_cell->renderer);
|
||||
else
|
||||
gtk_cell_renderer_class = NULL;
|
||||
|
||||
prop_list = gail_renderer_cell_class->property_list;
|
||||
prop_list = renderer_cell_class->property_list;
|
||||
|
||||
cell = GTK_CELL_ACCESSIBLE (renderer_cell);
|
||||
cell_info = find_cell_info (accessible, cell, TRUE);
|
||||
@ -2452,7 +2452,7 @@ update_cell_value (GailRendererCell *renderer_cell,
|
||||
}
|
||||
g_list_free (renderers);
|
||||
|
||||
return gail_renderer_cell_update_cache (renderer_cell, emit_change_signal);
|
||||
return _gtk_renderer_cell_accessible_update_cache (renderer_cell, emit_change_signal);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
Loading…
Reference in New Issue
Block a user