% % TNT interface for GNU Emacs. % % Author: Chris Maio % Modified: Don Hopkins % Last edit: 14 Sep 1990 % PS -> C message tags #define tRepairWindow 1 #define tGetWinInfo 2 #define tWinResized 3 #define tKeyboardInput 4 #define tMetaKeyDown 5 #define tEmacsInput 6 #define tEmacsInsert 7 #define tEmacsCommand 8 #define tEmacsTrack 9 #define tEmacsSelect 10 #define tDebugMessage 11 #define tHaveEmacsEvent 12 #define tReadEmacsEvent 13 cdef InitializeCable() cdef InitializeWire() /is_v3? systemdict /knownpackage known def is_v3? { /Courier findfont 12 scalefont setfont /NeWS 3 0 knownpackage not { /NeWS 3 0 findpackage beginpackage } if /TNTCore 3 0 knownpackage not { /TNTCore 3 0 findpackage beginpackage /TNT 3 0 findpackage beginpackage } if } if #if 1 (tntlib/emacs18/tnt.ps) LoadFile not { %(% This must be a string so //name gets evaluated at the right time. %#include "tnt.ps" %) cvx exec beep (Can't find tntlib/emacs18/tnt.ps\n) print flush quit } if #else #include "tnt.ps" #endif % create the initial window /startemacswindow ClassEmacsCanvas send % Emacs takes over here % C interface cdef DefineTag(name, value) name value DT cdef GetWinInfo(width, height, font_CharWidth, font_BaseLine, font_LineHeight) GW => tGetWinInfo(width, height, font_CharWidth, font_BaseLine, font_LineHeight) cdef WinResized(width, height, font_CharWidth, font_BaseLine, font_LineHeight) => tWinResized(width, height, font_CharWidth, font_BaseLine, font_LineHeight) cdef RepairWindow(x0, y0, x1, y1) => tRepairWindow(y1, x1, y0, x0) cdef KeyboardInput(c) => tKeyboardInput(c) cdef MetaKeyDown(c) => tMetaKeyDown(c) cdef EmacsInsert(string s) => tEmacsInsert(s) cdef EmacsCommand(string s) => tEmacsCommand(s) cdef EmacsInput(string s) => tEmacsInput(s) cdef EmacsTrack(name, action, x, y) => tEmacsTrack(name, action, x, y) cdef EmacsSelect(name, action, x, y) => tEmacsSelect(name, action, x, y) cdef DebugMessage(string s) => tDebugMessage(s) cdef HaveEmacsEvent(int size) => tHaveEmacsEvent cdef ReadEmacsEvent(string name, action, canvas, clientdata, x, y, time) => tReadEmacsEvent(name, action, canvas, clientdata, x, y, time) cdef BeginRepair() BR cdef EndRepair() ER cdef ClearScreen() CL cdef Flash() ^G cdef ClearToEOL(x, y) x y CE cdef InvertToEOL(x, y) x y FI cdef InsertLines(y, n) y n IL cdef InsertLines2(y, z, n) y z n IL2 cdef DeleteLines(y, n) y n DL cdef DeleteLines2(y, z, n) y z n DL2 cdef DeleteChars(x, y, n) x y n DC cdef InsertChars(x, y, n) x y n IC cdef ToggleCursor(x, y) x y CT cdef Show(x, y, cstring s) s x y S cdef ShowInverted(x, y, cstring s) s x y SI cdef ClearShow(x, y, n, y2, cstring s) s x y2 n x y CS cdef ClearShowInverted(x, y, n, y2, cstring s) s x y2 n x y CSI cdef SendPS (cstring s, resp) s resp DO cdef SetStuff (bool) bool ST cdef SetFont(cstring f, n) f n SF cdef SetOrigin(x, y) x y SO cdef SetDimensions(w, h) w h SD cdef SetFrameLabel(cstring s) s FL cdef SetSelection(rank, size, cstring s) rank size s SS cdef StartInput() IP cdef MapWindow() MW cdef ReshapeWindow() RW cdef InteractiveMove() IM cdef RetainWindow(n) n RT cdef ResetCanvas() RC