PdmOid.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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: PdmOid.h /main/9 1996/08/12 18:42:42 cde-hp $ */
  24. /*
  25. * dtpdm/PdmOid.h
  26. */
  27. /*
  28. * (c) Copyright 1996 Digital Equipment Corporation.
  29. * (c) Copyright 1996 Hewlett-Packard Company.
  30. * (c) Copyright 1996 International Business Machines Corp.
  31. * (c) Copyright 1996 Sun Microsystems, Inc.
  32. * (c) Copyright 1996 Novell, Inc.
  33. * (c) Copyright 1996 FUJITSU LIMITED.
  34. * (c) Copyright 1996 Hitachi.
  35. */
  36. #ifndef _PdmOid_h
  37. #define _PdmOid_h
  38. #include <X11/Intrinsic.h>
  39. /*
  40. * include the auto-generated PdmOid enum definition
  41. */
  42. #include "PdmOidDefs.h"
  43. /*
  44. * list of object identifiers
  45. */
  46. typedef struct _PdmOidList
  47. {
  48. PdmOid* list;
  49. int count;
  50. } PdmOidList;
  51. /*
  52. * linked list of object identifiers
  53. */
  54. typedef struct PdmOidNodeStruct
  55. {
  56. PdmOid oid;
  57. struct PdmOidNodeStruct* next;
  58. } *PdmOidNode;
  59. typedef struct _PdmOidLinkedList
  60. {
  61. PdmOidNode head;
  62. PdmOidNode tail;
  63. PdmOidNode current;
  64. int count;
  65. } PdmOidLinkedList;
  66. /*
  67. * PdmOidMediumSourceSize and related definitions
  68. */
  69. typedef struct
  70. {
  71. float minimum_x;
  72. float maximum_x;
  73. float minimum_y;
  74. float maximum_y;
  75. } PdmOidArea; /* (not used by PDM) */
  76. /*
  77. * XXX need to update continuous size spec to use reals
  78. */
  79. typedef struct
  80. {
  81. unsigned long lower_bound;
  82. unsigned long upper_bound;
  83. } PdmOidUnsignedRange; /* (not used by PDM) */
  84. typedef struct
  85. {
  86. PdmOidUnsignedRange range_across_feed;
  87. unsigned long increment_across_feed;
  88. PdmOidUnsignedRange range_in_feed;
  89. unsigned long increment_in_feed;
  90. Boolean long_edge_feeds;
  91. PdmOidArea assured_reproduction_area;
  92. } PdmOidMediumContinuousSize; /* (not used by PDM) */
  93. typedef struct
  94. {
  95. PdmOid page_size;
  96. Boolean long_edge_feeds; /* (not used by PDM) */
  97. PdmOidArea assured_reproduction_area; /* (not used by PDM) */
  98. } PdmOidMediumDiscreteSize;
  99. typedef struct
  100. {
  101. PdmOidMediumDiscreteSize* list;
  102. int count;
  103. } PdmOidMediumDiscreteSizeList;
  104. typedef struct
  105. {
  106. PdmOid input_tray; /* may be set to pdmoid_none */
  107. enum { PdmOidMediumSS_DISCRETE, PdmOidMediumSS_CONTINUOUS } mstag;
  108. union
  109. {
  110. PdmOidMediumDiscreteSizeList* discrete;
  111. PdmOidMediumContinuousSize* continuous_size; /* (not used by PDM) */
  112. } ms; /* "ms" is short for medium-size */
  113. } PdmOidMediumSourceSize;
  114. typedef struct
  115. {
  116. PdmOidMediumSourceSize* mss;
  117. int count;
  118. } PdmOidMediumSS;
  119. typedef struct
  120. {
  121. PdmOid input_tray;
  122. PdmOid medium;
  123. } PdmOidTrayMedium;
  124. typedef struct
  125. {
  126. PdmOidTrayMedium* list;
  127. int count;
  128. } PdmOidTrayMediumList;
  129. typedef enum {
  130. PDMOID_NOTIFY_UNSUPPORTED,
  131. PDMOID_NOTIFY_NONE,
  132. PDMOID_NOTIFY_EMAIL
  133. } PdmOidNotify;
  134. /*
  135. * PdmOid public methods
  136. */
  137. extern const char* PdmOidString(PdmOid);
  138. extern int PdmOidStringLength(PdmOid);
  139. extern PdmOid PdmOidFromString(const char* value);
  140. extern int PdmOidMsgSet(PdmOid);
  141. extern int PdmOidMsgNum(PdmOid);
  142. extern const char* PdmOidDefaultMsg(PdmOid);
  143. extern const char* PdmOidLocalString(PdmOid pdm_oid);
  144. /*
  145. * PdmOidList public methods
  146. */
  147. extern PdmOidList* PdmOidListNew(const char* value_string);
  148. extern void PdmOidListDelete(PdmOidList*);
  149. #define PdmOidListCount(l) ((l) ? (l)->count : 0)
  150. #define PdmOidListGetOid(l, i) ((l) ? (l)->list[(i)] : pdmoid_none)
  151. extern int PdmOidListGetIndex(const PdmOidList* list, PdmOid oid);
  152. extern Boolean PdmOidListHasOid(const PdmOidList* list, PdmOid oid);
  153. /*
  154. * PdmOidLinkedList public methods
  155. */
  156. extern PdmOidLinkedList* PdmOidLinkedListNew();
  157. extern void PdmOidLinkedListDelete(PdmOidLinkedList*);
  158. #define PdmOidLinkedListCount(l) ((l) ? (l)->count : 0)
  159. extern PdmOid PdmOidLinkedListGetOid(PdmOidLinkedList* list, int i);
  160. extern void PdmOidLinkedListAddOid(PdmOidLinkedList* list, PdmOid oid);
  161. extern int PdmOidLinkedListGetIndex(PdmOidLinkedList* list, PdmOid oid);
  162. extern Boolean PdmOidLinkedListHasOid(PdmOidLinkedList* list,
  163. PdmOid oid);
  164. extern PdmOid PdmOidLinkedListFirstOid(PdmOidLinkedList* list);
  165. extern PdmOid PdmOidLinkedListNextOid(PdmOidLinkedList* list);
  166. /*
  167. * PdmOidMediumSourceSize public methods
  168. */
  169. extern PdmOidMediumSS* PdmOidMediumSSNew(const char* value_string);
  170. extern void PdmOidMediumSSDelete(PdmOidMediumSS*);
  171. #define PdmOidMediumSSCount(me) ((me) ? (me)->count : 0)
  172. extern PdmOidLinkedList* PdmOidMediumSSGetAllSizes(PdmOidMediumSS*);
  173. extern void PdmOidMediumSSGetTraysSizes(PdmOidMediumSS*,
  174. PdmOidTrayMediumList*,
  175. PdmOidList** trays,
  176. PdmOidList** sizes);
  177. /*
  178. * PdmOidTrayMediumList public methods
  179. */
  180. extern PdmOidTrayMediumList* PdmOidTrayMediumListNew(const char* value_string);
  181. extern void PdmOidTrayMediumListDelete(PdmOidTrayMediumList* me);
  182. #define PdmOidTrayMediumListCount(me) ((me) ? (me)->count : 0)
  183. #define PdmOidTrayMediumListTray(me, i) \
  184. ((me) ? (me)->list[(i)].input_tray : pdmoid_none)
  185. #define PdmOidTrayMediumListMedium(me, i) \
  186. ((me) ? (me)->list[(i)].medium : pdmoid_none)
  187. /*
  188. * PdmOidNotify public methods
  189. */
  190. extern PdmOidNotify PdmOidNotifyParse(const char* value_string);
  191. extern const char* PdmOidNotifyString(PdmOidNotify notify);
  192. /*
  193. * PdmOidDocumentFormat public methods
  194. */
  195. extern char* PdmOidDocumentFormatParse(const char* value_string);
  196. extern char* PdmOidDocumentFormatDefault(const char* value_string);
  197. #endif /* _PdmOid_h - don't add any thing after this line */