home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / packagetool / sample package / htmlsample sources / renderingwindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  6.2 KB  |  144 lines

  1. /*
  2.     File: RenderingWindow.h
  3.     
  4.     Description:
  5.         This file contains exported routine prototypes that can be used to call
  6.     the routines defined in RenderingWindow.c.  These routines used to
  7.     manage the windows displayed by the HTMLSample application.
  8.     
  9.     HTMLSample is an application illustrating how to use the new
  10.     HTMLRenderingLib services found in Mac OS 9. HTMLRenderingLib
  11.     is Apple's light-weight HTML rendering engine capable of
  12.     displaying HTML files.
  13.  
  14.     Copyright:
  15.         © Copyright 1999 Apple Computer, Inc. All rights reserved.
  16.     
  17.     Disclaimer:
  18.         IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  19.         ("Apple") in consideration of your agreement to the following terms, and your
  20.         use, installation, modification or redistribution of this Apple software
  21.         constitutes acceptance of these terms.  If you do not agree with these terms,
  22.         please do not use, install, modify or redistribute this Apple software.
  23.  
  24.         In consideration of your agreement to abide by the following terms, and subject
  25.         to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  26.         copyrights in this original Apple software (the "Apple Software"), to use,
  27.         reproduce, modify and redistribute the Apple Software, with or without
  28.         modifications, in source and/or binary forms; provided that if you redistribute
  29.         the Apple Software in its entirety and without modifications, you must retain
  30.         this notice and the following text and disclaimers in all such redistributions of
  31.         the Apple Software.  Neither the name, trademarks, service marks or logos of
  32.         Apple Computer, Inc. may be used to endorse or promote products derived from the
  33.         Apple Software without specific prior written permission from Apple.  Except as
  34.         expressly stated in this notice, no other rights or licenses, express or implied,
  35.         are granted by Apple herein, including but not limited to any patent rights that
  36.         may be infringed by your derivative works or by other works in which the Apple
  37.         Software may be incorporated.
  38.  
  39.         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  40.         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  41.         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  42.         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  43.         COMBINATION WITH YOUR PRODUCTS.
  44.  
  45.         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  46.         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  47.         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  48.         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  49.         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  50.         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  51.         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  52.  
  53.     Change History (most recent first):
  54.         Wed, Dec 22, 1999 -- created
  55. */
  56.  
  57.  
  58. #ifndef __RENDERINGWINDOW__
  59. #define __RENDERINGWINDOW__
  60.  
  61. #include <Types.h>
  62. #include <Windows.h>
  63.  
  64.  
  65.  
  66. /* InitRenderingWindows is called to initialize the environment used by 
  67.     routines defined in this file.  It should be called before any of the 
  68.     other routines defined in this file are called. */
  69. OSStatus InitRenderingWindows(void);
  70.  
  71. /* CloseRenderingWindows closes any open rendering windows and
  72.     deallocates any structures allocated when InitRenderingWindows
  73.     was called. */
  74. OSStatus CloseRenderingWindows(void);
  75.  
  76.  
  77.  
  78. /* RWOpen opens a new, empty rendering window.  If successful,
  79.     then *rWindow will contain a pointer to a newly created window. */
  80. OSStatus RWOpen(WindowPtr *rWindow);
  81.  
  82. /* RWCloseWindow closes the rendering window pointed to by
  83.     rWin.  */
  84. void RWCloseWindow(WindowPtr rWin);
  85.  
  86. /* IsARenderingWindow returns true if rWin points to a rendering
  87.     window created by RWOpen. You should not call any of the routines
  88.     below for windows that are not rendering windows.  This routine
  89.     provides a convenient way to tell if a windowptr returned by one
  90.     of the toolbox routines is a rendering window. */
  91. Boolean IsARenderingWindow(WindowPtr rWin);
  92.  
  93.  
  94.  
  95. /* RWGotoURL displays HTML file referred to by the url in the
  96.     rendering window.  if addToHistory is true, then the window
  97.     will be added to the window's history list. */
  98. OSStatus RWGotoURL(WindowPtr rWin, char* url, Boolean addToHistory);
  99.  
  100. /* RWGotoAppRelLink displays HTML file referred to by the application
  101.     relative link in the rendering window.  if addToHistory is true, then
  102.     the window will be added to the window's history list. */
  103. OSStatus RWGotoAppRelLink(WindowPtr rWin, char* linkstr, Boolean addToHistory);
  104.  
  105.  
  106.  
  107. /* RWResetGotoMenu should be called before calling MenuKey or MenuSelect.  It
  108.     enables the back, forward, and home menu commands depending on what
  109.     commands are available and it rebuilds the history list at the bottom
  110.     of the go to menu. */
  111. void RWResetGotoMenu(WindowPtr rWin);
  112.  
  113. /* RWHandleGotoMenu should be called when an item is chosen from the
  114.     go to menu.  item is the number of the item that was chosen. */
  115. void RWHandleGotoMenu(WindowPtr rWin, short item);
  116.  
  117.  
  118.  
  119. /* RWUpdate should be called in response to an update event.
  120.     it calls BeginUpdate and EndUpdate redrawing the window's
  121.     contents as necessary. */
  122. void RWUpdate(WindowPtr rWin);
  123.  
  124. /* RWActivate should be called in response to activate events.*/
  125. void RWActivate(WindowPtr rWin, Boolean activate);
  126.  
  127. /* RWRecalculateSize should be called whenever the size of a rendering
  128.     window changes.  This routine resizes and redraws the windows
  129.     contents appropriately. */
  130. void RWRecalculateSize(WindowPtr rWin);
  131.  
  132. /* RWHandleMouseDown should be called in response to mouse down
  133.     events occuring inside of a rendering window.  This routine responds
  134.     to mouse clicks in the controls at the top of the window. */
  135. void RWHandleMouseDown(WindowPtr rWin, Point where);
  136.  
  137. /* RWKeyDown should be called for keydown events when a rendering
  138.     window is the frontmost window.  This routine maps the left, up,
  139.     and right arrow keys to the back, home, and forward commands. */
  140. void RWKeyDown(WindowPtr rWin, char theKey);
  141.  
  142. #endif
  143.  
  144.