OSDL::Video::TwoDimensional::BackBufferedWidget Class Reference

#include <OSDLBackBufferedWidget.h>

Inheritance diagram for OSDL::Video::TwoDimensional::BackBufferedWidget:

Inheritance graph
[legend]
Collaboration diagram for OSDL::Video::TwoDimensional::BackBufferedWidget:

Collaboration graph
[legend]

List of all members.


Detailed Description

A BackBufferedWidget is a Widget, hence a Surface, which contains only its own rendering (the one of its subwidgets is not on it) and which owns another Surface, which contains this widget rendered alongside the full tree of its subwidgets, which acts as a cache.

Hence when a BackBufferedWidget has to be redrawn whereas this widget itself did not change (this happen for example whenever one of its subwidgets changes), instead of triggering a new rendering from scratch of this widget, its own cached rendering (which is cached in the inherited surface, called here the back-buffer) is blitted directly to the overall surface (the surface this back-buffered widget owns) and the usual mechanism for subwidgets apply, so that they are rendered on this latter surface.

The role of the inherited and the owned surfaces should not be reversed, since the current organization allows to use all the inherited drawing primitives without any modification : they apply directly to the inherited back-buffer surface, which is the source surface from which the overall one is created.

Caching the own rendering of a widget in a back-buffer is especially useful whenever this rendering demands resources, for example when complex text is to be rendered.

To repeat for the sake of clarity, rendering specific to this widget is done in the so-called 'back-buffer' (which is stored in the inherited surface), as opposed to the 'overall' owned surface which refers to this widget and all its subwidgets.

Definition at line 69 of file OSDLBackBufferedWidget.h.


Public Types

enum  BaseColorMode { BackgroundColor, Colorkey, None, NotInitialized }
 Describes the available modes for handling the base color of a widget. More...
enum  DisplayType { BackBuffer, ClassicalScreenSurface, OpenGLScreenSurface }
 Describes the display type of a surface:. More...

Public Member Functions

 BackBufferedWidget (Surface &container, const Point2D &relativePosition, Length width, Length height, BaseColorMode baseColorMode, Pixels::ColorDefinition baseColor, const std::string &title="", bool minMaximizable=true, bool draggable=true, bool wrappable=true, bool closable=true) throw ( VideoException )
 Creates a new back-buffered Widget.
virtual ~BackBufferedWidget () throw ()
 Basic virtual destructor.
virtual void resize (Length newWidth, Length newHeight, bool ignored=false) throw ()
 Resizes both this widget and its back-buffer so that their new dimensions are the specified ones.
virtual void setBaseColorMode (BaseColorMode newBaseColorMode, Pixels::ColorDefinition newBaseColor) throw ( VideoException )
 Sets the current base color mode and base color, for both surfaces (back-buffer and overall).
virtual void redraw () throw ()
 Redraws this widget, by updating itself (if necessary) and then updating its sub-widgets, by blitting all of them (this widget, then all sub-widgets from bottom to top) to the back-buffer and then blitting the resulting back-buffer in the parent container of this widget.
virtual void redrawInternal () throw ()
 This method manages this widget so that no useless internal rendering is performed.
virtual void redrawBackBuffer () throw ()
 Basic do-nothing redraw method for the actual internal rendering into the back-buffer (the inherited surface).
SurfacegetWidgetRenderTarget () throw ()
 Returns the surface that should be targeted by widgets having to blit their renderings to their container.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw ()
 Returns an user-friendly description of the state of this object.
virtual void setWidth (Length newWidth) throw ()
 Sets the current width of this widget.
virtual void setHeight (Length newHeight) throw ()
 Sets the current height of this widget.
virtual BaseColorMode getBaseColorMode () const throw ()
 Returns the current base color mode.
virtual Pixels::ColorDefinition getBaseColor () const throw ()
 Returns the current base color.
virtual void setDecorationStatus (bool newDecorationStatus) throw ()
 Sets the current decoration status, so that this widget will have decorations or not after this method is called.
virtual const UprightRectanglegetClientArea () const throw ()
 Returns an upright rectangle which describes the client area, in widget referential.
virtual bool clean () throw ()
 Cleans the widget by blanking it with a background color, or a colorkey, or does nothing, depending on base color mode being respectively BackgroundColor, or Colorkey, or None.
virtual void beNotifiedOf (const Ceylan::Event &newEvent) throw ()
 Notifies this widget of a new event whose source is its container.
virtual void setRedrawState (bool needsToBeRedrawn) throw ()
 Sets redraw state.
virtual Clonable & clone () const throw ( Ceylan::ClonableException )
 Clones this Surface: creates a new Surface, exact copy of this Surface, but with no data shared with it at all.
virtual LowLevelSurfacegetSDLSurface () const throw ()
 Returns the SDL surface corresponding to that surface.
virtual void setSDLSurface (LowLevelSurface &newSurface, DisplayType displayType=BackBuffer) throw ()
 Sets this surface so that it corresponds to the supplied SDL surface.
virtual DisplayType getDisplayType () const throw ()
 Returns the display type (back-buffer, screen, etc.
virtual void setDisplayType (DisplayType newDisplayType) throw ()
 Sets the new display type (back-buffer, screen, etc.
virtual Ceylan::Flags getFlags () const throw ()
 Returns the flags caracterizing this surface.
virtual void setFlags (Ceylan::Flags newFlags) throw ()
 Sets the flags caracterizing this surface.
virtual void convertToDisplay (bool alphaChannelWanted=true) throw ( VideoException )
 Converts the internal surface to the pixel format of the display, so that any blit of this surface to the screen is quicker.
virtual void setAlpha (Ceylan::Flags flags, Pixels::ColorElement newAlpha) throw ( VideoException )
 Adjusts the alpha properties of the surface: sets the per-surface alpha value and/or enables or disables alpha blending.
Pixels::ColorDefinition guessColorKeyDefinition () const throw ( VideoException )
 Returns the color definition of the colorkey of this surface, as attempted to be guessed from the actual pixel colors (alpha not taken into account).
Pixels::PixelColor guessColorKey () const throw ( VideoException )
 Returns the pixel color of the colorkey of this surface, as attempted to be guessed from the actual pixel colors (alpha not taken into account).
virtual void setColorKey (Ceylan::Flags flags, Pixels::PixelColor keyPixelColor) throw ( VideoException )
 Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration.
virtual void setColorKey (Ceylan::Flags flags, Pixels::ColorDefinition keyColorDef) throw ( VideoException )
 Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration.
virtual void convertFromColorKeyToAlphaChannel () throw ( VideoException )
 Converts this surface, which must use a color key, so that it uses an alpha channel instead.
virtual PalettegetPalette () const throw ( VideoException )
 Returns a palette associated with this surface, if any.
virtual bool setPalette (const Palette &newPalette, ColorCount startingColorIndex=0, ColorCount numberOfColors=0, Ceylan::Flags targetedPalettes=Palette::Logical|Palette::Physical) throw ( VideoException )
 Sets this surface's palette thanks to specified one.
SurfacecreateColorReducedSurfaceFor (const Palette &palette, bool manageColorkey=true) const throw ( VideoException )
 Returns a newly created 8-bit (indexed) color surface, whose pixels have been chosen in the specified palette to match best with the pixel of the surface the method has been called on.
virtual PixelFormat & getPixelFormat () const throw ( VideoException )
 Returns this surface's pixel format.
virtual void setPixelFormat (PixelFormat &newFormat) throw ()
 Sets this surface's pixel format.
virtual Pitch getPitch () const throw ()
 Returns this surface's pitch.
virtual void setPitch (Pitch newPitch) throw ()
 Sets this surface's pitch.
virtual Length getWidth () const throw ()
 Returns this Surface's width.
virtual Length getHeight () const throw ()
 Returns this Surface's height.
virtual BitsPerPixel getBitsPerPixel () const throw ()
 Returns this surface's color depth, bits per pixel.
virtual void setBitsPerPixel (BitsPerPixel newBitsPerPixel) throw ()
 Sets this surface's color depth, bits per pixel.
virtual BytesPerPixel getBytesPerPixel () const throw ()
 Returns this surface's overall color depth, bytes per pixel.
virtual void setBytesPerPixel (BytesPerPixel newBytesPerPixel) throw ()
 Sets this surface's color depth, bytes per pixel.
virtual void * getPixels () const throw ()
 Returns this surface's video buffer, i.e.
virtual void setPixels (void *newPixels) throw ()
 Sets this surface's video buffer, i.e.
virtual bool fill (Pixels::ColorDefinition colorDef=Pixels::Black) throw ()
 Fills this surface with specified color.
virtual bool clear () throw ( VideoException )
 Clears this surface, which may be the screen surface.
virtual SurfaceflipVertical () const throw ( VideoException )
 Returns the result of a vertical flip of this source surface: the result will contain the original image mirrored according to a vertical line splitting this surface into a left and right area of equal size.
virtual SurfaceflipHorizontal () const throw ( VideoException )
 Returns the result of an horizontal flip of this source surface: the result will contain the original image mirrored according to an horizontal line splitting this surface into a top and bottom area of equal size.
virtual std::string describePixelAt (Coordinate x, Coordinate y) throw ()
 Returns a textual description of the pixel of this surface located at [x;y].
virtual Pixels::PixelColor getPixelColorAt (Coordinate x, Coordinate y) const throw ( VideoException )
 Returns the pixel color of one particular pixel of this surface, located at [x;y], encoded according to the pixel format of this surface.
virtual Pixels::ColorDefinition getColorDefinitionAt (Coordinate x, Coordinate y) const throw ( VideoException )
 Returns the color definition of one particular pixel of this surface, located at [x;y].
virtual void putRGBAPixelAt (Coordinate x, Coordinate y, ColorElement red, ColorElement green, ColorElement blue, ColorElement alpha=AlphaOpaque, bool blending=true, bool clipping=true, bool locking=false) throw ( VideoException )
 Sets the pixel at [x;y] of this surface to the given color, specified as separate RGBA coordinates.
virtual void putColorDefinitionAt (Coordinate x, Coordinate y, ColorDefinition colorDef, bool blending=true, bool clipping=true, bool locking=false) throw ( VideoException )
 Sets the pixel at [x;y] of this surface to the given color, specified as a color definition (set of RGBA coordinates).
virtual void putPixelColorAt (Coordinate x, Coordinate y, PixelColor convertedColor, ColorElement alpha=Pixels::AlphaOpaque, bool blending=true, bool clipping=true, bool locking=false) throw ( VideoException )
 Sets the pixel at [x;y] of this surface to the given color, specified as an already converted RGBA color.
virtual bool setAlphaForColor (Pixels::ColorDefinition colorDef, Pixels::ColorElement newAlpha) throw ()
virtual bool drawHorizontalLine (Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw ()
 Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
virtual bool drawHorizontalLine (Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::PixelColor actualColor) throw ()
 Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified actual RGBA pixel color, in this surface.
virtual bool drawHorizontalLine (Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::ColorDefinition colorDef=Pixels::White) throw ()
 Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
virtual bool drawVerticalLine (Coordinate x, Coordinate yStart, Coordinate yStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw ()
 Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
virtual bool drawVerticalLine (Coordinate x, Coordinate yStart, Coordinate yStop, Pixels::ColorDefinition colorDef=Pixels::White) throw ()
 Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
virtual bool drawLine (Coordinate xStart, Coordinate yStart, Coordinate xStop, Coordinate yStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw ()
 Draws a line in this surface, ranging from point (xStart;yStart), included, to point (xStop;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color.
virtual bool drawLine (Coordinate xStart, Coordinate yStart, Coordinate xStop, Coordinate yStop, Pixels::ColorDefinition=Pixels::White) throw ()
 Draws a line in this surface, ranging from point (xStart;yStart), included, to point (xStop;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color.
virtual bool drawCross (const TwoDimensional::Point2D &center, Pixels::ColorDefinition colorDef=Pixels::White, Length squareEdge=5) throw ()
 Draws a cross centered in center, included in a square whose length of edge is squareEdge.
virtual bool drawCross (Coordinate xCenter, Coordinate yCenter, Pixels::ColorDefinition colorDef=Pixels::White, Length squareEdge=5) throw ()
 Draws a cross centered in center, included in a square whose length of edge is squareEdge.
virtual bool drawEdges (Pixels::ColorDefinition edgeColor=Pixels::White, Length edgeWidth=1) throw ()
 Draws the edges of this surface, with specified color and edge width.
virtual bool drawBox (const UprightRectangle &rectangle, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw ()
 Draws a box with specified RGBA color.
virtual bool drawBox (const UprightRectangle &rectangle, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true) throw ()
 Draws a box with specified RGBA color.
virtual bool drawCircle (Coordinate xCenter, Coordinate yCenter, Length radius, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true, bool blended=true) throw ()
 Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface.
virtual bool drawCircle (Coordinate xCenter, Coordinate yCenter, Length radius, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true, bool blended=true) throw ()
 Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface.
virtual bool drawDiscWithEdge (Coordinate xCenter, Coordinate yCenter, Length outerRadius, Length innerRadius, Pixels::ColorDefinition ringColorDef=Pixels::Blue, Pixels::ColorDefinition discColorDef=Pixels::White, bool blended=true) throw ()
 Draws a disc whose center is (xCenter,yCenter), of specified radius (totalRadius), filled with specified color discColorDef, with a ring in it, on its border, i.e.
virtual bool drawEllipse (Coordinate xCenter, Coordinate yCenter, Length horizontalRadius, Length verticalRadius, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw ()
 Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface.
virtual bool drawEllipse (Coordinate xCenter, Coordinate yCenter, Length horizontalRadius, Length verticalRadius, Pixels::ColorDefinition colorDef, bool filled=true) throw ()
 Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface.
virtual bool drawPie (Coordinate xCenter, Coordinate yCenter, Length radius, Ceylan::Maths::AngleInDegrees angleStart, Ceylan::Maths::AngleInDegrees angleStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw ()
 Draws a polygon-based filled pie whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface, starting from angleStart, stopping to angleStop, both expressed in degrees.
virtual bool drawPie (Coordinate xCenter, Coordinate yCenter, Length radius, Ceylan::Maths::AngleInDegrees angleStart, Ceylan::Maths::AngleInDegrees angleStop, Pixels::ColorDefinition colorDef) throw ()
 Draws a polygon-based filled pie whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface, starting from angleStart, stopping to angleStop.
virtual bool drawTriangle (Coordinate x1, Coordinate y1, Coordinate x2, Coordinate y2, Coordinate x3, Coordinate y3, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw ()
 Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
virtual bool drawTriangle (Coordinate x1, Coordinate y1, Coordinate x2, Coordinate y2, Coordinate x3, Coordinate y3, Pixels::ColorDefinition colorDef, bool filled=true) throw ()
 Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
virtual bool drawTriangle (const TwoDimensional::Point2D &p1, const TwoDimensional::Point2D &p2, const TwoDimensional::Point2D &p3, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw ()
 Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
virtual bool drawTriangle (const TwoDimensional::Point2D &p1, const TwoDimensional::Point2D &p2, const TwoDimensional::Point2D &p3, Pixels::ColorDefinition colorDef, bool filled=true) throw ()
 Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
virtual bool drawPolygon (const std::list< TwoDimensional::Point2D * > summits, Coordinate x, Coordinate y, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw ()
 Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface.
virtual bool drawPolygon (const std::list< TwoDimensional::Point2D * > summits, Coordinate x, Coordinate y, Pixels::ColorDefinition colorDef, bool filled=true) throw ()
 Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface.
virtual bool drawGrid (Length columnStride=20, Length rowStride=20, Pixels::ColorDefinition lineColor=Pixels::White, bool fillBackground=false, Pixels::ColorDefinition backgroundColor=Pixels::Black) throw ()
 Draws a grid, with specified space between columns and rows and specified colors.
virtual bool printText (const std::string &text, Coordinate x, Coordinate y, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw ()
 Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates.
virtual bool printText (const std::string &text, Coordinate x, Coordinate y, ColorDefinition colorDef=Pixels::White) throw ()
 Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates.
virtual bool blitTo (Surface &targetSurface) const throw ( VideoException )
 Blits this surface onto specified surface.
virtual bool blitTo (Surface &targetSurface, Coordinate x, Coordinate y) const throw ( VideoException )
 Blits this surface onto specified surface.
virtual bool blitTo (Surface &targetSurface, const TwoDimensional::Point2D &location) const throw ( VideoException )
 Blits this surface onto specified surface.
virtual bool blitTo (Surface &targetSurface, const TwoDimensional::UprightRectangle &sourceRectangle, const TwoDimensional::Point2D &destinationLocation) const throw ( VideoException )
 Blits this surface onto specified surface.
virtual Surfacezoom (Ceylan::Maths::Real abscissaZoomFactor, Ceylan::Maths::Real ordinateZoomFactor, bool antialiasing=true) const throw ( VideoException )
 Returns a newly created surface, obtained from this surface after a zoom of given factors.
virtual SurfacerotoZoom (Ceylan::Maths::AngleInDegrees angle, Ceylan::Maths::Real zoomFactor, bool antialiasing=true) const throw ( VideoException )
 Returns a newly created surface, obtained from this surface after a rotation of given angle and a zoom of given factor.
virtual SurfacerotoZoom (Ceylan::Maths::AngleInDegrees angle, Ceylan::Maths::Real abscissaZoomFactor, Ceylan::Maths::Real ordinateZoomFactor, bool antialiasing=true) const throw ( VideoException )
 Returns a newly created surface, obtained from this surface after a rotation of given angle and zooms of given factors.
virtual UprightRectanglegetClippingArea () const throw ( VideoException )
 Returns this surface's clipping area, expressed thanks to an UprightRectangle.
virtual void setClippingArea (UprightRectangle &newClippingArea) throw ()
 Sets this surface's clipping area, expressed thanks to an UprightRectangle, whose ownership is left to the caller.
virtual UprightRectanglegetContentArea () const throw ( VideoException )
 Returns this surface's content area, expressed thanks to an UprightRectangle.
virtual void loadImage (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads an image, whose format will be auto-detected, from specified file, into this surface.
virtual void loadJPG (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a JPEG image from specified file into this surface.
virtual void loadPNG (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a PNG image from specified file into this surface.
virtual void loadBMP (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a BMP image from specified file into this surface.
virtual void loadGIF (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a GIF image from specified file into this surface.
virtual void loadLBM (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a LBM image from specified file into this surface.
virtual void loadPCX (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a PCX image from specified file into this surface.
virtual void loadPNM (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a PNM image from specified file into this surface.
virtual void loadTGA (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a TGA image from specified file into this surface.
virtual void loadXPM (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Loads a XPM image from specified file into this surface.
virtual void savePNG (const std::string &filename, bool overwrite=true) throw ( TwoDimensional::ImageException )
 Saves the current content of this surface into a PNG file.
virtual void saveBMP (const std::string &filename, bool overwrite=true) throw ( TwoDimensional::ImageException )
 Saves the current content of this surface into a BMP file.
virtual void update () throw ( VideoException )
 Updates the display with this surface, which will be automatically set in an up-to-date state if necessary, so that it is fully redrawn, including its widgets.
virtual void updateRectangles (const std::list< UprightRectangle * > &listRects) throw ( VideoException )
 Updates the part of this surface corresponding to the specified list of rectangles.
virtual void updateRectangle (const UprightRectangle &rect) throw ( VideoException )
 Updates the part of this surface corresponding to specified rectangle.
virtual void updateRectangle (Coordinate x, Coordinate y, Length width, Length height) throw ( VideoException )
 Updates the part of this surface corresponding to specified rectangle.
virtual bool getRedrawState () const throw ()
 Returns the current need for redraw state.
virtual bool isInternalSurfaceAvailable () const throw ()
 Tells whether the internal SDL surface is void or not.
virtual void addWidget (TwoDimensional::Widget &widget) throw ( VideoException )
 Registers specified widget to this surface, and put it at top level.
virtual void putWidgetToFront (TwoDimensional::Widget &widget) throw ( VideoException )
 Changes stacking inside this container surface so that specified widget is put to front.
virtual void putWidgetToBack (TwoDimensional::Widget &widget) throw ( VideoException )
 Changes stacking inside this container surface so that specified widget is put to back.
virtual void centerMousePosition () throw ()
 Centers in the middle of the screen the position of the mouse cursor, by generating a mouse motion event.
virtual void setMousePosition (Coordinate newX=0, Coordinate newY=0) throw ( VideoException )
 Sets the position of the mouse cursor, by generating a mouse motion event.
virtual bool mustBeLocked () const throw ()
 Tells whether this surface has to be locked before modifying it.
virtual Ceylan::System::Size getSizeInMemory () const throw ()
 Returns the approximate size in memory, in bytes, currently taken by this object.
virtual bool displayData (const Ceylan::Maths::IntegerData *dataArray, Ceylan::Uint32 dataCount, Pixels::ColorDefinition pencilColor, Pixels::ColorDefinition captionColor, Pixels::ColorDefinition backgroundColor, const std::string &caption="", const UprightRectangle *inBox=0) throw ()
 Displays specified set of data, defined by dataArray, an array of dataCount IntegerData elements, as a curve drawn with pencilColor, on a background whose color is backgroundColor.
virtual Point2D getUpperLeftCorner () const throw ()
 Returns this UprightRectangle's upper left corner.
virtual void setUpperLeftCorner (Point2D &newUpperLeftCorner) throw ()
 Sets this UprightRectangle's upper left corner, width and height do not change.
virtual Coordinate getUpperLeftAbscissa () const throw ()
 Returns directly the abscissa of upper left corner.
virtual void setUpperLeftAbscissa (Coordinate newAbscissa) throw ()
 Sets directly the abscissa of the upper left corner of this rectangle.
virtual Coordinate getUpperLeftOrdinate () const throw ()
 Returns directly the ordinate of upper left corner.
virtual void setUpperLeftOrdinate (Coordinate newOrdinate) throw ()
 Sets directly the ordinate of the upper left corner of this rectangle.
virtual Point2D getLowerRightCorner () const throw ()
 Returns this UprightRectangle's lower right corner.
virtual void setLowerRightCorner (Point2D &newLowerRightCorner) throw ( VideoException)
 Sets directly the lower right corner of this rectangle.
virtual Coordinate getLowerRightAbscissa () const throw ()
 Returns directly the abscissa of lower right corner.
virtual void setLowerRightAbscissa (Coordinate newAbscissa) throw ( VideoException )
 Sets directly the abscissa of the lower right corner of this rectangle.
virtual Coordinate getLowerRightOrdinate () const throw ()
 Returns directly the ordinate of lower right corner.
virtual void setLowerRightOrdinate (Coordinate newOrdinate) throw ( VideoException )
 Sets directly the ordinate of the lower right corner of this rectangle.
virtual bool draw (Surface &target, Pixels::ColorElement red, Pixels::ColorElement blue, Pixels::ColorElement green, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) const throw ()
 Draws this UprightRectangle to specified surface with specified RGBA color.
virtual bool draw (Surface &target, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true) const throw ()
 Draws this UprightRectangle to specified surface with specified RGBA color.
virtual bool drawWithRoundedCorners (Surface &target, Length edgeWidth=3, Pixels::ColorDefinition edgeColorDef=Pixels::White, Pixels::ColorDefinition backgroundColorDef=Pixels::Transparent) const throw ()
 Draws this UprightRectangle to specified surface with rounded corners, drawn with specified color, above a background of specified color.
virtual Length computeRadiusForRoundRectangle (Length edgeWidth) const throw ( VideoException )
 Computes the preferred radius of round corners for this rectangle, with the specified edge width.
virtual LowLevelRecttoLowLevelRect () const throw ( VideoException )

Static Public Member Functions

static Pixels::ColorDefinition GetEdgeColor () throw ()
 Returns the current default edge color for all new widgets.
static void SetEdgeColor (Pixels::ColorDefinition edgeColorDef) throw ()
 Sets the edge color for all new widgets.
static SurfaceLoadImage (const std::string &filename, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException )
 Surface factory: creates a new Surface instance from specified image file.
static std::string InterpretFlags (Ceylan::Flags flags) throw ()
 Outputs a textual description of the given surface flags.

Static Public Attributes

static const Ceylan::Flags Software = 0x00000000
 Indicates that a surface is to be stored in system memory.
static const Ceylan::Flags Hardware = 0x00000001
 Indicates that a surface is to be stored in video memory.
static const Ceylan::Flags AsynchronousBlit = 0x00000004
 Indicates that a surface should use asynchronous blits if possible.
static const Ceylan::Flags ExclusivePalette = 0x20000000
 Indicates that a surface should have an exclusive palette.
static const Ceylan::Flags HardwareAcceleratedBlit = 0x00000100
 Indicates that a surface is to use hardware-accelerated blits.
static const Ceylan::Flags ColorkeyBlit = 0x00001000
 Indicates that a surface is to use colorkey blits.
static const Ceylan::Flags RLEColorkeyBlit = 0x00004000
 Indicates that a surface is to use RLE-accelerated colorkey blits.
static const Ceylan::Flags AlphaBlendingBlit = 0x00010000
 Indicates that a surface is to use alpha blending blits.
static const Ceylan::Flags Preallocated = 0x01000000
 Indicates that a surface is to use preallocated memory.
static const Ceylan::Flags RLEColorkeyBlitAvailable = 0x00002000
 Indicates that RLE colorkey blit is actually accelerated (read-only).
static const Ceylan::Flags AnyPixelFormat = 0x10000000
 Indicates that a display surface may use any pixel format.
static const Ceylan::Flags DoubleBuffered = 0x40000000
 Indicates that a display surface is to be double buffered.
static const Ceylan::Flags FullScreen = 0x80000000
 Indicates that a display surface is to be full screen, not windowed.
static const Ceylan::Flags OpenGL = 0x00000002
 Indicates that a display surface should have an OpenGL context.
static const Ceylan::Flags Resizable = 0x00000010
 Indicates that a display surface is to be resizable.
static const Length graphAbscissaOffset = 10
 Offset used when drawing curve in a container.
static const Length graphOrdinateOffset = 15
 Offset used when drawing curve in a container.
static const Length captionAbscissaOffset = 5
 Offset used when printing caption in a container.
static const Length captionOrdinateOffset = 10
 Offset used when printing caption in a container.

Protected Types

typedef Ceylan::Sint16 Offset
 Offset of a Surface.

Protected Member Functions

virtual void setBackBufferRedrawState (bool needsToBeRedrawn) throw ()
 Sets the need for redraw state for the back-buffer.
virtual bool getBackBufferRedrawState () const throw ()
 Returns the current need for redraw state for the back-buffer.
virtual void updateDecorationFlag () throw ()
 Updates the decoration flag, depending on the various services requested.
virtual void updateClientArea () throw ()
 Updates client area with regard to current decoration status.
virtual SurfacegetContainer () throw ()
 Returns this widget's container surface.
virtual const SurfacegetConstContainer () const throw ()
 Returns this widget's container surface as a 'const' object.
virtual void drawFundamentals (Surface &targetSurface) throw ()
 Draws the fundamental parts of a widget : widget area cleaned accordingly to the current base color mode, and edges are drawn.
virtual bool isDecorated () const throw ()
 Tells whether this widget is decorated.
virtual void drawDecorations (Surface &targetSurface) throw ()
 Draws the decorations for this widget to specified surface.
virtual void preUnlock () throw ()
 Effective unlocking of the surface.
virtual void