1 // x11-rs: Rust bindings for X11 libraries
2 // The X11 libraries are available under the MIT license.
3 // These bindings are public domain.
4 
5 use std::os::raw::{
6   c_char,
7   c_int,
8   c_long,
9   c_short,
10   c_uchar,
11   c_uint,
12   c_ulong,
13   c_ushort,
14   c_void,
15 };
16 
17 use ::xlib::{
18   Display,
19   GC,
20   Region,
21   Screen,
22   Visual,
23   XEvent,
24   XGCValues,
25   _XrmHashBucketRec,
26   XrmOptionDescList,
27   XrmValue,
28   XSelectionRequestEvent,
29   XSetWindowAttributes,
30 };
31 
32 
33 //
34 // functions
35 //
36 
37 
38 x11_link! { Xt, xt, ["libXt.so.6", "libXt.so"], 300,
39   pub fn XtAddActions (_2: *mut XtActionsRec, _1: c_uint) -> (),
40   pub fn XtAddCallback (_4: Widget, _3: *const c_char, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut c_void)>, _1: *mut c_void) -> (),
41   pub fn XtAddCallbacks (_3: Widget, _2: *const c_char, _1: XtCallbackList) -> (),
42   pub fn XtAddConverter (_5: *const c_char, _4: *const c_char, _3: Option<unsafe extern "C" fn (*mut XrmValue, *mut c_uint, *mut XrmValue, *mut XrmValue)>, _2: XtConvertArgList, _1: c_uint) -> (),
43   pub fn XtAddEventHandler (_5: Widget, _4: c_ulong, _3: c_char, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _1: *mut c_void) -> (),
44   pub fn XtAddExposureToRegion (_2: *mut XEvent, _1: Region) -> (),
45   pub fn XtAddGrab (_3: Widget, _2: c_char, _1: c_char) -> (),
46   pub fn XtAddInput (_4: c_int, _3: *mut c_void, _2: Option<unsafe extern "C" fn (*mut c_void, *mut c_int, *mut c_ulong)>, _1: *mut c_void) -> c_ulong,
47   pub fn XtAddRawEventHandler (_5: Widget, _4: c_ulong, _3: c_char, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _1: *mut c_void) -> (),
48   pub fn XtAddSignal (_2: Option<unsafe extern "C" fn (*mut c_void, *mut c_ulong)>, _1: *mut c_void) -> c_ulong,
49   pub fn XtAddTimeOut (_3: c_ulong, _2: Option<unsafe extern "C" fn (*mut c_void, *mut c_ulong)>, _1: *mut c_void) -> c_ulong,
50   pub fn XtAddWorkProc (_2: Option<unsafe extern "C" fn (*mut c_void) -> c_char>, _1: *mut c_void) -> c_ulong,
51   pub fn XtAllocateGC (_6: Widget, _5: c_uint, _4: c_ulong, _3: *mut XGCValues, _2: c_ulong, _1: c_ulong) -> GC,
52   pub fn XtAppAddActionHook (_3: XtAppContext, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut c_char, *mut XEvent, *mut *mut c_char, *mut c_uint)>, _1: *mut c_void) -> *mut c_void,
53   pub fn XtAppAddActions (_3: XtAppContext, _2: *mut XtActionsRec, _1: c_uint) -> (),
54   pub fn XtAppAddBlockHook (_3: XtAppContext, _2: Option<unsafe extern "C" fn (*mut c_void)>, _1: *mut c_void) -> c_ulong,
55   pub fn XtAppAddConverter (_6: XtAppContext, _5: *const c_char, _4: *const c_char, _3: Option<unsafe extern "C" fn (*mut XrmValue, *mut c_uint, *mut XrmValue, *mut XrmValue)>, _2: XtConvertArgList, _1: c_uint) -> (),
56   pub fn XtAppAddInput (_5: XtAppContext, _4: c_int, _3: *mut c_void, _2: Option<unsafe extern "C" fn (*mut c_void, *mut c_int, *mut c_ulong)>, _1: *mut c_void) -> c_ulong,
57   pub fn XtAppAddSignal (_3: XtAppContext, _2: Option<unsafe extern "C" fn (*mut c_void, *mut c_ulong)>, _1: *mut c_void) -> c_ulong,
58   pub fn XtAppAddTimeOut (_4: XtAppContext, _3: c_ulong, _2: Option<unsafe extern "C" fn (*mut c_void, *mut c_ulong)>, _1: *mut c_void) -> c_ulong,
59   pub fn XtAppAddWorkProc (_3: XtAppContext, _2: Option<unsafe extern "C" fn (*mut c_void) -> c_char>, _1: *mut c_void) -> c_ulong,
60   pub fn XtAppCreateShell (_6: *const c_char, _5: *const c_char, _4: WidgetClass, _3: *mut Display, _2: *mut Arg, _1: c_uint) -> Widget,
61   pub fn XtAppError (_2: XtAppContext, _1: *const c_char) -> (),
62   pub fn XtAppErrorMsg (_7: XtAppContext, _6: *const c_char, _5: *const c_char, _4: *const c_char, _3: *const c_char, _2: *mut *mut c_char, _1: *mut c_uint) -> (),
63   pub fn XtAppGetErrorDatabase (_1: XtAppContext) -> *mut *mut _XrmHashBucketRec,
64   pub fn XtAppGetErrorDatabaseText (_8: XtAppContext, _7: *const c_char, _6: *const c_char, _5: *const c_char, _4: *const c_char, _3: *mut c_char, _2: c_int, _1: *mut _XrmHashBucketRec) -> (),
65   pub fn XtAppGetExitFlag (_1: XtAppContext) -> c_char,
66   pub fn XtAppGetSelectionTimeout (_1: XtAppContext) -> c_ulong,
67   pub fn XtAppInitialize (_9: *mut XtAppContext, _8: *const c_char, _7: XrmOptionDescList, _6: c_uint, _5: *mut c_int, _4: *mut *mut c_char, _3: *mut *mut c_char, _2: *mut Arg, _1: c_uint) -> Widget,
68   pub fn XtAppLock (_1: XtAppContext) -> (),
69   pub fn XtAppMainLoop (_1: XtAppContext) -> (),
70   pub fn XtAppNextEvent (_2: XtAppContext, _1: *mut XEvent) -> (),
71   pub fn XtAppPeekEvent (_2: XtAppContext, _1: *mut XEvent) -> c_char,
72   pub fn XtAppPending (_1: XtAppContext) -> c_ulong,
73   pub fn XtAppProcessEvent (_2: XtAppContext, _1: c_ulong) -> (),
74   pub fn XtAppReleaseCacheRefs (_2: XtAppContext, _1: *mut *mut c_void) -> (),
75   pub fn XtAppSetErrorHandler (_2: XtAppContext, _1: Option<unsafe extern "C" fn (*mut c_char)>) -> Option<unsafe extern "C" fn (*mut c_char)>,
76   pub fn XtAppSetErrorMsgHandler (_2: XtAppContext, _1: Option<unsafe extern "C" fn (*mut c_char, *mut c_char, *mut c_char, *mut c_char, *mut *mut c_char, *mut c_uint)>) -> Option<unsafe extern "C" fn (*mut c_char, *mut c_char, *mut c_char, *mut c_char, *mut *mut c_char, *mut c_uint)>,
77   pub fn XtAppSetExitFlag (_1: XtAppContext) -> (),
78   pub fn XtAppSetFallbackResources (_2: XtAppContext, _1: *mut *mut c_char) -> (),
79   pub fn XtAppSetSelectionTimeout (_2: XtAppContext, _1: c_ulong) -> (),
80   pub fn XtAppSetTypeConverter (_8: XtAppContext, _7: *const c_char, _6: *const c_char, _5: Option<unsafe extern "C" fn (*mut Display, *mut XrmValue, *mut c_uint, *mut XrmValue, *mut XrmValue, *mut *mut c_void) -> c_char>, _4: XtConvertArgList, _3: c_uint, _2: c_int, _1: Option<unsafe extern "C" fn (XtAppContext, *mut XrmValue, *mut c_void, *mut XrmValue, *mut c_uint)>) -> (),
81   pub fn XtAppSetWarningHandler (_2: XtAppContext, _1: Option<unsafe extern "C" fn (*mut c_char)>) -> Option<unsafe extern "C" fn (*mut c_char)>,
82   pub fn XtAppSetWarningMsgHandler (_2: XtAppContext, _1: Option<unsafe extern "C" fn (*mut c_char, *mut c_char, *mut c_char, *mut c_char, *mut *mut c_char, *mut c_uint)>) -> Option<unsafe extern "C" fn (*mut c_char, *mut c_char, *mut c_char, *mut c_char, *mut *mut c_char, *mut c_uint)>,
83   pub fn XtAppUnlock (_1: XtAppContext) -> (),
84   pub fn XtAppWarning (_2: XtAppContext, _1: *const c_char) -> (),
85   pub fn XtAppWarningMsg (_7: XtAppContext, _6: *const c_char, _5: *const c_char, _4: *const c_char, _3: *const c_char, _2: *mut *mut c_char, _1: *mut c_uint) -> (),
86   pub fn XtAugmentTranslations (_2: Widget, _1: *mut _TranslationData) -> (),
87   pub fn XtBuildEventMask (_1: Widget) -> c_ulong,
88   pub fn XtCallAcceptFocus (_2: Widget, _1: *mut c_ulong) -> c_char,
89   pub fn XtCallActionProc (_5: Widget, _4: *const c_char, _3: *mut XEvent, _2: *mut *mut c_char, _1: c_uint) -> (),
90   pub fn XtCallbackExclusive (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
91   pub fn XtCallbackNone (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
92   pub fn XtCallbackNonexclusive (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
93   pub fn XtCallbackPopdown (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
94   pub fn XtCallbackReleaseCacheRef (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
95   pub fn XtCallbackReleaseCacheRefList (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
96   pub fn XtCallCallbackList (_3: Widget, _2: XtCallbackList, _1: *mut c_void) -> (),
97   pub fn XtCallCallbacks (_3: Widget, _2: *const c_char, _1: *mut c_void) -> (),
98   pub fn XtCallConverter (_7: *mut Display, _6: Option<unsafe extern "C" fn (*mut Display, *mut XrmValue, *mut c_uint, *mut XrmValue, *mut XrmValue, *mut *mut c_void) -> c_char>, _5: *mut XrmValue, _4: c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
99   pub fn XtCalloc (_2: c_uint, _1: c_uint) -> *mut c_char,
100   pub fn XtCancelSelectionRequest (_2: Widget, _1: c_ulong) -> (),
101   pub fn XtChangeManagedSet (_6: *mut Widget, _5: c_uint, _4: Option<unsafe extern "C" fn (Widget, *mut Widget, *mut c_uint, *mut Widget, *mut c_uint, *mut c_void)>, _3: *mut c_void, _2: *mut Widget, _1: c_uint) -> (),
102   pub fn XtClass (_1: Widget) -> WidgetClass,
103   pub fn XtCloseDisplay (_1: *mut Display) -> (),
104   pub fn XtConfigureWidget (_6: Widget, _5: c_short, _4: c_short, _3: c_ushort, _2: c_ushort, _1: c_ushort) -> (),
105   pub fn XtConvert (_5: Widget, _4: *const c_char, _3: *mut XrmValue, _2: *const c_char, _1: *mut XrmValue) -> (),
106   pub fn XtConvertAndStore (_5: Widget, _4: *const c_char, _3: *mut XrmValue, _2: *const c_char, _1: *mut XrmValue) -> c_char,
107   pub fn XtConvertCase (_4: *mut Display, _3: c_ulong, _2: *mut c_ulong, _1: *mut c_ulong) -> (),
108   pub fn XtCreateApplicationContext () -> XtAppContext,
109   pub fn XtCreateApplicationShell (_4: *const c_char, _3: WidgetClass, _2: *mut Arg, _1: c_uint) -> Widget,
110   pub fn XtCreateManagedWidget (_5: *const c_char, _4: WidgetClass, _3: Widget, _2: *mut Arg, _1: c_uint) -> Widget,
111   pub fn XtCreatePopupShell (_5: *const c_char, _4: WidgetClass, _3: Widget, _2: *mut Arg, _1: c_uint) -> Widget,
112   pub fn XtCreateSelectionRequest (_2: Widget, _1: c_ulong) -> (),
113   pub fn XtCreateWidget (_5: *const c_char, _4: WidgetClass, _3: Widget, _2: *mut Arg, _1: c_uint) -> Widget,
114   pub fn XtCreateWindow (_5: Widget, _4: c_uint, _3: *mut Visual, _2: c_ulong, _1: *mut XSetWindowAttributes) -> (),
115   pub fn XtCvtColorToPixel (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
116   pub fn XtCvtIntToBool (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
117   pub fn XtCvtIntToBoolean (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
118   pub fn XtCvtIntToColor (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
119   pub fn XtCvtIntToFloat (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
120   pub fn XtCvtIntToFont (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
121   pub fn XtCvtIntToPixel (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
122   pub fn XtCvtIntToPixmap (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
123   pub fn XtCvtIntToShort (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
124   pub fn XtCvtIntToUnsignedChar (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
125   pub fn XtCvtStringToAcceleratorTable (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
126   pub fn XtCvtStringToAtom (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
127   pub fn XtCvtStringToBool (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
128   pub fn XtCvtStringToBoolean (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
129   pub fn XtCvtStringToCommandArgArray (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
130   pub fn XtCvtStringToCursor (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
131   pub fn XtCvtStringToDimension (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
132   pub fn XtCvtStringToDirectoryString (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
133   pub fn XtCvtStringToDisplay (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
134   pub fn XtCvtStringToFile (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
135   pub fn XtCvtStringToFloat (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
136   pub fn XtCvtStringToFont (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
137   pub fn XtCvtStringToFontSet (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
138   pub fn XtCvtStringToFontStruct (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
139   pub fn XtCvtStringToGravity (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
140   pub fn XtCvtStringToInitialState (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
141   pub fn XtCvtStringToInt (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
142   pub fn XtCvtStringToPixel (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
143   pub fn XtCvtStringToRestartStyle (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
144   pub fn XtCvtStringToShort (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
145   pub fn XtCvtStringToTranslationTable (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
146   pub fn XtCvtStringToUnsignedChar (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
147   pub fn XtCvtStringToVisual (_6: *mut Display, _5: *mut XrmValue, _4: *mut c_uint, _3: *mut XrmValue, _2: *mut XrmValue, _1: *mut *mut c_void) -> c_char,
148   pub fn XtDatabase (_1: *mut Display) -> *mut _XrmHashBucketRec,
149   pub fn XtDestroyApplicationContext (_1: XtAppContext) -> (),
150   pub fn XtDestroyGC (_1: GC) -> (),
151   pub fn XtDestroyWidget (_1: Widget) -> (),
152   pub fn XtDirectConvert (_5: Option<unsafe extern "C" fn (*mut XrmValue, *mut c_uint, *mut XrmValue, *mut XrmValue)>, _4: *mut XrmValue, _3: c_uint, _2: *mut XrmValue, _1: *mut XrmValue) -> (),
153   pub fn XtDisownSelection (_3: Widget, _2: c_ulong, _1: c_ulong) -> (),
154   pub fn XtDispatchEvent (_1: *mut XEvent) -> c_char,
155   pub fn XtDispatchEventToWidget (_2: Widget, _1: *mut XEvent) -> c_char,
156   pub fn XtDisplay (_1: Widget) -> *mut Display,
157   pub fn XtDisplayInitialize (_8: XtAppContext, _7: *mut Display, _6: *const c_char, _5: *const c_char, _4: XrmOptionDescList, _3: c_uint, _2: *mut c_int, _1: *mut *mut c_char) -> (),
158   pub fn XtDisplayOfObject (_1: Widget) -> *mut Display,
159   pub fn XtDisplayStringConversionWarning (_3: *mut Display, _2: *const c_char, _1: *const c_char) -> (),
160   pub fn XtDisplayToApplicationContext (_1: *mut Display) -> XtAppContext,
161   pub fn XtError (_1: *const c_char) -> (),
162   pub fn XtErrorMsg (_6: *const c_char, _5: *const c_char, _4: *const c_char, _3: *const c_char, _2: *mut *mut c_char, _1: *mut c_uint) -> (),
163   pub fn XtFindFile (_4: *const c_char, _3: Substitution, _2: c_uint, _1: Option<unsafe extern "C" fn (*mut c_char) -> c_char>) -> *mut c_char,
164   pub fn XtFree (_1: *mut c_char) -> (),
165   pub fn XtGetActionKeysym (_2: *mut XEvent, _1: *mut c_uint) -> c_ulong,
166   pub fn XtGetActionList (_3: WidgetClass, _2: *mut *mut XtActionsRec, _1: *mut c_uint) -> (),
167   pub fn XtGetApplicationNameAndClass (_3: *mut Display, _2: *mut *mut c_char, _1: *mut *mut c_char) -> (),
168   pub fn XtGetApplicationResources (_6: Widget, _5: *mut c_void, _4: *mut XtResource, _3: c_uint, _2: *mut Arg, _1: c_uint) -> (),
169   pub fn XtGetClassExtension (_5: WidgetClass, _4: c_uint, _3: c_int, _2: c_long, _1: c_uint) -> *mut c_void,
170   pub fn XtGetConstraintResourceList (_3: WidgetClass, _2: *mut *mut XtResource, _1: *mut c_uint) -> (),
171   pub fn XtGetDisplays (_3: XtAppContext, _2: *mut *mut *mut Display, _1: *mut c_uint) -> (),
172   pub fn XtGetErrorDatabase () -> *mut *mut _XrmHashBucketRec,
173   pub fn XtGetErrorDatabaseText (_6: *const c_char, _5: *const c_char, _4: *const c_char, _3: *const c_char, _2: *mut c_char, _1: c_int) -> (),
174   pub fn XtGetGC (_3: Widget, _2: c_ulong, _1: *mut XGCValues) -> GC,
175   pub fn XtGetKeyboardFocusWidget (_1: Widget) -> Widget,
176   pub fn XtGetKeysymTable (_3: *mut Display, _2: *mut c_uchar, _1: *mut c_int) -> *mut c_ulong,
177   pub fn XtGetMultiClickTime (_1: *mut Display) -> c_int,
178   pub fn XtGetResourceList (_3: WidgetClass, _2: *mut *mut XtResource, _1: *mut c_uint) -> (),
179   pub fn XtGetSelectionParameters (_7: Widget, _6: c_ulong, _5: *mut c_void, _4: *mut c_ulong, _3: *mut *mut c_void, _2: *mut c_ulong, _1: *mut c_int) -> (),
180   pub fn XtGetSelectionRequest (_3: Widget, _2: c_ulong, _1: *mut c_void) -> *mut XSelectionRequestEvent,
181   pub fn XtGetSelectionTimeout () -> c_ulong,
182   pub fn XtGetSelectionValue (_6: Widget, _5: c_ulong, _4: c_ulong, _3: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut c_ulong, *mut c_ulong, *mut c_void, *mut c_ulong, *mut c_int)>, _2: *mut c_void, _1: c_ulong) -> (),
183   pub fn XtGetSelectionValueIncremental (_6: Widget, _5: c_ulong, _4: c_ulong, _3: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut c_ulong, *mut c_ulong, *mut c_void, *mut c_ulong, *mut c_int)>, _2: *mut c_void, _1: c_ulong) -> (),
184   pub fn XtGetSelectionValues (_7: Widget, _6: c_ulong, _5: *mut c_ulong, _4: c_int, _3: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut c_ulong, *mut c_ulong, *mut c_void, *mut c_ulong, *mut c_int)>, _2: *mut *mut c_void, _1: c_ulong) -> (),
185   pub fn XtGetSelectionValuesIncremental (_7: Widget, _6: c_ulong, _5: *mut c_ulong, _4: c_int, _3: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut c_ulong, *mut c_ulong, *mut c_void, *mut c_ulong, *mut c_int)>, _2: *mut *mut c_void, _1: c_ulong) -> (),
186   pub fn XtGetSubresources (_8: Widget, _7: *mut c_void, _6: *const c_char, _5: *const c_char, _4: *mut XtResource, _3: c_uint, _2: *mut Arg, _1: c_uint) -> (),
187   pub fn XtGetSubvalues (_5: *mut c_void, _4: *mut XtResource, _3: c_uint, _2: *mut Arg, _1: c_uint) -> (),
188   pub fn XtGetValues (_3: Widget, _2: *mut Arg, _1: c_uint) -> (),
189   pub fn XtGrabButton (_9: Widget, _8: c_int, _7: c_uint, _6: c_char, _5: c_uint, _4: c_int, _3: c_int, _2: c_ulong, _1: c_ulong) -> (),
190   pub fn XtGrabKey (_6: Widget, _5: c_uchar, _4: c_uint, _3: c_char, _2: c_int, _1: c_int) -> (),
191   pub fn XtGrabKeyboard (_5: Widget, _4: c_char, _3: c_int, _2: c_int, _1: c_ulong) -> c_int,
192   pub fn XtGrabPointer (_8: Widget, _7: c_char, _6: c_uint, _5: c_int, _4: c_int, _3: c_ulong, _2: c_ulong, _1: c_ulong) -> c_int,
193   pub fn XtHasCallbacks (_2: Widget, _1: *const c_char) -> XtCallbackStatus,
194   pub fn XtHooksOfDisplay (_1: *mut Display) -> Widget,
195   pub fn XtInitialize (_6: *const c_char, _5: *const c_char, _4: XrmOptionDescList, _3: c_uint, _2: *mut c_int, _1: *mut *mut c_char) -> Widget,
196   pub fn XtInitializeWidgetClass (_1: WidgetClass) -> (),
197   pub fn XtInsertEventHandler (_6: Widget, _5: c_ulong, _4: c_char, _3: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _2: *mut c_void, _1: XtListPosition) -> (),
198   pub fn XtInsertEventTypeHandler (_6: Widget, _5: c_int, _4: *mut c_void, _3: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _2: *mut c_void, _1: XtListPosition) -> (),
199   pub fn XtInsertRawEventHandler (_6: Widget, _5: c_ulong, _4: c_char, _3: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _2: *mut c_void, _1: XtListPosition) -> (),
200   pub fn XtInstallAccelerators (_2: Widget, _1: Widget) -> (),
201   pub fn XtInstallAllAccelerators (_2: Widget, _1: Widget) -> (),
202   pub fn XtIsApplicationShell (_1: Widget) -> c_char,
203   pub fn XtIsComposite (_1: Widget) -> c_char,
204   pub fn XtIsConstraint (_1: Widget) -> c_char,
205   pub fn XtIsManaged (_1: Widget) -> c_char,
206   pub fn XtIsObject (_1: Widget) -> c_char,
207   pub fn XtIsOverrideShell (_1: Widget) -> c_char,
208   pub fn XtIsRealized (_1: Widget) -> c_char,
209   pub fn XtIsRectObj (_1: Widget) -> c_char,
210   pub fn XtIsSensitive (_1: Widget) -> c_char,
211   pub fn XtIsSessionShell (_1: Widget) -> c_char,
212   pub fn XtIsShell (_1: Widget) -> c_char,
213   pub fn XtIsSubclass (_2: Widget, _1: WidgetClass) -> c_char,
214   pub fn XtIsTopLevelShell (_1: Widget) -> c_char,
215   pub fn XtIsTransientShell (_1: Widget) -> c_char,
216   pub fn XtIsVendorShell (_1: Widget) -> c_char,
217   pub fn XtIsWidget (_1: Widget) -> c_char,
218   pub fn XtIsWMShell (_1: Widget) -> c_char,
219   pub fn XtKeysymToKeycodeList (_4: *mut Display, _3: c_ulong, _2: *mut *mut c_uchar, _1: *mut c_uint) -> (),
220   pub fn XtLastEventProcessed (_1: *mut Display) -> *mut XEvent,
221   pub fn XtLastTimestampProcessed (_1: *mut Display) -> c_ulong,
222   pub fn XtMainLoop () -> (),
223   pub fn XtMakeGeometryRequest (_3: Widget, _2: *mut XtWidgetGeometry, _1: *mut XtWidgetGeometry) -> XtGeometryResult,
224   pub fn XtMakeResizeRequest (_5: Widget, _4: c_ushort, _3: c_ushort, _2: *mut c_ushort, _1: *mut c_ushort) -> XtGeometryResult,
225   pub fn XtMalloc (_1: c_uint) -> *mut c_char,
226   pub fn XtManageChild (_1: Widget) -> (),
227   pub fn XtManageChildren (_2: *mut Widget, _1: c_uint) -> (),
228   pub fn XtMapWidget (_1: Widget) -> (),
229   pub fn XtMenuPopupAction (_4: Widget, _3: *mut XEvent, _2: *mut *mut c_char, _1: *mut c_uint) -> (),
230   pub fn XtMergeArgLists (_4: *mut Arg, _3: c_uint, _2: *mut Arg, _1: c_uint) -> *mut Arg,
231   pub fn XtMoveWidget (_3: Widget, _2: c_short, _1: c_short) -> (),
232   pub fn XtName (_1: Widget) -> *mut c_char,
233   pub fn XtNameToWidget (_2: Widget, _1: *const c_char) -> Widget,
234   pub fn XtNewString (_1: *mut c_char) -> *mut c_char,
235   pub fn XtNextEvent (_1: *mut XEvent) -> (),
236   pub fn XtNoticeSignal (_1: c_ulong) -> (),
237   pub fn XtOpenApplication (_10: *mut XtAppContext, _9: *const c_char, _8: XrmOptionDescList, _7: c_uint, _6: *mut c_int, _5: *mut *mut c_char, _4: *mut *mut c_char, _3: WidgetClass, _2: *mut Arg, _1: c_uint) -> Widget,
238   pub fn XtOpenDisplay (_8: XtAppContext, _7: *const c_char, _6: *const c_char, _5: *const c_char, _4: XrmOptionDescList, _3: c_uint, _2: *mut c_int, _1: *mut *mut c_char) -> *mut Display,
239   pub fn XtOverrideTranslations (_2: Widget, _1: *mut _TranslationData) -> (),
240   pub fn XtOwnSelection (_6: Widget, _5: c_ulong, _4: c_ulong, _3: Option<unsafe extern "C" fn (Widget, *mut c_ulong, *mut c_ulong, *mut c_ulong, *mut *mut c_void, *mut c_ulong, *mut c_int) -> c_char>, _2: Option<unsafe extern "C" fn (Widget, *mut c_ulong)>, _1: Option<unsafe extern "C" fn (Widget, *mut c_ulong, *mut c_ulong)>) -> c_char,
241   pub fn XtOwnSelectionIncremental (_8: Widget, _7: c_ulong, _6: c_ulong, _5: Option<unsafe extern "C" fn (Widget, *mut c_ulong, *mut c_ulong, *mut c_ulong, *mut *mut c_void, *mut c_ulong, *mut c_int, *mut c_ulong, *mut c_void, *mut *mut c_void) -> c_char>, _4: Option<unsafe extern "C" fn (Widget, *mut c_ulong, *mut c_void)>, _3: Option<unsafe extern "C" fn (Widget, *mut c_ulong, *mut c_ulong, *mut *mut c_void, *mut c_void)>, _2: Option<unsafe extern "C" fn (Widget, *mut c_ulong, *mut c_ulong, *mut *mut c_void, *mut c_void)>, _1: *mut c_void) -> c_char,
242   pub fn XtParent (_1: Widget) -> Widget,
243   pub fn XtParseAcceleratorTable (_1: *const c_char) -> *mut _TranslationData,
244   pub fn XtParseTranslationTable (_1: *const c_char) -> *mut _TranslationData,
245   pub fn XtPeekEvent (_1: *mut XEvent) -> c_char,
246   pub fn XtPending () -> c_char,
247   pub fn XtPopdown (_1: Widget) -> (),
248   pub fn XtPopup (_2: Widget, _1: XtGrabKind) -> (),
249   pub fn XtPopupSpringLoaded (_1: Widget) -> (),
250   pub fn XtProcessEvent (_1: c_ulong) -> (),
251   pub fn XtProcessLock () -> (),
252   pub fn XtProcessUnlock () -> (),
253   pub fn XtQueryGeometry (_3: Widget, _2: *mut XtWidgetGeometry, _1: *mut XtWidgetGeometry) -> XtGeometryResult,
254   pub fn XtRealizeWidget (_1: Widget) -> (),
255   pub fn XtRealloc (_2: *mut c_char, _1: c_uint) -> *mut c_char,
256   pub fn XtRegisterCaseConverter (_4: *mut Display, _3: Option<unsafe extern "C" fn (*mut Display, c_ulong, *mut c_ulong, *mut c_ulong)>, _2: c_ulong, _1: c_ulong) -> (),
257   pub fn XtRegisterDrawable (_3: *mut Display, _2: c_ulong, _1: Widget) -> (),
258   pub fn XtRegisterExtensionSelector (_5: *mut Display, _4: c_int, _3: c_int, _2: Option<unsafe extern "C" fn (Widget, *mut c_int, *mut *mut c_void, c_int, *mut c_void)>, _1: *mut c_void) -> (),
259   pub fn XtRegisterGrabAction (_5: Option<unsafe extern "C" fn (Widget, *mut XEvent, *mut *mut c_char, *mut c_uint)>, _4: c_char, _3: c_uint, _2: c_int, _1: c_int) -> (),
260   pub fn XtReleaseGC (_2: Widget, _1: GC) -> (),
261   pub fn XtReleasePropertyAtom (_2: Widget, _1: c_ulong) -> (),
262   pub fn XtRemoveActionHook (_1: *mut c_void) -> (),
263   pub fn XtRemoveAllCallbacks (_2: Widget, _1: *const c_char) -> (),
264   pub fn XtRemoveBlockHook (_1: c_ulong) -> (),
265   pub fn XtRemoveCallback (_4: Widget, _3: *const c_char, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut c_void)>, _1: *mut c_void) -> (),
266   pub fn XtRemoveCallbacks (_3: Widget, _2: *const c_char, _1: XtCallbackList) -> (),
267   pub fn XtRemoveEventHandler (_5: Widget, _4: c_ulong, _3: c_char, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _1: *mut c_void) -> (),
268   pub fn XtRemoveEventTypeHandler (_5: Widget, _4: c_int, _3: *mut c_void, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _1: *mut c_void) -> (),
269   pub fn XtRemoveGrab (_1: Widget) -> (),
270   pub fn XtRemoveInput (_1: c_ulong) -> (),
271   pub fn XtRemoveRawEventHandler (_5: Widget, _4: c_ulong, _3: c_char, _2: Option<unsafe extern "C" fn (Widget, *mut c_void, *mut XEvent, *mut c_char)>, _1: *mut c_void) -> (),
272   pub fn XtRemoveSignal (_1: c_ulong) -> (),
273   pub fn XtRemoveTimeOut (_1: c_ulong) -> (),
274   pub fn XtRemoveWorkProc (_1: c_ulong) -> (),
275   pub fn XtReservePropertyAtom (_1: Widget) -> c_ulong,
276   pub fn XtResizeWidget (_4: Widget, _3: c_ushort, _2: c_ushort, _1: c_ushort) -> (),
277   pub fn XtResizeWindow (_1: Widget) -> (),
278   pub fn XtResolvePathname (_8: *mut Display, _7: *const c_char, _6: *const c_char, _5: *const c_char, _4: *const c_char, _3: Substitution, _2: c_uint, _1: Option<unsafe extern "C" fn (*mut c_char) -> c_char>) -> *mut c_char,
279   pub fn XtScreen (_1: Widget) -> *mut Screen,
280   pub fn XtScreenDatabase (_1: *mut Screen) -> *mut _XrmHashBucketRec,
281   pub fn XtScreenOfObject (_1: Widget) -> *mut Screen,
282   pub fn XtSendSelectionRequest (_3: Widget, _2: c_ulong, _1: c_ulong) -> (),
283   pub fn XtSessionGetToken (_1: Widget) -> XtCheckpointToken,
284   pub fn XtSessionReturnToken (_1: XtCheckpointToken) -> (),
285   pub fn XtSetErrorHandler (_1: Option<unsafe extern "C" fn (*mut c_char)>) -> (),
286   pub fn XtSetErrorMsgHandler (_1: Option<unsafe extern "C" fn (*mut c_char, *mut c_char, *mut c_char, *mut c_char, *mut *mut c_char, *mut c_uint)>) -> (),
287   pub fn XtSetEventDispatcher (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut XEvent) -> c_char>) -> Option<unsafe extern "C" fn (*mut XEvent) -> c_char>,
288   pub fn XtSetKeyboardFocus (_2: Widget, _1: Widget) -> (),
289   pub fn XtSetKeyTranslator (_2: *mut Display, _1: Option<unsafe extern "C" fn (*mut Display, c_uchar, c_uint, *mut c_uint, *mut c_ulong)>) -> (),
290   pub fn XtSetLanguageProc (_3: XtAppContext, _2: Option<unsafe extern "C" fn (*mut Display, *mut c_char, *mut c_void) -> *mut c_char>, _1: *mut c_void) -> Option<unsafe extern "C" fn (*mut Display, *mut c_char, *mut c_void) -> *mut c_char>,
291   pub fn XtSetMappedWhenManaged (_2: Widget, _1: c_char) -> (),
292   pub fn XtSetMultiClickTime (_2: *mut Display, _1: c_int) -> (),
293   pub fn XtSetSelectionParameters (_6: Widget, _5: c_ulong, _4: c_ulong, _3: *mut c_void, _2: c_ulong, _1: c_int) -> (),
294   pub fn XtSetSelectionTimeout (_1: c_ulong) -> (),
295   pub fn XtSetSensitive (_2: Widget, _1: c_char) -> (),
296   pub fn XtSetSubvalues (_5: *mut c_void, _4: *mut XtResource, _3: c_uint, _2: *mut Arg, _1: c_uint) -> (),
297   pub fn XtSetTypeConverter (_7: *const c_char, _6: *const c_char, _5: Option<unsafe extern "C" fn (*mut Display, *mut XrmValue, *mut c_uint, *mut XrmValue, *mut XrmValue, *mut *mut c_void) -> c_char>, _4: XtConvertArgList, _3: c_uint, _2: c_int, _1: Option<unsafe extern "C" fn (XtAppContext, *mut XrmValue, *mut c_void, *mut XrmValue, *mut c_uint)>) -> (),
298   pub fn XtSetValues (_3: Widget, _2: *mut Arg, _1: c_uint) -> (),
299   pub fn XtSetWarningHandler (_1: Option<unsafe extern "C" fn (*mut c_char)>) -> (),
300   pub fn XtSetWarningMsgHandler (_1: Option<unsafe extern "C" fn (*mut c_char, *mut c_char, *mut c_char, *mut c_char, *mut *mut c_char, *mut c_uint)>) -> (),
301   pub fn XtSetWMColormapWindows (_3: Widget, _2: *mut Widget, _1: c_uint) -> (),
302   pub fn XtStringConversionWarning (_2: *const c_char, _1: *const c_char) -> (),
303   pub fn XtSuperclass (_1: Widget) -> WidgetClass,
304   pub fn XtToolkitInitialize () -> (),
305   pub fn XtToolkitThreadInitialize () -> c_char,
306   pub fn XtTranslateCoords (_5: Widget, _4: c_short, _3: c_short, _2: *mut c_short, _1: *mut c_short) -> (),
307   pub fn XtTranslateKey (_5: *mut Display, _4: c_uchar, _3: c_uint, _2: *mut c_uint, _1: *mut c_ulong) -> (),
308   pub fn XtTranslateKeycode (_5: *mut Display, _4: c_uchar, _3: c_uint, _2: *mut c_uint, _1: *mut c_ulong) -> (),
309   pub fn XtUngrabButton (_3: Widget, _2: c_uint, _1: c_uint) -> (),
310   pub fn XtUngrabKey (_3: Widget, _2: c_uchar, _1: c_uint) -> (),
311   pub fn XtUngrabKeyboard (_2: Widget, _1: c_ulong) -> (),
312   pub fn XtUngrabPointer (_2: Widget, _1: c_ulong) -> (),
313   pub fn XtUninstallTranslations (_1: Widget) -> (),
314   pub fn XtUnmanageChild (_1: Widget) -> (),
315   pub fn XtUnmanageChildren (_2: *mut Widget, _1: c_uint) -> (),
316   pub fn XtUnmapWidget (_1: Widget) -> (),
317   pub fn XtUnrealizeWidget (_1: Widget) -> (),
318   pub fn XtUnregisterDrawable (_2: *mut Display, _1: c_ulong) -> (),
319   pub fn XtWarning (_1: *const c_char) -> (),
320   pub fn XtWarningMsg (_6: *const c_char, _5: *const c_char, _4: *const c_char, _3: *const c_char, _2: *mut *mut c_char, _1: *mut c_uint) -> (),
321   pub fn XtWidgetToApplicationContext (_1: Widget) -> XtAppContext,
322   pub fn XtWindow (_1: Widget) -> c_ulong,
323   pub fn XtWindowOfObject (_1: Widget) -> c_ulong,
324   pub fn XtWindowToWidget (_2: *mut Display, _1: c_ulong) -> Widget,
325 variadic:
326   pub fn XtAsprintf (_2: *mut *mut c_char, _1: *const c_char) -> c_uint,
327   pub fn XtVaAppCreateShell (_4: *const c_char, _3: *const c_char, _2: WidgetClass, _1: *mut Display) -> Widget,
328   pub fn XtVaAppInitialize (_7: *mut XtAppContext, _6: *const c_char, _5: XrmOptionDescList, _4: c_uint, _3: *mut c_int, _2: *mut *mut c_char, _1: *mut *mut c_char) -> Widget,
329   pub fn XtVaCreateArgsList (_1: *mut c_void) -> *mut c_void,
330   pub fn XtVaCreateManagedWidget (_3: *const c_char, _2: WidgetClass, _1: Widget) -> Widget,
331   pub fn XtVaCreatePopupShell (_3: *const c_char, _2: WidgetClass, _1: Widget) -> Widget,
332   pub fn XtVaCreateWidget (_3: *const c_char, _2: WidgetClass, _1: Widget) -> Widget,
333   pub fn XtVaGetApplicationResources (_4: Widget, _3: *mut c_void, _2: *mut XtResource, _1: c_uint) -> (),
334   pub fn XtVaGetSubresources (_6: Widget, _5: *mut c_void, _4: *const c_char, _3: *const c_char, _2: *mut XtResource, _1: c_uint) -> (),
335   pub fn XtVaGetSubvalues (_3: *mut c_void, _2: *mut XtResource, _1: c_uint) -> (),
336   pub fn XtVaGetValues (_1: Widget) -> (),
337   pub fn XtVaOpenApplication (_8: *mut XtAppContext, _7: *const c_char, _6: XrmOptionDescList, _5: c_uint, _4: *mut c_int, _3: *mut *mut c_char, _2: *mut *mut c_char, _1: WidgetClass) -> Widget,
338   pub fn XtVaSetSubvalues (_3: *mut c_void, _2: *mut XtResource, _1: c_uint) -> (),
339   pub fn XtVaSetValues (_1: Widget) -> (),
340 globals:
341 }
342 
343 
344 //
345 // types
346 //
347 
348 
349 // TODO structs
350 #[repr(C)] pub struct Arg;
351 #[repr(C)] pub struct SubstitutionRec;
352 #[repr(C)] pub struct _TranslationData;
353 #[repr(C)] pub struct _WidgetClassRec;
354 #[repr(C)] pub struct _WidgetRec;
355 #[repr(C)] pub struct _XtActionsRec;
356 #[repr(C)] pub struct _XtAppStruct;
357 #[repr(C)] pub struct _XtCallbackRec;
358 #[repr(C)] pub struct _XtCheckpointTokenRec;
359 #[repr(C)] pub struct XtConvertArgRec;
360 #[repr(C)] pub struct _XtResource;
361 #[repr(C)] pub struct XtWidgetGeometry;
362 
363 // C enums
364 pub type XtCallbackStatus = c_int;
365 pub type XtGeometryResult = c_int;
366 pub type XtGrabKind = c_int;
367 pub type XtListPosition = c_int;
368 
369 #[allow(dead_code)]
370 #[cfg(test)]
371 #[repr(C)]
372 enum TestEnum {
373   Variant1,
374   Variant2,
375 }
376 
377 #[test]
enum_size_test()378 fn enum_size_test () {
379   assert!(::std::mem::size_of::<TestEnum>() == ::std::mem::size_of::<c_int>());
380 }
381 
382 // struct typedefs
383 pub type ArgList = *mut Arg;
384 pub type Substitution = *mut SubstitutionRec;
385 pub type Widget = *mut _WidgetRec;
386 pub type WidgetClass = *mut _WidgetClassRec;
387 pub type XtAccelerators = *mut _TranslationData;
388 pub type XtActionList = *mut _XtActionsRec;
389 pub type XtActionsRec = _XtActionsRec;
390 pub type XtAppContext = *mut _XtAppStruct;
391 pub type XtCallbackList = *mut _XtCallbackRec;
392 pub type XtCallbackRec = _XtCallbackRec;
393 pub type XtCheckpointToken = *mut _XtCheckpointTokenRec;
394 pub type XtCheckpointTokenRec = _XtCheckpointTokenRec;
395 pub type XtConvertArgList = *mut XtConvertArgRec;
396 pub type XtResource = _XtResource;
397 pub type XtResourceList = *mut _XtResource;
398 pub type XtTranslations = *mut _TranslationData;
399