From ff7e5dba2b72caada97e0715d200994e290fb043 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Mon, 12 Mar 2007 06:43:18 +0000 Subject: [PATCH] More implementation details. --- IMPLEMNT | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/IMPLEMNT b/IMPLEMNT index bdabe6b6..580f1726 100644 --- a/IMPLEMNT +++ b/IMPLEMNT @@ -136,7 +136,7 @@ here. Returns OK or ERR, which is passed on by the caller. int PDC_mouse_set(void); Called by mouse_set(), mouse_on(), and mouse_off() -- all the functions -that modifiy SP->_trap_mbe. If your platform needs to do anything in +that modify SP->_trap_mbe. If your platform needs to do anything in response to a change in SP->_trap_mbe (for example, turning the mouse cursor on or off), do it here. Returns OK or ERR, which is passed on by the caller. @@ -169,8 +169,16 @@ except checking for values out of range. void PDC_reset_prog_mode(void); +The non-portable functionality of reset_prog_mode() is handled here -- +whatever's not done in _restore_mode(). In current ports: In OS/2, this +sets the keyboard to binary mode; in Win32, it enables or disables the +mouse pointer to match the saved mode; in others it does nothing. + void PDC_reset_shell_mode(void); +The same thing, for reset_shell_mode(). In OS/2 and Win32, it restores +the default console mode; in others it does nothing. + int PDC_resize_screen(int nlines, int ncols); This does the main work of resize_term(). It may respond to non-zero @@ -182,10 +190,22 @@ action for the platform. void PDC_restore_screen_mode(int i); +Called from _restore_mode() in kernel.c, this function does the actual +mode changing, if applicable. Currently used only in DOS and OS/2. + void PDC_save_screen_mode(int i); +Called from _save_mode() in kernel.c, this function saves the actual +screen mode, if applicable. Currently used only in DOS and OS/2. + void PDC_scr_close(void); +The platform-specific part of endwin(). It may restore the image of the +original screen saved by PDC_scr_open(), if the PDC_RESTORE_SCREEN +environment variable is set; either way, if using an existing terminal, +this function should restore it to the mode it had at startup, and move +the cursor to the lower left corner. (The X11 port does nothing.) + void PDC_scr_free(void); Frees the memory for SP and pdc_atrtab allocated by PDC_scr_open(). @@ -193,6 +213,20 @@ Called by delscreen(). int PDC_scr_open(int argc, char **argv); +The platform-specific part of initscr(). It's actually called from +Xinitscr(); the arguments, if present, correspond to those used with +main(), and may be used to set the title of the terminal window, or for +other, platform-specific purposes. (The arguments are currently used +only in X11.) PDC_scr_open() must allocate memory for SP and pdc_atrtab, +and must initialize acs_map[] (unless it's preset) and several members +of SP, including lines, cols, mouse_wait, orig_attr (and if orig_attr is +TRUE, orig_fore and orig_back), mono, _restore and _preserve. (Although +SP and pdc_atrtab are used the same way in all ports, they're allocated +here in order to allow the X11 port to map them to a block of shared +memory.) If using an existing terminal, and the environment variable +PDC_RESTORE_SCREEN is set, this function may also store the existing +screen image for later restoration by PDC_scr_close(). + pdcsetsc.c: -----------