Dillo
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
dw::fltk::FltkViewBase Class Referenceabstract

#include <fltkviewbase.hh>

Classes

class  BackBuffer
 

Public Member Functions

 FltkViewBase (int x, int y, int w, int h, const char *label=0)
 
 ~FltkViewBase ()
 
void draw ()
 
int handle (int event)
 
void setLayout (core::Layout *layout)
 This methods notifies the view, that it has been attached to a layout. More...
 
void setCanvasSize (int width, int ascent, int descent)
 Set the canvas size. More...
 
void setCursor (core::style::Cursor cursor)
 Set the cursor appearance. More...
 
void setBgColor (core::style::Color *color)
 Set the background of the view. More...
 
void startDrawing (core::Rectangle *area)
 Called before drawing. More...
 
void finishDrawing (core::Rectangle *area)
 Called after drawing. More...
 
void queueDraw (core::Rectangle *area)
 Queue a region, which is given in canvas coordinates, for drawing. More...
 
void queueDrawTotal ()
 Queue the total viewport for drawing. More...
 
void cancelQueueDraw ()
 Cancel a draw queue request. More...
 
void drawPoint (core::style::Color *color, core::style::Color::Shading shading, int x, int y)
 
void drawLine (core::style::Color *color, core::style::Color::Shading shading, int x1, int y1, int x2, int y2)
 
void drawTypedLine (core::style::Color *color, core::style::Color::Shading shading, core::style::LineType type, int width, int x1, int y1, int x2, int y2)
 
void drawRectangle (core::style::Color *color, core::style::Color::Shading shading, bool filled, int x, int y, int width, int height)
 
void drawArc (core::style::Color *color, core::style::Color::Shading shading, bool filled, int centerX, int centerY, int width, int height, int angle1, int angle2)
 
void drawPolygon (core::style::Color *color, core::style::Color::Shading shading, bool filled, bool convex, core::Point *points, int npoints)
 
core::ViewgetClippingView (int x, int y, int width, int height)
 
void mergeClippingView (core::View *clippingView)
 
void setBufferedDrawing (bool b)
 
- Public Member Functions inherited from dw::fltk::FltkView
virtual bool usesFltkWidgets ()=0
 
virtual void addFltkWidget (Fl_Widget *widget, core::Allocation *allocation)
 
virtual void removeFltkWidget (Fl_Widget *widget)
 
virtual void allocateFltkWidget (Fl_Widget *widget, core::Allocation *allocation)
 
virtual void drawFltkWidget (Fl_Widget *widget, core::Rectangle *area)
 
- Public Member Functions inherited from dw::core::View
virtual bool usesViewport ()=0
 Return, whether this view uses a viewport. More...
 
virtual int getHScrollbarThickness ()=0
 Get the thickness of the horizontal scrollbar, when it is visible. More...
 
virtual int getVScrollbarThickness ()=0
 Get the thickness of the vertical scrollbar, when it is visible. More...
 
virtual void scrollTo (int x, int y)=0
 Scroll the vieport to the given position. More...
 
virtual void scroll (ScrollCommand)
 Scroll the viewport as commanded. More...
 
virtual void setViewportSize (int width, int height, int hScrollbarThickness, int vScrollbarThickness)=0
 Set the viewport size. More...
 
virtual void drawText (style::Font *font, style::Color *color, style::Color::Shading shading, int x, int y, const char *text, int len)=0
 
virtual void drawSimpleWrappedText (style::Font *font, style::Color *color, style::Color::Shading shading, int x, int y, int w, int h, const char *text)=0
 
virtual void drawImage (Imgbuf *imgbuf, int xRoot, int yRoot, int x, int y, int width, int height)=0
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More...
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal. More...
 
virtual int hashValue ()
 Return a hash value for the object. More...
 
virtual Objectclone ()
 Return an exact copy of the object. More...
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. More...
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object. More...
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses. More...
 

Protected Member Functions

virtual int translateViewXToCanvasX (int x)=0
 
virtual int translateViewYToCanvasY (int y)=0
 
virtual int translateCanvasXToViewX (int x)=0
 
virtual int translateCanvasYToViewY (int y)=0
 

Protected Attributes

core::LayouttheLayout
 
int canvasWidth
 
int canvasHeight
 
int mouse_x
 
int mouse_y
 
Fl_Widget * focused_child
 

Private Types

enum  DrawType { DRAW_PLAIN, DRAW_CLIPPED, DRAW_BUFFERED }
 

Private Member Functions

void draw (const core::Rectangle *rect, DrawType type)
 
void drawChildWidgets ()
 
int manageTabToFocus ()
 
void clipPoint (int *x, int *y, int border)
 

Private Attributes

int bgColor
 
core::Region drawRegion
 
core::RectangleexposeArea
 

Static Private Attributes

static BackBufferbackBuffer
 
static bool backBufferInUse
 

Member Enumeration Documentation

Enumerator
DRAW_PLAIN 
DRAW_CLIPPED 
DRAW_BUFFERED 

Constructor & Destructor Documentation

dw::fltk::FltkViewBase::FltkViewBase ( int  x,
int  y,
int  w,
int  h,
const char *  label = 0 
)
dw::fltk::FltkViewBase::~FltkViewBase ( )

References cancelQueueDraw().

Member Function Documentation

void dw::fltk::FltkViewBase::cancelQueueDraw ( )
virtual

Cancel a draw queue request.

If dw::core::View::queueDraw or dw::core::View::queueDrawTotal have been called before, and the actual drawing was not processed yet, the actual drawing should be cancelled. Otherwise, the cancellation should be ignored.

Implements dw::core::View.

Referenced by ~FltkViewBase().

void dw::fltk::FltkViewBase::clipPoint ( int *  x,
int *  y,
int  border 
)
inlineprivate
void dw::fltk::FltkViewBase::draw ( const core::Rectangle rect,
DrawType  type 
)
private
void dw::fltk::FltkViewBase::draw ( )
void dw::fltk::FltkViewBase::drawArc ( core::style::Color color,
core::style::Color::Shading  shading,
bool  filled,
int  centerX,
int  centerY,
int  width,
int  height,
int  angle1,
int  angle2 
)
virtual
void dw::fltk::FltkViewBase::drawChildWidgets ( )
private

Referenced by draw().

void dw::fltk::FltkViewBase::drawLine ( core::style::Color color,
core::style::Color::Shading  shading,
int  x1,
int  y1,
int  x2,
int  y2 
)
virtual
void dw::fltk::FltkViewBase::drawPoint ( core::style::Color color,
core::style::Color::Shading  shading,
int  x,
int  y 
)
virtual

Implements dw::core::View.

void dw::fltk::FltkViewBase::drawPolygon ( core::style::Color color,
core::style::Color::Shading  shading,
bool  filled,
bool  convex,
core::Point points,
int  npoints 
)
virtual
void dw::fltk::FltkViewBase::drawRectangle ( core::style::Color color,
core::style::Color::Shading  shading,
bool  filled,
int  x,
int  y,
int  width,
int  height 
)
virtual
void dw::fltk::FltkViewBase::drawTypedLine ( core::style::Color color,
core::style::Color::Shading  shading,
core::style::LineType  type,
int  width,
int  x1,
int  y1,
int  x2,
int  y2 
)
virtual
void dw::fltk::FltkViewBase::finishDrawing ( core::Rectangle area)
virtual

Called after drawing.

See also
dw::core:View::startDrawing

Implements dw::core::View.

core::View * dw::fltk::FltkViewBase::getClippingView ( int  x,
int  y,
int  width,
int  height 
)
virtual
int dw::fltk::FltkViewBase::handle ( int  event)
int dw::fltk::FltkViewBase::manageTabToFocus ( )
private
void dw::fltk::FltkViewBase::mergeClippingView ( core::View clippingView)
virtual

Implements dw::core::View.

void dw::fltk::FltkViewBase::queueDraw ( core::Rectangle area)
virtual

Queue a region, which is given in canvas coordinates, for drawing.

The view implementation is responsible, that this region is drawn, either immediately, or (which is more typical, since more efficient) the areas are collected, combined (as far as possible), and the drawing is later done in an idle function.

Implements dw::core::View.

References dw::core::Region::addRectangle(), and drawRegion.

Referenced by manageTabToFocus().

void dw::fltk::FltkViewBase::queueDrawTotal ( )
virtual

Queue the total viewport for drawing.

See also
dw::core::View::queueDraw

Implements dw::core::View.

void dw::fltk::FltkViewBase::setBgColor ( core::style::Color color)
virtual

Set the background of the view.

Implements dw::core::View.

References bgColor, and dw::core::style::Color::SHADING_NORMAL.

void dw::fltk::FltkViewBase::setBufferedDrawing ( bool  b)

References backBuffer.

void dw::fltk::FltkViewBase::setCanvasSize ( int  width,
int  ascent,
int  descent 
)
virtual
void dw::fltk::FltkViewBase::setCursor ( core::style::Cursor  cursor)
virtual

Set the cursor appearance.

Implements dw::core::View.

Referenced by dw::fltk::FltkViewport::handle().

void dw::fltk::FltkViewBase::setLayout ( core::Layout layout)
virtual

This methods notifies the view, that it has been attached to a layout.

Implements dw::core::View.

References layout, theLayout, dw::core::View::usesViewport(), and dw::core::Layout::viewportSizeChanged().

void dw::fltk::FltkViewBase::startDrawing ( core::Rectangle area)
virtual

Called before drawing.

All actual drawing operations will be enclosed into calls of dw::core:View::startDrawing and dw::core:View::finishDrawing. They may be implemented, e.g. when a backing pixmap is used, to prevent flickering. StartDrawing() will then initialize the backing pixmap, all other drawing operations will draw into it, and finishDrawing() will merge it into the window.

Implements dw::core::View.

virtual int dw::fltk::FltkViewBase::translateCanvasXToViewX ( int  x)
protectedpure virtual
virtual int dw::fltk::FltkViewBase::translateCanvasYToViewY ( int  y)
protectedpure virtual
virtual int dw::fltk::FltkViewBase::translateViewXToCanvasX ( int  x)
protectedpure virtual
virtual int dw::fltk::FltkViewBase::translateViewYToCanvasY ( int  y)
protectedpure virtual

Member Data Documentation

FltkViewBase::BackBuffer * dw::fltk::FltkViewBase::backBuffer
staticprivate
bool dw::fltk::FltkViewBase::backBufferInUse
staticprivate

Referenced by draw().

int dw::fltk::FltkViewBase::bgColor
private

Referenced by draw(), FltkViewBase(), and setBgColor().

int dw::fltk::FltkViewBase::canvasHeight
protected
int dw::fltk::FltkViewBase::canvasWidth
protected
core::Region dw::fltk::FltkViewBase::drawRegion
private

Referenced by draw(), and queueDraw().

core::Rectangle* dw::fltk::FltkViewBase::exposeArea
private

Referenced by draw(), and FltkViewBase().

Fl_Widget* dw::fltk::FltkViewBase::focused_child
protected

Referenced by FltkViewBase(), and handle().

int dw::fltk::FltkViewBase::mouse_x
protected
int dw::fltk::FltkViewBase::mouse_y
protected
core::Layout* dw::fltk::FltkViewBase::theLayout
protected

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