#ifndef JEFF_XTOOLS_H #define JEFF_XTOOLS_H #include #include #include "SDL.h" /* Types */ typedef Uint32 pixel_t; /* Functions */ XImage *x_window_dump(Display *dpy, Window window); Window x_wname_to_wid(Display *dpy, Window top, char *name); void x_send_key(Display *dpy, Window window, int keycode, int type); void x_send_pushkey(Display *dpy, Window window, int keycode); pixel_t x_pixel_from_rgb(short r, short g, short b); void x_pixel_to_rgb(pixel_t pix, short *r, short *g, short *b); void line32(SDL_Surface *s, int x1, int y1, int x2, int y2, Uint32 color); /* Image dumps */ int x_imagedump_save(XImage *xi, FILE *out); XImage *x_imagedump_load(FILE *in); void x_imagedump_free(XImage *xi); void x_image_to_png(XImage *xi, char *path); #endif /* JEFF_XTOOLS_H */