2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
9 #include <aros/config.h>
10 #include <proto/hostlib.h>
17 // Set to 1 if you want to disable the asynchronic nature of the X11 HIDD.
18 // This makes it easier to find the real reason of a misbehavior.
19 #define DEBUG_X11_SYNCHRON 0
22 XImage
* (*XCreateImage
) ( Display
* , Visual
* , unsigned int , int , int , char* , unsigned int , unsigned int , int , int );
23 int (*XInitImage
) ( XImage
* );
24 XImage
* (*XGetImage
) ( Display
* , Drawable
, int , int , unsigned int , unsigned int , unsigned long , int );
25 Display
* (*XOpenDisplay
) ( const char* );
26 char * (*XDisplayName
) ( const char* );
27 Atom (*XInternAtom
) ( Display
* , const char* , int );
28 Colormap (*XCreateColormap
) ( Display
* , Window
, Visual
* , int );
29 Cursor (*XCreatePixmapCursor
) ( Display
* , Pixmap
, Pixmap
, XColor
* , XColor
* , unsigned int , unsigned int );
30 Cursor (*XCreateFontCursor
) ( Display
* , unsigned int );
31 GC (*XCreateGC
) ( Display
* , Drawable
, unsigned long , XGCValues
* );
32 Pixmap (*XCreatePixmap
) ( Display
* , Drawable
, unsigned int , unsigned int , unsigned int );
33 Window (*XCreateSimpleWindow
) ( Display
* , Window
, int , int , unsigned int , unsigned int , unsigned int , unsigned long , unsigned long );
34 Window (*XCreateWindow
) ( Display
* , Window
, int , int , unsigned int , unsigned int , unsigned int , int , unsigned int , Visual
* , unsigned long , XSetWindowAttributes
* );
35 KeySym (*XLookupKeysym
) ( XKeyEvent
* , int );
36 long (*XMaxRequestSize
) ( Display
* );
37 VisualID (*XVisualIDFromVisual
) ( Visual
* );
38 XErrorHandler (*XSetErrorHandler
) ( XErrorHandler
);
39 XIOErrorHandler (*XSetIOErrorHandler
) ( XIOErrorHandler
);
40 int (*XSetWMHints
) ( Display
* , Window
, XWMHints
* );
41 XWMHints
* (*XGetWMHints
) ( Display
* , Window
);
42 void (*XSetWMNormalHints
)(Display
*display
, Window w
, XSizeHints
*hints
);
43 int (*XSetWMProtocols
) ( Display
* , Window
, Atom
* , int );
44 int (*XAutoRepeatOff
) ( Display
* );
45 int (*XAutoRepeatOn
) ( Display
* );
46 int (*XChangeGC
) ( Display
* , GC
, unsigned long , XGCValues
* );
47 int (*XChangeProperty
) ( Display
* , Window
, Atom
, Atom
, int , int , const unsigned char* , int );
48 int (*XChangeWindowAttributes
) ( Display
* , Window
, unsigned long , XSetWindowAttributes
* );
49 int (*XClearArea
) ( Display
* , Window
, int , int , unsigned int , unsigned int , int );
50 int (*XCloseDisplay
) ( Display
* );
51 int (*XConfigureWindow
) ( Display
* , Window
, unsigned int , XWindowChanges
* );
52 int (*XConvertSelection
) ( Display
* , Atom
, Atom
, Atom
, Window
, Time
);
53 int (*XCopyArea
) ( Display
* , Drawable
, Drawable
, GC
, int , int , unsigned int , unsigned int , int , int );
54 int (*XCopyPlane
) ( Display
* , Drawable
, Drawable
, GC
, int , int , unsigned int , unsigned int , int , int , unsigned long );
55 int (*XDefineCursor
) ( Display
* , Window
, Cursor
);
56 int (*XDeleteProperty
) ( Display
* , Window
, Atom
);
57 int (*XDestroyWindow
) ( Display
* , Window
);
58 int (*XDrawArc
) ( Display
* , Drawable
, GC
, int , int , unsigned int , unsigned int , int , int );
59 int (*XDrawLine
) ( Display
* , Drawable
, GC
, int , int , int , int );
60 int (*XDrawPoint
) ( Display
* , Drawable
, GC
, int , int );
61 int (*XDrawString
) ( Display
* , Drawable
, GC
, int , int , const char* , int );
62 int (*XEventsQueued
) ( Display
* , int );
63 int (*XFillRectangle
) ( Display
* , Drawable
, GC
, int , int , unsigned int , unsigned int );
64 int (*XFlush
) ( Display
* );
65 int (*XFree
) ( void* );
66 int (*XFreeColormap
) ( Display
* , Colormap
);
67 int (*XFreeGC
) ( Display
* , GC
);
68 int (*XFreePixmap
) ( Display
* , Pixmap
);
69 int (*XGetErrorText
) ( Display
* , int , char* , int );
70 XVisualInfo
* (*XGetVisualInfo
) ( Display
* , long , XVisualInfo
* , int* );
71 int (*XGetWindowProperty
) ( Display
* , Window
, Atom
, long , long , int , Atom
, Atom
* , int* , unsigned long* , unsigned long* , unsigned char** );
72 int (*XGetWindowAttributes
) ( Display
* , Window
, XWindowAttributes
* );
73 int (*XGrabKeyboard
) ( Display
* , Window
, int , int , int , Time
);
74 int (*XGrabPointer
) ( Display
* , Window
, int , unsigned int , int , int , Window
, Cursor
, Time
);
75 int (*XMapRaised
) ( Display
* , Window
);
76 int (*XMapWindow
) ( Display
* , Window
);
77 int (*XNextEvent
) ( Display
* , XEvent
* );
78 int (*XParseGeometry
) ( const char* , int* , int* , unsigned int* , unsigned int* );
79 int (*XPending
) ( Display
* );
80 int (*XPutImage
) ( Display
* , Drawable
, GC
, XImage
* , int , int , int , int , unsigned int , unsigned int );
81 int (*XRecolorCursor
) ( Display
* , Cursor
, XColor
* , XColor
* );
82 int (*XRefreshKeyboardMapping
) ( XMappingEvent
* );
83 int (*XSelectInput
) ( Display
* , Window
, long );
84 int (*XSendEvent
) ( Display
* , Window
, int , long , XEvent
* );
85 int (*XSetBackground
) ( Display
* , GC
, unsigned long );
86 int (*XSetClipMask
) ( Display
* , GC
, Pixmap
);
87 int (*XSetClipRectangles
) ( Display
* , GC
, int , int , XRectangle
* , int , int );
88 int (*XSetFillStyle
) ( Display
* , GC
, int );
89 int (*XSetForeground
) ( Display
* , GC
, unsigned long );
90 int (*XSetFunction
) ( Display
* , GC
, int );
91 int (*XSetIconName
) ( Display
* , Window
, const char* );
92 int (*XSetSelectionOwner
) ( Display
* , Atom
, Window
, Time
);
93 int (*XStoreColor
) ( Display
* , Colormap
, XColor
* );
94 int (*XStoreName
) ( Display
* , Window
, const char* );
95 int (*XSync
) ( Display
* , int );
96 int (*XAllocColor
) ( Display
* , Colormap
, XColor
* );
97 int (*XLookupString
) ( XKeyEvent
* , char* , int , KeySym
* , XComposeStatus
* );
98 int (*XQueryExtension
) (Display
*, char*, int*, int*, int*);
99 int (*XDefaultScreen
) (Display
*);
100 Window (*XRootWindow
) (Display
*, int);
101 XClassHint
* (*XAllocClassHint
) ();
102 int (*XSetClassHint
) (Display
*, Window
, XClassHint
*);
103 int (*XSetInputFocus
) ( Display
* , Window
, int , Time
);
104 #if DEBUG_X11_SYNCHRON
105 void (*XSynchronize
)(Display
*, Bool
);
109 #ifndef HAVE_XF86VMODE_H
111 /* Taken from xf86vmode.h */
113 unsigned int dotclock
;
114 unsigned short hdisplay
;
115 unsigned short hsyncstart
;
116 unsigned short hsyncend
;
117 unsigned short htotal
;
118 unsigned short hskew
;
119 unsigned short vdisplay
;
120 unsigned short vsyncstart
;
121 unsigned short vsyncend
;
122 unsigned short vtotal
;
126 } XF86VidModeModeInfo
;
131 Bool (*XF86VidModeGetAllModeLines
) (Display
*, int, int *, XF86VidModeModeInfo
***);
132 Bool (*XF86VidModeSwitchToMode
) ( Display
* , int , XF86VidModeModeInfo
* );
133 Bool (*XF86VidModeSetViewPort
) ( Display
* , int , int , int );
134 Bool (*XF86VidModeQueryVersion
) ( Display
* , int* , int* );
135 Bool (*XF86VidModeQueryExtension
) ( Display
* , int* , int* );
140 key_t (*ftok
) (const char *, int);
141 int (*shmctl
) (int, int, struct shmid_ds
*);
142 int (*shmget
) (key_t
, size_t, int);
143 void * (*shmat
) (int, const void *, int);
144 int (*shmdt
) (const void *);
149 struct xcursor_func
{
150 XcursorImage
* (*XcursorImageCreate
) ( int , int );
151 void (*XcursorImageDestroy
) ( XcursorImage
* );
152 Cursor (*XcursorImageLoadCursor
) ( Display
* , const XcursorImage
* );
155 extern void *xf86vm_handle
;
156 extern struct xf86vm_func xf86vm_func
;
158 extern void *xcursor_handle
;
159 extern struct xcursor_func xcursor_func
;
161 extern void *x11_handle
;
162 extern struct x11_func x11_func
;
164 extern void *libc_handle
;
165 extern struct libc_func libc_func
;
168 #define X11_SOFILE "libX11.so.6"
169 #define LIBC_SOFILE "libc.so.6"
170 #define XF86VM_SOFILE "libXxf86vm.so.1"
171 #define XCURSOR_SOFILE "libXcursor.so.1"
174 #ifdef HOST_OS_darwin
175 #define X11_SOFILE "/usr/X11/lib/libX11.6.dylib"
176 #define LIBC_SOFILE "libSystem.dylib"
177 #define XF86VM_SOFILE "/usr/X11/lib/libXxf86vm.1.dylib"
178 #define XCURSOR_SOFILE "/usr/X11/lib/libXcursor.1.dylib"
182 #define X11_SOFILE "libX11.so"
183 #define LIBC_SOFILE "libc.so"
184 #define XF86VM_SOFILE "libXxf86vm.so"
185 #define XCURSOR_SOFILE "libXcursor.so"
188 #define XVMCALL(func,...) (xf86vm_func.func(__VA_ARGS__))
189 #define XCCALL(func,...) (xcursor_func.func(__VA_ARGS__))
190 #define XCALL(func,...) (x11_func.func(__VA_ARGS__))
191 #define CCALL(func,...) (libc_func.func(__VA_ARGS__))