From b252059f8f7e6114c8abce584b32fb6525e24d56 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 8 Dec 2021 23:51:00 -0500 Subject: [PATCH] Annotate stub functions with UNIMPLEMENTED(). --- xlib/Cursor.cpp | 3 +++ xlib/Image.cpp | 5 +++++ xlib/Keyboard.cpp | 11 ++++++++-- xlib/stubs.c | 53 +++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 64 insertions(+), 8 deletions(-) diff --git a/xlib/Cursor.cpp b/xlib/Cursor.cpp index 8d6c534..b108ce7 100644 --- a/xlib/Cursor.cpp +++ b/xlib/Cursor.cpp @@ -5,6 +5,8 @@ extern "C" { #include } +#include "Debug.h" + extern "C" Cursor XCreateGlyphCursor(Display *display, Font source_font, Font mask_font, unsigned int source_char, unsigned int mask_char, @@ -69,6 +71,7 @@ XCreatePixmapCursor(Display *display, Pixmap source, Pixmap mask, unsigned int x, unsigned int y) { // TODO. + UNIMPLEMENTED(); return BadImplementation; } diff --git a/xlib/Image.cpp b/xlib/Image.cpp index f1565fa..bcb8704 100644 --- a/xlib/Image.cpp +++ b/xlib/Image.cpp @@ -1,3 +1,5 @@ +#include "Debug.h" + extern "C" { #include } @@ -14,6 +16,7 @@ XCreateImage(Display *display, Visual *visual, unsigned int width, unsigned int height, int bitmap_pad, int bytes_per_line) { + UNIMPLEMENTED(); return NULL; } @@ -21,6 +24,7 @@ extern "C" XImage * XGetImage(Display *display, Drawable d, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format) { + UNIMPLEMENTED(); return NULL; } @@ -29,5 +33,6 @@ XPutImage(Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) { + UNIMPLEMENTED(); return BadImplementation; } diff --git a/xlib/Keyboard.cpp b/xlib/Keyboard.cpp index 9c6aee0..72d2bb0 100644 --- a/xlib/Keyboard.cpp +++ b/xlib/Keyboard.cpp @@ -7,6 +7,7 @@ extern "C" { #include } +#include "Debug.h" #include "keysymlist.h" extern "C" Display* @@ -20,6 +21,7 @@ int XLookupString(XKeyEvent* event_struct, char* buffer_return, int bytes_buffer, KeySym* keysym_return, XComposeStatus *status_in_out) { + UNIMPLEMENTED(); // FIXME: Implement! *buffer_return = event_struct->keycode; *keysym_return = -1; @@ -36,6 +38,7 @@ XLookupKeysym(XKeyEvent* key_event, int index) KeyCode XKeysymToKeycode(Display *display, KeySym keysym) { + UNIMPLEMENTED(); // FIXME: Implement! return 0; } @@ -43,6 +46,7 @@ XKeysymToKeycode(Display *display, KeySym keysym) KeySym XkbKeycodeToKeysym(Display* dpy, KeyCode kc, int group, int level) { + UNIMPLEMENTED(); return NoSymbol; } @@ -109,19 +113,22 @@ XKeysymToString(KeySym keysym) extern "C" int XDisplayKeycodes(Display*, int*, int*) { + UNIMPLEMENTED(); return BadImplementation; } -int +extern "C" int XGrabKeyboard(Display *display, Window grab_window, Bool owner_events, int pointer_mode, int keyboard_mode, Time time) { + UNIMPLEMENTED(); // TODO? return BadImplementation; } -int +extern "C" int XUngrabKeyboard(Display *display, Time time) { + UNIMPLEMENTED(); return Success; } diff --git a/xlib/stubs.c b/xlib/stubs.c index 996265a..7e274b0 100644 --- a/xlib/stubs.c +++ b/xlib/stubs.c @@ -1,21 +1,26 @@ #include #include +#include "Debug.h" + int XSendEvent(Display *display, Window w, Bool propagate, long event_mask, XEvent *event_send) { + UNIMPLEMENTED(); return BadImplementation; } int XGrabServer(Display *display) { + UNIMPLEMENTED(); return Success; } int XUngrabServer(Display *display) { + UNIMPLEMENTED(); return Success; } @@ -23,29 +28,34 @@ int XGrabPointer(Display *display, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) { + UNIMPLEMENTED(); return BadImplementation; } int XUngrabPointer(Display *display, Time time) { + UNIMPLEMENTED(); return Success; } XHostAddress * XListHosts(Display *display, int *nhosts_return, Bool *state_return) { + UNIMPLEMENTED(); return NULL; } void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop) { + UNIMPLEMENTED(); } int XSetWindowColormap(Display *display, Window w, Colormap colormap) { + UNIMPLEMENTED(); return BadImplementation; } @@ -53,25 +63,29 @@ Status XGetWMColormapWindows(Display *display, Window w, Window **windows_return, int *count_return) { + UNIMPLEMENTED(); return BadImplementation; } Status -XSetWMColormapWindows(Display *display, Window w, Window *colormap_windows, - int count) +XSetWMColormapWindows(Display *display, Window w, + Window *colormap_windows, int count) { + UNIMPLEMENTED(); return 0; } int XSetWMHints(Display *display, Window w, XWMHints *wm_hints) { + UNIMPLEMENTED(); return 0; } int XRefreshKeyboardMapping(XMappingEvent *event_map) { + UNIMPLEMENTED(); return 0; } @@ -79,12 +93,14 @@ int XConvertSelection(Display *display, Atom selection, Atom target, Atom property, Window requestor, Time time) { + UNIMPLEMENTED(); return 0; } VisualID XVisualIDFromVisual(Visual *visual) { + UNIMPLEMENTED(); return 0; } @@ -92,46 +108,54 @@ Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return) { + UNIMPLEMENTED(); return BadAlloc; } int XSetClassHint(Display *display, Window w, XClassHint *class_hints) { + UNIMPLEMENTED(); return 0; } Window XGetSelectionOwner(Display* display, Atom selection) { + UNIMPLEMENTED(); return None; } int XSetSelectionOwner(Display *display, Atom selection, Window owner, Time time) { + UNIMPLEMENTED(); return BadImplementation; } int XSetTSOrigin(Display *display, GC gc, int x, int y) { + UNIMPLEMENTED(); return BadImplementation; } XFontSet XCreateFontSet(Display *display, const char *base_font_name_list, char ***missing_charset_list_return, int *missing_charset_count_return, char **def_string_return) { + UNIMPLEMENTED(); return NULL; } void XFreeFontSet(Display* dpy, XFontSet xf) { + UNIMPLEMENTED(); } int XSetIconName(Display *display, Window w, const char *icon_name) { + UNIMPLEMENTED(); return BadImplementation; } @@ -140,31 +164,35 @@ Status XTextPropertyToStringList ( char ***list_return, int *count_return) { + UNIMPLEMENTED(); return BadAlloc; } -void XFreeStringList (char **list) +void XFreeStringList(char **list) { + UNIMPLEMENTED(); } int XSetTransientForHint(Display *display, Window w, Window prop_window) { + UNIMPLEMENTED(); return BadImplementation; } int XSetInputFocus(Display *display, Window focus, int revert_to, Time time) { + UNIMPLEMENTED(); return BadImplementation; } - int XQueryTree(Display *display, Window w, Window *root_return, Window *parent_return, Window **children_return, unsigned int *nchildren_return) { + UNIMPLEMENTED(); return BadImplementation; } @@ -176,8 +204,9 @@ XGetWindowProperty(Display *display, Window w, Atom property, unsigned long *bytes_after_return, unsigned char **prop_return) { - if (nitems_return) - *nitems_return = 0; + UNIMPLEMENTED(); + *nitems_return = 0; + *prop_return = NULL; return BadImplementation; } @@ -185,52 +214,61 @@ int XChangeProperty(Display *display, Window w, Atom property, Atom type, int format, int mode, _Xconst unsigned char *data, int nelements) { + UNIMPLEMENTED(); return BadImplementation; } int XDeleteProperty(Display *display, Window w, Atom property) { + UNIMPLEMENTED(); return BadImplementation; } int (*XSynchronize(Display*, Bool))(Display*) { + UNIMPLEMENTED(); return NULL; } int XSetCommand(Display *display, Window w, char **argv, int argc) { + UNIMPLEMENTED(); return 0; } XErrorHandler XSetErrorHandler(XErrorHandler handler) { + UNIMPLEMENTED(); return NULL; } int XResetScreenSaver(Display* display) { + UNIMPLEMENTED(); return BadImplementation; } int XForceScreenSaver(Display* display, int) { + UNIMPLEMENTED(); return BadImplementation; } int XSetWindowBorderPixmap(Display *display, Window w, Pixmap border_pixmap) { + UNIMPLEMENTED(); return BadImplementation; } int XSetWindowBackgroundPixmap(Display *display, Window w, Pixmap background_pixmap) { + UNIMPLEMENTED(); return BadImplementation; } @@ -239,6 +277,7 @@ XWarpPointer(Display *display, 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) { + UNIMPLEMENTED(); return BadImplementation; } @@ -246,10 +285,12 @@ Status XReconfigureWMWindow(Display *display, Window w, int screen_number, unsigned int mask, XWindowChanges *changes) { + UNIMPLEMENTED(); return BadImplementation; } char* XSetLocaleModifiers(const char *modifier_list) { + UNIMPLEMENTED(); return NULL; }