1/**
2 *
3 * $Header: /cvsroot/lesstif/lesstif/include/Motif-2.1/Xm/Xm.h.in,v 1.38 2005/04/16 21:31:44 dannybackx Exp $
4 *
5 * Copyright � 1995 Free Software Foundation, Inc.
6 * Copyright � 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005 LessTif Development Team
7 *
8 * This file is part of the GNU LessTif Library.
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Library General Public License for more details.
19 *
20 * You should have received a copy of the GNU Library General Public
21 * License along with this library; if not, write to the Free
22 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 **/
25
26
27#ifndef _XM_XM_H
28#define _XM_XM_H
29
30#include <stddef.h>    /* for  wchar_t, etc. */
31
32#if defined(_MFC_VER) && !defined(STATIC_XM)
33/* If Lesstif is built as a DLL with a Microsoft compiler, we need to use the
34 *	__declspec mechanism to import and export variables and functions.
35 */
36#if XMDLL	/* We're compiling the DLL */
37#define XMLIBEXPORT __declspec(dllexport)
38#else		/* We're including this in an application that will link to the DLL */
39#define XMLIBEXPORT __declspec(dllimport)
40#endif
41#else
42#define XMLIBEXPORT /* Nada */
43#endif
44
45#include <X11/Intrinsic.h>
46#include <X11/Shell.h>
47#include <X11/Xatom.h>
48
49/* handy little define */
50
51#if NeedFunctionPrototypes
52#define _XmANSI_ARGS_(args) args
53#else
54#define _XmANSI_ARGS_(args) ()
55#endif
56
57/* Version Information */
58#define LESSTIF_VERSION  _MAJOR_VERSION_
59#define LESSTIF_REVISION _MINOR_VERSION_
60#define	LESSTIF_UPDATE_LEVEL	_PICO_VERSION_
61
62#define LesstifVersion (LESSTIF_VERSION * 1000 + LESSTIF_REVISION)
63#define LesstifVERSION_STRING "@(#)GNU/LessTif Version 2.1 Release _MAJOR_VERSION_._MINOR_VERSION_._PICO_VERSION_"
64
65/* since we're replacing Motif 2.1... */
66#define XmVERSION 2
67#define XmREVISION 1
68#define XmVersion (XmVERSION * 1000 + XmREVISION)
69#define XmVERSION_STRING LesstifVERSION_STRING
70#define XmUPDATE_LEVEL 0
71
72/* A function to report our version */
73extern char *XmVersionString(void);
74
75/* Our headers may use the #defines made above! */
76#include <Xm/XmStrDefs.h>
77#include <Xm/VirtKeys.h>
78#include <Xm/Transfer.h>
79#include <Xm/Primitive.h>
80#include <Xm/Manager.h>
81#include <Xm/Gadget.h>
82
83#ifdef __cplusplus
84extern "C" {
85#endif
86
87XMLIBEXPORT extern int xmUseVersion;
88
89/* pixmap stuff */
90
91#define XmUNSPECIFIED_PIXMAP	2
92
93/* define for easy checking for unset resources */
94
95#define XmUNSPECIFIED (~0)
96
97/*
98 * vendor defines (hey, GNU is a vendor)
99 */
100#define XmSTRING_OS_CHARSET             XmSTRING_ISO8859_1
101#ifndef XmFALLBACK_CHARSET
102#define XmFALLBACK_CHARSET              XmSTRING_ISO8859_1
103#endif
104
105#define XmDEFAULT_FONT                  _XmSDEFAULT_FONT
106#define XmDEFAULT_BACKGROUND            _XmSDEFAULT_BACKGROUND
107#define XmDEFAULT_DARK_THRESHOLD        20
108#define XmDEFAULT_LIGHT_THRESHOLD       93
109#define XmDEFAULT_FOREGROUND_THRESHOLD  70
110
111XMLIBEXPORT extern char    _XmSDEFAULT_FONT[];
112XMLIBEXPORT extern char    _XmSDEFAULT_BACKGROUND[];
113
114typedef unsigned char XmDirection;
115
116#define XmDIRECTION_IGNORED 0x30
117
118#define XmRIGHT_TO_LEFT_MASK 0x01
119#define XmLEFT_TO_RIGHT_MASK 0x02
120#define XmHORIZONTAL_MASK 0x03
121#define XmTOP_TO_BOTTOM_MASK 0x04
122#define XmBOTTOM_TO_TOP_MASK 0x08
123#define XmVERTICAL_MASK 0x0c
124#define XmPRECEDENCE_HORIZ_MASK 0x40
125#define XmPRECEDENCE_VERT_MASK 0x80
126#define XmPRECEDENCE_MASK 0xc0
127
128enum {
129    XmRIGHT_TO_LEFT_TOP_TO_BOTTOM =
130        XmRIGHT_TO_LEFT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_HORIZ_MASK,
131    XmLEFT_TO_RIGHT_TOP_TO_BOTTOM =
132        XmLEFT_TO_RIGHT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_HORIZ_MASK,
133    XmRIGHT_TO_LEFT_BOTTOM_TO_TOP =
134        XmRIGHT_TO_LEFT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_HORIZ_MASK,
135    XmLEFT_TO_RIGHT_BOTTOM_TO_TOP =
136        XmLEFT_TO_RIGHT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_HORIZ_MASK,
137    XmTOP_TO_BOTTOM_RIGHT_TO_LEFT =
138        XmRIGHT_TO_LEFT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_VERT_MASK,
139    XmTOP_TO_BOTTOM_LEFT_TO_RIGHT =
140        XmLEFT_TO_RIGHT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_VERT_MASK,
141    XmBOTTOM_TO_TOP_RIGHT_TO_LEFT =
142        XmRIGHT_TO_LEFT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_VERT_MASK,
143    XmBOTTOM_TO_TOP_LEFT_TO_RIGHT =
144        XmLEFT_TO_RIGHT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_VERT_MASK,
145    XmTOP_TO_BOTTOM =
146        XmTOP_TO_BOTTOM_MASK | XmHORIZONTAL_MASK | XmPRECEDENCE_MASK,
147    XmBOTTOM_TO_TOP =
148        XmBOTTOM_TO_TOP_MASK | XmHORIZONTAL_MASK | XmPRECEDENCE_MASK,
149    XmRIGHT_TO_LEFT =
150        XmRIGHT_TO_LEFT_MASK | XmVERTICAL_MASK | XmPRECEDENCE_MASK,
151    XmLEFT_TO_RIGHT =
152        XmLEFT_TO_RIGHT_MASK | XmVERTICAL_MASK | XmPRECEDENCE_MASK,
153    XmDEFAULT_DIRECTION = 0xff
154};
155
156/*
157 * XmString stuff
158 */
159
160typedef enum {
161    XmFONT_IS_FONT,
162    XmFONT_IS_FONTSET,
163    XmFONT_IS_XOC,	/* IBM's BiDi extension to Motif */
164    XmFONT_IS_XFT	/* FontConfig */
165} XmFontType;
166
167enum {
168    XmSTRING_DIRECTION_L_TO_R,
169    XmSTRING_DIRECTION_R_TO_L,
170    XmSTRING_DIRECTION_UNSET = 3,
171    XmSTRING_DIRECTION_DEFAULT = XmDEFAULT_DIRECTION
172};
173
174typedef unsigned char XmStringDirection;
175typedef unsigned char *XmString;
176typedef XmString *XmStringTable;
177typedef char *XmStringCharSet;
178typedef unsigned char XmStringComponentType;
179typedef char *XmStringTag;
180
181typedef struct __XmStringContextRec *_XmStringContext;
182typedef struct __XmStringRec *_XmString;
183typedef struct _XmtStringContextRec *XmStringContext;
184typedef struct _XmFontListContextRec *XmFontContext;
185
186#define	_MOTIF_DEFAULT_LOCALE	"_MOTIF_DEFAULT_LOCALE"
187/*
188 * Rendering stuff
189 *	The definitions for this replace some older XmFontList* stuff.
190 *	Here's the old stuff for reference :
191 *	typedef struct _XmFontListRec *XmFontListEntry, *XmFontList;
192 */
193typedef struct __XmRenditionRec		*XmFontListEntry;
194typedef	struct __XmRenderTableRec	*XmFontList;
195
196typedef struct __XmRenditionRec		*XmRendition;
197typedef struct __XmRenderTableRec	*XmRenderTable;
198
199enum {
200    XmSTRING_COMPONENT_UNKNOWN,		/* 0 */
201    XmSTRING_COMPONENT_CHARSET,		/* 1 */
202    XmSTRING_COMPONENT_TEXT,		/* 2 */
203    XmSTRING_COMPONENT_DIRECTION,	/* 3 */
204    XmSTRING_COMPONENT_SEPARATOR,	/* 4 */
205    XmSTRING_COMPONENT_LOCALE_TEXT,	/* 5 */
206    XmSTRING_COMPONENT_LOCALE,		/* 6 */
207    XmSTRING_COMPONENT_WIDECHAR_TEXT,	/* 7 */
208    XmSTRING_COMPONENT_LAYOUT_PUSH,	/* 8 */
209    XmSTRING_COMPONENT_LAYOUT_POP,	/* 9 */
210    XmSTRING_COMPONENT_RENDITION_BEGIN,	/* 10 */
211    XmSTRING_COMPONENT_RENDITION_END,	/* 11 */
212    XmSTRING_COMPONENT_TAB		/* 12 */
213    /* 13 - 125 is said to be reserved */
214};
215
216#define XmSTRING_COMPONENT_FONTLIST_ELEMENT_TAG XmSTRING_COMPONENT_CHARSET
217
218#define XmSTRING_COMPONENT_TAG          XmSTRING_COMPONENT_CHARSET
219
220#define XmSTRING_COMPONENT_END          ((XmStringComponentType) 126)
221/* anybody know what 127 is? */
222#define XmSTRING_COMPONENT_USER_BEGIN   ((XmStringComponentType) 128)
223/* 128-255 are user tags */
224#define XmSTRING_COMPONENT_USER_END     ((XmStringComponentType) 255)
225
226typedef enum {
227    XmCHARSET_TEXT,
228    XmMULTIBYTE_TEXT,
229    XmWIDECHAR_TEXT,
230    XmNO_TEXT
231} XmTextType;
232
233typedef enum {
234    XmOUTPUT_ALL,
235    XmOUTPUT_BETWEEN,
236    XmOUTPUT_BEGINNING,
237    XmOUTPUT_END,
238    XmOUTPUT_BOTH
239} XmParseModel;
240
241/* Real definition hidden in XmI/XmI.h */
242typedef struct __XmParseMappingRec *XmParseMapping;
243typedef XmParseMapping             *XmParseTable;
244typedef unsigned char XmIncludeStatus;
245
246typedef XmIncludeStatus (*XmParseProc) (
247	XtPointer	*text_in_out,
248	XtPointer	text_end,
249	XmTextType	type,
250	XmStringTag	tag,
251	XmParseMapping	entry,
252	int		pattern_length,
253	XmString	*str_include,
254	XtPointer	call_data);
255
256enum {
257    XmINSERT,
258    XmTERMINATE,
259    XmINVOKE
260};
261
262typedef enum {
263    XmSTYLE_STRING = XStringStyle,
264    XmSTYLE_COMPOUND = XCompoundTextStyle,
265    XmSTYLE_TEXT = XTextStyle,
266    XmSTYLE_STANDARD_ICC_TEXT = XStdICCTextStyle,
267    XmSTYLE_LOCALE = 32,
268    XmSTYLE_COMPOUND_STRING
269} XmICCEncodingStyle;
270
271/* tab list stuff */
272typedef enum {
273    XmABSOLUTE,
274    XmRELATIVE
275} XmOffsetModel;
276
277typedef struct _XmTabRec *XmTab;
278typedef struct _XmTabListRec  *XmTabList;
279
280/* render table stuff */
281
282typedef enum {
283    XmSKIP,
284    XmMERGE_REPLACE,
285    XmMERGE_OLD,
286    XmMERGE_NEW,
287    XmDUPLICATE
288} XmMergeMode;
289
290#define XmAS_IS 255
291#define XmFORCE_COLOR 1
292
293#define XmUNSPECIFIED_PIXEL ((Pixel) (~0))
294#define XmDEFAULT_SELECT_COLOR XmUNSPECIFIED_PIXEL
295#define XmREVERSED_GROUND_COLORS (XmDEFAULT_SELECT_COLOR - 1)
296#define XmHIGHLIGHT_COLOR (XmREVERSED_GROUND_COLORS - 1)
297
298enum {
299    XmUNSPECIFIED_LOAD_MODEL,
300    XmLOAD_DEFERRED,
301    XmLOAD_IMMEDIATE
302};
303
304/* size policy stuff */
305
306enum {
307    XmCHANGE_ALL,
308    XmCHANGE_NONE,
309    XmCHANGE_WIDTH,
310    XmCHANGE_HEIGHT
311};
312
313/* unitType stuff */
314
315enum {
316	XmPIXELS,
317	Xm100TH_MILLIMETERS,
318	Xm1000TH_INCHES,
319	Xm100TH_POINTS,
320	Xm100TH_FONT_UNITS,
321	XmINCHES,
322	XmCENTIMETERS,
323	XmMILLIMETERS,
324	XmPOINTS,
325	XmFONT_UNITS
326};
327
328/* delete Responses for VendorShell */
329
330enum {
331    XmDESTROY,
332    XmUNMAP,
333    XmDO_NOTHING
334};
335
336/* keyboard focus policies for VendorShell */
337
338enum {
339    XmEXPLICIT,
340    XmPOINTER
341};
342
343/* Navigation stuff */
344
345enum {
346    XmNONE,
347    XmTAB_GROUP,
348    XmSTICKY_TAB_GROUP,
349    XmEXCLUSIVE_TAB_GROUP
350};
351
352/* Audible Warning types for VendorShell */
353
354enum {
355/* implied
356 *  XmNONE
357 */
358    XmBELL = 1
359};
360
361/* Input Manager types */
362enum {
363    XmPER_SHELL,
364    XmPER_WIDGET,
365    XmINHERIT_POLICY = 255
366};
367
368/* Note: The define in XmI.h was changed to XmIMInputPolicy. */
369typedef unsigned char XmInputPolicy;
370
371/* various widgets' orientation, menu definitions */
372
373enum {
374    XmNO_ORIENTATION,
375    XmVERTICAL,
376    XmHORIZONTAL
377};
378
379/* row column types */
380
381enum {
382    XmWORK_AREA,
383    XmMENU_BAR,
384    XmMENU_PULLDOWN,
385    XmMENU_POPUP,
386    XmMENU_OPTION
387};
388
389/* row column packing strategies */
390
391enum {
392    XmNO_PACKING,
393    XmPACK_TIGHT,
394    XmPACK_COLUMN,
395    XmPACK_NONE
396};
397
398enum {
399/* implied
400 *  XmALIGNMENT_BASELINE_TOP,
401 *  XmALIGNMENT_CENTER,
402 *  XmALIGNMENT_BASELINE_BOTTOM,
403 */
404    XmALIGNMENT_CONTENTS_TOP = 3,
405    XmALIGNMENT_CONTENTS_BOTTOM
406};
407
408enum {
409    XmTEAR_OFF_ENABLED,
410    XmTEAR_OFF_DISABLED
411};
412
413enum {
414    XmUNPOST,
415    XmUNPOST_AND_REPLAY
416};
417
418/* XmPanedWindow positioning */
419enum {
420	XmLAST_POSITION = -1,
421	XmFIRST_POSITION
422};
423
424/* XmComboBox types */
425enum {
426   XmCOMBO_BOX = 0,
427   XmDROP_DOWN_COMBO_BOX,
428   XmDROP_DOWN_LIST
429};
430
431/* XmComboBox: XmNpositionMode resource */
432enum {
433  XmZERO_BASED,
434  XmONE_BASED
435};
436
437enum {
438   XmQUICK_NAVIGATE = 1
439};
440
441/* Label and Frame alignments */
442
443enum {
444    XmALIGNMENT_BEGINNING,
445    XmALIGNMENT_CENTER,
446    XmALIGNMENT_END
447};
448
449enum {
450    XmALIGNMENT_BASELINE_TOP,
451/* implied
452 *  XmALIGNMENT_CENTER
453 */
454    XmALIGNMENT_BASELINE_BOTTOM = 2,
455    XmALIGNMENT_WIDGET_TOP,
456    XmALIGNMENT_WIDGET_BOTTOM
457};
458
459#define XmALIGNMENT_CHILD_TOP XmALIGNMENT_WIDGET_BOTTOM
460#define XmALIGNMENT_CHILD_BOTTOM XmALIGNMENT_WIDGET_TOP
461
462/* Frame Child Types */
463
464enum {
465    XmFRAME_GENERIC_CHILD,
466    XmFRAME_WORKAREA_CHILD,
467    XmFRAME_TITLE_CHILD
468};
469
470/* For toggle button stuff */
471enum {
472    XmN_OF_MANY = 1,
473    XmONE_OF_MANY,
474    XmONE_OF_MANY_ROUND,
475    XmONE_OF_MANY_DIAMOND
476};
477
478enum { XmUNSET, XmSET, XmINDETERMINATE };
479enum { XmTOGGLE_BOOLEAN, XmTOGGLE_INDETERMINATE };
480
481typedef unsigned char XmToggleButtonState;
482
483/* Form attachments */
484
485enum {
486    XmATTACH_NONE,
487    XmATTACH_FORM,
488    XmATTACH_OPPOSITE_FORM,
489    XmATTACH_WIDGET,
490    XmATTACH_OPPOSITE_WIDGET,
491    XmATTACH_POSITION,
492    XmATTACH_SELF
493};
494
495/* resize policies for some manager widgets */
496
497enum {
498    XmRESIZE_NONE,
499    XmRESIZE_GROW,
500    XmRESIZE_ANY
501};
502
503/* callback reasons */
504
505enum {
506    XmCR_NONE,				/* 0 */
507    XmCR_HELP,				/* 1 */
508    XmCR_VALUE_CHANGED,			/* 2 */
509    XmCR_INCREMENT,			/* 3 */
510    XmCR_DECREMENT,			/* 4 */
511    XmCR_PAGE_INCREMENT,		/* 5 */
512    XmCR_PAGE_DECREMENT,		/* 6 */
513    XmCR_TO_TOP,			/* 7 */
514    XmCR_TO_BOTTOM,			/* 8 */
515    XmCR_DRAG,				/* 9 */
516    XmCR_ACTIVATE,			/* 10 */
517    XmCR_ARM,				/* 11 */
518    XmCR_DISARM,			/* 12 */
519    XmCR_DUMMY13,			/* 13 */
520    XmCR_DUMMY14,			/* 14 */
521    XmCR_DUMMY15,			/* 15 */
522    XmCR_MAP,				/* 16 */
523    XmCR_UNMAP,				/* 17 */
524    XmCR_FOCUS,				/* 18 */
525    XmCR_LOSING_FOCUS,			/* 19 */
526    XmCR_MODIFYING_TEXT_VALUE,		/* 20 */
527    XmCR_MOVING_INSERT_CURSOR,		/* 21 */
528    XmCR_EXECUTE,			/* 22 */
529    XmCR_SINGLE_SELECT,			/* 23 */
530    XmCR_MULTIPLE_SELECT,		/* 24 */
531    XmCR_EXTENDED_SELECT,		/* 25 */
532    XmCR_BROWSE_SELECT,			/* 26 */
533    XmCR_DEFAULT_ACTION,		/* 27 */
534    XmCR_CLIPBOARD_DATA_REQUEST,	/* 28 */
535    XmCR_CLIPBOARD_DATA_DELETE,		/* 29 */
536    XmCR_CASCADING,			/* 30 */
537    XmCR_OK,				/* 31 */
538    XmCR_CANCEL,			/* 32 */
539    XmCR_DUMMY33,			/* 33 */
540    XmCR_APPLY,				/* 34 */
541    XmCR_NO_MATCH,			/* 35 */
542    XmCR_COMMAND_ENTERED,		/* 36 */
543    XmCR_COMMAND_CHANGED,		/* 37 */
544    XmCR_EXPOSE,			/* 38 */
545    XmCR_RESIZE,			/* 39 */
546    XmCR_INPUT,				/* 40 */
547    XmCR_GAIN_PRIMARY,			/* 41 */
548    XmCR_LOSE_PRIMARY,			/* 42 */
549    XmCR_CREATE,			/* 43 */
550    XmCR_TEAR_OFF_ACTIVATE,		/* 44 */
551    XmCR_TEAR_OFF_DEACTIVATE,		/* 45 */
552    XmCR_OBSCURED_TRAVERSAL,		/* 46 */
553    XmCR_FOCUS_MOVED,			/* 47 */
554    XmCR_DUMMY48,			/* 48 */
555    XmCR_DUMMY49,			/* 49 */
556    XmCR_DUMMY50,			/* 50 */
557    XmCR_DUMMY51,			/* 51 */
558    XmCR_DUMMY52,			/* 52 */
559    XmCR_DUMMY53,			/* 53 */
560    XmCR_REPOST,			/* 54 */
561    XmCR_COLLAPSED,			/* 55 */
562    XmCR_EXPANDED,			/* 56 */
563    XmCR_SELECT,			/* 57 */
564    XmCR_DRAG_START,			/* 58 */
565    XmCR_NO_FONT,			/* 59 */
566    XmCR_NO_RENDITION,			/* 60 */
567    XmCR_POST,				/* 61 */
568    XmCR_SPIN_NEXT,			/* 62 */
569    XmCR_SPIN_PRIOR,			/* 63 */
570    XmCR_SPIN_FIRST,			/* 64 */
571    XmCR_SPIN_LAST,			/* 65 */
572    XmCR_PAGE_SCROLLER_INCREMENT,	/* 66 */
573    XmCR_PAGE_SCROLLER_DECREMENT,	/* 67 */
574    XmCR_MAJOR_TAB,			/* 68 */
575    XmCR_MINOR_TAB,			/* 69 */
576	XmCR_START_JOB,
577	XmCR_END_JOB,
578	XmCR_PAGE_SETUP,
579    XmCR_PDM_NONE,                      /* ?? */
580    XmCR_PDM_START_VXAUTH,              /* ?? */
581    XmCR_PDM_START_PXAUTH,              /* ?? */
582    XmCR_PDM_UP,                        /* ?? */
583    XmCR_PDM_OK,                        /* ?? */
584    XmCR_PDM_CANCEL,                    /* ?? */
585    XmCR_PDM_START_ERROR,               /* ?? */
586    XmCR_PDM_EXIT_ERROR,                /* ?? */
587    XmCR_PROTOCOLS = 6666		/* Note: this was 47 in Motif 1.2x */
588};
589
590/*
591 * callback structures
592 */
593
594typedef struct {
595    int reason;
596    XEvent *event;
597} XmAnyCallbackStruct;
598
599typedef struct {
600    int reason;
601    XEvent *event;
602    int click_count;
603} XmArrowButtonCallbackStruct;
604
605typedef struct {
606    int reason;
607    XEvent *event;
608    XmString item_or_text;
609    int item_position;
610} XmComboBoxCallbackStruct;
611
612typedef struct {
613    int reason;
614    XEvent *event;
615    XmString value;
616    int length;
617} XmCommandCallbackStruct;
618
619typedef struct {
620    int reason;
621    XEvent *event;
622    Widget item;
623    unsigned char new_outline_state;
624} XmContainerOutlineCallbackStruct;
625
626typedef struct {
627    int reason;
628    XEvent *event;
629    WidgetList selected_items;
630    int selected_item_count;
631    unsigned char auto_selection_type;
632} XmContainerSelectCallbackStruct;
633
634typedef struct {
635    int reason;
636    XEvent *event;
637    XmRendition rendition;
638    char *font_name;
639    XmRenderTable render_table;
640    XmStringTag tag;
641} XmDisplayCallbackStruct;
642
643typedef struct _XmDragStartCallbackStruct {
644    int reason;
645    XEvent *event;
646    Widget widget;
647    Boolean doit;
648} XmDragStartCallbackStruct, *XmDragStartCallback;
649
650typedef struct {
651    int reason;
652    XEvent *event;
653    Window window;
654} XmDrawingAreaCallbackStruct;
655
656typedef struct {
657    int reason;
658    XEvent *event;
659    Window window;
660    int click_count;
661} XmDrawnButtonCallbackStruct;
662
663typedef struct {
664    int reason;
665    XEvent *event;
666    XmString value;
667    int length;
668    XmString mask;
669    int mask_length;
670    XmString dir;
671    int dir_length;
672    XmString pattern;
673    int pattern_length;
674} XmFileSelectionBoxCallbackStruct;
675
676typedef struct {
677    int reason;                    /* reason callback was called */
678    XEvent *event;                 /* points to event structure */
679    XmString item;                 /* item most recently selected */
680    int item_length;               /* number of bytes in item member */
681    int item_position;             /* item's position in XmNitems */
682    XmString *selected_items;      /* list of items selected */
683    int selected_item_count;       /* number of items in selected_items */
684    int *selected_item_positions;  /* array of ints marking selected items */
685    char selection_type;           /* type of most recent selection */
686    unsigned char auto_selection_type;  /* type of automatic selection callback */
687} XmListCallbackStruct;
688
689typedef struct {
690    int reason;
691    XEvent *event;
692    int page_number;
693    Widget page_widget;
694    int prev_page_number;
695    Widget prev_page_widget;
696} XmNotebookCallbackStruct;
697
698typedef struct {
699    int reason;
700    XEvent *event;
701    Widget menuToPost;
702    Boolean postIt;
703    Widget target;
704} XmPopupHandlerCallbackStruct;
705
706typedef struct {
707    int reason;                   /* reason callback was called */
708    XEvent *event;
709    int click_count;
710} XmPushButtonCallbackStruct;
711
712typedef struct {
713    int reason;
714    XEvent *event;
715    Widget widget;
716    char *data;
717    char *callbackstruct;
718} XmRowColumnCallbackStruct;
719
720
721typedef struct {
722    int reason;                   /* reason callback was called */
723    XEvent *event;
724    int value;
725} XmScaleCallbackStruct;
726
727typedef struct {
728    int reason;
729    XEvent *event;
730    int value;
731    int pixel;
732} XmScrollBarCallbackStruct;
733
734typedef struct {
735    int reason;
736    XEvent *event;
737    XmString value;
738    int length;
739} XmSelectionBoxCallbackStruct;
740
741typedef struct {
742    int reason;
743    XEvent *event;
744    Widget widget;
745    Boolean doit;
746    int position;
747    XmString value;
748    Boolean crossed_boundary;
749} XmSimpleSpinBoxCallbackStruct;
750
751typedef struct {
752    int reason;
753    XEvent *event;
754    Widget widget;
755    Boolean doit;
756    int position;
757    XmString value;
758    Boolean crossed_boundary;
759} XmSpinBoxCallbackStruct;
760
761typedef struct {
762    int reason;                   /* reason callback was called */
763    XEvent *event;
764    int set;
765} XmToggleButtonCallbackStruct;
766
767/* multiclick */
768
769enum {
770    XmMULTICLICK_DISCARD,
771    XmMULTICLICK_KEEP
772};
773
774/* Drawn button overrides some of the ShadowTypes */
775enum {
776    XmSHADOW_IN = 7,
777    XmSHADOW_OUT
778};
779
780/* Arrow button directions */
781enum {
782    XmARROW_UP,
783    XmARROW_DOWN,
784    XmARROW_LEFT,
785    XmARROW_RIGHT
786};
787
788/* Shadow/Separator types */
789
790enum {
791    XmNO_LINE,
792    XmSINGLE_LINE,
793    XmDOUBLE_LINE,
794    XmSINGLE_DASHED_LINE,
795    XmDOUBLE_DASHED_LINE,
796    XmSHADOW_ETCHED_IN,
797    XmSHADOW_ETCHED_OUT,
798    XmSHADOW_ETCHED_IN_DASH,
799    XmSHADOW_ETCHED_OUT_DASH,
800    XmINVALID_SEPARATOR_TYPE
801};
802
803/* XmLabel types */
804
805enum {
806    XmPIXMAP = 1,
807    XmSTRING
808};
809
810/* DragDrop */
811enum {
812    XmWINDOW,
813/* implied
814 *  XmPIXMAP
815 */
816    XmCURSOR = 2
817};
818
819/* maximum value resources */
820
821enum {
822    XmMAX_ON_TOP,
823    XmMAX_ON_BOTTOM,
824    XmMAX_ON_LEFT,
825    XmMAX_ON_RIGHT
826};
827
828/* list selection policies */
829
830enum {
831    XmSINGLE_SELECT,
832    XmMULTIPLE_SELECT,
833    XmEXTENDED_SELECT,
834    XmBROWSE_SELECT
835};
836
837enum {
838    XmSTATIC,
839    XmDYNAMIC
840};
841
842enum {
843    XmNORMAL_MODE,
844    XmADD_MODE
845};
846
847/* container stuff */
848
849/* for XmRAutomaticSelection */
850enum {
851    XmNO_AUTO_SELECT,
852    XmAUTO_SELECT
853};
854
855/* auto_selection_type */
856enum {
857   XmAUTO_UNSET,
858   XmAUTO_BEGIN,
859   XmAUTO_MOTION,
860   XmAUTO_CANCEL,
861   XmAUTO_NO_CHANGE,
862   XmAUTO_CHANGE
863};
864
865/* for XmRLineStyle */
866enum {
867 /* XmNO_LINE */
868    XmSINGLE = 1
869};
870
871/* for XmREntryViewType */
872enum {
873 /* XmLARGE_ICON */
874 /* XmSMALL_ICON */
875    XmANY_ICON = 2
876};
877
878/* for XmRSpatialIncludeModel */
879enum {
880    XmAPPEND,
881    XmCLOSEST,
882    XmFIRST_FIT
883};
884
885/* for XmRLayoutType */
886enum {
887    XmOUTLINE,
888    XmSPATIAL,
889    XmDETAIL
890};
891
892/* for XmNoutlineButtonPolicy */
893enum {
894    XmOUTLINE_BUTTON_PRESENT,
895    XmOUTLINE_BUTTON_ABSENT
896};
897
898/* for XmRSpatialPlaceStyle */
899enum {
900 /* XmNONE */
901    XmGRID = 1,
902    XmCELLS
903};
904
905/* for XmRPrimaryOwnership */
906enum {
907    XmOWN_NEVER,
908    XmOWN_ALWAYS,
909    XmOWN_MULTIPLE,
910    XmOWN_POSSIBLE_MULTIPLE
911};
912
913/* for XmRSpatialResizeModel */
914enum {
915    XmGROW_MINOR,
916    XmGROW_MAJOR,
917    XmGROW_BALANCED
918};
919
920/* for XmRSelectionTechnique */
921enum {
922    XmMARQUEE,
923    XmMARQUEE_EXTEND_START,
924    XmMARQUEE_EXTEND_BOTH,
925    XmTOUCH_ONLY,
926    XmTOUCH_OVER
927};
928
929/* for XmRSpatialSnapModel */
930enum {
931 /* XmNONE */
932    XmSNAP_TO_GRID = 1,
933    XmCENTER
934};
935
936/* for XmROutlineState */
937enum {
938    XmCOLLAPSED,
939    XmEXPANDED
940};
941
942/* icon gadget stuff */
943
944/* for XmRViewType */
945enum {
946    XmLARGE_ICON,
947    XmSMALL_ICON
948};
949
950/* for XmRVisualEmphasis */
951enum {
952    XmSELECTED,
953    XmNOT_SELECTED
954};
955
956/* notebook stuff */
957
958#define XmUNSPECIFIED_PAGE_NUMBER       (-32768)
959
960/* for XmRBindingType */
961enum {
962 /* XmNONE */
963 /* XmPIXMAP */
964    XmSOLID = 2,
965    XmSPIRAL,
966    XmPIXMAP_OVERLAP_ONLY
967};
968
969/* for XmRNBChildType */
970enum {
971 /* XmNONE */
972    XmPAGE = 1,
973    XmMAJOR_TAB,
974    XmMINOR_TAB,
975    XmSTATUS_AREA,
976    XmPAGE_SCROLLER
977};
978
979/* spin box stuff */
980
981/* for XmNarrowLayout */
982enum {
983    XmARROWS_END,
984    XmARROWS_BEGINNING,
985    XmARROWS_SPLIT,
986    XmARROWS_FLAT_END,
987    XmARROWS_FLAT_BEGINNING
988};
989
990/* XmSpinBox XmNarrowOrientation */
991enum {
992	XmARROWS_HORIZONTAL,
993	XmARROWS_VERTICAL
994};
995
996/* for XmNarrowSensitivity or XmNdefaultArrowSensitivity */
997enum {
998    XmARROWS_INSENSITIVE,
999    XmARROWS_INCREMENT_SENSITIVE,
1000    XmARROWS_DECREMENT_SENSITIVE,
1001    XmARROWS_SENSITIVE,
1002    XmARROWS_DEFAULT_SENSITIVITY
1003};
1004
1005/* for XmNspinBoxChildType */
1006enum {
1007    XmNUMERIC = 3
1008};
1009
1010/* XmNpositionType for XmSpinBox */
1011enum {
1012	XmPOSITION_VALUE,
1013	XmPOSITION_INDEX
1014};
1015
1016/* XmSpinBoxValidatePosition() return values */
1017enum{
1018   XmVALID_VALUE,
1019   XmCURRENT_VALUE,
1020   XmMINIMUM_VALUE,
1021   XmMAXIMUM_VALUE,
1022   XmINCREMENT_VALUE
1023};
1024
1025
1026/* scrolled window policy stuff */
1027
1028enum {
1029    XmVARIABLE,
1030    XmCONSTANT,
1031    XmRESIZE_IF_POSSIBLE
1032};
1033
1034enum {
1035    XmAUTOMATIC,
1036    XmAPPLICATION_DEFINED
1037};
1038
1039enum {
1040/* implied
1041 *  XmSTATIC,
1042 */
1043    XmAS_NEEDED = 1
1044};
1045
1046enum {
1047    XmBOTTOM_RIGHT,
1048    XmTOP_RIGHT,
1049    XmBOTTOM_LEFT,
1050    XmTOP_LEFT
1051};
1052
1053/* main window command window locations */
1054
1055enum {
1056    XmCOMMAND_ABOVE_WORKSPACE,
1057    XmCOMMAND_BELOW_WORKSPACE
1058};
1059
1060/* edit modes for text widgets */
1061
1062enum {
1063    XmMULTI_LINE_EDIT,
1064    XmSINGLE_LINE_EDIT
1065};
1066
1067/* text directions */
1068
1069typedef enum {
1070    XmTEXT_FORWARD,
1071    XmTEXT_BACKWARD
1072} XmTextDirection;
1073
1074typedef long XmTextPosition;
1075typedef Atom XmTextFormat;
1076
1077#define XmFMT_8_BIT	((XmTextFormat) XA_STRING)
1078#define XmFMT_16_BIT	((XmTextFormat) 2)  /* they _mean_ XA_SECONDARY ??? */
1079
1080/*
1081 * something about backwards compatibility... besides, xmcd needs these
1082 */
1083#define FMT8BIT  XmFMT_8_BIT
1084#define FMT16BIT XmFMT_16_BIT
1085
1086#define XmFMT_8_BIT	((XmTextFormat) XA_STRING)
1087#define XmFMT_16_BIT	((XmTextFormat) 2)  /* they _mean_ XA_SECONDARY ??? */
1088
1089/* Stuff for Text Widgets */
1090typedef enum {
1091    XmSELECT_POSITION,
1092    XmSELECT_WHITESPACE,
1093    XmSELECT_WORD,
1094    XmSELECT_LINE,
1095    XmSELECT_ALL,
1096    XmSELECT_PARAGRAPH,
1097    XmSELECT_OUT_LINE
1098} XmTextScanType;
1099
1100/* highlight mode for text and textfield widgets */
1101
1102typedef enum {
1103    XmHIGHLIGHT_NORMAL,
1104    XmHIGHLIGHT_SELECTED,
1105    XmHIGHLIGHT_SECONDARY_SELECTED
1106} XmHighlightMode;
1107
1108typedef struct {
1109    char *ptr;
1110    int length;
1111    XmTextFormat format;
1112} XmTextBlockRec, *XmTextBlock;
1113
1114/* keep the members comma separated, as that can be endian dependent */
1115typedef struct {
1116    int  reason;
1117    XEvent *event;
1118    Boolean doit;
1119    XmTextPosition currInsert, newInsert;
1120    XmTextPosition startPos, endPos;
1121    XmTextBlock text;
1122} XmTextVerifyCallbackStruct, *XmTextVerifyPtr;
1123
1124typedef struct {
1125    wchar_t *wcsptr;
1126    int length;
1127} XmTextBlockRecWcs, *XmTextBlockWcs;
1128
1129typedef struct {
1130    int  reason;
1131    XEvent *event;
1132    Boolean doit;
1133    XmTextPosition currInsert, newInsert;
1134    XmTextPosition startPos, endPos;
1135    XmTextBlockWcs text;
1136} XmTextVerifyCallbackStructWcs, *XmTextVerifyPtrWcs;
1137
1138#define XmCOPY_FAILED           0
1139#define XmCOPY_SUCCEEDED        1
1140#define XmCOPY_TRUNCATED        2
1141
1142/* dialog child types */
1143
1144enum {
1145    XmDIALOG_NONE,
1146    XmDIALOG_APPLY_BUTTON,
1147    XmDIALOG_CANCEL_BUTTON,
1148    XmDIALOG_DEFAULT_BUTTON,
1149    XmDIALOG_OK_BUTTON,
1150    XmDIALOG_FILTER_LABEL,
1151    XmDIALOG_FILTER_TEXT,
1152    XmDIALOG_HELP_BUTTON,
1153    XmDIALOG_LIST,
1154    XmDIALOG_LIST_LABEL,
1155    XmDIALOG_MESSAGE_LABEL,
1156    XmDIALOG_SELECTION_LABEL,
1157    XmDIALOG_SYMBOL_LABEL,
1158    XmDIALOG_TEXT,
1159    XmDIALOG_SEPARATOR,
1160    XmDIALOG_DIR_LIST,
1161    XmDIALOG_DIR_LIST_LABEL
1162};
1163
1164#define XmDIALOG_COMMAND_TEXT    XmDIALOG_TEXT
1165#define XmDIALOG_FILE_LIST       XmDIALOG_LIST
1166#define XmDIALOG_FILE_LIST_LABEL XmDIALOG_LIST_LABEL
1167#define XmDIALOG_HISTORY_LIST    XmDIALOG_LIST
1168#define XmDIALOG_PROMPT_LABEL    XmDIALOG_SELECTION_LABEL
1169#define XmDIALOG_VALUE_TEXT      XmDIALOG_TEXT
1170
1171/* dialog styles */
1172enum {
1173    XmDIALOG_MODELESS,
1174    XmDIALOG_PRIMARY_APPLICATION_MODAL,
1175    XmDIALOG_FULL_APPLICATION_MODAL,
1176    XmDIALOG_SYSTEM_MODAL
1177};
1178
1179/* this is obsolete.  Use XmDIALOG_PRIMARY_APPLICATION_MODAL */
1180#define XmDIALOG_APPLICATION_MODAL XmDIALOG_PRIMARY_APPLICATION_MODAL
1181
1182/* child placements (for selection boxes) */
1183
1184enum {
1185    XmPLACE_TOP,
1186    XmPLACE_ABOVE_SELECTION,
1187    XmPLACE_BELOW_SELECTION
1188};
1189
1190/* file type masks for filesb */
1191#define XmFILE_DIRECTORY    (1 << 0)
1192#define XmFILE_REGULAR      (1 << 1)
1193#define XmFILE_ANY_TYPE     (XmFILE_DIRECTORY | XmFILE_REGULAR)
1194
1195/* defines for selection dialog type: */
1196
1197enum {
1198    XmDIALOG_WORK_AREA,
1199    XmDIALOG_PROMPT,
1200    XmDIALOG_SELECTION,
1201    XmDIALOG_COMMAND,
1202    XmDIALOG_FILE_SELECTION
1203};
1204
1205/* dialog types */
1206enum {
1207    XmDIALOG_TEMPLATE,
1208    XmDIALOG_ERROR,
1209    XmDIALOG_INFORMATION,
1210    XmDIALOG_MESSAGE,
1211    XmDIALOG_QUESTION,
1212    XmDIALOG_WARNING,
1213    XmDIALOG_WORKING
1214};
1215
1216/* traversal stuff */
1217
1218typedef enum {
1219    XmVISIBILITY_UNOBSCURED,
1220    XmVISIBILITY_PARTIALLY_OBSCURED,
1221    XmVISIBILITY_FULLY_OBSCURED
1222} XmVisibility;
1223
1224typedef enum {
1225    XmTRAVERSE_CURRENT,
1226    XmTRAVERSE_NEXT,
1227    XmTRAVERSE_PREV,
1228    XmTRAVERSE_HOME,
1229    XmTRAVERSE_NEXT_TAB_GROUP,
1230    XmTRAVERSE_PREV_TAB_GROUP,
1231    XmTRAVERSE_UP,
1232    XmTRAVERSE_DOWN,
1233    XmTRAVERSE_LEFT,
1234    XmTRAVERSE_RIGHT
1235} XmTraversalDirection;
1236
1237typedef struct {
1238    int reason;
1239    XEvent *event;
1240    Widget traversal_destination;
1241    XmTraversalDirection direction;
1242} XmTraverseObscuredCallbackStruct;
1243
1244typedef unsigned char XmNavigationType;
1245
1246/* simple menu stuff */
1247
1248typedef unsigned char XmButtonType;
1249typedef XmButtonType * XmButtonTypeTable;
1250typedef KeySym * XmKeySymTable;
1251typedef XmStringCharSet * XmStringCharSetTable;
1252
1253enum {
1254    XmPUSHBUTTON = 1,
1255    XmTOGGLEBUTTON,
1256    XmRADIOBUTTON,
1257    XmCASCADEBUTTON,
1258    XmSEPARATOR,
1259    XmDOUBLE_SEPARATOR,
1260    XmTITLE
1261};
1262
1263#define XmCHECKBUTTON	XmTOGGLEBUTTON
1264
1265/* Stuff needed by the base class stuff in BaseClass.c */
1266
1267typedef XtPointer (*XmResourceBaseProc)(Widget w, XtPointer);
1268
1269typedef struct _XmSecondaryResourceDataRec {
1270    XmResourceBaseProc base_proc;
1271    XtPointer client_data;
1272    String name;
1273    String res_class;
1274    XtResourceList resources;
1275    Cardinal num_resources;
1276} XmSecondaryResourceDataRec, *XmSecondaryResourceData;
1277
1278XMLIBEXPORT Cardinal XmGetSecondaryResourceData(WidgetClass wc,
1279				    XmSecondaryResourceData **resData);
1280
1281/************************ Manager.c ***************************/
1282XMLIBEXPORT Widget XmObjectAtPoint(Widget cw, Position x, Position y);
1283
1284/************************ ImageCache.c ***************************/
1285
1286XMLIBEXPORT Pixmap XmGetPixmap(Screen *screen, char *image_name,
1287                   Pixel foreground, Pixel background);
1288XMLIBEXPORT Pixmap XmGetPixmapByDepth(Screen *screen, char *image_name,
1289                          Pixel foreground, Pixel background, int depth);
1290XMLIBEXPORT Boolean XmDestroyPixmap(Screen *screen, Pixmap pixmap);
1291XMLIBEXPORT Boolean XmInstallImage(XImage *image, char *image_name);
1292XMLIBEXPORT Boolean XmUninstallImage(XImage *image);
1293XMLIBEXPORT XtEnum XmGetScaledPixmap(Widget widget, String image_name,
1294                         Pixel foreground, Pixel background,
1295                         int depth, double scaling_ratio);
1296
1297/************************** Manager.c *****************************/
1298
1299XMLIBEXPORT void XmUpdateDisplay(Widget w);
1300
1301/************************* Primitive.c ****************************/
1302
1303typedef long XmOffset;
1304typedef XmOffset *XmOffsetPtr;
1305
1306XMLIBEXPORT void XmResolvePartOffsets(WidgetClass w_class, XmOffsetPtr *offset);
1307XMLIBEXPORT void XmResolveAllPartOffsets(WidgetClass w_class, XmOffsetPtr *offset,
1308			     XmOffsetPtr *constraint_offset);
1309XMLIBEXPORT Boolean XmWidgetGetBaselines(Widget wid, Dimension **baselines,
1310			     int *line_count);
1311XMLIBEXPORT Boolean XmWidgetGetDisplayRect(Widget wid, XRectangle *displayrect);
1312
1313/************************** RenderTable.c ****************************/
1314
1315XMLIBEXPORT XmRenderTable XmRenderTableAddRenditions(XmRenderTable        oldtable,
1316					 XmRendition    *renditions,
1317					 Cardinal       rendition_count,
1318					 XmMergeMode    merge_mode);
1319
1320XMLIBEXPORT XmRenderTable XmRenderTableCopy(XmRenderTable table,
1321				XmStringTag     *tags,
1322				int             tag_count);
1323
1324XMLIBEXPORT XmRenderTable XmRenderTableCvtFromProp(Widget         widget,
1325				       char             *property,
1326				       unsigned int     length);
1327
1328XMLIBEXPORT unsigned int XmRenderTableCvtToProp(Widget            widget,
1329				    XmRenderTable       table,
1330				    char                **prop_return);
1331
1332XMLIBEXPORT void XmRenderTableFree(XmRenderTable table);
1333
1334XMLIBEXPORT XmRendition XmRenderTableGetRendition(XmRenderTable   table,
1335				      XmStringTag       tag);
1336
1337XMLIBEXPORT XmRendition *XmRenderTableGetRenditions(XmRenderTable table,
1338					XmStringTag     *tags,
1339					Cardinal        tag_count);
1340
1341XMLIBEXPORT int XmRenderTableGetTags(XmRenderTable        table,
1342			 XmStringTag    **tag_list);
1343
1344XMLIBEXPORT XmRenderTable XmRenderTableRemoveRenditions(XmRenderTable     oldtable,
1345					    XmStringTag *tags,
1346					    int         tag_count);
1347
1348XMLIBEXPORT Boolean XmeRenderTableGetDefaultFont(XmRenderTable    renderTable,
1349				     XFontStruct        **fontStruct);
1350
1351XMLIBEXPORT XmString XmStringGenerate(XtPointer   text,
1352			  XmStringTag   tag,
1353			  XmTextType    type,
1354			  XmStringTag   rendition);
1355
1356XMLIBEXPORT XmRendition XmRenditionCreate(Widget widget,
1357			      XmStringTag tag,
1358			      ArgList arglist,
1359			      Cardinal argcount);
1360
1361XMLIBEXPORT void XmRenditionFree(XmRendition rendition);
1362
1363XMLIBEXPORT void XmRenditionUpdate(XmRendition rendition,
1364		       ArgList arglist,
1365		       Cardinal argcount);
1366
1367XMLIBEXPORT void XmRenditionRetrieve (XmRendition rendition,
1368                          ArgList arglist,
1369			  Cardinal argcount);
1370
1371/************************ ResConvert.c ****************************/
1372
1373XMLIBEXPORT void XmRegisterConverters(void);
1374XMLIBEXPORT void XmCvtStringToUnitType(XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val);
1375XMLIBEXPORT char *XmRegisterSegmentEncoding(char *fontlist_tag, char *ct_encoding);
1376XMLIBEXPORT char *XmMapSegmentEncoding(char *fontlist_tag);
1377XMLIBEXPORT XmString XmCvtCTToXmString(char *text);
1378XMLIBEXPORT Boolean XmCvtTextToXmString(Display *display, XrmValuePtr args,
1379			    Cardinal *num_args, XrmValue *from_val,
1380			    XrmValue *to_val, XtPointer *converter_data);
1381XMLIBEXPORT char *XmCvtXmStringToCT(XmString string);
1382XMLIBEXPORT Boolean XmCvtXmStringToText(Display *display, XrmValuePtr args,
1383			    Cardinal *num_args, XrmValue *from_val,
1384			    XrmValue *to_val, XtPointer *converter_data);
1385XMLIBEXPORT int XmConvertStringToUnits(Screen *screen, String spec, int orientation,
1386	int to_type, XtEnum *parse_error);
1387XMLIBEXPORT unsigned int XmCvtXmStringToByteStream(XmString string,
1388                                       unsigned char **prop_return);
1389XMLIBEXPORT XmString XmCvtByteStreamToXmString(unsigned char *property);
1390XMLIBEXPORT int XmCvtXmStringTableToTextProperty (Display *display,
1391                                      XmStringTable string_table,
1392                                      int count,
1393                                      XmICCEncodingStyle style,
1394                                      XTextProperty *text_prop_return);
1395
1396/************************** ResInd.c ******************************/
1397
1398XMLIBEXPORT int XmConvertUnits(Widget widget, int orientation,
1399		   int from_unit_type, int from_value, int to_unit_type);
1400XMLIBEXPORT int  XmCvtToHorizontalPixels(Screen *screen, int from_val, int from_type);
1401XMLIBEXPORT int  XmCvtToVerticalPixels(Screen *screen, int from_val, int from_type);
1402XMLIBEXPORT int  XmCvtFromHorizontalPixels(Screen *screen, int from_val, int to_type);
1403XMLIBEXPORT int  XmCvtFromVerticalPixels(Screen *screen, int from_val, int to_type);
1404XMLIBEXPORT void XmSetFontUnits(Display *display, int h_value, int v_value);
1405XMLIBEXPORT void XmSetFontUnit(Display *display, int value);
1406
1407/************************* MenuUtil.c *****************************/
1408
1409XMLIBEXPORT void XmSetMenuCursor(Display *display, Cursor cursorId);
1410XMLIBEXPORT Cursor XmGetMenuCursor(Display *display);
1411
1412/************************** Simple.c ******************************/
1413
1414XMLIBEXPORT Widget XmCreateSimpleCheckBox(Widget parent, char *name,
1415			      Arg *arglist, Cardinal argcount);
1416XMLIBEXPORT Widget XmCreateSimpleMenuBar(Widget parent, char *name,
1417			     Arg *arglist, Cardinal argcount);
1418XMLIBEXPORT Widget XmCreateSimpleOptionMenu(Widget parent, char *name,
1419				Arg *arglist, Cardinal argcount);
1420XMLIBEXPORT Widget XmCreateSimplePopupMenu(Widget parent, char *name,
1421			       Arg *arglist, Cardinal argcount);
1422XMLIBEXPORT Widget XmCreateSimplePulldownMenu(Widget parent, char *name,
1423				  Arg *arglist, Cardinal argcount);
1424XMLIBEXPORT Widget XmCreateSimpleRadioBox(Widget parent, char *name,
1425			      Arg *arglist, Cardinal argcount);
1426
1427/************************* VaSimple.c *****************************/
1428
1429XMLIBEXPORT Widget XmVaCreateSimpleCheckBox(Widget parent, String name,
1430				XtCallbackProc callback, ...);
1431XMLIBEXPORT Widget XmVaCreateSimpleMenuBar(Widget parent, String name,
1432			       ...);
1433XMLIBEXPORT Widget XmVaCreateSimpleOptionMenu(Widget parent, String name,
1434				  XmString option_label,
1435				  KeySym option_mnemonic,
1436				  int button_set,
1437				  XtCallbackProc callback, ...);
1438XMLIBEXPORT Widget XmVaCreateSimplePopupMenu(Widget parent, String name,
1439				 XtCallbackProc callback, ...);
1440XMLIBEXPORT Widget XmVaCreateSimplePulldownMenu(Widget parent, String name,
1441				    int post_from_button,
1442				    XtCallbackProc callback, ...);
1443XMLIBEXPORT Widget XmVaCreateSimpleRadioBox(Widget parent, String name,
1444				int button_set,
1445				XtCallbackProc callback, ...);
1446
1447/************************** TrackLoc.c *****************************/
1448
1449XMLIBEXPORT Widget XmTrackingEvent(Widget widget, Cursor cursor, Boolean confine_to,
1450		       XEvent *event_return);
1451XMLIBEXPORT Widget XmTrackingLocate(Widget widget, Cursor cursor, Boolean confine_to);
1452
1453/**************************** Visual.c *****************************/
1454
1455typedef void (*XmColorProc)(XColor *bg_color, XColor *fg_color,
1456			    XColor *sel_color, XColor *ts_color, XColor *bs_color);
1457
1458
1459XMLIBEXPORT XmColorProc XmSetColorCalculation(XmColorProc proc);
1460XMLIBEXPORT XmColorProc XmGetColorCalculation(void);
1461XMLIBEXPORT void XmGetColors(Screen *screen, Colormap color_map,
1462			Pixel background, Pixel *foreground_ret,
1463			Pixel *top_shadow_ret, Pixel *bottom_shadow_ret,
1464			Pixel *select_ret);
1465XMLIBEXPORT void XmChangeColor(Widget widget, Pixel background);
1466
1467/*************************** XmString.c ****************************/
1468
1469XMLIBEXPORT Dimension XmStringBaseline(XmFontList fontlist, XmString string);
1470XMLIBEXPORT Boolean XmStringByteCompare(XmString s1, XmString s2);
1471XMLIBEXPORT Boolean XmStringCompare(XmString s1, XmString s2);
1472XMLIBEXPORT XmString XmStringConcat(XmString s1, XmString s2);
1473XMLIBEXPORT XmString XmStringConcatAndFree(XmString s1, XmString s2);
1474XMLIBEXPORT XmString XmStringCreate(char *text, char *tag);
1475XMLIBEXPORT XmString XmStringCreateLtoR(char *text, char *tag);
1476XMLIBEXPORT XmString XmStringLtoRCreate(char *text, char *tag);
1477XMLIBEXPORT XmString XmStringCreateLocalized(char *text);
1478XMLIBEXPORT XmString XmStringCreateSimple(char *text);
1479XMLIBEXPORT XmString XmStringDirectionCreate(XmStringDirection direction);
1480XMLIBEXPORT void XmStringDraw(Display *d,
1481		  Window w,
1482		  XmFontList fontlist,
1483		  XmString string,
1484		  GC gc,
1485		  Position x,
1486		  Position y,
1487		  Dimension width,
1488		  unsigned char alignment,
1489		  unsigned char layout_direction,
1490		  XRectangle *clip);
1491XMLIBEXPORT void XmStringDrawImage(Display *d, Window w,
1492		       XmFontList fontlist,
1493		       XmString string,
1494		       GC gc,
1495		       Position x,
1496		       Position y,
1497		       Dimension width,
1498		       unsigned char alignment,
1499		       unsigned char layout_direction,
1500		       XRectangle *clip);
1501XMLIBEXPORT void XmStringDrawUnderline(Display *d, Window w,
1502			   XmFontList fontlist, XmString string,
1503			   GC gc, Position x, Position y, Dimension width,
1504			   unsigned char alignment,
1505			   unsigned char layout_direction,
1506			   XRectangle *clip,
1507			   XmString underline);
1508XMLIBEXPORT Boolean XmStringEmpty(XmString s1);
1509XMLIBEXPORT void XmStringExtent(XmFontList fontlist,
1510		    XmString string,
1511		    Dimension *width,
1512		    Dimension *height);
1513XMLIBEXPORT void XmStringFree(XmString string);
1514XMLIBEXPORT void XmStringFreeContext(XmStringContext context);
1515XMLIBEXPORT Boolean XmStringGetLtoR(XmString string,
1516			XmStringCharSet tag,
1517			char **text);
1518XMLIBEXPORT XmStringComponentType XmStringGetNextComponent(XmStringContext context,
1519					       char **text,
1520					       XmStringCharSet *tag,
1521					       XmStringDirection *direction,
1522					       XmStringComponentType *unknown_tag,
1523					       unsigned short *unknown_length,
1524					       unsigned char **unknown_value);
1525XMLIBEXPORT Boolean XmStringGetNextSegment(XmStringContext context,
1526			       char **text,
1527			       XmStringCharSet *tag,
1528			       XmStringDirection *direction,
1529			       Boolean *separator);
1530XMLIBEXPORT Boolean XmStringHasSubstring(XmString string,
1531			     XmString substring);
1532XMLIBEXPORT Dimension XmStringHeight(XmFontList fontlist, XmString string);
1533XMLIBEXPORT Boolean XmStringInitContext(XmStringContext *context,
1534			    XmString string);
1535XMLIBEXPORT int XmStringLength(XmString s1);
1536XMLIBEXPORT int XmStringLineCount(XmString string);
1537XMLIBEXPORT XmString XmStringNConcat(XmString s1, XmString s2, int num_bytes);
1538XMLIBEXPORT XmString XmStringCopy(XmString s);
1539XMLIBEXPORT XmString XmStringNCopy(XmString s1, int num_bytes);
1540XMLIBEXPORT XmStringComponentType XmStringPeekNextComponent(XmStringContext context);
1541XMLIBEXPORT XmString XmStringSegmentCreate(char *text, char *tag,
1542			       XmStringDirection direction,
1543			       Boolean separator);
1544XMLIBEXPORT XmString XmStringSeparatorCreate(void);
1545
1546XMLIBEXPORT Dimension XmStringWidth(XmFontList fontList, XmString string);
1547
1548XMLIBEXPORT XtPointer XmStringUnparse(XmString string,
1549                          XmStringTag tag,
1550                          XmTextType tag_type,
1551                          XmTextType output_type,
1552                          XmParseTable parse_table,
1553                          Cardinal parse_count,
1554                          XmParseModel parse_model);
1555
1556
1557XMLIBEXPORT Cardinal XmStringToXmStringTable(XmString string,
1558                                 XmString break_comp,
1559                                 XmStringTable *table);
1560
1561XMLIBEXPORT XmString XmStringTableToXmString(XmStringTable table,
1562                                 Cardinal count,
1563                                 XmString break_component);
1564
1565XMLIBEXPORT XtPointer *XmStringTableUnparse(XmStringTable table,
1566                                Cardinal count,
1567                                XmStringTag tag,
1568                                XmTextType tag_type,
1569                                XmTextType output_type,
1570                                XmParseTable parse,
1571                                Cardinal parse_count,
1572                                XmParseModel parse_model);
1573
1574XMLIBEXPORT XmStringTable XmStringTableParseStringArray(XtPointer *strings,
1575                                            Cardinal count,
1576                                            XmStringTag tag,
1577                                            XmTextType type,
1578                                            XmParseTable parse,
1579                                            Cardinal parse_count,
1580                                            XtPointer call_data);
1581
1582XMLIBEXPORT XmString XmStringPutRendition(XmString string,
1583                              XmStringTag rendition);
1584
1585XMLIBEXPORT XmParseMapping XmParseMappingCreate(ArgList arg_list,
1586                                    Cardinal arg_count);
1587
1588XMLIBEXPORT void XmParseMappingSetValues(XmParseMapping parse_mapping,
1589                             ArgList arg_list,
1590                             Cardinal arg_count);
1591
1592XMLIBEXPORT void XmParseMappingGetValues(XmParseMapping parse_mapping,
1593                             ArgList arg_list,
1594                             Cardinal arg_count);
1595
1596XMLIBEXPORT void XmParseMappingFree(XmParseMapping parse_mapping);
1597
1598XMLIBEXPORT void XmParseTableFree(XmParseTable parse_table,
1599                      Cardinal parse_count);
1600
1601XMLIBEXPORT XmStringComponentType XmStringGetNextTriple(XmStringContext context,
1602                                            unsigned int *length,
1603                                            XtPointer *value);
1604
1605XMLIBEXPORT XmStringComponentType XmStringPeekNextTriple(XmStringContext context);
1606
1607XMLIBEXPORT XmString XmStringComponentCreate(XmStringComponentType ctype,
1608                                 unsigned int length,
1609                                 XtPointer value);
1610
1611XMLIBEXPORT Boolean XmStringIsVoid(XmString s1);
1612
1613XMLIBEXPORT XmString XmStringParseText(XtPointer text, XtPointer *text_end, XmStringTag tag,
1614	XmTextType type, XmParseTable parse_table, Cardinal parse_count,
1615	XtPointer call_data);
1616
1617/*************************** FontList.c *****************************/
1618
1619XMLIBEXPORT XmFontList XmFontListAppendEntry(XmFontList oldlist,
1620				 XmFontListEntry entry);
1621XMLIBEXPORT XmFontList XmFontListCreate(XFontStruct *font,
1622			    XmStringCharSet charset);
1623XMLIBEXPORT XmFontList XmFontListAdd(XmFontList old,
1624			 XFontStruct *font,
1625			 XmStringCharSet charset);
1626XMLIBEXPORT XmFontList XmFontListCopy(XmFontList fontlist);
1627XMLIBEXPORT XmFontListEntry XmFontListEntryCreate(char *tag,
1628				      XmFontType type,
1629				      XtPointer font);
1630XMLIBEXPORT void XmFontListEntryFree(XmFontListEntry *entry);
1631XMLIBEXPORT XtPointer XmFontListEntryGetFont(XmFontListEntry entry,
1632				 XmFontType *type_return);
1633XMLIBEXPORT char *XmFontListEntryGetTag(XmFontListEntry entry);
1634XMLIBEXPORT XmFontListEntry XmFontListEntryLoad(Display *display,
1635				    char *font_name,
1636				    XmFontType type,
1637				    char *tag);
1638XMLIBEXPORT void XmFontListFree(XmFontList list);
1639XMLIBEXPORT void XmFontListFreeFontContext(XmFontContext context);
1640XMLIBEXPORT Boolean XmFontListInitFontContext(XmFontContext *context,
1641				  XmFontList fontlist);
1642XMLIBEXPORT XmFontListEntry XmFontListNextEntry(XmFontContext context);
1643XMLIBEXPORT Boolean XmFontListGetNextFont(XmFontContext context, XmStringCharSet *charset, XFontStruct **font);
1644XMLIBEXPORT XmFontList XmFontListRemoveEntry(XmFontList oldlist,
1645				 XmFontListEntry entry);
1646
1647XMLIBEXPORT XmFontList XmStringCreateFontList( XFontStruct *font, XmStringCharSet charset);
1648
1649/************************** Dest.c ***********************************/
1650
1651XMLIBEXPORT Widget XmGetDestination(Display *display);
1652
1653/*************************** Traversal.c *****************************/
1654
1655XMLIBEXPORT Boolean XmIsTraversable(Widget widget);
1656XMLIBEXPORT XmVisibility XmGetVisibility(Widget widget);
1657XMLIBEXPORT void XmAddTabGroup(Widget widget);
1658XMLIBEXPORT void XmRemoveTabGroup(Widget widget);
1659XMLIBEXPORT Widget XmGetTabGroup(Widget widget);
1660XMLIBEXPORT Boolean XmProcessTraversal(Widget widget, XmTraversalDirection direction);
1661XMLIBEXPORT Widget XmGetFocusWidget(Widget widget);
1662
1663/**************************** Direction.c *********************************/
1664
1665XMLIBEXPORT Boolean XmDirectionMatch(XmDirection dir1, XmDirection dir2);
1666XMLIBEXPORT Boolean XmDirectionMatchPartial(XmDirection dir1, XmDirection dir2, XmDirection dir_mask);
1667XMLIBEXPORT XmStringDirection XmDirectionToStringDirection(XmDirection dir);
1668XMLIBEXPORT XmDirection XmStringDirectionToDirection(XmStringDirection sdir);
1669
1670/******************************* Xme.c ************************************/
1671
1672XMLIBEXPORT void XmeConvertMerge(XtPointer data, Atom type,
1673                     int format, unsigned long length,
1674                     XmConvertCallbackStruct *call_data);
1675
1676#ifdef __cplusplus
1677}
1678#endif
1679
1680
1681#include <Xm/VendorS.h>
1682#include <Xm/XmIm.h>
1683
1684
1685#ifdef __cplusplus
1686extern "C" {
1687#endif
1688
1689/* The following is for backwards compability (bc) */
1690#define XmINDICATOR_3D_BOX 0x01
1691#define XmINDICATOR_FLAT_BOX 0x02
1692#define XmINDICATOR_CHECK_GLYPH 0x10
1693#define XmINDICATOR_CROSS_GLYPH 0x20
1694
1695enum {
1696    XmINDICATOR_NONE = 0,
1697    XmINDICATOR_FILL = XmINDICATOR_3D_BOX,
1698    XmINDICATOR_CHECK = XmINDICATOR_CHECK_GLYPH,
1699    XmINDICATOR_CHECK_BOX = XmINDICATOR_CHECK_GLYPH + XmINDICATOR_3D_BOX,
1700    XmINDICATOR_CROSS = XmINDICATOR_CROSS_GLYPH,
1701    XmINDICATOR_CROSS_BOX = XmINDICATOR_CROSS_GLYPH + XmINDICATOR_3D_BOX
1702};
1703
1704/* A slider can either be a slider or a thermometer */
1705enum { XmSLIDER, XmTHERMOMETER };
1706
1707#define XmTextSetTopPosition    XmTextSetTopCharacter
1708
1709enum {
1710	XmPOPUP_DISABLED = 0,
1711	XmPOPUP_KEYBOARD,
1712	XmPOPUP_AUTOMATIC,
1713	XmPOPUP_AUTOMATIC_RECURSIVE
1714};
1715
1716/* sliderVisual */
1717enum {
1718	XmBACKGROUND_COLOR,
1719	XmFOREGROUND_COLOR,
1720	XmTROUGH_COLOR,
1721	XmSHADOWED_BACKGROUND,
1722	XmFLAT_FOREGROUND
1723};
1724
1725/* showValue */
1726enum {
1727	XmNEAR_SLIDER = 1,
1728        XmNEAR_BORDER
1729};
1730
1731/* sliderMark */
1732enum {
1733	/* XmNONE */
1734	XmETCHED_LINE = 1,
1735	XmTHUMB_MARK,
1736	XmROUND_MARK
1737};
1738
1739/* showArrows */
1740enum {
1741	/* XmNONE */
1742	XmEACH_SIDE = 1,
1743	XmMAX_SIDE,
1744	XmMIN_SIDE
1745};
1746
1747/* XmString */
1748XmString XmStringGenerate(XtPointer   text, XmStringTag tag,
1749                          XmTextType  type, XmStringTag rendition);
1750
1751/* XmFileSelectionBox */
1752enum {
1753	XmPATH_MODE_FULL,
1754	XmPATH_MODE_RELATIVE
1755};
1756
1757enum {
1758	XmFILTER_NONE,
1759	XmFILTER_HIDDEN_FILES
1760};
1761
1762/* RowColumn */
1763#define XmInheritMenuTraversalProc ((XmMenuTraversalProc) _XtInherit)
1764
1765/* XmTabList */
1766XmTabList XmTabListCopy(XmTabList tablist,
1767                        int offset,
1768                        Cardinal count);
1769
1770void XmTabListFree(XmTabList tablist);
1771
1772XmTab XmTabListGetTab(XmTabList tablist,
1773                      Cardinal position);
1774
1775XmTabList XmTabListInsertTabs(XmTabList oldlist,
1776                              XmTab *tabs,
1777                              Cardinal tab_count,
1778                              int position);
1779
1780XmTabList XmTabListRemoveTabs(XmTabList oldlist,
1781                              Cardinal *position_list,
1782                              Cardinal position_count);
1783
1784XmTabList XmTabListReplacePositions(XmTabList oldlist,
1785                                    Cardinal *position_list,
1786                                    XmTab *tabs,
1787                                    Cardinal tab_count);
1788
1789Cardinal XmTabListTabCount(XmTabList tablist);
1790
1791void XmTabSetValue(XmTab tab,
1792                   float value);
1793
1794XmTab XmTabCreate(float value,
1795                  unsigned char units,
1796                  XmOffsetModel offset_model,
1797                  unsigned char alignment,
1798                  char *decimal);
1799
1800void XmTabFree(XmTab tab);
1801
1802float XmTabGetValues(XmTab tab,
1803                     unsigned char *units,
1804                     XmOffsetModel *offset,
1805                     unsigned char *alignment,
1806                     char **decimal);
1807
1808XmTabList XmStringTableProposeTablist(XmStringTable strings,
1809                                      Cardinal num_strings,
1810                                      Widget widget,
1811                                      float pad_value,
1812                                      XmOffsetModel offset_model);
1813
1814/*
1815 * XmPrint API
1816 */
1817enum {
1818        XmPDM_NOTIFY_FAIL,
1819        XmPDM_NOTIFY_SUCCESS
1820};
1821
1822void XmRedisplayWidget(Widget w);
1823
1824#ifdef __cplusplus
1825}
1826#endif
1827
1828#endif /* _XM_XM_H */
1829