vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

x11-inc.h (3358B)


      1 #define Colormap	XColormap
      2 #define Cursor		XCursor
      3 #define Display		XDisplay
      4 #define Drawable	XDrawable
      5 #define Font		XFont
      6 #define GC		XGC
      7 #define Point		XPoint
      8 #define Rectangle	XRectangle
      9 #define Screen		XScreen
     10 #define Visual		XVisual
     11 #define Window		XWindow
     12 
     13 #include <X11/X.h>
     14 #include <X11/Xlib.h>
     15 #include <X11/Xatom.h>
     16 #include <X11/Xutil.h>
     17 #include <X11/Xresource.h>
     18 #include <X11/keysym.h>
     19 
     20 #undef Colormap
     21 #undef Cursor
     22 #undef Display
     23 #undef Drawable
     24 #undef Font
     25 #undef GC
     26 #undef Point
     27 #undef Rectangle
     28 #undef Screen
     29 #undef Visual
     30 #undef Window
     31 
     32 /*
     33  * Structure pointed to by X field of Memimage
     34  */
     35 typedef struct Xmem Xmem;
     36 struct Xmem
     37 {
     38 	int		pixmap;	/* pixmap id */
     39 	XImage		*xi;	/* local image */
     40 	int		dirty;	/* is the X server ahead of us?  */
     41 	Rectangle	dirtyr;	/* which pixels? */
     42 	Rectangle	r;	/* size of image */
     43 };
     44 
     45 typedef struct Xprivate Xprivate;
     46 struct Xprivate {
     47 	uint32		chan;
     48 	XColormap	cmap;
     49 	XCursor		cursor;
     50 	XDisplay	*display;
     51 	XDisplay	*snarfcon;
     52 	XDisplay	*kmcon;
     53 	int		fd;	/* of display */
     54 	int		depth;				/* of screen */
     55 	XDrawable	drawable;
     56 	XColor		map[256];
     57 	XColor		map7[128];
     58 	uchar		map7to8[128][2];
     59 	XGC		gccopy;
     60 	XGC		gccopy0;
     61 	XGC		gcfill;
     62 	uint32		gcfillcolor;
     63 	XGC		gcfill0;
     64 	uint32		gcfill0color;
     65 	XGC		gcreplsrc;
     66 	uint32		gcreplsrctile;
     67 	XGC		gcreplsrc0;
     68 	uint32		gcreplsrc0tile;
     69 	XGC		gcsimplesrc;
     70 	uint32		gcsimplesrccolor;
     71 	uint32		gcsimplesrcpixmap;
     72 	XGC		gcsimplesrc0;
     73 	uint32		gcsimplesrc0color;
     74 	uint32		gcsimplesrc0pixmap;
     75 	XGC		gczero;
     76 	uint32		gczeropixmap;
     77 	XGC		gczero0;
     78 	uint32		gczero0pixmap;
     79 	Rectangle	newscreenr;
     80 	Memimage*	screenimage;
     81 	QLock		screenlock;
     82 	XDrawable	screenpm;
     83 	XDrawable	nextscreenpm;
     84 	Rectangle	screenr;
     85 	int		toplan9[256];
     86 	int		tox11[256];
     87 	int		usetable;
     88 	XVisual		*vis;
     89 	Atom		clipboard;
     90 	Atom		utf8string;
     91 	Atom		targets;
     92 	Atom		text;
     93 	Atom		compoundtext;
     94 	Atom		takefocus;
     95 	Atom		losefocus;
     96 	Atom		wmprotos;
     97 	Atom		wmstate;
     98 	Atom		wmfullscreen;
     99 	uint		putsnarf;
    100 	uint		assertsnarf;
    101 	int		destroyed;
    102 };
    103 
    104 extern Xprivate _x;
    105 
    106 extern Memimage *_xallocmemimage(Rectangle, uint32, int);
    107 extern XImage	*_xallocxdata(Memimage*, Rectangle);
    108 extern void	_xdirtyxdata(Memimage*, Rectangle);
    109 extern void	_xfillcolor(Memimage*, Rectangle, uint32);
    110 extern void	_xfreexdata(Memimage*);
    111 extern XImage	*_xgetxdata(Memimage*, Rectangle);
    112 extern void	_xputxdata(Memimage*, Rectangle);
    113 
    114 long _xkeysym2rune(KeySym keysym);
    115 
    116 struct Mouse;
    117 extern int	_xtoplan9mouse(XEvent*, struct Mouse*);
    118 extern void	_xtoplan9kbd(XEvent*);
    119 extern void	_xexpose(XEvent*);
    120 extern int	_xselect(XEvent*);
    121 extern int	_xconfigure(XEvent*);
    122 extern int	_xdestroy(XEvent*);
    123 extern void	_flushmemscreen(Rectangle);
    124 extern void	_xmoveto(Point);
    125 struct Cursor;
    126 extern void	_xsetcursor(struct Cursor*);
    127 extern void	_xbouncemouse(Mouse*);
    128 extern int		_xsetlabel(char*);
    129 extern Memimage*	_xattach(char*, char*);
    130 extern char*		_xgetsnarf(void);
    131 extern void		_xputsnarf(char *data);
    132 extern void		_xtopwindow(void);
    133 extern void		_xresizewindow(Rectangle);
    134 extern void		_xmovewindow(Rectangle);
    135 extern int		_xreplacescreenimage(void);
    136 
    137 #define MouseMask (\
    138 	ButtonPressMask|\
    139 	ButtonReleaseMask|\
    140 	PointerMotionMask|\
    141 	Button1MotionMask|\
    142 	Button2MotionMask|\
    143 	Button3MotionMask)
    144 
    145 extern Rectangle screenrect;
    146 extern Rectangle windowrect;
    147 extern int fullscreen;
    148 
    149 typedef struct Cursor Cursor;
    150 
    151 enum
    152 {
    153 	PMundef = ~0
    154 };