
#var ModeSettings D(((MO_OPTIONS*const)(long)*(short*)((char*)MO_currentOptions+6)))
#var NULL D(((void*)0))
#var FALSE D(0)
#var TRUE D(1)

#var HANDLE typedef unsigned short HANDLE;
#var SCR_RECT typedef union{struct{unsigned char x0,y0,x1,y1;}xy;unsigned long l;}SCR_RECT;
#var SCR_STATE typedef struct{void*ScrAddr;unsigned char XMax,YMax;short CurFont,CurAttr,CurX,CurY;SCR_RECT CurClip;}SCR_STATE;
#var WIN_RECT typedef struct{short x0,y0,x1,y1;}WIN_RECT;
#var WINDOW typedef struct WindowStruct{unsigned short Flags;unsigned char CurFont;unsigned char CurAttr;unsigned char Background;short TaskId;short CurX,CurY;short CursorX,CursorY;SCR_RECT Client;SCR_RECT Window;SCR_RECT Clip;SCR_RECT Port;unsigned short DupScr;struct WindowStruct*Next;char*Title;SCR_STATE savedScrState;unsigned char Reserved[16];}WINDOW;
#var EVENT typedef struct EventStruct{unsigned short Type;unsigned short RunningApp;unsigned short Side;unsigned short StatusFlags;union{WINDOW*w;WIN_RECT*r;char*pasteText;HANDLE hPasteText;struct{unsigned short Mod;unsigned short Code;}Key;}extra;unsigned char StartType;}EVENT;
#var EVENT_HANDLER typedef void(*EVENT_HANDLER)(EVENT*)CALLBACK;
#var CM_IDLE D(1792)
#var CM_INIT D(1793)
#var CM_STARTTASK D(1794)
#var CM_ACTIVATE D(1795)
#var CM_FOCUS D(1796)
#var CM_UNFOCUS D(1797)
#var CM_DEACTIVATE D(1798)
#var CM_ENDTASK D(1799)
#var CM_START_CURRENT D(1800)
#var CM_DEFAULTS D(1803)
#var CM_KEYPRESS D(1808)
#var CM_MENU_CUT D(1824)
#var CM_MENU_COPY D(1825)
#var CM_MENU_PASTE D(1826)
#var CM_STRING D(1827)
#var CM_HSTRING D(1828)
#var CM_DEL D(1829)
#var CM_CLR D(1830)
#var CM_MENU_CLEAR D(1831)
#var CM_MENU_FIND D(1832)
#var CM_INSERT D(1840)
#var CM_BLINK D(1856)
#var CM_STORE D(1872)
#var CM_RECALL D(1873)
#var CM_WPAINT D(1888)
#var CM_MENU_OPEN D(1904)
#var CM_MENU_SAVE D(1905)
#var CM_MENU_NEW D(1906)
#var CM_MENU_FORMAT D(1907)
#var CM_MENU_ABOUT D(1908)
#var CM_MODE_CHANGE D(1920)
#var CM_SWITCH_GRAPH D(1921)
#var CM_GEOMETRY D(1984)

#var MO_OPTIONS typedef struct{unsigned short CurrentFolder;unsigned short SplitScreen;unsigned short NumGraphs;unsigned short Graph1;unsigned short Graph2;unsigned short Split1App;unsigned short Split2App;unsigned short SplitRatio;unsigned short Angle;unsigned short ExactApprox;unsigned short Fix;unsigned short Exp;unsigned short Vector;unsigned short Complex;unsigned short Pretty;unsigned short Base;unsigned short UnitSystem;unsigned short CustomUnits;}MO_OPTIONS;
#var PAINTING_ENABLED D(0)
#var PAINTING_SUSPENDED D(2)

#var ACTIVITY_IDLE D(0)
#var ACTIVITY_BUSY D(1)
#var ACTIVITY_PAUSED D(2)
#var ACTIVITY_NORMAL D(3)

#var AP_NULL D(-3)
#var AP_RUNNING D(-2)
#var AP_CURRENT D(-1)

#var AP_START_CURRENT D(0)
#var __AP_START_NEW_2 D(1)
#var __AP_START_OPEN_2 D(2)
#var __AP_START_ERROR_2 D(3)
#var __AP_START_NEW_1 D(16)
#var __AP_START_OPEN_1 D(32)
#var __AP_START_ERROR_1 D(48)

#var SDT_EXPR D(0)
#var SDT_LIST D(1)
#var SDT_MAT D(2)
#var SDT_FUNC D(3)
#var SDT_PRGM D(4)
#var SDT_PIC D(5)
#var SDT_STR D(6)
#var SDT_TEXT D(7)
#var SDT_GDB D(8)
#var SDT_DATA D(9)
#var SDT_FIG D(10)
#var SDT_MAC D(11)
#var SDT_OTH D(12)
#var SDT_SYS D(13)
#var SDT_ALL D(14)
#var SDT_ASM D(15)

#var WF_SYS_ALLOC D(1)
#var WF_STEAL_MEM D(2)
#var WF_DONT_REALLOC D(4)
#var WF_ROUNDEDBORDER D(8)
#var WF_SAVE_SCR D(16)
#var WF_DUP_SCR D(32)
#var WF_TTY D(64)
#var WF_ACTIVE D(128)
#var WF_NOBORDER D(256)
#var WF_NOBOLD D(512)
#var WF_DUP_ON D(1024)
#var WF_VIRTUAL D(2048)
#var WF_TITLE D(4096)
#var WF_DIRTY D(8192)
#var WF_TRY_SAVE_SCR D(16400)
#var WF_VISIBLE D(-32768)

#var EV_hook D((*((EVENT_HANDLER*)(_rom_call_addr(2A3)))))
#var ABT_dialog D(_rom_call(void,(void),10D))
#var CAT_dialog D(_rom_call(void,(void),125))
#var EV_captureEvents D(_rom_call(EVENT_HANDLER,(EVENT_HANDLER),C6))
#var EV_centralDispatcher D(_rom_call(void,(void),156))
#var EV_clearPasteString D(_rom_call(void,(void),C7))
#var EV_defaultHandler D(_rom_call(void,(EVENT*),157))
#var EV_eventLoop D(_rom_call(void,(void),158))
#var EV_getAppID short EV_getAppID(const char*)__ATTR_LIB_ASM__;
#var EV_getc D(_rom_call(unsigned short,(short,EVENT*),C8))
#var EV_getSplitRect D(_rom_call(WIN_RECT*,(short),C9))
#var EV_notifySwitchGraph D(_rom_call(void,(void),CA))
#var EV_paintOneWindow D(_rom_call(short,(void),CB))
#var EV_paintWindows D(_rom_call(void,(void),CC))
#var EV_registerMenu D(_rom_call(void,(void*),159))
#var EV_restorePainting D(_rom_call(short,(short),CD))
#var EV_sendEvent D(_rom_call(void,(short,EVENT*),CE))
#var EV_sendEventSide D(_rom_call(void,(short,EVENT*,short),CF))
#var EV_sendString D(_rom_call(void,(short),D0))
#var EV_setCmdCheck D(_rom_call(void,(short,short),D1))
#var EV_setCmdState D(_rom_call(void,(short,short),D2))
#var EV_setFKeyState D(_rom_call(void,(short,short,short),D3))
#var EV_startApp D(_rom_call(void,(short,short),D4))
#var EV_startSide D(_rom_call(void,(__pshort,short,short),D5))
#var EV_startTask D(_rom_call(void,(short),D6))
#var EV_suspendPainting D(_rom_call(short,(void),D7))
#var EV_switch D(_rom_call(void,(void),D8))
#var handleRclKey D(_rom_call(void,(short),14F))
#var MO_currentOptions D(_rom_call(void,(void),D9))
#var MO_defaults D(_rom_call(void,(void),DA))
#var MO_digestOptions D(_rom_call(void,(short),DB))
#var MO_isMultigraphTask D(_rom_call(short,(short),DC))
#var MO_modeDialog D(_rom_call(void,(void),DD))
#var MO_notifyModeChange D(_rom_call(void,(short),DE))
#var MO_sendQuit D(_rom_call(void,(short,short),DF))


#var AP_START_NEW D((AMS_1xx?__AP_START_NEW_1:__AP_START_NEW_2))
#var AP_START_OPEN D((AMS_1xx?__AP_START_OPEN_1:__AP_START_OPEN_2))
#var AP_START_ERROR D((AMS_1xx?__AP_START_ERROR_1:__AP_START_ERROR_2))
