Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
Epsilon User's Manual and Reference
   Primitives and EEL Subroutines
      Buffer Primitives
         Changing Buffer Contents
         Moving Text Between Buffers
         Getting Text from a Buffer
         . . .
         Listing Buffers
      Display Primitives
         Creating & Destroying Windows
         Window Resizing Primitives
         Preserving Window Arrangements
         Pop-up Windows
         Pop-up Window Subroutines
         . . .
      File Primitives
         File Reading Primitives
         File Writing Primitives
         Line Translation Primitives
         . . .
         Tagging Internals
      . . .

Previous   Up    Next
Window Resizing Primitives  Primitives and EEL Subroutines   Pop-up Windows


Epsilon User's Manual and Reference > Primitives and EEL Subroutines > Display Primitives >

Preserving Window Arrangements

struct window_info {
        short left, top, right, bottom;
        short textcolor, hbordcolor;
        short vbordcolor, titlecolor;
        short borders, other, bufnum;
        int point, dpoint;
        /* primitives fill in before this line */
        int dcolumn;
        short prevbuf;
};

get_window_info(int win, struct window_info *p)
low_window_info(int win, struct window_info *p)
window_create(int first, struct window_info *p)
low_window_create(int first, struct window_info *p)
select_low_window(int wnum, int top, int bot,
                  int lines, int cols)

Epsilon has several primitives that are useful for recording a particular window configuration and reconstructing it later.

The get_window_info( ) subroutine fills a structure with information on the specified window. The information includes the window's size and position, its selected colors, and so forth. It uses the low_window_info( ) primitive to collect some of the information, then fills in the rest itself by inspecting the window.

After calling get_window_info( ) on each tiled window (obtaining a series of structures, each holding information on one window), you can restore that window configuration using the window_create( ) subroutine. It takes a pointer to a structure that get_window_info( ) filled in, and a flag that must be nonzero if this is the first window in the new configuration. It uses the low_window_create( ) primitive to create the window. The point or dpoint members of the structure may be -1 when you call window_create( ) or low_window_create( ), and Epsilon will provide default values for point and window_start in the new window, based on values stored with the buffer. The window-creating functions remain in the window they create, so you can modify its window-specific variables.

After a series of window_create( )'s, you must use the select_low_window( ) primitive to switch to one of the created windows (specifying it by window number or handle, as usual).

Using window_create( ) directly modifies windows, and Epsilon doesn't check that the resulting window configuration is legal. For example, you can define a set of tiled windows that leave gaps on the screen, overlap, or extend past the screen borders. The result of creating an illegal window configuration is undefined.

The first time you call window_create( ), pass it a nonzero flag, and Epsilon will (internally) delete all tiled windows, and create the first window. Then call window_create( ) again, as needed, to create the remaining windows (pass it a zero flag). Finally, you must call the select_low_window( ) primitive. Once you begin using window_create( ), Epsilon will not be able to refresh the screen correctly until you call the select_low_window( ) primitive to exit window-creation. The top and bot parameters specify the new values of the avoid-top-lines and avoid-bottom-lines variables, and set the variables to the indicated values while finishing window creation. The lines and cols parameters specify the size of the screen that was used to construct the old window configuration. All windows defined using low_window_create( ) are based on that screen size. When you call select_low_window( ), Epsilon resizes all the windows you've defined so that they fit the current screen size.

save_screen(struct screen_info *p)
restore_screen(struct screen_info *p)

The save_screen( ) subroutine saves Epsilon's window configuration in a struct screen_info structure. The first time you call this subroutine on an instance of the screen_info structure, make sure its wins member is zero. The restore_screen( ) subroutine restores Epsilon's window configuration from such a structure.



Previous   Up    Next
Window Resizing Primitives  Primitives and EEL Subroutines   Pop-up Windows


Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.