Dillo v3.1.1-119-g140d9ebd
|
#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. | |
void | setCanvasSize (int width, int ascent, int descent) |
Set the canvas size. | |
void | setCursor (core::style::Cursor cursor) |
Set the cursor appearance. | |
void | setBgColor (core::style::Color *color) |
Set the background of the view. | |
void | startDrawing (core::Rectangle *area) |
Called before drawing. | |
void | finishDrawing (core::Rectangle *area) |
Called after drawing. | |
void | queueDraw (core::Rectangle *area) |
Queue a region, which is given in canvas coordinates, for drawing. | |
void | queueDrawTotal () |
Queue the total viewport for drawing. | |
void | cancelQueueDraw () |
Cancel a draw queue request. | |
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::View * | getClippingView (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. | |
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 | 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. | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. | |
virtual int | hashValue () |
Return a hash value for the object. | |
virtual Object * | clone () |
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. | |
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::Layout * | theLayout |
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::Rectangle * | exposeArea |
Static Private Attributes | |
static BackBuffer * | backBuffer |
static bool | backBufferInUse |
Definition at line 15 of file fltkviewbase.hh.
|
private |
Enumerator | |
---|---|
DRAW_PLAIN | |
DRAW_CLIPPED | |
DRAW_BUFFERED |
Definition at line 32 of file fltkviewbase.hh.
dw::fltk::FltkViewBase::FltkViewBase | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
const char * | label = 0 |
||
) |
Definition at line 64 of file fltkviewbase.cc.
References backBuffer, bgColor, canvasHeight, canvasWidth, exposeArea, focused_child, mouse_x, and mouse_y.
dw::fltk::FltkViewBase::~FltkViewBase | ( | ) |
Definition at line 81 of file fltkviewbase.cc.
References 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.
Definition at line 445 of file fltkviewbase.cc.
Referenced by ~FltkViewBase().
|
inlineprivate |
Definition at line 43 of file fltkviewbase.hh.
References exposeArea, dw::core::Rectangle::height, dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
Referenced by drawLine(), and drawRectangle().
void dw::fltk::FltkViewBase::draw | ( | ) |
Definition at line 95 of file fltkviewbase.cc.
References dw::core::Region::clear(), draw(), DRAW_BUFFERED, DRAW_CLIPPED, DRAW_PLAIN, drawChildWidgets(), drawRegion, lout::container::typed::Iterator< T >::getNext(), lout::container::typed::Iterator< T >::hasNext(), dw::core::Region::rectangles(), translateViewXToCanvasX(), and translateViewYToCanvasY().
Referenced by draw().
|
private |
Definition at line 132 of file fltkviewbase.cc.
References backBuffer, backBufferInUse, bgColor, DRAW_BUFFERED, DRAW_CLIPPED, dw::core::Layout::expose(), exposeArea, H, dw::core::Rectangle::height, dw::core::Rectangle::isEmpty(), dw::fltk::FltkViewBase::BackBuffer::offscreen, dw::fltk::FltkViewBase::BackBuffer::setSize(), theLayout, translateCanvasXToViewX(), translateCanvasYToViewY(), translateViewXToCanvasX(), translateViewYToCanvasY(), dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
|
virtual |
Implements dw::core::View.
Definition at line 541 of file fltkviewbase.cc.
References translateCanvasXToViewX(), and translateCanvasYToViewY().
|
private |
Definition at line 188 of file fltkviewbase.cc.
Referenced by draw().
|
virtual |
Implements dw::core::View.
Definition at line 455 of file fltkviewbase.cc.
References clipPoint(), translateCanvasXToViewX(), and translateCanvasYToViewY().
Referenced by drawTypedLine().
|
virtual |
Implements dw::core::View.
Definition at line 449 of file fltkviewbase.cc.
|
virtual |
Implements dw::core::View.
Definition at line 558 of file fltkviewbase.cc.
References translateCanvasXToViewX(), and translateCanvasYToViewY().
|
virtual |
Implements dw::core::View.
Definition at line 504 of file fltkviewbase.cc.
References clipPoint(), translateCanvasXToViewX(), and translateCanvasYToViewY().
|
virtual |
Implements dw::core::View.
Definition at line 471 of file fltkviewbase.cc.
References drawLine(), dw::core::style::LINE_DASHED, dw::core::style::LINE_DOTTED, and dw::core::style::LINE_NORMAL.
|
virtual |
Called after drawing.
Implements dw::core::View.
Definition at line 430 of file fltkviewbase.cc.
|
virtual |
Implements dw::core::View.
Definition at line 588 of file fltkviewbase.cc.
References translateCanvasXToViewX(), and translateCanvasYToViewY().
int dw::fltk::FltkViewBase::handle | ( | int | event | ) |
Definition at line 287 of file fltkviewbase.cc.
References _MSG, dw::core::Layout::buttonPress(), dw::core::Layout::buttonRelease(), dw::core::Layout::cancelTooltip(), dw::core::Layout::enterNotify(), focused_child, dw::fltk::getDwButtonState(), dw::core::Layout::leaveNotify(), manageTabToFocus(), dw::core::Layout::motionNotify(), mouse_x, mouse_y, theLayout, translateViewXToCanvasX(), and translateViewYToCanvasY().
Referenced by dw::fltk::FltkPreview::handle(), and dw::fltk::FltkViewport::handle().
|
private |
Definition at line 223 of file fltkviewbase.cc.
References dw::core::Rectangle::height, dw::core::HPOS_INTO_VIEW, queueDraw(), dw::core::Layout::scrollTo(), theLayout, translateViewXToCanvasX(), translateViewYToCanvasY(), dw::core::VPOS_INTO_VIEW, dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
Referenced by handle().
|
virtual |
Implements dw::core::View.
Definition at line 595 of file fltkviewbase.cc.
|
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.
Definition at line 434 of file fltkviewbase.cc.
References dw::core::Region::addRectangle(), and drawRegion.
Referenced by manageTabToFocus().
|
virtual |
Queue the total viewport for drawing.
Implements dw::core::View.
Definition at line 440 of file fltkviewbase.cc.
|
virtual |
Set the background of the view.
Implements dw::core::View.
Definition at line 419 of file fltkviewbase.cc.
References bgColor, and dw::core::style::Color::SHADING_NORMAL.
void dw::fltk::FltkViewBase::setBufferedDrawing | ( | bool | b | ) |
Definition at line 86 of file fltkviewbase.cc.
References backBuffer.
Referenced by UIcmd_tab_new().
|
virtual |
Set the canvas size.
Implements dw::core::View.
Reimplemented in dw::fltk::FltkViewport.
Definition at line 390 of file fltkviewbase.cc.
References canvasHeight, and canvasWidth.
Referenced by dw::fltk::FltkFlatView::setCanvasSize(), dw::fltk::FltkPreview::setCanvasSize(), and dw::fltk::FltkViewport::setCanvasSize().
|
virtual |
Set the cursor appearance.
Implements dw::core::View.
Definition at line 396 of file fltkviewbase.cc.
Referenced by dw::fltk::FltkViewport::handle().
|
virtual |
This methods notifies the view, that it has been attached to a layout.
Implements dw::core::View.
Definition at line 383 of file fltkviewbase.cc.
References layout, theLayout, dw::core::View::usesViewport(), and dw::core::Layout::viewportSizeChanged().
|
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.
Definition at line 426 of file fltkviewbase.cc.
|
protectedpure virtual |
Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.
Referenced by dw::fltk::FltkWidgetView::allocateFltkWidget(), draw(), drawArc(), dw::fltk::FltkWidgetView::drawImage(), drawLine(), drawPolygon(), drawRectangle(), dw::fltk::FltkWidgetView::drawSimpleWrappedText(), dw::fltk::FltkWidgetView::drawText(), and getClippingView().
|
protectedpure virtual |
Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.
Referenced by dw::fltk::FltkWidgetView::allocateFltkWidget(), draw(), drawArc(), dw::fltk::FltkWidgetView::drawImage(), drawLine(), drawPolygon(), drawRectangle(), dw::fltk::FltkWidgetView::drawSimpleWrappedText(), dw::fltk::FltkWidgetView::drawText(), and getClippingView().
|
protectedpure virtual |
Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.
Referenced by draw(), draw(), handle(), and manageTabToFocus().
|
protectedpure virtual |
Implemented in dw::fltk::FltkFlatView, dw::fltk::FltkPreview, and dw::fltk::FltkViewport.
Referenced by draw(), draw(), handle(), and manageTabToFocus().
|
staticprivate |
Definition at line 37 of file fltkviewbase.hh.
Referenced by draw(), FltkViewBase(), and setBufferedDrawing().
|
staticprivate |
Definition at line 38 of file fltkviewbase.hh.
Referenced by draw().
|
private |
Definition at line 34 of file fltkviewbase.hh.
Referenced by draw(), FltkViewBase(), and setBgColor().
|
protected |
Definition at line 57 of file fltkviewbase.hh.
Referenced by dw::fltk::FltkViewport::adjustScrollbarValues(), FltkViewBase(), dw::fltk::FltkPreviewWindow::reallocate(), dw::fltk::FltkViewport::scroll(), dw::fltk::FltkViewport::scrollTo(), setCanvasSize(), dw::fltk::FltkPreview::translateCanvasYToViewY(), and dw::fltk::FltkPreview::translateViewYToCanvasY().
|
protected |
Definition at line 57 of file fltkviewbase.hh.
Referenced by dw::fltk::FltkViewport::adjustScrollbarValues(), FltkViewBase(), dw::fltk::FltkPreviewWindow::reallocate(), dw::fltk::FltkViewport::scrollTo(), setCanvasSize(), dw::fltk::FltkPreview::translateCanvasXToViewX(), and dw::fltk::FltkPreview::translateViewXToCanvasX().
|
private |
Definition at line 35 of file fltkviewbase.hh.
Referenced by draw(), and queueDraw().
|
private |
Definition at line 36 of file fltkviewbase.hh.
Referenced by clipPoint(), draw(), and FltkViewBase().
|
protected |
Definition at line 59 of file fltkviewbase.hh.
Referenced by FltkViewBase(), and handle().
|
protected |
Definition at line 58 of file fltkviewbase.hh.
Referenced by FltkViewBase(), handle(), dw::fltk::FltkViewport::handle(), dw::fltk::FltkViewport::positionChanged(), and dw::fltk::FltkViewport::selectionScroll().
|
protected |
Definition at line 58 of file fltkviewbase.hh.
Referenced by FltkViewBase(), handle(), dw::fltk::FltkViewport::handle(), dw::fltk::FltkViewport::positionChanged(), and dw::fltk::FltkViewport::selectionScroll().
|
protected |
Definition at line 56 of file fltkviewbase.hh.
Referenced by draw(), dw::fltk::FltkWidgetView::drawText(), handle(), manageTabToFocus(), dw::fltk::FltkViewport::positionChanged(), dw::fltk::FltkViewport::resize(), dw::fltk::FltkPreviewWindow::scrollTo(), dw::fltk::FltkViewport::scrollTo(), and setLayout().