home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / WINUTILM.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  8KB  |  198 lines

  1. /* @(#)Z 1.7 com/src/ui/WinUtilM.h, odui, od96os2, odos29646d 96/11/15 15:29:31 (96/10/29 09:34:11) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odui
  6.  *
  7.  *   CLASSES:   WindowLink
  8.  *        WindowListIterator
  9.  *
  10.  *   ORIGINS: 82,27
  11.  *
  12.  *
  13.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  14.  *   All Rights Reserved
  15.  *   Licensed Materials - Property of IBM
  16.  *   US Government Users Restricted Rights - Use, duplication or
  17.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  18.  *       
  19.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  21.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  22.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  23.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  24.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  25.  *   OR PERFORMANCE OF THIS SOFTWARE.
  26.  */
  27. /*====END_GENERATED_PROLOG========================================
  28.  */
  29.  
  30. /********************************************************************/
  31. /*  Licensed Materials - Property of IBM                            */
  32. /*                                                                  */
  33. /*                                                                  */
  34. /* Copyright (C) International Business Machines Corp., 1994.       */
  35. /* Copyright (C) Apple Computer, Inc., 1994                         */
  36. /*                                                                  */
  37. /*  US Government Users Restricted Rights -                         */
  38. /*  Use, duplication, or disclosure restricted                      */
  39. /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  40. /*                                                                  */
  41. /*  IBM Change History (most recent first):                         */
  42. /*  <OS2>  02/20/96 jrb            Port DR4                         */
  43. /*  <OS2>  08/23/95 aml     133968 Port DR3                         */
  44. /*                                                                  */
  45. /********************************************************************/
  46. /*
  47.         File:           WinUtilM.h
  48.  
  49.         Contains:       Macintosh window utility functions and classes
  50.  
  51.         Owned by:       Richard Rodseth
  52.  
  53.         Copyright:      ⌐ 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  54.  
  55.         Change History (most recent first):
  56.  
  57.                  <5>     6/28/95        RR              1242642 BB Mostly ref counting. Added
  58.                                                                         WindowLink::ShouldRemove
  59.                  <4>     6/22/95        RR              #1245283 Undoable frame deletion
  60.                                                                         #1209427 Changed private api between
  61.                                                                         iterator and iteratee. Allow deletion while
  62.                                                                         iterating. Added fRemove flag to WindowLink
  63.                  <3>     5/25/95        jpa             List.h --> LinkList.h. Removed
  64.                                                                         GetNextWindow, which is now in Toolbox
  65.                                                                         <Windows.h> [1253324, 1241078]
  66.                  <2>     4/14/95        Té              With RR & CG: #1194507 DR/BB:title bar of a
  67.                                                                         draft window doesn't reveal it is a draft
  68.                                                                         or which draft it is.  Added
  69.                                                                         GetDraftNumFromDraft.
  70.                  <1>     6/16/94        RR              first checked in
  71.  
  72.         To Do:
  73.         In Progress:
  74.  
  75. */
  76.  
  77. #ifndef _WINUTILM_
  78. #define _WINUTILM_
  79.  
  80. #ifndef _LINKLIST_
  81. #include <LinkList.h>
  82. #endif
  83.  
  84. #ifndef _ODTYPES_
  85. #include "ODTypes.h"
  86. #endif
  87.  
  88. //==============================================================================
  89. // Classes used by this interface
  90. //==============================================================================
  91.  
  92. class ODWindow;
  93.  
  94. //==============================================================================
  95. // Function Prototypes
  96. //==============================================================================
  97.  
  98. #ifdef _PLATFORM_MACINTOSH_
  99. WindowPtr GetWindowList();
  100. void SetWindowList(WindowPtr theWindow);
  101. #endif
  102. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_)
  103. // Function to return the next window in the Z-order relative to the input
  104. // window
  105. WindowPtr NextWindow(WindowPtr theWindow);
  106. #endif
  107. #ifdef _PLATFORM_UNIX_
  108. // Function to return the next window in the Z-order relative to the input
  109. // window
  110. WindowPtr NextWindow(Window *windows,
  111.                      unsigned int num_windows,
  112.                      ODPlatformWindow theWindow);
  113. #endif
  114.  
  115. #ifdef _PLATFORM_MACINTOSH_
  116. void SetNextWindow(WindowPtr theWindow, WindowPtr nextWindow);
  117. #endif
  118. #if defined (_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_)
  119. // Function to return the topmost window on the desktop
  120. WindowPtr FrontWindow();
  121. #endif
  122. #ifdef _PLATFORM_UNIX_
  123. // Function to return the topmost window on the desktop
  124. WindowPtr FrontWindow(Screen *screen, Window **windows, unsigned int *num_windows);
  125. #endif
  126.  
  127. ODBoolean GetWindowHilite(WindowPtr theWindow);
  128. #ifdef _PLATFORM_MACINTOSH_
  129. void SetWindowHilite(WindowPtr theWindow, ODBoolean windowHilite);
  130. RgnHandle GetStructureRegion(WindowPtr theWindow);
  131. RgnHandle GetContentRegion(WindowPtr theWindow);
  132. #endif
  133. #ifdef _PLATFORM_UNIX_
  134. ODBoolean       GetWindowVisible(Display *display, WindowPtr theWindow);
  135. #else
  136. ODBoolean       GetWindowVisible(WindowPtr theWindow);
  137. #endif
  138. ODULong GetDraftNumFromDraft(Environment* ev, ODDraft* draft);
  139. //=====================================================================================
  140. // WindowLink
  141. //=====================================================================================
  142.  
  143. class WindowLink : public Link
  144. {
  145.         public:
  146.                 WindowLink(ODID windowID, ODWindow* window);
  147.                 ~WindowLink() {}
  148.  
  149.                 ODBoolean ShouldRemove();
  150.  
  151.                 ODID            fID;
  152.                 ODWindow* fWindow;
  153.                 ODBoolean fRemove;
  154. };
  155.  
  156. //=====================================================================================
  157. // WindowListIterator - iterates over the Window Manager window list. Iterating from
  158. // back to front using Last/Previous obviously results in several scans of the list,
  159. // as it's a singly-linked list
  160. //=====================================================================================
  161.  
  162.  
  163. class WindowListIterator
  164. {
  165. public:
  166.         WindowListIterator();
  167.         ~WindowListIterator();
  168.  
  169.         ODBoolean IsNotComplete();
  170.  
  171. #ifdef _PLATFORM_UNIX_
  172.         WindowPtr First(Screen *screen);
  173. #else
  174.         WindowPtr First();
  175. #endif
  176.  
  177.         WindowPtr Next();
  178.  
  179. #ifdef _PLATFORM_UNIX_
  180.         WindowPtr Last(Screen *screen);
  181. #else
  182.         WindowPtr Last();
  183. #endif
  184.  
  185.         WindowPtr Previous();
  186.  
  187. private:
  188.         WindowPtr fCurrentWindow;
  189. #ifdef _PLATFORM_UNIX_
  190.    Screen *screen;
  191.    Window *windows;
  192.    unsigned int num_windows;
  193. #endif
  194. };
  195.  
  196.  
  197. #endif //_WINUTILM_
  198.