diff options
Diffstat (limited to 'dsimple.h')
-rw-r--r-- | dsimple.h | 54 |
1 files changed, 16 insertions, 38 deletions
@@ -29,10 +29,8 @@ from The Open Group. /* - * Just_display.h: This file contains the definitions needed to use the - * functions in just_display.c. It also declares the global - * variables dpy, screen, and program_name which are needed to - * use just_display.c. + * dsimple.h: This file contains the definitions needed to use the + * functions in dsimple.c. It also declares the global + * variable program_name which is needed to use dsimple.c. * - * Written by Mark Lillibridge. Last updated 7/1/87 - * - * Send bugs, etc. to chariot@athena.mit.edu. + * Written by Mark Lillibridge for Xlib. Last updated 7/1/87 + * Ported to XCB over two decades later. */ @@ -40,10 +38,6 @@ from The Open Group. #include <X11/Xfuncproto.h> +#include <xcb/xcb.h> +#include <xcb/xproto.h> - /* Simple helper macros */ -#ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif /* MAX */ -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif /* MIN */ +typedef enum { False = 0, True } Bool; @@ -52,30 +46,14 @@ from The Open Group. extern char *program_name; /* Name of this program */ -extern Display *dpy; /* The current display */ -extern int screen; /* The current screen */ - -#define INIT_NAME program_name=argv[0] /* use this in main to setup - program_name */ - /* Declaritions for functions in dsimple.c */ + /* Declarations for functions in dsimple.c */ -char *Get_Display_Name(int *, char **); -Display *Open_Display(char *); -void Setup_Display_And_Screen(int *, char **); -void Close_Display(void); -Window Select_Window_Args(int *, char **); -void usage(void); +const char *Get_Display_Name (const char *displayname); +void Setup_Display_And_Screen (const char *displayname, + xcb_connection_t **dpy, xcb_screen_t **screen); -#define X_USAGE "[host:display]" /* X arguments handled by - Get_Display_Name */ - -/* - * Other_stuff.h: Definitions of routines in other_stuff. - * - * Written by Mark Lillibridge. Last updated 7/1/87 - * - * Send bugs, etc. to chariot@athena.mit.edu. - */ +xcb_window_t Select_Window(xcb_connection_t *, const xcb_screen_t *, int); +xcb_window_t Window_With_Name(xcb_connection_t *, xcb_window_t, const char *); -Window Select_Window(Display *, int); -Window Window_With_Name(Display *, Window, char *); void Fatal_Error(char *, ...) _X_NORETURN _X_ATTRIBUTE_PRINTF(1, 2); + +void Print_X_Error (xcb_connection_t *, xcb_generic_error_t *); |