Skip to content

Commit

Permalink
Extend Xlib objects in fake includes (eliben#233)
Browse files Browse the repository at this point in the history
* Extend Xlib objects in fake includes

* Move X11 typedefs and defines to X11 subdirectory. Remove unecessarry function declarations header
  • Loading branch information
Alexnagel authored and eliben committed Jan 23, 2018
1 parent 2168238 commit 1894fd7
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 6 deletions.
2 changes: 2 additions & 0 deletions utils/fake_libc_include/X11/Xlib.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#include "_fake_defines.h"
#include "_fake_typedefs.h"
#include "_X11_fake_defines.h"
#include "_X11_fake_typedefs.h"
13 changes: 13 additions & 0 deletions utils/fake_libc_include/X11/_X11_fake_defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _X11_FAKE_DEFINES_H
#define _X11_FAKE_DEFINES_H

#define Atom CARD32
#define Bool int
#define KeySym CARD32
#define Pixmap CARD32
#define Time CARD32
#define _XFUNCPROTOBEGIN
#define _XFUNCPROTOEND
#define _Xconst const

#endif
38 changes: 38 additions & 0 deletions utils/fake_libc_include/X11/_X11_fake_typedefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef _X11_FAKE_TYPEDEFS_H
#define _X11_FAKE_TYPEDEFS_H

typedef char* XPointer;
typedef unsigned char KeyCode;
typedef unsigned int CARD32;
typedef unsigned long VisualID;
typedef unsigned long XIMResetState;
typedef unsigned long XID;
typedef XID Window;
typedef XID Colormap;
typedef XID Cursor;
typedef XID Drawable;
typedef void* XtPointer;
typedef XtPointer XtRequestId;
typedef struct Display Display;
typedef struct Screen Screen;
typedef struct Status Status;
typedef struct Visual Visual;
typedef struct Widget *Widget;
typedef struct XColor XColor;
typedef struct XClassHint XClassHint;
typedef struct XEvent XEvent;
typedef struct XFontStruct XFontStruct;
typedef struct XGCValues XGCValues;
typedef struct XKeyEvent XKeyEvent;
typedef struct XKeyPressedEvent XKeyPressedEvent;
typedef struct XPoint XPoint;
typedef struct XRectangle XRectangle;
typedef struct XSelectionRequestEvent XSelectionRequestEvent;
typedef struct XWindowChanges XWindowChanges;
typedef struct _XGC _XCG;
typedef struct _XGC *GC;
typedef struct _XIC *XIC;
typedef struct _XIM *XIM;
typedef struct _XImage XImage;

#endif
6 changes: 0 additions & 6 deletions utils/fake_libc_include/_fake_typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ typedef _Bool bool;

typedef int va_list;

/* Xlib objects */
typedef struct Display Display;
typedef unsigned long XID;
typedef unsigned long VisualID;
typedef XID Window;

/* Mir typedefs */
typedef void* MirEGLNativeWindowType;
typedef void* MirEGLNativeDisplayType;
Expand Down

0 comments on commit 1894fd7

Please sign in to comment.