SDLI.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  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 libraries 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: SDLI.h /main/7 1995/11/28 14:24:36 cde-hp $ */
  24. /*************************************<+>*************************************
  25. *****************************************************************************
  26. **
  27. ** File: SDLI.h
  28. **
  29. ** Project:
  30. **
  31. ** Description: Public Header file for Canvas.c
  32. **
  33. ** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
  34. **
  35. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  36. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  37. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  38. ** (c) Copyright 1993, 1994 Novell, Inc.
  39. **
  40. *******************************************************************
  41. *************************************<+>*************************************/
  42. #ifndef _DtHelpSDLI_h
  43. #define _DtHelpSDLI_h
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /*****************************************************************************
  48. * SDL DTD versioning defines
  49. *****************************************************************************/
  50. /*
  51. * The first version
  52. */
  53. #define SDL_DTD_VERSION 1
  54. /*
  55. * The first minor version
  56. */
  57. #define SDL_DTD_1_0 0
  58. /*
  59. * Virpage levels went from 1-n.
  60. * Any virpage with a level of
  61. * zero (or less) are hidden.
  62. */
  63. #define SDL_DTD_1_1 1
  64. /*****************************************************************************
  65. * Attribute type enumerations
  66. *****************************************************************************/
  67. enum SdlAttrDataType {
  68. /* bad data type */
  69. SdlAttrDataTypeInvalid,
  70. /* valid data types */
  71. SdlAttrDataTypeId , SdlAttrDataTypeNumber, SdlAttrDataTypeCdata,
  72. SdlAttrDataTypeFont, SdlAttrDataTypeEnum };
  73. /*****************************************************************************
  74. * Option enumerations
  75. *****************************************************************************/
  76. enum sdlOption
  77. {
  78. /*
  79. * all _DtCv enums are from the canvas engine
  80. */
  81. /* bad option indicator */
  82. SdlOptionBad = _DtCvOPTION_BAD,
  83. /* string breakng types */
  84. SdlLiteral = _DtCvLITERAL,
  85. SdlDynamic = _DtCvDYNAMIC,
  86. /* table border types */
  87. SdlBorderNone = _DtCvBORDER_NONE,
  88. SdlBorderFull = _DtCvBORDER_FULL,
  89. SdlBorderHorz = _DtCvBORDER_HORZ,
  90. SdlBorderVert = _DtCvBORDER_VERT,
  91. SdlBorderTop = _DtCvBORDER_TOP,
  92. SdlBorderBottom = _DtCvBORDER_BOTTOM,
  93. SdlBorderLeft = _DtCvBORDER_LEFT,
  94. SdlBorderRight = _DtCvBORDER_RIGHT,
  95. /* horizontal orientation */
  96. SdlJustifyLeftCorner = _DtCvJUSTIFY_LEFT_CORNER,
  97. SdlJustifyLeft = _DtCvJUSTIFY_LEFT,
  98. SdlJustifyLeftMargin = _DtCvJUSTIFY_LEFT_MARGIN,
  99. SdlJustifyCenter = _DtCvJUSTIFY_CENTER,
  100. SdlJustifyRightMargin = _DtCvJUSTIFY_RIGHT_MARGIN,
  101. SdlJustifyRight = _DtCvJUSTIFY_RIGHT,
  102. SdlJustifyRightCorner = _DtCvJUSTIFY_RIGHT_CORNER,
  103. /* extra horizontal text placement */
  104. SdlJustifyNum = _DtCvJUSTIFY_NUM,
  105. /* extra vertical orientation */
  106. SdlJustifyTop = _DtCvJUSTIFY_TOP,
  107. SdlJustifyBottom = _DtCvJUSTIFY_BOTTOM,
  108. /* flow types */
  109. SdlWrap = _DtCvWRAP,
  110. SdlNoWrap = _DtCvWRAP_NONE,
  111. SdlWrapJoin = _DtCvWRAP_JOIN,
  112. /* SDL specific options */
  113. /* Boolean */
  114. SdlBoolYes , SdlBoolNo ,
  115. /* key classes */
  116. SdlClassAcro , SdlClassBook , SdlClassEmph , SdlClassJargon ,
  117. SdlClassL10n , SdlClassName , SdlClassQuote , SdlClassProduct,
  118. SdlClassTermdef , SdlClassTerm , SdlClassMachIn , SdlClassMachOut,
  119. SdlClassMachCont, SdlClassPubLit , SdlClassUdefkey ,
  120. /* head classes */
  121. SdlClassLabel , SdlClassHead , SdlClassCaption ,
  122. SdlClassAnnotation, SdlClassPHead, SdlClassUdefhead,
  123. /* format classes */
  124. SdlClassTable , SdlClassCell , SdlClassList,
  125. SdlClassItem , SdlClassText , SdlClassUdeffrmt,
  126. /* graphic classes */
  127. SdlClassFigure, SdlClassInLine , SdlClassButton ,
  128. SdlClassIcon , SdlClassUdefgraph,
  129. /* phrase styles */
  130. SdlClassSuper , SdlClassSub ,
  131. /* apps types */
  132. SdlAppAll , SdlAppHelp , SdlAppTutorial ,
  133. SdlAppRef , SdlAppSys ,
  134. /* timing */
  135. SdlTimingSync , SdlTimingAsync ,
  136. /* types */
  137. SdlTypeLiteral , SdlTypeLined ,
  138. SdlTypeDynamic , SdlTypeUnlinedLiteral,
  139. SdlTypeCdata ,
  140. /* links */
  141. SdlWindowCurrent , SdlWindowNew, SdlWindowPopup,
  142. /* traversal */
  143. SdlTraversalReturn, SdlTraversalNoReturn,
  144. /* <id> types */
  145. SdlIdVirpage , SdlIdBlock , SdlIdForm , SdlIdPara ,
  146. SdlIdCPara , SdlIdHead , SdlIdSubHead , SdlIdAnchor ,
  147. SdlIdSwitch , SdlIdSnRef , SdlIdGraphic , SdlIdText ,
  148. SdlIdAudio , SdlIdVideo , SdlIdAnimate ,
  149. SdlIdCrossDoc, SdlIdManPage , SdlIdTextFile,
  150. SdlIdSysCmd , SdlIdScript , SdlIdCallback,
  151. /* <script> interpreter types */
  152. SdlInterpKsh, SdlInterpTcl, SdlInterpCsh, SdlInterpSh,
  153. /* <headstyle> placement types */
  154. SdlPlaceParent, SdlPlaceObject,
  155. /* <headstyle> stack types */
  156. SdlStackHoriz , SdlStackVert
  157. };
  158. typedef enum sdlOption SdlOption;
  159. /*****************************************************************************
  160. * SDL Element enumerations
  161. *****************************************************************************/
  162. enum SdlElement
  163. {
  164. SdlElementNone,
  165. SdlElementComment,
  166. SdlElementSdlDoc,
  167. SdlElementVStruct,
  168. SdlElementVirpage,
  169. SdlElementHead,
  170. SdlElementSubHead,
  171. SdlElementSnb,
  172. SdlElementBlock,
  173. SdlElementForm,
  174. SdlElementPara,
  175. SdlElementCPara,
  176. SdlElementFdata,
  177. SdlElementFstyle,
  178. SdlElementFrowvec,
  179. SdlElementKey,
  180. SdlElementCdata,
  181. /* System notations */
  182. SdlElementGraphic,
  183. SdlElementText,
  184. SdlElementAudio,
  185. SdlElementVideo,
  186. SdlElementAnimate,
  187. SdlElementCrossDoc,
  188. SdlElementManPage,
  189. SdlElementTextFile,
  190. SdlElementSysCmd,
  191. SdlElementCallback,
  192. SdlElementScript,
  193. /* System notations (end) */
  194. SdlElementAnchor,
  195. SdlElementLink,
  196. SdlElementSwitch,
  197. SdlElementSnRef,
  198. SdlElementRefItem,
  199. SdlElementAltText,
  200. SdlElementSphrase,
  201. SdlElementRev,
  202. SdlElementSpc,
  203. /* Conditionals */
  204. SdlElementIf,
  205. SdlElementCond,
  206. SdlElementThen,
  207. SdlElementElse,
  208. /* Conditionals (end) */
  209. /* The sgml header to the document */
  210. SdlElementDocument,
  211. SdlElementSgml,
  212. SdlElementDocType,
  213. /* Generated elements in the document */
  214. SdlElementLoids,
  215. SdlElementToss,
  216. SdlElementLoPhrases,
  217. SdlElementPhrase,
  218. SdlElementIndex,
  219. SdlElementEntry,
  220. SdlElementRelDocs,
  221. SdlElementRelFile,
  222. SdlElementNotes,
  223. /* Generated elements (end) */
  224. /* Table of styles and sematics. */
  225. SdlElementKeyStyle,
  226. SdlElementHeadStyle,
  227. SdlElementFormStyle,
  228. SdlElementFrmtStyle,
  229. SdlElementGrphStyle,
  230. /* Table of styles and sematics.(end) */
  231. SdlElementId,
  232. /* Support asyncronous blocks */
  233. SdlElementBlockAsync,
  234. /* Support getting the title of a virpage */
  235. SdlElementTitle,
  236. /* Support content that has optional markup followed by PCDATA */
  237. SdlPcDataFollows
  238. };
  239. /******** Private Defines Declarations ********/
  240. /* sort of enumerated types */
  241. #define ENUM_VALUE 0x01
  242. #define NUMBER_VALUE 0x02
  243. #define STRING1_VALUE 0x03
  244. #define STRING2_VALUE 0x04
  245. #define VALUE_MASK 0x07
  246. #define VALUE_TYPE_SHIFT 3
  247. #define MINOR_MASK (0x07 << VALUE_TYPE_SHIFT)
  248. #define SET_ENUM_ATTR(x) ((x) << VALUE_TYPE_SHIFT | ENUM_VALUE)
  249. #define SET_NUMBER_ATTR(x) ((x) << VALUE_TYPE_SHIFT | NUMBER_VALUE)
  250. #define SET_STRING_ATTR(x) ((x) << VALUE_TYPE_SHIFT | STRING1_VALUE)
  251. #define SET_STRING2_ATTR(x) ((x) << VALUE_TYPE_SHIFT | STRING2_VALUE)
  252. #define ATTRS_EQUAL(type, x, y) \
  253. (((type) != SdlAttrDataTypeEnum) ? \
  254. ((x) == (y) ? 1 : 0) : \
  255. (((((x) & VALUE_MASK) == ((y) & VALUE_MASK)) && \
  256. ((x) & (y) & ~(VALUE_MASK))) ? 1 : 0))
  257. #define SDLIsString1(x) ((((x) & VALUE_MASK) == STRING1_VALUE) ? 1 : 0)
  258. #define SDLIsString2(x) ((((x) & VALUE_MASK) == STRING2_VALUE) ? 1 : 0)
  259. #define SDLIsStrAttrSet(pa, attr) \
  260. (((((attr) & VALUE_MASK)==STRING1_VALUE) ? ((pa).str1_values & attr) : \
  261. ((((attr) & VALUE_MASK)==STRING2_VALUE) ? \
  262. ((pa).str2_values & attr) : 0)) & (~VALUE_MASK))
  263. #define SDLIsAttrSet(pa, attr) \
  264. (((((attr) & VALUE_MASK)==ENUM_VALUE) ? ((pa).enum_values & attr) : \
  265. ((((attr) & VALUE_MASK)==NUMBER_VALUE) ? ((pa).num_values & attr) : \
  266. ((((attr) & VALUE_MASK)==STRING1_VALUE) ? ((pa).str1_values & attr) : \
  267. ((pa).str2_values & attr)))) & (~VALUE_MASK))
  268. #define SDLAttrFlagType(x) ((x) & VALUE_MASK)
  269. /************************************************************************
  270. * Enum types
  271. ************************************************************************/
  272. /*
  273. * this set has the same attribute 'class',
  274. * but each has a different set of values.
  275. */
  276. #define SDL_ATTR_CLASS SET_ENUM_ATTR(1 << 3)
  277. #define SDL_ATTR_CLASSALL (SDL_ATTR_CLASS)
  278. #define SDL_ATTR_CLASSH SET_ENUM_ATTR((1 << 3) | 0x01)
  279. #define SDL_ATTR_CLASSF SET_ENUM_ATTR((1 << 3) | 0x02)
  280. #define SDL_ATTR_CLASSK SET_ENUM_ATTR((1 << 3) | 0x03)
  281. #define SDL_ATTR_CLASSG SET_ENUM_ATTR((1 << 3) | 0x04)
  282. #define SDL_ATTR_CLASSFG SET_ENUM_ATTR((1 << 3) | 0x05)
  283. #define SDL_ATTR_CLASSP SET_ENUM_ATTR((1 << 3) | 0x06)
  284. /*
  285. * this set has the same attribute 'type',
  286. * but each has a different set of values.
  287. */
  288. #define SDL_ATTR_TYPE SET_ENUM_ATTR((1 << 4) | 0x00)
  289. #define SDL_ATTR_TYPEFRMT SET_ENUM_ATTR((1 << 4) | 0x01)
  290. #define SDL_ATTR_TYPEID SET_ENUM_ATTR((1 << 4) | 0x02)
  291. #define SDL_ATTR_APP SET_ENUM_ATTR(1 << 5)
  292. #define SDL_ATTR_TIMING SET_ENUM_ATTR(1 << 6)
  293. #define SDL_ATTR_HDR SET_ENUM_ATTR(1 << 7)
  294. /* Format Style Attributes */
  295. #define SDL_ATTR_BORDER SET_ENUM_ATTR(1 << 8)
  296. #define SDL_ATTR_JUSTIFY SET_ENUM_ATTR((1 << 9) | 0x00)
  297. #define SDL_ATTR_JUSTIFY1 SET_ENUM_ATTR((1 << 9) | 0x01)
  298. #define SDL_ATTR_JUSTIFY2 SET_ENUM_ATTR((1 << 9) | 0x02)
  299. #define SDL_ATTR_VJUST SET_ENUM_ATTR(1 << 10)
  300. /* Head Style Attributes */
  301. #define SDL_ATTR_ORIENT SET_ENUM_ATTR(1 << 11)
  302. #define SDL_ATTR_VORIENT SET_ENUM_ATTR(1 << 12)
  303. #define SDL_ATTR_FLOW SET_ENUM_ATTR(1 << 13)
  304. #define SDL_ATTR_WINDOW SET_ENUM_ATTR(1 << 14)
  305. #define SDL_ATTR_PLACEMENT SET_ENUM_ATTR(1 << 15)
  306. #define SDL_ATTR_STACK SET_ENUM_ATTR(1 << 16)
  307. /* Link Attribute */
  308. #define SDL_ATTR_TRAVERSAL SET_ENUM_ATTR(1 << 17)
  309. /* Font Style Attributes */
  310. #define SDL_ATTR_STYLE SET_ENUM_ATTR(1 << 18)
  311. #define SDL_ATTR_SPACING SET_ENUM_ATTR(1 << 19)
  312. #define SDL_ATTR_WEIGHT SET_ENUM_ATTR(1 << 20)
  313. #define SDL_ATTR_SLANT SET_ENUM_ATTR(1 << 21)
  314. #define SDL_ATTR_SPECIAL SET_ENUM_ATTR(1 << 22)
  315. #define SDL_ATTR_INTERP SET_ENUM_ATTR(1 << 23)
  316. /************************************************************************
  317. * number types
  318. ************************************************************************/
  319. /*
  320. * LEVEL and RLEVEL share the same data element in the structure
  321. */
  322. #define SDL_ATTR_LEVEL SET_NUMBER_ATTR(1 << 3)
  323. #define SDL_ATTR_RLEVEL SET_NUMBER_ATTR(1 << 4)
  324. #define SDL_ATTR_LENGTH SET_NUMBER_ATTR(1 << 5)
  325. #define SDL_ATTR_NCOLS SET_NUMBER_ATTR(1 << 6)
  326. #define SDL_ATTR_COUNT SET_NUMBER_ATTR(1 << 7)
  327. /* Font Style Attributes */
  328. #define SDL_ATTR_POINTSZ SET_NUMBER_ATTR(1 << 8)
  329. #define SDL_ATTR_SETWIDTH SET_NUMBER_ATTR(1 << 9)
  330. /* Format Style Attributes */
  331. #define SDL_ATTR_FMARGIN SET_NUMBER_ATTR(1 << 10)
  332. #define SDL_ATTR_LMARGIN SET_NUMBER_ATTR(1 << 11)
  333. #define SDL_ATTR_RMARGIN SET_NUMBER_ATTR(1 << 12)
  334. #define SDL_ATTR_TMARGIN SET_NUMBER_ATTR(1 << 13)
  335. #define SDL_ATTR_BMARGIN SET_NUMBER_ATTR(1 << 14)
  336. #define SDL_ATTR_SRCHWT SET_NUMBER_ATTR(1 << 15)
  337. #define SDL_ATTR_OFFSET SET_NUMBER_ATTR(1 << 16)
  338. /* Head Style Attributes */
  339. #define SDL_ATTR_HEADWDTH SET_NUMBER_ATTR(1 << 17)
  340. /************************************************************************
  341. * string1 types
  342. ************************************************************************/
  343. #define SDL_ATTR_VERSION SET_STRING_ATTR(1 << 0)
  344. #define SDL_ATTR_LANGUAGE SET_STRING_ATTR(1 << 1)
  345. #define SDL_ATTR_DOCID SET_STRING_ATTR(1 << 2)
  346. /* style attr */
  347. #define SDL_ATTR_PHRASE SET_STRING_ATTR(1 << 3)
  348. /* refitem */
  349. #define SDL_ATTR_BUTTON SET_STRING_ATTR(1 << 4)
  350. /* link */
  351. #define SDL_ATTR_DESCRIPT SET_STRING_ATTR(1 << 5)
  352. #define SDL_ATTR_LINKINFO SET_STRING_ATTR(1 << 6)
  353. /* Font Style Attributes */
  354. #define SDL_ATTR_COLOR SET_STRING_ATTR(1 << 7)
  355. #define SDL_ATTR_XLFD SET_STRING_ATTR(1 << 8)
  356. #define SDL_ATTR_XLFDI SET_STRING_ATTR(1 << 9)
  357. #define SDL_ATTR_XLFDB SET_STRING_ATTR(1 << 10)
  358. #define SDL_ATTR_XLFDIB SET_STRING_ATTR(1 << 11)
  359. #define SDL_ATTR_TYPENAM SET_STRING_ATTR(1 << 12)
  360. #define SDL_ATTR_TYPENAMI SET_STRING_ATTR(1 << 13)
  361. #define SDL_ATTR_TYPENAMB SET_STRING_ATTR(1 << 14)
  362. #define SDL_ATTR_TYPENAMIB SET_STRING_ATTR(1 << 15)
  363. /*
  364. * start share of element 'id'.
  365. */
  366. #define SDL_ATTR_ID SET_STRING_ATTR(1 << 16)
  367. #define SDL_ATTR_NAME SET_STRING_ATTR(1 << 17)
  368. #define SDL_ATTR_RID SET_STRING_ATTR(1 << 18)
  369. #define SDL_ATTR_CELLS SET_STRING_ATTR(1 << 19)
  370. #define SDL_ATTR_FRST_PG SET_STRING_ATTR(1 << 20)
  371. /*
  372. * SSI and RSSI share the same element 'ssi'.
  373. */
  374. #define SDL_ATTR_SSI SET_STRING_ATTR(1 << 21)
  375. #define SDL_ATTR_RSSI SET_STRING_ATTR(1 << 22)
  376. /************************************************************************
  377. * string2 types
  378. ************************************************************************/
  379. /*
  380. * Group A, B, C, and D all share the same data space
  381. *
  382. * Group A.
  383. */
  384. #define SDL_ATTR_CHARSET SET_STRING2_ATTR(1 << 0)
  385. #define SDL_ATTR_COLW SET_STRING2_ATTR(1 << 1)
  386. #define SDL_ATTR_COLJ SET_STRING2_ATTR(1 << 2)
  387. #define SDL_ATTR_TEXT SET_STRING2_ATTR(1 << 3)
  388. #define SDL_ATTR_BRANCHES SET_STRING2_ATTR(1 << 4)
  389. #define SDL_ATTR_ABBREV SET_STRING2_ATTR(1 << 5)
  390. #define SDL_ATTR_ENTER SET_STRING2_ATTR(1 << 6)
  391. #define SDL_ATTR_EXIT SET_STRING2_ATTR(1 << 7)
  392. /*
  393. * Group B.
  394. */
  395. #define SDL_ATTR_PRODUCT SET_STRING2_ATTR(1 << 8)
  396. #define SDL_ATTR_LICENSE SET_STRING2_ATTR(1 << 9)
  397. #define SDL_ATTR_TIMESTAMP SET_STRING2_ATTR(1 << 10)
  398. #define SDL_ATTR_PRODPN SET_STRING2_ATTR(1 << 11)
  399. #define SDL_ATTR_PRODVER SET_STRING2_ATTR(1 << 12)
  400. #define SDL_ATTR_AUTHOR SET_STRING2_ATTR(1 << 13)
  401. #define SDL_ATTR_SDLDTD SET_STRING2_ATTR(1 << 14)
  402. #define SDL_ATTR_SRCDTD SET_STRING2_ATTR(1 << 15)
  403. #define SDL_ATTR_PUBID SET_STRING2_ATTR(1 << 16)
  404. /*
  405. * Group C.
  406. * the group uses the SDL_ATTR_PRODUCT & SDL_ATTR_LICENSE
  407. */
  408. #define SDL_ATTR_FORMAT SET_STRING2_ATTR(1 << 17)
  409. #define SDL_ATTR_METHOD SET_STRING2_ATTR(1 << 18)
  410. #define SDL_ATTR_XID SET_STRING2_ATTR(1 << 19)
  411. #define SDL_ATTR_COMMAND SET_STRING2_ATTR(1 << 20)
  412. #define SDL_ATTR_DATA SET_STRING2_ATTR(1 << 21)
  413. /*
  414. * Group D.
  415. * Used for <entry>
  416. */
  417. #define SDL_ATTR_MAIN SET_STRING2_ATTR(1 << 22)
  418. #define SDL_ATTR_LOCS SET_STRING2_ATTR(1 << 23)
  419. #define SDL_ATTR_SYNS SET_STRING2_ATTR(1 << 24)
  420. #define SDL_ATTR_SORT SET_STRING2_ATTR(1 << 25)
  421. /* Attribute Value defines */
  422. enum SdlAttrValue
  423. {
  424. SdlAttrValueBad,
  425. SdlAttrValueImplied,
  426. SdlAttrValueRequired,
  427. SdlAttrValueImpliedDef
  428. };
  429. /* Segment types */
  430. #define SDL_ELEMENT CE_ELEMENT
  431. #define SDL_STRING CE_STRING
  432. #define SDL_GRAPHIC CE_GRAPHIC
  433. #define SDL_ELEMENT_SHIFT CE_SHIFT_PAST_CHAR_SIZE
  434. #define SDL_ELEMENT_MASK (0xfffff << SDL_ELEMENT_SHIFT)
  435. /*
  436. * this is the maximum number of bits in an unsigned long value.
  437. * This is for the inclusion and exclustion masks.
  438. */
  439. /* On Hewlett-Packard Machines! */
  440. #define SDL_MASK_SIZE 32
  441. #define SDL_MASK_LEN 2
  442. /******** Private Macro Declarations ********/
  443. #define SDLSetTypeOfSegment(x,y) (((x) & ~(CE_PRIMARY_MASK)) | (y))
  444. #define SDLGetTypeOfSegent(x) _CEGetPrimaryType(x)
  445. #define SDLSetTypeToElement(x) SDLSetTypeOfSegment((x), SDL_ELEMENT)
  446. #define SDLSetTypeToString(x) SDLSetTypeOfSegment((x), SDL_STRING)
  447. #define SDLSetTypeToGraphic(x) SDLSetTypeOfSegment((x), SDL_GRAPHIC)
  448. #define SDLSetTypeToSpecial(x) SDLSetTypeOfSegment((x), CE_SPECIAL)
  449. #ifndef SDLAttrOffset
  450. #define SDLAttrOffset(p_type, field) \
  451. (((char *)(&(((p_type)NULL)->field)))-((char *)NULL))
  452. #endif
  453. #define SDLSearchMask(mask, value) \
  454. ((mask[(value)/SDL_MASK_SIZE] & \
  455. (((unsigned)1L) << ((value) % SDL_MASK_SIZE))) ? True : False)
  456. #define SDLMaskValue1(value) \
  457. (((value) < SDL_MASK_SIZE ? ((unsigned)1L) : 0) \
  458. << ((value) % SDL_MASK_SIZE))
  459. #define SDLMaskValue2(value) \
  460. (((value) < SDL_MASK_SIZE ? 0: ((unsigned)1L)) \
  461. << ((value) % SDL_MASK_SIZE))
  462. #define SDLClearAllBits { 0, 0 }
  463. #define SDLSetAllBits \
  464. { ~(SDLMaskValue1(SdlElementNone)), ~(SDLMaskValue2(SdlElementNone)) }
  465. #define SDLCheckMask(mask) \
  466. (((mask)[0] != 0 || (mask)[1] != 0) ? 1 : 0)
  467. #define SDLStripFromMask(mask, value) \
  468. (mask)[(value)/SDL_MASK_SIZE] = \
  469. ((mask)[(value)/SDL_MASK_SIZE] & \
  470. (~(((unsigned)1L) << ((value) % SDL_MASK_SIZE))))
  471. #define SDLInitMask(value) \
  472. { \
  473. SDLMaskValue1(value), \
  474. SDLMaskValue2(value), \
  475. }
  476. #define SDLInitMaskTwo(value1, value2) \
  477. { \
  478. SDLMaskValue1(value1) | SDLMaskValue1(value2), \
  479. SDLMaskValue2(value1) | SDLMaskValue2(value2), \
  480. }
  481. #define SDLInitMaskThree(value1, value2, value3) \
  482. { \
  483. SDLMaskValue1(value1) | SDLMaskValue1(value2) | SDLMaskValue1(value3), \
  484. SDLMaskValue2(value1) | SDLMaskValue2(value2) | SDLMaskValue2(value3), \
  485. }
  486. #define SDLInitMaskFour(value1, value2, value3, value4) \
  487. { \
  488. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  489. SDLMaskValue1(value3) | SDLMaskValue1(value4), \
  490. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  491. SDLMaskValue2(value3) | SDLMaskValue2(value4), \
  492. }
  493. #define SDLInitMaskFive(value1, value2, value3, value4, value5) \
  494. { \
  495. SDLMaskValue1(value1) | SDLMaskValue1(value2) | SDLMaskValue1(value3) | \
  496. SDLMaskValue1(value4) | SDLMaskValue1(value5),\
  497. SDLMaskValue2(value1) | SDLMaskValue2(value2) | SDLMaskValue2(value3) | \
  498. SDLMaskValue2(value4) | SDLMaskValue2(value5),\
  499. }
  500. #define SDLInitMaskSix(value1, value2, value3, value4, value5, value6) \
  501. { \
  502. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  503. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  504. SDLMaskValue1(value5) | SDLMaskValue1(value6), \
  505. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  506. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  507. SDLMaskValue2(value5) | SDLMaskValue2(value6), \
  508. }
  509. #define SDLInitMaskSeven(value1, value2, value3,\
  510. value4, value5, value6, value7) \
  511. { \
  512. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  513. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  514. SDLMaskValue1(value5) | SDLMaskValue1(value6) | \
  515. SDLMaskValue1(value7), \
  516. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  517. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  518. SDLMaskValue2(value5) | SDLMaskValue2(value6) | \
  519. SDLMaskValue2(value7), \
  520. }
  521. #define SDLInitMaskEight(value1, value2, value3, value4, value5, \
  522. value6, value7, value8) \
  523. { \
  524. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  525. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  526. SDLMaskValue1(value5) | SDLMaskValue1(value6) | \
  527. SDLMaskValue1(value7) | SDLMaskValue1(value8), \
  528. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  529. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  530. SDLMaskValue2(value5) | SDLMaskValue2(value6) | \
  531. SDLMaskValue2(value7) | SDLMaskValue2(value8), \
  532. }
  533. #define SDLInitMaskNine(value1, value2, value3, value4, value5, \
  534. value6, value7, value8, value9) \
  535. { \
  536. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  537. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  538. SDLMaskValue1(value5) | SDLMaskValue1(value6) | \
  539. SDLMaskValue1(value7) | SDLMaskValue1(value8) | \
  540. SDLMaskValue1(value9), \
  541. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  542. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  543. SDLMaskValue2(value5) | SDLMaskValue2(value6) | \
  544. SDLMaskValue2(value7) | SDLMaskValue2(value8) | \
  545. SDLMaskValue2(value9), \
  546. }
  547. #define SDLInitMaskEleven(value1, value2, value3, value4, value5, \
  548. value6, value7, value8, value9, value10, \
  549. value11) \
  550. { \
  551. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  552. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  553. SDLMaskValue1(value5) | SDLMaskValue1(value6) | \
  554. SDLMaskValue1(value7) | SDLMaskValue1(value8) | \
  555. SDLMaskValue1(value9) | SDLMaskValue1(value10) | \
  556. SDLMaskValue1(value11), \
  557. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  558. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  559. SDLMaskValue2(value5) | SDLMaskValue2(value6) | \
  560. SDLMaskValue2(value7) | SDLMaskValue2(value8) | \
  561. SDLMaskValue2(value9) | SDLMaskValue2(value10) | \
  562. SDLMaskValue2(value11), \
  563. }
  564. #define SDLInitMaskTwelve(value1, value2, value3, value4, value5, \
  565. value6, value7, value8, value9, value10, \
  566. value11, value12) \
  567. { \
  568. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  569. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  570. SDLMaskValue1(value5) | SDLMaskValue1(value6) | \
  571. SDLMaskValue1(value7) | SDLMaskValue1(value8) | \
  572. SDLMaskValue1(value9) | SDLMaskValue1(value10) | \
  573. SDLMaskValue1(value11) | SDLMaskValue1(value12), \
  574. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  575. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  576. SDLMaskValue2(value5) | SDLMaskValue2(value6) | \
  577. SDLMaskValue2(value7) | SDLMaskValue2(value8) | \
  578. SDLMaskValue2(value9) | SDLMaskValue2(value10) | \
  579. SDLMaskValue2(value11) | SDLMaskValue2(value12), \
  580. }
  581. #define SDLInitMaskThirteen(value1, value2, value3, value4, value5, \
  582. value6 , value7 , value8 , value9, value10, \
  583. value11, value12, value13) \
  584. { \
  585. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  586. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  587. SDLMaskValue1(value5) | SDLMaskValue1(value6) | \
  588. SDLMaskValue1(value7) | SDLMaskValue1(value8) | \
  589. SDLMaskValue1(value9) | SDLMaskValue1(value10) | \
  590. SDLMaskValue1(value11) | SDLMaskValue1(value12) | \
  591. SDLMaskValue1(value13), \
  592. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  593. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  594. SDLMaskValue2(value5) | SDLMaskValue2(value6) | \
  595. SDLMaskValue2(value7) | SDLMaskValue2(value8) | \
  596. SDLMaskValue2(value9) | SDLMaskValue2(value10) | \
  597. SDLMaskValue2(value11) | SDLMaskValue2(value12) | \
  598. SDLMaskValue2(value13), \
  599. }
  600. #define SDLInitMaskFourteen(value1, value2, value3, value4, value5, \
  601. value6 , value7 , value8 , value9, value10, \
  602. value11, value12, value13, value14) \
  603. { \
  604. SDLMaskValue1(value1) | SDLMaskValue1(value2) | \
  605. SDLMaskValue1(value3) | SDLMaskValue1(value4) | \
  606. SDLMaskValue1(value5) | SDLMaskValue1(value6) | \
  607. SDLMaskValue1(value7) | SDLMaskValue1(value8) | \
  608. SDLMaskValue1(value9) | SDLMaskValue1(value10) | \
  609. SDLMaskValue1(value11) | SDLMaskValue1(value12) | \
  610. SDLMaskValue1(value13) | SDLMaskValue1(value14), \
  611. SDLMaskValue2(value1) | SDLMaskValue2(value2) | \
  612. SDLMaskValue2(value3) | SDLMaskValue2(value4) | \
  613. SDLMaskValue2(value5) | SDLMaskValue2(value6) | \
  614. SDLMaskValue2(value7) | SDLMaskValue2(value8) | \
  615. SDLMaskValue2(value9) | SDLMaskValue2(value10) | \
  616. SDLMaskValue2(value11) | SDLMaskValue2(value12) | \
  617. SDLMaskValue2(value13) | SDLMaskValue1(value14), \
  618. }
  619. /******** Private Typedef Declarations ********/
  620. typedef char* SDLId;
  621. typedef char* SDLCdata;
  622. typedef int SDLNumber;
  623. typedef unsigned long SDLMask; /* must be a 32 bit value */
  624. typedef _DtHelpFontHints* _DtHelpFontHintPtr;
  625. /******** Private Structures Declarations ********/
  626. typedef struct {
  627. const char *string;
  628. SdlOption option_value;
  629. } OptionList;
  630. typedef struct {
  631. unsigned long attr_value;
  632. const OptionList *options;
  633. } SDLAttributeOptions;
  634. typedef struct {
  635. const char *string;
  636. _DtHelpFontValue option_value;
  637. } FontSpecOption;
  638. typedef struct {
  639. unsigned long attr_value;
  640. const FontSpecOption *options;
  641. } SDLFontSpecList;
  642. typedef struct {
  643. SDLMask mask[SDL_MASK_LEN];
  644. int (*model)();
  645. } SDLContent;
  646. enum SdlStructType {
  647. SdlStructTypeBad = -1,
  648. SdlIgnore,
  649. SdlFontSpecific,
  650. SdlElementSpecific,
  651. SdlTableSpecific,
  652. SdlContainerSpecific
  653. };
  654. typedef struct {
  655. const char *name;
  656. enum SdlAttrDataType data_type;
  657. enum SdlStructType struct_type;
  658. int sdl_attr_define;
  659. int field_ptr;
  660. } SDLAttribute;
  661. typedef struct {
  662. int sdl_attr_define;
  663. enum SdlAttrValue sdl_value;
  664. const char *def_string;
  665. } SDLElementAttrList;
  666. enum _sdlElToGeneral
  667. {
  668. SdlToNone,
  669. SdlToContainer,
  670. SdlToMarker,
  671. SdlToGraphic,
  672. SdlToString,
  673. SdlToSpc,
  674. SdlToSnb
  675. };
  676. typedef enum _sdlElToGeneral SdlToGeneral;
  677. typedef struct _sdlElementInfo {
  678. const char *element_str; /* the element string */
  679. const char *element_end_str; /* the ending string */
  680. int str_sig_chars; /* # of significant chars */
  681. int end_sig_chars; /* # of significant chars */
  682. enum SdlElement sdl_element; /* The element's value */
  683. SDLMask exceptions[SDL_MASK_LEN];
  684. /* what elements cannot
  685. appear in this element */
  686. const SDLElementAttrList *attrib_list; /* attribute list */
  687. const SDLContent *content; /* The element's content */
  688. int elim_flag; /* If this element's
  689. segment list is null,
  690. eleminate the element */
  691. int cdata_flag; /* If no attributes, is
  692. there cdata before the
  693. end */
  694. int formatting; /* does this cause a
  695. formatting break */
  696. int new_fonts; /* does this cause new
  697. fonts to be pulled in? */
  698. SdlToGeneral sdl_to_gen; /* What kind of general
  699. type is this element? */
  700. } SDLElementInfo;
  701. /******** Private Macros Declarations ********/
  702. #ifndef _SdlIsTossStyle
  703. #define _SdlIsTossStyle(x) (SdlElementKeyStyle == (x) || \
  704. SdlElementHeadStyle == (x) || \
  705. SdlElementFormStyle == (x) || \
  706. SdlElementFrmtStyle == (x) || \
  707. SdlElementGrphStyle == (x))
  708. #endif
  709. /******** Private Function Declarations ********/
  710. #ifdef __cplusplus
  711. } /* Close scope of 'extern "C"' declaration which encloses file. */
  712. #endif
  713. #endif /* _DtHelpSDLI_h */
  714. /* DON'T ADD ANYTHING AFTER THIS #endif */