diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-10 15:53:21 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-10 15:53:21 -0400 |
commit | 3ab431238f73ac90c6d2df2f83c8cc7afcc253ba (patch) | |
tree | 76ddc321ae2151eb7bca0abb878f408bef9adb67 | |
parent | 66fc0d9690e93e9dc8168fc709152dfdea87bd27 (diff) |
Stub out most of the core protocol request API
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/colormap.c | 224 | ||||
-rw-r--r-- | src/display.c | 304 | ||||
-rw-r--r-- | src/draw.c | 338 | ||||
-rw-r--r-- | src/event.c | 26 | ||||
-rw-r--r-- | src/font.c | 121 | ||||
-rw-r--r-- | src/hints.c | 99 | ||||
-rw-r--r-- | src/input.c | 372 | ||||
-rw-r--r-- | src/window.c | 43 | ||||
-rw-r--r-- | src/xim.c | 134 |
10 files changed, 1661 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 7afdd11..8001c4e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ libX11_wayland_la_LIBADD = $(CSX_LIBS) libX11_wayland_la_CPPFLAGS = $(CSX_CFLAGS) libX11_wayland_la_SOURCES = \ display.c resource.c window.c pixmap.c event.c input.c private.h \ - hints.c xim.c + hints.c xim.c draw.c font.c colormap.c noinst_PROGRAMS = csx-test xlib-test diff --git a/src/colormap.c b/src/colormap.c new file mode 100644 index 0000000..e31a899 --- /dev/null +++ b/src/colormap.c @@ -0,0 +1,224 @@ +#include <stdint.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#include <X11/Xproto.h> +#include <X11/Xlib.h> + +#include "private.h" + +WL_EXPORT Colormap +XCreateColormap(Display *xdisplay, + Window w, Visual* visual, int alloc) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CreateColormap, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XFreeColormap(Display *xdisplay, Colormap colormap) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_FreeColormap, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Colormap +XCopyColormapAndFree(Display *xdisplay, Colormap colormap) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CopyColormapAndFree, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XInstallColormap(Display *xdisplay, Colormap colormap) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_InstallColormap, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XUninstallColormap(Display *xdisplay, Colormap colormap) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_UninstallColormap, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Colormap * +XListInstalledColormaps(Display *xdisplay, Window w, int *num) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ListInstalledColormaps, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT Status +XAllocColor(Display *xdisplay, Colormap colormap, XColor *screen) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_AllocColor, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Status +XAllocNamedColor(Display *xdisplay, + Colormap colormap, + const char *color_name, + XColor *screen_def, + XColor *exact_def) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_AllocNamedColor, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Status +XAllocColorCells(Display *xdisplay, + Colormap colormap, + Bool contig, + unsigned long* plane_masks_return, + unsigned int nplanes, + unsigned long* pixels_return, + unsigned int npixels) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_AllocColorCells, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Status +XAllocColorPlanes(Display *xdisplay, + Colormap colormap, + Bool contig, + unsigned long *pixels_return, + int ncolors, + int nreds, + int ngreens, + int nblues, + unsigned long *rmask_return, + unsigned long *gmask_return, + unsigned long *bmask_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_AllocColorPlanes, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XFreeColors(Display *xdisplay, + Colormap colormap, + unsigned long* pixels, + int npixels, + unsigned long planes) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_FreeColors, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XStoreColors(Display *xdisplay, Colormap colormap, XColor *color, int ncolors) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_StoreColors, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XStoreNamedColor(Display *xdisplay, + Colormap colormap, + _Xconst char* color, + unsigned long pixel, + int flags) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_StoreNamedColor, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XQueryColors(Display *xdisplay, + Colormap colormap, XColor *defs, int ncolors) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryColors, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Status +XLookupColor(Display *xdisplay, + Colormap colormap, + _Xconst char* color_name, + XColor* exact_def_return, + XColor* screen_def_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_LookupColor, 0); + + STUB(); + + return 1; +} + diff --git a/src/display.c b/src/display.c index af6fc92..907ca53 100644 --- a/src/display.c +++ b/src/display.c @@ -510,3 +510,307 @@ XFree(void *data) return 1; } + +WL_EXPORT int +XSetSelectionOwner(Display *xdisplay, Atom selection, Window owner, Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetSelectionOwner, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Window +XGetSelectionOwner(Display *xdisplay, Atom selection) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetSelectionOwner, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XConvertSelection(Display *xdisplay, Atom selection, + Atom target, Atom property, Window requestor, Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ConvertSelection, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGrabServer(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GrabServer, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XUngrabServer(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_UngrabServer, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XQueryExtension(Display *xdisplay, const char *name, + int *major, int *first_event, int *first_error) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryExtension, 0); + + STUB(); + + return 1; +} + +WL_EXPORT char ** +XListExtensions(Display *xdisplay, int *nextensions) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ListExtensions, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT Cursor +XCreatePixmapCursor(Display *xdisplay, + Pixmap source, Pixmap mask, + XColor *foreground, XColor *background, + unsigned int x, unsigned int y) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CreateCursor, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Cursor +XCreateGlyphCursor(Display *xdisplay, + Font source_font, Font mask_font, + unsigned int source_char, unsigned int mask_char, + XColor const *foreground_color, + XColor const *background_color) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CreateGlyphCursor, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XFreeCursor(Display *xdisplay, Cursor cursor) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_FreeCursor, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XRecolorCursor(Display *xdisplay, Cursor cursor, + XColor *foreground_color, XColor *background_color) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_RecolorCursor, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Status +XQueryBestSize(Display *xdisplay, + int class, Drawable which_screen, + unsigned int width, unsigned int height, + unsigned int *width_return, unsigned int *height_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryBestSize, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XSetScreenSaver(Display *xdisplay, int timeout, int interval, + int prefer_blanking, int allow_exposures) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetScreenSaver, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGetScreenSaver(Display *xdisplay, + int *timeout_return, + int *interval_return, + int *prefer_blanking_return, + int *allow_exposures_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetScreenSaver, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XAddHost(Display *xdisplay, XHostAddress *host) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ChangeHosts, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XRemoveHost(Display *xdisplay, XHostAddress *host) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ChangeHosts, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XAddHosts(Display *xdisplay, XHostAddress *hosts, int n) +{ + int i; + + for (i = 0; i < n; i++) + XAddHost(xdisplay, &hosts[i]); + + return 1; +} + +WL_EXPORT int +XRemoveHosts(Display *xdisplay, XHostAddress *hosts, int n) +{ + int i; + + for (i = 0; i < n; i++) + XRemoveHost(xdisplay, &hosts[i]); + + return 1; +} + +WL_EXPORT XHostAddress * +XListHosts(Display *xdisplay, int *nhosts, Bool* state_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ListHosts, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT int +XSetAccessControl(Display *xdisplay, int mode) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetAccessControl, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XSetCloseDownMode(Display *xdisplay, int close_mode) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetCloseDownMode, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XKillClient(Display *xdisplay, XID resource) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_KillClient, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XForceScreenSaver(Display *xdisplay, int mode) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ForceScreenSaver, 0); + + STUB(); + + return 1; +} + + +WL_EXPORT int +XNoOp(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_NoOperation, 0); + + return 1; +} + diff --git a/src/draw.c b/src/draw.c new file mode 100644 index 0000000..e7f9134 --- /dev/null +++ b/src/draw.c @@ -0,0 +1,338 @@ +#include <stdint.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#include <X11/Xproto.h> +#include <X11/Xlib.h> + +#include "private.h" + +WL_EXPORT GC +XCreateGC(Display *xdisplay, + Drawable d, unsigned long valuemask, XGCValues* values) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CreateGC, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT int +XChangeGC(Display *xdisplay, + GC gc, unsigned long valuemask, XGCValues* values) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ChangeGC, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XCopyGC(Display *xdisplay, + GC src, unsigned long valuemask, GC dest) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CopyGC, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XSetDashes(Display *xdisplay, + GC gc, int dash_offset, const char* dash_list, int n) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetDashes, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XSetClipRectangles(Display *xdisplay, + GC gc, + int clip_x_origin, + int clip_y_origin, + XRectangle* rectangles, + int n, + int ordering) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetClipRectangles, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XFreeGC(Display *xdisplay, GC gc) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_FreeGC, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XClearArea(Display *xdisplay, + Window w, + int x, + int y, + unsigned int width, + unsigned int height, + Bool exposures) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ClearArea, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XCopyArea(Display *xdisplay, + Drawable src, + Drawable dest, + GC gc, + int src_x, + int src_y, + unsigned int width, + unsigned int height, + int dest_x, + int dest_y) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CopyArea, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XCopyPlane(Display *xdisplay, + Drawable src, + Drawable dest, + GC gc, + int src_x, + int src_y, + unsigned int width, + unsigned int height, + int dest_x, + int dest_y, + unsigned long plane) + +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CopyPlane, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolyPoint(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyPoint, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolyLine(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyLine, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolySegment(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolySegment, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolyRectangle(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyRectangle, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolyArc(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyArc, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XFillPoly(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_FillPoly, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolyFillRectangle(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyFillRectangle, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolyFillArc(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyFillArc, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPutImage(Display *xdisplay, + Drawable d, + GC gc, + XImage* image, + int src_x, + int src_y, + int dest_x, + int dest_y, + unsigned int width, + unsigned int height) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PutImage, 0); + + STUB(); + + return 1; +} + +WL_EXPORT XImage * +XGetImage(Display *xdisplay, + Drawable d, + int x, + int y, + unsigned int width, + unsigned int height, + unsigned long plane_mask, + int format) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetImage, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT int +XPolyText8(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyText8, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XPolyText16(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_PolyText16, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XImageText8(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ImageText8, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XImageText16(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ImageText16, 0); + + STUB(); + + return 1; +} + diff --git a/src/event.c b/src/event.c index a33931d..8e527e4 100644 --- a/src/event.c +++ b/src/event.c @@ -1,10 +1,36 @@ #include <stdlib.h> +#include <X11/Xproto.h> #include <X11/Xlib.h> #include "private.h" WL_EXPORT int +XSendEvent(Display *xdisplay, + Window w, Bool propagate, long event_mask, XEvent* event_send) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SendEvent, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XAllowEvents(Display *xdisplay, int event_mode, Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_AllowEvents, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int XNextEvent(Display *xdisplay, XEvent *xevent) { struct csx_display *display = csx_display(xdisplay); diff --git a/src/font.c b/src/font.c new file mode 100644 index 0000000..fc3c04c --- /dev/null +++ b/src/font.c @@ -0,0 +1,121 @@ +#include <stdint.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#include <X11/Xproto.h> +#include <X11/Xlib.h> + +#include "private.h" + +WL_EXPORT int +XOpenFont(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_OpenFont, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XCloseFont(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_CloseFont, 0); + + STUB(); + + return 1; +} + +WL_EXPORT XFontStruct * +XQueryFont(Display *xdisplay, XID font_id) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryFont, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT int +XQueryTextExtents(Display *xdisplay, + XID font_ID, + const char *string, + int nchars, + int *direction_return, + int *font_ascent_return, + int *font_descent_return, + XCharStruct *overall_return) + +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryTextExtents, 0); + + STUB(); + + return 1; +} + +WL_EXPORT char ** +XListFonts(Display *xdisplay, + const char* pattern, + int maxnames, + int *actual_count) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ListFonts, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT char ** +XListFontsWithInfo(Display *xdisplay, + const char *pattern, + int maxnames, + int *count_return, + XFontStruct **info_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ListFontsWithInfo, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT int +XSetFontPath(Display *xdisplay, char **directories, int ndirs) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetFontPath, 0); + + STUB(); + + return 1; +} + +WL_EXPORT char ** +XGetFontPath(Display *xdisplay, int *npaths) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetFontPath, 0); + + STUB(); + + return NULL; +} + diff --git a/src/hints.c b/src/hints.c new file mode 100644 index 0000000..128e826 --- /dev/null +++ b/src/hints.c @@ -0,0 +1,99 @@ +#include <stdint.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Xatom.h> + +#include "private.h" + +WL_EXPORT int +XSetSizeHints(Display *dpy, Window w, XSizeHints *hints, Atom property) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetWMHints(Display *dpy, Window w, XWMHints *wmhints) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetZoomHints(Display *dpy, Window w, XSizeHints *zhints) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetNormalHints(Display *dpy, Window w, XSizeHints *hints) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetIconSizes(Display *dpy, Window w, XIconSize *list, int count) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetCommand(Display *dpy, Window w, char **argv, int argc) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetStandardProperties(Display *dpy, Window w, const char *name, + const char *icon_string, Pixmap icon_pixmap, + char **argv, int argc, XSizeHints *hints) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetTransientForHint(Display *dpy, Window w, Window propWindow) +{ + STUB(); + + return 0; +} + +WL_EXPORT int +XSetClassHint(Display *dpy, Window w, XClassHint *classhint) +{ + STUB(); + + return 0; +} + +WL_EXPORT Status +XSetWMProtocols(Display *dpy, Window w, Atom *protocols, int count) +{ + Atom prop; + + prop = XInternAtom(dpy, "WM_PROTOCOLS", False); + if (prop == None) + return False; + + XChangeProperty(dpy, w, prop, XA_ATOM, 32, + PropModeReplace, (unsigned char *) protocols, count); + + return True; +} diff --git a/src/input.c b/src/input.c index 93102ed..aacd5c3 100644 --- a/src/input.c +++ b/src/input.c @@ -3,6 +3,7 @@ #include <string.h> #include <stdlib.h> +#include <X11/Xproto.h> #include <X11/Xlib.h> #include "private.h" @@ -230,3 +231,374 @@ csx_display_add_seat(struct csx_display *display, &wl_seat_interface, 1); wl_seat_add_listener(seat->seat, &seat_listener, seat); } + +WL_EXPORT Bool +XQueryPointer(Display *xdisplay, + Window w, Window *root_return, Window *child_return, + int *root_x, int *root_y, int *win_x, int *win_y, + unsigned int *mask) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryPointer, 0); + + STUB(); + + return 1; +} + +WL_EXPORT XTimeCoord * +XGetMotionEvents(Display *xdisplay, + Window w, Time start, Time stop, int *nevents_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetMotionEvents, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT int +XGrabPointer(Display *xdisplay, + Window grab_window, Bool owner_events, unsigned int event_mask, + int pointer_mode, int keyboard_mode, Window confine_to, + Cursor cursor, Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GrabPointer, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XUngrabPointer(Display *xdisplay, Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_UngrabPointer, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGrabButton(Display *xdisplay, + unsigned int button, + unsigned int modifiers, + Window grab_window, + Bool owner_events, + unsigned int event_mask, + int pointer_mode, + int keyboard_mode, + Window confine_to, + Cursor cursor) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GrabButton, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XUngrabButton(Display *xdisplay, + unsigned int button, + unsigned int modifiers, + Window grab_window) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_UngrabButton, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XChangeActivePointerGrab(Display *xdisplay, + unsigned int event_mask, + Cursor cursor, + Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ChangeActivePointerGrab, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGrabKeyboard(Display *xdisplay, + Window grab_window, + Bool owner_events, + int pointer_mode, + int keyboard_mode, + Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GrabKeyboard, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XUngrabKeyboard(Display *xdisplay, Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_UngrabKeyboard, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGrabKey(Display *xdisplay, + int keycode, + unsigned int modifiers, + Window grab_window, + Bool owner_events, + int pointer_mode, + int keyboard_mode) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GrabKey, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XUngrabKey(Display *xdisplay, + int keycode, unsigned int modifiers, Window grab_window) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_UngrabKey, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XWarpPointer(Display *xdisplay, + Window src_w, + Window dest_w, + int src_x, + int src_y, + unsigned int src_width, + unsigned int src_height, + int dest_x, + int dest_y) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_WarpPointer, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XSetInputFocus(Display *xdisplay, Window focus, int revert_to, Time time) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetInputFocus, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGetInputFocus(Display *xdisplay, Window *focus, int *revert_to) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetInputFocus, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XQueryKeymap(Display *xdisplay, char keys[32]) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryKeymap, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XChangeKeyboardMapping(Display *xdisplay, + int first_keycode, int keysyms_per_keycode, + KeySym *keysyms, int num_codes) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ChangeKeyboardMapping, 0); + + STUB(); + + return 1; +} + +WL_EXPORT KeySym * +XGetKeyboardMapping(Display *xdisplay, + KeyCode first_keycode, + int keycode_count, + int *keysyms_per_keycode) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetKeyboardMapping, 0); + + STUB(); + + return NULL; +} + +WL_EXPORT int +XChangeKeyboardControl(Display *xdisplay, + unsigned long value_mask, + XKeyboardControl* values) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ChangeKeyboardControl, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGetKeyboardControl(Display *xdisplay, XKeyboardState *values) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetKeyboardControl, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XBell(Display *xdisplay, int percent) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_Bell, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XChangePointerControl(Display *xdisplay, + Bool do_accel, + Bool do_threshold, + int accel_numerator, + int accel_denominator, + int threshold) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_ChangePointerControl, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGetPointerControl(Display *xdisplay, + int* accel_numerator_return, + int* accel_denominator_return, + int* threshold_return) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetPointerControl, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XSetPointerMapping(Display *xdisplay, + const unsigned char *map, int nmap) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetPointerMapping, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XGetPointerMapping(Display *xdisplay, unsigned char *map, int nmap) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetPointerMapping, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XSetModifierMapping(Display *xdisplay, XModifierKeymap *modmap) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_SetModifierMapping, 0); + + STUB(); + + return 1; +} + +WL_EXPORT XModifierKeymap * +XGetModifierMapping(Display *xdisplay) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_GetModifierMapping, 0); + + STUB(); + + return NULL; +} + diff --git a/src/window.c b/src/window.c index 7e8f14a..582212c 100644 --- a/src/window.c +++ b/src/window.c @@ -946,6 +946,47 @@ XListProperties(Display *xdisplay, Window xwindow, int *num_prop) atoms[i++] = property->name; *num_prop = length; - + return atoms; } + +WL_EXPORT int +XRotateWindowProperties(Display *xdisplay, + Window w, Atom *properties, + int nprops, int npositions) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_RotateProperties, 0); + + STUB(); + + return 1; +} + +WL_EXPORT Status +XQueryTree(Display *xdisplay, Window w, Window *root, + Window *parent, Window **children, unsigned int *nchildren) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_QueryTree, 0); + + STUB(); + + return 1; +} + +WL_EXPORT int +XTranslateCoordinates(Display *xdisplay, Window src_win, Window dest_win, + int src_x, int src_y, + int *dst_x, int *dst_y, Window *child) +{ + struct csx_display *display = csx_display(xdisplay); + + csx_display_enter(display, X_TranslateCoords, 0); + + STUB(); + + return 1; +} diff --git a/src/xim.c b/src/xim.c new file mode 100644 index 0000000..f3985cb --- /dev/null +++ b/src/xim.c @@ -0,0 +1,134 @@ +#include <stdlib.h> +#include <string.h> + +#include <X11/Xlib.h> +#include "private.h" + +struct _XIM { + Display *xdisplay; +}; + +struct _XIC { +}; + +WL_EXPORT XIM +XOpenIM(Display *xdisplay, struct _XrmHashBucketRec *rdb, + char *res_name, char *res_class) +{ + STUB(); + + return NULL; +} + +WL_EXPORT Status XCloseIM(XIM im) +{ + STUB(); + + return 0; +} + +WL_EXPORT char * +XGetIMValues(XIM im, ...) +{ + STUB(); + + return NULL; +} + +WL_EXPORT char * +XSetIMValues(XIM im, ...) +{ + STUB(); + + return NULL; +} + +WL_EXPORT Display * +XDisplayOfIM(XIM im) +{ + STUB(); + + return im->xdisplay; +} + +WL_EXPORT char * +XLocaleOfIM(XIM im) +{ + STUB(); + + return NULL; +} + +WL_EXPORT XIC +XCreateIC(XIM im, ...) +{ + STUB(); + + return NULL; +} + +WL_EXPORT void +XDestroyIC(XIC ic) +{ + STUB(); +} + +WL_EXPORT void +XSetICFocus(XIC id) +{ + STUB(); +} + +WL_EXPORT void +XUnsetICFocus(XIC ic) +{ + STUB(); +} + +WL_EXPORT wchar_t * +XwcResetIC(XIC ic) +{ + STUB(); + + return NULL; +} + +WL_EXPORT char * +XmbResetIC(XIC ic) +{ + STUB(); + + return NULL; +} + +WL_EXPORT char * +Xutf8ResetIC(XIC ic) +{ + STUB(); + + return NULL; +} + +WL_EXPORT char * +XSetICValues(XIC ic, ...) +{ + STUB(); + + return NULL; +} + +WL_EXPORT char * +XGetICValues(XIC ic, ...) +{ + STUB(); + + return NULL; +} + +WL_EXPORT XIM +XIMOfIC(XIC ic) +{ + STUB(); + + return NULL; +} |