In file include/csws/csapp.h:

class csApp : public csComponent

This class is a top-level CrystalSpace Windowing Toolkit object

Inheritance:


Public Fields

csStrVector* customtexturename
Custom textures
csStrVector* dialogdefs
Dialog buttons definitions
char* dialogtexturename
Dialog buttons (radio- and check- boxes) texture
csComponent* FocusOwner
The component that captured all focused events (mouse & keyboard)
bool insert
Global "Insert" key state
csComponent* KeyboardOwner
The component that captured the keyboard
csComponent* MouseOwner
The component that captured the mouse
char* mousetexturename
Mouse cursor texture
int Pal[cs_Color_Last]
Application's adaptive palette
bool RedrawFlag
If this flag is set, there are still unrefreshed components
csStrVector* titlebardefs
Titlebar buttons definitions
char* titletexturename
Titlebar buttons texture
bool WindowListChanged
This is set to TRUE each time top-level window list changes

Public Methods

csComponent* CaptureFocus(csComponent *who)
Capture all focused events (or disable capture if NULL)
csComponent* CaptureKeyboard(csComponent *who)
Capture all keyboard events (or disable capture if NULL)
csComponent* CaptureMouse(csComponent *who)
Capture all mouse events (or disable capture if NULL)
csApp(char *AppTitle, int argc, char *argv[], csAppBackgroundStyle iBackgroundStyle = csabsSolid)
Initialize windowing system
virtual void Delete(csComponent *comp)
Delete a child component
void Dismiss(int iCode = cscmdCancel)
Dismiss a dialog box with given return code
virtual void Draw()
Draw the application background
int Execute(csComponent *comp)
Execute a dialog box (or entire app if NULL) and return its dismiss code
Archive* GetArchive()
Return application's data archive
bool GetKeyState(int iKey)
Query shift key state
csMouse* GetMouse()
Return application's global mouse object
csMouseCursorID GetMouseCursor()
Query mouse cursor pointer
int GetPage()
Return active page number
csTextureHandle* GetTexture(char *Name)
Find a texture by name
csTextureList* GetTextures()
Return application's texture list
csWorld* GetWorld()
Get world for textures, config files etc.
virtual bool HandleEvent(csEvent &Event)
Handle a event and return true if processed
void Idle()
The windowing system is idle: do some lazy work
virtual void Insert(csComponent *comp)
Insert a child component
virtual void Loop()
Start endless event loop
virtual void NextFrame()
This should be called once per frame by system driver
virtual bool PostHandleEvent(csEvent &Event)
Handle a event if nobody eaten it.
void pplBox(int x, int y, int w, int h, int color)
Draw a box
void pplClear(int color)
Clear page with specified color
void pplFreeArea(ImageArea *Area)
Free buffer used to keep an area of screen
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 pplRestoreArea(ImageArea *Area, bool Free = false)
Restore a part of screen
void pplRestoreClipRect()
Restore clipping rectangle to (0, 0, ScreenW, ScreenH);
void pplSaveArea(ImageArea *&Area, int x, int y, int w, int h)
Save a part of screen
void pplSetClipRect(csRect &clip)
Same, but with csRect argument
void pplSetClipRect(int xmin, int ymin, int xmax, int ymax)
Set clipping rectangle: SHOULD CALL pplRestoreClipRect() AFTER DRAWING!
void pplSprite2D(csSprite2D *s2d, int x, int y, int w, int h)
Draw a (scaled) 2D sprite
void pplText(int x, int y, int fg, int bg, int Font, char *s)
Draw a text string: if bg < 0 background is not drawn
virtual bool PreHandleEvent(csEvent &Event)
Handle a event before all others
void Process()
Process all queued messages
void PutEvent(csEvent *Event)
Add a event to event queue
void SetMouseCursor(csMouseCursorID ID)
Set mouse cursor pointer
void SetWindowListSize(int iWidth, int iHeight)
Set window list size
virtual void SetWorld(csWorld *AppWorld)
Set world for textures, config files etc.
void ShutDown()
Shut down the program
int TextHeight(int Font)
Return the height of currently selected font
int TextWidth(char *text, int Font)
Return the width of given text using currently selected font
void WindowList()
Show window list
virtual ~csApp()
Deinitialize windowing system

Public

The following variables are initialized by reading sys/csws.cfg

Protected Fields

csAppBackgroundStyle BackgroundStyle
Application background style
int DismissCode
The code that dialog passed to Dismiss ()
csEventQueue* EventQueue
The event queue
csGraphicsPipeline* GfxPpl
The graphics pipeline
int LoopLevel
The recursion level within System->Loop ()
csMouse* Mouse
The mouse pointer
csMouseCursorID MouseCursorID
Current & old mouse pointer ID
int WindowListWidth
Window list width and height
csWorld* world
The world object

Protected Methods

virtual bool InitialSetup()
Set up initial application layout (create windows, menus etc)
virtual void LoadConfig()
Initialize configuration data: load csws.cfg

Private Methods

void LoadTextures()
load textures used by all child objects
void SetupPalette()
setup palette
void Update()
Flush graphics pipeline

Inherited from csComponent:

Public Fields

csApp* app
csRect bound
csVector clipchildren
csComponent* focused
unsigned int id
csComponent* next
csComponent* parent
csComponent* top

Public Methods

void Box(int xmin, int ymin, int xmax, int ymax, int colindx)
void Center(bool iHoriz = true, bool iVert = true)
virtual void Close()
void DeleteAll()
void DeleteClipChild(csComponent *clipchild)
void Drag(int x, int y, int DragMode)
void FindMaxFreeRect(csRect &area)
virtual void FixPosition(int &newX, int &newY)
virtual void FixSize(int &newW, int &newH)
csComponent* ForEach(bool (*func) (csComponent *child, void *param), void *param = NULL, bool Zorder = false)
csComponent* GetChild(int find_id)
csComponent* GetClipParent()
int GetColor(int Index)
csComponent* GetDefault()
int GetDragStyle()
csComponent* GetFocused()
int GetFont()
int GetState(int mask)
virtual char* GetText()
virtual void GetText(char *oText, int iTextSize)
csComponent* GetTop()
void GlobalToLocal(int &x, int &y)
bool HandleDragEvent(csEvent &Event, int BorderW, int BorderH)
virtual void Hide()
void InsertClipChild(csComponent *clipchild)
void Invalidate(bool IncludeChildren = false)
void Invalidate(csRect &area, bool IncludeChildren = false)
void Invalidate(int xmin, int ymin, int xmax, int ymax, bool IncludeChildren = false)
void Line(float x1, float y1, float x2, float y2, int colindx)
void LocalToGlobal(int &x, int &y)
virtual bool Maximize()
virtual csComponent* NextChild(csComponent *start = NULL, bool disabled = false)
virtual csComponent* NextControl(csComponent *start = NULL)
virtual csComponent* NextGroup(csComponent *start = NULL)
void ObliqueRect3D(int xmin, int ymin, int xmax, int ymax, int cornersize, int darkindx, int lightindx)
void Pixel(int x, int y, int colindx)
virtual csComponent* PrevChild(csComponent *start = NULL, bool disabled = false)
virtual csComponent* PrevControl(csComponent *start = NULL)
virtual csComponent* PrevGroup(csComponent *start = NULL)
void Rect3D(int xmin, int ymin, int xmax, int ymax, int darkindx, int lightindx)
void Redraw()
virtual bool Restore()
bool Select()
void* SendCommand(int CommandCode, void *Info = NULL)
void SetApp(csApp *newapp)
void SetClipRect(int xmin, int ymin, int xmax, int ymax)
void SetClipRect()
void SetColor(int Index, int Color)
bool SetDragRect(int xmin, int ymin, int xmax, int ymax)
void SetDragStyle(int iDragStyle)
bool SetFocused(csComponent *comp)
void SetFont(int iFont, bool IncludeChildren = false)
void SetMouse(csMouseCursorID Cursor)
void SetPalette(int *iPalette, int iPaletteSize)
void SetPalette(int iPaletteID)
void SetPos(int x, int y)
virtual bool SetRect(int xmin, int ymin, int xmax, int ymax)
bool SetRect(csRect &rect)
void SetSize(int w, int h)
void SetSizingCursor(int dragtype)
virtual void SetState(int mask, bool enable)
virtual void SetSuggestedSize(int dw, int dh)
virtual void SetText(char *iText)
bool SetZorder(csComponent *comp, csComponent *below)
virtual void Show(bool focused = false)
void Sprite2D(csSprite2D *s2d, int x, int y)
void Sprite2D(csSprite2D *s2d, int x, int y, int w, int h)
virtual void SuggestSize(int &w, int &h)
void Text(int x, int y, int fgindx, int bgindx, char *s)

Protected Fields

csRect clip
csComponent* clipparent
csRect dirty
static csRect dragBound
int DragStyle
static int dragX
int Font
bool Maximized
csRect OrgBound
bool originalpalette
int* palette
int state
char* text

Protected Methods

void Clip(csObjVector &rect, csComponent *last)
void ClipAlienChildren(csObjVector &rect, csComponent *child)
void DrawUnderline(int iX, int iY, char *iText, int iUnderlinePos, int iColor)
static void PrepareLabel(char *iLabel, char * &oLabel, int &oUnderlinePos)
static int WordLeft(char *iText, int StartPos)
static int WordRight(char *iText, int StartPos)

Inherited from csBase:


Documentation

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.

csGraphicsPipeline* GfxPpl
The graphics pipeline

csMouse* Mouse
The mouse pointer

csEventQueue* EventQueue
The event queue

csWorld* world
The world object

csAppBackgroundStyle BackgroundStyle
Application background style

int WindowListWidth
Window list width and height

csMouseCursorID MouseCursorID
Current & old mouse pointer ID

int LoopLevel
The recursion level within System->Loop ()

int DismissCode
The code that dialog passed to Dismiss ()

virtual bool InitialSetup()
Set up initial application layout (create windows, menus etc)

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)

bool RedrawFlag
If this flag is set, there are still unrefreshed components

bool WindowListChanged
This is set to TRUE each time top-level window list changes

The following variables are initialized by reading sys/csws.cfg

char* mousetexturename
Mouse cursor texture

char* titletexturename
Titlebar buttons texture

csStrVector* titlebardefs
Titlebar buttons definitions

char* dialogtexturename
Dialog buttons (radio- and check- boxes) texture

csStrVector* dialogdefs
Dialog buttons definitions

csStrVector* customtexturename
Custom textures

bool insert
Global "Insert" key state

csApp(char *AppTitle, int argc, char *argv[], csAppBackgroundStyle iBackgroundStyle = csabsSolid)
Initialize windowing system

virtual ~csApp()
Deinitialize windowing system

void ShutDown()
Shut down the program

void Idle()
The windowing system is idle: do some lazy work

virtual void Draw()
Draw the application background

virtual void NextFrame()
This should be called once per frame by system driver

virtual void SetWorld(csWorld *AppWorld)
Set world for textures, config files etc.

csWorld* GetWorld()
Get world for textures, config files etc.

virtual void Loop()
Start endless event loop

Archive* GetArchive()
Return application's data archive

csTextureList* GetTextures()
Return application's texture list

csTextureHandle* GetTexture(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

void PutEvent(csEvent *Event)
Add a event to event queue

void Process()
Process all queued messages

virtual bool HandleEvent(csEvent &Event)
Handle a event and return true if processed

int GetPage()
Return active page number

csComponent* CaptureMouse(csComponent *who)
Capture all mouse events (or disable capture if NULL)

csComponent* CaptureKeyboard(csComponent *who)
Capture all keyboard events (or disable capture if NULL)

csComponent* CaptureFocus(csComponent *who)
Capture all focused events (or disable capture if NULL)

bool GetKeyState(int iKey)
Query shift key state

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

int Execute(csComponent *comp)
Execute a dialog box (or entire app if NULL) and return its dismiss code

void Dismiss(int iCode = cscmdCancel)
Dismiss a dialog box with given return code

virtual bool PreHandleEvent(csEvent &Event)
Handle a event before all others

virtual bool PostHandleEvent(csEvent &Event)
Handle a event if nobody eaten it.

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, int Font, char *s)
Draw a text string: if bg < 0 background is not drawn

void pplSprite2D(csSprite2D *s2d, int x, int y, int w, int h)
Draw a (scaled) 2D sprite

void pplSaveArea(ImageArea *&Area, int x, int y, int w, int h)
Save a part of screen

void pplRestoreArea(ImageArea *Area, bool Free = false)
Restore a part of screen

void pplFreeArea(ImageArea *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);

int TextWidth(char *text, int Font)
Return the width of given text using currently selected font

int TextHeight(int Font)
Return the height of currently selected font

virtual void LoadConfig()
Initialize configuration data: load csws.cfg

void LoadTextures()
load textures used by all child objects

void SetupPalette()
setup palette

void Update()
Flush graphics pipeline


Direct child classes:
MazeEditor

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de