#include <screenarea.h>
Inheritance diagram for wftk::ScreenArea:
Public Member Functions | |
ScreenArea () | |
Contstructor. | |
virtual | ~ScreenArea () |
Destructor. | |
bool | show () |
Returns true for a successful show(), false if the widget was already shown. | |
bool | hide () |
Returns true for a successful hide(), false if the widget was already hidden. | |
void | raise () |
raise this widget to the front | |
void | lower () |
lower this widget to the back | |
void | resize (const Rect &) |
Resize this widget. | |
void | resize (Uint16 w, Uint16 h) |
Resize this widget. | |
bool | isHidden () const |
Returns true if this widget is hidden. | |
void | setParent (ScreenArea *) |
Changing the parent from null to non-null increases the widget's refcount, and changing from non-null to null decreases it. | |
ScreenArea * | parent () |
Get this widget's parent. | |
const ScreenArea * | parent () const |
Get this widget's parent. | |
bool | contains (const ScreenArea &) const |
true if this widget contains the argument | |
ScreenArea * | getContainer (const Point &) |
If no child widget contains the point, either the current widget (if it contains the point) or 0 (if not) is returned. | |
const PackingInfo & | getPackingInfo () const |
returns this widget's packing information | |
const Rect & | getRect () const |
return geometry | |
const Region & | getShape () const |
return geometry for shaped widgets | |
const Region & | getCoverage () const |
return opaque subarea for partially transparent widgets | |
Rect | screenRect () const |
The absolute position of the widget on the screen. | |
Uint16 | width () const |
the width of the widget | |
Uint16 | height () const |
the height of the widget | |
Rect | globalCoord (const Rect &local) const |
convert widget coordinates to root window coordinates | |
Rect | localCoord (const Rect &global) const |
convert root window coordinates to widget coordinates | |
bool | hasMouse () const |
true if the mouse is in the widget | |
virtual bool | mouseEvent (const Point &pos, const Point &rel, Mouse::Button mask) |
mouse motion event handler | |
virtual bool | buttonEvent (Mouse::Button, bool pressed, const Point &) |
mouse button event handler | |
virtual void | gainedMouse () |
mouse gain event handler | |
virtual void | lostMouse () |
mouse loss event handler | |
std::string | name () const |
std::type_info::name(), for debugging | |
Public Attributes | |
SigC::Signal0< void > | deleted |
Emitted in destructor. | |
SigC::Signal2< void, Uint16, Uint16 > | resized |
emitted when ScreenArea is resized | |
Protected Member Functions | |
void | removeChildren () |
Sometimes (e.g., RootWindow) it is necessary to remove all the children of a derived class instance before doing other things in the derived class destructor. | |
void | packingUpdate () |
update this widget's packing in its parent | |
void | setShape (const Region &shape, const Region &coverage) |
The 'shape' argument specifies which pixels are part of the widget, and is clipped to the widget's rectangle. | |
void | setCoverage (const Region &coverage) |
Set the area the widget covers opaquely. | |
const Region & | getExposed () const |
get the exposed portion of the widget | |
bool | dirty () const |
check if part of the widget needs to be redrawn | |
void | invalidate (const Region &) |
Invalidate part of the widget to force a redraw. | |
void | invalidate () |
Invalidate the whole widget to force a redraw. | |
void | blit (Surface &target, const Point &offset) |
This should only be called as part of the drawing engine. | |
virtual void | draw (Surface &, const Point &offset, const Region &) |
The area drawn to must lie within the given region. | |
virtual void | drawAfter (Surface &, const Point &offset, const Region &) |
The area drawn to must lie within the given region. | |
virtual void | handleResize (Uint16 w, Uint16 h) |
Calculate new shape for shaped widgets, call to setShape() after a resize. | |
virtual void | setPackingInfo () |
recalculate the object's prefered size | |
virtual void | packingUpdateParent () |
chains PackingInfo updates (due to resize, etc.) to the containing widget | |
Protected Attributes | |
PackingInfo | packing_info_ |
information on the widget's prefered size |
For information on writing your own widgets, set README.widgets in the source
|
This should only be called as part of the drawing engine. It's protected instead of private so RootWindow can call it. |
|
The area drawn to must lie within the given region. This is protected so derived classes can call their parents' draw() in their own implementations. Reimplemented in wftk::BorderedDialog, wftk::Label, wftk::LineEdit, wftk::Movie, wftk::PushButton, wftk::Slider, and wftk::Widget.
|
|
The area drawn to must lie within the given region. This is protected so derived classes can call their parents' drawAfter() in their own implementations. Reimplemented in wftk::RootWindow, and wftk::Widget.
|
|
Sometimes (e.g., RootWindow) it is necessary to remove all the children of a derived class instance before doing other things in the derived class destructor. We therefore export this functionality. |
|
Changing the parent from null to non-null increases the widget's refcount, and changing from non-null to null decreases it. Effectively, the parent holds a reference to the child. |
|
The 'shape' argument specifies which pixels are part of the widget, and is clipped to the widget's rectangle. The 'coverage' argument specifies the amount of area the widget covers opaquely, and is clipped to the shape. By default, shape is set equal to the widget's rectangle for both Widget and ScreenArea. The default for coverage is the widget's rectangle for Widget and an empty region for ScreenArea (since it doesn't draw a background). For derived non-rectangular or non-opaque widgets, this function will generally need to be called in both the widget's constructor and in the virtual function handleResize(). |
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.