Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
fltkplatform.hh
Go to the documentation of this file.
1#ifndef __DW_FLTKPLATFORM_HH__
2#define __DW_FLTKPLATFORM_HH__
3
4#ifndef __INCLUDED_FROM_DW_FLTK_CORE_HH__
5# error Do not include this file directly, use "fltkcore.hh" instead.
6#endif
7
8namespace dw {
9
13namespace fltk {
14
16{
18 Fl_Font font[4];
19 public:
20 FontFamily (Fl_Font fontNormal, Fl_Font fontBold,
21 Fl_Font fontItalic, Fl_Font fontBoldItalic);
22 void set (Fl_Font, int attrs);
23 Fl_Font get (int attrs);
24 };
25
27
32
34 ~FltkFont ();
35
36 static void initSystemFonts ();
37
38public:
39 Fl_Font font;
40
41 static FltkFont *create (core::style::FontAttrs *attrs);
42 static bool fontExists (const char *name);
43 static Fl_Font get (const char *name, int attrs);
44};
45
46
60
62{
63private:
64 FltkTooltip (const char *text);
65 ~FltkTooltip ();
66public:
67 static FltkTooltip *create(const char *text);
68 static void cancel();
69 void onEnter();
70 void onLeave();
71 void onMotion();
72};
73
74
78class FltkView: public core::View
79{
80public:
81 virtual bool usesFltkWidgets () = 0;
82
83 virtual void addFltkWidget (Fl_Widget *widget,
84 core::Allocation *allocation);
85 virtual void removeFltkWidget (Fl_Widget *widget);
86 virtual void allocateFltkWidget (Fl_Widget *widget,
87 core::Allocation *allocation);
88 virtual void drawFltkWidget (Fl_Widget *widget, core::Rectangle *area);
89};
90
91
93{
94private:
96 {
97 private:
99
100 public:
102 this->platform = platform; }
103
105 *label);
107 createComplexButtonResource (core::Widget *widget, bool relief);
110 int rows);
112 core::ui::EntryResource *createEntryResource (int size, bool password,
113 const char *label,
114 const char *placeholder);
116 int rows,
117 const char *placeholder);
119 activated);
122 *groupedWith, bool activated);
123 };
124
126
128 {
129 public:
130 int id;
131 void (core::Layout::*func) ();
132 };
133
135
136 lout::container::typed::List <IdleFunc> *idleQueue;
139
140 static void generalStaticIdle(void *data);
141 void generalIdle();
142
144 lout::container::typed::List <ui::FltkResource> *resources;
145
146public:
147 FltkPlatform ();
148 ~FltkPlatform ();
149
151
152 void attachView (core::View *view);
153
154 void detachView (core::View *view);
155
156 int textWidth (core::style::Font *font, const char *text, int len);
157 char *textToUpper (const char *text, int len);
158 char *textToLower (const char *text, int len);
159 int nextGlyph (const char *text, int idx);
160 int prevGlyph (const char *text, int idx);
161 float dpiX ();
162 float dpiY ();
163
164 int addIdle (void (core::Layout::*func) ());
165 void removeIdle (int idleId);
166
168 bool tryEverything);
169 bool fontExists (const char *name);
170 core::style::Color *createColor (int color);
171 core::style::Tooltip *createTooltip (const char *text);
172 void cancelTooltip();
173
174 core::Imgbuf *createImgbuf (core::Imgbuf::Type type, int width, int height,
175 double gamma);
176
177 void copySelection(const char *text);
178
180
181 void attachResource (ui::FltkResource *resource);
182 void detachResource (ui::FltkResource *resource);
183};
184
185} // namespace fltk
186} // namespace dw
187
188#endif // __DW_FLTKPLATFORM_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
An interface to encapsulate some platform dependencies.
Definition platform.hh:17
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
An interface to encapsulate platform dependent drawing.
Definition view.hh:17
The base class of all dillo widgets.
Definition widget.hh:44
Interface for labelled buttons resources.
Definition ui.hh:400
A factory for the common resource.
Definition ui.hh:581
static FltkColor * create(int color)
static lout::container::typed::HashTable< dw::core::style::ColorAttrs, FltkColor > * colorsTable
int colors[SHADING_NUM]
void set(Fl_Font, int attrs)
static FontFamily standardFontFamily
static bool fontExists(const char *name)
static FltkFont * create(core::style::FontAttrs *attrs)
static lout::container::typed::HashTable< lout::object::ConstString, FontFamily > * systemFonts
static Fl_Font get(const char *name, int attrs)
static void initSystemFonts()
static lout::container::typed::HashTable< dw::core::style::FontAttrs, FltkFont > * fontsTable
core::ui::LabelButtonResource * createLabelButtonResource(const char *label)
core::ui::OptionMenuResource * createOptionMenuResource()
core::ui::ComplexButtonResource * createComplexButtonResource(core::Widget *widget, bool relief)
core::ui::RadioButtonResource * createRadioButtonResource(core::ui::RadioButtonResource *groupedWith, bool activated)
core::ui::MultiLineTextResource * createMultiLineTextResource(int cols, int rows, const char *placeholder)
core::ui::ListResource * createListResource(core::ui::ListResource::SelectionMode selectionMode, int rows)
void setPlatform(FltkPlatform *platform)
core::ui::EntryResource * createEntryResource(int size, bool password, const char *label, const char *placeholder)
core::ui::CheckButtonResource * createCheckButtonResource(bool activated)
void(core::Layout::* func)()
static void generalStaticIdle(void *data)
float dpiX()
Return screen resolution in x-direction.
int nextGlyph(const char *text, int idx)
Return the index of the next glyph in string text.
int addIdle(void(core::Layout::*func)())
core::Imgbuf * createImgbuf(core::Imgbuf::Type type, int width, int height, double gamma)
Create a (platform speficic) image buffer.
int prevGlyph(const char *text, int idx)
Return the index of the previous glyph in string text.
void copySelection(const char *text)
Copy selected text (0-terminated).
void setLayout(core::Layout *layout)
This methods notifies the platform, that it has been attached to a layout.
bool fontExists(const char *name)
void removeIdle(int idleId)
Remove an idle function, which has not been processed yet.
core::style::Color * createColor(int color)
Create a color resource for a given 0xrrggbb value.
FltkResourceFactory resourceFactory
lout::container::typed::List< ui::FltkResource > * resources
float dpiY()
Return screen resolution in y-direction.
void attachResource(ui::FltkResource *resource)
lout::container::typed::List< IdleFunc > * idleQueue
char * textToLower(const char *text, int len)
Return the string resulting from transforming text to lowercase.
core::style::Tooltip * createTooltip(const char *text)
Create a tooltip.
core::ui::ResourceFactory * getResourceFactory()
...
void detachResource(ui::FltkResource *resource)
void detachView(core::View *view)
This methods notifies the platform, that a view has been detached from the related layout.
core::style::Font * createFont(core::style::FontAttrs *attrs, bool tryEverything)
Create a (platform dependent) font.
int textWidth(core::style::Font *font, const char *text, int len)
Return the width of a text, with a given length and font.
void attachView(core::View *view)
This methods notifies the platform, that a view has been attached to the related layout.
void cancelTooltip()
Cancel a tooltip (either shown or requested)
char * textToUpper(const char *text, int len)
Return the string resulting from transforming text to uppercase.
static FltkTooltip * create(const char *text)
This interface adds some more methods for all flkt-based views.
virtual void drawFltkWidget(Fl_Widget *widget, core::Rectangle *area)
virtual void removeFltkWidget(Fl_Widget *widget)
virtual void addFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
virtual void allocateFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
virtual bool usesFltkWidgets()=0
Typed version of container::untyped::HashTable.
Definition container.hh:536
An object::Object wrapper for constant strings (char*).
Definition object.hh:163
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
Dw is in this namespace, or sub namespaces of this one.
Represents the allocation, i.e.
Definition types.hh:164