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