MityDSP::tcGuiFramework Class Reference
#include <ggui/guiFramework.h>
List of all members.
Public Member Functions |
| tcGuiFramework (tcBench::tsFontDecl *apFontDecls, int anNumFontDecls, tcGuiDspDisplay *apDisplay, tsDspRomFsNode *apDirectory, int EventLoopPrio=5, int UpdateRateMs=100) |
| tcGuiFramework (tcGuiDspDisplay *apDisplay, const char *apDirectory, int EventLoopPrio=5, int UpdateRateMs=100) |
bool | BuildBitmap (const char *apFilename, tcBitmap &arBitMap) |
| ~tcGuiFramework () |
tcView * | GetView (const char *apViewName) |
void | ShowView (const char *apViewName) |
void | SetHomeView (const char *apViewName) |
void | ShowHomeView () |
void | PostEvent (tcGuiEvent &event) |
void | AddTouchscreenHandler (tcDspTouchScreen *apScreen) |
void | AddRemoteFrameBuffer (tcRFBIface *apIface) |
bool | BuildBitmap (tsDspRomFsNode *apNode, tcBitmap &arBitMap) |
void | SetInactivityTimeout (int anTimeout) |
void | EnableScreen (bool abOn) |
void | SetBaseColor (const tsRgb &arColor) |
Protected Member Functions |
void | EventLoop (void) |
void | FlipScreen (void) |
void | TSHandler (tcDspTouchScreen *apScreen) |
Static Protected Member Functions |
static void | DispatchEventLoop (void *apThis) |
static void | DispatchTSHandler (void *apThis, void *apScreen) |
Protected Attributes |
tcGuiDspDisplay * | mpDisplay |
| pointer to graphics display managed
|
int | mnUpdateRateMs |
| update rate for event handling/animation
|
tcFrameBench * | mpBench |
| pointer to ggui master bench object
|
int | mnLoopPrio |
| default event loop priority
|
MBX_Handle | mhEventBox |
| Event mail box.
|
int | mnTicksPerMs |
| number of ticks per ms
|
tcRFBIface * | mpRFBIface |
| remote frame buffer interface
|
char | maHomeView [snHomeViewStrLen+1] |
| "home" view name
|
int | mnInactivityTimer |
| Ms since last user action.
|
int | mnInactivityTimeout |
| timeout for display turn off
|
tsRgb | msBaseColor |
| Background color for things without bitmaps.
|
Static Protected Attributes |
static const int | snHomeViewStrLen = 127 |
Detailed Description
Instances of this class provide framework management for the ggui graphics library.
- See also:
- tcGuiFramework Page
Constructor & Destructor Documentation
tcGuiFramework::tcGuiFramework |
( |
tcBench::tsFontDecl * |
apFontDecls, |
|
|
int |
anNumFontDecls, |
|
|
tcGuiDspDisplay * |
apDisplay, |
|
|
tsDspRomFsNode * |
apFileSystem, |
|
|
int |
EventLoopPrio = 5 , |
|
|
int |
UpdateRateMs = 100 | |
|
) |
| | |
Main Constructor for GGUI framework handling.
Upon construction, a tcGuiFramework class will:
-
initialize a ggui tcBench (using a tcFrameBench implementation)
-
load the provided fonts from the apFontDecls
-
parse the root node of the provided apFileSystem for all image files (those files ending with a ".png or .bmp" extenstion and load/register them with the ggui bench.
-
Locate the skin.xml file and pass it to the ggui bench for parsing.
-
Start an Event Loop thread, which handles events and system paint events.
- Parameters:
-
| apFontDecls | a list of valid font declarations to register with the tcBench |
| anNumFontDecls | the length of the apFontDecls list |
| apDisplay | pointer to valid display screen/object that ggui will use for graphics |
| apFileSystem | pointer to ggui skins directory ROM filesystem objects |
| EventLoopPrio | thread priority that should be used to spawn Event Loop Thread |
| Base | update rate (in milliseconds) to use for simple animation of buttons, etc. |
- Note:
- the Event Loop thread is named "GuiFrameWork"
MityDSP::tcGuiFramework::tcGuiFramework |
( |
tcGuiDspDisplay * |
apDisplay, |
|
|
const char * |
apDirectory, |
|
|
int |
EventLoopPrio = 5 , |
|
|
int |
UpdateRateMs = 100 | |
|
) |
| | |
tcGuiFramework::~tcGuiFramework |
( |
|
) |
|
Desctructor, not typically reached
Member Function Documentation
bool MityDSP::tcGuiFramework::BuildBitmap |
( |
const char * |
apFilename, |
|
|
tcBitmap & |
arBitMap | |
|
) |
| | |
tcView * tcGuiFramework::GetView |
( |
const char * |
apViewName |
) |
|
This is utility method to allow external (non-framework) user classes to have access to a view (or a "screen") and it's objects. This class allows external objects to assign system callbacks, etc., to the ggui widgets without having to interface directly with the underlying tcBench objects.
- Parameters:
-
| apViewName | name of the view object requested |
- Returns:
- pointer to the requested view or NULL if no view is found
void tcGuiFramework::ShowView |
( |
const char * |
apViewName |
) |
|
Shows the specified view on the graphics display.
- Parameters:
-
| apViewName | desired view name to show |
void tcGuiFramework::SetHomeView |
( |
const char * |
apViewName |
) |
|
Sets the "Home" view for this framework. This is the view that gets shown when ShowHomeView() is called, making it an easy operation to go back to a sort of home or base view from any other view.
- Parameters:
-
| apViewName | desired view name to set as home |
void tcGuiFramework::ShowHomeView |
( |
|
) |
|
Shows the view that was previously set as the home view
void tcGuiFramework::PostEvent |
( |
tcGuiEvent & |
event |
) |
|
Post a GGUI event to the tcFramework Event Loop. This routine allows external device drivers to post mouse or keyboard events to the ggui framework without direct access to the tcBench object.
- Parameters:
-
void tcGuiFramework::AddTouchscreenHandler |
( |
tcDspTouchScreen * |
apScreen |
) |
|
This is a utility method that users may call to have the tcGuiFramework class manage / interpret events from a tcDspTocuhScreen and generate appropriate events (via PostEvent) to the tcGuiFramework event loop.
This routine will generate a thread with the name "GuiTouchHandler".
- Parameters:
-
| apScreen | pointer to tcDspTouchScreen device to manage. |
void MityDSP::tcGuiFramework::AddRemoteFrameBuffer |
( |
tcRFBIface * |
apIface |
) |
[inline] |
bool tcGuiFramework::BuildBitmap |
( |
tsDspRomFsNode * |
apNode, |
|
|
tcBitmap & |
arBitMap | |
|
) |
| | |
void MityDSP::tcGuiFramework::SetInactivityTimeout |
( |
int |
anTimeout |
) |
[inline] |
void tcGuiFramework::EnableScreen |
( |
bool |
abOn |
) |
|
Explicitly enable/disable the screen. Typically used to wake up the screen in response to system event...
- Parameters:
-
| abOn | Set to true to enable the screen. |
void MityDSP::tcGuiFramework::SetBaseColor |
( |
const tsRgb & |
arColor |
) |
[inline] |
void tcGuiFramework::DispatchEventLoop |
( |
void * |
apThis |
) |
[static, protected] |
Internal method used dispatch the main event loop thread.
- Parameters:
-
void tcGuiFramework::EventLoop |
( |
void |
|
) |
[protected] |
Main Event Loop
This method comprises of the tcGuiFramework main event loop thread. The event loop waits for incoming events (generated by animation time-outs or mouse clicks, etc.), processes them, and updates the screen accordingly.
void tcGuiFramework::FlipScreen |
( |
void |
|
) |
[protected] |
Flip the screen to show recently drawn data.
This routine is used to manage double (or triple) buffered screen areas in the event loop. Essentially, the visible screen is assigned to the active screen, and the contents of the active screen are copied to the next available screen buffer for future painting (allowing the use of invalid regions for optimized drawing). This screen buffer is then assigned to the active screen for future paint activity.
void tcGuiFramework::DispatchTSHandler |
( |
void * |
apThis, |
|
|
void * |
apScreen | |
|
) |
| | [static, protected] |
Static utility method to dispatch a TouchScreen Event handler.
- Parameters:
-
| apThis | pointer to valid tcGuiFramework object |
| apScreen | pointer to tcDspTouchScreen to Manage |
void tcGuiFramework::TSHandler |
( |
tcDspTouchScreen * |
apScreen |
) |
[protected] |
tcDspTouchScreen Event Handler Method.
This method will monitor a provided touchscreen and generate appropriate ggui based mouse events (left button Up/Down, mouse move events) and hand them to the main tcGuiFramework Event Loop.
- Parameters:
-
| apScreen | pointer to tcDspTouchScreen to Manage |
Member Data Documentation
pointer to graphics display managed
update rate for event handling/animation
pointer to ggui master bench object
default event loop priority
remote frame buffer interface
Ms since last user action.
timeout for display turn off
Background color for things without bitmaps.