Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

wftk::ScreenArea Class Reference

ScreenArea Baseclass. More...

#include <screenarea.h>

Inheritance diagram for wftk::ScreenArea:

wftk::Box wftk::Filler wftk::Movie wftk::Table wftk::VideoWidget wftk::Widget wftk::Label wftk::LineEdit wftk::ProgressBar wftk::SingleContainer wftk::Slider wftk::MultiLineEdit wftk::Button wftk::CornerContainer wftk::Dialog wftk::ListBox wftk::RootWindow wftk::Terminal wftk::PushButton wftk::BorderedDialog wftk::FixedDialog wftk::FullScreenDialog wftk::ToggleButton wftk::MessageDialog wftk::ProgressDialog wftk::QuestionBox List of all members.

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.

ScreenAreaparent ()
 Get this widget's parent.

const ScreenAreaparent () const
 Get this widget's parent.

bool contains (const ScreenArea &) const
 true if this widget contains the argument

ScreenAreagetContainer (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 PackingInfogetPackingInfo () const
 returns this widget's packing information

const RectgetRect () const
 return geometry

const RegiongetShape () const
 return geometry for shaped widgets

const RegiongetCoverage () 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 RegiongetExposed () 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


Detailed Description

ScreenArea Baseclass.

For information on writing your own widgets, set README.widgets in the source


Member Function Documentation

void wftk::ScreenArea::blit Surface target,
const Point offset
[protected]
 

This should only be called as part of the drawing engine.

It's protected instead of private so RootWindow can call it.

virtual void wftk::ScreenArea::draw Surface ,
const Point offset,
const Region
[inline, protected, virtual]
 

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.

virtual void wftk::ScreenArea::drawAfter Surface ,
const Point offset,
const Region
[inline, protected, virtual]
 

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.

void wftk::ScreenArea::removeChildren  )  [protected]
 

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.

void wftk::ScreenArea::setParent ScreenArea  ) 
 

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.

void wftk::ScreenArea::setShape const Region shape,
const Region coverage
[protected]
 

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().


The documentation for this class was generated from the following files:

Generated Thu Mar 18 20:06:05 2004.
Copyright © 1998-2003 by the respective authors.

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.