mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 00:11:29 +00:00
Convert GailFrame to GtkFrameAccessible
This commit is contained in:
parent
1ef996ca3c
commit
a129392bb4
@ -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);
|
||||
|
@ -1,85 +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 Lesser 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "gailframe.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)
|
||||
|
||||
static void
|
||||
gail_frame_class_init (GailFrameClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
|
||||
class->initialize = gail_frame_initialize;
|
||||
class->get_name = gail_frame_get_name;
|
||||
}
|
||||
|
||||
static void
|
||||
gail_frame_init (GailFrame *frame)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gail_frame_initialize (AtkObject *accessible,
|
||||
gpointer data)
|
||||
{
|
||||
ATK_OBJECT_CLASS (gail_frame_parent_class)->initialize (accessible, data);
|
||||
|
||||
accessible->role = ATK_ROLE_PANEL;
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
gail_frame_get_name (AtkObject *obj)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
@ -1,51 +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_FRAME_H__
|
||||
#define __GAIL_FRAME_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))
|
||||
|
||||
typedef struct _GailFrame GailFrame;
|
||||
typedef struct _GailFrameClass GailFrameClass;
|
||||
|
||||
struct _GailFrame
|
||||
{
|
||||
GailContainer parent;
|
||||
};
|
||||
|
||||
GType gail_frame_get_type (void);
|
||||
|
||||
struct _GailFrameClass
|
||||
{
|
||||
GailContainerClass parent_class;
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GAIL_FRAME_H__ */
|
67
gtk/a11y/gtkframeaccessible.c
Normal file
67
gtk/a11y/gtkframeaccessible.c
Normal file
@ -0,0 +1,67 @@
|
||||
/* 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 Lesser 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkframeaccessible.h"
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GtkFrameAccessible, gtk_frame_accessible, GAIL_TYPE_CONTAINER)
|
||||
|
||||
static void
|
||||
gtk_frame_accessible_initialize (AtkObject *accessible,
|
||||
gpointer data)
|
||||
{
|
||||
ATK_OBJECT_CLASS (gtk_frame_accessible_parent_class)->initialize (accessible, data);
|
||||
|
||||
accessible->role = ATK_ROLE_PANEL;
|
||||
}
|
||||
|
||||
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
|
||||
gtk_frame_accessible_class_init (GtkFrameAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
|
||||
class->initialize = gtk_frame_accessible_initialize;
|
||||
class->get_name = gtk_frame_accessible_get_name;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_frame_accessible_init (GtkFrameAccessible *frame)
|
||||
{
|
||||
}
|
51
gtk/a11y/gtkframeaccessible.h
Normal file
51
gtk/a11y/gtkframeaccessible.h
Normal file
@ -0,0 +1,51 @@
|
||||
/* 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_FRAME_ACCESSIBLE_H__
|
||||
#define __GTK_FRAME_ACCESSIBLE_H__
|
||||
|
||||
#include "gailcontainer.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#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 _GtkFrameAccessible GtkFrameAccessible;
|
||||
typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
|
||||
|
||||
struct _GtkFrameAccessible
|
||||
{
|
||||
GailContainer parent;
|
||||
};
|
||||
|
||||
struct _GtkFrameAccessibleClass
|
||||
{
|
||||
GailContainerClass parent_class;
|
||||
};
|
||||
|
||||
GType gtk_frame_accessible_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user