michael@0: /* ATK - Accessibility Toolkit michael@0: * Copyright 2001 Sun Microsystems Inc. michael@0: * michael@0: * This library is free software; you can redistribute it and/or michael@0: * modify it under the terms of the GNU Library General Public michael@0: * License as published by the Free Software Foundation; either michael@0: * version 2 of the License, or (at your option) any later version. michael@0: * michael@0: * This library is distributed in the hope that it will be useful, michael@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of michael@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU michael@0: * Library General Public License for more details. michael@0: * michael@0: * You should have received a copy of the GNU Library General Public michael@0: * License along with this library; if not, write to the michael@0: * Free Software Foundation, Inc., 59 Temple Place - Suite 330, michael@0: * Boston, MA 02111-1307, USA. michael@0: */ michael@0: michael@0: #ifndef __ATK_COMPONENT_H__ michael@0: #define __ATK_COMPONENT_H__ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif /* __cplusplus */ michael@0: michael@0: /* michael@0: * The AtkComponent interface should be supported by any object that is michael@0: * rendered on the screen. The interface provides the standard mechanism michael@0: * for an assistive technology to determine and set the graphical michael@0: * representation of an object. michael@0: */ michael@0: michael@0: #define ATK_TYPE_COMPONENT (atk_component_get_type ()) michael@0: #define ATK_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT) michael@0: #define ATK_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent) michael@0: #define ATK_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface)) michael@0: michael@0: #ifndef _TYPEDEF_ATK_COMPONENT_ michael@0: #define _TYPEDEF_ATK_COMPONENT_ michael@0: typedef struct _AtkComponent AtkComponent; michael@0: #endif michael@0: typedef struct _AtkComponentIface AtkComponentIface; michael@0: michael@0: typedef void (*AtkFocusHandler) (AtkObject*, gboolean); michael@0: michael@0: typedef struct _AtkRectangle AtkRectangle; michael@0: michael@0: struct _AtkRectangle michael@0: { michael@0: gint x; michael@0: gint y; michael@0: gint width; michael@0: gint height; michael@0: }; michael@0: michael@0: GType atk_rectangle_get_type (void); michael@0: michael@0: #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ()) michael@0: struct _AtkComponentIface michael@0: { michael@0: GTypeInterface parent; michael@0: michael@0: guint (* add_focus_handler) (AtkComponent *component, michael@0: AtkFocusHandler handler); michael@0: michael@0: gboolean (* contains) (AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: AtkCoordType coord_type); michael@0: michael@0: AtkObject* (* ref_accessible_at_point) (AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: AtkCoordType coord_type); michael@0: void (* get_extents) (AtkComponent *component, michael@0: gint *x, michael@0: gint *y, michael@0: gint *width, michael@0: gint *height, michael@0: AtkCoordType coord_type); michael@0: void (* get_position) (AtkComponent *component, michael@0: gint *x, michael@0: gint *y, michael@0: AtkCoordType coord_type); michael@0: void (* get_size) (AtkComponent *component, michael@0: gint *width, michael@0: gint *height); michael@0: gboolean (* grab_focus) (AtkComponent *component); michael@0: void (* remove_focus_handler) (AtkComponent *component, michael@0: guint handler_id); michael@0: gboolean (* set_extents) (AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: gint width, michael@0: gint height, michael@0: AtkCoordType coord_type); michael@0: gboolean (* set_position) (AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: AtkCoordType coord_type); michael@0: gboolean (* set_size) (AtkComponent *component, michael@0: gint width, michael@0: gint height); michael@0: michael@0: AtkLayer (* get_layer) (AtkComponent *component); michael@0: gint (* get_mdi_zorder) (AtkComponent *component); michael@0: michael@0: /* michael@0: * signal handlers michael@0: */ michael@0: void (* bounds_changed) (AtkComponent *component, michael@0: AtkRectangle *bounds); michael@0: gdouble (* get_alpha) (AtkComponent *component); michael@0: }; michael@0: michael@0: GType atk_component_get_type (void); michael@0: michael@0: /* convenience functions */ michael@0: michael@0: guint atk_component_add_focus_handler (AtkComponent *component, michael@0: AtkFocusHandler handler); michael@0: gboolean atk_component_contains (AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: AtkCoordType coord_type); michael@0: AtkObject* atk_component_ref_accessible_at_point(AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: AtkCoordType coord_type); michael@0: void atk_component_get_extents (AtkComponent *component, michael@0: gint *x, michael@0: gint *y, michael@0: gint *width, michael@0: gint *height, michael@0: AtkCoordType coord_type); michael@0: void atk_component_get_position (AtkComponent *component, michael@0: gint *x, michael@0: gint *y, michael@0: AtkCoordType coord_type); michael@0: void atk_component_get_size (AtkComponent *component, michael@0: gint *width, michael@0: gint *height); michael@0: AtkLayer atk_component_get_layer (AtkComponent *component); michael@0: gint atk_component_get_mdi_zorder (AtkComponent *component); michael@0: gboolean atk_component_grab_focus (AtkComponent *component); michael@0: void atk_component_remove_focus_handler (AtkComponent *component, michael@0: guint handler_id); michael@0: gboolean atk_component_set_extents (AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: gint width, michael@0: gint height, michael@0: AtkCoordType coord_type); michael@0: gboolean atk_component_set_position (AtkComponent *component, michael@0: gint x, michael@0: gint y, michael@0: AtkCoordType coord_type); michael@0: gboolean atk_component_set_size (AtkComponent *component, michael@0: gint width, michael@0: gint height); michael@0: gdouble atk_component_get_alpha (AtkComponent *component); michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif /* __cplusplus */ michael@0: michael@0: michael@0: #endif /* __ATK_COMPONENT_H__ */