Remove relocations from the atk factories. Remove unused gail_foo_new()

* modules/other/gail/*.[ch]: Remove relocations from the atk
	factories. Remove unused gail_foo_new() functions. Fix object
	instantiation to be derivation safe by moving initialisation code
	from the removed gail_foo_new() functions to the
	AtkObjectClass::initialize implementation. Bug #505226.

svn path=/trunk/; revision=19237
This commit is contained in:
Christian Persch 2007-12-25 09:29:46 +00:00
parent 99fa9096e0
commit 535e29c380
91 changed files with 261 additions and 1448 deletions

View File

@ -1,3 +1,11 @@
2007-12-22 Christian Persch <chpe@gnome.org>
* modules/other/gail/*.[ch]: Remove relocations from the atk
factories. Remove unused gail_foo_new() functions. Fix object
instantiation to be derivation safe by moving initialisation code
from the removed gail_foo_new() functions to the
AtkObjectClass::initialize implementation. Bug #505226.
2007-12-24 Matthias Clasen <mclasen@redhat.com>
* modules/other/gail/gailentry.c:

View File

@ -15,7 +15,6 @@ gail_c_sources = \
gailadjustment.c \
gailarrow.c \
gailbooleancell.c \
gailbooleancellfactory.c \
gailbox.c \
gailbutton.c \
gailcalendar.c \
@ -34,7 +33,6 @@ gail_c_sources = \
gailframe.c \
gailimage.c \
gailimagecell.c \
gailimagecellfactory.c \
gailitem.c \
gaillabel.c \
gaillist.c \
@ -44,7 +42,6 @@ gail_c_sources = \
gailnotebook.c \
gailnotebookpage.c \
gailobject.c \
gailobjectfactory.c \
gailoptionmenu.c \
gailpaned.c \
gailpixmap.c \
@ -54,7 +51,6 @@ gail_c_sources = \
gailradiosubmenuitem.c \
gailrange.c \
gailrenderercell.c \
gailrenderercellfactory.c \
gailscale.c \
gailscrollbar.c \
gailscrolledwindow.c \
@ -63,7 +59,6 @@ gail_c_sources = \
gailsubmenuitem.c \
gailstatusbar.c \
gailtextcell.c \
gailtextcellfactory.c \
gailtextview.c \
gailtogglebutton.c \
gailtoplevel.c \
@ -79,7 +74,6 @@ gail_private_h_sources = \
gailadjustment.h \
gailarrow.h \
gailbooleancell.h \
gailbooleancellfactory.h \
gailbox.h \
gailbutton.h \
gailcalendar.h \
@ -99,7 +93,6 @@ gail_private_h_sources = \
gailframe.h \
gailimage.h \
gailimagecell.h \
gailimagecellfactory.h \
gailitem.h \
gaillabel.h \
gaillist.h \
@ -109,7 +102,6 @@ gail_private_h_sources = \
gailnotebook.h \
gailnotebookpage.h \
gailobject.h \
gailobjectfactory.h \
gailoptionmenu.h \
gailpaned.h \
gailpixmap.h \
@ -119,7 +111,6 @@ gail_private_h_sources = \
gailradiosubmenuitem.h \
gailrange.h \
gailrenderercell.h \
gailrenderercellfactory.h \
gailscale.h \
gailscrollbar.h \
gailscrolledwindow.h \
@ -128,7 +119,6 @@ gail_private_h_sources = \
gailsubmenuitem.h \
gailstatusbar.h \
gailtextcell.h \
gailtextcellfactory.h \
gailtextview.h \
gailtogglebutton.h \
gailtoplevel.h \

View File

@ -70,44 +70,49 @@ static guint focus_notify_handler = 0;
static guint focus_tracker_id = 0;
static GQuark quark_focus_object = 0;
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_WIDGET, gail_widget, gail_widget_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CONTAINER, gail_container, gail_container_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_BUTTON, gail_button, gail_button_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ITEM, gail_item, gail_item_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU_ITEM, gail_menu_item, gail_menu_item_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, gail_toggle_button, gail_toggle_button_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_IMAGE, gail_image, gail_image_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TEXT_VIEW, gail_text_view, gail_text_view_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_COMBO, gail_combo, gail_combo_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_COMBO_BOX, gail_combo_box, gail_combo_box_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ENTRY, gail_entry, gail_entry_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU_SHELL, gail_menu_shell, gail_menu_shell_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU, gail_menu, gail_menu_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_WINDOW, gail_window, gail_window_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RANGE, gail_range, gail_range_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCALE, gail_scale, gail_scale_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CLIST, gail_clist, gail_clist_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_LABEL, gail_label, gail_label_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_STATUSBAR, gail_statusbar, gail_statusbar_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_NOTEBOOK, gail_notebook, gail_notebook_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CALENDAR, gail_calendar, gail_calendar_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PROGRESS_BAR, gail_progress_bar, gail_progress_bar_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SPIN_BUTTON, gail_spin_button, gail_spin_button_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TREE_VIEW, gail_tree_view, gail_tree_view_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_FRAME, gail_frame, gail_frame_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RADIO_BUTTON, gail_radio_button, gail_radio_button_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ARROW, gail_arrow, gail_arrow_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PIXMAP, gail_pixmap, gail_pixmap_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SEPARATOR, gail_separator, gail_separator_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_BOX, gail_box, gail_box_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, gail_scrolled_window, gail_scrolled_window_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_LIST, gail_list, gail_list_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PANED, gail_paned, gail_paned_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCROLLBAR, gail_scrollbar, gail_scrollbar_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_OPTION_MENU, gail_option_menu, gail_option_menu_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CHECK_MENU_ITEM, gail_check_menu_item, gail_check_menu_item_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RADIO_MENU_ITEM, gail_radio_menu_item, gail_radio_menu_item_new)
GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_EXPANDER, gail_expander, gail_expander_new)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_OBJECT, GailObject, gail_object, GTK_TYPE_OBJECT)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BUTTON, GailButton, gail_button, GTK_TYPE_BUTTON)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ITEM, GailItem, gail_item, GTK_TYPE_ITEM)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_MENU_ITEM, GailMenuItem, gail_menu_item, gail_menu_item_new)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, GailToggleButton, gail_toggle_button, GTK_TYPE_TOGGLE_BUTTON)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_IMAGE, GailImage, gail_image, GTK_TYPE_IMAGE)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TEXT_VIEW, GailTextView, gail_text_view, GTK_TYPE_TEXT_VIEW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO, GailCombo, gail_combo, GTK_TYPE_COMBO)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO_BOX, GailComboBox, gail_combo_box, GTK_TYPE_COMBO_BOX)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ENTRY, GailEntry, gail_entry, GTK_TYPE_ENTRY)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GTK_TYPE_MENU_SHELL)
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_CLIST, GailCList, gail_clist, GTK_TYPE_CLIST)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LABEL, GailLabel, gail_label, GTK_TYPE_LABEL)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CALENDAR, GailCalendar, gail_calendar, GTK_TYPE_CALENDAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_bar, GTK_TYPE_PROGRESS_BAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SPIN_BUTTON, GailSpinButton, gail_spin_button, GTK_TYPE_SPIN_BUTTON)
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_ARROW, GailArrow, gail_arrow, GTK_TYPE_ARROW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PIXMAP, GailPixmap, gail_pixmap, GTK_TYPE_PIXMAP)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SEPARATOR, GailSeparator, gail_separator, GTK_TYPE_SEPARATOR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BOX, GailBox, gail_box, GTK_TYPE_BOX)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LIST, GailList, gail_list, GTK_TYPE_LIST)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLBAR, GailScrollbar, gail_scrollbar, GTK_TYPE_SCROLLBAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_OPTION_MENU, GailOptionMenu, gail_option_menu, GTK_TYPE_OPTION_MENU)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_CHECK_MENU_ITEM, GailCheckMenuItem, gail_check_menu_item, gail_check_menu_item_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_RADIO_MENU_ITEM, GailRadioMenuItem, gail_radio_menu_item, gail_radio_menu_item_new)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_EXPANDER, GailExpander, gail_expander, GTK_TYPE_EXPANDER)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_RENDERER_CELL, GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_RENDERER, gail_renderer_cell_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_BOOLEAN_CELL, GailBooleanCell, gail_boolean_cell, GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_IMAGE_CELL, GailImageCell, gail_image_cell, GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_TEXT_CELL, GailTextCell, gail_text_cell, GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell_new)
static AtkObject*
gail_get_accessible_for_widget (GtkWidget *widget,

View File

@ -1,7 +1,6 @@
#include <gail/gailadjustment.h>
#include <gail/gailarrow.h>
#include <gail/gailbooleancell.h>
#include <gail/gailbooleancellfactory.h>
#include <gail/gailbox.h>
#include <gail/gailbutton.h>
#include <gail/gailcalendar.h>
@ -18,7 +17,6 @@
#include <gail/gailframe.h>
#include <gail/gailimage.h>
#include <gail/gailimagecell.h>
#include <gail/gailimagecellfactory.h>
#include <gail/gailitem.h>
#include <gail/gaillabel.h>
#include <gail/gaillist.h>
@ -27,7 +25,6 @@
#include <gail/gailmenuitem.h>
#include <gail/gailnotebook.h>
#include <gail/gailobject.h>
#include <gail/gailobjectfactory.h>
#include <gail/gailoptionmenu.h>
#include <gail/gailpaned.h>
#include <gail/gailpixmap.h>
@ -35,7 +32,6 @@
#include <gail/gailradiobutton.h>
#include <gail/gailradiomenuitem.h>
#include <gail/gailrenderercell.h>
#include <gail/gailrenderercellfactory.h>
#include <gail/gailrange.h>
#include <gail/gailscale.h>
#include <gail/gailscrollbar.h>
@ -44,7 +40,6 @@
#include <gail/gailspinbutton.h>
#include <gail/gailstatusbar.h>
#include <gail/gailtextcell.h>
#include <gail/gailtextcellfactory.h>
#include <gail/gailtextview.h>
#include <gail/gailtogglebutton.h>
#include <gail/gailtoplevel.h>

View File

@ -70,8 +70,6 @@ gail_adjustment_new (GtkAdjustment *adjustment)
object = g_object_new (GAIL_TYPE_ADJUSTMENT, NULL);
g_return_val_if_fail (object != NULL, NULL);
atk_object = ATK_OBJECT (object);
atk_object_initialize (atk_object, adjustment);

View File

@ -24,6 +24,8 @@
static void gail_arrow_class_init (GailArrowClass *klass);
static void gail_arrow_init (GailArrow *arrow);
static void gail_arrow_initialize (AtkObject *accessible,
gpointer data);
/* AtkImage */
static void atk_image_interface_init (AtkImageIface *iface);
@ -41,6 +43,9 @@ static void
gail_arrow_class_init (GailArrowClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
atk_object_class->initialize = gail_arrow_initialize;
gobject_class->finalize = gail_arrow_finalize;
}
@ -51,21 +56,13 @@ gail_arrow_init (GailArrow *arrow)
arrow->image_description = NULL;
}
AtkObject*
gail_arrow_new (GtkWidget *widget)
static void
gail_arrow_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
ATK_OBJECT_CLASS (gail_arrow_parent_class)->initialize (accessible, data);
g_return_val_if_fail (GTK_IS_ARROW (widget), NULL);
object = g_object_new (GAIL_TYPE_ARROW, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
accessible->role = ATK_ROLE_ICON;
return accessible;
}
static void

View File

@ -51,8 +51,6 @@ struct _GailArrowClass
GailWidgetClass parent_class;
};
AtkObject* gail_arrow_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,80 +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 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 <gtk/gtkcellrenderertoggle.h>
#include "gailbooleancellfactory.h"
#include "gailbooleancell.h"
static void gail_boolean_cell_factory_class_init (GailBooleanCellFactoryClass *klass);
static AtkObject* gail_boolean_cell_factory_create_accessible (
GObject *obj);
static GType gail_boolean_cell_factory_get_accessible_type (void);
GType
gail_boolean_cell_factory_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (GailBooleanCellFactoryClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) gail_boolean_cell_factory_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (GailBooleanCellFactory), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
"GailBooleanCellFactory" , &tinfo, 0);
}
return type;
}
static void
gail_boolean_cell_factory_class_init (GailBooleanCellFactoryClass *klass)
{
AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
class->create_accessible = gail_boolean_cell_factory_create_accessible;
class->get_accessible_type = gail_boolean_cell_factory_get_accessible_type;
}
static AtkObject*
gail_boolean_cell_factory_create_accessible (GObject *obj)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER_TOGGLE (obj), NULL);
return gail_boolean_cell_new ();
}
static GType
gail_boolean_cell_factory_get_accessible_type (void)
{
return GAIL_TYPE_BOOLEAN_CELL;
}

View File

@ -1,56 +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_BOOLEAN_CELL_FACTORY_H__
#define __GAIL_BOOLEAN_CELL_FACTORY_H__
#include <atk/atkobjectfactory.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GAIL_TYPE_BOOLEAN_CELL_FACTORY (gail_boolean_cell_factory_get_type ())
#define GAIL_BOOLEAN_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactory))
#define GAIL_BOOLEAN_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactoryClass))
#define GAIL_IS_BOOLEAN_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY))
#define GAIL_IS_BOOLEAN_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_BOOLEAN_CELL_FACTORY))
#define GAIL_BOOLEAN_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactoryClass))
typedef struct _GailBooleanCellFactory GailBooleanCellFactory;
typedef struct _GailBooleanCellFactoryClass GailBooleanCellFactoryClass;
struct _GailBooleanCellFactory
{
AtkObjectFactory parent;
};
struct _GailBooleanCellFactoryClass
{
AtkObjectFactoryClass parent_class;
};
GType gail_boolean_cell_factory_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_BOOLEAN_CELL_FACTORY_H__ */

View File

@ -24,6 +24,8 @@
static void gail_box_class_init (GailBoxClass *klass);
static void gail_box_init (GailBox *box);
static void gail_box_initialize (AtkObject *accessible,
gpointer data);
static AtkStateSet* gail_box_ref_state_set (AtkObject *accessible);
G_DEFINE_TYPE (GailBox, gail_box, GAIL_TYPE_CONTAINER)
@ -33,6 +35,7 @@ gail_box_class_init (GailBoxClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_box_initialize;
class->ref_state_set = gail_box_ref_state_set;
}
@ -41,22 +44,13 @@ gail_box_init (GailBox *box)
{
}
AtkObject*
gail_box_new (GtkWidget *widget)
static void
gail_box_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_BOX (widget), NULL);
object = g_object_new (GAIL_TYPE_BOX, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_box_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_FILLER;
return accessible;
}
static AtkStateSet*

View File

@ -49,8 +49,6 @@ struct _GailBoxClass
GailContainerClass parent_class;
};
AtkObject* gail_box_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -184,22 +184,6 @@ gail_button_init (GailButton *button)
button->textutil = NULL;
}
AtkObject*
gail_button_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_BUTTON (widget), NULL);
object = g_object_new (GAIL_TYPE_BUTTON, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static G_CONST_RETURN gchar*
gail_button_get_name (AtkObject *obj)
{

View File

@ -67,8 +67,6 @@ struct _GailButtonClass
GailContainerClass parent_class;
};
AtkObject* gail_button_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -24,12 +24,17 @@
static void gail_calendar_class_init (GailCalendarClass *klass);
static void gail_calendar_init (GailCalendar *calendar);
static void gail_calendar_initialize (AtkObject *accessible,
gpointer data);
G_DEFINE_TYPE (GailCalendar, gail_calendar, GAIL_TYPE_WIDGET)
static void
gail_calendar_class_init (GailCalendarClass *klass)
{
AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
atk_object_class->initialize = gail_calendar_initialize;
}
static void
@ -37,20 +42,11 @@ gail_calendar_init (GailCalendar *calendar)
{
}
AtkObject*
gail_calendar_new (GtkWidget *widget)
static void
gail_calendar_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_CALENDAR (widget), NULL);
object = g_object_new (GAIL_TYPE_CALENDAR, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_calendar_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_CALENDAR;
return accessible;
}

View File

@ -49,8 +49,6 @@ struct _GailCalendarClass
GailWidgetClass parent_class;
};
AtkObject* gail_calendar_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -287,24 +287,6 @@ gail_clist_init (GailCList *clist)
{
}
AtkObject*
gail_clist_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_CLIST (widget), NULL);
object = g_object_new (GAIL_TYPE_CLIST, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
accessible->role = ATK_ROLE_TABLE;
return accessible;
}
static void
gail_clist_real_initialize (AtkObject *obj,
gpointer data)
@ -315,6 +297,8 @@ gail_clist_real_initialize (AtkObject *obj,
ATK_OBJECT_CLASS (gail_clist_parent_class)->initialize (obj, data);
obj->role = ATK_ROLE_TABLE;
clist = GAIL_CLIST (obj);
clist->caption = NULL;

View File

@ -62,8 +62,6 @@ struct _GailCListClass
GailContainerClass parent_class;
};
AtkObject* gail_clist_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -91,22 +91,6 @@ gail_combo_init (GailCombo *combo)
combo->select_idle_handler = 0;
}
AtkObject*
gail_combo_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_COMBO (widget), NULL);
object = g_object_new (GAIL_TYPE_COMBO, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_combo_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -57,8 +57,6 @@ struct _GailComboClass
GailContainerClass parent_class;
};
AtkObject* gail_combo_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -90,22 +90,6 @@ gail_combo_box_init (GailComboBox *combo_box)
combo_box->popup_set = FALSE;
}
AtkObject*
gail_combo_box_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_COMBO_BOX (widget), NULL);
object = g_object_new (GAIL_TYPE_COMBO_BOX, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_combo_box_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -58,8 +58,6 @@ struct _GailComboBoxClass
GailContainerClass parent_class;
};
AtkObject* gail_combo_box_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -70,23 +70,7 @@ gail_container_init (GailContainer *container)
container->children = NULL;
}
AtkObject*
gail_container_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_CONTAINER (widget), NULL);
object = g_object_new (GAIL_TYPE_CONTAINER, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static gint
static gint
gail_container_get_n_children (AtkObject* obj)
{
GtkWidget *widget;

View File

@ -62,8 +62,6 @@ struct _GailContainerClass
gpointer data);
};
AtkObject* gail_container_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -348,22 +348,6 @@ gail_entry_finalize (GObject *object)
G_OBJECT_CLASS (gail_entry_parent_class)->finalize (object);
}
AtkObject*
gail_entry_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_ENTRY (widget), NULL);
object = g_object_new (GAIL_TYPE_ENTRY, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static gint
gail_entry_get_index_in_parent (AtkObject *accessible)
{

View File

@ -68,8 +68,6 @@ struct _GailEntryClass
GailWidgetClass parent_class;
};
AtkObject* gail_entry_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -144,22 +144,6 @@ gail_expander_init (GailExpander *expander)
expander->textutil = NULL;
}
AtkObject*
gail_expander_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_EXPANDER (widget), NULL);
object = g_object_new (GAIL_TYPE_EXPANDER, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static G_CONST_RETURN gchar*
gail_expander_get_name (AtkObject *obj)
{

View File

@ -56,8 +56,6 @@ struct _GailExpanderClass
GailContainerClass parent_class;
};
AtkObject* gail_expander_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,5 +1,7 @@
/* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2002 Sun Microsystems Inc.
* Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
* Copyright (C) 2007 Christian Persch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -23,60 +25,83 @@
#include <glib-object.h>
#include <atk/atkobject.h>
#define GAIL_ACCESSIBLE_FACTORY(type, type_as_function, opt_create_accessible) \
\
static GType \
type_as_function ## _factory_get_accessible_type (void) \
{ \
return type; \
} \
\
static AtkObject* \
type_as_function ## _factory_create_accessible (GObject *obj) \
{ \
GtkWidget *widget; \
AtkObject *accessible; \
\
g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL); \
\
widget = GTK_WIDGET (obj); \
\
accessible = opt_create_accessible (widget); \
\
return accessible; \
} \
\
static void \
type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass) \
{ \
klass->create_accessible = type_as_function ## _factory_create_accessible; \
klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
} \
\
static GType \
type_as_function ## _factory_get_type (void) \
{ \
static GType t = 0; \
\
if (!t) \
{ \
char *name; \
static const GTypeInfo tinfo = \
{ \
sizeof (AtkObjectFactoryClass), \
NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \
}; \
\
name = g_strconcat (g_type_name (type), "Factory", NULL); \
t = g_type_register_static ( \
ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0); \
g_free (name); \
} \
\
return t; \
#define _GAIL_IMPLEMENT_FACTORY_CREATE_ACCESSIBLE(GAIL_TYPE, TYPE) \
{ \
AtkObject *accessible; \
\
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, TYPE), NULL); \
\
accessible = g_object_new (GAIL_TYPE, NULL); \
atk_object_initialize (accessible, object); \
\
return accessible; \
}
#define _GAIL_IMPLEMENT_FACTORY_BEGIN(GAIL_TYPE, TypeName, type_name) \
\
static GType \
type_name##_factory_get_accessible_type (void) \
{ \
return GAIL_TYPE; \
} \
\
static AtkObject* \
type_name##_factory_create_accessible (GObject *object) \
{
#define _GAIL_IMPLEMENT_FACTORY_END(GAIL_TYPE, TypeName, type_name) \
} \
\
static void \
type_name##_factory_class_init (AtkObjectFactoryClass *klass) \
{ \
klass->create_accessible = type_name ## _factory_create_accessible; \
klass->get_accessible_type = type_name ## _factory_get_accessible_type;\
} \
\
GType \
type_name##_factory_get_type (void) \
{ \
static volatile gsize g_define_type_id__volatile = 0; \
if (g_once_init_enter (&g_define_type_id__volatile)) \
{ \
GType g_define_type_id = \
g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY, \
g_intern_static_string (#TypeName "Factory"), \
sizeof (AtkObjectFactoryClass), \
(GClassInitFunc) type_name##_factory_class_init, \
sizeof (AtkObjectFactory), \
(GInstanceInitFunc) NULL, \
(GTypeFlags) 0); \
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
} \
return g_define_type_id__volatile; \
}
/* Implements a AtkObjectFactory creating accessibles of type
* @GAIL_TYPE for objects of type @TYPE.
*/
#define GAIL_IMPLEMENT_FACTORY(GAIL_TYPE, TypeName, type_name, TYPE) \
_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
_GAIL_IMPLEMENT_FACTORY_CREATE_ACCESSIBLE (GAIL_TYPE, TYPE) \
_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
/* Implements a AtkObjectFactory creating accessibles of type
* @GAIL_TYPE with creation func @create_accessible.
*/
#define GAIL_IMPLEMENT_FACTORY_WITH_FUNC(GAIL_TYPE, TypeName, type_name, create_accessible) \
_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
{ return create_accessible (GTK_WIDGET (object)); } \
_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
#define GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY(GAIL_TYPE, TypeName, type_name, TYPE, create_accessible) \
_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
{ \
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, TYPE), NULL);\
return create_accessible (); \
} \
_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
#define GAIL_WIDGET_SET_FACTORY(widget_type, type_as_function) \
atk_registry_set_factory_type (atk_get_default_registry (), \
widget_type, \

View File

@ -25,6 +25,8 @@
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 G_CONST_RETURN gchar* gail_frame_get_name (AtkObject *obj);
G_DEFINE_TYPE (GailFrame, gail_frame, GAIL_TYPE_CONTAINER)
@ -34,6 +36,7 @@ gail_frame_class_init (GailFrameClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_frame_initialize;
class->get_name = gail_frame_get_name;
}
@ -42,22 +45,13 @@ gail_frame_init (GailFrame *frame)
{
}
AtkObject*
gail_frame_new (GtkWidget *widget)
static void
gail_frame_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_FRAME (widget), NULL);
object = g_object_new (GAIL_TYPE_FRAME, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_frame_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_PANEL;
return accessible;
}
static G_CONST_RETURN gchar*

View File

@ -50,8 +50,6 @@ struct _GailFrameClass
GailContainerClass parent_class;
};
AtkObject* gail_frame_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -56,27 +56,16 @@ gail_html_box_class_init (GailHtmlBoxClass *klass)
class->initialize = gail_html_box_initialize;
}
AtkObject*
gail_html_box_new (GObject *obj)
{
GObject *object;
AtkObject *atk_object;
g_return_val_if_fail (HTML_IS_BOX (obj), NULL);
object = g_object_new (GAIL_TYPE_HTML_BOX, NULL);
atk_object = ATK_OBJECT (object);
atk_object_initialize (atk_object, obj);
atk_object->role = ATK_ROLE_UNKNOWN;
return atk_object;
}
static void
gail_html_box_initialize (AtkObject *obj,
gpointer data)
{
HtmlBox *box;
ATK_OBJECT_CLASS (gail_html_box_parent_class)->initialize (obj, data);
obj->role = ATK_ROLE_UNKNOWN;
box = HTML_BOX (data);
/*

View File

@ -48,8 +48,6 @@ struct _GailHtmlBoxClass
GType gail_html_box_get_type (void);
AtkObject* gail_html_box_new (GObject *obj);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -25,6 +25,8 @@
static void gail_image_class_init (GailImageClass *klass);
static void gail_image_init (GailImage *image);
static void gail_image_initialize (AtkObject *accessible,
gpointer data);
static G_CONST_RETURN gchar* gail_image_get_name (AtkObject *accessible);
@ -53,6 +55,7 @@ gail_image_class_init (GailImageClass *klass)
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
gobject_class->finalize = gail_image_finalize;
class->initialize = gail_image_initialize;
class->get_name = gail_image_get_name;
}
@ -62,22 +65,13 @@ gail_image_init (GailImage *image)
image->image_description = NULL;
}
AtkObject*
gail_image_new (GtkWidget *widget)
static void
gail_image_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_IMAGE (widget), NULL);
object = g_object_new (GAIL_TYPE_IMAGE, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_image_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_ICON;
return accessible;
}
/* Copied from gtktoolbar.c, keep in sync */

View File

@ -52,8 +52,6 @@ struct _GailImageClass
GailWidgetClass parent_class;
};
AtkObject* gail_image_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,81 +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 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 <gtk/gtkcellrendererpixbuf.h>
#include "gailimagecellfactory.h"
#include "gailimagecell.h"
static void gail_image_cell_factory_class_init (GailImageCellFactoryClass *klass);
static AtkObject* gail_image_cell_factory_create_accessible (
GObject *obj);
static GType gail_image_cell_factory_get_accessible_type (void);
GType
gail_image_cell_factory_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (GailImageCellFactoryClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) gail_image_cell_factory_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (GailImageCellFactory), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
"GailImageCellFactory" , &tinfo, 0);
}
return type;
}
static void
gail_image_cell_factory_class_init (GailImageCellFactoryClass *klass)
{
AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
class->create_accessible = gail_image_cell_factory_create_accessible;
class->get_accessible_type = gail_image_cell_factory_get_accessible_type;
}
static AtkObject*
gail_image_cell_factory_create_accessible (GObject *obj)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER_PIXBUF (obj), NULL);
return gail_image_cell_new ();
}
static GType
gail_image_cell_factory_get_accessible_type (void)
{
return GAIL_TYPE_IMAGE_CELL;
}

View File

@ -1,56 +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_IMAGE_CELL_FACTORY_H__
#define __GAIL_IMAGE_CELL_FACTORY_H__
#include <atk/atkobjectfactory.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GAIL_TYPE_IMAGE_CELL_FACTORY (gail_image_cell_factory_get_type ())
#define GAIL_IMAGE_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactory))
#define GAIL_IMAGE_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactoryClass))
#define GAIL_IS_IMAGE_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY))
#define GAIL_IS_IMAGE_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_IMAGE_CELL_FACTORY))
#define GAIL_IMAGE_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactoryClass))
typedef struct _GailImageCellFactory GailImageCellFactory;
typedef struct _GailImageCellFactoryClass GailImageCellFactoryClass;
struct _GailImageCellFactory
{
AtkObjectFactory parent;
};
struct _GailImageCellFactoryClass
{
AtkObjectFactoryClass parent_class;
};
GType gail_image_cell_factory_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_IMAGE_CELL_FACTORY_H__ */

View File

@ -116,22 +116,6 @@ gail_item_init (GailItem *item)
{
}
AtkObject*
gail_item_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_ITEM (widget), NULL);
object = g_object_new (GAIL_TYPE_ITEM, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_item_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -54,8 +54,6 @@ struct _GailItemClass
GailContainerClass parent_class;
};
AtkObject* gail_item_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -208,22 +208,6 @@ gail_label_init_text_util (GailLabel *gail_label,
gail_label->label_length = g_utf8_strlen (label_text, -1);
}
AtkObject*
gail_label_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_LABEL (widget), NULL);
object = g_object_new (GAIL_TYPE_LABEL, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
notify_name_change (AtkObject *atk_obj)
{

View File

@ -57,8 +57,6 @@ struct _GailLabelClass
GailWidgetClass parent_class;
};
AtkObject* gail_label_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -27,6 +27,9 @@ static void gail_list_class_init (GailListClass *klass);
static void gail_list_init (GailList *list);
static void gail_list_initialize (AtkObject *accessible,
gpointer data);
static gint gail_list_get_index_in_parent (AtkObject *accessible);
static void atk_selection_interface_init (AtkSelectionIface *iface);
@ -50,6 +53,7 @@ gail_list_class_init (GailListClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_list_initialize;
class->get_index_in_parent = gail_list_get_index_in_parent;
}
@ -58,22 +62,13 @@ gail_list_init (GailList *list)
{
}
AtkObject*
gail_list_new (GtkWidget *widget)
static void
gail_list_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_LIST (widget), NULL);
object = g_object_new (GAIL_TYPE_LIST, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_list_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_LIST;
return accessible;
}
static gint

View File

@ -49,8 +49,6 @@ struct _GailListClass
GailContainerClass parent_class;
};
AtkObject* gail_list_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -51,24 +51,6 @@ gail_menu_init (GailMenu *accessible)
{
}
AtkObject*
gail_menu_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_MENU (widget), NULL);
object = g_object_new (GAIL_TYPE_MENU, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
g_object_set_data (G_OBJECT (accessible), "atk-component-layer",
GINT_TO_POINTER (ATK_LAYER_POPUP));
return accessible;
}
static void
gail_menu_real_initialize (AtkObject *obj,
gpointer data)
@ -76,6 +58,9 @@ gail_menu_real_initialize (AtkObject *obj,
ATK_OBJECT_CLASS (gail_menu_parent_class)->initialize (obj, data);
obj->role = ATK_ROLE_MENU;
g_object_set_data (G_OBJECT (obj), "atk-component-layer",
GINT_TO_POINTER (ATK_LAYER_POPUP));
}
static AtkObject*

View File

@ -50,8 +50,6 @@ struct _GailMenuClass
GailMenuShellClass parent_class;
};
AtkObject* gail_menu_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -24,6 +24,8 @@
static void gail_menu_shell_class_init (GailMenuShellClass *klass);
static void gail_menu_shell_init (GailMenuShell *menu_shell);
static void gail_menu_shell_initialize (AtkObject *accessible,
gpointer data);
static void atk_selection_interface_init (AtkSelectionIface *iface);
static gboolean gail_menu_shell_add_selection (AtkSelection *selection,
gint i);
@ -42,6 +44,9 @@ G_DEFINE_TYPE_WITH_CODE (GailMenuShell, gail_menu_shell, GAIL_TYPE_CONTAINER,
static void
gail_menu_shell_class_init (GailMenuShellClass *klass)
{
AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
atk_object_class->initialize = gail_menu_shell_initialize;
}
static void
@ -49,28 +54,19 @@ gail_menu_shell_init (GailMenuShell *menu_shell)
{
}
AtkObject*
gail_menu_shell_new (GtkWidget *widget)
static void
gail_menu_shell_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
ATK_OBJECT_CLASS (gail_menu_shell_parent_class)->initialize (accessible, data);
g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), NULL);
object = g_object_new (GAIL_TYPE_MENU_SHELL, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
if (GTK_IS_MENU_BAR (widget))
if (GTK_IS_MENU_BAR (data))
accessible->role = ATK_ROLE_MENU_BAR;
else
/*
* Accessible object for Menu is created in gailmenu.c
*/
accessible->role = ATK_ROLE_UNKNOWN;
return accessible;
}
static void

View File

@ -50,8 +50,6 @@ struct _GailMenuShellClass
GailContainerClass parent_class;
};
AtkObject* gail_menu_shell_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -105,22 +105,6 @@ gail_notebook_init (GailNotebook *notebook)
notebook->idle_focus_id = 0;
}
AtkObject*
gail_notebook_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_NOTEBOOK (widget), NULL);
object = g_object_new (GAIL_TYPE_NOTEBOOK, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static AtkObject*
gail_notebook_ref_child (AtkObject *obj,
gint i)

View File

@ -63,8 +63,6 @@ struct _GailNotebookClass
GailContainerClass parent_class;
};
AtkObject* gail_notebook_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -31,19 +31,6 @@ static void gail_object_real_initialize (AtkObject *obj,
G_DEFINE_TYPE (GailObject, gail_object, ATK_TYPE_GOBJECT_ACCESSIBLE)
AtkObject*
gail_object_new (GObject *obj)
{
gpointer object;
AtkObject *atk_object;
g_return_val_if_fail (GTK_IS_OBJECT (obj), NULL);
object = g_object_new (GAIL_TYPE_OBJECT, NULL);
atk_object = ATK_OBJECT (object);
atk_object_initialize (atk_object, obj);
return atk_object;
}
static void
gail_object_class_init (GailObjectClass *klass)
{

View File

@ -48,8 +48,6 @@ struct _GailObjectClass
AtkGObjectAccessibleClass parent_class;
};
AtkObject* gail_object_new (GObject *obj);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,79 +0,0 @@
/* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2003 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 <gtk/gtk.h>
#include "gailobjectfactory.h"
#include "gailobject.h"
static void gail_object_factory_class_init (GailObjectFactoryClass *klass);
static AtkObject* gail_object_factory_create_accessible (GObject *obj);
static GType gail_object_factory_get_accessible_type (void);
GType
gail_object_factory_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (GailObjectFactoryClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) gail_object_factory_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (GailObjectFactory), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (
ATK_TYPE_OBJECT_FACTORY,
"GailObjectFactory" , &tinfo, 0);
}
return type;
}
static void
gail_object_factory_class_init (GailObjectFactoryClass *klass)
{
AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
class->create_accessible = gail_object_factory_create_accessible;
class->get_accessible_type = gail_object_factory_get_accessible_type;
}
static AtkObject*
gail_object_factory_create_accessible (GObject *obj)
{
return gail_object_new (obj);
}
static GType
gail_object_factory_get_accessible_type (void)
{
return GAIL_TYPE_OBJECT;
}

View File

@ -1,58 +0,0 @@
/* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2003 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_OBJECT_FACTORY_H__
#define __GAIL_OBJECT_FACTORY_H__
#include <atk/atkobjectfactory.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GAIL_TYPE_OBJECT_FACTORY (gail_object_factory_get_type ())
#define GAIL_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactory))
#define GAIL_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactoryClass))
#define GAIL_IS_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_OBJECT_FACTORY))
#define GAIL_IS_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_OBJECT_FACTORY))
#define GAIL_OBJECT_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactoryClass))
typedef struct _GailObjectFactory GailObjectFactory;
typedef struct _GailObjectFactoryClass GailObjectFactoryClass;
struct _GailObjectFactory
{
AtkObjectFactory parent;
};
struct _GailObjectFactoryClass
{
AtkObjectFactoryClass parent_class;
};
GType gail_object_factory_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_OBJECT_FACTORY_H__ */

View File

@ -78,22 +78,6 @@ gail_option_menu_init (GailOptionMenu *menu)
{
}
AtkObject*
gail_option_menu_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), NULL);
object = g_object_new (GAIL_TYPE_OPTION_MENU, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_option_menu_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -50,8 +50,6 @@ struct _GailOptionMenuClass
GailButtonClass parent_class;
};
AtkObject* gail_option_menu_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -61,22 +61,6 @@ gail_paned_init (GailPaned *paned)
{
}
AtkObject*
gail_paned_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_PANED (widget), NULL);
object = g_object_new (GAIL_TYPE_PANED, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static AtkStateSet*
gail_paned_ref_state_set (AtkObject *accessible)
{

View File

@ -49,8 +49,6 @@ struct _GailPanedClass
GailContainerClass parent_class;
};
AtkObject* gail_paned_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -24,6 +24,8 @@
static void gail_pixmap_class_init (GailPixmapClass *klass);
static void gail_pixmap_init (GailPixmap *pixmap);
static void gail_pixmap_initialize (AtkObject *accessible,
gpointer data);
/* AtkImage */
static void atk_image_interface_init (AtkImageIface *iface);
@ -49,7 +51,10 @@ static void
gail_pixmap_class_init (GailPixmapClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
atk_object_class->initialize = gail_pixmap_initialize;
gobject_class->finalize = gail_pixmap_finalize;
}
@ -59,23 +64,13 @@ gail_pixmap_init (GailPixmap *pixmap)
pixmap->image_description = NULL;
}
AtkObject*
gail_pixmap_new (GtkWidget *widget)
static void
gail_pixmap_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_assert (GTK_IS_PIXMAP (widget));
g_return_val_if_fail (GTK_IS_PIXMAP (widget), NULL);
object = g_object_new (GAIL_TYPE_PIXMAP, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_pixmap_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_ICON;
return accessible;
}
static void

View File

@ -52,12 +52,9 @@ struct _GailPixmapClass
GailWidgetClass parent_class;
};
AtkObject* gail_pixmap_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_PIXMAP_H__ */

View File

@ -70,22 +70,6 @@ gail_progress_bar_init (GailProgressBar *bar)
{
}
AtkObject*
gail_progress_bar_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (widget), NULL);
object = g_object_new (GAIL_TYPE_PROGRESS_BAR, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_progress_bar_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -52,13 +52,9 @@ struct _GailProgressBarClass
GailWidgetClass parent_class;
};
AtkObject* gail_progress_bar_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_PROGRESS_BAR_H__ */

View File

@ -24,6 +24,8 @@
static void gail_radio_button_class_init (GailRadioButtonClass *klass);
static void gail_radio_button_init (GailRadioButton *radio_button);
static void gail_radio_button_initialize (AtkObject *accessible,
gpointer data);
static AtkRelationSet* gail_radio_button_ref_relation_set (AtkObject *obj);
@ -34,32 +36,25 @@ gail_radio_button_class_init (GailRadioButtonClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_radio_button_initialize;
class->ref_relation_set = gail_radio_button_ref_relation_set;
}
AtkObject*
gail_radio_button_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_RADIO_BUTTON (widget), NULL);
object = g_object_new (GAIL_TYPE_RADIO_BUTTON, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
accessible->role = ATK_ROLE_RADIO_BUTTON;
return accessible;
}
static void
gail_radio_button_init (GailRadioButton *radio_button)
{
radio_button->old_group = NULL;
}
static void
gail_radio_button_initialize (AtkObject *accessible,
gpointer data)
{
ATK_OBJECT_CLASS (gail_radio_button_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_RADIO_BUTTON;
}
AtkRelationSet*
gail_radio_button_ref_relation_set (AtkObject *obj)
{

View File

@ -51,8 +51,6 @@ struct _GailRadioButtonClass
GailToggleButtonClass parent_class;
};
AtkObject* gail_radio_button_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -94,22 +94,6 @@ gail_range_init (GailRange *range)
{
}
AtkObject*
gail_range_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_RANGE (widget), NULL);
object = g_object_new (GAIL_TYPE_RANGE, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_range_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -56,8 +56,6 @@ struct _GailRangeClass
GailWidgetClass parent_class;
};
AtkObject* gail_range_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,80 +0,0 @@
/* GAIL - The GNOME Accessibility Enabling Library
* Copyright 2004 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 <gtk/gtkcellrenderer.h>
#include "gailrenderercellfactory.h"
#include "gailrenderercell.h"
static void gail_renderer_cell_factory_class_init (GailRendererCellFactoryClass *klass);
static AtkObject* gail_renderer_cell_factory_create_accessible (
GObject *obj);
static GType gail_renderer_cell_factory_get_accessible_type (void);
GType
gail_renderer_cell_factory_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (GailRendererCellFactoryClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) gail_renderer_cell_factory_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (GailRendererCellFactory), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
"GailRendererCellFactory" , &tinfo, 0);
}
return type;
}
static void
gail_renderer_cell_factory_class_init (GailRendererCellFactoryClass *klass)
{
AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
class->create_accessible = gail_renderer_cell_factory_create_accessible;
class->get_accessible_type = gail_renderer_cell_factory_get_accessible_type;
}
static AtkObject*
gail_renderer_cell_factory_create_accessible (GObject *obj)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER (obj), NULL);
return gail_renderer_cell_new ();
}
static GType
gail_renderer_cell_factory_get_accessible_type (void)
{
return GAIL_TYPE_RENDERER_CELL;
}

View File

@ -1,56 +0,0 @@
/* GAIL - The GNOME Accessibility Enabling Library
* Copyright 2004 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_FACTORY_H__
#define __GAIL_RENDERER_CELL_FACTORY_H__
#include <atk/atkobjectfactory.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GAIL_TYPE_RENDERER_CELL_FACTORY (gail_renderer_cell_factory_get_type ())
#define GAIL_RENDERER_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactory))
#define GAIL_RENDERER_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactoryClass))
#define GAIL_IS_RENDERER_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY))
#define GAIL_IS_RENDERER_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_RENDERER_CELL_FACTORY))
#define GAIL_RENDERER_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactoryClass))
typedef struct _GailRendererCellFactory GailRendererCellFactory;
typedef struct _GailRendererCellFactoryClass GailRendererCellFactoryClass;
struct _GailRendererCellFactory
{
AtkObjectFactory parent;
};
struct _GailRendererCellFactoryClass
{
AtkObjectFactoryClass parent_class;
};
GType gail_renderer_cell_factory_get_type (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_RENDERER_CELL_FACTORY_H__ */

View File

@ -96,22 +96,6 @@ gail_scale_class_init (GailScaleClass *klass)
gobject_class->notify = gail_scale_notify;
}
AtkObject*
gail_scale_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_RANGE (widget), NULL);
object = g_object_new (GAIL_TYPE_SCALE, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_scale_init (GailScale *scale)
{

View File

@ -52,8 +52,6 @@ struct _GailScaleClass
GailRangeClass parent_class;
};
AtkObject* gail_scale_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -24,6 +24,8 @@
static void gail_scrollbar_class_init (GailScrollbarClass *klass);
static void gail_scrollbar_init (GailScrollbar *accessible);
static void gail_scrollbar_initialize (AtkObject *accessible,
gpointer data);
static gint gail_scrollbar_get_index_in_parent (AtkObject *accessible);
@ -34,6 +36,7 @@ gail_scrollbar_class_init (GailScrollbarClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_scrollbar_initialize;
class->get_index_in_parent = gail_scrollbar_get_index_in_parent;
}
@ -42,22 +45,13 @@ gail_scrollbar_init (GailScrollbar *accessible)
{
}
AtkObject*
gail_scrollbar_new (GtkWidget *widget)
static void
gail_scrollbar_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_SCROLLBAR (widget), NULL);
object = g_object_new (GAIL_TYPE_SCROLLBAR, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_scrollbar_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_SCROLL_BAR;
return accessible;
}
static gint

View File

@ -50,8 +50,6 @@ struct _GailScrollbarClass
GailRangeClass parent_class;
};
AtkObject* gail_scrollbar_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -55,22 +55,6 @@ gail_scrolled_window_init (GailScrolledWindow *window)
{
}
AtkObject*
gail_scrolled_window_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_SCROLLED_WINDOW (widget), NULL);
object = g_object_new (GAIL_TYPE_SCROLLED_WINDOW, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_scrolled_window_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -49,8 +49,6 @@ struct _GailScrolledWindowClass
GailContainerClass parent_class;
};
AtkObject* gail_scrolled_window_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -24,6 +24,8 @@
static void gail_separator_class_init (GailSeparatorClass *klass);
static void gail_separator_init (GailSeparator *accessible);
static void gail_separator_initialize (AtkObject *accessible,
gpointer data);
static AtkStateSet* gail_separator_ref_state_set (AtkObject *accessible);
G_DEFINE_TYPE (GailSeparator, gail_separator, GAIL_TYPE_WIDGET)
@ -33,6 +35,7 @@ gail_separator_class_init (GailSeparatorClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_separator_initialize;
class->ref_state_set = gail_separator_ref_state_set;
}
@ -41,24 +44,13 @@ gail_separator_init (GailSeparator *accessible)
{
}
AtkObject*
gail_separator_new (GtkWidget *widget)
static void
gail_separator_initialize (AtkObject *accessible,
gpointer data)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_SEPARATOR (widget), NULL);
object = g_object_new (GAIL_TYPE_SEPARATOR, NULL);
g_return_val_if_fail (GTK_IS_ACCESSIBLE (object), NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
ATK_OBJECT_CLASS (gail_separator_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_SEPARATOR;
return accessible;
}
static AtkStateSet*

View File

@ -49,8 +49,6 @@ struct _GailSeparatorClass
GailWidgetClass parent_class;
};
AtkObject *gail_separator_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -71,22 +71,6 @@ gail_spin_button_init (GailSpinButton *button)
{
}
AtkObject*
gail_spin_button_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (widget), NULL);
object = g_object_new (GAIL_TYPE_SPIN_BUTTON, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_spin_button_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -51,8 +51,6 @@ struct _GailSpinButtonClass
GailEntryClass parent_class;
};
AtkObject* gail_spin_button_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -119,22 +119,6 @@ gail_statusbar_init (GailStatusbar *bar)
{
}
AtkObject*
gail_statusbar_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_STATUSBAR (widget), NULL);
object = g_object_new (GAIL_TYPE_STATUSBAR, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static G_CONST_RETURN gchar*
gail_statusbar_get_name (AtkObject *obj)
{

View File

@ -52,8 +52,6 @@ struct _GailStatusbarClass
GailContainerClass parent_class;
};
AtkObject* gail_statusbar_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,81 +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 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 <gtk/gtkcellrenderertext.h>
#include "gailtextcellfactory.h"
#include "gailtextcell.h"
static void gail_text_cell_factory_class_init (GailTextCellFactoryClass *klass);
static AtkObject* gail_text_cell_factory_create_accessible (
GObject *obj);
static GType gail_text_cell_factory_get_accessible_type (void);
GType
gail_text_cell_factory_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (GailTextCellFactoryClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) gail_text_cell_factory_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (GailTextCellFactory), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
"GailTextCellFactory" , &tinfo, 0);
}
return type;
}
static void
gail_text_cell_factory_class_init (GailTextCellFactoryClass *klass)
{
AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
class->create_accessible = gail_text_cell_factory_create_accessible;
class->get_accessible_type = gail_text_cell_factory_get_accessible_type;
}
static AtkObject*
gail_text_cell_factory_create_accessible (GObject *obj)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER_TEXT (obj), NULL);
return gail_text_cell_new ();
}
static GType
gail_text_cell_factory_get_accessible_type (void)
{
return GAIL_TYPE_TEXT_CELL;
}

View File

@ -1,56 +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_TEXT_CELL_FACTORY_H__
#define __GAIL_TEXT_CELL_FACTORY_H__
#include <atk/atkobjectfactory.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GAIL_TYPE_TEXT_CELL_FACTORY (gail_text_cell_factory_get_type ())
#define GAIL_TEXT_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_TEXT_CELL_FACTORY, GailTextCellFactory))
#define GAIL_TEXT_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_TEXT_CELL_FACTORY, GailTextCellFactoryClass))
#define GAIL_IS_TEXT_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_TEXT_CELL_FACTORY))
#define GAIL_IS_TEXT_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_TEXT_CELL_FACTORY))
#define GAIL_TEXT_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_TEXT_CELL_FACTORY, GailTextCellFactoryClass))
typedef struct _GailTextCellFactory GailTextCellFactory;
typedef struct _GailTextCellFactoryClass GailTextCellFactoryClass;
struct _GailTextCellFactory
{
AtkObjectFactory parent;
};
struct _GailTextCellFactoryClass
{
AtkObjectFactoryClass parent_class;
};
GType gail_text_cell_factory_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_TEXT_CELL_FACTORY_H__ */

View File

@ -265,22 +265,6 @@ gail_text_view_finalize (GObject *object)
G_OBJECT_CLASS (gail_text_view_parent_class)->finalize (object);
}
AtkObject*
gail_text_view_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_TEXT_VIEW (widget), NULL);
object = g_object_new (GAIL_TYPE_TEXT_VIEW, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_text_view_real_notify_gtk (GObject *obj,
GParamSpec *pspec)

View File

@ -62,8 +62,6 @@ struct _GailTextViewClass
GailContainerClass parent_class;
};
AtkObject* gail_text_view_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -57,22 +57,6 @@ gail_toggle_button_init (GailToggleButton *button)
{
}
AtkObject*
gail_toggle_button_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_TOGGLE_BUTTON (widget), NULL);
object = g_object_new (GAIL_TYPE_TOGGLE_BUTTON, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_toggle_button_real_initialize (AtkObject *obj,
gpointer data)

View File

@ -49,8 +49,6 @@ struct _GailToggleButtonClass
GailButtonClass parent_class;
};
AtkObject* gail_toggle_button_new( GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -26,6 +26,8 @@
static void gail_toplevel_class_init (GailToplevelClass *klass);
static void gail_toplevel_init (GailToplevel *toplevel);
static void gail_toplevel_initialize (AtkObject *accessible,
gpointer data);
static void gail_toplevel_object_finalize (GObject *obj);
/* atkobject.h */
@ -59,29 +61,13 @@ static gboolean is_combo_window (GtkWidget
G_DEFINE_TYPE (GailToplevel, gail_toplevel, ATK_TYPE_OBJECT)
AtkObject*
gail_toplevel_new (void)
{
GObject *object;
AtkObject *accessible;
object = g_object_new (GAIL_TYPE_TOPLEVEL, NULL);
g_return_val_if_fail ((object != NULL), NULL);
accessible = ATK_OBJECT (object);
accessible->role = ATK_ROLE_APPLICATION;
accessible->name = g_get_prgname();
accessible->accessible_parent = NULL;
return accessible;
}
static void
gail_toplevel_class_init (GailToplevelClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
class->initialize = gail_toplevel_initialize;
class->get_n_children = gail_toplevel_get_n_children;
class->ref_child = gail_toplevel_ref_child;
class->get_parent = gail_toplevel_get_parent;
@ -135,6 +121,17 @@ gail_toplevel_init (GailToplevel *toplevel)
gail_toplevel_hide_event_watcher, toplevel, (GDestroyNotify) NULL);
}
static void
gail_toplevel_initialize (AtkObject *accessible,
gpointer data)
{
ATK_OBJECT_CLASS (gail_toplevel_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_APPLICATION;
accessible->name = g_get_prgname();
accessible->accessible_parent = NULL;
}
static void
gail_toplevel_object_finalize (GObject *obj)
{

View File

@ -49,8 +49,6 @@ struct _GailToplevelClass
AtkObjectClass parent_class;
};
AtkObject *gail_toplevel_new(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -608,22 +608,6 @@ gail_tree_view_real_notify_gtk (GObject *obj,
GAIL_WIDGET_CLASS (gail_tree_view_parent_class)->notify_gtk (obj, pspec);
}
AtkObject*
gail_tree_view_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), NULL);
object = g_object_new (GAIL_TYPE_TREE_VIEW, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
return accessible;
}
static void
gail_tree_view_finalize (GObject *object)
{

View File

@ -66,8 +66,6 @@ struct _GailTreeViewClass
GailContainerClass parent_class;
};
AtkObject* gail_tree_view_new (GtkWidget *widget);
AtkObject* gail_tree_view_ref_focus_cell (GtkTreeView *treeview);
#ifdef __cplusplus

View File

@ -309,7 +309,10 @@ static AtkObject*
gail_util_get_root (void)
{
if (!root)
root = gail_toplevel_new();
{
root = g_object_new (GAIL_TYPE_TOPLEVEL, NULL);
atk_object_initialize (root, NULL);
}
return root;
}

View File

@ -174,35 +174,6 @@ gail_window_class_init (GailWindowClass *klass)
G_TYPE_NONE, 0);
}
AtkObject*
gail_window_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
gail_return_val_if_fail (widget != NULL, NULL);
/*
* A GailWindow can be created for a GtkHandleBox or a GtkWindow
*/
if (!GTK_IS_WINDOW (widget) &&
!GTK_IS_HANDLE_BOX (widget))
gail_return_val_if_fail (FALSE, NULL);
object = g_object_new (GAIL_TYPE_WINDOW, NULL);
accessible = ATK_OBJECT (object);
atk_object_initialize (accessible, widget);
/*
* Notify that tooltip is showing
*/
if (accessible->role == ATK_ROLE_TOOL_TIP &&
GTK_WIDGET_MAPPED (widget))
atk_object_notify_state_change (accessible, ATK_STATE_SHOWING, 1);
return accessible;
}
static void
gail_window_init (GailWindow *accessible)
{
@ -215,6 +186,13 @@ gail_window_real_initialize (AtkObject *obj,
GtkWidget *widget;
GailWindow *window;
/*
* A GailWindow can be created for a GtkHandleBox or a GtkWindow
*/
if (!GTK_IS_WINDOW (widget) &&
!GTK_IS_HANDLE_BOX (widget))
gail_return_if_fail (FALSE);
ATK_OBJECT_CLASS (gail_window_parent_class)->initialize (obj, data);
window = GAIL_WINDOW (obj);
@ -254,6 +232,13 @@ gail_window_real_initialize (AtkObject *obj,
else
obj->role = ATK_ROLE_FRAME;
}
/*
* Notify that tooltip is showing
*/
if (obj->role == ATK_ROLE_TOOL_TIP &&
GTK_WIDGET_MAPPED (widget))
atk_object_notify_state_change (obj, ATK_STATE_SHOWING, 1);
}
static void

View File

@ -53,8 +53,6 @@ struct _GailWindowClass
GailContainerClass parent_class;
};
AtkObject* gail_window_new (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */