Commit 5fb86cf7 authored by Matthias Clasen's avatar Matthias Clasen

Convert GailScale to GtkScaleAccessible

parent 3e6fc741
......@@ -38,7 +38,7 @@ gail_c_sources = \
gailradiosubmenuitem.c \
gailrange.c \
gailrenderercell.c \
gailscale.c \
gtkscaleaccessible.c \
gailscalebutton.c \
gailscrollbar.c \
gailscrolledwindow.c \
......@@ -93,7 +93,7 @@ gail_private_h_sources = \
gailradiosubmenuitem.h \
gailrange.h \
gailrenderercell.h \
gailscale.h \
gtkscaleaccessible.h \
gailscalebutton.h \
gailscrollbar.h \
gailscrolledwindow.h \
......
......@@ -49,7 +49,6 @@
#include "gailradiomenuitem.h"
#include "gailrenderercell.h"
#include "gailrange.h"
#include "gailscale.h"
#include "gailscalebutton.h"
#include "gailscrollbar.h"
#include "gailscrolledwindow.h"
......@@ -121,7 +120,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GT
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_RANGE, GailRange, gail_range, GTK_TYPE_RANGE)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCALE, GailScale, gail_scale, GTK_TYPE_SCALE)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCALE_BUTTON, GailScaleButton, gail_scale_button, GTK_TYPE_SCALE_BUTTON)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
......@@ -895,7 +893,6 @@ gail_accessibility_module_init (void)
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU, gail_menu);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WINDOW, gail_window);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_RANGE, gail_range);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCALE, gail_scale);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCALE_BUTTON, gail_scale_button);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_STATUSBAR, gail_statusbar);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_NOTEBOOK, gail_notebook);
......
......@@ -20,39 +20,36 @@
#include "config.h"
#include <gtk/gtk.h>
#include "gailscale.h"
#include "gtkscaleaccessible.h"
static const char * gail_scale_get_description (AtkObject *object);
G_DEFINE_TYPE (GtkScaleAccessible, gtk_scale_accessible, GAIL_TYPE_RANGE)
G_DEFINE_TYPE (GailScale, gail_scale, GAIL_TYPE_RANGE)
static void
gail_scale_class_init (GailScaleClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->get_description = gail_scale_get_description;
}
static void
gail_scale_init (GailScale *scale)
{
}
static const char *
gail_scale_get_description (AtkObject *object)
static const gchar *
gtk_scale_accessible_get_description (AtkObject *object)
{
GtkWidget *widget;
PangoLayout *layout;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
if (widget == NULL)
/* State is defunct */
return NULL;
layout = gtk_scale_get_layout (GTK_SCALE (widget));
if (layout)
return pango_layout_get_text (layout);
return ATK_OBJECT_CLASS (gail_scale_parent_class)->get_description (object);
return ATK_OBJECT_CLASS (gtk_scale_accessible_parent_class)->get_description (object);
}
static void
gtk_scale_accessible_class_init (GtkScaleAccessibleClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->get_description = gtk_scale_accessible_get_description;
}
static void
gtk_scale_accessible_init (GtkScaleAccessible *scale)
{
}
......@@ -17,38 +17,36 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GAIL_SCALE_H__
#define __GAIL_SCALE_H__
#ifndef __GTK_SCALE_ACCESSIBLE_H__
#define __GTK_SCALE_ACCESSIBLE_H__
#include "gailrange.h"
#include "gailtextutil.h"
G_BEGIN_DECLS
#define GAIL_TYPE_SCALE (gail_scale_get_type ())
#define GAIL_SCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_SCALE, GailScale))
#define GAIL_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_SCALE, GailScaleClass))
#define GAIL_IS_SCALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_SCALE))
#define GAIL_IS_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_SCALE))
#define GAIL_SCALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_SCALE, GailScaleClass))
#define GTK_TYPE_SCALE_ACCESSIBLE (gtk_scale_accessible_get_type ())
#define GTK_SCALE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCALE_ACCESSIBLE, GtkScaleAccessible))
#define GTK_SCALE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCALE_ACCESSIBLE, GtkScaleAccessibleClass))
#define GTK_IS_SCALE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCALE_ACCESSIBLE))
#define GTK_IS_SCALE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCALE_ACCESSIBLE))
#define GTK_SCALE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCALE_ACCESSIBLE, GtkScaleAccessibleClass))
typedef struct _GailScale GailScale;
typedef struct _GailScaleClass GailScaleClass;
typedef struct _GtkScaleAccessible GtkScaleAccessible;
typedef struct _GtkScaleAccessibleClass GtkScaleAccessibleClass;
struct _GailScale
struct _GtkScaleAccessible
{
GailRange parent;
GailTextUtil *textutil;
};
GType gail_scale_get_type (void);
struct _GailScaleClass
struct _GtkScaleAccessibleClass
{
GailRangeClass parent_class;
};
GType gtk_scale_accessible_get_type (void);
G_END_DECLS
#endif /* __GAIL_SCALE_H__ */
#endif /* __GTK_SCALE_ACCESSIBLE_H__ */
......@@ -42,6 +42,8 @@
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
#include "a11y/gtkscaleaccessible.h"
/**
* SECTION:gtkscale
......@@ -410,6 +412,8 @@ gtk_scale_class_init (GtkScaleClass *class)
GTK_SCROLL_END);
g_type_class_add_private (gobject_class, sizeof (GtkScalePrivate));
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_SCALE_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