atkutil.inc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. // included by atk.pp
  2. {$IFDEF read_forward_definitions}
  3. {
  4. AtkCoordType:
  5. @ATK_XY_SCREEN: specifies xy coordinates relative to the screen
  6. @ATK_XY_WINDOW: specifies xy coordinates relative to the widgets
  7. top-level window
  8. Specifies how xy coordinates are to be interpreted. Used by functions such
  9. as atk_component_get_position() and atk_text_get_character_extents()
  10. }
  11. PAtkCoordType = ^TAtkCoordType;
  12. TAtkCoordType = (
  13. ATK_XY_SCREEN,
  14. ATK_XY_WINDOW
  15. );
  16. {$ENDIF read_forward_definitions}
  17. //------------------------------------------------------------------------------
  18. {$IFDEF read_interface_types}
  19. {
  20. A focus tracker is a function which is called when an anObject
  21. receives focus.
  22. }
  23. TAtkEventListener = procedure (para1:PAtkObject); cdecl;
  24. TAtkEventListenerInitProc = procedure;
  25. TAtkEventListenerInit = procedure (para1: TAtkEventListenerInitProc); cdecl;
  26. PAtkKeyEventStruct = ^TAtkKeyEventStruct;
  27. TAtkKeyEventStruct = record
  28. _type : gint;
  29. state : guint;
  30. keyval : guint;
  31. length : gint;
  32. _string : Pgchar;
  33. keycode : guint16;
  34. timestamp : guint32;
  35. end;
  36. TAtkKeySnoopFunc = function (event:PAtkKeyEventStruct; func_data:gpointer):gint; cdecl;
  37. PAtkKeyEventType = ^TAtkKeyEventType;
  38. TAtkKeyEventType = (
  39. ATK_KEY_EVENT_PRESS,
  40. ATK_KEY_EVENT_RELEASE,
  41. ATK_KEY_EVENT_LAST_DEFINED
  42. );
  43. PAtkUtil = ^TAtkUtil;
  44. TAtkUtil = record
  45. parent : TGObject;
  46. end;
  47. PAtkUtilClass = ^TAtkUtilClass;
  48. TAtkUtilClass = record
  49. parent : TGObjectClass;
  50. add_global_event_listener : function (listener:TGSignalEmissionHook; event_type:Pgchar):guint; cdecl;
  51. remove_global_event_listener : procedure (listener_id:guint); cdecl;
  52. add_key_event_listener : function (listener:TAtkKeySnoopFunc; data:gpointer):guint; cdecl;
  53. remove_key_event_listener : procedure (listener_id:guint); cdecl;
  54. get_root : function :PAtkObject; cdecl;
  55. get_toolkit_name : function :Pgchar; cdecl;
  56. get_toolkit_version : function :Pgchar; cdecl;
  57. end;
  58. {$ENDIF read_interface_types}
  59. //------------------------------------------------------------------------------
  60. {$IFDEF read_interface_rest}
  61. function ATK_TYPE_UTIL : GType;
  62. function ATK_IS_UTIL(obj: pointer) : boolean;
  63. function ATK_UTIL(obj: pointer) : PAtkUtil;
  64. function ATK_UTIL_CLASS(klass: pointer) : PAtkUtilClass;
  65. function ATK_IS_UTIL_CLASS(klass: pointer) : boolean;
  66. function ATK_UTIL_GET_CLASS(obj: pointer) : PAtkUtilClass;
  67. function atk_util_get_type:GType; cdecl; external atklib;
  68. {
  69. Adds the specified function to the list of functions to be called
  70. when an anObject receives focus.
  71. }
  72. function atk_add_focus_tracker(focus_tracker:TAtkEventListener):guint; cdecl; external atklib;
  73. {
  74. Removes the specified focus tracker from the list of function
  75. to be called when any anObject receives focus
  76. }
  77. procedure atk_remove_focus_tracker(tracker_id:guint); cdecl; external atklib;
  78. {
  79. Specifies the function to be called for focus tracker initialization.
  80. removal. This function should be called by an implementation of the
  81. ATK interface if any specific work needs to be done to enable
  82. focus tracking.
  83. }
  84. procedure atk_focus_tracker_init(add_function:TAtkEventListenerInit); cdecl; external atklib;
  85. {
  86. Cause the focus tracker functions which have been specified to be
  87. executed for the anObject.
  88. }
  89. procedure atk_focus_tracker_notify(anObject:PAtkObject); cdecl; external atklib;
  90. {
  91. Adds the specified function to the list of functions to be called
  92. when an event of type event_type occurs.
  93. }
  94. function atk_add_global_event_listener(listener:TGSignalEmissionHook; event_type:Pgchar):guint; cdecl; external atklib;
  95. {
  96. Removes the specified event listener
  97. }
  98. procedure atk_remove_global_event_listener(listener_id:guint); cdecl; external atklib;
  99. {
  100. Adds the specified function to the list of functions to be called
  101. when an keyboard event occurs.
  102. }
  103. function atk_add_key_event_listener(listener:TAtkKeySnoopFunc; data:gpointer):guint; cdecl; external atklib;
  104. {
  105. Removes the specified event listener
  106. }
  107. procedure atk_remove_key_event_listener(listener_id:guint); cdecl; external atklib;
  108. {
  109. Returns the root accessible container for the current application.
  110. }
  111. function atk_get_root:PAtkObject; cdecl; external atklib;
  112. {
  113. Returns name string for the GUI toolkit.
  114. }
  115. function atk_get_toolkit_name:Pgchar; cdecl; external atklib;
  116. {
  117. Returns version string for the GUI toolkit.
  118. }
  119. function atk_get_toolkit_version:Pgchar; cdecl; external atklib;
  120. {$ENDIF read_interface_rest}
  121. //------------------------------------------------------------------------------
  122. {$IFDEF read_implementation}
  123. function ATK_TYPE_UTIL : GType;
  124. begin
  125. ATK_TYPE_UTIL:=atk_util_get_type;
  126. end;
  127. function ATK_IS_UTIL(obj: pointer) : boolean;
  128. begin
  129. ATK_IS_UTIL:=G_TYPE_CHECK_INSTANCE_TYPE(obj,ATK_TYPE_UTIL);
  130. end;
  131. function ATK_UTIL(obj: pointer) : PAtkUtil;
  132. begin
  133. ATK_UTIL:=PAtkUtil(G_TYPE_CHECK_INSTANCE_CAST(obj,ATK_TYPE_UTIL));
  134. end;
  135. function ATK_UTIL_CLASS(klass: pointer) : PAtkUtilClass;
  136. begin
  137. ATK_UTIL_CLASS:=PAtkUtilClass(G_TYPE_CHECK_CLASS_CAST(klass,ATK_TYPE_UTIL));
  138. end;
  139. function ATK_IS_UTIL_CLASS(klass: pointer) : boolean;
  140. begin
  141. ATK_IS_UTIL_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,ATK_TYPE_UTIL);
  142. end;
  143. function ATK_UTIL_GET_CLASS(obj: pointer) : PAtkUtilClass;
  144. begin
  145. ATK_UTIL_GET_CLASS:=PAtkUtilClass(G_TYPE_INSTANCE_GET_CLASS(obj,ATK_TYPE_UTIL));
  146. end;
  147. {$ENDIF read_implementation}