Skip to content

Commit

Permalink
Annotate stub functions with UNIMPLEMENTED().
Browse files Browse the repository at this point in the history
  • Loading branch information
waddlesplash committed Dec 9, 2021
1 parent 9b497ab commit b252059
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 8 deletions.
3 changes: 3 additions & 0 deletions xlib/Cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ extern "C" {
#include <X11/cursorfont.h>
}

#include "Debug.h"

extern "C" Cursor
XCreateGlyphCursor(Display *display, Font source_font, Font mask_font,
unsigned int source_char, unsigned int mask_char,
Expand Down Expand Up @@ -69,6 +71,7 @@ XCreatePixmapCursor(Display *display, Pixmap source, Pixmap mask,
unsigned int x, unsigned int y)
{
// TODO.
UNIMPLEMENTED();
return BadImplementation;
}

Expand Down
5 changes: 5 additions & 0 deletions xlib/Image.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "Debug.h"

extern "C" {
#include <X11/Xlib.h>
}
Expand All @@ -14,13 +16,15 @@ XCreateImage(Display *display, Visual *visual,
unsigned int width, unsigned int height,
int bitmap_pad, int bytes_per_line)
{
UNIMPLEMENTED();
return NULL;
}

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;
}

Expand All @@ -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;
}
11 changes: 9 additions & 2 deletions xlib/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern "C" {
#include <X11/XKBlib.h>
}

#include "Debug.h"
#include "keysymlist.h"

extern "C" Display*
Expand All @@ -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;
Expand All @@ -36,13 +38,15 @@ XLookupKeysym(XKeyEvent* key_event, int index)
KeyCode
XKeysymToKeycode(Display *display, KeySym keysym)
{
UNIMPLEMENTED();
// FIXME: Implement!
return 0;
}

KeySym
XkbKeycodeToKeysym(Display* dpy, KeyCode kc, int group, int level)
{
UNIMPLEMENTED();
return NoSymbol;
}

Expand Down Expand Up @@ -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;
}
53 changes: 47 additions & 6 deletions xlib/stubs.c
Original file line number Diff line number Diff line change
@@ -1,137 +1,161 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>

#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;
}

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;
}

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;
}

int
XConvertSelection(Display *display, Atom selection, Atom target,
Atom property, Window requestor, Time time)
{
UNIMPLEMENTED();
return 0;
}

VisualID
XVisualIDFromVisual(Visual *visual)
{
UNIMPLEMENTED();
return 0;
}

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;
}

Expand All @@ -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;
}

Expand All @@ -176,61 +204,71 @@ 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;
}

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;
}

Expand All @@ -239,17 +277,20 @@ 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;
}

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;
}

0 comments on commit b252059

Please sign in to comment.