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

  1. //====START_GENERATED_PROLOG====================================== 
  2. // 
  3. // 
  4. //   COMPONENT_NAME: odutils 
  5. // 
  6. //   CLASSES: none 
  7. // 
  8. //   ORIGINS: 82,27 
  9. // 
  10. // 
  11. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996 
  12. //   All Rights Reserved 
  13. //   Licensed Materials - Property of IBM 
  14. //   US Government Users Restricted Rights - Use, duplication or 
  15. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
  16. //        
  17. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
  18. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
  19. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR 
  20. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 
  21. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
  22. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE 
  23. //   OR PERFORMANCE OF THIS SOFTWARE. 
  24. // 
  25. //====END_GENERATED_PROLOG======================================== 
  26. // 
  27. // @(#) 1.9 com/src/utils/include/WinUtils.h, odutils, od96os2, odos29646d 9/12/96 15:15:23 [ 11/15/96 15:29:04 ] 
  28. /* 
  29.     File:        WinUtils.h 
  30.  
  31.     Contains:    Utility functions for getting persistent window properties from a frame 
  32.  
  33.     Owned by:    Richard Rodseth 
  34.  
  35.     Copyright:    ⌐ 1995 by Apple Computer, Inc., all rights reserved. 
  36.  
  37. */ 
  38.  
  39. #ifndef _WINUTILS_ 
  40. #define _WINUTILS_ 
  41.  
  42.  
  43. #ifndef SOM_ODSession_xh 
  44. #include <ODSessn.xh> 
  45. #endif 
  46.  
  47. #ifndef _ODTYPES_ 
  48. #include <ODTypes.h> 
  49. #endif 
  50.  
  51. #ifndef _ODMVCLNK_ 
  52. #include <ODMvcLnk.h> 
  53. #endif 
  54.  
  55.  
  56.  
  57. //============================================================================== 
  58. // Theory of operation 
  59. //============================================================================== 
  60.  
  61. /* 
  62.  
  63. These functions allow a part editor to obtain the properties necessary to create 
  64. a window, from the storage annotation on a root frame. BeginGetWindowProperties 
  65. returns kODTrue if the annotation exists, and fills in the "properties" struct. 
  66. EndGetWindProperties releases the sourceFrame field of the struct. 
  67.  
  68. Usage: 
  69.  
  70.     WindowProperties props; 
  71.     ODWindow* window = kODNULL; 
  72.      
  73.     if (BeginGetWindowProperties(ev, frame, &props)) 
  74.     { 
  75.  
  76.         ODPlatformWindow platformWindow = NewCWindow(kODNULL, &(props.boundsRect), props.title, 
  77.                     kODFalse, props.procID, (WindowPtr)-1L, props.hasCloseBox, props.refCon); 
  78.          
  79.         window =  fSession->GetWindowState(ev)->RegisterWindowForFrame(ev, platformWindow, 
  80.                                                         frame, 
  81.                                                          props.isRootWindow,    // Keeps draft open 
  82.                                                          kODTrue,    // Is resizable 
  83.                                                          kODFalse,    // Is floating 
  84.                                                          kODTrue,    // shouldSave 
  85.                                                          props.sourceFrame); 
  86.         EndGetWindowProperties(ev, &props); // Release source frame 
  87.     } 
  88.  
  89. */ 
  90.  
  91. //============================================================================== 
  92. // Classes used by this interface 
  93. //============================================================================== 
  94.  
  95. struct    ODFrame; 
  96.  
  97. //============================================================================== 
  98. // Function prototypes 
  99. //============================================================================== 
  100.  
  101. struct WindowProperties 
  102. #ifdef _PLATFORM_OS2_ 
  103.         RECTL boundsRect; 
  104. #else 
  105.     Rect boundsRect; 
  106. #endif // _PLATFORM_OS2_ 
  107.     Str255 title; 
  108. #if defined (_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_AIX_) 
  109.         ODULong   createFlags; 
  110.         ODULong   swpFlags; 
  111. #endif // _PLATFORM_WIN32_ || _PLATFORM_OS2_ || _PLATFORM_AIX_ 
  112.     ODSShort  procID; 
  113.     ODBoolean hasCloseBox; 
  114.     ODSLong   refCon; 
  115.     ODBoolean wasVisible; 
  116.     ODBoolean isResizable; 
  117.     ODBoolean isFloating; 
  118.     ODBoolean isRootWindow; 
  119.     ODBoolean shouldShowLinks; 
  120.     ODFrame*  sourceFrame; 
  121. }; 
  122.  
  123. #ifdef __cplusplus 
  124. extern "C" { 
  125. #endif 
  126.  
  127. _DLLIMPORTEXPORT_ ODBoolean BeginGetWindowProperties(Environment* ev, ODFrame* frame, WindowProperties* properties); 
  128.  
  129.         // Obtains window properties from the storage unit referred to in the frame's 
  130.         // kODPropWindowProperties. 
  131.  
  132. _DLLIMPORTEXPORT_ void EndGetWindowProperties(Environment* ev, WindowProperties* properties); 
  133.  
  134.        // Releases the source frame 
  135.  
  136.  
  137. _DLLIMPORTEXPORT_ void Get72DPIToScreenScale( ODSession *session, ODFixed *xScale, ODFixed *yScale ); 
  138.  
  139.        // Returns the scale factors from OpenDoc 72DPI space to device space. 
  140.  
  141.  
  142. _DLLIMPORTEXPORT_ void GetScreenTo72DPIScale( ODSession *session, ODFixed *xScale, ODFixed *yScale ); 
  143.  
  144.        // Returns the scale factors from device space to OpenDoc 72DPI space. 
  145.  
  146.  
  147. #ifdef __cplusplus 
  148. } /* extern "C" */ 
  149. #endif 
  150.  
  151.  
  152. #endif // _WINUTILS_ 
  153.