IrrIMGUI  0.3.1
Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
IrrIMGUI::UnitTest::IIMGUIHandleMock Class Reference

#include <IIMGUIHandleMock.h>

Inheritance diagram for IrrIMGUI::UnitTest::IIMGUIHandleMock:
Inheritance graph
[legend]
Collaboration diagram for IrrIMGUI::UnitTest::IIMGUIHandleMock:
Collaboration graph
[legend]

Public Member Functions

IIMGUIHandle methods that are mocked
 IIMGUIHandleMock (irr::IrrlichtDevice *const pDevice, IrrIMGUI::CIMGUIEventStorage *const pEventStorage=nullptr, IrrIMGUI::SIMGUISettings const *const pSettings=nullptr)
 
virtual ~IIMGUIHandleMock (void)
 
virtual void startGUI (void)
 Call this methods before you draw the IMGUI elements and before calling "drawAll()". More...
 
virtual void drawAll (void)
 Call this function after "startGUI()" and after you draw your GUI elements. It will render all elements to the screen (do not call it before rendering the 3D Scene!). More...
 
virtual IrrIMGUI::SIMGUISettings const & getSettings (void) const
 
virtual void setSettings (IrrIMGUI::SIMGUISettings const &rSettings)
 
virtual ImFont * addFont (ImFontConfig const *pFontConfig)
 Adds a font to the IMGUI memory. More...
 
virtual ImFont * addDefaultFont (ImFontConfig const *pFontConfig=NULL)
 Adds the default font to the IMGUI memory. More...
 
virtual ImFont * addFontFromFileTTF (char const *pFileName, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, ImWchar const *pGlyphRanges=NULL)
 Adds a font from a TTF file to the IMGUI memory. More...
 
virtual ImFont * addFontFromMemoryTTF (void *pTTFData, int TTFSize, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, ImWchar const *pGlyphRanges=NULL)
 Adds a font from a TTF byte array to the IMGUI memory. More...
 
virtual ImFont * addFontFromMemoryCompressedTTF (void const *pCompressedTTFData, int CompressedTTFSize, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, ImWchar const *pGlyphRanges=NULL)
 Adds a font from a compressed TTF byte array to the IMGUI memory. More...
 
virtual ImFont * addFontFromMemoryCompressedBase85TTF (char const *pCompressedTTFDataBase85, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, const ImWchar *pGlyphRanges=NULL)
 Adds a font from a compressed TTF byte array that uses the base85 character encoding to the IMGUI memory. More...
 
virtual void compileFonts (void)
 This function copies all fonts that have been added with "addFont/addDefaultFont" into graphic memory. More...
 
virtual void resetFonts (void)
 Resets the font memory and restores the default font as the one and only font in the system. More...
 
virtual ImWchar const * getGlyphRangesDefault (void)
 
virtual ImWchar const * getGlyphRangesJapanese (void)
 
virtual ImWchar const * getGlyphRangesChinese (void)
 
virtual ImWchar const * getGlyphRangesCyrillic (void)
 
virtual IrrIMGUI::IGUITexturecreateTexture (irr::video::IImage *pImage)
 Creates a GUI texture object out of an Irrlicht image. More...
 
virtual IrrIMGUI::IGUITexturecreateTexture (irr::video::ITexture *pTexture)
 Creates a GUI texture object out of an Irrlicht texture. More...
 
virtual void updateTexture (IrrIMGUI::IGUITexture *pGUITexture, irr::video::IImage *pImage)
 Updates a GUI texture object with an Irrlicht image. More...
 
virtual void updateTexture (IrrIMGUI::IGUITexture *pGUITexture, irr::video::ITexture *pTexture)
 Updates a GUI texture object with an Irrlicht texture. More...
 
virtual void deleteTexture (IrrIMGUI::IGUITexture *pGUITexture)
 Deletes an texture from graphic memory. More...
 
- Public Member Functions inherited from IrrIMGUI::IIMGUIHandle
virtual ~IIMGUIHandle (void)
 Destructor. More...
 
- Public Member Functions inherited from IrrIMGUI::IReferenceCounter
 IReferenceCounter (void)
 Constructor. More...
 
virtual ~IReferenceCounter (void)
 Destructor. More...
 
virtual void grab (void)
 Call this method to grab an instance. More...
 
virtual void drop (void)
 Call this method to drop an instance. If you drop the last used instance, the object is destroyed. More...
 
virtual irr::u32 getReferenceCount (void) const
 

Static Public Member Functions

Methods to control the behavior of the Mock.
static void enableMock (void)
 
static void disableMock (void)
 
static void enableIMGUICalls (bool const Enable=true)
 
static void disableIMGUICalls (void)
 
static bool areIMGUICallsEnabled (void)
 

Private Member Functions

ImFont * getDummyFont (void)
 
ImWchar const * getGlyphRangesDummy (void)
 

Static Private Member Functions

static IIMGUIHandlecreateMock (irr::IrrlichtDevice *const pDevice, IrrIMGUI::CIMGUIEventStorage *const pEventStorage=nullptr, IrrIMGUI::SIMGUISettings const *const pSettings=nullptr)
 Factory method for the mock. More...
 
static void drawGUIList (ImDrawData *pDrawData)
 Dummy draw method. More...
 

Private Attributes

IrrIMGUI::SIMGUISettings mDefaultSettings
 A dummy object for storing default settings. More...
 
irr::IrrlichtDevice *const mpDevice
 Stores the Irrlicht device pointer. More...
 
IrrIMGUI::CIMGUIEventStorage *const mpEventStorage
 Stores a pointer to an Event Storage. More...
 
irr::f32 mLastTime
 Stores the last time in seconds, when an update was done. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IrrIMGUI::IIMGUIHandle
 IIMGUIHandle (void)
 Forbidden Constructor. More...
 

Detailed Description

Definition at line 53 of file IIMGUIHandleMock.h.

Constructor & Destructor Documentation

IrrIMGUI::UnitTest::IIMGUIHandleMock::IIMGUIHandleMock ( irr::IrrlichtDevice *const  pDevice,
IrrIMGUI::CIMGUIEventStorage *const  pEventStorage = nullptr,
IrrIMGUI::SIMGUISettings const *const  pSettings = nullptr 
)
inline

Definition at line 59 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual IrrIMGUI::UnitTest::IIMGUIHandleMock::~IIMGUIHandleMock ( void  )
inlinevirtual

Definition at line 74 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

Member Function Documentation

virtual ImFont* IrrIMGUI::UnitTest::IIMGUIHandleMock::addDefaultFont ( ImFontConfig const *  pFontConfig = NULL)
inlinevirtual

Adds the default font to the IMGUI memory.

Parameters
pFontConfigIs a pointer to the font configuration.
Returns
Returns a pointer to the font for later usage with PushFont(...) to activate this font.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 135 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual ImFont* IrrIMGUI::UnitTest::IIMGUIHandleMock::addFont ( ImFontConfig const *  pFontConfig)
inlinevirtual

Adds a font to the IMGUI memory.

Parameters
pFontConfigIs a pointer to the font configuration.
Returns
Returns a pointer to the font for later usage with PushFont(...) to activate this font.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 128 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual ImFont* IrrIMGUI::UnitTest::IIMGUIHandleMock::addFontFromFileTTF ( char const *  pFileName,
float  FontSizeInPixel,
ImFontConfig const *  pFontConfig = NULL,
ImWchar const *  pGlyphRanges = NULL 
)
inlinevirtual

Adds a font from a TTF file to the IMGUI memory.

Parameters
pFileNameIs the name of the file to add.
FontSizeInPixelIs the desired font size to use.
pFontConfigIs a pointer to the font configuration.
pGlyphRangesIs the Glyph-Range to select the correct character set.
Returns
Returns a pointer to the font for later usage with PushFont(...) to activate this font.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 142 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual ImFont* IrrIMGUI::UnitTest::IIMGUIHandleMock::addFontFromMemoryCompressedBase85TTF ( char const *  pCompressedTTFDataBase85,
float  FontSizeInPixel,
ImFontConfig const *  pFontConfig = NULL,
const ImWchar *  pGlyphRanges = NULL 
)
inlinevirtual

Adds a font from a compressed TTF byte array that uses the base85 character encoding to the IMGUI memory.

Parameters
pCompressedTTFDataBase85Is a pointer to the char array.
FontSizeInPixelIs the desired font size to use.
pFontConfigIs a pointer to the font configuration.
pGlyphRangesIs the Glyph-Range to select the correct character set.
Returns
Returns a pointer to the font for later usage with PushFont(...) to activate this font.
Note
This function does not transfer the ownership of the byte array. You are responsible for delete this memory after the font is in graphic memory.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 163 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual ImFont* IrrIMGUI::UnitTest::IIMGUIHandleMock::addFontFromMemoryCompressedTTF ( void const *  pCompressedTTFData,
int  CompressedTTFSize,
float  FontSizeInPixel,
ImFontConfig const *  pFontConfig = NULL,
ImWchar const *  pGlyphRanges = NULL 
)
inlinevirtual

Adds a font from a compressed TTF byte array to the IMGUI memory.

Parameters
pCompressedTTFDataIs a pointer to the byte array.
CompressedTTFSizeIs the size of the array in byte.
FontSizeInPixelIs the desired font size to use.
pFontConfigIs a pointer to the font configuration.
pGlyphRangesIs the Glyph-Range to select the correct character set.
Returns
Returns a pointer to the font for later usage with PushFont(...) to activate this font.
Note
This function does not transfer the ownership of the byte array. You are responsible for delete this memory after the font is in graphic memory.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 156 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual ImFont* IrrIMGUI::UnitTest::IIMGUIHandleMock::addFontFromMemoryTTF ( void *  pTTFData,
int  TTFSize,
float  FontSizeInPixel,
ImFontConfig const *  pFontConfig = NULL,
ImWchar const *  pGlyphRanges = NULL 
)
inlinevirtual

Adds a font from a TTF byte array to the IMGUI memory.

Parameters
pTTFDataIs a pointer to the byte array.
TTFSizeIs the size of the array in byte.
FontSizeInPixelIs the desired font size to use.
pFontConfigIs a pointer to the font configuration.
pGlyphRangesIs the Glyph-Range to select the correct character set.
Returns
Returns a pointer to the font for later usage with PushFont(...) to activate this font.
Attention
This function transfers the ownership of 'pTTFData' to the IMGUI System and will be deleted automatically. Do not delete it by yourself!

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 149 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

static bool IrrIMGUI::UnitTest::IIMGUIHandleMock::areIMGUICallsEnabled ( void  )
inlinestatic

Definition at line 310 of file IIMGUIHandleMock.h.

Here is the caller graph for this function:

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::compileFonts ( void  )
inlinevirtual

This function copies all fonts that have been added with "addFont/addDefaultFont" into graphic memory.

Attention
Call this function before using the fonts that have been added.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 170 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

static IIMGUIHandle* IrrIMGUI::UnitTest::IIMGUIHandleMock::createMock ( irr::IrrlichtDevice *const  pDevice,
IrrIMGUI::CIMGUIEventStorage *const  pEventStorage = nullptr,
IrrIMGUI::SIMGUISettings const *const  pSettings = nullptr 
)
inlinestaticprivate

Factory method for the mock.

Definition at line 353 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual IrrIMGUI::IGUITexture* IrrIMGUI::UnitTest::IIMGUIHandleMock::createTexture ( irr::video::IImage *  pImage)
inlinevirtual

Creates a GUI texture object out of an Irrlicht image.

Parameters
pImageIs a pointer to an Irrlicht image object.
Returns
Returns an GUI texture object.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 247 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual IrrIMGUI::IGUITexture* IrrIMGUI::UnitTest::IIMGUIHandleMock::createTexture ( irr::video::ITexture *  pTexture)
inlinevirtual

Creates a GUI texture object out of an Irrlicht texture.

Parameters
pTextureIs a pointer to an Irrlicht texture object.
Returns
Returns an GUI texture object.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 254 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::deleteTexture ( IrrIMGUI::IGUITexture pGUITexture)
inlinevirtual

Deletes an texture from graphic memory.

Parameters
pGUITextureIs a pointer to the texture to delete. Do not use it afterwards!

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 275 of file IIMGUIHandleMock.h.

static void IrrIMGUI::UnitTest::IIMGUIHandleMock::disableIMGUICalls ( void  )
inlinestatic

Definition at line 304 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

static void IrrIMGUI::UnitTest::IIMGUIHandleMock::disableMock ( void  )
inlinestatic

Definition at line 292 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::drawAll ( void  )
inlinevirtual

Call this function after "startGUI()" and after you draw your GUI elements. It will render all elements to the screen (do not call it before rendering the 3D Scene!).

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 100 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

static void IrrIMGUI::UnitTest::IIMGUIHandleMock::drawGUIList ( ImDrawData *  pDrawData)
inlinestaticprivate

Dummy draw method.

Definition at line 359 of file IIMGUIHandleMock.h.

Here is the caller graph for this function:

static void IrrIMGUI::UnitTest::IIMGUIHandleMock::enableIMGUICalls ( bool const  Enable = true)
inlinestatic

Definition at line 298 of file IIMGUIHandleMock.h.

Here is the caller graph for this function:

static void IrrIMGUI::UnitTest::IIMGUIHandleMock::enableMock ( void  )
inlinestatic

Definition at line 286 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

ImFont* IrrIMGUI::UnitTest::IIMGUIHandleMock::getDummyFont ( void  )
inlineprivate
Returns
Returns a dummy font in case of IMGUI is enabled or nullptr, when IMGUI is disabled.

Definition at line 331 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual ImWchar const* IrrIMGUI::UnitTest::IIMGUIHandleMock::getGlyphRangesChinese ( void  )
inlinevirtual
Returns
Returns the Japanese + full set of about 21000 CJK Unified Ideographs

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 221 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual ImWchar const* IrrIMGUI::UnitTest::IIMGUIHandleMock::getGlyphRangesCyrillic ( void  )
inlinevirtual
Returns
Default + about 400 Cyrillic characters

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 234 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual ImWchar const* IrrIMGUI::UnitTest::IIMGUIHandleMock::getGlyphRangesDefault ( void  )
inlinevirtual
Returns
Returns the Basic Latin and Extended Latin Range.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 195 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

ImWchar const* IrrIMGUI::UnitTest::IIMGUIHandleMock::getGlyphRangesDummy ( void  )
inlineprivate
Returns
Returns a dummy glyph range.

Definition at line 343 of file IIMGUIHandleMock.h.

Here is the caller graph for this function:

virtual ImWchar const* IrrIMGUI::UnitTest::IIMGUIHandleMock::getGlyphRangesJapanese ( void  )
inlinevirtual
Returns
Returns the Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 208 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual IrrIMGUI::SIMGUISettings const& IrrIMGUI::UnitTest::IIMGUIHandleMock::getSettings ( void  ) const
inlinevirtual
Returns
Returns a constant reference to the currently applied settings structure.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 112 of file IIMGUIHandleMock.h.

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::resetFonts ( void  )
inlinevirtual

Resets the font memory and restores the default font as the one and only font in the system.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 182 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::setSettings ( IrrIMGUI::SIMGUISettings const &  rSettings)
inlinevirtual
Parameters
rSettingsis a reference to a Setting structure that should be applied.
Note
The settings are applied to all GUI handles at the same time, since IMGUI uses internally a single instance.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 120 of file IIMGUIHandleMock.h.

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::startGUI ( void  )
inlinevirtual

Call this methods before you draw the IMGUI elements and before calling "drawAll()".

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 87 of file IIMGUIHandleMock.h.

Here is the call graph for this function:

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::updateTexture ( IrrIMGUI::IGUITexture pGUITexture,
irr::video::IImage *  pImage 
)
inlinevirtual

Updates a GUI texture object with an Irrlicht image.

Parameters
pGUITextureIs a pointer to the GUI texture object.
pImageIs a pointer to an Irrlicht image object.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 261 of file IIMGUIHandleMock.h.

virtual void IrrIMGUI::UnitTest::IIMGUIHandleMock::updateTexture ( IrrIMGUI::IGUITexture pGUITexture,
irr::video::ITexture *  pTexture 
)
inlinevirtual

Updates a GUI texture object with an Irrlicht texture.

Parameters
pGUITextureIs a pointer to the GUI texture object.
pTextureIs a pointer to an Irrlicht image object.

Implements IrrIMGUI::IIMGUIHandle.

Definition at line 268 of file IIMGUIHandleMock.h.

Member Data Documentation

IrrIMGUI::SIMGUISettings IrrIMGUI::UnitTest::IIMGUIHandleMock::mDefaultSettings
private

A dummy object for storing default settings.

Definition at line 319 of file IIMGUIHandleMock.h.

irr::f32 IrrIMGUI::UnitTest::IIMGUIHandleMock::mLastTime
private

Stores the last time in seconds, when an update was done.

Definition at line 328 of file IIMGUIHandleMock.h.

irr::IrrlichtDevice* const IrrIMGUI::UnitTest::IIMGUIHandleMock::mpDevice
private

Stores the Irrlicht device pointer.

Definition at line 322 of file IIMGUIHandleMock.h.

IrrIMGUI::CIMGUIEventStorage* const IrrIMGUI::UnitTest::IIMGUIHandleMock::mpEventStorage
private

Stores a pointer to an Event Storage.

Definition at line 325 of file IIMGUIHandleMock.h.


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