Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
docs/drawing.html
<HTML> |
<HEAD> |
<TITLE>HTMLRenderingLib - Drawing Routines</TITLE> |
</HEAD> |
<BODY BGCOLOR="#FFFFFF"> |
<H4> </H4> |
<H3>HTMLRenderingLib - Routines for drawing and affecting HTML |
display characteristics.</H3> |
<H4><A NAME=HRSetGrafPtr></A></H4> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRSetGrafPtr</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRSetGrafPtr( |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
GrafPtr grafPtr);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>grafPtr</B> - a pointer to a quickdraw grafport where the |
HTML should be drawn.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>HRSetGrafPtr can be used to set the grafport an HTML rendering |
object uses for drawing.</P> |
<P><A HREF="index.html">return to index</A></P> |
<H4><A NAME=HRActivate></A></H4> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRActivate</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRActivate( |
<A HREF="types.html#HRReference">HRReference</A> hrRef);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Call HRActivate when one of a window containing an HTML rendering |
object receives an activate event.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRDeactivate></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRDeactivate</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRDeactivate( |
<A HREF="types.html#HRReference">HRReference</A> hrRef);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Call HRDeactivate when one of a window containing an HTML |
rendering object receives an deactivate event.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRDraw></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRDraw</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRDraw( |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
RgnHandle updateRgnH);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>updateRgnH</B> - if not NULL, updateRgnH contains a region |
handle representing the area of the screen that should be redrawn. |
Normally, for update events, you will provide the window's visRgn |
in this parameter.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Call HRDraw when one of a window containing an HTML rendering |
object receives an update event, or when you would like to redraw the |
HTML being displayed by an HTML rendering object.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRSetRenderingRect></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRSetRenderingRect</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRSetRenderingRect( |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
const Rect *renderingRect);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>renderingRect</B> - a pointer to a QuickDraw Rect structure |
defining the rectangle where the HTML should be drawn. This |
rectangle will include the HTML and the scroll bars when they are |
visible.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Call HRSetRenderingRect to set the rectangle where the HTML |
rendering object should draw.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRGetRenderedImageSize></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRGetRenderedImageSize</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRGetRenderedImageSize( |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
Point *renderingSize);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>renderingSize</B> - a pointer to a QuickDraw Point |
structure.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>HRGetRenderedImageSize can be used to establish the actual size of |
the rendered HTML given the viewing rectangle specified in the last |
call to <A HREF="#HRSetRenderingRect">HRSetRenderingRect</A>. </P> |
<P>NOTE: HTMLRenderingLib does its best to fit the HTML into the |
viewing rectangle, however in some cases its width or height may |
extend beyond the boundaries of this rectangle.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRScrollToLocation></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRScrollToLocation</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRScrollToLocation( |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
Point *location);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>location</B> - a pointer to a QuickDraw Point structure |
describing the horizontal and vertical coordinates (inside of the |
rendered HTML image) that should be moved to the top left corner |
of the view rectangle.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Cal HRScrollToLocation to set the viewing origin to a particular |
location inside of the rendered HTML document.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRForceQuickdraw></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRForceQuickdraw</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRForceQuickdraw( |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
Boolean forceQuickdraw);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>forceQuickdraw</B> - a boolean value.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Call HRForceQuickdraw to turn on and off QuickDraw drawing. It is |
appropriate to turn on QuickDraw drawing when asking the |
HTMLRenderingLib to draw to some devices such as, for example, |
printers.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRSetScrollbarState></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRSetScrollbarState</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRSetScrollbarState( |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
<A HREF="types.html#HRScrollbarState">HRScrollbarState</A> hScrollbarState, |
<A HREF="types.html#HRScrollbarState">HRScrollbarState</A> vScrollbarState);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>hScrollbarState</B> - a value of type <A HREF="types.html#HRScrollbarState">HRScrollbarState</A> |
specifying the state for the horizontal scroll bar. This can be |
either eHRScrollbarOn, eHRScrollbarOff, or eHRScrollbarAuto.</P> |
<P><B>vScrollbarState</B> - a value of type <A HREF="types.html#HRScrollbarState">HRScrollbarState</A> |
specifying the state for the vertical scroll bar. This can be |
either eHRScrollbarOn, eHRScrollbarOff, or eHRScrollbarAuto.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>HRSetScrollbarState can be called to explicity turn on or of the |
scroll bars in the rendering area. By default, the scroll bars are |
set to automatically show/hide themselves as appropriate depending on |
the size of the HTML image being displayed.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRSetDrawBorder></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRSetDrawBorder</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRSetDrawBorder( |
HRReference hrRef, |
Boolean drawBorder);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>drawBorder</B> -a boolean value.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Call HRSetDrawBorder to ask the HTMLRenderingLib to draw a |
standard border around the outside of the area specified in the to |
<A HREF="#HRSetRenderingRect">HRSetRenderingRect</A> call.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=HRSetGrowboxCutout></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">HRSetGrowboxCutout</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus HRSetGrowboxCutout( |
HRReference hrRef, |
Boolean allowCutout);</PRE> |
<P><B>hrRef</B> - a reference to a HTML rendering object |
previously obtained by calling <A HREF="generalroutines.html#HRNewReference">HRNewReference</A>.</P> |
<P><B>allowCutout</B> - a boolean value.</P> |
<P>function result - an error code or noErr if successful.</P></BLOCKQUOTE> |
<P>Call HRSetGrowboxCutout to notify the HTML rendering object that |
the HTML is being rendered inside of a window that has a grow box in |
the bottom right hand corner. If allowCutout is true, then the |
HTMLRenderingLib will not draw in the bottom right 16 by 16 pixel |
area of the viewing rectangle.</P> |
<P><A HREF="index.html">return to index</A></P> |
<P> </P> |
<P></P> |
</BODY> |
</HTML> |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-30