home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Shareware 1999 March
/
PCShareware-3-99.iso
/
IMPLE
/
DJGPP.RAR
/
DJGPP2
/
XLIB-SR0.ZIP
/
SRC
/
XLIBEMU
/
XLIBEMU.H
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-18
|
7KB
|
308 lines
/* $Id: xlibemu.h 1.4 1994/01/30 18:48:06 ulrich Exp ulrich $ */
/*
* Xlibemu.h
*
* Internal header file for Xlibemu.
*/
#include "copying.h"
#ifndef _XLIB_EMU_H_
#define _XLIB_EMU_H_
#include <grx.h>
#include <mousex.h>
/* include Xproto.h before all others.
* X11 resources (Window, Pixmap, ...) are defined and undefined
* in this header file.
*/
#define NEED_EVENTS
#include <X11/Xproto.h>
/* include X.h before Xlibint.h includes it */
#include <X11/X.h>
/* shadow typedefs from X.h */
typedef struct _WWindowRec * _WWindowPtr;
typedef struct _WPixmapRec * _WPixmapPtr;
typedef GrCursor * _WCursorPtr;
typedef GrFont * _WFontPtr;
typedef union _WDrawableRec * _WDrawablePtr;
#define Window _WWindowPtr
#define Pixmap _WPixmapPtr
#define Cursor _WCursorPtr
#define Font _WFontPtr
#define Drawable _WDrawablePtr
/*
* External structures
*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "region.h"
/*
* Internal structures
*/
typedef struct {
void (*fillBox) ();
long fillArg;
} _WFillGC;
/* Supported keycodes */
#define MIN_KEYCODE 8
#define MAX_KEYCODE 114
#define NUM_KEYCODES (MAX_KEYCODE - MIN_KEYCODE + 1)
/* Number of display connections */
#define MAX_CONN 8
typedef struct _WPixmapRec {
int type;
GrContext* context;
GrPattern* pattern;
unsigned int width;
unsigned int height;
char* data;
} _WPixmap;
typedef struct _WWindowRec {
int type; /* Drawable type */
GrContext *context;
GrContext *context_save;
Window parent;
Window top_child;
Window bottom_child;
Window lower_sibling;
Window upper_sibling;
int x;
int y;
unsigned int width;
unsigned int height;
unsigned int border_width;
int depth;
unsigned int class;
Visual* visual;
Bool mapped;
Bool viewable;
int visibility;
int win_gravity;
int bit_gravity;
unsigned long flags;
long event_mask;
long event_masks[MAX_CONN];
long do_not_propagate_mask;
_WFillGC background;
_WFillGC border;
Cursor cursor;
int backing_store;
unsigned long backing_planes;
unsigned long backing_pixel;
Bool save_under;
Bool override_redirect;
Colormap colormap;
BoxRec window_port;
BoxRec border_port;
Region visible_region;
XPointer ext_addr;
} _WWindow;
typedef union _WDrawableRec {
int type; /* 0=GrBitmap,
1=GrPixmap,
2=_WWindow
3=_WPixmap */
_WWindow window;
_WPixmap pixmap;
} _WDrawable;
typedef struct _WCursorRec {
int shape;
int refcount;
GrCursor *cursor;
} _WCursor;
typedef struct _WGC {
struct _XGC xgc;
/*
* Xlibemu extensions to the _XGC structure
* I hope none of the X application programmers
* ever used the _XGC structure.
*/
void (*Plot)();
void (*Line)();
void (*Box)();
void (*Circle)();
void (*Ellipse)();
void (*CircleArc)();
void (*EllipseArc)();
void (*PolyLine)();
void (*Polygon)();
void (*FilledBox)();
void (*FilledCircle)();
void (*FilledEllipse)();
void (*FilledCircleArc)();
void (*FilledEllipseArc)();
void (*FilledPolygon)();
long line_arg;
long fill_arg;
GrLineOption line_opt;
GrLinePattern line_pat;
int dash_len;
char *dash_list;
} *WGC;
typedef struct _WPointerGrabRec {
int active;
Display* display;
Window grab_window;
long event_mask;
int owner_events;
int pointer_mode;
int keyboard_mode;
Window confine_to;
Cursor cursor;
Time time;
int pointer_x;
int pointer_y;
} _WPointerGrab;
typedef struct _WKeyboardGrabRec {
int active;
Display* display;
Window grab_window;
long event_mask;
int owner_events;
int pointer_mode;
int keyboard_mode;
Time time;
} _WKeyboardGrab;
typedef struct _WInputFocusRec {
Window window;
int revert_to;
Time time;
} _WInputFocus;
typedef struct _WQueueEventRec {
int flags; /* flags (see eventque.h) */
int x,y; /* coordinates */
int buttons; /* button state */
int key; /* key code from keyboard */
int scan; /* scan code from keyboard */
int kbstat; /* keybd status (ALT, CTRL, etc..) */
long time; /* time stamp of the event */
} _WQueueEvent;
/* eventque.c */
void _WQueueUnInit(void);
void _WQueueInit(void);
void _WMouseSetSpeed(int speed);
void _WMouseSetAccel(int thresh,int accel);
void _WMouseSetLimits(int x1,int y1,int x2,int y2);
void _WMouseGetLimits(int *x1,int *y1,int *x2,int *y2);
void _WMouseWarp(int x,int y);
void _WMouseSetCursor(GrCursor *cursor);
void _WMouseSetColors(int fg,int bg);
void _WMouseDisplayCursor(void);
void _WMouseEraseCursor(void);
int _WMouseBlock(GrContext *c,int x1,int y1,int x2,int y2);
void _WMouseUnBlock(int flags);
void _WMouseEventEnable(int enable_kb,int enable_ms);
void _WQueueGetEvent(int flags,_WQueueEvent *e);
int _WQueuePendingEvent(void);
void _WQueueQuery (_WQueueEvent *e);
/*
* Internal functions
*/
int _WError (Display *dpy, XID resourceid, int error_code, int request_code);
void _WGetWindowPort (Window w, BoxPtr p);
void _WGetBorderPort (Window w, BoxPtr p);
int _WClipPortByParents (Window w, BoxPtr p);
int _WClipBorderByParents (Window w, BoxPtr p);
void _WProcessEvent (XEvent* event, long event_mask);
void _WSetViewable (Window w, Bool viewable);
void _WSetMapping (Window w, Bool mapped);
void _WMapSubwindows (Window parent);
Window _WPointToWindow (Display *dpy, int x, int y);
Window _WPointToWindowBorder (Display *dpy, int x, int y);
void _WNewWindowContext (Window w);
void _WGetWindowOrigin (Window w, int* x, int* y);
void _WMoveBorder (XEvent *event,
BoxPtr result, int border_width, int border_color);
Cursor _WGetWindowCursor (Window w);
Window _WMaskEventWindow (Window w, unsigned long mask);
unsigned int _WButtonAndModifierState (_WQueueEvent *ev);
void _WDefineCursor (Cursor new_cursor);
int _WSetVisibleRegion (Window w);
void _WSetVisibleSubwindows (Window w);
int _WInvalidateParent (Window w);
void _WDummyFilledBox ();
int _WDrawContext (Drawable d, GC gc);
int _WDrawScreenContext (Drawable d);
void _WDrawRegion (void (*prim)(), long a, long b, long c, long d, long e);
void _WDrawWindowBorder (Display *dpy, Window w, BoxPtr r, Bool exposures);
void _WDrawWindowBackground (Display* dpy, Window w, BoxPtr r, Bool exposures);
void _WDrawWindow (Display *dpy, Window w, BoxPtr r, Bool exposures);
void _WDrawSubwindows (Display *dpy, Window w, BoxPtr r, Bool exposures);
void _WDrawSiblingsBelow (Display *display, Window w, Bool exposures);
Time _WCurrentTime ();
Time _WConvertTime (long event_time);
Bool _WIsInferior (Window a, Window b);
Bool _WCheckWindow (Display *dpy, Window window, int request_code);
void _XEnq (Display *dpy, XEvent *ev);
/* dispatch.c */
Window _WFindEventWindow (Display *dpy, Window w, long event_mask);
int _WPropagateEvent (XEvent *ev, Window pointer_window);
void _WDispatchEvent (XEvent *ev);
/* globals.c */
extern _WPointerGrab _PointerGrab;
extern _WKeyboardGrab _KeyboardGrab;
extern _WInputFocus _Focus;
extern Cursor _Cursor;
extern BoxRec _ClipBox;
extern unsigned long _EventSerial;
extern _WQueueEvent _LastMouseEvent;
extern Window _LastMouseWindow;
extern Window _LastEnterWindow;
extern Window _LastLeaveWindow;
extern int _Xdebug;
extern Display *_ConnTable[];
extern XKeyboardState _KeyboardState;
#include "Xlibint.h"
#endif