X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmsdos.h;h=4db6cf8b28961610a0529ac0af927eae2d946296;hb=0a87fde47bcff35f196024766f8d0d00319a28d1;hp=c3357a65ca16c02a21f9d46621e22a4c247dcf20;hpb=4dcd7afc3645fa20c7868263eb09764e68240acd;p=rocksndiamonds.git diff --git a/src/msdos.h b/src/msdos.h index c3357a65..4db6cf8b 100644 --- a/src/msdos.h +++ b/src/msdos.h @@ -12,20 +12,13 @@ * msdos.h * ***********************************************************/ -#ifndef XPM_INCLUDE_FILE -#define XPM_INCLUDE_FILE -#endif - -#define XRES 800 -#define YRES 600 - -#define TRUE 1 -#define FALSE 0 - #include #include -// Allegro keyboard mapping +#define XRES 800 +#define YRES 600 + +/* Allegro keyboard mapping */ #define OSD_KEY_ESC 1 /* keyboard scan codes */ #define OSD_KEY_1 2 /* (courtesy of allegro.h) */ @@ -137,7 +130,7 @@ #define OSD_MAX_KEY 115 -// X11 keyboard mapping +/* X11 keyboard mapping */ #define XK_KP_Enter OSD_KEY_ENTER_PAD #define XK_KP_0 OSD_KEY_0_PAD @@ -236,12 +229,53 @@ #define XK_F11 OSD_KEY_F11 #define XK_F10 OSD_KEY_F10 -#define MOUSE_FILENAME "graphics\\mouse.gif" + +/*!!!*/ +#define XK_KP_Add OSD_KEY_PLUS_PAD +#define XK_KP_Subtract OSD_KEY_MINUS_PAD +#define XK_KP_Multiply OSD_KEY_ASTER_PAD +#define XK_KP_Divide OSD_KEY_SLASH_PAD +#define XK_KP_Separator OSD_KEY_STOP_PAD +#define XK_Control_L OSD_KEY_LCONTROL +#define XK_Control_R OSD_KEY_RCONTROL +#define XK_Meta_L OSD_KEY_ALT +#define XK_Meta_R OSD_KEY_ALTGR +#define XK_Alt_L OSD_KEY_ALT +#define XK_Alt_R OSD_KEY_ALTGR +#define XK_Mode_switch 0 /* unknown in allegro */ +#define XK_Multi_key 0 /* unknown in allegro */ +#define XK_Insert OSD_KEY_INSERT +#define XK_Tab OSD_KEY_TAB +#define XK_Home OSD_KEY_HOME +#define XK_End OSD_KEY_END +#define XK_Page_Up OSD_KEY_PGUP +#define XK_Page_Down OSD_KEY_PGDN +#define XK_space OSD_KEY_SPACE +#define XK_adiaeresis 0 /* unknown in allegro */ +#define XK_odiaeresis 0 /* unknown in allegro */ +#define XK_udiaeresis 0 /* unknown in allegro */ +#define XK_apostrophe 0 /* unknown in allegro */ +#define XK_plus 0 /* unknown in allegro */ +#define XK_minus OSD_KEY_MINUS +#define XK_comma OSD_KEY_COMMA +#define XK_period OSD_KEY_STOP +#define XK_numbersign 0 /* unknown in allegro */ +#define XK_less 0 /* unknown in allegro */ +#define XK_greater 0 /* unknown in allegro */ +#define XK_asciicircum 0 /* unknown in allegro */ +#define XK_ssharp 0 /* unknown in allegro */ +#define XK_F1 0 /* unknown in allegro */ +#define XK_F24 0 /* unknown in allegro */ +#define XK_VoidSymbol 0 /* unknown in allegro */ +/*!!!*/ + + +#define MOUSE_GIF_FILENAME "graphics\\mouse.gif" +#define MOUSE_PCX_FILENAME "graphics\\mouse.gif" +#define JOYSTICK_FILENAME "joystick.cnf" #define screen myscreen #define XFlush(a) -#define XSync(a,b) -#define XSetClipOrigin(a,b,c,d) #define XGetImage(a,b,c,d,e,f,g,h) ((XImage *) NULL) #define XAutoRepeatOn(a) #define XAutoRepeatOff(a) @@ -252,24 +286,23 @@ #define XDefaultDepth(a,b) (8) #define XSetWMProperties(a,b,c,d,e,f,g,h,i) -#define MAX_EVENT_BUFFER 256 +#define MAX_EVENT_BUFFER 256 -#define Status int -#define Bool int -#define True 1 -#define False 0 +#define True 1 +#define False 0 +#define None 0L -#define DUMMY_FILE (void*) -1 -#define DUMMY_MASK -1 +#define DUMMY_FILE ((void *) -1) +#define DUMMY_MASK (-1) -#define KeyPressMask (1L<<0) -#define KeyReleaseMask (1L<<1) -#define ButtonPressMask (1L<<2) -#define ButtonReleaseMask (1L<<3) -#define ButtonMotionMask (1L<<13) -#define ExposureMask (1L<<15) -#define StructureNotifyMask (1L<<17) -#define FocusChangeMask (1L<<21) +#define KeyPressMask (1L << 0) +#define KeyReleaseMask (1L << 1) +#define ButtonPressMask (1L << 2) +#define ButtonReleaseMask (1L << 3) +#define ButtonMotionMask (1L << 13) +#define ExposureMask (1L << 15) +#define StructureNotifyMask (1L << 17) +#define FocusChangeMask (1L << 21) #define KeyPress 2 #define KeyRelease 3 @@ -281,27 +314,36 @@ #define Expose 12 #define UnmapNotify 18 #define MapNotify 19 +#define ClientMessage 33 -#define GCForeground (1L<<2) -#define GCBackground (1L<<3) -#define GCGraphicsExposures (1L<<16) -#define GCClipMask (1L<<19) +#define GCForeground (1L << 2) +#define GCBackground (1L << 3) +#define GCGraphicsExposures (1L << 16) +#define GCClipMask (1L << 19) -#define NormalState 1 /* most applications want to start this way */ +#define NormalState 1 /* most applications want to start this way */ #define InputHint (1L << 0) #define StateHint (1L << 1) #define IconPixmapHint (1L << 2) #define IconMaskHint (1L << 5) -#define PSize (1L << 3) /* program specified size */ -#define PMinSize (1L << 4) /* program specified minimum size */ -#define PMaxSize (1L << 5) /* program specified maximum size */ +#define PSize (1L << 3) /* program specified size */ +#define PMinSize (1L << 4) /* program specified minimum size */ +#define PMaxSize (1L << 5) /* program specified maximum size */ + +#define XpmSuccess 0 +#define XpmOpenFailed -1 +#define XpmFileInvalid -2 +#define XpmNoMemory -3 +#define XpmColorFailed -4 -#define XpmSuccess 0 -#define XpmOpenFailed -1 -#define XpmFileInvalid -2 -#define XpmNoMemory -3 -#define XpmColorFailed -4 -#define XpmCloseness (1L<<12) +#define XpmCloseness (1L << 12) + +#define PCX_Success 0 +#define PCX_OpenFailed -1 +#define PCX_ReadFailed -2 +#define PCX_FileInvalid -3 +#define PCX_NoMemory -4 +#define PCX_ColorFailed -5 #define BitmapSuccess 0 #define BitmapOpenFailed 1 @@ -310,16 +352,21 @@ #define ZPixmap 2 /* depth == drawable depth */ -#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) -#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap) -#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr]) -#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) -#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) -#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) -#define AllPlanes ((unsigned long)~0L) +#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) +#define DefaultColormap(dpy, scr) (ScreenOfDisplay(dpy,scr)->cmap) +#define ScreenOfDisplay(dpy, scr) (&((_XPrivDisplay)dpy)->screens[scr]) +#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) +#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) +#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) +#define AllPlanes ((unsigned long)~0L) + +#define DefaultVisual(dpy, scr) (NULL) +#define DefaultDepth(dpy, scr) (NULL) +#define XDisplayWidth(dpy, scr) (XRES) +#define XDisplayHeight(dpy, scr) (YRES) #define XGetPixel(ximage, x, y) \ - ((*((ximage)->f.get_pixel))((ximage), (x), (y))) + ((*((ximage)->f.get_pixel))((ximage), (x), (y))) typedef unsigned long Pixel; /* Index into colormap */ typedef unsigned long XID; @@ -330,143 +377,165 @@ typedef XID Colormap; typedef XID KeySym; typedef XID GContext; typedef struct _XDisplay Display; +typedef long Visual; +typedef long XVisualInfo; +typedef long Atom; +typedef int Status; +typedef int Bool; typedef struct _XGC { - GContext gid; /* protocol ID for graphics context */ + GContext gid; /* protocol ID for graphics context */ } *GC; -typedef struct { - Colormap cmap; /* default color map */ - Window root; /* Root window id. */ - unsigned long white_pixel; - unsigned long black_pixel; /* White and Black pixel values */ - int x; - int y; - unsigned int width; - unsigned int height; - BITMAP *video_bitmap; +typedef struct +{ + Colormap cmap; /* default color map */ + Window root; /* root window id */ + unsigned long white_pixel; /* white pixel value */ + unsigned long black_pixel; /* black pixel value */ + int x; + int y; + unsigned int width; + unsigned int height; + BITMAP *video_bitmap; } Screen; typedef struct _XDisplay { - int default_screen; /* default screen for operations */ - Screen *screens; /* pointer to list of screens */ - BITMAP *mouse_ptr; + int default_screen; /* default screen for operations */ + Screen *screens; /* pointer to list of screens */ + BITMAP *mouse_ptr; } *_XPrivDisplay; -typedef struct _XImage { - struct funcs { - unsigned long (*get_pixel) (struct _XImage *, int, int); - } f; +typedef struct _XImage +{ + struct funcs + { + unsigned long (*get_pixel) (struct _XImage *, int, int); + } f; } XImage; -typedef struct { - long flags; /* marks which fields in this structure are defined */ - int width, height; /* should set so old wm's don't mess up */ - int min_width, min_height; - int max_width, max_height; +typedef struct +{ + long flags; /* marks which fields in this structure are defined */ + int width, height; /* should set so old wm's don't mess up */ + int min_width, min_height; + int max_width, max_height; } XSizeHints; -typedef struct { - long flags; /* marks which fields in this structure are defined */ - Bool input; /* does this application rely on the window manager to - get keyboard input? */ - int initial_state; /* see below */ - Pixmap icon_pixmap; /* pixmap to be used as icon */ - Pixmap icon_mask; /* icon mask bitmap */ +typedef struct +{ + long flags; /* marks which fields in this structure are defined */ + Bool input; /* does this application rely on the window manager to + get keyboard input? */ + int initial_state; /* see below */ + Pixmap icon_pixmap; /* pixmap to be used as icon */ + Pixmap icon_mask; /* icon mask bitmap */ } XWMHints; -typedef struct { - char *res_name; - char *res_class; +typedef struct +{ + char *res_name; + char *res_class; } XClassHint; -typedef struct { - unsigned char *value; /* same as Property routines */ +typedef struct +{ + unsigned char *value; /* same as Property routines */ } XTextProperty; -typedef struct { - unsigned long foreground;/* foreground pixel */ - unsigned long background;/* background pixel */ - Bool graphics_exposures;/* boolean, should exposures be generated */ - Pixmap clip_mask; /* bitmap clipping; other calls for rects */ - int clip_x_origin; /* origin for clipping */ - int clip_y_origin; - unsigned long value_mask; +typedef struct +{ + unsigned long foreground; /* foreground pixel */ + unsigned long background; /* background pixel */ + Bool graphics_exposures; /* boolean, should exposures be generated */ + Pixmap clip_mask; /* bitmap clipping; other calls for rects */ + int clip_x_origin; /* x origin for clipping */ + int clip_y_origin; /* y origin for clipping */ + unsigned long value_mask; } XGCValues; -typedef struct { - unsigned long valuemask; /* Specifies which attributes are */ - unsigned int closeness; /* Allowable RGB deviation */ - Pixel *pixels; /* List of used color pixels */ - unsigned int npixels; /* Number of used pixels */ +typedef struct +{ + unsigned long valuemask; /* specifies which attributes are */ + unsigned int closeness; /* allowable RGB deviation */ + Pixel *pixels; /* list of used color pixels */ + unsigned int npixels; /* number of used pixels */ } XpmAttributes; -typedef struct { - int type; - int x, y; - int width, height; +typedef struct +{ + int type; + int x, y; + int width, height; } XExposeEvent; -typedef struct { - int type; /* of event */ - int x, y; /* pointer x, y coordinates in event window */ - unsigned int button; /* detail */ +typedef struct +{ + int type; /* of event */ + int x, y; /* pointer x, y coordinates in event window */ + unsigned int button; /* detail */ } XButtonEvent; -typedef struct { - int type; - int x, y; /* pointer x, y coordinates in event window */ +typedef struct +{ + int type; + int x, y; /* pointer x, y coordinates in event window */ } XMotionEvent; -typedef struct { - int type; /* of event */ - unsigned int state; /* key or button mask */ +typedef struct +{ + int type; /* of event */ + unsigned int state; /* key or button mask */ } XKeyEvent; -typedef struct { - int type; /* FocusIn or FocusOut */ +typedef struct +{ + int type; /* FocusIn or FocusOut */ } XFocusChangeEvent; +typedef struct +{ + int type; /* ClientMessage */ +} XClientMessageEvent; -typedef union _XEvent { - int type; /* must not be changed; first element */ - XExposeEvent xexpose; - XButtonEvent xbutton; - XMotionEvent xmotion; - XKeyEvent xkey; +typedef union _XEvent +{ + int type; /* must not be changed; first element */ + XExposeEvent xexpose; + XButtonEvent xbutton; + XMotionEvent xmotion; + XKeyEvent xkey; } XEvent; - -extern void XMapWindow(Display*, Window); -//extern void XFlush(Display*); -extern Display *XOpenDisplay(char*); -//extern char *XDisplayName(char*); -extern Window XCreateSimpleWindow(Display*, Window, int, int, unsigned int, unsigned int, unsigned int, unsigned long, unsigned long); -extern int XReadBitmapFile(Display*, Drawable, char*, unsigned int*, unsigned int*, Pixmap*, int*, int*); -extern Status XStringListToTextProperty(char**, int, XTextProperty*); -//extern void XSetWMProperties(Display*, Window, XTextProperty*, XTextProperty*, char**, int, XSizeHints*, XWMHints*, XClassHint*); -extern void XFree(void*); -//extern void XSelectInput(Display*, Window, long); -extern GC XCreateGC(Display*, Drawable, unsigned long, XGCValues*); -extern void XFillRectangle(Display*, Drawable, GC, int, int, unsigned int, unsigned int); -extern Pixmap XCreatePixmap(Display*, Drawable, unsigned int, unsigned int, unsigned int); -//extern int XDefaultDepth(Display*, int); -extern inline void XCopyArea(Display*, Drawable, Drawable, GC, int, int, unsigned int, unsigned int, int, int); -extern int XpmReadFileToPixmap(Display*, Drawable, char*, Pixmap*, Pixmap*, XpmAttributes*); -//extern void XFreeColors(Display*, Colormap, unsigned long*, int, unsigned long); -//extern void XpmFreeAttributes(XpmAttributes*); -extern void XFreePixmap(Display*, Pixmap); -extern void XFreeGC(Display*, GC); -extern void XCloseDisplay(Display*); -extern int XPending(Display*); -extern void XNextEvent(Display*, XEvent*); -//extern void XSync(Display*, Bool); -//extern void XAutoRepeatOn(Display*); -//extern void XAutoRepeatOff(Display*); -extern KeySym XLookupKeysym(XKeyEvent*, int); -//extern void XSetClipOrigin(Display*, GC, int, int); -//extern XImage *XGetImage(Display*, Drawable, int, int, unsigned int, unsigned int, unsigned long, int); - -BITMAP *load_gif(char *filename, RGB *pal); \ No newline at end of file +unsigned char get_ascii(KeySym); +void XMapWindow(Display *, Window); +Display *XOpenDisplay(char *); +Window XCreateSimpleWindow(Display *, Window, int, int, + unsigned int, unsigned int, unsigned int, + unsigned long, unsigned long); +Status XStringListToTextProperty(char **, int, XTextProperty *); +void XFree(void *); +GC XCreateGC(Display *, Drawable, unsigned long, XGCValues *); +void XSetClipMask(Display *, GC, Pixmap); +void XSetClipOrigin(Display *, GC, int, int); +void XFillRectangle(Display *, Drawable, GC, int, int, + unsigned int, unsigned int); +Pixmap XCreatePixmap(Display *, Drawable, unsigned int, unsigned int, + unsigned int); +void XSync(Display *, Bool); +inline void XCopyArea(Display *, Drawable, Drawable, GC, int, int, + unsigned int, unsigned int, int, int); +int Read_PCX_to_Pixmap(Display *, Window, GC, char *, Pixmap *, Pixmap *); +int XpmReadFileToPixmap(Display *, Drawable, char *, Pixmap *, Pixmap *, + XpmAttributes *); +int XReadBitmapFile(Display *, Drawable, char *, + unsigned int *, unsigned int *, Pixmap *, int *, int *); +void XFreePixmap(Display *, Pixmap); +void XFreeGC(Display *, GC); +void XCloseDisplay(Display *); +void XNextEvent(Display *, XEvent *); +int XPending(Display *); +KeySym XLookupKeysym(XKeyEvent *, int); +void NetworkServer(int, int);