GUIDOLib  1.7.7
Guido Engine Internal Documentation
Public Member Functions | Protected Member Functions | List of all members
NullGDevice Class Reference
Inheritance diagram for NullGDevice:
VGDevice

Public Member Functions

 NullGDevice (VGSystem *sys)
 
 NullGDevice (VGSystem *sys, int inWidth, int inHeight)
 
virtual ~NullGDevice ()
 
virtual bool IsValid () const
 Returns the ability of the current VGdevice to be drawn into. More...
 
virtual bool BeginDraw ()
 
virtual void EndDraw ()
 
virtual void InvalidateRect (float left, float top, float right, float bottom)
 
virtual void MoveTo (float x, float y)
 Moves the current position to the point specified by (x,y). More...
 
virtual void LineTo (float x, float y)
 
virtual void Line (float x1, float y1, float x2, float y2)
 
virtual void Frame (float left, float top, float right, float bottom)
 
virtual void Arc (float left, float top, float right, float bottom, float startX, float startY, float endX, float endY)
 
virtual void FrameEllipse (float x, float y, float width, float height)
 Draws an ellipse. More...
 
virtual void Ellipse (float x, float y, float width, float height, const VGColor &color)
 Draws a filled ellipse. More...
 
virtual void Triangle (float x1, float y1, float x2, float y2, float x3, float y3)
 
virtual void Polygon (const float *xCoords, const float *yCoords, int count)
 
virtual void Rectangle (float left, float top, float right, float bottom)
 
virtual void SetMusicFont (const VGFont *font)
 
virtual const VGFontGetMusicFont () const
 Returns the currently selected music VGFont. More...
 
virtual void SetTextFont (const VGFont *font)
 
virtual const VGFontGetTextFont () const
 Returns the currently selected text VGFont. More...
 
virtual void SelectPen (const VGColor &inColor, float width)
 
virtual void SelectFillColor (const VGColor &c)
 
virtual void PushPen (const VGColor &inColor, float inWidth)
 
virtual void PopPen ()
 
virtual void PushFillColor (const VGColor &inColor)
 
virtual void PopFillColor ()
 
virtual void SetRasterOpMode (VRasterOpMode ROpMode)
 
virtual VRasterOpMode GetRasterOpMode () const
 
virtual bool CopyPixels (VGDevice *pSrcDC, float alpha=-1.0)
 
virtual bool CopyPixels (int xDest, int yDest, VGDevice *pSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, float alpha=-1.0)
 
virtual bool CopyPixels (int xDest, int yDest, int dstWidth, int dstHeight, VGDevice *pSrcDC, float alpha=-1.0)
 
virtual bool CopyPixels (int xDest, int yDest, int dstWidth, int dstHeight, VGDevice *pSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, float alpha=-1.0)
 
virtual void SetScale (float x, float y)
 Sets the scale factors of the current VGDevice to the input values. More...
 
virtual void SetOrigin (float x, float y)
 Specifies which VGDevice point (x,y) maps to the window origin (0,0). More...
 
virtual void OffsetOrigin (float x, float y)
 Offsets the current VGDevice's origin (see above). More...
 
virtual void LogicalToDevice (float *x, float *y) const
 
virtual void DeviceToLogical (float *x, float *y) const
 
virtual float GetXScale () const
 
virtual float GetYScale () const
 
virtual float GetXOrigin () const
 
virtual float GetYOrigin () const
 
virtual void NotifySize (int inWidth, int inHeight)
 
virtual int GetWidth () const
 Returns the width (set via NotifySize) of the current VGDevice. More...
 
virtual int GetHeight () const
 Returns the height (set via NotifySize) of the current VGDevice. More...
 
virtual void DrawMusicSymbol (float x, float y, unsigned int inSymbolID)
 
virtual void DrawString (float x, float y, const char *s, int inCharCount)
 
virtual void SetFontColor (const VGColor &inColor)
 Sets the text/music color for the current VGDevice. More...
 
virtual VGColor GetFontColor () const
 Returns the text/music color of the current VGDevice. More...
 
virtual void SetFontBackgroundColor (const VGColor &inColor)
 Sets the text/music background color for the current VGDevice. More...
 
virtual VGColor GetFontBackgroundColor () const
 Returns the text/music background color of the current VGDevice. More...
 
virtual void SetFontAlign (unsigned int inAlign)
 
virtual unsigned int GetFontAlign () const
 
virtual void SetDPITag (float inDPI=72.0f)
 Sets the printing resolution of the current VGDevice. More...
 
virtual float GetDPITag () const
 Returns the printing resolution of the current VGDevice. More...
 
virtual void * GetBitMapPixels ()
 Allows pixels operations and returns a pointer to the bitmap pixels. More...
 
virtual void ReleaseBitMapPixels ()
 Update bitmap pixels and ends pixels operations. More...
 
virtual const char * GetImageData (const char *&outDataPtr, int &outLength)
 Gives the current device data and returns the data associated mime type. More...
 
virtual void ReleaseImageData (const char *) const
 Release the pointer returned by GetImageData. More...
 
virtual VGSystemgetVGSystem () const
 temporary hack - must be removed asap More...
 
virtual void SelectPenColor (const VGColor &inColor)
 Creates a new VGPen object with the specified VGColor. More...
 
virtual void SelectPenWidth (float witdh)
 Creates a new VGPen object with the specified VGColor. More...
 
virtual void PushPenColor (const VGColor &inColor)
 
virtual void PopPenColor ()
 
virtual void PushPenWidth (float width)
 
virtual void PopPenWidth ()
 
- Public Member Functions inherited from VGDevice
virtual ~VGDevice ()
 
virtual void selectfont (int)
 Selects a font (only for SVG device). More...
 

Protected Member Functions

virtual void * GetNativeContext () const
 Returns the platform-specific device context object. More...
 

Additional Inherited Members

- Public Types inherited from VGDevice
enum  VRasterOpMode {
  kUnknown = 0, kOpCopy = 1, kOpAnd = 2, kOpXOr = 4,
  kOpInvert = 8, kOpOr = 16
}
 Raster operation modes (color fill, bit copy, etc.) More...
 
enum  VTextAlignMode {
  kAlignBase = 1, kAlignBottom = 2, kAlignTop = 4, kAlignCenter = 8,
  kAlignLeft = 16, kAlignRight = 32, kAlignBaseLeft = kAlignLeft | kAlignBase
}
 Text alignment modes. More...
 

Detailed Description

This VGDevice is the most basic child object that can be used to build almost nothing but time-graphic mapping & common graphical objects dummy initialization. Thus, it shouldn't be used as a real VGDevice but more as the basic x-platform
"template" VGDevice implementation.

For inherited methods documentation, see VGDevice.h

Constructor & Destructor Documentation

◆ NullGDevice() [1/2]

NullGDevice::NullGDevice ( VGSystem sys)
inline

◆ NullGDevice() [2/2]

NullGDevice::NullGDevice ( VGSystem sys,
int  inWidth,
int  inHeight 
)
inline

◆ ~NullGDevice()

virtual NullGDevice::~NullGDevice ( )
inlinevirtual

Member Function Documentation

◆ Arc()

virtual void NullGDevice::Arc ( float  left,
float  top,
float  right,
float  bottom,
float  startX,
float  startY,
float  endX,
float  endY 
)
inlinevirtual

Draws a counter-clockwise elliptical arc between the startX, startY, endX & endY coordinates and inside the [left, top, right, bottom] elliptical bounding box. The distance from these points to the middle of the ellipse is not important, only the angle is taken in account.

Implements VGDevice.

◆ BeginDraw()

virtual bool NullGDevice::BeginDraw ( )
inlinevirtual

Prepares the device's context before a set of drawing operations and saves the current one (like the previous SaveDC() method). This method should be used before every set of drawing operation.

Implements VGDevice.

◆ CopyPixels() [1/4]

virtual bool NullGDevice::CopyPixels ( int  xDest,
int  yDest,
int  dstWidth,
int  dstHeight,
VGDevice pSrcDC,
float  alpha = -1.0 
)
inlinevirtual

Copies a pixmap from a source rectangle into a destination rectangle, stretching or compressing the pixmap to fit the dimensions of the destination rectangle, if necessary. The method stretches or compresses the pixmap using the raster mode currently set in the destination VGdevice. Default alpha (-1.0) means copying bits using their own transparency values, if any; if no alpha channel value is available, opaque copy (alpha = 1.0) is performed.

Implements VGDevice.

◆ CopyPixels() [2/4]

virtual bool NullGDevice::CopyPixels ( int  xDest,
int  yDest,
int  dstWidth,
int  dstHeight,
VGDevice pSrcDC,
int  xSrc,
int  ySrc,
int  nSrcWidth,
int  nSrcHeight,
float  alpha = -1.0 
)
inlinevirtual

Copies a pixmap from a source rectangle into a destination rectangle, stretching or compressing the pixmap to fit the dimensions of the destination rectangle, if necessary. The method stretches or compresses the pixmap using the raster mode currently set in the destination VGdevice. Default alpha (-1.0) means copying bits using their own transparency values, if any; if no alpha channel value is available, opaque copy (alpha = 1.0) is performed.

Implements VGDevice.

◆ CopyPixels() [3/4]

virtual bool NullGDevice::CopyPixels ( int  xDest,
int  yDest,
VGDevice pSrcDC,
int  xSrc,
int  ySrc,
int  nSrcWidth,
int  nSrcHeight,
float  alpha = -1.0 
)
inlinevirtual

Makes the exact copy of the content (pixmap) of the specified rectangle from the pSrcDC source VGDevice to the specified destination of the current device. The raster operation mode should be specified using SetRasterOpMode(). Default alpha (-1.0) means copying bits using their own transparency values, if any; if no alpha channel value is available, opaque copy (alpha = 1.0) is performed.

Implements VGDevice.

◆ CopyPixels() [4/4]

virtual bool NullGDevice::CopyPixels ( VGDevice pSrcDC,
float  alpha = -1.0 
)
inlinevirtual

Copies the entire content (pixmap) of the pSrcDC source VGDevice to the current device. The raster operation mode should be specified using SetRasterOpMode(). Default alpha (-1.0) means copying bits using their own transparency values, if any; if no alpha channel value is available, opaque copy (alpha = 1.0) is performed.

Implements VGDevice.

◆ DeviceToLogical()

virtual void NullGDevice::DeviceToLogical ( float *  x,
float *  y 
) const
inlinevirtual

Computes input VGDevice coordinates to get their values outside its VGDevice coordinate system.

Implements VGDevice.

◆ DrawMusicSymbol()

virtual void NullGDevice::DrawMusicSymbol ( float  x,
float  y,
unsigned int  inSymbolID 
)
inlinevirtual

Writes the music symbol specified by the input inSymbolID at the specified location, using the currently selected music font, background color, and text color.

Implements VGDevice.

◆ DrawString()

virtual void NullGDevice::DrawString ( float  x,
float  y,
const char *  s,
int  inCharCount 
)
inlinevirtual

Writes the specified inCharCount number of text characters at the specified location, using the currently selected text font, background color, and text color.

Implements VGDevice.

◆ Ellipse()

virtual void NullGDevice::Ellipse ( float  x,
float  y,
float  width,
float  height,
const VGColor color 
)
inlinevirtual

Draws a filled ellipse.

Implements VGDevice.

◆ EndDraw()

virtual void NullGDevice::EndDraw ( )
inlinevirtual

Restores the device's context after a set of drawing operations. and restore the previous one (like the previous RestoreDC() method). This method should be used after every set of drawing operation.

Implements VGDevice.

◆ Frame()

virtual void NullGDevice::Frame ( float  left,
float  top,
float  right,
float  bottom 
)
inlinevirtual

Draws a frame using the specified coordinates. The frame is outlined by using the current pen, but not filled.

Implements VGDevice.

◆ FrameEllipse()

virtual void NullGDevice::FrameEllipse ( float  x,
float  y,
float  width,
float  height 
)
inlinevirtual

Draws an ellipse.

Implements VGDevice.

◆ GetBitMapPixels()

virtual void* NullGDevice::GetBitMapPixels ( )
inlinevirtual

Allows pixels operations and returns a pointer to the bitmap pixels.

Implements VGDevice.

◆ GetDPITag()

virtual float NullGDevice::GetDPITag ( ) const
inlinevirtual

Returns the printing resolution of the current VGDevice.

Implements VGDevice.

◆ GetFontAlign()

virtual unsigned int NullGDevice::GetFontAlign ( ) const
inlinevirtual

Returns the text/music alignment mode of the current VGDevice. See enum VTextAlignMode above.

Implements VGDevice.

◆ GetFontBackgroundColor()

virtual VGColor NullGDevice::GetFontBackgroundColor ( ) const
inlinevirtual

Returns the text/music background color of the current VGDevice.

Implements VGDevice.

◆ GetFontColor()

virtual VGColor NullGDevice::GetFontColor ( ) const
inlinevirtual

Returns the text/music color of the current VGDevice.

Implements VGDevice.

◆ GetHeight()

virtual int NullGDevice::GetHeight ( ) const
inlinevirtual

Returns the height (set via NotifySize) of the current VGDevice.

Implements VGDevice.

◆ GetImageData()

virtual const char* NullGDevice::GetImageData ( const char *&  outDataPtr,
int &  outLength 
)
inlinevirtual

Gives the current device data and returns the data associated mime type.

Implements VGDevice.

◆ GetMusicFont()

virtual const VGFont* NullGDevice::GetMusicFont ( ) const
inlinevirtual

Returns the currently selected music VGFont.

Implements VGDevice.

◆ GetNativeContext()

virtual void* NullGDevice::GetNativeContext ( ) const
inlineprotectedvirtual

Returns the platform-specific device context object.

Implements VGDevice.

◆ GetRasterOpMode()

virtual VRasterOpMode NullGDevice::GetRasterOpMode ( ) const
inlinevirtual

Retrieves the foreground mix mode of the specified device. The mix mode specifies how the pen or interior color and the color already on the device are combined to yield a new color.

Implements VGDevice.

◆ GetTextFont()

virtual const VGFont* NullGDevice::GetTextFont ( ) const
inlinevirtual

Returns the currently selected text VGFont.

Implements VGDevice.

◆ getVGSystem()

virtual VGSystem* NullGDevice::getVGSystem ( ) const
inlinevirtual

temporary hack - must be removed asap

Implements VGDevice.

◆ GetWidth()

virtual int NullGDevice::GetWidth ( ) const
inlinevirtual

Returns the width (set via NotifySize) of the current VGDevice.

Implements VGDevice.

◆ GetXOrigin()

virtual float NullGDevice::GetXOrigin ( ) const
inlinevirtual

Implements VGDevice.

◆ GetXScale()

virtual float NullGDevice::GetXScale ( ) const
inlinevirtual

GetXScale, GetYScale, GetXOrigin, GetYOrigin : get VGDevice's scaling/coordinate atributes.

Implements VGDevice.

◆ GetYOrigin()

virtual float NullGDevice::GetYOrigin ( ) const
inlinevirtual

Implements VGDevice.

◆ GetYScale()

virtual float NullGDevice::GetYScale ( ) const
inlinevirtual

Implements VGDevice.

◆ InvalidateRect()

virtual void NullGDevice::InvalidateRect ( float  left,
float  top,
float  right,
float  bottom 
)
inlinevirtual

Invalidate a rectangle i.e. indicates the native graphic device that the corresponding rectangle needs to be refreshed.

Implements VGDevice.

◆ IsValid()

virtual bool NullGDevice::IsValid ( ) const
inlinevirtual

Returns the ability of the current VGdevice to be drawn into.

Implements VGDevice.

◆ Line()

virtual void NullGDevice::Line ( float  x1,
float  y1,
float  x2,
float  y2 
)
inlinevirtual

Draws a line from the position specified by (x1,y1) up to, but not including, the point specified by (x2,y2).

Implements VGDevice.

◆ LineTo()

virtual void NullGDevice::LineTo ( float  x,
float  y 
)
inlinevirtual

Draws a line from the current position up to, but not including, the point specified by (x,y).

Implements VGDevice.

◆ LogicalToDevice()

virtual void NullGDevice::LogicalToDevice ( float *  x,
float *  y 
) const
inlinevirtual

Computes input coordinates to get their values in the current VGDevice coordinate system.

Implements VGDevice.

◆ MoveTo()

virtual void NullGDevice::MoveTo ( float  x,
float  y 
)
inlinevirtual

Moves the current position to the point specified by (x,y).

Implements VGDevice.

◆ NotifySize()

virtual void NullGDevice::NotifySize ( int  inWidth,
int  inHeight 
)
inlinevirtual

Sets the size of the current VGDevice. Use this method to update the derived device's attributes and actual size.

Implements VGDevice.

◆ OffsetOrigin()

virtual void NullGDevice::OffsetOrigin ( float  x,
float  y 
)
inlinevirtual

Offsets the current VGDevice's origin (see above).

Implements VGDevice.

◆ Polygon()

virtual void NullGDevice::Polygon ( const float *  xCoords,
const float *  yCoords,
int  count 
)
inlinevirtual

Draws a polygon consisting of count vertices connected by straight lines. The polygon is NOT outlined but simply filled using the current fill color.

Implements VGDevice.

◆ PopFillColor()

virtual void NullGDevice::PopFillColor ( )
inlinevirtual

Restores the previous color brush from the stack into the current VGDevice. This method was previously called PopBrush().

Implements VGDevice.

◆ PopPen()

virtual void NullGDevice::PopPen ( )
inlinevirtual

Restores the previous VGPen object from the stack into the current VGDevice.

Implements VGDevice.

◆ PopPenColor()

virtual void NullGDevice::PopPenColor ( )
inlinevirtual

Implements VGDevice.

◆ PopPenWidth()

virtual void NullGDevice::PopPenWidth ( )
inlinevirtual

Implements VGDevice.

◆ PushFillColor()

virtual void NullGDevice::PushFillColor ( const VGColor inColor)
inlinevirtual

Saves the current color brush and selects the new one using the specified VGColor into the current VGDevice. This method was previously called PushBrush().

Implements VGDevice.

◆ PushPen()

virtual void NullGDevice::PushPen ( const VGColor inColor,
float  inWidth 
)
inlinevirtual

Saves the current VGPen and selects the new one using the specified VGColor and width into the current VGDevice.

Implements VGDevice.

◆ PushPenColor()

virtual void NullGDevice::PushPenColor ( const VGColor inColor)
inlinevirtual

Implements VGDevice.

◆ PushPenWidth()

virtual void NullGDevice::PushPenWidth ( float  width)
inlinevirtual

Implements VGDevice.

◆ Rectangle()

virtual void NullGDevice::Rectangle ( float  left,
float  top,
float  right,
float  bottom 
)
inlinevirtual

Draws a rectangle. The rectangle is NOT outlined but simply filled using the current fill color.

Implements VGDevice.

◆ ReleaseBitMapPixels()

virtual void NullGDevice::ReleaseBitMapPixels ( )
inlinevirtual

Update bitmap pixels and ends pixels operations.

Implements VGDevice.

◆ ReleaseImageData()

virtual void NullGDevice::ReleaseImageData ( const char *  ) const
inlinevirtual

Release the pointer returned by GetImageData.

Implements VGDevice.

◆ SelectFillColor()

virtual void NullGDevice::SelectFillColor ( const VGColor c)
inlinevirtual

Creates a new solid brush (to paint the interiors of filled shapes) with the specified VGColor and selects it into the current VGDevice. This method was previously called SelectBrush().

Implements VGDevice.

◆ SelectPen()

virtual void NullGDevice::SelectPen ( const VGColor inColor,
float  witdh 
)
inlinevirtual

Creates a new VGPen object with the specified VGColor and width and selects it into the current VGDevice.

Implements VGDevice.

◆ SelectPenColor()

virtual void NullGDevice::SelectPenColor ( const VGColor inColor)
inlinevirtual

Creates a new VGPen object with the specified VGColor.

Implements VGDevice.

◆ SelectPenWidth()

virtual void NullGDevice::SelectPenWidth ( float  witdh)
inlinevirtual

Creates a new VGPen object with the specified VGColor.

Implements VGDevice.

◆ SetDPITag()

virtual void NullGDevice::SetDPITag ( float  inDPI = 72.0f)
inlinevirtual

Sets the printing resolution of the current VGDevice.

Implements VGDevice.

◆ SetFontAlign()

virtual void NullGDevice::SetFontAlign ( unsigned int  inAlign)
inlinevirtual

Sets the text/music alignment mode of the current VGDevice. See enum VTextAlignMode above.

Implements VGDevice.

◆ SetFontBackgroundColor()

virtual void NullGDevice::SetFontBackgroundColor ( const VGColor inColor)
inlinevirtual

Sets the text/music background color for the current VGDevice.

Implements VGDevice.

◆ SetFontColor()

virtual void NullGDevice::SetFontColor ( const VGColor inColor)
inlinevirtual

Sets the text/music color for the current VGDevice.

Implements VGDevice.

◆ SetMusicFont()

virtual void NullGDevice::SetMusicFont ( const VGFont font)
inlinevirtual

Selects the specified music VGFont into the current VGDevice. Warning ! this method doesn't return the previously selected font anymore. Use GetMusicFont() instead.

Implements VGDevice.

◆ SetOrigin()

virtual void NullGDevice::SetOrigin ( float  x,
float  y 
)
inlinevirtual

Specifies which VGDevice point (x,y) maps to the window origin (0,0).

Implements VGDevice.

◆ SetRasterOpMode()

virtual void NullGDevice::SetRasterOpMode ( VRasterOpMode  ROpMode)
inlinevirtual

Sets the current foreground mix mode. We use the foreground mix mode to combine pens and interiors of filled objects with the colors already on the device. The foreground mix mode defines how colors from the brush or pen and the colors in the existing image are to be combined. See enum VRasterOpMode above.

Implements VGDevice.

◆ SetScale()

virtual void NullGDevice::SetScale ( float  x,
float  y 
)
inlinevirtual

Sets the scale factors of the current VGDevice to the input values.

Implements VGDevice.

◆ SetTextFont()

virtual void NullGDevice::SetTextFont ( const VGFont font)
inlinevirtual

Selects the specified text VGFont into the current VGDevice. Warning ! this method doesn't return the previously selected font anymore. Use GetMusicFont() instead.

Implements VGDevice.

◆ Triangle()

virtual void NullGDevice::Triangle ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)
inlinevirtual

Draws a triangle consisting of three points connected by straight lines. The triangle is NOT outlined but simply filled using the current fill color.

Implements VGDevice.


Guido Project Copyright © 2019 Grame-CNCM