#include <OSDLWidget.h>


Therefore widgets can have their own widgets too, insofar they are surfaces as well.
So, towards its parent surface, the widget is an event listener.
Being also a Surface, it can have widgets itself, and therefore would behave as an event source too.
When a widget is to be drawn, it has to be managed by its parent surface, which is the only object which is able to know how to cope with stacking and overlapping elements.
Therefore, when a widget changes, the information climbs up the surface composition tree to its root, which will result back, during the next redraw phase, to a selective redraw.
This drawing of the graphical tree is depth-first : child elements are sorted from bottom to top, they are completely drawn in turn.
Besides the inherited 'need for redraw' propagated state, which determines whether the widget needs to copy back its internal video buffer to its parent surface, a widget will have to be re-rendered on request, when its redrawInternal method will be called. Advanced widgets could rely on a backbuffer and a state attribute telling whether the widget changed, so that the redrawInternal method triggers a new rendering of this widget only when appropriate. The interest of this method depends on the balance to be found between the cost of memory resource (the back-buffer) and of CPU usage (the useless redrawings).
Each widget can have either a background color (which is used to fill the widget dedicated area prior to any rendering), or a colorkey (which is used to fill as well its area and set as its colorkey, hence making it fully transparent as a whole before any special rendering which allows for non-rectangular shapes), or not color at all, so that the widget can exactly draw itself as wanted.
The meaning of this base color is determined by the base color mode.
When a colorkey is used, RLE encoding is activated to gain speed.
Definition at line 122 of file OSDLWidget.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 | |
| Widget (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 Widget, whose container surface is container. | |
| virtual | ~Widget () throw () |
| Basic virtual destructor. | |
| 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 void | resize (Length newWidth, Length newHeight, bool ignored=false) throw () |
| Resizes this widget so that its new dimensions are the specified ones. | |
| virtual BaseColorMode | getBaseColorMode () const throw () |
| Returns the current base color mode. | |
| virtual void | setBaseColorMode (BaseColorMode newBaseColorMode, Pixels::ColorDefinition newBaseColor) throw ( VideoException ) |
| Sets the current base color mode and base color. | |
| 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 UprightRectangle & | getClientArea () 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 void | redraw () throw () |
| Redraws this widget, first thanks to a blit of its surface to its parent, then for all its sub-widgets, if any, from bottom to top. | |
| virtual void | redrawInternal () throw () |
| Basic redraw method for internal rendering. | |
| virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw () |
| Returns an user-friendly description of the state of this object. | |
| 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 LowLevelSurface & | getSDLSurface () 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 Palette & | getPalette () 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. | |
| Surface & | createColorReducedSurfaceFor (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 Surface & | flipVertical () 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 Surface & | flipHorizontal () 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 ¢er, 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 Surface & | zoom (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 Surface & | rotoZoom (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 Surface & | rotoZoom (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 UprightRectangle & | getClippingArea () 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 UprightRectangle & | getContentArea () 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. | |
| Surface & | getWidgetRenderTarget () throw () |
| Returns the surface that should be targeted by widgets having to blit their renderings to their container. | |
| 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 LowLevelRect * | toLowLevelRect () 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 Surface & | LoadImage (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 | 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 Surface & | getContainer () throw () |
| Returns this widget's container surface. | |
| virtual const Surface & | getConstContainer () 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 | postLock () throw () |
| Effective locking of the surface. | |
| Offset | getOffset () const throw () |
| Returns this surface's offset. | |
| void | setOffset (Offset offset) throw () |
| Sets this surface's offset. | |
| virtual void | flush () throw () |
| Releases internal SDL surface. | |
| virtual void | |