Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
dw::core::View Class Referenceabstract

An interface to encapsulate platform dependent drawing. More...

#include <view.hh>

Public Member Functions

virtual void setLayout (Layout *layout)=0
 This methods notifies the view, that it has been attached to a layout.
 
virtual void setCanvasSize (int width, int ascent, int descent)=0
 Set the canvas size.
 
virtual void setCursor (style::Cursor cursor)=0
 Set the cursor appearance.
 
virtual void setBgColor (style::Color *color)=0
 Set the background of the view.
 
virtual bool usesViewport ()=0
 Return, whether this view uses a viewport.
 
virtual int getHScrollbarThickness ()=0
 Get the thickness of the horizontal scrollbar, when it is visible.
 
virtual int getVScrollbarThickness ()=0
 Get the thickness of the vertical scrollbar, when it is visible.
 
virtual int getScrollbarOnLeft ()=0
 
virtual void scrollTo (int x, int y)=0
 Scroll the vieport to the given position.
 
virtual void scroll (ScrollCommand)
 Scroll the viewport as commanded.
 
virtual void setViewportSize (int width, int height, int hScrollbarThickness, int vScrollbarThickness)=0
 Set the viewport size.
 
virtual void startDrawing (Rectangle *area)=0
 Called before drawing.
 
virtual void finishDrawing (Rectangle *area)=0
 Called after drawing.
 
virtual void queueDraw (Rectangle *area)=0
 Queue a region, which is given in canvas coordinates, for drawing.
 
virtual void queueDrawTotal ()=0
 Queue the total viewport for drawing.
 
virtual void cancelQueueDraw ()=0
 Cancel a draw queue request.
 
virtual void drawPoint (style::Color *color, style::Color::Shading shading, int x, int y)=0
 
virtual void drawLine (style::Color *color, style::Color::Shading shading, int x1, int y1, int x2, int y2)=0
 
virtual void drawTypedLine (style::Color *color, style::Color::Shading shading, style::LineType type, int width, int x1, int y1, int x2, int y2)=0
 
virtual void drawRectangle (style::Color *color, style::Color::Shading shading, bool filled, int x, int y, int width, int height)=0
 
virtual void drawArc (style::Color *color, style::Color::Shading shading, bool filled, int centerX, int centerY, int width, int height, int angle1, int angle2)=0
 
virtual void drawPolygon (style::Color *color, style::Color::Shading shading, bool filled, bool convex, Point *points, int npoints)=0
 
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
 
virtual ViewgetClippingView (int x, int y, int width, int height)=0
 
virtual void mergeClippingView (View *clippingView)=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.
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal.
 
virtual int hashValue ()
 Return a hash value for the object.
 
virtual Objectclone ()
 Return an exact copy of the object.
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer.
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object.
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses.
 

Detailed Description

An interface to encapsulate platform dependent drawing.

See also
Dillo Widget Overview, Layout and Views

Definition at line 16 of file view.hh.

Member Function Documentation

◆ cancelQueueDraw()

virtual void dw::core::View::cancelQueueDraw ( )
pure 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.

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::queueResize().

◆ drawArc()

virtual void dw::core::View::drawArc ( style::Color color,
style::Color::Shading  shading,
bool  filled,
int  centerX,
int  centerY,
int  width,
int  height,
int  angle1,
int  angle2 
)
pure virtual

◆ drawImage()

virtual void dw::core::View::drawImage ( Imgbuf imgbuf,
int  xRoot,
int  yRoot,
int  x,
int  y,
int  width,
int  height 
)
pure virtual

◆ drawLine()

virtual void dw::core::View::drawLine ( style::Color color,
style::Color::Shading  shading,
int  x1,
int  y1,
int  x2,
int  y2 
)
pure virtual

◆ drawPoint()

virtual void dw::core::View::drawPoint ( style::Color color,
style::Color::Shading  shading,
int  x,
int  y 
)
pure virtual

Implemented in dw::fltk::FltkViewBase.

◆ drawPolygon()

virtual void dw::core::View::drawPolygon ( style::Color color,
style::Color::Shading  shading,
bool  filled,
bool  convex,
Point points,
int  npoints 
)
pure virtual

◆ drawRectangle()

virtual void dw::core::View::drawRectangle ( style::Color color,
style::Color::Shading  shading,
bool  filled,
int  x,
int  y,
int  width,
int  height 
)
pure virtual

◆ drawSimpleWrappedText()

virtual void dw::core::View::drawSimpleWrappedText ( style::Font font,
style::Color color,
style::Color::Shading  shading,
int  x,
int  y,
int  w,
int  h,
const char *  text 
)
pure virtual

◆ drawText()

virtual void dw::core::View::drawText ( style::Font font,
style::Color color,
style::Color::Shading  shading,
int  x,
int  y,
const char *  text,
int  len 
)
pure virtual

◆ drawTypedLine()

virtual void dw::core::View::drawTypedLine ( style::Color color,
style::Color::Shading  shading,
style::LineType  type,
int  width,
int  x1,
int  y1,
int  x2,
int  y2 
)
pure virtual

◆ finishDrawing()

virtual void dw::core::View::finishDrawing ( Rectangle area)
pure virtual

Called after drawing.

See also
dw::core:View::startDrawing

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::draw().

◆ getClippingView()

virtual View * dw::core::View::getClippingView ( int  x,
int  y,
int  width,
int  height 
)
pure virtual

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::Image::draw().

◆ getHScrollbarThickness()

virtual int dw::core::View::getHScrollbarThickness ( )
pure virtual

Get the thickness of the horizontal scrollbar, when it is visible.

Does not have to be implemented, when usesViewport returns false.

Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.

Referenced by dw::core::Layout::attachView().

◆ getScrollbarOnLeft()

virtual int dw::core::View::getScrollbarOnLeft ( )
pure virtual

◆ getVScrollbarThickness()

virtual int dw::core::View::getVScrollbarThickness ( )
pure virtual

Get the thickness of the vertical scrollbar, when it is visible.

Does not have to be implemented, when usesViewport returns false.

Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.

Referenced by dw::core::Layout::attachView().

◆ mergeClippingView()

virtual void dw::core::View::mergeClippingView ( View clippingView)
pure virtual

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::Image::draw().

◆ queueDraw()

virtual void dw::core::View::queueDraw ( Rectangle area)
pure 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.

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::queueDraw().

◆ queueDrawTotal()

virtual void dw::core::View::queueDrawTotal ( )
pure virtual

Queue the total viewport for drawing.

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

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::removeWidget(), and dw::core::Layout::scrollIdle().

◆ scroll()

virtual void dw::core::View::scroll ( ScrollCommand  )
inlinevirtual

Scroll the viewport as commanded.

Reimplemented in dw::fltk::FltkPreview, and dw::fltk::FltkViewport.

Definition at line 87 of file view.hh.

Referenced by dw::core::Layout::scroll().

◆ scrollTo()

virtual void dw::core::View::scrollTo ( int  x,
int  y 
)
pure virtual

Scroll the vieport to the given position.

Does not have to be implemented, when usesViewport returns false.

Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.

Referenced by dw::core::Layout::attachView(), and dw::core::Layout::scrollIdle().

◆ setBgColor()

virtual void dw::core::View::setBgColor ( style::Color color)
pure virtual

Set the background of the view.

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::attachView(), and dw::core::Layout::setBgColor().

◆ setCanvasSize()

virtual void dw::core::View::setCanvasSize ( int  width,
int  ascent,
int  descent 
)
pure virtual

◆ setCursor()

virtual void dw::core::View::setCursor ( style::Cursor  cursor)
pure virtual

Set the cursor appearance.

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::attachView(), and dw::core::Layout::setCursor().

◆ setLayout()

virtual void dw::core::View::setLayout ( Layout layout)
pure virtual

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

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::attachView(), and dw::core::Layout::detachView().

◆ setViewportSize()

virtual void dw::core::View::setViewportSize ( int  width,
int  height,
int  hScrollbarThickness,
int  vScrollbarThickness 
)
pure virtual

Set the viewport size.

Does not have to be implemented, when usesViewport returns false.

This will normally imply a resize of the UI widget. Width and height are the dimensions of the new size, including the scrollbar thicknesses.

Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.

Referenced by dw::core::Layout::attachView(), dw::core::Layout::removeWidget(), and dw::core::Layout::resizeIdle().

◆ startDrawing()

virtual void dw::core::View::startDrawing ( Rectangle area)
pure 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.

Implemented in dw::fltk::FltkViewBase.

Referenced by dw::core::Layout::draw().

◆ usesViewport()

virtual bool dw::core::View::usesViewport ( )
pure virtual

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