dblbuffer.cpp, paratest.cpp, and sigc.cpp.
Public Types | |
enum | CursorMode { QUERY, NONE, HARDWARE, SOFTWARE } |
Cursor mode. More... | |
enum | { IDAPPLICATION = PG_WIDGETID_INTERNAL + 100 } |
Public Member Functions | |
PG_Application () | |
~PG_Application () | |
bool | InitScreen (int w, int h, int depth=0, Uint32 flags=SDL_SWSURFACE|SDL_HWPALETTE) |
Initialize the screen. | |
PG_Theme * | LoadTheme (const char *xmltheme, bool asDefault=true, const char *searchpath=NULL) |
Load a widget theme. | |
SDL_Thread * | Run (bool threaded=false) |
Run the applications main eventloop. | |
void | Quit () |
Exit the main eventloop. | |
SDL_Surface * | SetScreen (SDL_Surface *screen) |
Set a custom screen surface. | |
bool | SetBackground (const char *filename, int mode=BKMODE_TILE) |
Set the application's background image. | |
bool | SetBackground (SDL_Surface *surface, int mode=BKMODE_TILE) |
Set the application's background image. | |
void | SetEmergencyQuit (bool esc) |
Enable / disable the emergency quit key ("ESC"). | |
void | PrintVideoTest () |
Outputs some information about the current video target (only with DEBUG enabled). | |
void | EnableBackground (bool enable=true) |
void | DeleteBackground () |
void | EnableAppIdleCalls (bool enable=true) |
Set AppIdleCalls. | |
void | SetIcon (const char *filename) |
Set application`s window-manager icon. | |
void | SetCaption (const char *title, const char *icon) |
Set application`s window-manager title and icon name. | |
void | GetCaption (char **title, char **icon) |
Get application`s window-manager title and icon name. | |
int | Iconify (void) |
Iconify/Minimise the window-manager window. | |
Static Public Member Functions | |
int | RunEventLoop (void *data) |
Run the modal message pump. | |
SDL_Surface * | GetScreen () |
Get the current screen surface. | |
bool | LockScreen () |
Set a lock on the screen surface (to avoid concurrent drawing operations). | |
bool | UnlockScreen () |
Unlock the screen surface. | |
void | RedrawBackground (const PG_Rect &rect) |
Redraw the application background. | |
void | SetApplicationPath (const char *path) |
Add an application search path. | |
const char * | GetApplicationPath () |
Return the current application path. | |
const char * | GetRelativePath (const char *file) |
Tries to find a specifies file. | |
int | GetScreenHeight () |
Get the current screen (or window) height. | |
int | GetScreenWidth () |
Get the current screen (or window) width. | |
void | FlipPage () |
Do a page flip (only for double buffered screens). | |
PG_Theme * | GetTheme () |
Get the current default widgettheme. | |
bool | GetBulkMode () |
Check if the application is currently in bulk mode. | |
void | SetBulkMode (bool bulk=true) |
Set the bulk mode. | |
bool | GetGLMode () |
bool | LoadLayout (const char *name) |
Load layout from the XML file. | |
bool | LoadLayout (const char *name, void(*WorkCallback)(int now, int max)) |
Load layout from the XML file. | |
bool | LoadLayout (const char *name, void(*WorkCallback)(int now, int max), void *UserSpace) |
Load layout from the XML file. | |
PG_Widget * | GetWidgetByName (const char *Name) |
Get widget by name. | |
template<class T> T * | GetWidget (const char *Name) |
template<class T> T * | GetWidget (int id) |
PG_Widget * | GetWidgetById (int id) |
Get widget by id. | |
void | SetFontColor (const PG_Color &Color) |
Set default font color. | |
void | SetFontAlpha (int Alpha) |
Set default font transparency (!!!). | |
void | SetFontStyle (PG_Font::Style Style) |
Set default font style. | |
void | SetFontSize (int Size) |
Set default font size. | |
void | SetFontIndex (int Index) |
Set default font index. | |
void | SetFontName (const char *Name) |
Set default font name. | |
void | SetCursor (SDL_Surface *image) |
Set a graphical mouse cursor. | |
void | DrawCursor (bool update=true) |
Update the graphical mouse cursor. | |
CursorMode | ShowCursor (CursorMode mode) |
Set or query the type of mouse cursor to use. | |
void | DisableDirtyUpdates (bool disable) |
Disable dirty widget updates. | |
bool | GetDirtyUpdatesDisabled () |
Check if the 'dirty update' mode is disabled globally. | |
PG_Application * | GetApp () |
bool | GetAppIdleCallsEnabled () |
Get the behaviour concerning empty queues (see EnableAppIdleCalls()). | |
void | FlushEventQueue () |
Flush the event queue. | |
void | ClearOldMousePosition () |
If software cursors are enabled and you move the mouse, the old location has to be refreshed somehow with the underlying graphics. | |
Public Attributes | |
SignalQuit | sigQuit |
SignalVideoResize | sigVideoResize |
SignalXMLTag | sigXMLTag |
Static Public Attributes | |
PG_Font * | DefaultFont |
Protected Member Functions | |
void | Shutdown () |
Cleanup the application data. | |
bool | eventKeyUp (const SDL_KeyboardEvent *key) |
Overridable Eventhandler for a SDL_KeyboardEvent message. | |
bool | eventKeyDown (const SDL_KeyboardEvent *key) |
Overridable Eventhandler for a SDL_KeyboardEvent message. | |
bool | eventQuit (int id, PG_MessageObject *widget, unsigned long data) |
Overridable Eventhandler for a SDL_QuitEvent message. | |
bool | eventResize (const SDL_ResizeEvent *event) |
Overridable Eventhandler for a SDL_ResizeEvent message. | |
virtual void | eventInit () |
|
|
|
Cursor mode.
|
|
|
|
|
|
If software cursors are enabled and you move the mouse, the old location has to be refreshed somehow with the underlying graphics. This is done by this function. Note that bulkmode has to be disabled for this function to be called. |
|
|
|
Disable dirty widget updates. This function is used to disable dirty widget updates globally. Dirty updates are usually used to speed up blitting. However, it can cause problems with 'semitransparent' widgets.
|
|
Update the graphical mouse cursor. This will redraw the graphical curser pointer, if enabled. You might need to call this if you stop the normal event loop from running.
|
|
Set AppIdleCalls.
|
|
|
|
|
|
Overridable Eventhandler for a SDL_KeyboardEvent message. This handler is called when a key changed it's state from unpressed to pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
Overridable Eventhandler for a SDL_KeyboardEvent message. This handler is called when a key changed it's state from pressed to unpressed. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
Overridable Eventhandler for a SDL_QuitEvent message. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
Overridable Eventhandler for a SDL_ResizeEvent message. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
Do a page flip (only for double buffered screens).
|
|
Flush the event queue.
|
|
|
|
Get the behaviour concerning empty queues (see EnableAppIdleCalls()).
|
|
Return the current application path.
|
|
Check if the application is currently in bulk mode.
|
|
Get application`s window-manager title and icon name.
|
|
Check if the 'dirty update' mode is disabled globally.
|
|
|
|
Tries to find a specifies file.
|
|
Get the current screen surface.
|
|
Get the current screen (or window) height.
|
|
Get the current screen (or window) width.
|
|
Get the current default widgettheme.
|
|
|
|
|
|
Get widget by id.
|
|
Get widget by name.
|
|
Iconify/Minimise the window-manager window.
|
|
Initialize the screen.
|
|
Load layout from the XML file.
|
|
Load layout from the XML file.
|
|
Load layout from the XML file.
|
|
Load a widget theme.
|
|
Set a lock on the screen surface (to avoid concurrent drawing operations).
|
|
Outputs some information about the current video target (only with DEBUG enabled).
|
|
Exit the main eventloop.
|
|
Redraw the application background.
|
|
Run the applications main eventloop.
|
|
Run the modal message pump. This function will exit when the main window was closed. |
|
Add an application search path.
|
|
Set the application's background image.
|
|
Set the application's background image.
|
|
Set the bulk mode.
|
|
Set application`s window-manager title and icon name.
|
|
Set a graphical mouse cursor. This function makes the cursor use software rendering with the image specified. Note that this can be slow and result in sluggish mouse performance. Note that calling this function doesn't enable software rendering. An additional call to PG_ShowCursor is required.
|
|
Enable / disable the emergency quit key ("ESC").
|
|
Set default font transparency (!!!).
|
|
Set default font color.
|
|
Set default font index.
|
|
Set default font name.
|
|
Set default font size.
|
|
Set default font style.
|
|
Set application`s window-manager icon.
|
|
Set a custom screen surface.
|
|
Set or query the type of mouse cursor to use. This function is used to set or query the type of mouse cursor used. See the documentation for PG_CURSOR_MODE for more details.
|
|
Cleanup the application data.
|
|
Unlock the screen surface.
|
|
|
|
|
|
|
|
|