dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

view.hh
Go to the documentation of this file.
1 #ifndef __DW_VIEW_HH__
2 #define __DW_VIEW_HH__
3 
4 #ifndef __INCLUDED_FROM_DW_CORE_HH__
5 # error Do not include this file directly, use "core.hh" instead.
6 #endif
7 
8 namespace dw {
9 namespace core {
10 
17 {
18 public:
19  /*
20  * ----------------------------
21  * Operations on the view
22  * ----------------------------
23  */
24 
29  virtual void setLayout (Layout *layout) = 0;
30 
34  virtual void setCanvasSize (int width, int ascent, int descent) = 0;
35 
39  virtual void setCursor (style::Cursor cursor) = 0;
40 
44  virtual void setBgColor (style::Color *color) = 0;
45 
46  /*
47  * ---------------------------------------------------------
48  * Scrolling and Related. Only usesViewport must be
49  * implemented, if it returns false, the other methods
50  * are never called.
51  * -------------------------------------------------------
52  */
53 
57  virtual bool usesViewport () = 0;
58 
65  virtual int getHScrollbarThickness () = 0;
66 
73  virtual int getVScrollbarThickness () = 0;
74 
80  virtual void scrollTo (int x, int y) = 0;
81 
85  virtual void scroll (ScrollCommand) { };
86 
96  virtual void setViewportSize (int width, int height,
97  int hScrollbarThickness,
98  int vScrollbarThickness) = 0;
99 
100  /*
101  * -----------------------
102  * Drawing functions
103  * -----------------------
104  */
105 
116  virtual void startDrawing (Rectangle *area) = 0;
117 
123  virtual void finishDrawing (Rectangle *area) = 0;
124 
134  virtual void queueDraw (Rectangle *area) = 0;
135 
141  virtual void queueDrawTotal () = 0;
142 
151  virtual void cancelQueueDraw () = 0;
152 
153  /*
154  * The following methods should be self-explaining.
155  */
156 
157  virtual void drawPoint (style::Color *color,
158  style::Color::Shading shading,
159  int x, int y) = 0;
160  virtual void drawLine (style::Color *color,
161  style::Color::Shading shading,
162  int x1, int y1, int x2, int y2) = 0;
163  virtual void drawTypedLine (style::Color *color,
164  style::Color::Shading shading,
165  style::LineType type, int width,
166  int x1, int y1, int x2, int y2) = 0;
167  virtual void drawRectangle (style::Color *color,
168  style::Color::Shading shading, bool filled,
169  int x, int y, int width, int height) = 0;
170  virtual void drawArc (style::Color *color,
171  style::Color::Shading shading, bool filled,
172  int centerX, int centerY, int width, int height,
173  int angle1, int angle2) = 0;
174  virtual void drawPolygon (style::Color *color,
175  style::Color::Shading shading,
176  bool filled, bool convex, Point *points,
177  int npoints) = 0;
178  virtual void drawText (style::Font *font,
179  style::Color *color,
180  style::Color::Shading shading,
181  int x, int y, const char *text, int len) = 0;
182  virtual void drawSimpleWrappedText (style::Font *font, style::Color *color,
183  style::Color::Shading shading,
184  int x, int y, int w, int h,
185  const char *text) = 0;
186  virtual void drawImage (Imgbuf *imgbuf, int xRoot, int yRoot,
187  int x, int y, int width, int height) = 0;
188 
189  /*
190  * --------------
191  * Clipping
192  * --------------
193  */
194 
195  /*
196  * To prevent drawing outside of a given area, a clipping view may be
197  * requested, which also implements this interface. The clipping view is
198  * related to the parent view (clipping views may be nested!), anything
199  * which is drawn into this clipping view, is later merged again into the
200  * parent view. An implementation will typically use additional pixmaps,
201  * which are later merged into the parent view pixmap/window.
202  */
203 
204  virtual View *getClippingView (int x, int y, int width, int height) = 0;
205  virtual void mergeClippingView (View *clippingView) = 0;
206 };
207 
208 } // namespace core
209 } // namespace dw
210 
211 #endif // __DW_VIEW_HH__
dw::core::Point
Definition: types.hh:49
dw::core::View::cancelQueueDraw
virtual void cancelQueueDraw()=0
Cancel a draw queue request.
dw::core::style::Cursor
Cursor
Definition: style.hh:198
dw::core::View::mergeClippingView
virtual void mergeClippingView(View *clippingView)=0
dw::core::style::Color
Definition: style.hh:709
dw::core::View::setViewportSize
virtual void setViewportSize(int width, int height, int hScrollbarThickness, int vScrollbarThickness)=0
Set the viewport size.
dw::core::View::drawText
virtual void drawText(style::Font *font, style::Color *color, style::Color::Shading shading, int x, int y, const char *text, int len)=0
dw::core::View::drawSimpleWrappedText
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
dw::core::View::startDrawing
virtual void startDrawing(Rectangle *area)=0
Called before drawing.
dw::core::style::LineType
LineType
Definition: style.hh:289
dw::core::View::drawRectangle
virtual void drawRectangle(style::Color *color, style::Color::Shading shading, bool filled, int x, int y, int width, int height)=0
dw::core::View::drawImage
virtual void drawImage(Imgbuf *imgbuf, int xRoot, int yRoot, int x, int y, int width, int height)=0
dw::core::style::Color::Shading
Shading
Definition: style.hh:725
dw::core::View::queueDrawTotal
virtual void queueDrawTotal()=0
Queue the total viewport for drawing.
dw::core::View::usesViewport
virtual bool usesViewport()=0
Return, whether this view uses a viewport.
lout::object::Object
This is the base class for many other classes, which defines very common virtual methods.
Definition: object.hh:24
dw::core::style::Font
Definition: style.hh:656
dw::core::View::drawTypedLine
virtual void drawTypedLine(style::Color *color, style::Color::Shading shading, style::LineType type, int width, int x1, int y1, int x2, int y2)=0
dw::core::View::drawArc
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
dw::core::Layout
The central class for managing and drawing a widget tree.
Definition: layout.hh:16
dw::core::ScrollCommand
ScrollCommand
Definition: types.hh:35
dw::core::View::getClippingView
virtual View * getClippingView(int x, int y, int width, int height)=0
dw::core::Imgbuf
The platform independent interface for image buffers.
Definition: imgbuf.hh:161
dw::core::Rectangle
dw::core::Shape implemtation for simple rectangles.
Definition: types.hh:69
dw::core::View::setLayout
virtual void setLayout(Layout *layout)=0
This methods notifies the view, that it has been attached to a layout.
dw::core::View
An interface to encapsulate platform dependent drawing.
Definition: view.hh:16
dw::core::View::getVScrollbarThickness
virtual int getVScrollbarThickness()=0
Get the thickness of the vertical scrollbar, when it is visible.
dw::core::View::setBgColor
virtual void setBgColor(style::Color *color)=0
Set the background of the view.
dw::core::View::scroll
virtual void scroll(ScrollCommand)
Scroll the viewport as commanded.
Definition: view.hh:85
dw::core::View::finishDrawing
virtual void finishDrawing(Rectangle *area)=0
Called after drawing.
dw::core::View::scrollTo
virtual void scrollTo(int x, int y)=0
Scroll the vieport to the given position.
dw::core::View::drawPoint
virtual void drawPoint(style::Color *color, style::Color::Shading shading, int x, int y)=0
dw::core::View::setCursor
virtual void setCursor(style::Cursor cursor)=0
Set the cursor appearance.
dw::core::View::drawPolygon
virtual void drawPolygon(style::Color *color, style::Color::Shading shading, bool filled, bool convex, Point *points, int npoints)=0
dw
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtextblock.cc:26
dw::core::View::drawLine
virtual void drawLine(style::Color *color, style::Color::Shading shading, int x1, int y1, int x2, int y2)=0
dw::core::View::queueDraw
virtual void queueDraw(Rectangle *area)=0
Queue a region, which is given in canvas coordinates, for drawing.
dw::core::View::getHScrollbarThickness
virtual int getHScrollbarThickness()=0
Get the thickness of the horizontal scrollbar, when it is visible.
dw::core::View::setCanvasSize
virtual void setCanvasSize(int width, int ascent, int descent)=0
Set the canvas size.