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

VCF::XCBContextPeer Class Reference

#include <XCBContextPeer.h>

Inheritance diagram for VCF::XCBContextPeer:

VCF::ContextPeer VCF::XCBControlContextPeer List of all members.

Public Member Functions

 XCBContextPeer ()
 XCBContextPeer (const uint32 &width, const uint32 &height)
 XCBContextPeer (OSHandleID contextID)
 In this case the OSHandleID will be a vaild pointer to a XCBSurface struct.
virtual ~XCBContextPeer ()
void init ()
void checkHandle ()
void releaseHandle ()
virtual void setContext (GraphicsContext *context)
virtual GraphicsContextgetContext ()
virtual OSHandleID getContextID ()
virtual void setContextID (OSHandleID contextID)
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 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 setTextAlignment (const bool &alignTobaseline)
 this is used to determine how to align text when the windowing systems draws it.
virtual bool isTextAlignedToBaseline ()
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 moveTo (const double &x, const double &y)
virtual void lineTo (const double &x, const double &y)
void closePath ()
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 isAntiAliasingOn ()
 Turns the XOR mode on or off.
virtual void setAntiAliasingOn (bool antiAliasingOn)
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 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 drawThemeTabs (Rect *rect, DrawUIState &paneState, TabState &selectedTabState, TabState &otherTabs, const std::vector< String > &tabNames, int selectedTabIndex)
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)
void internal_setImage (xcb_image_t *image)
void internal_setGamma (double gamma)

Protected Member Functions

void resetPath ()
void renderScanlinesSolid (agg::rasterizer_scanline_aa<> &rasterizer, const agg::rgba &color)
void clearGlyphs ()
const agg::glyph_cache * glyph (int character, double &x, double &y)
Size getTextSize (const String &text)
void renderLine (const std::vector< GlyphInfo > &glyphs, size_t lastGlyphPos, const Size &currentLineSz, const Rect &bounds, const int32 &drawOptions)

Protected Attributes

GraphicsContextcontext_
xcb_image_t * image_
XCBSurfacedrawingSurface_
bool antiAliasing_
agg::rendering_buffer renderBuffer_
agg::scanline_u8 scanline_
Rect currentClipRect_
agg::path_storage currentPath_
FontStruct * fonts_
std::vector< CachedGlyph * > cachedFontGlyphs_
String prevFontHash_
Point origin_

Classes

struct  GlyphInfo

Constructor & Destructor Documentation

VCF::XCBContextPeer::XCBContextPeer  ) 
 

VCF::XCBContextPeer::XCBContextPeer const uint32 width,
const uint32 height
 

VCF::XCBContextPeer::XCBContextPeer OSHandleID  contextID  ) 
 

In this case the OSHandleID will be a vaild pointer to a XCBSurface struct.

The XCBSurface pointer will have valid values set for all it's members.

virtual VCF::XCBContextPeer::~XCBContextPeer  )  [virtual]
 


Member Function Documentation

virtual void VCF::XCBContextPeer::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.

virtual void VCF::XCBContextPeer::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.

void VCF::XCBContextPeer::checkHandle  ) 
 

Reimplemented in VCF::XCBControlContextPeer.

void VCF::XCBContextPeer::clearGlyphs  )  [protected]
 

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::drawImage const double &  x,
const double &  y,
Rect imageBounds,
Image image,
int  compositeMode
[virtual]
 

Implements VCF::ContextPeer.

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

Draws a them compliant background.

Implements VCF::ContextPeer.

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

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

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::drawThemeCheckboxRect Rect rect,
ButtonState state
[virtual]
 

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::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::XCBContextPeer::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::XCBContextPeer::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::XCBContextPeer::drawThemeImage Rect rect,
Image image,
DrawUIState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::drawThemeMenuItemText Rect rect,
MenuState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::drawThemeRadioButtonRect Rect rect,
ButtonState state
[virtual]
 

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::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::XCBContextPeer::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::XCBContextPeer::drawThemeTabContent Rect rect,
DrawUIState state
[virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::drawThemeTabs Rect rect,
DrawUIState paneState,
TabState selectedTabState,
TabState otherTabs,
const std::vector< String > &  tabNames,
int  selectedTabIndex
[virtual]
 

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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::XCBContextPeer::ellipse const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2
[virtual]
 

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

Size VCF::XCBContextPeer::getTextSize const String text  )  [protected]
 

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

Implements VCF::ContextPeer.

const agg::glyph_cache* VCF::XCBContextPeer::glyph int  character,
double &  x,
double &  y
[protected]
 

void VCF::XCBContextPeer::init  ) 
 

void VCF::XCBContextPeer::internal_setGamma double  gamma  ) 
 

void VCF::XCBContextPeer::internal_setImage xcb_image_t *  image  ) 
 

virtual bool VCF::XCBContextPeer::isAntiAliasingOn  )  [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::XCBContextPeer::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::XCBContextPeer::isTextAlignedToBaseline  )  [virtual]
 

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

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

Implements VCF::ContextPeer.

virtual bool VCF::XCBContextPeer::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::XCBContextPeer::rectangle const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2
[virtual]
 

Implements VCF::ContextPeer.

void VCF::XCBContextPeer::releaseHandle  ) 
 

Reimplemented in VCF::XCBControlContextPeer.

void VCF::XCBContextPeer::renderLine const std::vector< GlyphInfo > &  glyphs,
size_t  lastGlyphPos,
const Size currentLineSz,
const Rect bounds,
const int32 drawOptions
[protected]
 

void VCF::XCBContextPeer::renderScanlinesSolid agg::rasterizer_scanline_aa<> &  rasterizer,
const agg::rgba &  color
[protected]
 

void VCF::XCBContextPeer::resetPath  )  [protected]
 

virtual void VCF::XCBContextPeer::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::XCBContextPeer::setAntiAliasingOn bool  antiAliasingOn  )  [virtual]
 

Implements VCF::ContextPeer.

virtual void VCF::XCBContextPeer::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.