atktext.inc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. // included by atk.pp
  2. {
  3. AtkAttributeSet:
  4. This is a singly-linked list (a #GSList) of #AtkAttribute. It is
  5. used by atk_text_get_run_attributes(), atk_text_get_default_attributes()
  6. and atk_editable_text_set_run_attributes()
  7. }
  8. {$IFDEF read_forward_definitions}
  9. PAtkAttributeSet = ^TAtkAttributeSet;
  10. {$ENDIF read_forward_definitions}
  11. //------------------------------------------------------------------------------
  12. {$IFDEF read_interface_types}
  13. TAtkAttributeSet = TGSList;
  14. {
  15. AtkAttribute:
  16. @name: The attribute name. Call atk_text_attr_get_name()
  17. @value: the value of the attribute, represented as a string.
  18. Call atk_text_attr_get_value() for those which are strings.
  19. For values which are numbers, the string representation of the number
  20. is in value.
  21. A string name/value pair representing a text attribute.
  22. }
  23. PAtkAttribute = ^TAtkAttribute;
  24. TAtkAttribute = record
  25. name : Pgchar;
  26. value : Pgchar;
  27. end;
  28. {
  29. AtkTextAttribute
  30. @ATK_TEXT_ATTR_INVALID: Invalid attribute
  31. @ATK_TEXT_ATTR_LEFT_MARGIN: The pixel width of the left margin
  32. @ATK_TEXT_ATTR_RIGHT_MARGIN: The pixel width of the right margin
  33. @ATK_TEXT_ATTR_INDENT: The number of pixels that the text is indented
  34. @ATK_TEXT_ATTR_INVISIBLE: Either "true" or "false" indicating whether text is visible or not
  35. @ATK_TEXT_ATTR_EDITABLE: Either "true" or "false" indicating whether text is editable or not
  36. @ATK_TEXT_ATTR_PIXELS_ABOVE_LINES: Pixels of blank space to leave above each newline-terminated line.
  37. @ATK_TEXT_ATTR_PIXELS_BELOW_LINES: Pixels of blank space to leave below each newline-terminated line.
  38. @ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP: Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph).
  39. @ATK_TEXT_ATTR_BG_FULL_HEIGHT: "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character.
  40. @ATK_TEXT_ATTR_RISE: Number of pixels that the characters are risen above the baseline
  41. @ATK_TEXT_ATTR_UNDERLINE: "none", "single", "double" or "low"
  42. @ATK_TEXT_ATTR_STRIKETHROUGH: "true" or "false" whether the text is strikethrough
  43. @ATK_TEXT_ATTR_SIZE: The size of the characters.
  44. @ATK_TEXT_ATTR_SCALE: The scale of the characters. The value is a string representation of a double
  45. @ATK_TEXT_ATTR_WEIGHT: The weight of the characters.
  46. @ATK_TEXT_ATTR_LANGUAGE: The language used
  47. @ATK_TEXT_ATTR_FAMILY_NAME: The font family name
  48. @ATK_TEXT_ATTR_BG_COLOR: The background color. The value is an RGB value of the format "%u,%u,%u"
  49. @ATK_TEXT_ATTR_FG_COLOR:The foreground color. The value is an RGB value of the format "%u,%u,%u"
  50. @ATK_TEXT_ATTR_BG_STIPPLE: "true" if a #GdkBitmap is set for stippling the background color.
  51. @ATK_TEXT_ATTR_FG_STIPPLE: "true" if a #GdkBitmap is set for stippling the foreground color.
  52. @ATK_TEXT_ATTR_WRAP_MODE: The wrap mode of the text, if any. Values are "none", "char" or "word"
  53. @ATK_TEXT_ATTR_DIRECTION: The direction of the text, if set. Values are "none", "ltr" or "rtl"
  54. @ATK_TEXT_ATTR_JUSTIFICATION: The justification of the text, if set. Values are "left", "right", "center" or "fill"
  55. @ATK_TEXT_ATTR_STRETCH: The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" or "ultra_expanded"
  56. @ATK_TEXT_ATTR_VARIANT: The capitalization variant of the text, if set. Values are "normal" or "small_caps"
  57. @ATK_TEXT_ATTR_STYLE: The slant style of the text, if set. Values are "normal", "oblique" or "italic"
  58. @ATK_TEXT_ATTR_LAST_DEFINED: not a valid text attribute, used for finding theEnd of enumeration
  59. Describes the text attributes supported
  60. }
  61. PAtkTextAttribute = ^TAtkTextAttribute;
  62. TAtkTextAttribute = (
  63. ATK_TEXT_ATTR_INVALID {:= 0},
  64. ATK_TEXT_ATTR_LEFT_MARGIN,
  65. ATK_TEXT_ATTR_RIGHT_MARGIN,
  66. ATK_TEXT_ATTR_INDENT,
  67. ATK_TEXT_ATTR_INVISIBLE,
  68. ATK_TEXT_ATTR_EDITABLE,
  69. ATK_TEXT_ATTR_PIXELS_ABOVE_LINES,
  70. ATK_TEXT_ATTR_PIXELS_BELOW_LINES,
  71. ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP,
  72. ATK_TEXT_ATTR_BG_FULL_HEIGHT,
  73. ATK_TEXT_ATTR_RISE,
  74. ATK_TEXT_ATTR_UNDERLINE,
  75. ATK_TEXT_ATTR_STRIKETHROUGH,
  76. ATK_TEXT_ATTR_SIZE,
  77. ATK_TEXT_ATTR_SCALE,
  78. ATK_TEXT_ATTR_WEIGHT,
  79. ATK_TEXT_ATTR_LANGUAGE,
  80. ATK_TEXT_ATTR_FAMILY_NAME,
  81. ATK_TEXT_ATTR_BG_COLOR,
  82. ATK_TEXT_ATTR_FG_COLOR,
  83. ATK_TEXT_ATTR_BG_STIPPLE,
  84. ATK_TEXT_ATTR_FG_STIPPLE,
  85. ATK_TEXT_ATTR_WRAP_MODE,
  86. ATK_TEXT_ATTR_DIRECTION,
  87. ATK_TEXT_ATTR_JUSTIFICATION,
  88. ATK_TEXT_ATTR_STRETCH,
  89. ATK_TEXT_ATTR_VARIANT,
  90. ATK_TEXT_ATTR_STYLE,
  91. ATK_TEXT_ATTR_LAST_DEFINED
  92. );
  93. {
  94. AtkTextBoundary:
  95. @ATK_TEXT_BOUNDARY_CHAR:
  96. @ATK_TEXT_BOUNDARY_WORD_START:
  97. @ATK_TEXT_BOUNDARY_WORD_END:
  98. @ATK_TEXT_BOUNDARY_SENTENCE_START:
  99. @ATK_TEXT_BOUNDARY_SENTENCE_END:
  100. @ATK_TEXT_BOUNDARY_LINE_START:
  101. @ATK_TEXT_BOUNDARY_LINE_END:
  102. Text boundary types used for specifying boundaries for regions of text
  103. }
  104. PAtkTextBoundary = ^TAtkTextBoundary;
  105. TAtkTextBoundary = (
  106. ATK_TEXT_BOUNDARY_CHAR,
  107. ATK_TEXT_BOUNDARY_WORD_START,
  108. ATK_TEXT_BOUNDARY_WORD_END,
  109. ATK_TEXT_BOUNDARY_SENTENCE_START,
  110. ATK_TEXT_BOUNDARY_SENTENCE_END,
  111. ATK_TEXT_BOUNDARY_LINE_START,
  112. ATK_TEXT_BOUNDARY_LINE_END
  113. );
  114. {
  115. signal handlers
  116. }
  117. PAtkTextIface = ^TAtkTextIface;
  118. TAtkTextIface = record
  119. parent : TGTypeInterface;
  120. get_text : function (text:PAtkText; start_offset:gint; end_offset:gint):Pgchar; cdecl;
  121. get_text_after_offset : function (text:PAtkText; offset:gint; boundary_type:TAtkTextBoundary; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl;
  122. get_text_at_offset : function (text:PAtkText; offset:gint; boundary_type:TAtkTextBoundary; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl;
  123. get_character_at_offset : function (text:PAtkText; offset:gint):gunichar; cdecl;
  124. get_text_before_offset : function (text:PAtkText; offset:gint; boundary_type:TAtkTextBoundary; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl;
  125. get_caret_offset : function (text:PAtkText):gint; cdecl;
  126. get_run_attributes : function (text:PAtkText; offset:gint; start_offset:Pgint; end_offset:Pgint):PAtkAttributeSet; cdecl;
  127. get_default_attributes : function (text:PAtkText):PAtkAttributeSet; cdecl;
  128. get_character_extents : procedure (text:PAtkText; offset:gint; x:Pgint; y:Pgint; width:Pgint;
  129. height:Pgint; coords:TAtkCoordType); cdecl;
  130. get_character_count : function (text:PAtkText):gint; cdecl;
  131. get_offset_at_point : function (text:PAtkText; x:gint; y:gint; coords:TAtkCoordType):gint; cdecl;
  132. get_n_selections : function (text:PAtkText):gint; cdecl;
  133. get_selection : function (text:PAtkText; selection_num:gint; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl;
  134. add_selection : function (text:PAtkText; start_offset:gint; end_offset:gint):gboolean; cdecl;
  135. remove_selection : function (text:PAtkText; selection_num:gint):gboolean; cdecl;
  136. set_selection : function (text:PAtkText; selection_num:gint; start_offset:gint; end_offset:gint):gboolean; cdecl;
  137. set_caret_offset : function (text:PAtkText; offset:gint):gboolean; cdecl;
  138. text_changed : procedure (text:PAtkText; position:gint; length:gint); cdecl;
  139. text_caret_moved : procedure (text:PAtkText; location:gint); cdecl;
  140. text_selection_changed : procedure (text:PAtkText); cdecl;
  141. pad1 : TAtkFunction;
  142. pad2 : TAtkFunction;
  143. pad3 : TAtkFunction;
  144. pad4 : TAtkFunction;
  145. end;
  146. {$ENDIF read_interface_types}
  147. //------------------------------------------------------------------------------
  148. {$IFDEF read_interface_rest}
  149. function atk_text_attribute_register(name:Pgchar):TAtkTextAttribute; cdecl; external atklib;
  150. function ATK_TYPE_TEXT : GType;
  151. function ATK_IS_TEXT(obj: pointer) : boolean;
  152. function ATK_TEXT(obj: pointer) : PAtkText;
  153. function ATK_TEXT_GET_IFACE(obj: pointer) : PAtkTextIface;
  154. {
  155. Additional AtkObject properties used by AtkText:
  156. "accessible_text" (accessible text has changed)
  157. "accessible_caret" (accessible text cursor position changed:
  158. editable text only)
  159. }
  160. function atk_text_get_type:GType; cdecl; external atklib;
  161. function atk_text_get_text(text:PAtkText; start_offset:gint; end_offset:gint):Pgchar; cdecl; external atklib;
  162. function atk_text_get_character_at_offset(text:PAtkText; offset:gint):gunichar; cdecl; external atklib;
  163. function atk_text_get_text_after_offset(text:PAtkText; offset:gint; boundary_type:TAtkTextBoundary; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl; external atklib;
  164. function atk_text_get_text_at_offset(text:PAtkText; offset:gint; boundary_type:TAtkTextBoundary; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl; external atklib;
  165. function atk_text_get_text_before_offset(text:PAtkText; offset:gint; boundary_type:TAtkTextBoundary; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl; external atklib;
  166. function atk_text_get_caret_offset(text:PAtkText):gint; cdecl; external atklib;
  167. procedure atk_text_get_character_extents(text:PAtkText; offset:gint; x:Pgint; y:Pgint; width:Pgint;
  168. height:Pgint; coords:TAtkCoordType); cdecl; external atklib;
  169. function atk_text_get_run_attributes(text:PAtkText; offset:gint; start_offset:Pgint; end_offset:Pgint):PAtkAttributeSet; cdecl; external atklib;
  170. function atk_text_get_default_attributes(text:PAtkText):PAtkAttributeSet; cdecl; external atklib;
  171. function atk_text_get_character_count(text:PAtkText):gint; cdecl; external atklib;
  172. function atk_text_get_offset_at_point(text:PAtkText; x:gint; y:gint; coords:TAtkCoordType):gint; cdecl; external atklib;
  173. function atk_text_get_n_selections(text:PAtkText):gint; cdecl; external atklib;
  174. function atk_text_get_selection(text:PAtkText; selection_num:gint; start_offset:Pgint; end_offset:Pgint):Pgchar; cdecl; external atklib;
  175. function atk_text_add_selection(text:PAtkText; start_offset:gint; end_offset:gint):gboolean; cdecl; external atklib;
  176. function atk_text_remove_selection(text:PAtkText; selection_num:gint):gboolean; cdecl; external atklib;
  177. function atk_text_set_selection(text:PAtkText; selection_num:gint; start_offset:gint; end_offset:gint):gboolean; cdecl; external atklib;
  178. function atk_text_set_caret_offset(text:PAtkText; offset:gint):gboolean; cdecl; external atklib;
  179. procedure atk_attribute_set_free(attrib_set:PAtkAttributeSet); cdecl; external atklib;
  180. function atk_text_attribute_get_name(attr:TAtkTextAttribute):Pgchar; cdecl; external atklib;
  181. function atk_text_attribute_for_name(name:Pgchar):TAtkTextAttribute; cdecl; external atklib;
  182. function atk_text_attribute_get_value(attr:TAtkTextAttribute; index:gint):Pgchar; cdecl; external atklib;
  183. {$ENDIF read_interface_rest}
  184. //------------------------------------------------------------------------------
  185. {$IFDEF read_implementation}
  186. function ATK_TYPE_TEXT : GType;
  187. begin
  188. ATK_TYPE_TEXT:=atk_text_get_type;
  189. end;
  190. function ATK_IS_TEXT(obj: pointer) : boolean;
  191. begin
  192. ATK_IS_TEXT:=G_TYPE_CHECK_INSTANCE_TYPE(obj,ATK_TYPE_TEXT);
  193. end;
  194. function ATK_TEXT(obj: pointer) : PAtkText;
  195. begin
  196. ATK_TEXT:=PAtkText(G_TYPE_CHECK_INSTANCE_CAST(obj,ATK_TYPE_TEXT));
  197. end;
  198. function ATK_TEXT_GET_IFACE(obj: pointer) : PAtkTextIface;
  199. begin
  200. ATK_TEXT_GET_IFACE:=PAtkTextIface(G_TYPE_INSTANCE_GET_INTERFACE(obj,ATK_TYPE_TEXT));
  201. end;
  202. {$ENDIF read_implementation}