#include <gr_Graphics.h>
Public Member Functions | |
virtual | ~GR_AllocInfo () |
virtual GR_GraphicsId | getType () const |
virtual bool | isPrinterGraphics () const |
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.
virtual GR_AllocInfo::~GR_AllocInfo | ( | ) | [inline, virtual] |
virtual GR_GraphicsId GR_AllocInfo::getType | ( | void | ) | const [inline, virtual] |
Reimplemented in GR_QtAllocInfo, GR_Win32AllocInfo, GR_CairoAllocInfo, and GR_CairoNullGraphicsAllocInfo.
References UT_ASSERT_HARMLESS, and UT_NOT_IMPLEMENTED.
Referenced by GR_Win32USPGraphics::graphicsAllocator(), GR_Win32Graphics::graphicsAllocator(), GR_UnixCairoGraphics::graphicsAllocator(), and GR_QtGraphics::graphicsAllocator().
virtual bool GR_AllocInfo::isPrinterGraphics | ( | ) | const [inline, virtual] |
Reimplemented in GR_QtAllocInfo, GR_Win32AllocInfo, GR_CairoAllocInfo, and GR_CairoNullGraphicsAllocInfo.
References UT_ASSERT_HARMLESS, and UT_NOT_IMPLEMENTED.
Referenced by XAP_App::newGraphics().