Public Member Functions

GR_AllocInfo Class Reference

#include <gr_Graphics.h>

Inheritance diagram for GR_AllocInfo:
GR_CairoAllocInfo GR_CairoNullGraphicsAllocInfo GR_QtAllocInfo GR_Win32AllocInfo GR_UnixCairoAllocInfo

List of all members.

Public Member Functions

virtual ~GR_AllocInfo ()
virtual GR_GraphicsId getType () const
virtual bool isPrinterGraphics () const

Detailed Description

The following class serves as an argument to GR_GraphicsFactory::newGraphics()

There should be only one derived class for each platform (not each graphics), capable of holding information for all different graphics classes on the platform.

For example, on Unix we have three different classes with the following constructors:

GR_UnixGraphics(GdkWindow * win, XAP_UnixFontManager * fontManager, XAP_App *app)

PS_Graphics(const char * szFilename, const char * szTitle, const char * szSoftwareNameAndVersion, XAP_UnixFontManager * fontManager, bool bIsFile, XAP_App *pApp);

UnixNull_Graphics(XAP_UnixFontManager * fontManager,XAP_App *pApp);

GR_UnixAllocInfo will need to be able to hold parameters for all the constructors, something like

class GR_UnixAllocInfo { GdkWindow * win; XAP_UnixFontManager * fontManager; XAP_App * app; const char * szFilename; const char * szTitle; const char * szSoftwareNameAndVersion; bool bIsFile; };

This does impose some limitations on classes implemented as plugins: if the plugin class needs something that is not in the platform class and cannot obtain it by other means (for example by quering XAP_App), the AllocInfo class will need to be extended.

Platform implementation needs to override getType() so that graphicsAllocator() can do type-checking.


Constructor & Destructor Documentation

virtual GR_AllocInfo::~GR_AllocInfo (  )  [inline, virtual]

Member Function Documentation

virtual bool GR_AllocInfo::isPrinterGraphics (  )  const [inline, virtual]

The documentation for this class was generated from the following file: