csApp Class Reference
[Application]
This class is a top-level CrystalSpace Windowing Toolkit object.
More...
#include <csapp.h>
Inheritance diagram for csApp:

Public Methods | |
csApp (iObjectRegistry *object_reg, csSkin &Skin) | |
Initialize windowing system by giving a system driver and a skin. | |
virtual | ~csApp () |
Deinitialize windowing system. | |
virtual bool | Initialize () |
Set up application layout (read configs, create windows, menus etc). | |
void | SetSkin (csSkin *Skin, bool DeleteOld=true) |
Set the skin of the application. | |
virtual void | StartFrame () |
This is called once per frame by HandleEvent (). | |
virtual void | FinishFrame () |
This is called at the end of every frame. | |
void | FlushEvents () |
Process all events in the queue and refresh the screen. | |
iEvent * | CreateEvent () |
Create a new event object: NEVER create event objects with `new'. | |
void | Post (iEvent *Event) |
Add a previously created event to event queue. | |
void | ShutDown () |
Shut down the program. | |
virtual void | Idle () |
The windowing system is idle: do some lazy work. | |
virtual void | Draw () |
Draw the application background. | |
virtual void | GetFont (iFont *&oFont) |
Return default font and font size. | |
void | SetBackgroundStyle (csAppBackgroundStyle iBackgroundStyle) |
Set application background style. | |
void | Printf (int mode, char const *format,...) |
Display a string on the console using almost usual printf() syntax. | |
void | PrintfV (int mode, char const *format, va_list) |
Display a string on the console using almost usual printf() syntax. | |
bool | LoadTexture (const char *iTexName, const char *iTexParams, int iFlags) |
Add a single texture to application's texture list. | |
virtual void | PrepareTextures () |
Prepare textures for usage (register them with the graphics driver). | |
csWSTexVector * | GetTextures () |
Return application's texture list. | |
iTextureHandle * | GetTexture (const char *Name) |
Find a texture by name. | |
csMouse & | GetMouse () |
Return application's global mouse object. | |
void | SetMouseCursor (csMouseCursorID ID) |
Set mouse cursor pointer. | |
csMouseCursorID | GetMouseCursor () |
Query mouse cursor pointer. | |
csComponent * | CaptureMouse (csComponent *who) |
Capture all mouse events (or disable capture if 0). | |
csComponent * | CaptureKeyboard (csComponent *who) |
Capture all keyboard events (or disable capture if 0). | |
csComponent * | CaptureFocus (csComponent *who) |
Capture all focused events (or disable capture if 0). | |
bool | GetKeyState (int iKey) |
Query the current state of a key. | |
csTicks | GetCurrentTime () |
Query current time. | |
void | WindowList () |
Show window list. | |
void | SetWindowListSize (int iWidth, int iHeight) |
Set window list size. | |
virtual void | Insert (csComponent *comp) |
Insert a child component. | |
virtual void | Delete (csComponent *comp) |
Delete a child component. | |
bool | StartModal (csComponent *comp, iBase *userdata) |
Set modality state on a component. | |
void | StopModal (int iCode=cscmdCancel) |
Stop top-level modality state. | |
csComponent * | GetTopModalComponent () |
Get the top component which is currently modal. | |
iBase * | GetTopModalUserdata () |
Get the userdata for the top modal component. | |
void | Dismiss (int iCode=cscmdCancel) |
Dismiss a dialog box with given return code. | |
virtual bool | PreHandleEvent (iEvent &Event) |
Handle a event before all others. | |
virtual bool | HandleEvent (iEvent &Event) |
Send event to all childs and return processed status. | |
virtual bool | PostHandleEvent (iEvent &Event) |
Handle a event if nobody eaten it. | |
virtual void | NotifyDelete (csComponent *iComp) |
Every time a component is deleted, this routine is called. | |
virtual csSkin * | GetSkin () |
Get the closest in window hierarchy skin object. | |
void | HintAdd (const char *iText, csComponent *iComp) |
Associate a hint with given component. | |
void | HintRemove (csComponent *iComp) |
Remove the hint associated with given component. | |
csHintManager & | GetHintManager () |
Get the hint manager object. | |
csPtr< iFont > | LoadFont (const char *iFontName, int fontSize=10) |
Load a font and return its handle or 0. | |
int | FindColor (int r, int g, int b) |
Return a color identifier given R,G,B (each 0..255). | |
int | pplColor (int color) |
Convert a logical color into physical. | |
void | pplBox (int x, int y, int w, int h, int color) |
Draw a box. | |
void | pplLine (float x1, float y1, float x2, float y2, int color) |
Draw a line. | |
void | pplPixel (int x, int y, int color) |
Draw a pixel. | |
void | pplText (int x, int y, int fg, int bg, iFont *Font, const char *s) |
Draw a text string: if bg < 0 background is not drawn. | |
void | pplPixmap (csPixmap *s2d, int x, int y, int w, int h, uint8 Alpha) |
Draw a (scaled) pixmap. | |
void | pplTiledPixmap (csPixmap *s2d, int x, int y, int w, int h, int orgx, int orgy, uint8 Alpha) |
Draw a (unscaled but tiled) pixmap. | |
void | pplTexture (iTextureHandle *hTex, int sx, int sy, int sw, int sh, int tx, int ty, int tw, int th, uint8 Alpha=0) |
Draw a (part) of texture (possibly scaled) in given screen rectangle. | |
void | pplSaveArea (csImageArea *&Area, int x, int y, int w, int h) |
Save a part of screen. | |
void | pplRestoreArea (csImageArea *Area, bool Free=false) |
Restore a part of screen. | |
void | pplFreeArea (csImageArea *Area) |
Free buffer used to keep an area of screen. | |
void | pplClear (int color) |
Clear page with specified color. | |
void | pplSetClipRect (int xmin, int ymin, int xmax, int ymax) |
Set clipping rectangle: SHOULD CALL pplRestoreClipRect() AFTER DRAWING! | |
void | pplSetClipRect (csRect &clip) |
Same, but with csRect argument. | |
void | pplRestoreClipRect () |
Restore clipping rectangle to (0, 0, ScreenW, ScreenH);. | |
bool | ClipLine (float &x1, float &y1, float &x2, float &y2, int ClipX1, int ClipY1, int ClipX2, int ClipY2) |
Clip a line against a rectangle and return true if its clipped out. | |
bool | SwitchMouseCursor (csMouseCursorID Shape) |
Change system mouse cursor and return success status. | |
void | GetPixel (int x, int y, uint8 &oR, uint8 &oG, uint8 &oB) |
Get R,G,B at given screen location. | |
void | pplPolygon3D (G3DPolygonDPFX &poly, uint mode) |
Draw a 3D polygon. | |
void | pplClearZbuffer (int x1, int y1, int x2, int y2) |
Clear the Z-buffer in the given area. | |
void | pplClearZbuffer () |
Clear the entire Z-buffer (takes effect before next 3D draw operation). | |
void | SetZbufferMode (unsigned mode) |
Set the respective Z-buffer mode (one of CS_ZBUF_XXX constants). | |
void | pplBeginDraw (unsigned mode) |
Begin drawing: users of CSWS should NEVER invoke G2D/G3D->BeginDraw! | |
void | pplInvalidate (csRect &rect) |
Force blitting of the respective rectangle at the end of frame. | |
void | pplDontCacheFrame () |
Tell the graphics pipeline that you are going to update the entire screen during NEXT frame. | |
iGraphics2D * | GetG2D () |
Get the pointer to 2D graphics driver for direct manipulations. | |
iGraphics3D * | GetG3D () |
Get the pointer to 2D graphics driver for direct manipulations. | |
Public Attributes | |
iObjectRegistry * | object_reg |
The object registry. | |
csRef< iVirtualClock > | vc |
The virtual clock. | |
csRef< iEventQueue > | event_queue |
The event queue. | |
csRef< iPluginManager > | plugin_mgr |
The plugin manager. | |
csRef< iVFS > | VFS |
The virtual file system. | |
csConfigAccess | config |
The system configuration. | |
csRef< iFontServer > | FontServer |
The font server. | |
csRef< iImageIO > | ImageLoader |
The image loader. | |
csRef< iKeyboardDriver > | KeyboardDriver |
Keyboard driver. | |
csRef< iMouseDriver > | MouseDriver |
Mouse driver. | |
int | Pal [cs_Color_Last] |
Application's adaptive palette. | |
csComponent * | MouseOwner |
The component that captured the mouse. | |
csComponent * | KeyboardOwner |
The component that captured the keyboard. | |
csComponent * | FocusOwner |
The component that captured all focused events (mouse & keyboard). | |
csComponent * | LastMouseContainer |
The component that the mouse was last over. | |
csSkin * | skin |
The global skin repository. | |
bool | WindowListChanged |
This is set to TRUE each time top-level window list changes. | |
bool | InsertMode |
Global "Insert" key state. | |
int | ScreenWidth |
Screen width and height (application can be actually smaller). | |
int | ScreenHeight |
Screen width and height (application can be actually smaller). | |
csRef< iFont > | DefaultFont |
Default font. | |
int | DefaultFontSize |
Default font size. | |
Protected Methods | |
void | InitializeSkin () |
Initialize all skin slices with textures and colors etc. | |
void | SetupPalette () |
setup palette | |
Protected Attributes | |
csGraphicsPipeline | GfxPpl |
The graphics pipeline. | |
csMouse * | Mouse |
The mouse pointer. | |
csWSTexVector | Textures |
The list of windowing system textures. | |
csHintManager * | hints |
The hints manager. | |
int | WindowListWidth |
Window list width and height. | |
int | WindowListHeight |
Window list width and height. | |
csMouseCursorID | MouseCursorID |
Current & old mouse pointer ID. | |
csMouseCursorID | OldMouseCursorID |
Current & old mouse pointer ID. | |
int | DismissCode |
The code that dialog passed to Dismiss (). | |
int | PhysColorShift |
This is equal to 8 if any of physical r,g,b masks is 0xff000000. | |
csTicks | CurrentTime |
The time at the start of current frame. | |
iEventOutlet * | EventOutlet |
The system event outlet. | |
csAppBackgroundStyle | BackgroundStyle |
Application background style. | |
bool | InFrame |
Are we inbetween StartFrame() and FinishFrame()? | |
csApp::csAppPlugin * | scfiPlugin |
The iComponent interface. | |
csArray< csModalInfo * > | ModalInfo |
This is a stack of csModalInfo instances to keep track of modality. |
Detailed Description
This class is a top-level CrystalSpace Windowing Toolkit object.
Generally there should be only one object of this class. Usually it is the root of entire window hierarchy. This class also owns the application-global mouse object, event queue object, graphics pipeline and some others.
The Crystal Space application is a regular plugin from the system driver's point of view.
Definition at line 81 of file csapp.h.
Constructor & Destructor Documentation
|
Initialize windowing system by giving a system driver and a skin.
|
|
Deinitialize windowing system.
|
Member Function Documentation
|
Capture all focused events (or disable capture if 0).
|
|
Capture all keyboard events (or disable capture if 0).
|
|
Capture all mouse events (or disable capture if 0).
|
|
Clip a line against a rectangle and return true if its clipped out.
Definition at line 431 of file csapp.h. References csGraphicsPipeline::ClipLine(). |
|
Create a new event object: NEVER create event objects with `new'.
Definition at line 219 of file csapp.h. References iEventOutlet::CreateEvent(). |
|
Delete a child component.
Reimplemented from csComponent. |
|
Dismiss a dialog box with given return code.
|
|
Draw the application background.
Reimplemented from csComponent. |
|
Return a color identifier given R,G,B (each 0..255).
|
|
This is called at the end of every frame.
|
|
Process all events in the queue and refresh the screen.
|
|
Query current time.
|
|
Return default font and font size.
Reimplemented from csComponent. |
|
Get the pointer to 2D graphics driver for direct manipulations. WARNING! Don't abuse of this function! Definition at line 485 of file csapp.h. References csGraphicsPipeline::G2D. |
|
Get the pointer to 2D graphics driver for direct manipulations. WARNING! Don't abuse of this function! Definition at line 492 of file csapp.h. References csGraphicsPipeline::G3D. |
|
Get the hint manager object.
|
|
Query the current state of a key.
|
|
Return application's global mouse object.
Definition at line 266 of file csapp.h. References csMouseCursorID. |
|
Query mouse cursor pointer.
|
|
Get R,G,B at given screen location.
Definition at line 440 of file csapp.h. References csGraphicsPipeline::GetPixel(). |
|
Get the closest in window hierarchy skin object.
Reimplemented from csComponent. |
|
Find a texture by name.
Definition at line 259 of file csapp.h. References csWSTexVector::FindTexture(), and csWSTexture::GetHandle(). |
|
Return application's texture list.
|
|
Get the top component which is currently modal. Or 0 if not in modality. |
|
Get the userdata for the top modal component. Or 0 if not in modality. |
|
Send event to all childs and return processed status.
Reimplemented from csComponent. |
|
Associate a hint with given component.
Definition at line 349 of file csapp.h. References csHintManager::Add(). |
|
Remove the hint associated with given component.
|
|
The windowing system is idle: do some lazy work.
|
|
Set up application layout (read configs, create windows, menus etc).
|
|
Initialize all skin slices with textures and colors etc.
|
|
Insert a child component.
Reimplemented from csComponent. |
|
Load a font and return its handle or 0.
|
|
Add a single texture to application's texture list.
|
|
Every time a component is deleted, this routine is called.
|
|
Add a previously created event to event queue.
Definition at line 223 of file csapp.h. References iEventOutlet::Post(). |
|
Handle a event if nobody eaten it.
Reimplemented from csComponent. |
|
Begin drawing: users of CSWS should NEVER invoke G2D/G3D->BeginDraw!
Definition at line 462 of file csapp.h. References csGraphicsPipeline::BeginDraw(). |
|
Draw a box.
Definition at line 376 of file csapp.h. References csGraphicsPipeline::Box(). |
|
Clear page with specified color.
Definition at line 415 of file csapp.h. References csGraphicsPipeline::Clear(). |
|
Clear the entire Z-buffer (takes effect before next 3D draw operation).
Definition at line 454 of file csapp.h. References csGraphicsPipeline::ClearZbuffer(). |
|
Clear the Z-buffer in the given area.
Definition at line 450 of file csapp.h. References csGraphicsPipeline::ClearZbuffer(). |
|
Convert a logical color into physical.
|
|
Tell the graphics pipeline that you are going to update the entire screen during NEXT frame. This will force graphics pipeline to NOT cache the image of the current frame so that it can be propagated to next frame (if during next frame you are going to repaint just a part of screen, propagating image changes through multiple video pages is a MUST, otherwise you will get flickering images). Definition at line 478 of file csapp.h. References csGraphicsPipeline::DontCacheFrame. |
|
Free buffer used to keep an area of screen.
Definition at line 411 of file csapp.h. References csGraphicsPipeline::FreeArea(). |
|
Force blitting of the respective rectangle at the end of frame.
Definition at line 466 of file csapp.h. References csGraphicsPipeline::Invalidate(). |
|
Draw a line.
Definition at line 380 of file csapp.h. References csGraphicsPipeline::Line(). |
|
Draw a pixel.
Definition at line 384 of file csapp.h. References csGraphicsPipeline::Pixel(). |
|
Draw a (scaled) pixmap.
Definition at line 392 of file csapp.h. References csGraphicsPipeline::Pixmap(). |
|
Draw a 3D polygon.
Definition at line 446 of file csapp.h. References csGraphicsPipeline::Polygon3D(). |
|
Restore a part of screen.
Definition at line 408 of file csapp.h. References csGraphicsPipeline::RestoreArea(). |
|
Restore clipping rectangle to (0, 0, ScreenW, ScreenH);.
Definition at line 427 of file csapp.h. References csGraphicsPipeline::RestoreClipRect(). |
|
Save a part of screen.
Definition at line 405 of file csapp.h. References csGraphicsPipeline::SaveArea(). |
|
Same, but with csRect argument.
Definition at line 423 of file csapp.h. References csGraphicsPipeline::SetClipRect(), csRect::xmax, csRect::xmin, csRect::ymax, and csRect::ymin. |
|
Set clipping rectangle: SHOULD CALL pplRestoreClipRect() AFTER DRAWING!
Definition at line 419 of file csapp.h. References csGraphicsPipeline::SetClipRect(). |
|
Draw a text string: if bg < 0 background is not drawn.
Definition at line 388 of file csapp.h. References csGraphicsPipeline::Text(). |
|
Draw a (part) of texture (possibly scaled) in given screen rectangle.
Definition at line 400 of file csapp.h. References csGraphicsPipeline::Texture(). |
|
Draw a (unscaled but tiled) pixmap.
Definition at line 395 of file csapp.h. References csGraphicsPipeline::TiledPixmap(). |
|
Handle a event before all others.
Reimplemented from csComponent. |
|
Prepare textures for usage (register them with the graphics driver).
|
|
Display a string on the console using almost usual printf() syntax.
|
|
Display a string on the console using almost usual printf() syntax.
|
|
Set application background style.
|
|
Set mouse cursor pointer.
Definition at line 269 of file csapp.h. References csMouseCursorID. |
|
Set the skin of the application.
|
|
setup palette
|
|
Set window list size.
|
|
Set the respective Z-buffer mode (one of CS_ZBUF_XXX constants).
Definition at line 458 of file csapp.h. References csGraphicsPipeline::SetZbufferMode(). |
|
Shut down the program.
|
|
This is called once per frame by HandleEvent ().
|
|
Set modality state on a component. When the component is dismissed StopModal() will be called automatically. This function returns immediatelly. StartModal() can fail if the component is already modal. |
|
Stop top-level modality state.
|
|
Change system mouse cursor and return success status.
Definition at line 436 of file csapp.h. References csGraphicsPipeline::SwitchMouseCursor(). |
|
Show window list.
|
Member Data Documentation
|
Application background style.
|
|
The system configuration.
|
|
The time at the start of current frame.
|
|
Default font.
|
|
Default font size.
|
|
The code that dialog passed to Dismiss ().
|
|
The event queue.
|
|
The system event outlet.
|
|
The component that captured all focused events (mouse & keyboard).
|
|
The font server.
|
|
The graphics pipeline.
|
|
The hints manager.
|
|
The image loader.
|
|
Are we inbetween StartFrame() and FinishFrame()?
|
|
Global "Insert" key state.
|
|
Keyboard driver.
|
|
The component that captured the keyboard.
|
|
The component that the mouse was last over.
|
|
This is a stack of csModalInfo instances to keep track of modality.
|
|
The mouse pointer.
|
|
Current & old mouse pointer ID.
|
|
Mouse driver.
|
|
The component that captured the mouse.
|
|
The object registry.
|
|
Current & old mouse pointer ID.
|
|
Application's adaptive palette.
|
|
This is equal to 8 if any of physical r,g,b masks is 0xff000000.
|
|
The plugin manager.
|
|
The iComponent interface.
|
|
Screen width and height (application can be actually smaller).
|
|
Screen width and height (application can be actually smaller).
|
|
The global skin repository.
|
|
The list of windowing system textures.
|
|
The virtual clock.
|
|
The virtual file system.
|
|
This is set to TRUE each time top-level window list changes.
|
|
Window list width and height.
|
|
Window list width and height.
|
The documentation for this class was generated from the following file:
- csws/csapp.h
Generated for Crystal Space by doxygen 1.2.18