-#ifndef MSDOS
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-#include <X11/Xos.h>
-#include <X11/Intrinsic.h>
-#include <X11/keysymdef.h>
-#endif
-
-#ifdef USE_SDL_LIBRARY
-#include "sdl.h"
-#endif
-
-#ifdef USE_SDL_LIBRARY
-
-typedef SDL_Surface *Bitmap;
-typedef SDL_Surface *DrawWindow;
-typedef SDL_Surface *DrawBuffer;
-
-typedef SDLKey Key;
-
-typedef SDL_Event Event;
-typedef SDL_MouseButtonEvent ButtonEvent;
-typedef SDL_MouseMotionEvent MotionEvent;
-typedef SDL_KeyboardEvent KeyEvent;
-typedef XExposeEvent ExposeEvent;
-typedef XFocusChangeEvent FocusChangeEvent;
-typedef XClientMessageEvent ClientMessageEvent;
-
-#define EVENT_BUTTONPRESS SDL_MOUSEBUTTONDOWN
-#define EVENT_BUTTONRELEASE SDL_MOUSEBUTTONUP
-#define EVENT_MOTIONNOTIFY SDL_MOUSEMOTION
-#define EVENT_KEYPRESS SDL_KEYDOWN
-#define EVENT_KEYRELEASE SDL_KEYUP
-#define EVENT_EXPOSE SDL_USEREVENT + 0
-#define EVENT_FOCUSIN SDL_USEREVENT + 1
-#define EVENT_FOCUSOUT SDL_USEREVENT + 2
-#define EVENT_CLIENTMESSAGE SDL_QUIT
-#define EVENT_MAPNOTIFY SDL_USEREVENT + 4
-#define EVENT_UNMAPNOTIFY SDL_USEREVENT + 5
-
-#define KEY_UNDEFINED SDLK_UNKNOWN
-
-#define KEY_Return SDLK_RETURN
-#define KEY_Escape SDLK_ESCAPE
-
-#define KEY_Left SDLK_LEFT
-#define KEY_Right SDLK_RIGHT
-#define KEY_Up SDLK_UP
-#define KEY_Down SDLK_DOWN
-
-#ifdef SDLK_KP_LEFT
-#define KEY_KP_Left SDLK_KP_LEFT
-#define KEY_KP_Right SDLK_KP_RIGHT
-#define KEY_KP_Up SDLK_KP_UP
-#define KEY_KP_Down SDLK_KP_DOWN
-#endif
-
-#define KEY_KP_Enter SDLK_KP_ENTER
-#define KEY_KP_Add SDLK_KP_PLUS
-#define KEY_KP_Subtract SDLK_KP_MINUS
-#define KEY_KP_Multiply SDLK_KP_MULTIPLY
-#define KEY_KP_Divide SDLK_KP_DIVIDE
-#define KEY_KP_Separator SDLK_KP_PERIOD
-
-#define KEY_Shift_L SDLK_LSHIFT
-#define KEY_Shift_R SDLK_RSHIFT
-#define KEY_Control_L SDLK_LCTRL
-#define KEY_Control_R SDLK_RCTRL
-#define KEY_Meta_L SDLK_LMETA
-#define KEY_Meta_R SDLK_RMETA
-#define KEY_Alt_L SDLK_LALT
-#define KEY_Alt_R SDLK_RALT
-#define KEY_Mode_switch SDLK_MODE
-#define KEY_Multi_key KEY_UNDEFINED /* undefined */
-
-#define KEY_BackSpace SDLK_BACKSPACE
-#define KEY_Delete SDLK_DELETE
-#define KEY_Insert SDLK_INSERT
-#define KEY_Tab SDLK_TAB
-#define KEY_Home SDLK_HOME
-#define KEY_End SDLK_END
-#define KEY_Page_Up SDLK_PAGEUP
-#define KEY_Page_Down SDLK_PAGEDOWN
-
-#define KEY_space SDLK_SPACE
-#define KEY_exclam SDLK_EXCLAIM
-#define KEY_quotedbl SDLK_QUOTEDBL
-#define KEY_numbersign SDLK_HASH
-#define KEY_dollar SDLK_DOLLAR
-#define KEY_percent KEY_UNDEFINED /* undefined */
-#define KEY_ampersand SDLK_AMPERSAND
-#define KEY_apostrophe SDLK_QUOTE
-#define KEY_parenleft SDLK_LEFTPAREN
-#define KEY_parenright SDLK_RIGHTPAREN
-#define KEY_asterisk SDLK_ASTERISK
-#define KEY_plus SDLK_PLUS
-#define KEY_comma SDLK_COMMA
-#define KEY_minus SDLK_MINUS
-#define KEY_period SDLK_PERIOD
-#define KEY_slash SDLK_SLASH
-
-#define KEY_colon SDLK_COLON
-#define KEY_semicolon SDLK_SEMICOLON
-#define KEY_less SDLK_LESS
-#define KEY_equal SDLK_EQUALS
-#define KEY_greater SDLK_GREATER
-#define KEY_question SDLK_QUESTION
-#define KEY_at SDLK_AT
-
-#define KEY_bracketleft SDLK_LEFTBRACKET
-#define KEY_backslash SDLK_BACKSLASH
-#define KEY_bracketright SDLK_RIGHTBRACKET
-#define KEY_asciicircum SDLK_CARET
-#define KEY_underscore SDLK_UNDERSCORE
-#define KEY_grave SDLK_BACKQUOTE
-
-#define KEY_quoteleft KEY_UNDEFINED /* undefined */
-#define KEY_braceleft KEY_UNDEFINED /* undefined */
-#define KEY_bar KEY_UNDEFINED /* undefined */
-#define KEY_braceright KEY_UNDEFINED /* undefined */
-#define KEY_asciitilde KEY_UNDEFINED /* undefined */
-
-#define KEY_Adiaeresis SDLK_WORLD_36
-#define KEY_Odiaeresis SDLK_WORLD_54
-#define KEY_Udiaeresis SDLK_WORLD_60
-#define KEY_adiaeresis SDLK_WORLD_68
-#define KEY_odiaeresis SDLK_WORLD_86
-#define KEY_udiaeresis SDLK_WORLD_92
-#define KEY_ssharp SDLK_WORLD_63