Commit a129392b authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Convert GailFrame to GtkFrameAccessible

parent 1ef996ca
......@@ -18,7 +18,7 @@ gail_c_sources = \
gailcontainercell.c \
gtkentryaccessible.c \
gailexpander.c \
gailframe.c \
gtkframeaccessible.c \
gailimage.c \
gailimagecell.c \
gtklabelaccessible.c \
......@@ -70,7 +70,7 @@ gail_private_h_sources = \
gtkentryaccessible.h \
gailexpander.h \
gailfactory.h \
gailframe.h \
gtkframeaccessible.h \
gailimage.h \
gailimagecell.h \
gtklabelaccessible.h \
......
......@@ -32,7 +32,6 @@
#include "gailcontainer.h"
#include "gailcontainercell.h"
#include "gailexpander.h"
#include "gailframe.h"
#include "gailimage.h"
#include "gailimagecell.h"
#include "gaillinkbutton.h"
......@@ -121,7 +120,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_bar, GTK_TYPE_PROGRESS_BAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
......@@ -890,7 +888,6 @@ gail_accessibility_module_init (void)
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_NOTEBOOK, gail_notebook);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_PROGRESS_BAR, gail_progress_bar);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_TREE_VIEW, gail_tree_view);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_FRAME, gail_frame);
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);
......
......@@ -21,65 +21,47 @@
#include <string.h>
#include <gtk/gtk.h>
#include "gailframe.h"
#include "gtkframeaccessible.h"
static void gail_frame_class_init (GailFrameClass *klass);
static void gail_frame_init (GailFrame *frame);
static void gail_frame_initialize (AtkObject *accessible,
gpointer data);
static const gchar* gail_frame_get_name (AtkObject *obj);
G_DEFINE_TYPE (GailFrame, gail_frame, GAIL_TYPE_CONTAINER)
G_DEFINE_TYPE (GtkFrameAccessible, gtk_frame_accessible, GAIL_TYPE_CONTAINER)
static void
gail_frame_class_init (GailFrameClass *klass)
gtk_frame_accessible_initialize (AtkObject *accessible,
gpointer data)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
ATK_OBJECT_CLASS (gtk_frame_accessible_parent_class)->initialize (accessible, data);
class->initialize = gail_frame_initialize;
class->get_name = gail_frame_get_name;
accessible->role = ATK_ROLE_PANEL;
}
static void
gail_frame_init (GailFrame *frame)
static const gchar *
gtk_frame_accessible_get_name (AtkObject *obj)
{
const gchar *name;
GtkWidget *widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
if (widget == NULL)
return NULL;
name = ATK_OBJECT_CLASS (gtk_frame_accessible_parent_class)->get_name (obj);
if (name != NULL)
return name;
return gtk_frame_get_label (GTK_FRAME (widget));
}
static void
gail_frame_initialize (AtkObject *accessible,
gpointer data)
gtk_frame_accessible_class_init (GtkFrameAccessibleClass *klass)
{
ATK_OBJECT_CLASS (gail_frame_parent_class)->initialize (accessible, data);
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
accessible->role = ATK_ROLE_PANEL;
class->initialize = gtk_frame_accessible_initialize;
class->get_name = gtk_frame_accessible_get_name;
}
static const gchar*
gail_frame_get_name (AtkObject *obj)
static void
gtk_frame_accessible_init (GtkFrameAccessible *frame)
{
const gchar *name;
g_return_val_if_fail (GAIL_IS_FRAME (obj), NULL);
name = ATK_OBJECT_CLASS (gail_frame_parent_class)->get_name (obj);
if (name != NULL)
{
return name;
}
else
{
/*
* Get the text on the label
*/
GtkWidget *widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
if (widget == NULL)
{
/*
* State is defunct
*/
return NULL;
}
return gtk_frame_get_label (GTK_FRAME (widget));
}
}
......@@ -17,35 +17,35 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GAIL_FRAME_H__
#define __GAIL_FRAME_H__
#ifndef __GTK_FRAME_ACCESSIBLE_H__
#define __GTK_FRAME_ACCESSIBLE_H__
#include "gailcontainer.h"
G_BEGIN_DECLS
#define GAIL_TYPE_FRAME (gail_frame_get_type ())
#define GAIL_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_FRAME, GailFrame))
#define GAIL_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_FRAME, GailFrameClass))
#define GAIL_IS_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_FRAME))
#define GAIL_IS_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_FRAME))
#define GAIL_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_FRAME, GailFrameClass))
#define GTK_TYPE_FRAME_ACCESSIBLE (gtk_frame_accessible_get_type ())
#define GTK_FRAME_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessible))
#define GTK_FRAME_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
#define GTK_IS_FRAME_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FRAME_ACCESSIBLE))
#define GTK_IS_FRAME_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME_ACCESSIBLE))
#define GTK_FRAME_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
typedef struct _GailFrame GailFrame;
typedef struct _GailFrameClass GailFrameClass;
typedef struct _GtkFrameAccessible GtkFrameAccessible;
typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
struct _GailFrame
struct _GtkFrameAccessible
{
GailContainer parent;
};
GType gail_frame_get_type (void);
struct _GailFrameClass
struct _GtkFrameAccessibleClass
{
GailContainerClass parent_class;
};
GType gtk_frame_accessible_get_type (void);
G_END_DECLS
#endif /* __GAIL_FRAME_H__ */
#endif /* __GTK_FRAME_ACCESSIBLE_H__ */
......@@ -33,6 +33,7 @@
#include "gtkintl.h"
#include "gtkbuildable.h"
#include "a11y/gtkframeaccessible.h"
/**
* SECTION:gtkframe
......@@ -221,6 +222,8 @@ gtk_frame_class_init (GtkFrameClass *class)
class->compute_child_allocation = gtk_frame_real_compute_child_allocation;
g_type_class_add_private (class, sizeof (GtkFramePrivate));
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_FRAME_ACCESSIBLE);
}
static void
......
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