#include <macwindow.h>
Public Member Functions | |
BaseMacWindow (int id, bool editable, MacWindowManager *wm) | |
int | getId () |
WindowType | getType () |
bool | isEditable () |
virtual void | setVisible (bool visible, bool silent=false) |
bool | isVisible () |
ManagedSurface * | getWindowSurface () |
virtual ManagedSurface * | getBorderSurface ()=0 |
virtual const Common::Rect & | getInnerDimensions ()=0 |
virtual bool | draw (bool forceRedraw=false)=0 |
virtual bool | draw (ManagedSurface *g, bool forceRedraw=false)=0 |
virtual bool | processEvent (Common::Event &event)=0 |
virtual bool | isDirty ()=0 |
void | setCallback (bool(*callback)(WindowClick, Common::Event &, void *), void *data) |
Public Member Functions inherited from Graphics::MacWidget | |
MacWidget (MacWidget *parent, int x, int y, int w, int h, MacWindowManager *wm, bool focusable, uint16 border=0, uint16 gutter=0, uint16 shadow=0, uint32 fgcolor=0, uint32 bgcolor=0xff) | |
const Common::Rect & | getDimensions () |
virtual void | setActive (bool active) |
void | setDirty (bool dirty) |
virtual bool | needsRedraw () |
virtual void | blit (ManagedSurface *g, Common::Rect &dest) |
virtual bool | hasAllFocus () |
virtual void | setColors (uint32 fg, uint32 bg) |
virtual void | setDimensions (const Common::Rect &r) |
Common::Point | getAbsolutePos () |
MacWidget * | findEventHandler (Common::Event &event, int dx, int dy) |
void | removeWidget (MacWidget *child, bool del=true) |
Graphics::ManagedSurface * | getSurface () |
Protected Attributes | |
int | _id |
WindowType | _type |
bool | _editable |
bool(* | _callback )(WindowClick, Common::Event &, void *) |
void * | _dataPtr |
bool | _visible |
bool | _draggable |
Protected Attributes inherited from Graphics::MacWidget | |
uint16 | _border |
uint16 | _gutter |
uint16 | _shadow |
uint32 | _fgcolor |
uint32 | _bgcolor |
Graphics::ManagedSurface * | _composeSurface |
bool | _contentIsDirty |
Additional Inherited Members | |
Public Attributes inherited from Graphics::MacWidget | |
bool | _focusable |
bool | _active |
bool | _editable |
uint | _priority |
Common::Rect | _dims |
MacWindowManager * | _wm |
MacWidget * | _parent |
Common::Array< MacWidget * > | _children |
Abstract class that defines common functionality for all window classes. It supports event callbacks and drawing.
Graphics::BaseMacWindow::BaseMacWindow | ( | int | id, |
bool | editable, | ||
MacWindowManager * | wm | ||
) |
Base constructor.
id | ID of the window. |
editable | True if the window is editable. |
wm | Pointer to the MacWindowManager that owns the window. |
|
inline |
Accessor method to the id of the window.
|
inline |
Accessor method to the type of window. Each subclass must indicate it's type.
|
inlinevirtual |
Accessor method to check whether the window is editable (e.g. for resizing).
Reimplemented from Graphics::MacWidget.
|
virtual |
Mutator to change the visible state of the window.
visible | Target state. |
Reimplemented in Graphics::MacMenu, and Director::Window.
bool Graphics::BaseMacWindow::isVisible | ( | ) |
Accessor to determine whether a window is active.
|
inline |
Method to access the entire interior surface of the window (e.g. to draw an image).
|
pure virtual |
Method to access the border surface of the window.
Implemented in Graphics::MacWindow, and Graphics::MacMenu.
|
pure virtual |
Accessor to retrieve the dimensions of the inner surface of the window (i.e. without taking borders into account). Note that the returned dimensions' position is relative to the WM's screen, just like in getDimensions().
Implemented in Graphics::MacWindow, and Graphics::MacMenu.
|
pure virtual |
Method called to internally draw the window. This relies on the window being marked as dirty unless otherwise specified.
forceRedraw | Its behavior depends on the subclass. |
Reimplemented from Graphics::MacWidget.
Implemented in Graphics::MacWindow, Graphics::MacMenu, and Graphics::MacTextWindow.
|
pure virtual |
Method called to draw the window into the target surface. This method is most often called by the WM, and relies on the window being marked as dirty unless otherwise specified.
g | Surface on which to draw the window. |
forceRedraw | It's behavior depends on the subclass. |
Reimplemented from Graphics::MacWidget.
Implemented in Graphics::MacWindow, Graphics::MacMenu, Graphics::MacTextWindow, and Graphics::MacPopUp.
|
pure virtual |
Method called by the WM when there is an event concerning the window. Note that depending on the subclass of the window, it might not be called if the window is not active.
event | Event to be processed. |
Reimplemented from Graphics::MacWidget.
Implemented in Graphics::MacWindow, Director::Window, Graphics::MacMenu, and Graphics::MacTextWindow.
|
pure virtual |
Method that checks if the window is needs redrawing.
Implemented in Graphics::MacWindow, and Graphics::MacMenu.
|
inline |
Set the callback that will be used when an event needs to be processed.
callback | A function pointer to a function that accepts:
|