1¾«0::::;<EWAN Emulation DLL interface 1.1 function EmulStart( hInWindow: HWND; pInPos: PPoint ): PTermBase;export; Should be called before any other calls is made that take a PTermBase pointer. Returns a far pointer. Should be considered a session specific handle. function EmulEnd( hInWindow: HWND; pInTolk: PTermBase ): integer;export; Will be called when the DLL is to be unloaded. Return 0; (Purpouse to be defined) function EmulationName( pInTolk: PTermBase ):PChar;export; Return the name of the emulation for this instance of the interpreter. If argument is NULL (nil), return the default name. function NewBlock( pTolk : PTermBase; pIn: PChar; wInSize: Word ): integer; export; New raw data from port. To be interpreded. Return 0; (Purpouse to be defined) function GetBlockCount( pTolk : PTermBase ):Word;export; Number of calls to be made to GetBlock to recieve all buffered commands from the DLL. function GetBlock( pTolk : PTermBase; pIn: PChar ):integer;export; Return next block of cmd + size + data sequences. One cmd sequence/block. The entire structure may not be bigger than 1024 bytes! Return 0; (Purpouse to be defined) function NewKeyDown( pTolk : PTermBase; pInMsg: PMessage ):integer;export; Generated by WM_KEYDOWN. pInMsg is a pointer to a TMessage struct. Returns: 0: Not interpreted 1: Has meaning for this emulation (just for the programs information) TMessage = record Receiver: HWnd; Message: Word; case Integer of 0: (WParam: Word; LParam: Longint; Result: Longint); 1: (WParamLo: Byte; WParamHi: Byte; LParamLo: Word; LParamHi: Word; ResultLo: Word; ResultHi: Word); end; function MapKey( pTolk : PTermBase; pInMsg: PMessage ):integer;export; Generated by WM_CHAR Returns: 1: Send this character as usual 2: Dont send this character function SetupEmulation( pTolk : PTermBase; hInWindow: HWnd ):integer;export; Show configuration dialog with aboutbox and such. hInWindow is the parent windowhandle. Return 0; (Purpouse to be defined) function Version( VAR iUtVerMaj, iUtVerMin: Word ):integer;export; Return supported functionset and commandset. This version is Maj 1 Min 1 Return 0; (Purpouse to be defined) procedure LoadConfig( pTolk : PTermBase; pInNamn : PChar );export; Load the configuration for the instance identified by pTolk, and the name pInNamn. procedure SaveConfig( pTolk : PTermBase; pInNamn : PChar );export; Save the configuration for the instance identified by pTolk, and the name pInNamn. All pointers is far pointers. All function uses "far pascal" calling convention. GetBlock returns a record like this: record { Identify the type of action to be taken. } iCmd : integer; { size of data } iSize : integer; { Never more than 1024-4=1020 bytes! } data : array[0..0]; end; To make characters to be typed in tty manner this will look like: cmd := CMD_TEXT; { CMD_TEXT id a integer constant = 0 } iSize := 12; StrCopy( @data, 'Hello world!' ); List of recognized commands sent by GetBlock const CMD_TEXT = $00; { Data is text to show on screen } CMD_CURPOS = $01; { 2 integer, Y + X koord absolute cur pos} CMD_CUR2EOL = $02; CMD_CR = $03; CMD_LF = $04; CMD_DELLEFT = $05; { Nondestructive } CMD_TAB = $06; CMD_UP = $07; { 1 integer repeat count, 1 int as boolean - should scrolling occur? } CMD_RIGHT = $08; { 1 integer repeat count, 1 int as boolean - should scrolling occur? } CMD_DOWN = $09; { 2 bytes repeat cnt } CMD_LEFT = $0A; { 2 bytes repeat cnt } CMD_DELLEFTDESTRUCTIVE = $0B; { Clear position to the left of the cursor and move cursor} CMD_CLRSCR = $10; { Clear screen } CMD_CLREOL = $11; { Clear from cursor to end of line } CMD_CLREOS = $12; { Clear from cursor to end of screen } CMD_CLRLINCUR = $13; { Clear line to cursor } CMD_CLRSCNCUR = $14; { Clear from top of screen to cursor } CMD_CLRLIN = $15; { 1 integer repeat cnt } CMD_INSLIN = $16; { 1 integer repeat cnt } CMD_DELLIN = $17; { 1 integer repeat cnt } CMD_FGCOL = $20; { CharColor struct } CMD_BGCOL = $21; CMD_ATTRIB = $22; CMD_DEFFGCOL = $23; CMD_DEFBGCOL = $24; CMD_SAVEPOS = $30; { Cursorpos } CMD_RESTOREPOS = $31; CMD_SCROLLRGN = $40; { 2 integers. Topline bottomline. 0, 23 default for Vt100 } CMD_SETTAB = $41; { At cursor pos } CMD_CLEARTAB = $42; { At cursor pos } CMD_CLEARTABS = $43; { All } CMD_SEND = $A0; { send data to outport } {Screen attributes} ATTRIB_NORMAL = $0; { Reset all attributes } ATTRIB_UNDERLINE = $1; ATTRIB_BOLD = $2; ATTRIB_ITALIC = $4; ATTRIB_BLINK = $8; ATTRIB_REVERSE = $10; ATTRIB_NOUNDERLINE = $81; ATTRIB_NOBOLD = $82; ATTRIB_NOITALIC = $84; ATTRIB_NOBLINK = $88; ATTRIB_NOREVERSE = $90; type PCharColor = ^CharColor; CharColor = record Fg : longint; { RGB() format } Bg : longint; end; Function name DLL function index # EmulStart index 1, EmulEnd index 2, NewBlock index 3, GetBlockCount index 4, GetBlock index 5, SetupEmulation index 6, EmulationName index 7, NewKeyDown index 8, Version index 9, MapKey index 10, LoadConfig index 14, SaveConfig index 15; WParamHi: Byte; LParamLo: Word; LParamHi: Word; ResultLo: Word; ResultHi€ w¤sìoŽkÖg4cn_õ[HW¢SÚO9KT`L 9{w0szo™kßgHc•_ [a WÜ S Oz KT`L z ¼ wn s’ n– jY f bA ]ÊYîTòPüLH €¢ÿÿ¤ÿÿîÿÿðÿÿBÿÿŒÿÿŽÿÿØÿÿÚÿÿ ÿÿ2ÿÿ4ÿÿpÿÿrÿÿ¼ÿÿóÿÿõÿÿJÿÿLÿÿzÿÿz ÿÿ¢ÿÿÜÿÿÞÿÿ7ÿÿ9ÿÿ}ÿÿÿÿµÿÿÿÿ.ÿÿ0ÿÿ|ÿÿ~ÿÿ›ÿÿÈÿÿëÿÿ4ÿÿ6ÿÿKÿÿKaÿÿvÿÿŒÿÿ¦ÿÿÃÿÿáÿÿýÿÿÿÿ5ÿÿQÿÿmÿÿŠÿÿ•ÿÿ—ÿÿ™ÿÿáÿÿãÿÿûÿÿ'ÿÿFÿÿFHÿÿ—ÿÿ™ÿÿÎÿÿ÷ÿÿ ÿÿ ÿÿc ÿÿe ÿÿ• ÿÿ´ ÿÿÚ ÿÿÜ ÿÿ ÿÿ" ÿÿx ÿÿz ÿÿ¾ ÿÿÀ ÿÿ ÿÿ  ÿÿ ÿÿl ÿÿn ÿÿ” ÿÿ– ÿÿŸ ÿÿÎ ÿÿã ÿÿö ÿÿ ÿÿ7 ÿÿP ÿÿW ÿÿY ÿÿœ ÿÿØ ÿÿè ÿÿ ÿÿ ÿÿ  ÿÿ ÿÿA ÿÿC ÿÿJ ÿÿ ÿÿƒ ÿÿÄ ÿÿÙ ÿÿê ÿÿû ÿÿ$ÿÿ6ÿÿÿÿ ÿÿ4ÿÿ_ÿÿºÿÿ¼ÿÿãÿÿãÿÿ[ÿÿŒÿÿËÿÿúÿÿ)ÿÿXÿÿZÿÿ„ÿÿ˜ÿÿ­ÿÿÅÿÿÛÿÿÝÿÿÿÿÿÿÿÿvÿÿžÿÿÇÿÿÇçÿÿéÿÿëÿÿÿÿÿÿ/ÿÿ1ÿÿaÿÿzÿÿÿÿ¥ÿÿ»ÿÿÓÿÿÕÿÿðÿÿÿÿ ÿÿ8ÿÿRÿÿTÿÿTZÿÿtÿÿˆÿÿ¬ÿÿ¾ÿÿÄÿÿÆÿÿÈÿÿÊÿÿðÿÿòÿÿÿÿÿÿ0ÿÿHÿÿ]ÿÿvÿÿŽÿÿ¤ÿÿ¸ÿÿ¸ÌÿÿÎÿÿåÿÿüÿÿþÿÿÿÿÿÿÿÿÊÿÿðÿÿòÿÿÿÿÿÿ0ÿÿHÿÿ]ÿÿvÿÿŽÿÿ¤ÿÿ¸ÿÿÈK8tive } CMD_TAB = $06; CMD_UP = $07; { 1 integer repeat count, 1 int as boolean - shoul Arial 0Courier New CMD_RIGHT = $08; { 1 integer repeat count, 1 int as boolean - should scrolling o