Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
fltkpreview.hh
Go to the documentation of this file.
1#ifndef __FlTKPREVIEW_HH__
2#define __FlTKPREVIEW_HH__
3
4#include <FL/Fl_Button.H>
5#include <FL/Fl_Menu_Window.H>
6#include "fltkviewbase.hh"
7
8namespace dw {
9namespace fltk {
10
12{
13 friend class FltkPreviewWindow;
14
15private:
17
18protected:
19 int translateViewXToCanvasX (int x);
20 int translateViewYToCanvasY (int y);
21 int translateCanvasXToViewX (int x);
22 int translateCanvasYToViewY (int y);
23
24public:
25 FltkPreview (int x, int y, int w, int h, dw::core::Layout *layout,
26 const char *label = 0);
27 ~FltkPreview ();
28
29 int handle (int event);
30
31 void setCanvasSize (int width, int ascent, int descent);
32
33 bool usesViewport ();
36 int getScrollbarOnLeft ();
37 void scrollTo (int x, int y);
39 void setViewportSize (int width, int height,
40 int hScrollbarThickness, int vScrollbarThickness);
41
42 void drawText (core::style::Font *font,
43 core::style::Color *color,
45 int x, int y, const char *text, int len);
47 core::style::Color *color,
49 int x, int y, int w, int h,
50 const char *text);
51 void drawImage (core::Imgbuf *imgbuf, int xRoot, int yRoot,
52 int x, int y, int width, int height);
53
54 bool usesFltkWidgets ();
55 void drawFltkWidget (Fl_Widget *widget, core::Rectangle *area);
56};
57
58
59class FltkPreviewWindow: public Fl_Menu_Window
60{
61private:
62 enum { BORDER_WIDTH = 2 };
63
65 int posX, posY;
66
67public:
70
71 void reallocate ();
72
73 void showWindow ();
74 void hideWindow ();
75
76 void scrollTo (int mouseX, int mouseY);
77};
78
79
80class FltkPreviewButton: public Fl_Button
81{
82private:
84
85public:
86 FltkPreviewButton (int x, int y, int w, int h,
87 dw::core::Layout *layout, const char *label = 0);
89
90 int handle (int event);
91};
92
93} // namespace fltk
94} // namespace dw
95
96#endif // __FlTKPREVIEW_HH__
The platform independent interface for image buffers.
Definition imgbuf.hh:162
The central class for managing and drawing a widget tree.
Definition layout.hh:17
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
FltkPreviewWindow * window
void scrollTo(int mouseX, int mouseY)
void drawFltkWidget(Fl_Widget *widget, core::Rectangle *area)
void drawText(core::style::Font *font, core::style::Color *color, core::style::Color::Shading shading, int x, int y, const char *text, int len)
bool usesViewport()
Return, whether this view uses a viewport.
int getVScrollbarThickness()
Get the thickness of the vertical scrollbar, when it is visible.
int translateCanvasYToViewY(int y)
void scrollTo(int x, int y)
Scroll the vieport to the given position.
int handle(int event)
void scroll(dw::core::ScrollCommand cmd)
Scroll the viewport as commanded.
void drawImage(core::Imgbuf *imgbuf, int xRoot, int yRoot, int x, int y, int width, int height)
int translateViewXToCanvasX(int x)
void drawSimpleWrappedText(core::style::Font *font, core::style::Color *color, core::style::Color::Shading shading, int x, int y, int w, int h, const char *text)
int translateCanvasXToViewX(int x)
int getHScrollbarThickness()
Get the thickness of the horizontal scrollbar, when it is visible.
void setViewportSize(int width, int height, int hScrollbarThickness, int vScrollbarThickness)
Set the viewport size.
void setCanvasSize(int width, int ascent, int descent)
Set the canvas size.
int translateViewYToCanvasY(int y)
static Layout * layout
static core::Imgbuf * imgbuf
ScrollCommand
Definition types.hh:35
Dw is in this namespace, or sub namespaces of this one.