DisplayAreaP.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these librararies and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: DisplayAreaP.h /main/18 1996/08/13 11:35:51 cde-hp $ */
  24. /************************************<+>*************************************
  25. ****************************************************************************
  26. **
  27. ** File: DisplayAreaP.h
  28. **
  29. ** Project: Cde Help System
  30. **
  31. ** Description: Defines the Display Area structures and defines.
  32. **
  33. ****************************************************************************
  34. ************************************<+>*************************************/
  35. /*
  36. * (c) Copyright 1996 Digital Equipment Corporation.
  37. * (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992,
  38. 1993, 1994, 1996 Hewlett-Packard Company.
  39. * (c) Copyright 1993, 1994, 1996 International Business Machines Corp.
  40. * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc.
  41. * (c) Copyright 1993, 1994, 1996 Novell, Inc.
  42. * (c) Copyright 1996 FUJITSU LIMITED.
  43. * (c) Copyright 1996 Hitachi.
  44. */
  45. #ifndef _DtHelpDisplayAreaP_h
  46. #define _DtHelpDisplayAreaP_h
  47. #include <X11/X.h>
  48. #include <Xm/XmP.h>
  49. #include <Dt/CanvasP.h>
  50. #include <DtI/GraphicsP.h>
  51. /*
  52. * Traversal flags
  53. */
  54. #define _DT_HELP_SHADOW_TRAVERSAL (1 << 0)
  55. #define _DT_HELP_NOT_INITIALIZED (1 << 1)
  56. #define _DT_HELP_TRAVERSAL_DRAWN (1 << 2)
  57. #define _DT_HELP_DRAW_TOC_IND (1 << 3)
  58. #define _DT_HELP_CLEAR_TOC_IND (1 << 4)
  59. #define _DT_HELP_TOC_ON (1 << 5)
  60. /*
  61. * enum states for selection
  62. */
  63. enum _DtHelpSelectState
  64. {
  65. _DtHelpNothingDoing,
  66. _DtHelpCopyOrLink,
  67. _DtHelpSelectingText
  68. };
  69. /*
  70. * Whether the display area has the focus or not
  71. */
  72. #define _DT_HELP_FOCUS_FLAG 0x04
  73. typedef struct {
  74. int used;
  75. int num_pixels;
  76. Pixmap pix;
  77. Pixmap mask;
  78. Dimension width;
  79. Dimension height;
  80. Pixel *pixels;
  81. } DtHelpGraphicStruct;
  82. typedef struct {
  83. _DtCvPointer font_ptr;
  84. int spc_idx;
  85. } DtHelpSpecialChars;
  86. typedef struct _dtHelpDAFontMetrics {
  87. _DtCvUnit ascent; /* Maximum ascent */
  88. _DtCvUnit descent; /* Maximum descent */
  89. _DtCvUnit average_width; /* Average width of a character */
  90. _DtCvUnit super; /* Offset from baseline for super scripts */
  91. _DtCvUnit sub; /* Offset from baseline for sub scripts */
  92. } _DtHelpDAFontMetrics;
  93. typedef struct {
  94. short inited;
  95. _DtHelpDAFontMetrics fm;
  96. } DtHelpDAFSMetrics;
  97. typedef struct _DtHelpDAfontInfo {
  98. char **exact_fonts; /* the list of fonts specified by the
  99. toss element rather than hints. */
  100. XrmDatabase def_font_db; /* The default font resource db */
  101. XrmDatabase font_idx_db; /* Which font index goes with which
  102. set of font resources */
  103. XFontStruct **font_structs; /* The font structures opened */
  104. XFontSet *font_sets; /* The font sets opened */
  105. DtHelpDAFSMetrics *fs_metrics;
  106. XrmQuark lang_charset; /* the char set for current lang */
  107. int *exact_idx; /* The indexes for the exact fonts */
  108. int max_structs; /* the max number of font_structs */
  109. int max_sets; /* The max number of font_sets */
  110. int struct_cnt; /* the cur number of font_structs */
  111. int set_cnt; /* The cur number of font_sets */
  112. long def_idx; /* The default index */
  113. } DtHelpDAFontInfo;
  114. /*
  115. * SelectionScroll structure
  116. */
  117. typedef struct {
  118. int horizontal_reason;
  119. int vertical_reason;
  120. } SelectionScrollStruct;
  121. /*
  122. * DisplayArea structure
  123. */
  124. typedef struct _dtHelpDispAreaStruct {
  125. Widget dispWid; /* The text and graphic area. */
  126. Widget vertScrollWid; /* The vertical scroll bar */
  127. Widget horzScrollWid; /* The horizontal scroll bar */
  128. Boolean vertIsMapped;
  129. Boolean horzIsMapped;
  130. short neededFlags; /* _DtHelpAS_NEEDED flags */
  131. short nl_to_space; /* are newlines in multibyte */
  132. /* strings turned into spaces? */
  133. Dimension formWidth; /* Pixel width of the parent area */
  134. Dimension formHeight; /* Pixel height of the parent area */
  135. Dimension dispWidth; /* Pixel width of the display area */
  136. Dimension dispHeight; /* Pixel height of the display area */
  137. Dimension dispUseHeight; /* Pixel height of the display area
  138. minus the decor margin. */
  139. Dimension dispUseWidth; /* Pixel width of the display area
  140. minus the decor margin. */
  141. Dimension marginWidth; /* Pixel padding at the left and
  142. right of the display area. */
  143. Dimension marginHeight; /* Pixel padding at the top and
  144. bottom of the display area. */
  145. short decorThickness; /* the shadow thickness plus highlight
  146. thickness of the display area */
  147. void (*hyperCall)(); /* The hypertext callback */
  148. void (*resizeCall)(); /* The resize callback */
  149. int (*exec_filter)(); /* The execution filter callback */
  150. XtPointer clientData; /* The client's data for the callback */
  151. Pixel traversalColor; /* The client's traversal color */
  152. Pixel foregroundColor; /* The client's foreground color */
  153. Pixel backgroundColor; /* The client's foreground color */
  154. Pixel searchColor; /* The client's search hilite color */
  155. GC pixmapGC;
  156. GC normalGC;
  157. GC invertGC;
  158. Pixmap def_pix; /* the default 'missing pixmap' */
  159. Dimension def_pix_width; /* the width of the default pixmap */
  160. Dimension def_pix_height; /* the height of the default pixmap */
  161. _DtGrContext *context; /* image converter context */
  162. Colormap colormap; /* The colormap to use */
  163. Visual *visual; /* The visual to use */
  164. DtHelpDAFontInfo font_info; /* The font information */
  165. int depth; /* The depth of the window */
  166. int fontAscent;
  167. int lineHeight;
  168. int leading;
  169. long charWidth; /* The average size of a character */
  170. int moveThreshold; /* The number of pixels that must
  171. be moved before a copy-paste
  172. action occurs. */
  173. int underLine;
  174. int lineThickness; /* For traversal box and underline */
  175. int firstVisible; /* The absolute number of the first
  176. line visible in the window. */
  177. int nextNonVisible; /* The absolute number of the first
  178. line non visible, next to the last
  179. visible window. */
  180. int visibleCount; /* The number of lines viewable */
  181. int maxYpos; /* Maximum Y positioning */
  182. int virtualX; /* The virtual x of the window */
  183. int maxX; /* The max virtual x of a line */
  184. int max_spc; /* The maximum special characters */
  185. int cur_spc; /* The current unused structure */
  186. int timerX; /* Used for button clicks/selections */
  187. int timerY; /* Used for button clicks/selections */
  188. int scr_timer_x; /* Used for button clicks/selections */
  189. int scr_timer_y; /* Used for button clicks/selections */
  190. int vert_init_scr; /* The initial vert scrolling timeout*/
  191. int vert_rep_scr; /* The repeat vert scrolling timeout */
  192. int horz_init_scr; /* The initial horz scrolling timeout*/
  193. int horz_rep_scr; /* The repeat horz scrolling timeout */
  194. _DtCvUnit toc_width; /* The width of the toc indicator */
  195. _DtCvUnit toc_height; /* The height of the toc indicator */
  196. _DtCvUnit toc_y; /* The y coordinate of the toc */
  197. _DtCvUnit toc_base; /* The baseline coordinate of the toc*/
  198. Time anchor_time; /* Indicates the primary selection
  199. time. */
  200. Boolean primary; /* Indicates if this widget has the
  201. primary selection */
  202. Boolean text_selected; /* Indicates if the selection has
  203. occurred */
  204. enum _DtHelpSelectState select_state;
  205. /* Indicates the state of the current
  206. selection. */
  207. short toc_flag; /* Indicates if the traversal indicator
  208. is always on. */
  209. _DtCvPointer toc_indicator; /* The indicator used in the toc */
  210. XtIntervalId scr_timer_id;
  211. SelectionScrollStruct scr_timer_data;
  212. DtHelpSpecialChars *spc_chars; /* Structure containing the spc chars */
  213. _DtCvHandle canvas;
  214. _DtCvTopicPtr lst_topic;
  215. wchar_t *cant_begin_chars; /* characters that cannot */
  216. /* begin a line of text */
  217. wchar_t *cant_end_chars; /* characters that cannot */
  218. /* end a line of text */
  219. short dtinfo; /* Indicates if being used by dtinfo */
  220. Pixmap stipple; /* stippled pixmap */
  221. /* callback to be called whenever you manipulate the display */
  222. /* area's vertical scrollbar directly using XtSetValues, */
  223. /* because the application (dtinfo) has callbacks on the */
  224. /* scrollbar, these do not get called when we adjust it with */
  225. /* XtSetValues() */
  226. void (*vScrollNotify)(void *,unsigned int);
  227. /* dtinfo requires this for doing link previews */
  228. void (*armCallback)(void*);
  229. _DtCvValue honor_size; /* Layout parameter for _DtCvSetTopic */
  230. _DtCvRenderType render_type; /* Render type performed on expose */
  231. unsigned short media_resolution; /* used for scaling images */
  232. } DtHelpDispAreaStruct;
  233. #endif /* _DtHelpDisplayAreaP_h */