00001 #ifndef __DW_VIEW_HH__
00002 #define __DW_VIEW_HH__
00003
00004 #ifndef __INCLUDED_FROM_DW_CORE_HH__
00005 # error Do not include this file directly, use "core.hh" instead.
00006 #endif
00007
00008 namespace dw {
00009 namespace core {
00010
00016 class View: public lout::object::Object
00017 {
00018 public:
00019
00020
00021
00022
00023
00024
00029 virtual void setLayout (Layout *layout) = 0;
00030
00034 virtual void setCanvasSize (int width, int ascent, int descent) = 0;
00035
00039 virtual void setCursor (style::Cursor cursor) = 0;
00040
00044 virtual void setBgColor (style::Color *color) = 0;
00045
00046
00047
00048
00049
00050
00051
00052
00053
00057 virtual bool usesViewport () = 0;
00058
00065 virtual int getHScrollbarThickness () = 0;
00066
00073 virtual int getVScrollbarThickness () = 0;
00074
00080 virtual void scrollTo (int x, int y) = 0;
00081
00085 virtual void scroll (ScrollCommand) { };
00086
00096 virtual void setViewportSize (int width, int height,
00097 int hScrollbarThickness,
00098 int vScrollbarThickness) = 0;
00099
00100
00101
00102
00103
00104
00105
00116 virtual void startDrawing (Rectangle *area) = 0;
00117
00123 virtual void finishDrawing (Rectangle *area) = 0;
00124
00134 virtual void queueDraw (Rectangle *area) = 0;
00135
00141 virtual void queueDrawTotal () = 0;
00142
00151 virtual void cancelQueueDraw () = 0;
00152
00153
00154
00155
00156
00157 virtual void drawPoint (style::Color *color,
00158 style::Color::Shading shading,
00159 int x, int y) = 0;
00160 virtual void drawLine (style::Color *color,
00161 style::Color::Shading shading,
00162 int x1, int y1, int x2, int y2) = 0;
00163 virtual void drawTypedLine (style::Color *color,
00164 style::Color::Shading shading,
00165 style::LineType type, int width,
00166 int x1, int y1, int x2, int y2) = 0;
00167 virtual void drawRectangle (style::Color *color,
00168 style::Color::Shading shading, bool filled,
00169 int x, int y, int width, int height) = 0;
00170 virtual void drawArc (style::Color *color,
00171 style::Color::Shading shading, bool filled,
00172 int centerX, int centerY, int width, int height,
00173 int angle1, int angle2) = 0;
00174 virtual void drawPolygon (style::Color *color,
00175 style::Color::Shading shading,
00176 bool filled, bool convex, Point *points,
00177 int npoints) = 0;
00178 virtual void drawText (style::Font *font,
00179 style::Color *color,
00180 style::Color::Shading shading,
00181 int x, int y, const char *text, int len) = 0;
00182 virtual void drawSimpleWrappedText (style::Font *font, style::Color *color,
00183 style::Color::Shading shading,
00184 int x, int y, int w, int h,
00185 const char *text) = 0;
00186 virtual void drawImage (Imgbuf *imgbuf, int xRoot, int yRoot,
00187 int x, int y, int width, int height) = 0;
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204 virtual View *getClippingView (int x, int y, int width, int height) = 0;
00205 virtual void mergeClippingView (View *clippingView) = 0;
00206 };
00207
00208 }
00209 }
00210
00211 #endif // __DW_VIEW_HH__