Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::OSXContext Class Reference

#include <OSXContext.h>

Inheritance diagram for VCF::OSXContext:

VCF::ContextPeer VCF::Object VCF::OSXControlContextPeer List of all members.

Public Types

enum  LastPrimitive { lpNone, lpMove, lpLine }

Public Member Functions

 OSXContext ()
 OSXContext (const uint32 &width, const uint32 &height)
 Creates a new HDC from scratch.
 OSXContext (OSHandleID contextID)
 conextID MUST be a pointer to a OSXGCRef instance (which in turn can be on the stack, so long as it has valid values
virtual ~OSXContext ()
virtual void setContext (GraphicsContext *context)
virtual GraphicsContextgetContext ()
virtual OSHandleID getContextID ()
virtual void setContextID (OSHandleID handle)
 handle/contextID MUST be a pointer to a OSXGCRef instance (which in turn can be on the stack, so long as it has valid values
virtual void textAt (const Rect &bounds, const String &text, const int32 &drawOptions=0)
virtual double getTextWidth (const String &text)
virtual double getTextHeight (const String &text)
virtual void rectangle (const double &x1, const double &y1, const double &x2, const double &y2)
virtual void roundRect (const double &x1, const double &y1, const double &x2, const double &y2, const double &xc, const double &yc)
virtual void ellipse (const double &x1, const double &y1, const double &x2, const double &y2)
virtual void arc (const double &x1, const double &y1, const double &x2, const double &y2, const double &x3, const double &y3, const double &x4, const double &y4)
virtual void polyline (const std::vector< Point > &pts)
virtual void curve (const double &x1, const double &y1, const double &x2, const double &y2, const double &x3, const double &y3, const double &x4, const double &y4)
virtual void lineTo (const double &x, const double &y)
virtual void closePath ()
virtual void moveTo (const double &x, const double &y)
void init ()
virtual void setOrigin (const double &x, const double &y)
virtual Point getOrigin ()
virtual void copyContext (const Rect &sourceRect, const Rect &destRect, ContextPeer *sourceContext)
virtual bool isMemoryContext ()
 is this context Peer in memory or does it associated with a component ?
virtual bool prepareForDrawing (int32 drawingOperation)
 this method is called for the peer to initialize any graphics resources before calling the following methods:
virtual void finishedDrawing (int32 drawingOperation)
virtual void drawImage (const double &x, const double &y, Rect *imageBounds, Image *image, int compositeMode)
virtual void bitBlit (const double &x, const double &y, Rect *imageBounds, Image *image)
 "Blits" the image to the underlying graphics context.
virtual void checkHandle ()
virtual void releaseHandle ()
virtual bool isXORModeOn ()
virtual void setXORModeOn (const bool &XORModeOn)
virtual bool isAntiAliasingOn ()
 Turns the XOR mode on or off.
virtual void setAntiAliasingOn (bool antiAliasingOn)
virtual void setTextAlignment (const bool &alignTobaseline)
 this is used to determine how to align text when the windowing systems draws it.
virtual bool isTextAlignedToBaseline ()
virtual void setClippingPath (Path *clippingPath)
 sets the current clipping path to be used for the duration of the Contexts lifetime or until it has been changed
virtual void setClippingRect (Rect *clipRect)
virtual void drawThemeSelectionRect (Rect *rect, DrawUIState &state)
virtual void drawThemeFocusRect (Rect *rect, DrawUIState &state)
 Draws a focus rect, which is an inverted gray dotted line around the rect.
virtual void drawThemeButtonRect (Rect *rect, ButtonState &state, Rect *captionRect=NULL)
 Draws a button's background, the border, and its caption.
virtual void drawThemeButtonFocusRect (Rect *rect)
 Similar to drawThemeFocusRect, but dimension of the focus rect is chosen by the peer.
virtual void drawThemeCheckboxRect (Rect *rect, ButtonState &state)
virtual void drawThemeRadioButtonRect (Rect *rect, ButtonState &state)
virtual void drawThemeComboboxRect (Rect *rect, ButtonState &state)
virtual void drawThemeScrollButtonRect (Rect *rect, ScrollBarState &state)
virtual void drawThemeDisclosureButton (Rect *rect, DisclosureButtonState &state)
 Draws a button that is used to open up more details, for example the button that opens up a tree node to reveal it's children, that is compliant with the native windowing systems default look and feel.
virtual void drawThemeTab (Rect *rect, TabState &state)
 Draws a tab, the part of the TabbedPages control that acts like a little button to activate a page, that is compliant with the native windowing systems default look and feel.
virtual void drawThemeTabPage (Rect *rect, DrawUIState &state)
 Draws a tab page - the page on which other controls for the page are parented to, that is compliant with the native windowing systems default look and feel.
virtual void drawThemeTabContent (Rect *rect, DrawUIState &state)
virtual void drawThemeTickMarks (Rect *rect, SliderState &state)
 Draws a tick mark, like that used for a slider control, that is compliant with the native windowing systems default look and feel.
virtual void drawThemeSlider (Rect *rect, SliderState &state)
 Draws a slider control, like that used for a slider control, that is compliant with the native windowing systems default look and feel.
virtual void drawThemeProgress (Rect *rect, ProgressState &state)
 Draws a progress bar control, that is compliant with the native windowing systems default look and feel.
virtual void drawThemeImage (Rect *rect, Image *image, DrawUIState &state)
virtual void drawThemeHeader (Rect *rect, ButtonState &state)
 Draws a header control that is compliant with the native windowing systems default look and feel.
virtual void drawThemeEdge (Rect *rect, DrawUIState &state, const int32 &edgeSides, const int32 &edgeStyle)
 draws edges, useful for separators, that is compliant with the native windowing systems default look and feel.
virtual void drawThemeSizeGripper (Rect *rect, DrawUIState &state)
 Draws a size gripper for resizing a control/window that is compliant with the native windowing systems default look and feel.
virtual void drawThemeBackground (Rect *rect, BackgroundState &state)
 Draws a them compliant background.
virtual void drawThemeMenuItem (Rect *rect, MenuState &state)
 Draws the background appropriate for a menu item that is compliant with the native windowing systems default look and feel.
virtual void drawThemeMenuItemText (Rect *rect, MenuState &state)
virtual void drawThemeText (Rect *rect, TextState &state)
virtual void drawThemeTabs (Rect *rect, DrawUIState &paneState, TabState &selectedTabState, TabState &otherTabs, const std::vector< String > &tabNames, int selectedTabIndex)
virtual void drawThemeBorder (Rect *rect, DrawUIState &state)
CGContextRef getCGContext ()

Protected Member Functions

void atsuDrawTextInBox (const VCF::Rect &rect, const int32 &drawOptions)
double getLayoutWidth (ATSUTextLayout layout)
void setLayoutWidth (ATSUTextLayout layout, double width)
VCF::Size getLayoutDimensions (const String &text)
void endLastPrimitive ()
void finishLastPrimitive (const double &x, const double &y)

Protected Attributes

OSXGCRef contextRef_
uint32 imgWidth_
uint32 imgHeight_
GraphicsContextcontext_
int32 currentDrawingOperation_
ATSUTextLayout textLayout_
VCF::Point origin_
bool xorModeOn_
LastPrimitive lastPrimitive_
VCF::Point lastPrimitiveP1_
VCF::Point lastPrimitiveV1_
bool antialiasingOn_

Member Enumeration Documentation

enum VCF::OSXContext::LastPrimitive
 

Enumerator:
lpNone 
lpMove 
lpLine 


Constructor & Destructor Documentation

VCF::OSXContext::OSXContext  ) 
 

VCF::OSXContext::OSXContext const uint32 width,
const uint32 height
 

Creates a new HDC from scratch.

VCF::OSXContext::OSXContext OSHandleID  contextID  ) 
 

conextID MUST be a pointer to a OSXGCRef instance (which in turn can be on the stack, so long as it has valid values

virtual VCF::OSXContext::~OSXContext  )  [virtual]
 


Member Function Documentation

virtual void VCF::OSXContext::arc const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2,
const double &  x3,
const double &  y3,
const double &  x4,
const double &  y4
[virtual]
 

Implements VCF::ContextPeer.

void VCF::OSXContext::atsuDrawTextInBox const VCF::Rect rect,
const int32 drawOptions
[protected]
 

virtual void VCF::OSXContext::bitBlit const double &  x,
const double &  y,
Rect imageBounds,
Image image
[virtual]
 

"Blits" the image to the underlying graphics context.

No attempt is made to transform the image. The image is blitted to the coordinates specified by the x and y arguments, and the image's width and height are used to determine the bounds.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::checkHandle  )  [virtual]
 

Reimplemented in VCF::OSXControlContextPeer.

virtual void VCF::OSXContext::closePath  )  [virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::copyContext const Rect sourceRect,
const Rect destRect,
ContextPeer sourceContext
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::curve const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2,
const double &  x3,
const double &  y3,
const double &  x4,
const double &  y4
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawImage const double &  x,
const double &  y,
Rect imageBounds,
Image image,
int  compositeMode
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeBackground Rect rect,
BackgroundState state
[virtual]
 

Draws a them compliant background.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeBorder Rect rect,
DrawUIState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeButtonFocusRect Rect rect  )  [virtual]
 

Similar to drawThemeFocusRect, but dimension of the focus rect is chosen by the peer.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeButtonRect Rect rect,
ButtonState state,
Rect captionRect = NULL
[virtual]
 

Draws a button's background, the border, and its caption.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeCheckboxRect Rect rect,
ButtonState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeComboboxRect Rect rect,
ButtonState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeDisclosureButton Rect rect,
DisclosureButtonState state
[virtual]
 

Draws a button that is used to open up more details, for example the button that opens up a tree node to reveal it's children, that is compliant with the native windowing systems default look and feel.

On Win32 this is usually represented by the "+" and "-" look as found on the tree controls, while on OSX it is the little triangles

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeEdge Rect rect,
DrawUIState state,
const int32 edgeSides,
const int32 edgeStyle
[virtual]
 

draws edges, useful for separators, that is compliant with the native windowing systems default look and feel.

use a mask or 1 or more values of type ContextPeer::EdgeType to indicate which sides of the rect to draw an edge on

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeFocusRect Rect rect,
DrawUIState state
[virtual]
 

Draws a focus rect, which is an inverted gray dotted line around the rect.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeHeader Rect rect,
ButtonState state
[virtual]
 

Draws a header control that is compliant with the native windowing systems default look and feel.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeImage Rect rect,
Image image,
DrawUIState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeMenuItem Rect rect,
MenuState state
[virtual]
 

Draws the background appropriate for a menu item that is compliant with the native windowing systems default look and feel.

This is typically called first by a menu item to give it a standard look and feel in it's background before drawing any thing else

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeMenuItemText Rect rect,
MenuState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeProgress Rect rect,
ProgressState state
[virtual]
 

Draws a progress bar control, that is compliant with the native windowing systems default look and feel.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeRadioButtonRect Rect rect,
ButtonState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeScrollButtonRect Rect rect,
ScrollBarState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeSelectionRect Rect rect,
DrawUIState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeSizeGripper Rect rect,
DrawUIState state
[virtual]
 

Draws a size gripper for resizing a control/window that is compliant with the native windowing systems default look and feel.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeSlider Rect rect,
SliderState state
[virtual]
 

Draws a slider control, like that used for a slider control, that is compliant with the native windowing systems default look and feel.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeTab Rect rect,
TabState state
[virtual]
 

Draws a tab, the part of the TabbedPages control that acts like a little button to activate a page, that is compliant with the native windowing systems default look and feel.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeTabContent Rect rect,
DrawUIState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeTabPage Rect rect,
DrawUIState state
[virtual]
 

Draws a tab page - the page on which other controls for the page are parented to, that is compliant with the native windowing systems default look and feel.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeTabs Rect rect,
DrawUIState paneState,
TabState selectedTabState,
TabState otherTabs,
const std::vector< String > &  tabNames,
int  selectedTabIndex
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeText Rect rect,
TextState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::drawThemeTickMarks Rect rect,
SliderState state
[virtual]
 

Draws a tick mark, like that used for a slider control, that is compliant with the native windowing systems default look and feel.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::ellipse const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2
[virtual]
 

Implements VCF::ContextPeer.

void VCF::OSXContext::endLastPrimitive  )  [protected]
 

virtual void VCF::OSXContext::finishedDrawing int32  drawingOperation  )  [virtual]
 

Implements VCF::ContextPeer.

void VCF::OSXContext::finishLastPrimitive const double &  x,
const double &  y
[protected]
 

CGContextRef VCF::OSXContext::getCGContext  )  [inline]
 

virtual GraphicsContext* VCF::OSXContext::getContext  )  [virtual]
 

Implements VCF::ContextPeer.

virtual OSHandleID VCF::OSXContext::getContextID  )  [virtual]
 

Implements VCF::ContextPeer.

VCF::Size VCF::OSXContext::getLayoutDimensions const String text  )  [protected]
 

double VCF::OSXContext::getLayoutWidth ATSUTextLayout  layout  )  [protected]
 

virtual Point VCF::OSXContext::getOrigin  )  [virtual]
 

Implements VCF::ContextPeer.

virtual double VCF::OSXContext::getTextHeight const String text  )  [virtual]
 

Implements VCF::ContextPeer.

virtual double VCF::OSXContext::getTextWidth const String text  )  [virtual]
 

Implements VCF::ContextPeer.

void VCF::OSXContext::init  ) 
 

virtual bool VCF::OSXContext::isAntiAliasingOn  )  [inline, virtual]
 

Turns the XOR mode on or off.

Parameters:
bool XORModeOn, if true then turns the XORMode on otherwise if it's false it turns it off.

Implements VCF::ContextPeer.

virtual bool VCF::OSXContext::isMemoryContext  )  [virtual]
 

is this context Peer in memory or does it associated with a component ?

Returns:
bool true if the context is on memory, otherwise false

Implements VCF::ContextPeer.

virtual bool VCF::OSXContext::isTextAlignedToBaseline  )  [virtual]
 

Implements VCF::ContextPeer.

virtual bool VCF::OSXContext::isXORModeOn  )  [virtual]
 

virtual void VCF::OSXContext::lineTo const double &  x,
const double &  y
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::moveTo const double &  x,
const double &  y
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::polyline const std::vector< Point > &  pts  )  [virtual]
 

Implements VCF::ContextPeer.

virtual bool VCF::OSXContext::prepareForDrawing int32  drawingOperation  )  [virtual]
 

this method is called for the peer to initialize any graphics resources before calling the following methods:

  • textAt
  • getTextWidth
  • getTextHeight
  • rectangle
  • ellipse
  • arc
  • polyline
  • curve
  • moveTo
  • lineTo
Since the drawing primitives like (rectangle, moveTo, etc) are executed as a series of operations by the GraphicsContext, this means that prepareForDrawing() will get called as part of the GraphicsContext::fillPath(), GraphicsContext::strokePath(), or GraphicsContext::textAtXXX() methods. prepareForDrawing() will be called prior to any of the drawing primitive functions in the above list, allowing the peer to initialize whatever graphics resources need to be as specified by the GraphicsContext.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::rectangle const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::releaseHandle  )  [virtual]
 

Reimplemented in VCF::OSXControlContextPeer.

virtual void VCF::OSXContext::roundRect const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2,
const double &  xc,
const double &  yc
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::setAntiAliasingOn bool  antiAliasingOn  )  [virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::setClippingPath Path clippingPath  )  [virtual]
 

sets the current clipping path to be used for the duration of the Contexts lifetime or until it has been changed

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::setClippingRect Rect clipRect  )  [virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::setContext GraphicsContext context  )  [virtual]
 

Implements VCF::ContextPeer.

Reimplemented in VCF::OSXControlContextPeer.

virtual void VCF::OSXContext::setContextID OSHandleID  handle  )  [virtual]
 

handle/contextID MUST be a pointer to a OSXGCRef instance (which in turn can be on the stack, so long as it has valid values

Implements VCF::ContextPeer.

void VCF::OSXContext::setLayoutWidth ATSUTextLayout  layout,
double  width
[protected]
 

virtual void VCF::OSXContext::setOrigin const double &  x,
const double &  y
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::setTextAlignment const bool &  alignTobaseline  )  [virtual]
 

this is used to determine how to align text when the windowing systems draws it.

Currently the choices are 2: either it is aligned to the top, or in other words the coordinates specified represent the top, left position to start rendering the text, or aligned to the baseline, in which the top, left coordinates represent the baseline point of origin. The latter setting is useful when drawing text whith different font styles.

Implements VCF::ContextPeer.

virtual void VCF::OSXContext::setXORModeOn const bool &  XORModeOn  )  [virtual]
 

virtual void VCF::OSXContext::textAt const Rect bounds,
const String text,
const int32 drawOptions = 0
[virtual]
 

Implements VCF::ContextPeer.


Member Data Documentation

bool VCF::OSXContext::antialiasingOn_ [protected]
 

GraphicsContext* VCF::OSXContext::context_ [protected]
 

OSXGCRef VCF::OSXContext::contextRef_ [protected]
 

int32 VCF::OSXContext::currentDrawingOperation_ [protected]
 

uint32 VCF::OSXContext::imgHeight_ [protected]
 

uint32 VCF::OSXContext::imgWidth_ [protected]
 

LastPrimitive VCF::OSXContext::lastPrimitive_ [protected]
 

VCF::Point VCF::OSXContext::lastPrimitiveP1_ [protected]
 

VCF::Point VCF::OSXContext::lastPrimitiveV1_ [protected]
 

VCF::Point VCF::OSXContext::origin_ [protected]
 

ATSUTextLayout VCF::OSXContext::textLayout_ [protected]
 

bool VCF::OSXContext::xorModeOn_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information