home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmos2002.zip / DEF / multiscr.def < prev    next >
Text File  |  1998-01-23  |  4KB  |  86 lines

  1. DEFINITION MODULE MultiScreen;
  2.  
  3.         (********************************************************)
  4.         (*                                                      *)
  5.         (*      This module allows the creation of multiple     *)
  6.         (*      virtual screens - complete screens, not just    *)
  7.         (*      windows - with two keyboard "hot keys" used     *)
  8.         (*              to navigate around the screens.         *)
  9.         (*                                                      *)
  10.         (*      We support a two-level hierarchy: a virtual     *)
  11.         (*      screen is a collection of windows, and each     *)
  12.         (*      virtual screen is a member of a group.  (In     *)
  13.         (*      addition, there is a pseudo-group made up of    *)
  14.         (*      all windows which are not associated with       *)
  15.         (*      any virtual screen, to handle the "normal       *)
  16.         (*      output" which bypasses this module.)  One       *)
  17.         (*      hot key cycles through the groups, and the      *)
  18.         (*      second cycles through the virtual screens of    *)
  19.         (*      the currently active group.                     *)
  20.         (*                                                      *)
  21.         (*      In the present version, the client module has   *)
  22.         (*      to call EnableHotKeys to define and activate    *)
  23.         (*      the hot keys.                                   *)
  24.         (*                                                      *)
  25.         (*  Programmer:         P. Moylan                       *)
  26.         (*  Last edited:        23 January 1998                 *)
  27.         (*  Status:             OK                              *)
  28.         (*                                                      *)
  29.         (********************************************************)
  30.  
  31. FROM Windows IMPORT
  32.     (* type *)  Window, DisplayPage;
  33.  
  34. TYPE ScreenGroup;       (* is private *)
  35.      VirtualScreen;     (* is private *)
  36.  
  37. PROCEDURE EnableHotKeys (flag1: BOOLEAN;  key1: CHAR;
  38.                          flag2: BOOLEAN;  key2: CHAR);
  39.  
  40.     (* Creates the "hot key" tasks, and enable the hot keys.  The first *)
  41.     (* pair of parameters defines the group switching hot key, and the  *)
  42.     (* second pair defines the hot key for cycling within a group.      *)
  43.     (* The "flag" part of each parameter pair is FALSE for a normal     *)
  44.     (* key, and TRUE for an extended key defined by a two-character     *)
  45.     (* sequence (where the first character is CHR(0).                   *)
  46.  
  47. PROCEDURE CreateScreenGroup (hardwarepage: DisplayPage): ScreenGroup;
  48.  
  49.     (* Creates a new screen group, and maps it to the specified display *)
  50.     (* page in the screen hardware.  It is permissible to map more than *)
  51.     (* one group to the same hardware page.  Note that any group on     *)
  52.     (* hardware page 0 shares the screen with "normal output" which     *)
  53.     (* does not belong to any virtual page.  This is permitted, but     *)
  54.     (* on aesthetic grounds is usually not a good idea.                 *)
  55.  
  56. PROCEDURE CreateVirtualScreen (group: ScreenGroup): VirtualScreen;
  57.  
  58.     (* Adds a new virtual screen to the specified group.        *)
  59.  
  60. PROCEDURE MapToVirtualScreen (w: Window;  screen: VirtualScreen);
  61.  
  62.     (* Before calling this procedure, both w and screen must have been  *)
  63.     (* created.  This procedure ensures that window w is visible on     *)
  64.     (* the screen only when the given virtual screen page is active.    *)
  65.     (* The association lasts until the window is closed or the virtual  *)
  66.     (* screen is removed.                                               *)
  67.  
  68. PROCEDURE VirtualScreenOf (w: Window): VirtualScreen;
  69.  
  70.     (* Returns the virtual screen, if any, with which window w is       *)
  71.     (* associated.  It is possible that no such association exists, in  *)
  72.     (* which case we return a NIL result.                               *)
  73.  
  74. PROCEDURE RemoveVirtualScreen (VAR (*INOUT*) screen: VirtualScreen);
  75.  
  76.     (* Destroys all associations between the given virtual screen and   *)
  77.     (* its windows (but does not close the windows), and permanently    *)
  78.     (* removes this screen from the collection of virtual screens.      *)
  79.  
  80. PROCEDURE RemoveScreenGroup (VAR (*INOUT*) group: ScreenGroup);
  81.  
  82.     (* As above, but removes an entire group.   *)
  83.  
  84. END MultiScreen.
  85.  
  86.