OSDL::Video::TwoDimensional::Widget Class Reference

#include <OSDLWidget.h>

Inheritance diagram for OSDL::Video::TwoDimensional::Widget:

[legend]
Collaboration diagram for OSDL::Video::TwoDimensional::Widget:
[legend]
List of all members.

Detailed Description

Widgets are graphical components that are drawn in their parent container, which is a surface.

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

See also:
the BackBufferedWidget class for this behaviour.
Widgets can handle window decorations, notably for being minimized, maximized, dragged, wrapped or closed by the user. The corresponding icons may be used. Default ones are provided as 18*18 PNG icons. If one of the previous features is activated for a widget, it will trigger automatically the widget decoration.

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 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 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 SDL_Surface & getSDLSurface () const throw ()
 Returns the SDL surface corresponding to that surface.
virtual void setSDLSurface (SDL_Surface &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.
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 bool setPalette (Palette &newPalette, ColorCount startingColorIndex=0, ColorCount numberOfColors=0, Ceylan::Flags targettedPalettes=Palette::Logical|Palette::Physical) throw ()
 Sets this surface's palette thanks to specified one.
virtual PixelFormat & getPixelFormat () const throw ()
 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 ()
 Clears the screen.
virtual SurfaceflipVertical () const throw ()
 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 ()
 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, 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 ()
 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 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.
SurfacegetWidgetRenderTarget () 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 ()
 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 SDL_Rect * toSDLRect () 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
 Indicates that a surface is to be stored in system memory.
static const Ceylan::Flags Hardware
 Indicates that a surface is to be stored in video memory.
static const Ceylan::Flags AsynchronousBlit
 Indicates that a surface should use asynchronous blits if possible.
static const Ceylan::Flags ExclusivePalette
 Indicates that a surface should have an exclusive palette.
static const Ceylan::Flags HardwareAcceleratedBlit
 Indicates that a surface is to use hardware-accelerated blits.
static const Ceylan::Flags ColorkeyBlit
 Indicates that a surface is to use colorkey blits.
static const Ceylan::Flags RLEColorkeyBlit
 Indicates that a surface is to use RLE-accelerated colorkey blits.
static const Ceylan::Flags AlphaBlendingBlit
 Indicates that a surface is to use alpha blending blits.
static const Ceylan::Flags Preallocated
 Indicates that a surface is to use preallocated memory.
static const Ceylan::Flags RLEColorkeyBlitAvailable
 Indicates that RLE colorkey blit is actually accelerated (read-only).
static const Ceylan::Flags AnyPixelFormat
 Indicates that a display surface may use any pixel format.
static const Ceylan::Flags DoubleBuffered
 Indicates that a display surface is to be double buffered.
static const Ceylan::Flags FullScreen
 Indicates that a display surface is to be full screen, not windowed.
static const Ceylan::Flags OpenGL
 Indicates that a display surface should have an OpenGL context.
static const Ceylan::Flags Resizable
 Indicates that a display surface is to be resizable.
static const Length graphAbscissaOffset
 Offset used when drawing curve in a container.
static const Length graphOrdinateOffset
 Offset used when drawing curve in a container.
static const Length captionAbscissaOffset
 Offset used when printing caption in a container.
static const Length captionOrdinateOffset
 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 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 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 inconsistencyDetected (const std::string &message) const throw ()
 Triggered when an abnormal inconsistency is detected between OSDL's surface state and its back-end counterpart.

Protected Attributes

Point2D _upperLeftCorner
 This widget's upper left corner, relatively to its container.
UprightRectangle _clientArea
 The rectangular client area, defined in the referential of this widget.
bool _decorated
 Tells whether this widget rendering should include decorations.
std::string _title
 This Widget's title.
bool _minMaximizable
 Tells whether this widget can be minimized and maximized by the user.
bool _draggable
 Tells whether this widget can be dragged by the user.
bool _wrappable
 Tells whether this widget can be wrapped by the user, hiding the whole widget but its decoration.
bool _closable
 Tells whether this widget can be closed by the user.
bool _hasFocus
 Tells whether this widget has currently the focus (i.e.
BaseColorMode _baseColorMode
 Tells whether a background color, color-keying or nothing special shall be used for this widget.
Pixels::ColorDefinition _baseColor
 Stores the base color of this widget, which is either used as a background color or a colorkey, depending on '_baseColorMode'.
Pixels::PixelColor _actualBaseColor
 The base color, converted to this widget current pixel format, inherited from container.
SDL_Surface * _surface
 This internal structure also contains private fields not used here.
DisplayType _displayType
 Tells what is the display type of this surface.
bool _mustBeLocked
 Tells whether this surface must be locked before modifying it.
Coordinate _x
 Upper left corner's abscissa (horizontal coordinate).
Coordinate _y
 Upper left corner's ordinate (vertical coordinate).

Static Protected Attributes

static Pixels::ColorDefinition _EdgeColor
 Color of widget edges.
static Pixels::ColorDefinition _TitleColor
 Color of widget title.
static Text::HorizontalAlignment _TitleHorizontalAlignment
 Defines how a widget title should be horizontally aligned (default : Center).
static Text::VerticalAlignment _TitleVerticalAlignment
 Defines how a widget title should be vertically aligned.
static Length _ClientOffsetWidth
 Default width offset for client area relative to widget vertical edges.
static Length _ClientOffsetHeight
 Default height offset for client area relative to widget horizontal edges.
static Coordinate _TitleOffsetAbscissa
 Default abscissa offset relative to widget upper left corner used to print widget title with left alignment.
static Coordinate _TitleOffsetOrdinate
 Default ordinate offset relative to widget upper left corner used to print widget title.
static Coordinate _TitleBarOffsetOrdinate
 Default ordinate offset relative to widget upper left corner used to draw widget title bar.
static std::string _DefaultTitle
 Default title to be used when a titleless widget has however to be rendered decorated.

Private Member Functions

 Widget (const Widget &source) throw ()
 Copy constructor made private to ensure that it will never be called.
Widgetoperator= (const Widget &source) throw ()
 Assignment operator made private to ensure that it will never be called.


Member Typedef Documentation

typedef Ceylan::Sint16 OSDL::Video::Surface::Offset [protected, inherited]

Offset of a Surface.

Definition at line 3083 of file OSDLSurface.h.


Member Enumeration Documentation

enum OSDL::Video::TwoDimensional::Widget::BaseColorMode

Describes the available modes for handling the base color of a widget.

Hence the base color can be the background color of a widget ('BackgroundColor'), or the color key to be used if automatic color-keying is activated ('Colorkey'). The base color can be ignored thanks to 'None'.

The 'NotInitialized' value is only to be used in constructors.

Enumerator:
BackgroundColor 
Colorkey 
None 
NotInitialized 

Definition at line 144 of file OSDLWidget.h.

enum OSDL::Video::Surface::DisplayType [inherited]

Describes the display type of a surface :.

Enumerator:
BackBuffer 
ClassicalScreenSurface 
OpenGLScreenSurface 

Definition at line 197 of file OSDLSurface.h.


Constructor & Destructor Documentation

OSDL::Video::TwoDimensional::Widget::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.

Its container, which is always a surface (since Widgets are themselves specialized surfaces) will own this widget, therefore will deallocate it when appropriate.

Most of the widget attributes, such as bits per pixel, will be deduced from the corresponding attributes of the container surface.

A Widget is a (special) surface. This surface stores the result of the rendering of this widget and of all the renderings of subwidgets this widget may have.

As a result, a basic widget has no surface of its own, where it could store its own rendering for later use. Therefore when at least one of its subwidgets changes, it has to be veritably redrawn too, instead of which it could simply blit its own rendering, if it were stored.

To rely on such behaviour, see the BackBufferedWidget class.

Even if there is not reason for that widget to be decorated (no title, no special attributes such as maximizable activated, etc.), decoration rendering can be forced after widget creation thanks to the setDecorationStatus method.

Widgets are created by default with a pure black colorkey (Pixels::Black) and with color-keying disabled.

Parameters:
container this Widget's container surface, to which it will automatically be subscribed to, as an EventListener for redraw operations.
relativePosition tells where the upper-left corner of the widget is located inside its container.
width this widget's width, in pixels.
height this widget's height, in pixels.
baseColorMode is the chosen mode for base color.
baseColor is the base color of the widget.
title the title which may be drawn, if non empty, on the top of this widget.
minMaximizable tells whether the widget can be minimized or maximized by the user.
draggable tells whether the widget can be dragged by the user.
wrappable tells whether the widget can be wrapped (only the widget decoration is displayed) by the user.
closable tells whether the widget can be closed by the user.
Exceptions:
VideoException if an error occured, for example with colorkey activation.
Note:
The stacking is set to the top position on creation. The stack level used to be inaccurately modeled as a third coordinate (depth), instead of which it is managed thanks to an ordered list in the parent container.

Parent surface cannot be 'const' since the widget may issue redraw triggers for example.

Widget::~Widget (  )  throw () [virtual]

Basic virtual destructor.

Definition at line 126 of file OSDLWidget.cc.

OSDL::Video::TwoDimensional::Widget::Widget ( const Widget source  )  throw () [explicit, private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

void Widget::setWidth ( Length  newWidth  )  throw () [virtual]

Sets the current width of this widget.

If the new width is different from the current one, triggers a resize that will invalidate this widget rendering : 'needs redraw' will be true afterwards.

The client area will be automatically adjusted.

Reimplemented from OSDL::Video::Surface.

Definition at line 143 of file OSDLWidget.cc.

void Widget::setHeight ( Length  newHeight  )  throw () [virtual]

Sets the current height of this widget.

If the new height is different from the current one, triggers a resize that will invalidate this widget rendering : 'needs redraw' will be true afterwards.

The client area will be automatically adjusted.

Reimplemented from OSDL::Video::Surface.

Definition at line 151 of file OSDLWidget.cc.

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().

void Widget::resize ( Length  newWidth,
Length  newHeight,
bool  ignored = false 
) throw () [virtual]

Resizes this widget so that its new dimensions are the specified ones.

If the new dimensions are the same as the current ones, then nothing special will be done, widget stays as is.

Otherwise, it will be resized and will invalidate this widget rendering : 'needs redraw' will be true afterwards.

The client area will be automatically adjusted.

Parameters:
newWidth the new width.
newHeight the new height.
ignored is ignored.

Reimplemented from OSDL::Video::Surface.

Reimplemented in OSDL::Video::TwoDimensional::BackBufferedWidget.

Definition at line 159 of file OSDLWidget.cc.

References OSDL::Video::Surface::resize().

Referenced by OSDL::Video::TwoDimensional::BackBufferedWidget::resize().

Widget::BaseColorMode Widget::getBaseColorMode (  )  const throw () [virtual]

Returns the current base color mode.

Definition at line 179 of file OSDLWidget.cc.

References _baseColorMode.

Referenced by OSDL::Video::TwoDimensional::BackBufferedWidget::redrawInternal().

void Widget::setBaseColorMode ( BaseColorMode  newBaseColorMode,
Pixels::ColorDefinition  newBaseColor 
) throw ( VideoException ) [virtual]

Sets the current base color mode and base color.

Based on previous values, only the necessary operations will be performed.

, setting the same colorkey twice will activate the key only once.

Note:
Sets the 'needsRedraw' flag to true if a change occured.
Parameters:
newBaseColorMode the new base color mode.
newBaseColor the new base color.
Exceptions:
VideoException if a change in color-keying failed.

Reimplemented in OSDL::Video::TwoDimensional::BackBufferedWidget.

Definition at line 188 of file OSDLWidget.cc.

References OSDL::Video::Pixels::areEqual(), and OSDL::Video::Pixels::convertColorDefinitionToPixelColor().

Pixels::ColorDefinition Widget::getBaseColor (  )  const throw () [virtual]

Returns the current base color.

Definition at line 257 of file OSDLWidget.cc.

References _baseColor.

void Widget::setDecorationStatus ( bool  newDecorationStatus  )  throw () [virtual]

Sets the current decoration status, so that this widget will have decorations or not after this method is called.

Parameters:
newDecorationStatus the new decoration status.

Definition at line 266 of file OSDLWidget.cc.

const UprightRectangle & Widget::getClientArea (  )  const throw () [virtual]

Returns an upright rectangle which describes the client area, in widget referential.

Client area is the total usable area that is left for this widget specific renderings.

Note:
The client area might not be the whole widget area, for example if the widget is decorated : at least the title bar will not be taken in client area.

Definition at line 275 of file OSDLWidget.cc.

References _clientArea.

bool Widget::clean (  )  throw () [virtual]

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.

Note:
The '_needsRedraw' flag is not changed.

Definition at line 284 of file OSDLWidget.cc.

References _baseColor, _baseColorMode, BackgroundColor, Colorkey, OSDL::Video::Surface::fill(), None, and NotInitialized.

void Widget::beNotifiedOf ( const Ceylan::Event &  newEvent  )  throw () [virtual]

Notifies this widget of a new event whose source is its container.

Note:
This event remains property of the container, which will take care of its life cycle.

Definition at line 320 of file OSDLWidget.cc.

void Widget::setRedrawState ( bool  needsToBeRedrawn  )  throw () [virtual]

Sets redraw state.

Note:
On transition from the 'needs redraw' flag from false to true, parent container is notified.

Reimplemented from OSDL::Video::Surface.

Definition at line 345 of file OSDLWidget.cc.

References OSDL::Video::Surface::setRedrawState().

Referenced by redrawInternal(), and OSDL::Video::TwoDimensional::BackBufferedWidget::redrawInternal().

void Widget::redraw (  )  throw () [virtual]

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.

Note:
If necessary (if the widget changed), then prior to any action, the widget will update its surface, thanks to redrawInternal.

Reimplemented from OSDL::Video::Surface.

Reimplemented in OSDL::Video::TwoDimensional::BackBufferedWidget.

Definition at line 361 of file OSDLWidget.cc.

References _upperLeftCorner, OSDL::Video::Surface::blitTo(), getContainer(), OSDL::Video::Surface::getRedrawState(), OSDL::Video::Surface::getWidgetRenderTarget(), OSDL::Video::Surface::redraw(), and OSDL::Video::Pixels::toString().

void Widget::redrawInternal (  )  throw () [virtual]

Basic redraw method for internal rendering.

This basic implementation only fills the overall widget surface with the background color, draws the edges and renders the caption (a text below an horizontal line).

Note:
This method is meant to be overridden, so that this widget is able to paint itself, i.e. only its background, its widgets excluded.

Such overriding method must, once done, set the '_needsRedraw' flag to false, otherwise its container(s) will be drawn again and again, uselessly.

Reimplemented from OSDL::Video::Surface.

Reimplemented in OSDL::Video::TwoDimensional::BackBufferedWidget.

Definition at line 398 of file OSDLWidget.cc.

References _decorated, drawDecorations(), drawFundamentals(), and setRedrawState().

const string Widget::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Reimplemented from OSDL::Video::Surface.

Reimplemented in OSDL::Video::TwoDimensional::BackBufferedWidget, and OSDL::Video::TwoDimensional::TextWidget.

Definition at line 422 of file OSDLWidget.cc.

References OSDL::Video::OpenGL::None, OSDL::Video::Surface::toString(), and OSDL::Video::Pixels::toString().

Pixels::ColorDefinition Widget::GetEdgeColor (  )  throw () [static]

Returns the current default edge color for all new widgets.

Definition at line 523 of file OSDLWidget.cc.

References _EdgeColor.

void Widget::SetEdgeColor ( Pixels::ColorDefinition  edgeColorDef  )  throw () [static]

Sets the edge color for all new widgets.

Parameters:
edgeColorDef the color definition of the edges.

Definition at line 531 of file OSDLWidget.cc.

void Widget::updateDecorationFlag (  )  throw () [protected, virtual]

Updates the decoration flag, depending on the various services requested.

Definition at line 544 of file OSDLWidget.cc.

References _closable, _decorated, _draggable, _minMaximizable, _title, and _wrappable.

void Widget::updateClientArea (  )  throw () [protected, virtual]

Updates client area with regard to current decoration status.

Reimplemented in OSDL::Video::TwoDimensional::TextWidget.

Definition at line 556 of file OSDLWidget.cc.

References _clientArea, _ClientOffsetHeight, _ClientOffsetWidth, _decorated, _TitleBarOffsetOrdinate, OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getWidth(), OSDL::Video::TwoDimensional::UprightRectangle::setHeight(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftOrdinate(), and OSDL::Video::TwoDimensional::UprightRectangle::setWidth().

Referenced by OSDL::Video::TwoDimensional::TextWidget::updateClientArea().

Surface & Widget::getContainer (  )  throw () [protected, virtual]

Returns this widget's container surface.

Note:
The container of this widget is stored as its only event source.

Definition at line 590 of file OSDLWidget.cc.

References OSDL::Video::Pixels::toString().

Referenced by redraw(), and OSDL::Video::TwoDimensional::BackBufferedWidget::redraw().

const Surface & Widget::getConstContainer (  )  const throw () [protected, virtual]

Returns this widget's container surface as a 'const' object.

Note:
The container of this widget is stored as its only event source.

This 'const' method is useful so that calling method (ex : toString) can remain 'const' as well.

Definition at line 618 of file OSDLWidget.cc.

References OSDL::Video::Pixels::toString().

void Widget::drawFundamentals ( Surface targetSurface  )  throw () [protected, virtual]

Draws the fundamental parts of a widget : widget area cleaned accordingly to the current base color mode, and edges are drawn.

Note:
The 'needs redraw' flag is not changed.
Remains not static to allow easy override, and needs widget attributes.

Definition at line 646 of file OSDLWidget.cc.

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and redrawInternal().

bool Widget::isDecorated (  )  const throw () [protected, virtual]

Tells whether this widget is decorated.

Note:
A widget is decorated if and only if at least one of its possible features (ex : draggable, movable, etc.) is activated.

Definition at line 660 of file OSDLWidget.cc.

References _decorated.

void Widget::drawDecorations ( Surface targetSurface  )  throw () [protected, virtual]

Draws the decorations for this widget to specified surface.

Parameters:
targetSurface must be specified since decorations are not always to be rendered directly on widget surface : for instance for back-buffered widgets, another surface is targeted.
Note:
Remains not static to allow easy override, and needs widget attributes.

Definition at line 668 of file OSDLWidget.cc.

References OSDL::Video::TwoDimensional::Text::BasicFontCharacterHeight, OSDL::Video::TwoDimensional::Text::BasicFontCharacterWidth, OSDL::Video::TwoDimensional::Text::Bottom, OSDL::Video::TwoDimensional::Text::HeightCentered, OSDL::Video::TwoDimensional::Text::Left, OSDL::Video::TwoDimensional::Text::Right, OSDL::Video::TwoDimensional::Text::Top, and OSDL::Video::TwoDimensional::Text::WidthCentered.

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and redrawInternal().

Widget& OSDL::Video::TwoDimensional::Widget::operator= ( const Widget source  )  throw () [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

Clonable & Surface::clone (  )  const throw ( Ceylan::ClonableException ) [virtual, inherited]

Clones this Surface : creates a new Surface, exact copy of this Surface, but with no data shared with it at all.

The display type of the clone will be back-buffer.

Exceptions:
VideoException on failure, such as the impossibility of creating the new surface, or to blit the former one.
Note:
Returns 'Clonable' instead of 'Surface' since adjusting pointers for covariant returns is not implemented yet with gcc (3.3.5).

Definition at line 316 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface, OSDL::Video::Surface::BackBuffer, OSDL::Utils::getBackendLastError(), OSDL::Video::Surface::getBitsPerPixel(), OSDL::Video::Pixels::getCurrentColorMasks(), OSDL::Video::Surface::getFlags(), OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getPixelFormat(), OSDL::Video::Surface::getWidth(), OSDL::Video::Surface::Surface(), and OSDL::Video::Pixels::toString().

SDL_Surface & Surface::getSDLSurface (  )  const throw () [virtual, inherited]

Returns the SDL surface corresponding to that surface.

Note:
The returned surface can be the null pointer.

This surface keeps ownership of the returned SDL surface.

Returns:
the SDL surface corresponding to that surface.

Definition at line 387 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Referenced by OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Overlay::Overlay(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text(), OSDL::Video::VideoModule::setWindowIcon(), and OSDL::Video::VideoModule::toggleFullscreen().

void Surface::setSDLSurface ( SDL_Surface &  newSurface,
DisplayType  displayType = BackBuffer 
) throw () [virtual, inherited]

Sets this surface so that it corresponds to the supplied SDL surface.

Parameters:
newSurface the new surface to be managed
displayType tells whether this new surface is a backbuffer or a screen surface.
Note:
Deallocates any previously held surface.

Definition at line 396 of file OSDLSurface.cc.

Surface::DisplayType Surface::getDisplayType (  )  const throw () [virtual, inherited]

Returns the display type (back-buffer, screen, etc.

) of this Surface.

Definition at line 409 of file OSDLSurface.cc.

References OSDL::Video::Surface::_displayType.

void Surface::setDisplayType ( DisplayType  newDisplayType  )  throw () [virtual, inherited]

Sets the new display type (back-buffer, screen, etc.

) of this surface.

Definition at line 417 of file OSDLSurface.cc.

Ceylan::Flags Surface::getFlags (  )  const throw () [virtual, inherited]

Returns the flags caracterizing this surface.

See also:
the static Flags defined in this class.

Definition at line 425 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Referenced by OSDL::Video::Surface::clone(), and OSDL::Video::Surface::convertFromColorKeyToAlphaChannel().

virtual void OSDL::Video::Surface::setFlags ( Ceylan::Flags  newFlags  )  throw () [virtual, inherited]

Sets the flags caracterizing this surface.

Note:
Does not change anything to the surface, though.
See also:
the static Flags defined in this class.

void Surface::convertToDisplay ( bool  alphaChannelWanted = true  )  throw ( VideoException ) [virtual, inherited]

Converts the internal surface to the pixel format of the display, so that any blit of this surface to the screen is quicker.

The backend must already be initialized.

Parameters:
alphaChannelWanted tells whether this converted surface should have an alpha channel after this call.
This method can be used to convert a colorkey to an alpha channel, if the ColorkeyBlit flag is already set on this surface and if alphaChannelWanted is true. The generated surface will then be transparent (alpha=AlphaTransparent) where the pixels match the colorkey, and opaque (alpha=AlphaOpaque) elsewhere.

Exceptions:
VideoException if no internal surface is available, if the conversion failed or if there is not enough memory.

Definition at line 442 of file OSDLSurface.cc.

Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Surface::convertFromColorKeyToAlphaChannel(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().

virtual void OSDL::Video::Surface::setAlpha ( Ceylan::Flags  flags,
Pixels::ColorElement  newAlpha 
) throw ( VideoException ) [virtual, inherited]

Adjusts the alpha properties of the surface : sets the per-surface alpha value and/or enables or disables alpha blending.

Parameters:
flags can be an OR'd combination of the following two options, one of these options, or 0 (none) :
newAlpha is the per-surface alpha value. A surface needs not to have an alpha channel to use per-surface alpha, and blitting can still be accelerated with Surface::RLEColorkeyBlit.
Note:
0 (AlphaTransparent) is considered fully transparent and 255 (AlphaOpaque) is considered fully opaque.

The per-surface alpha value of 128 is considered a special case and is optimised, so it is much faster than other per-surface values.

virtual void OSDL::Video::Surface::setColorKey ( Ceylan::Flags  flags,
Pixels::PixelColor  keyPixelColor 
) throw ( VideoException ) [virtual, inherited]

Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration.

RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e. pixels that match the key value). The key must be defined accoring to the same pixel format as the surface.

Parameters:
flag can be a OR'ed combination :
  • if Surface::ColorkeyBlit is set, then the key is the transparent pixel value in the source image of a blit.
  • if Surface::RLEColorkeyBlit is set, RLE acceleration will be used when blitting this surface. The RLE encoding will be performed the first time the surface is blitted or when it will be converted to display format.
If flag is 0, this function clears any current color key.

Parameters:
keyPixelColor,the pixel color of the key. Pixels::convertColorDefinitionToPixelColor is often useful for obtaining a correct value for the color key.

Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().

virtual void OSDL::Video::Surface::setColorKey ( Ceylan::Flags  flags,
Pixels::ColorDefinition  keyColorDef 
) throw ( VideoException ) [virtual, inherited]

Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration.

RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e. pixels that match the key value). The key must be defined accoring to the same pixel format as the surface.

Parameters:
flag can be a OR'ed combination :
  • if Surface::ColorkeyBlit is set, then the key is the transparent pixel value in the source image of a blit.
  • if Surface::RLEColorkeyBlit is set, RLE acceleration will be used when blitting this surface. The RLE encoding will be performed the first time the surface is blitted or when it will be converted to display format.
If flag is 0, this function clears any current color key.

Parameters:
keyColorDef the color definition of the color key.

void Surface::convertFromColorKeyToAlphaChannel (  )  throw ( VideoException ) [virtual, inherited]

Converts this surface, which must use a color key, so that it uses an alpha channel instead.

This method uses 'convertToDisplay'.

Exceptions:
VideoException if no internal surface is available, if it does not use color key, if the conversion failed or if there is not enough memory.

Definition at line 504 of file OSDLSurface.cc.

References OSDL::Video::Surface::ColorkeyBlit, OSDL::Video::Surface::convertToDisplay(), OSDL::Video::Surface::getFlags(), and OSDL::Video::Surface::toString().

virtual bool OSDL::Video::Surface::setPalette ( Palette newPalette,
ColorCount  startingColorIndex = 0,
ColorCount  numberOfColors = 0,
Ceylan::Flags  targettedPalettes = Palette::Logical|Palette::Physical 
) throw () [virtual, inherited]

Sets this surface's palette thanks to specified one.

Parameters:
newPalette the palette from which new color definitions should be taken.
startingColorIndex the color-definition index in newPalette from which color definitions will be taken.
numberOfColors the number of colors that should be copied, starting from startingColorIndex. If zero, all remaining color definitions from newPalette will be taken.
targettedPalettes a flag which tells whether logical palette, physical one or both (OR'ed) should be updated.
Returns:
true if all colours were set exactly as requested, false otherwise.

Pixels::PixelFormat & Surface::getPixelFormat (  )  const throw () [virtual, inherited]

Returns this surface's pixel format.

Definition at line 552 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Surface::clone(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().

void Surface::setPixelFormat ( PixelFormat &  newFormat  )  throw () [virtual, inherited]

Sets this surface's pixel format.

Definition at line 564 of file OSDLSurface.cc.

Pitch Surface::getPitch (  )  const throw () [virtual, inherited]

Returns this surface's pitch.

Definition at line 692 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

void Surface::setPitch ( Pitch  newPitch  )  throw () [virtual, inherited]

Sets this surface's pitch.

Definition at line 700 of file OSDLSurface.cc.

Length Surface::getWidth (  )  const throw () [virtual, inherited]

Returns this Surface's width.

Reimplemented from OSDL::Video::TwoDimensional::UprightRectangle.

Definition at line 708 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Referenced by OSDL::Video::Surface::centerMousePosition(), OSDL::Video::Surface::clone(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().

Length Surface::getHeight (  )  const throw () [virtual, inherited]

Returns this Surface's height.

Reimplemented from OSDL::Video::TwoDimensional::UprightRectangle.

Definition at line 724 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Referenced by OSDL::Video::Surface::centerMousePosition(), OSDL::Video::Surface::clone(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().

BitsPerPixel Surface::getBitsPerPixel (  )  const throw () [virtual, inherited]

Returns this surface's color depth, bits per pixel.

Note:
Do not mix up with bytes per pixels.
See also:
getBytesPerPixel

Definition at line 830 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Referenced by OSDL::Video::Surface::clone().

void Surface::setBitsPerPixel ( BitsPerPixel  newBitsPerPixel  )  throw () [virtual, inherited]

Sets this surface's color depth, bits per pixel.

Note:
This method does not update the BytesPerPixel settings.

Definition at line 838 of file OSDLSurface.cc.

BytesPerPixel Surface::getBytesPerPixel (  )  const throw () [virtual, inherited]

Returns this surface's overall color depth, bytes per pixel.

Note:
Do not mix up with bits per pixels.
See also:
getBitsPerPixel

Definition at line 848 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

void Surface::setBytesPerPixel ( BytesPerPixel  newBytesPerPixel  )  throw () [virtual, inherited]

Sets this surface's color depth, bytes per pixel.

Note:
This method does not update the BytesPerPixel settings.

Definition at line 856 of file OSDLSurface.cc.

void * Surface::getPixels (  )  const throw () [virtual, inherited]

Returns this surface's video buffer, i.e.

its whole set of pixels.

Definition at line 866 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

void Surface::setPixels ( void *  newPixels  )  throw () [virtual, inherited]

Sets this surface's video buffer, i.e.

its whole set of pixels.

Definition at line 875 of file OSDLSurface.cc.

bool Surface::fill ( Pixels::ColorDefinition  colorDef = Pixels::Black  )  throw () [virtual, inherited]

Fills this surface with specified color.

Can be used for blanking a surface, if the background color is chosen.

Parameters:
colorDef the color definition of the fill color.
Returns:
true iff the operation succeeded.
Note:
Locks surface if needed.

Definition at line 570 of file OSDLSurface.cc.

References OSDL::Video::Pixels::toString().

Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), clean(), OSDL::Video::Surface::clear(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), OSDL::Video::TwoDimensional::BackBufferedWidget::redrawInternal(), OSDL::Video::TwoDimensional::Text::Font::renderLatin1MultiLineText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().

bool Surface::clear (  )  throw () [virtual, inherited]

Clears the screen.

This method performs a mere 'fill' with pure black.

Returns:
true iff the operation succeeded.
Note:
Locks surface if needed.

Definition at line 590 of file OSDLSurface.cc.

References OSDL::Video::Pixels::Black, and OSDL::Video::Surface::fill().

Surface & Surface::flipVertical (  )  const throw () [virtual, inherited]

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.

Something looking as '>' would be flipped into '<'.

Returns:
a new surface whose pixels are the ones of this left-untouched surface, the pixels being vertically flipped.
Note:
The returned surface will have to be deallocated by the caller.

Definition at line 598 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface, and OSDL::Video::Surface::Surface().

Surface & Surface::flipHorizontal (  )  const throw () [virtual, inherited]

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.

Something looking as '^' would be flipped into 'v'.

Returns:
a new surface whose pixels are the ones of this left-untouched surface, the pixels being horizontally flipped.
Note:
The returned surface will have to be deallocated by the caller.

Definition at line 640 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface, and OSDL::Video::Surface::Surface().

string Surface::describePixelAt ( Coordinate  x,
Coordinate  y 
) throw () [virtual, inherited]

Returns a textual description of the pixel of this surface located at [x;y].

Parameters:
x the abscissa of the pixel.
y the ordinate of the pixel.
Returns:
a string containing a description (mainly the RGBA coordinates) of this pixel.

Definition at line 675 of file OSDLSurface.cc.

References OSDL::Video::Pixels::toString().

Referenced by OSDL::Video::TwoDimensional::drawDiscWithEdge().

Pixels::PixelColor Surface::getPixelColorAt ( Coordinate  x,
Coordinate  y 
) const throw ( VideoException ) [virtual, inherited]

Returns the pixel color of one particular pixel of this surface, located at [x;y], encoded according to the pixel format of this surface.

Returns:
the encoded pixel color of the pixel at [x;y].
No clipping is performed, the surface should have been previously locked if necessary.

See also:
OSDL::Video::Pixels::get

Definition at line 888 of file OSDLSurface.cc.

References OSDL::Video::Pixels::getPixelColor().

Pixels::ColorDefinition Surface::getColorDefinitionAt ( Coordinate  x,
Coordinate  y 
) const throw ( VideoException ) [virtual, inherited]

Returns the color definition of one particular pixel of this surface, located at [x;y].

If this surface has no alpha coordinate, then the fourth color coordinate of the returned definition will be AlphaOpaque.

No clipping is performed, the surface should have been previously locked if necessary.

See also:
OSDL::Video::Pixels::get

Definition at line 897 of file OSDLSurface.cc.

References OSDL::Video::Pixels::convertPixelColorToColorDefinition(), and OSDL::Video::Pixels::getPixelColor().

void Surface::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 ) [virtual, inherited]

Sets the pixel at [x;y] of this surface to the given color, specified as separate RGBA coordinates.

Parameters:
x the abscissa of the point to change.
y the ordinate of the point to change.
red the red color coordinate.
green the green color coordinate.
blue the blue color coordinate.
alpha the alpha color coordinate.
blending tells whether the alpha channel must be taken into account, resulting to alpha blending with the destination pixel. If false, the exact specified color will be put in target pixel, instead of being blended with it.
clipping tells whether point location is checked against surface bounds. If clipping is activated and the pixel is outside, nothing is done.
locking tells whether this primitive should take $ care of locking / unlocking the surface (not recommended on a per pixel basis, because of lock overhead)
Exceptions:
VideoException if a problem occurs with a lock operation.
Note:
The four RGBA coordinates will be automatically mapped according to the target surface's pixel format.
See also:
getPixel.

OSDL::Video::Pixels::put.

Definition at line 908 of file OSDLSurface.cc.

References OSDL::Video::Pixels::putRGBAPixel().

void Surface::putColorDefinitionAt ( Coordinate  x,
Coordinate  y,
ColorDefinition  colorDef,
bool  blending = true,
bool  clipping = true,
bool  locking = false 
) throw ( VideoException ) [virtual, inherited]

Sets the pixel at [x;y] of this surface to the given color, specified as a color definition (set of RGBA coordinates).

Parameters:
x the abscissa of the point to change.
y the ordinate of the point to change.
colorDef the RGBA color definition of the put pixel.
blending tells whether the alpha channel must be taken into account, resulting to alpha blending with the destination pixel. If false, the exact specified color will be put in target pixel, instead of being blended with it.
clipping tells whether point location is checked against surface bounds. If clipping is activated and the pixel is outside, nothing is done.
locking tells whether this primitive should take care of locking / unlocking the surface (not recommended on a per pixel basis because of lock overhead)
Exceptions:
VideoException if a problem occurs with a lock operation.
Note:
The four RGBA coordinates will be automatically mapped according to the target surface's pixel format.
See also:
getPixel

OSDL::Video::Pixels::put

Definition at line 921 of file OSDLSurface.cc.

References OSDL::Video::Pixels::putRGBAPixel().

void Surface::putPixelColorAt ( Coordinate  x,
Coordinate  y,
PixelColor  convertedColor,
ColorElement  alpha,
bool  blending = true,
bool  clipping = true,
bool  locking = false 
) throw ( VideoException ) [virtual, inherited]

Sets the pixel at [x;y] of this surface to the given color, specified as an already converted RGBA color.

Parameters:
alpha the alpha coordinate of the pixel to be put with full precision : the alpha encoded in the converted color may not be reliable.
blending tells whether the alpha channel must be taken into account, resulting to alpha blending with the destination pixel. If false, the exact specified color will be put in target pixel, instead of being blended with it.
clipping tells whether point location is checked against surface bounds. If clipping is activated and the pixel is outside, nothing is done.
locking tells whether this primitive should take care of locking / unlocking the surface (not recommended on a per pixel basis, because of lock overhead).

Definition at line 932 of file OSDLSurface.cc.

References OSDL::Video::Pixels::putPixelColor().

bool Surface::setAlphaForColor ( Pixels::ColorDefinition  colorDef,
Pixels::ColorElement  newAlpha 
) throw () [virtual, inherited]

Definition at line 944 of file OSDLSurface.cc.

References OSDL::Video::Pixels::areEqual(), OSDL_DEBUG_PIXEL, and OSDL::Video::Pixels::toString().

Referenced by OSDL::Video::TwoDimensional::drawDiscWithEdge().

bool Surface::drawHorizontalLine ( Coordinate  xStart,
Coordinate  xStop,
Coordinate  y,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
) throw () [virtual, inherited]

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.

Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

This line will be antialiased if antialias mode is set.

See also:
drawVertical, draw

VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 1041 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::drawHorizontal().

bool Surface::drawHorizontalLine ( Coordinate  xStart,
Coordinate  xStop,
Coordinate  y,
Pixels::PixelColor  actualColor 
) throw () [virtual, inherited]

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.

Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

This line will be antialiased if antialias mode is set.

See also:
drawVertical, draw

VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 1052 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::drawHorizontal().

bool Surface::drawHorizontalLine ( Coordinate  xStart,
Coordinate  xStop,
Coordinate  y,
Pixels::ColorDefinition  colorDef = Pixels::White 
) throw () [virtual, inherited]

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.

Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

This line will be antialiased if antialias mode is set.

See also:
drawVertical, draw

VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 1061 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::drawHorizontal().

bool Surface::drawVerticalLine ( Coordinate  x,
Coordinate  yStart,
Coordinate  yStop,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
) throw () [virtual, inherited]

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.

Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

This line will be antialiased if antialias mode is set.

See also:
drawHorizontal, draw

VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 1071 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::drawVertical().

bool Surface::drawVerticalLine ( Coordinate  x,
Coordinate  yStart,
Coordinate  yStop,
Pixels::ColorDefinition  colorDef = Pixels::White 
) throw () [virtual, inherited]

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.

Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

This line will be antialiased if antialias mode is set.

See also:
drawHorizontal, draw

VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState.

Definition at line 1082 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::drawVertical().

bool Surface::drawLine ( Coordinate  xStart,
Coordinate  yStart,
Coordinate  xStop,
Coordinate  yStop,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
) throw () [virtual, inherited]

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.

Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

This line will be antialiased if antialias mode is set.

See also:
drawHorizontal, drawVertical

VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 1092 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::draw().

bool Surface::drawLine ( Coordinate  xStart,
Coordinate  yStart,
Coordinate  xStop,
Coordinate  yStop,
Pixels::ColorDefinition  = Pixels::White 
) throw () [virtual, inherited]

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.

Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

This line will be antialiased if antialias mode is set.

See also:
drawHorizontal, drawVertical

VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 1104 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::draw().

bool Surface::drawCross ( const TwoDimensional::Point2D center,
Pixels::ColorDefinition  colorDef = Pixels::White,
Length  squareEdge = 5 
) throw () [virtual, inherited]

Draws a cross centered in center, included in a square whose length of edge is squareEdge.

Note:
Useful to mark a point.

Locks surface if needed.

Clipping is performed.

This cross will be antialiased if antialias mode is set.

Definition at line 1114 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::drawCross().

bool Surface::drawCross ( Coordinate  xCenter,
Coordinate  yCenter,
Pixels::ColorDefinition  colorDef = Pixels::White,
Length  squareEdge = 5 
) throw () [virtual, inherited]

Draws a cross centered in center, included in a square whose length of edge is squareEdge.

Note:
Useful to mark a point.

Locks surface if needed.

Clipping is performed.

This cross will be antialiased if antialias mode is set.

Definition at line 1123 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Line::drawCross().

bool Surface::drawEdges ( Pixels::ColorDefinition  edgeColor = Pixels::White,
Length  edgeWidth = 1 
) throw () [virtual, inherited]

Draws the edges of this surface, with specified color and edge width.

Parameters:
edgeColor the color of edges.
edgeWidth the width of edges.
Note:
Locks surface if needed.

Clipping is performed.

Definition at line 1132 of file OSDLSurface.cc.

virtual bool OSDL::Video::Surface::drawBox ( const UprightRectangle &  rectangle,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque,
bool  filled = true 
) throw () [virtual, inherited]

Draws a box with specified RGBA color.

Parameters:
filled tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn.
Note:
Locks surface if needed.

virtual bool OSDL::Video::Surface::drawBox ( const UprightRectangle &  rectangle,
Pixels::ColorDefinition  colorDef = Pixels::White,
bool  filled = true 
) throw () [virtual, inherited]

Draws a box with specified RGBA color.

Parameters:
rectangle the box to fill
colorDef the fill color
filled tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn.
Note:
Locks surface if needed.

bool Surface::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 () [virtual, inherited]

Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface.

Parameters:
filled tells whether the circle should be filled (disc).
blended tells whether, for each pixel of disc, the specified color should be blended with the one of the target pixel (if true), or if the specified color should replace the former one, regardless of any blending (if false). Note that only discs may be drawn without being blended : circles are always blended.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

A circle will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1192 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawCircle().

Referenced by OSDL::Video::TwoDimensional::drawDiscWithEdge().

bool Surface::drawCircle ( Coordinate  xCenter,
Coordinate  yCenter,
Length  radius,
Pixels::ColorDefinition  colorDef = Pixels::White,
bool  filled = true,
bool  blended = true 
) throw () [virtual, inherited]

Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface.

Parameters:
filled tells whether the circle should be filled (disc).
blended tells whether, for each pixel of disc, the specified color should be blended with the one of the target pixel (if true), or if the specified color should replace the former one, regardless of any blending (if false). Note that only discs may be drawn without being blended : circles are always blended.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

A circle will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1204 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawCircle().

bool Surface::drawDiscWithEdge ( Coordinate  xCenter,
Coordinate  yCenter,
Length  outerRadius,
Length  innerRadius,
Pixels::ColorDefinition  ringColorDef = Pixels::Blue,
Pixels::ColorDefinition  discColorDef = Pixels::White,
bool  blended = true 
) throw () [virtual, inherited]

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.

starting from innerRadius to totalRadius, colored with ringColorDef, on this surface.

Parameters:
xCenter the abscissa of the center of the disc.
yCenter the ordinate of the center of the disc.
outerRadius the overall disc radius, including the border ring.
innerRadius,the radius from which the ring is drawn, until totalRadius is reached.
ringColorDef the ring color, the color of the border of this disk.
discColorDef the inner color of the disc.
blended tells whether, for each pixel of the edged disc, the specified color should be blended with the one of the target pixel (if true), or if the specified color should replace the former one, regardless of any blending (if false).
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
This method is rather expensive (slow), especially if 'discColorDef' is not fully opaque and if 'blended' is false.

Locks surface if needed, cipping is performed, disc will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1215 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawDiscWithEdge().

bool Surface::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 () [virtual, inherited]

Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface.

Parameters:
filled tells whether the ellipse should be filled.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

An unfilled ellipse will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1227 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawEllipse().

bool Surface::drawEllipse ( Coordinate  xCenter,
Coordinate  yCenter,
Length  horizontalRadius,
Length  verticalRadius,
Pixels::ColorDefinition  colorDef,
bool  filled = true 
) throw () [virtual, inherited]

Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface.

Parameters:
filled tells whether the ellipse should be filled.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

An unfilled ellipse will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1239 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawEllipse().

bool Surface::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 () [virtual, inherited]

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.

Parameters:
xCenter the abscissa of the center of the pie.
yCenter the ordinate of the center of the pie.
radius the radius of the pie.
angleStart the starting angle of the pie, in degrees.
angleStop the stopping angle of the pie, in degrees.
red the red color coordinate of fill color.
green the green color coordinate of fill color.
blue the blue color coordinate of fill color.
alpha the alpha color coordinate of fill color.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1251 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawPie().

bool Surface::drawPie ( Coordinate  xCenter,
Coordinate  yCenter,
Length  radius,
Ceylan::Maths::AngleInDegrees  angleStart,
Ceylan::Maths::AngleInDegrees  angleStop,
Pixels::ColorDefinition  colorDef 
) throw () [virtual, inherited]

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.

Parameters:
xCenter the abscissa of the center of the pie.
yCenter the ordinate of the center of the pie.
radius the radius of the pie.
angleStart the starting angle of the pie, in degrees.
angleStop the stopping angle of the pie, in degrees.
colorDef the color definition of fill color.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1264 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawPie().

bool Surface::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 () [virtual, inherited]

Draws a triangle defined by specified three points, with specified RGBA color, on this surface.

Parameters:
filled tells whether the triangle should be filled (disc).
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

Will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1277 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawTriangle().

bool Surface::drawTriangle ( Coordinate  x1,
Coordinate  y1,
Coordinate  x2,
Coordinate  y2,
Coordinate  x3,
Coordinate  y3,
Pixels::ColorDefinition  colorDef,
bool  filled = true 
) throw () [virtual, inherited]

Draws a triangle defined by specified three points, with specified RGBA color, on this surface.

Parameters:
filled tells whether the triangle should be filled (disc).
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

Will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1291 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawTriangle().

bool Surface::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 () [virtual, inherited]

Draws a triangle defined by specified three points, with specified RGBA color, on this surface.

Parameters:
filled tells whether the triangle should be filled (disc).
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

Will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1303 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawTriangle().

bool Surface::drawTriangle ( const TwoDimensional::Point2D p1,
const TwoDimensional::Point2D p2,
const TwoDimensional::Point2D p3,
Pixels::ColorDefinition  colorDef,
bool  filled = true 
) throw () [virtual, inherited]

Draws a triangle defined by specified three points, with specified RGBA color, on this surface.

Parameters:
filled tells whether the triangle should be filled (disc).
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

Will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

Definition at line 1317 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::drawTriangle().

virtual bool OSDL::Video::Surface::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 () [virtual, inherited]

Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface.

Parameters:
summits could be a 'const' list of 'const' Point2D pointers, but the STL would not be able to match it with mostly used argument 'const list of Point2D non-const pointers'.
x the abscissa the polygon should be translated of, on screen.
y the ordinate the polygon should be translated of, on screen.
filled tells whether the polygon should be filled.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

Will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

virtual bool OSDL::Video::Surface::drawPolygon ( const std::list< TwoDimensional::Point2D * >  summits,
Coordinate  x,
Coordinate  y,
Pixels::ColorDefinition  colorDef,
bool  filled = true 
) throw () [virtual, inherited]

Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface.

Parameters:
summits could be a 'const' list of 'const' Point2D pointers, but the STL would not be able to match it with mostly used argument 'const list of Point2D non-const pointers'.
x the abscissa the polygon should be translated of, on screen.
y the ordinate the polygon should be translated of, on screen.
filled tells whether the polygon should be filled.
Returns:
false if and only if something went wrong (ex : surface lock failed).
Note:
Locks surface if needed.

Clipping is performed.

Will be antialiased if antialias mode is set.

See also:
VideoModule::GetAntiAliasingState

bool Surface::drawGrid ( Length  columnStride = 20,
Length  rowStride = 20,
Pixels::ColorDefinition  lineColor = Pixels::White,
bool  fillBackground = false,
Pixels::ColorDefinition  backgroundColor = Pixels::Black 
) throw () [virtual, inherited]

Draws a grid, with specified space between columns and rows and specified colors.

Parameters:
columnStride the number of pixels between two columns.
rowStride the number of pixels between two rows.
lineColor the color of the grid lines.
fillBackground tells whether a background should be filled.
backgroundColor the color of the background, if activated.
Note:
Useful to check transparency blits for example.

Locks surface if needed.

Definition at line 1353 of file OSDLSurface.cc.

bool Surface::printText ( const std::string &  text,
Coordinate  x,
Coordinate  y,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
) throw () [virtual, inherited]

Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates.

Basic font will be used.

See also:
Font class for far better text rendering, including fixed and TrueType fonts.

Definition at line 1398 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Text::printBasic().

bool Surface::printText ( const std::string &  text,
Coordinate  x,
Coordinate  y,
ColorDefinition  colorDef = Pixels::White 
) throw () [virtual, inherited]

Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates.

Basic font will be used.

See also:
Font class for far better text rendering, including fixed and TrueType fonts.

Definition at line 1409 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Text::printBasic().

bool Surface::blitTo ( Surface targetSurface  )  const throw ( VideoException ) [virtual, inherited]

Blits this surface onto specified surface.

Blits from a RGBA Surface with AlphaBlendingBlit set to another RGBA surface will keep the alpha of the destination surface. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them : the destination alpha will work as a mask. Hence one might set the alpha of the destination surface to targeted value before the blit.

Parameters:
targetSurface the destination surface this surface will be blitted to, starting at [0;0] in the destination surface : both upper left corners will correspond.
Exceptions:
VideoMemoryLostException if either of the surfaces was in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted. Otherwise, if blit went wrong differently, throw a commented VideoException.
Note:
Should not be called on a locked surface.

Definition at line 1418 of file OSDLSurface.cc.

Referenced by OSDL::Video::TwoDimensional::Text::TrueTypeFont::blitLatin1Glyph(), OSDL::Video::TwoDimensional::Text::Font::blitLatin1Text(), OSDL::Video::TwoDimensional::drawDiscWithEdge(), redraw(), OSDL::Video::TwoDimensional::BackBufferedWidget::redraw(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), OSDL::Video::TwoDimensional::BackBufferedWidget::redrawInternal(), and OSDL::Video::Surface::resize().

bool Surface::blitTo ( Surface targetSurface,
Coordinate  x,
Coordinate  y 
) const throw ( VideoException ) [virtual, inherited]

Blits this surface onto specified surface.

Blits from a RGBA Surface with AlphaBlendingBlit set to another RGBA surface will keep the alpha of the destination surface. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them : the destination alpha will work as a mask. Hence one might set the alpha of the destination surface to targeted value before the blit.

Parameters:
targetSurface the destination surface this surface will be blitted to.
x abscissa of the destination surface where this surface will be blitted.
y ordinate of the destination surface where this surface will be blitted
Exceptions:
VideoMemoryLostException if either of the surfaces were in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted. Otherwise, if blit went wrong differently, throw a commented VideoException.
Note:
Should not be called on a locked surface.

Definition at line 1426 of file OSDLSurface.cc.

References OSDL::Utils::getBackendLastError(), and OSDL::Video::Pixels::toString().

bool Surface::blitTo ( Surface targetSurface,
const TwoDimensional::Point2D location 
) const throw ( VideoException ) [virtual, inherited]

Blits this surface onto specified surface.

Parameters:
targetSurface the destination surface this surface will be blitted to.
location the point of the destination surface where this surface will be blitted.
Exceptions:
VideoMemoryLostException if either of the surfaces was in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted. Otherwise, if blit went wrong differently, throw a commented VideoException.
Note:
Should not be called on a locked surface.

Definition at line 1489 of file OSDLSurface.cc.

bool Surface::blitTo ( Surface targetSurface,
const TwoDimensional::UprightRectangle sourceRectangle,
const TwoDimensional::Point2D destinationLocation 
) const throw ( VideoException ) [virtual, inherited]

Blits this surface onto specified surface.

Parameters:
targetSurface the destination surface this surface will be blitted to.
sourceRectangle a clipping rectangle defining which part of this surface is to be blitted.
destinationLocation the point of the destination surface where this surface will be blitted.
Exceptions:
VideoMemoryLostException if either of the surfaces were in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted.
Note:
Should not be called on a locked surface.

Definition at line 1499 of file OSDLSurface.cc.

References OSDL::Utils::getBackendLastError().

Surface & Surface::zoom ( Ceylan::Maths::Real  abscissaZoomFactor,
Ceylan::Maths::Real  ordinateZoomFactor,
bool  antialiasing = true 
) const throw ( VideoException ) [virtual, inherited]

Returns a newly created surface, obtained from this surface after a zoom of given factors.

If, for this surface, pixel color is not 8 bit or 32 bit, then a 32-bit surface will be internally created and used for the zoom.

Ownership of the returned surface is transferred to the caller, who will have to deallocate it when having finished with it.

The final rendering speed depends first on antialiasing being requested or not, then on resulting surface size.

A surface is returned instead of zooming directly this surface to avoid accumulating rounding errors when zooming multiple times the same image : better use a constant source surface from which zoomed ones are created with various zoom factors than changing the same surface again and again.

Parameters:
abscissaZoomFactor the zoom factor to be applied on the abscissa axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case.
ordinateZoomFactor the zoom factor to be applied on the ordinate axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case.
antialiasing if true and if zoom factors are positive, requests antialiasing (fine and expensive interpolation). 8-bit surfaces will never be antialiased.

Definition at line 1561 of file OSDLSurface.cc.

Surface & Surface::rotoZoom ( Ceylan::Maths::AngleInDegrees  angle,
Ceylan::Maths::Real  zoomFactor,
bool  antialiasing = true 
) const throw ( VideoException ) [virtual, inherited]

Returns a newly created surface, obtained from this surface after a rotation of given angle and a zoom of given factor.

If, for this surface, pixel color is not 8 bit or 32 bit, then a 32-bit surface will be internally created and used for the rotozoom.

Ownership of the returned surface is transferred to the caller, who will have to deallocate it when having finished with it.

The final rendering speed depends first on antialiasing being requested or not, then on resulting surface size.

A surface is returned instead of rotating this surface to avoid accumulating rounding errors when rotozooming multiple times the same image : better use a constant source surface from which rotozoomed ones are created with various angles and zoom factors than changing the same surface again and again.

Parameters:
angle the angle of rotation, in degrees.
zoomFactor the zoom factor to be applied on both surface dimensions. If negative, the surface is rotated of Pi before the angle is applied. No antialiasing will be performed in this case.
antialiasing if true and if zoom factor is positive, requests antialiasing (fine and expensive interpolation). 8-bit surfaces will never be antialiased.

Definition at line 1585 of file OSDLSurface.cc.

Surface & Surface::rotoZoom ( Ceylan::Maths::AngleInDegrees  angle,
Ceylan::Maths::Real  abscissaZoomFactor,
Ceylan::Maths::Real  ordinateZoomFactor,
bool  antialiasing = true 
) const throw ( VideoException ) [virtual, inherited]

Returns a newly created surface, obtained from this surface after a rotation of given angle and zooms of given factors.

If, for this surface, pixel color is not 8 bit or 32 bit, then a 32-bit surface will be internally created and used for the rotozoom.

Ownership of the returned surface is transferred to the caller, who will have to deallocate it when finish with it.

The final rendering speed depends first on antialiasing being requested or not, then on resulting surface size.

A surface is returned instead of rotating this surface to avoid accumulating rounding errors when rotozooming multiple times the same image : better use a constant source surface from which rotozoomed ones are created with various angles and zoom factors than changing the same surface again and again.

Parameters:
angle the angle of rotation, in degrees.
abscissaZoomFactor the zoom factor to be applied on the abscissa axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case.
ordinateZoomFactor the zoom factor to be applied on the ordinate axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case.
antialiasing if true and if zoom factors are positive, requests antialiasing (fine and expensive interpolation). 8-bit surfaces will never be antialiased.

Definition at line 1595 of file OSDLSurface.cc.

UprightRectangle & Surface::getClippingArea (  )  const throw () [virtual, inherited]

Returns this surface's clipping area, expressed thanks to an UprightRectangle.

Should not be confused with the actual area corresponding to this surface, which is another UprightRectangle.

Returns:
A new UprightRectangle, whose ownership is transferred to the caller, who therefore has to deallocate it when having finished with it.

Definition at line 1621 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface, and OSDL::Video::TwoDimensional::UprightRectangle::UprightRectangle().

virtual void OSDL::Video::Surface::setClippingArea ( UprightRectangle &  newClippingArea  )  throw () [virtual, inherited]

Sets this surface's clipping area, expressed thanks to an UprightRectangle, whose ownership is left to the caller.

Should not be confused with the actual area corresponding to this surface, which is another UprightRectangle.

virtual void OSDL::Video::Surface::loadImage ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads an image, whose format will be auto-detected, from specified file, into this surface.

This is a Surface factory.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the image file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::load
Should be inlined.

Referenced by OSDL::Video::Surface::LoadImage().

virtual void OSDL::Video::Surface::loadJPG ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a JPEG image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the JPEG file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadJPG
Should be inlined.

virtual void OSDL::Video::Surface::loadPNG ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a PNG image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the PNG file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadPNG
Should be inlined.

virtual void OSDL::Video::Surface::loadBMP ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a BMP image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the BMP file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadBMP
Should be inlined.

virtual void OSDL::Video::Surface::loadGIF ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a GIF image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the GIF file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadGIF
Should be inlined.

virtual void OSDL::Video::Surface::loadLBM ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a LBM image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the LBM file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadLBM
Should be inlined.

virtual void OSDL::Video::Surface::loadPCX ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a PCX image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the PCX file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadPCX
Should be inlined.

virtual void OSDL::Video::Surface::loadPNM ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a PNM image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the PNM file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadPNM
Should be inlined.

virtual void OSDL::Video::Surface::loadTGA ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a TGA image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the TGA file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadTGA
Should be inlined.

virtual void OSDL::Video::Surface::loadXPM ( const std::string &  filename,
bool  blitOnly = false,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Loads a XPM image from specified file into this surface.

Parameters:
targetSurface the surface that should correspond to the loaded image.
filename the name of the XPM file.
blitOnly tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false).
convertToDisplayFormat tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion).
convertWithAlpha if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel.
Note:
Specifying a blitOnly option set to true is especially convenient when selecting the screen's surface as target surface, since this surface is special and should not be deallocated as the others may be.
See also:
Image::loadXPM
Should be inlined.

void Surface::savePNG ( const std::string &  filename,
bool  overwrite = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Saves the current content of this surface into a PNG file.

Parameters:
filename the name of the PNG file to be created (ex : 'screenshot.png')
overwrite tells whether an existing file filename should be overwritten, or if an exception should be raised.
Note:
This method is especially useful for screenshots.
See also:
loadPNG.
This method cannot be 'const' since this surface may have to be locked in order to access the pixels that are to be saved.

Definition at line 1757 of file OSDLSurface.cc.

References OSDL::Video::TwoDimensional::Image::SavePNG().

void Surface::saveBMP ( const std::string &  filename,
bool  overwrite = true 
) throw ( TwoDimensional::ImageException ) [virtual, inherited]

Saves the current content of this surface into a BMP file.

Parameters:
filename the name of the BMP file to create (ex : 'screenshot.bmp')
overwrite tells whether an existing file filename should be overwritten, or if an exception should be raised.
Note:
The savePNG method should be preferred to this one.
See also:
savePNG, loadBMP
This method cannot be 'const' since this surface may have to be locked in order to access the pixels that are to be saved.

Definition at line 1766 of file OSDLSurface.cc.

References OSDL::Utils::getBackendLastError().

void Surface::update (  )  throw ( VideoException ) [virtual, inherited]

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.

If it is a screen surface (either OpenGL or not), it will be updated in order to have the display match the surface buffer. Does nothing more if this surface is not a screen surface.

Note:
When this method is called, the surface is supposed not to be locked.

on hardware that does not support double-buffering, this is equivalent to calling the updateRectangle method with all arguments to zero.

Note:
The Surface::DoubleBuffered flag must have been passed to setMode, when setting the video mode, for this function to have a chance to perform hardware flipping.
See also:
SDL_Flip
Exceptions:
VideoException if the operation failed, including if this surface is not a screen surface.

Definition at line 1782 of file OSDLSurface.cc.

References OSDL::Video::Surface::_displayType, OSDL::Video::Surface::_surface, OSDL::Video::Surface::BackBuffer, OSDL::Video::Surface::ClassicalScreenSurface, OSDL::Utils::getBackendLastError(), OSDL::Video::Surface::OpenGLScreenSurface, and OSDL::Video::Surface::redraw().

virtual void OSDL::Video::Surface::updateRectangles ( const std::list< UprightRectangle * > &  listRects  )  throw ( VideoException ) [virtual, inherited]

Updates the part of this surface corresponding to the specified list of rectangles.

Note:
The rectangles must be confined within the screen boundaries (no clipping is done).

The surface must not be locked when this method is called.

It is advised to call this method only once per frame, since each call has some processing overhead. This is no restriction, since you can pass any number of rectangles each time.

The rectangles are not automatically merged or checked for overlap. In general, the programmer can use his knowledge about his particular rectangles to merge them in an efficient way, to avoid overdraw.

Note:
STL too clumsy to understand list<const UprightRectangle const *> etc. (would require conversion by copy)
Exceptions:
VideoException if the operation failed, including if this surface is not a screen surface.

virtual void OSDL::Video::Surface::updateRectangle ( const UprightRectangle &  rect  )  throw ( VideoException ) [virtual, inherited]

Updates the part of this surface corresponding to specified rectangle.

Note:
The rectangle must be confined within the screen boundaries (no clipping is done).

The surface must not be locked when this method is called.

Exceptions:
VideoException if the operation failed, including if this surface is not a screen surface.

void Surface::updateRectangle ( Coordinate  x,
Coordinate  y,
Length  width,
Length  height 
) throw ( VideoException ) [virtual, inherited]

Updates the part of this surface corresponding to specified rectangle.

Note:
The rectangle must be confined within the screen boundaries (no clipping is done).

If all arguments are equal to zero, the entire surface will be updated.

The surface must not be locked when this method is called.

Exceptions:
VideoException if the operation failed, including if this surface is not a screen surface.

Definition at line 1901 of file OSDLSurface.cc.

bool Surface::getRedrawState (  )  const throw () [virtual, inherited]

Returns the current need for redraw state.

Definition at line 1932 of file OSDLSurface.cc.

References OSDL::Video::Surface::_needsRedraw.

Referenced by redraw(), OSDL::Video::Surface::redraw(), and OSDL::Video::TwoDimensional::BackBufferedWidget::redraw().

bool Surface::isInternalSurfaceAvailable (  )  const throw () [virtual, inherited]

Tells whether the internal SDL surface is void or not.

Note:
By design, this method should always return true.

May be inline.

Definition at line 1997 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

void Surface::addWidget ( TwoDimensional::Widget widget  )  throw ( VideoException ) [virtual, inherited]

Registers specified widget to this surface, and put it at top level.

Note:
The specified widget cannot be 'const' since, for example, a redraw event might result in a change in the widget.

Definition at line 2005 of file OSDLSurface.cc.

Surface & Surface::getWidgetRenderTarget (  )  throw () [inherited]

Returns the surface that should be targeted by widgets having to blit their renderings to their container.

Usually (but not always) the render target is the instance itself.

Reimplemented in OSDL::Video::TwoDimensional::BackBufferedWidget.

Definition at line 2033 of file OSDLSurface.cc.

Referenced by redraw().

void Surface::putWidgetToFront ( TwoDimensional::Widget widget  )  throw ( VideoException ) [virtual, inherited]

Changes stacking inside this container surface so that specified widget is put to front.

Note:
Specified widget must already be registered to this surface.
Exceptions:
VideoException if the widget is not a registered one.

Definition at line 2046 of file OSDLSurface.cc.

void Surface::putWidgetToBack ( TwoDimensional::Widget widget  )  throw ( VideoException ) [virtual, inherited]

Changes stacking inside this container surface so that specified widget is put to back.

Note:
Specified widget must already be registered to this surface.
Exceptions:
VideoException if the widget is not a registered one.

Definition at line 2063 of file OSDLSurface.cc.

void Surface::centerMousePosition (  )  throw () [virtual, inherited]

Centers in the middle of the screen the position of the mouse cursor, by generating a mouse motion event.

Note:
Must be called on a screen surface, with mouse enabled of course.

Definition at line 2081 of file OSDLSurface.cc.

References OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getWidth(), and OSDL::Video::Surface::setMousePosition().

void Surface::setMousePosition ( Coordinate  newX = 0,
Coordinate  newY = 0 
) throw () [virtual, inherited]

Sets the position of the mouse cursor, by generating a mouse motion event.

Note:
Must be called on a screen surface, with mouse enabled of course.

Definition at line 2089 of file OSDLSurface.cc.

Referenced by OSDL::Video::Surface::centerMousePosition().

bool Surface::mustBeLocked (  )  const throw () [virtual, inherited]

Tells whether this surface has to be locked before modifying it.

When using a surface, in general there is no need to use this method because the lock/unlock methods take care of that.

See also:
Ceylan::Lockable.
This method cannot be inlined since it is inherited.

Definition at line 2107 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Ceylan::System::Size Surface::getSizeInMemory (  )  const throw () [virtual, inherited]

Returns the approximate size in memory, in bytes, currently taken by this object.

See also:
Ceylan::Measurable interface.

Definition at line 2142 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

virtual bool OSDL::Video::Surface::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 () [virtual, inherited]

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.

The whole display will be scaled vertically to fit into inBox. On the contrary, the abscissa will be used as is.

Note:
If inBox is a null pointer, then the curve will be drawn in the whole surface.

When choosing the width of the container (inBox), to avoid truncating the graph, add 2*graphAbscissaOffset to the number of samples that describes the curve, and it will fit at best : both left and right boundaries will be taken into account.

Surface & Surface::LoadImage ( const std::string &  filename,
bool  convertToDisplayFormat = true,
bool  convertWithAlpha = true 
) throw ( TwoDimensional::ImageException ) [static, inherited]

Surface factory : creates a new Surface instance from specified image file.

Note:
The caller takes ownership of the created Surface, and must deallocate it when necessary.

Image format, if supported, is auto-detected.

Definition at line 2463 of file OSDLSurface.cc.

References OSDL::Video::Surface::loadImage().

Referenced by OSDL::Video::OpenGL::GLTexture::GLTexture().

static std::string OSDL::Video::Surface::InterpretFlags ( Ceylan::Flags  flags  )  throw () [static, inherited]

Outputs a textual description of the given surface flags.

These flags are interpreted as surface flags only.

Parameters:
flags the surface video settings to interpret.
Note:
One shall not call this method on flags used with VideoModule::setMode. Use VideoModule::interpretFlags instead, since their meaning is different.

void Surface::preUnlock (  )  throw () [protected, virtual, inherited]

Effective unlocking of the surface.

Nevertheless, only lock/unlock pair should be used by user programs.

See also:
Ceylan::Lockable

Definition at line 2116 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

void Surface::postLock (  )  throw () [protected, virtual, inherited]

Effective locking of the surface.

Nevertheless, only lock/unlock pair should be used by user programs.

See also:
Ceylan::Lockable

Definition at line 2129 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

Offset Surface::getOffset (  )  const throw () [inline, protected, inherited]

Returns this surface's offset.

Definition at line 2624 of file OSDLSurface.cc.

References OSDL::Video::Surface::_surface.

void Surface::setOffset ( Offset  offset  )  throw () [inline, protected, inherited]

Sets this surface's offset.

Definition at line 2632 of file OSDLSurface.cc.

void Surface::flush (  )  throw () [protected, virtual, inherited]

Releases internal SDL surface.

Definition at line 2641 of file OSDLSurface.cc.

References OSDL::Video::Surface::_displayType, OSDL::Video::Surface::_surface, OSDL::Video::Surface::BackBuffer, and OSDL::Video::Surface::inconsistencyDetected().

Referenced by OSDL::Video::Surface::~Surface().

virtual void OSDL::Video::Surface::inconsistencyDetected ( const std::string &  message  )  const throw () [protected, virtual, inherited]

Triggered when an abnormal inconsistency is detected between OSDL's surface state and its back-end counterpart.

Note:
Those kind of errors, which are detected at runtime, mean that the code misbehaved badly, therefore an emergency stop might help.

Referenced by OSDL::Video::Surface::flush().

Point2D UprightRectangle::getUpperLeftCorner (  )  const throw () [virtual, inherited]

Returns this UprightRectangle's upper left corner.

Definition at line 98 of file OSDLUprightRectangle.cc.

References OSDL::Video::TwoDimensional::UprightRectangle::_x, and OSDL::Video::TwoDimensional::UprightRectangle::_y.

void UprightRectangle::setUpperLeftCorner ( Point2D newUpperLeftCorner  )  throw () [virtual, inherited]

Sets this UprightRectangle's upper left corner, width and height do not change.

Definition at line 106 of file OSDLUprightRectangle.cc.

Coordinate UprightRectangle::getUpperLeftAbscissa (  )  const throw () [virtual, inherited]

Returns directly the abscissa of upper left corner.

Definition at line 117 of file OSDLUprightRectangle.cc.

References OSDL::Video::TwoDimensional::UprightRectangle::_x.

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().

void UprightRectangle::setUpperLeftAbscissa ( Coordinate  newAbscissa  )  throw () [virtual, inherited]

Sets directly the abscissa of the upper left corner of this rectangle.

Definition at line 125 of file OSDLUprightRectangle.cc.

Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().

Coordinate UprightRectangle::getUpperLeftOrdinate (  )  const throw () [virtual, inherited]

Returns directly the ordinate of upper left corner.

Definition at line 134 of file OSDLUprightRectangle.cc.

References OSDL::Video::TwoDimensional::UprightRectangle::_y.

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().

void UprightRectangle::setUpperLeftOrdinate ( Coordinate  newOrdinate  )  throw () [virtual, inherited]

Sets directly the ordinate of the upper left corner of this rectangle.

Definition at line 142 of file OSDLUprightRectangle.cc.

Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().

Point2D UprightRectangle::getLowerRightCorner (  )  const throw () [virtual, inherited]

Returns this UprightRectangle's lower right corner.

Definition at line 155 of file OSDLUprightRectangle.cc.

References OSDL::Video::TwoDimensional::UprightRectangle::_x, OSDL::Video::TwoDimensional::UprightRectangle::_y, OSDL::Video::TwoDimensional::UprightRectangle::getHeight(), and OSDL::Video::TwoDimensional::UprightRectangle::getWidth().

void UprightRectangle::setLowerRightCorner ( Point2D newLowerRightCorner  )  throw ( VideoException) [virtual, inherited]

Sets directly the lower right corner of this rectangle.

Exceptions:
VideoException if width or height would become negative.

Definition at line 164 of file OSDLUprightRectangle.cc.

References OSDL::Video::Pixels::toString().

Coordinate UprightRectangle::getLowerRightAbscissa (  )  const throw () [virtual, inherited]

Returns directly the abscissa of lower right corner.

Definition at line 181 of file OSDLUprightRectangle.cc.

References OSDL::Video::TwoDimensional::UprightRectangle::_x, and OSDL::Video::TwoDimensional::UprightRectangle::getWidth().

void UprightRectangle::setLowerRightAbscissa ( Coordinate  newAbscissa  )  throw ( VideoException ) [virtual, inherited]

Sets directly the abscissa of the lower right corner of this rectangle.

Exceptions:
VideoException if width or height would become negative.

Definition at line 189 of file OSDLUprightRectangle.cc.

References OSDL::Video::Pixels::toString().

Coordinate UprightRectangle::getLowerRightOrdinate (  )  const throw () [virtual, inherited]

Returns directly the ordinate of lower right corner.

Definition at line 205 of file OSDLUprightRectangle.cc.

References OSDL::Video::TwoDimensional::UprightRectangle::_y, and OSDL::Video::TwoDimensional::UprightRectangle::getHeight().

void UprightRectangle::setLowerRightOrdinate ( Coordinate  newOrdinate  )  throw ( VideoException ) [virtual, inherited]

Sets directly the ordinate of the lower right corner of this rectangle.

Exceptions:
VideoException if width or height would become negative.

Definition at line 213 of file OSDLUprightRectangle.cc.

References OSDL::Video::Pixels::toString().

bool UprightRectangle::draw ( Surface target,
Pixels::ColorElement  red,
Pixels::ColorElement  blue,
Pixels::ColorElement  green,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque,
bool  filled = true 
) const throw () [virtual, inherited]

Draws this UprightRectangle to specified surface with specified RGBA color.

Parameters:
target the surface to which this rectangle will be rendered.
filled tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn.
Note:
Locks surface if needed.

Definition at line 265 of file OSDLUprightRectangle.cc.

References OSDL::Video::Pixels::convertRGBAToColorDefinition(), and OSDL::Video::TwoDimensional::Line::draw().

Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners().

bool UprightRectangle::draw ( Surface target,
Pixels::ColorDefinition  colorDef = Pixels::White,
bool  filled = true 
) const throw () [virtual, inherited]

Draws this UprightRectangle to specified surface with specified RGBA color.

Parameters:
target the surface to which this rectangle will be rendered.
filled tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn.
Note:
Locks surface if needed.

Definition at line 276 of file OSDLUprightRectangle.cc.

References OSDL::Video::Pixels::convertColorDefinitionToRawPixelColor(), and OSDL::Video::Pixels::toString().

bool UprightRectangle::drawWithRoundedCorners ( Surface target,
Length  edgeWidth = 3,
Pixels::ColorDefinition  edgeColorDef = Pixels::White,
Pixels::ColorDefinition  backgroundColorDef = Pixels::Transparent 
) const throw () [virtual, inherited]

Draws this UprightRectangle to specified surface with rounded corners, drawn with specified color, above a background of specified color.

The width of the borders can be chosen, and should not be incompatible with the dimensions of this rectangle.

Parameters:
target the surface to which this rectangle will be rendered.
edgeWidth the width of the edges of this rectangle.
edgeColorDef the color definition of the edges of this rectangle.
backgroundColorDef the color definition of the background of this rectangle.
Note:
Locks surface if needed.

Definition at line 323 of file OSDLUprightRectangle.cc.

References OSDL::Video::Surface::AlphaBlendingBlit, OSDL::Video::Pixels::AlphaOpaque, OSDL::Video::Surface::ColorkeyBlit, OSDL::Video::TwoDimensional::UprightRectangle::draw(), OSDL::Video::Pixels::getCurrentColorMasks(), OSDL::Video::Surface::RLEColorkeyBlit, OSDL::Video::Pixels::selectColorDifferentFrom(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftOrdinate(), OSDL::Video::TwoDimensional::Point2D::setX(), OSDL::Video::TwoDimensional::Point2D::setY(), OSDL::Video::Surface::Software, and OSDL::Video::Pixels::toString().

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().

Length UprightRectangle::computeRadiusForRoundRectangle ( Length  edgeWidth  )  const throw ( VideoException ) [virtual, inherited]

Computes the preferred radius of round corners for this rectangle, with the specified edge width.

Parameters:
edgeWidth the edge width to take into account for the radius.
Returns:
a suitable radius, whose dimension is deemed appropriate.
Exceptions:
VideoException if no radius can fullfill the set of constraints due to this rectangle and the edge width.

Definition at line 694 of file OSDLUprightRectangle.cc.

References OSDL::Video::Pixels::toString().

Referenced by OSDL::Video::TwoDimensional::TextWidget::updateClientArea().

SDL_Rect * UprightRectangle::toSDLRect (  )  const throw ( VideoException ) [virtual, inherited]

Definition at line 724 of file OSDLUprightRectangle.cc.

References OSDL::Video::TwoDimensional::UprightRectangle::_x, OSDL::Video::TwoDimensional::UprightRectangle::_y, OSDL::Video::TwoDimensional::UprightRectangle::getHeight(), and OSDL::Video::TwoDimensional::UprightRectangle::getWidth().


Member Data Documentation

Point2D OSDL::Video::TwoDimensional::Widget::_upperLeftCorner [protected]

This widget's upper left corner, relatively to its container.

Definition at line 596 of file OSDLWidget.h.

Referenced by redraw(), and OSDL::Video::TwoDimensional::BackBufferedWidget::redraw().

UprightRectangle OSDL::Video::TwoDimensional::Widget::_clientArea [protected]

The rectangular client area, defined in the referential of this widget.

This area is the one left for this widget specific renderings (ex : any decorations excluded).

Definition at line 607 of file OSDLWidget.h.

Referenced by getClientArea(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().

bool OSDL::Video::TwoDimensional::Widget::_decorated [protected]

Tells whether this widget rendering should include decorations.

Definition at line 616 of file OSDLWidget.h.

Referenced by isDecorated(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), redrawInternal(), updateClientArea(), and updateDecorationFlag().

std::string OSDL::Video::TwoDimensional::Widget::_title [protected]

This Widget's title.

Definition at line 620 of file OSDLWidget.h.

Referenced by updateDecorationFlag().

bool OSDL::Video::TwoDimensional::Widget::_minMaximizable [protected]

Tells whether this widget can be minimized and maximized by the user.

Note:
If set, this triggers the display of the corresponding minimize/maximize icon : it implies that the widget will be decorated.

Definition at line 632 of file OSDLWidget.h.

Referenced by updateDecorationFlag().

bool OSDL::Video::TwoDimensional::Widget::_draggable [protected]

Tells whether this widget can be dragged by the user.

Note:
If set, this triggers the display of the corresponding draggable icon : it implies that the widget will be decorated.

Definition at line 643 of file OSDLWidget.h.

Referenced by updateDecorationFlag().

bool OSDL::Video::TwoDimensional::Widget::_wrappable [protected]

Tells whether this widget can be wrapped by the user, hiding the whole widget but its decoration.

Note:
If set, this triggers the display of the corresponding wrappable icon : it implies that the widget will be decorated.

Definition at line 655 of file OSDLWidget.h.

Referenced by updateDecorationFlag().

bool OSDL::Video::TwoDimensional::Widget::_closable [protected]

Tells whether this widget can be closed by the user.

Note:
If set, this triggers the display of the corresponding closable icon : it implies that the widget will be decorated.

Definition at line 666 of file OSDLWidget.h.

Referenced by updateDecorationFlag().

bool OSDL::Video::TwoDimensional::Widget::_hasFocus [protected]

Tells whether this widget has currently the focus (i.e.

is selected by the user).

Note:
Multiple widgets may have the focus simultaneously.

Definition at line 676 of file OSDLWidget.h.

BaseColorMode OSDL::Video::TwoDimensional::Widget::_baseColorMode [protected]

Tells whether a background color, color-keying or nothing special shall be used for this widget.

See also:
BaseColorMode, _baseColor

Definition at line 687 of file OSDLWidget.h.

Referenced by clean(), and getBaseColorMode().

Pixels::ColorDefinition OSDL::Video::TwoDimensional::Widget::_baseColor [protected]

Stores the base color of this widget, which is either used as a background color or a colorkey, depending on '_baseColorMode'.

See also:
_baseColorMode

Definition at line 698 of file OSDLWidget.h.

Referenced by clean(), getBaseColor(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and OSDL::Video::TwoDimensional::BackBufferedWidget::redrawInternal().

Pixels::PixelColor OSDL::Video::TwoDimensional::Widget::_actualBaseColor [protected]

The base color, converted to this widget current pixel format, inherited from container.

Definition at line 706 of file OSDLWidget.h.

Pixels::ColorDefinition Widget::_EdgeColor [static, protected]

Color of widget edges.

Definition at line 718 of file OSDLWidget.h.

Referenced by GetEdgeColor().

Pixels::ColorDefinition Widget::_TitleColor [static, protected]

Color of widget title.

Definition at line 721 of file OSDLWidget.h.

Text::HorizontalAlignment Widget::_TitleHorizontalAlignment [static, protected]

Defines how a widget title should be horizontally aligned (default : Center).

Definition at line 729 of file OSDLWidget.h.

Text::VerticalAlignment Widget::_TitleVerticalAlignment [static, protected]

Defines how a widget title should be vertically aligned.

(default : Center).

Definition at line 737 of file OSDLWidget.h.

Length Widget::_ClientOffsetWidth [static, protected]

Default width offset for client area relative to widget vertical edges.

Definition at line 746 of file OSDLWidget.h.

Referenced by updateClientArea().

Length Widget::_ClientOffsetHeight [static, protected]

Default height offset for client area relative to widget horizontal edges.

Note:
For decorated widgets, the top widget edge taken into account is the title bar.

Definition at line 757 of file OSDLWidget.h.

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and updateClientArea().

Coordinate Widget::_TitleOffsetAbscissa [static, protected]

Default abscissa offset relative to widget upper left corner used to print widget title with left alignment.

Definition at line 767 of file OSDLWidget.h.

Coordinate Widget::_TitleOffsetOrdinate [static, protected]

Default ordinate offset relative to widget upper left corner used to print widget title.

Definition at line 775 of file OSDLWidget.h.

Coordinate Widget::_TitleBarOffsetOrdinate [static, protected]

Default ordinate offset relative to widget upper left corner used to draw widget title bar.

Definition at line 783 of file OSDLWidget.h.

Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and updateClientArea().

std::string Widget::_DefaultTitle [static, protected]

Default title to be used when a titleless widget has however to be rendered decorated.

Definition at line 791 of file OSDLWidget.h.

const Ceylan::Flags Surface::Software [static, inherited]

Indicates that a surface is to be stored in system memory.

Definition at line 212 of file OSDLSurface.h.

Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners().

const Ceylan::Flags Surface::Hardware [static, inherited]

Indicates that a surface is to be stored in video memory.

Definition at line 216 of file OSDLSurface.h.

Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::TwoDimensional::Text::Font::renderLatin1MultiLineText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().

const Ceylan::Flags Surface::AsynchronousBlit [static, inherited]

Indicates that a surface should use asynchronous blits if possible.

Definition at line 224 of file OSDLSurface.h.

const Ceylan::Flags Surface::ExclusivePalette [static, inherited]

Indicates that a surface should have an exclusive palette.

Definition at line 228 of file OSDLSurface.h.

const Ceylan::Flags Surface::HardwareAcceleratedBlit [static, inherited]

Indicates that a surface is to use hardware-accelerated blits.

Definition at line 236 of file OSDLSurface.h.

const Ceylan::Flags Surface::ColorkeyBlit [static, inherited]

Indicates that a surface is to use colorkey blits.

Definition at line 240 of file OSDLSurface.h.

Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Surface::convertFromColorKeyToAlphaChannel(), OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), OSDL::Video::TwoDimensional::Text::Font::renderLatin1MultiLineText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().

const Ceylan::Flags Surface::RLEColorkeyBlit [static, inherited]

Indicates that a surface is to use RLE-accelerated colorkey blits.

Definition at line 248 of file OSDLSurface.h.

Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().

const Ceylan::Flags Surface::AlphaBlendingBlit [static, inherited]

Indicates that a surface is to use alpha blending blits.

Definition at line 252 of file OSDLSurface.h.

Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), and OSDL::Video::OpenGL::GLTexture::upload().

const Ceylan::Flags Surface::Preallocated [static, inherited]

Indicates that a surface is to use preallocated memory.

Definition at line 255 of file OSDLSurface.h.

const Ceylan::Flags Surface::RLEColorkeyBlitAvailable [static, inherited]

Indicates that RLE colorkey blit is actually accelerated (read-only).

Note:
The meaning of this private internal flag is an hypothesis, this flag should not be used externally anyway.

Definition at line 266 of file OSDLSurface.h.

Referenced by OSDL::Video::OpenGL::GLTexture::upload().

const Ceylan::Flags Surface::AnyPixelFormat [static, inherited]

Indicates that a display surface may use any pixel format.

Definition at line 281 of file OSDLSurface.h.

const Ceylan::Flags Surface::DoubleBuffered [static, inherited]

Indicates that a display surface is to be double buffered.

Definition at line 289 of file OSDLSurface.h.

const Ceylan::Flags Surface::FullScreen [static, inherited]

Indicates that a display surface is to be full screen, not windowed.

Definition at line 297 of file OSDLSurface.h.

const Ceylan::Flags Surface::OpenGL [static, inherited]

Indicates that a display surface should have an OpenGL context.

Definition at line 305 of file OSDLSurface.h.

const Ceylan::Flags Surface::Resizable [static, inherited]

Indicates that a display surface is to be resizable.

Definition at line 312 of file OSDLSurface.h.

const Length Surface::graphAbscissaOffset [static, inherited]

Offset used when drawing curve in a container.

Definition at line 3039 of file OSDLSurface.h.

const Length Surface::graphOrdinateOffset [static, inherited]

Offset used when drawing curve in a container.

Definition at line 3042 of file OSDLSurface.h.

const Length Surface::captionAbscissaOffset [static, inherited]

Offset used when printing caption in a container.

Definition at line 3046 of file OSDLSurface.h.

const Length Surface::captionOrdinateOffset [static, inherited]

Offset used when printing caption in a container.

Definition at line 3049 of file OSDLSurface.h.

SDL_Surface* OSDL::Video::Surface::_surface [protected, inherited]

This internal structure also contains private fields not used here.

Definition at line 3132 of file OSDLSurface.h.

Referenced by OSDL::Video::Surface::clone(), OSDL::Video::Surface::flipHorizontal(), OSDL::Video::Surface::flipVertical(), OSDL::Video::Surface::flush(), OSDL::Video::Surface::getBitsPerPixel(), OSDL::Video::Surface::getBytesPerPixel(), OSDL::Video::Surface::getClippingArea(), OSDL::Video::Surface::getFlags(), OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getOffset(), OSDL::Video::Surface::getPitch(), OSDL::Video::Surface::getPixelFormat(), OSDL::Video::Surface::getPixels(), OSDL::Video::Surface::getSDLSurface(), OSDL::Video::Surface::getSizeInMemory(), OSDL::Video::Surface::getWidth(), OSDL::Video::Surface::isInternalSurfaceAvailable(), OSDL::Video::Surface::mustBeLocked(), OSDL::Video::Surface::postLock(), OSDL::Video::Surface::preUnlock(), and OSDL::Video::Surface::update().

DisplayType OSDL::Video::Surface::_displayType [protected, inherited]

Tells what is the display type of this surface.

The display type has to be recorded since :

Definition at line 3146 of file OSDLSurface.h.

Referenced by OSDL::Video::Surface::flush(), OSDL::Video::Surface::getDisplayType(), OSDL::Video::Surface::update(), and OSDL::Video::Surface::~Surface().

bool OSDL::Video::Surface::_mustBeLocked [protected, inherited]

Tells whether this surface must be locked before modifying it.

Definition at line 3154 of file OSDLSurface.h.

Coordinate OSDL::Video::TwoDimensional::UprightRectangle::_x [protected, inherited]

Upper left corner's abscissa (horizontal coordinate).

Definition at line 404 of file OSDLUprightRectangle.h.

Referenced by OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightCorner(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftCorner(), and OSDL::Video::TwoDimensional::UprightRectangle::toSDLRect().

Coordinate OSDL::Video::TwoDimensional::UprightRectangle::_y [protected, inherited]

Upper left corner's ordinate (vertical coordinate).

Definition at line 408 of file OSDLUprightRectangle.h.

Referenced by OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightCorner(), OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightOrdinate(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftCorner(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftOrdinate(), and OSDL::Video::TwoDimensional::UprightRectangle::toSDLRect().


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 14:47:36 2007 for OSDL by  doxygen 1.5.1