You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

172 lines
9.0 KiB

  1. /* ATK - Accessibility Toolkit
  2. * Copyright 2001 Sun Microsystems Inc.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
  20. #error "Only <atk/atk.h> can be included directly."
  21. #endif
  22. #ifndef __ATK_COMPONENT_H__
  23. #define __ATK_COMPONENT_H__
  24. #include <atk/atkobject.h>
  25. #include <atk/atkutil.h>
  26. G_BEGIN_DECLS
  27. /*
  28. * The AtkComponent interface should be supported by any object that is
  29. * rendered on the screen. The interface provides the standard mechanism
  30. * for an assistive technology to determine and set the graphical
  31. * representation of an object.
  32. */
  33. #define ATK_TYPE_COMPONENT (atk_component_get_type ())
  34. #define ATK_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
  35. #define ATK_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
  36. #define ATK_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
  37. #ifndef _TYPEDEF_ATK_COMPONENT_
  38. #define _TYPEDEF_ATK_COMPONENT_
  39. typedef struct _AtkComponent AtkComponent;
  40. #endif
  41. typedef struct _AtkComponentIface AtkComponentIface;
  42. typedef void (*AtkFocusHandler) (AtkObject*, gboolean);
  43. typedef struct _AtkRectangle AtkRectangle;
  44. struct _AtkRectangle
  45. {
  46. gint x;
  47. gint y;
  48. gint width;
  49. gint height;
  50. };
  51. GType atk_rectangle_get_type (void);
  52. #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
  53. struct _AtkComponentIface
  54. {
  55. GTypeInterface parent;
  56. guint (* add_focus_handler) (AtkComponent *component,
  57. AtkFocusHandler handler);
  58. gboolean (* contains) (AtkComponent *component,
  59. gint x,
  60. gint y,
  61. AtkCoordType coord_type);
  62. AtkObject* (* ref_accessible_at_point) (AtkComponent *component,
  63. gint x,
  64. gint y,
  65. AtkCoordType coord_type);
  66. void (* get_extents) (AtkComponent *component,
  67. gint *x,
  68. gint *y,
  69. gint *width,
  70. gint *height,
  71. AtkCoordType coord_type);
  72. void (* get_position) (AtkComponent *component,
  73. gint *x,
  74. gint *y,
  75. AtkCoordType coord_type);
  76. void (* get_size) (AtkComponent *component,
  77. gint *width,
  78. gint *height);
  79. gboolean (* grab_focus) (AtkComponent *component);
  80. void (* remove_focus_handler) (AtkComponent *component,
  81. guint handler_id);
  82. gboolean (* set_extents) (AtkComponent *component,
  83. gint x,
  84. gint y,
  85. gint width,
  86. gint height,
  87. AtkCoordType coord_type);
  88. gboolean (* set_position) (AtkComponent *component,
  89. gint x,
  90. gint y,
  91. AtkCoordType coord_type);
  92. gboolean (* set_size) (AtkComponent *component,
  93. gint width,
  94. gint height);
  95. AtkLayer (* get_layer) (AtkComponent *component);
  96. gint (* get_mdi_zorder) (AtkComponent *component);
  97. /*
  98. * signal handlers
  99. */
  100. void (* bounds_changed) (AtkComponent *component,
  101. AtkRectangle *bounds);
  102. gdouble (* get_alpha) (AtkComponent *component);
  103. };
  104. GType atk_component_get_type (void);
  105. /* convenience functions */
  106. guint atk_component_add_focus_handler (AtkComponent *component,
  107. AtkFocusHandler handler);
  108. gboolean atk_component_contains (AtkComponent *component,
  109. gint x,
  110. gint y,
  111. AtkCoordType coord_type);
  112. AtkObject* atk_component_ref_accessible_at_point(AtkComponent *component,
  113. gint x,
  114. gint y,
  115. AtkCoordType coord_type);
  116. void atk_component_get_extents (AtkComponent *component,
  117. gint *x,
  118. gint *y,
  119. gint *width,
  120. gint *height,
  121. AtkCoordType coord_type);
  122. void atk_component_get_position (AtkComponent *component,
  123. gint *x,
  124. gint *y,
  125. AtkCoordType coord_type);
  126. void atk_component_get_size (AtkComponent *component,
  127. gint *width,
  128. gint *height);
  129. AtkLayer atk_component_get_layer (AtkComponent *component);
  130. gint atk_component_get_mdi_zorder (AtkComponent *component);
  131. gboolean atk_component_grab_focus (AtkComponent *component);
  132. void atk_component_remove_focus_handler (AtkComponent *component,
  133. guint handler_id);
  134. gboolean atk_component_set_extents (AtkComponent *component,
  135. gint x,
  136. gint y,
  137. gint width,
  138. gint height,
  139. AtkCoordType coord_type);
  140. gboolean atk_component_set_position (AtkComponent *component,
  141. gint x,
  142. gint y,
  143. AtkCoordType coord_type);
  144. gboolean atk_component_set_size (AtkComponent *component,
  145. gint width,
  146. gint height);
  147. gdouble atk_component_get_alpha (AtkComponent *component);
  148. G_END_DECLS
  149. #endif /* __ATK_COMPONENT_H__ */