Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
platform.hh
Go to the documentation of this file.
1#ifndef __DW_PLATFORM_HH__
2#define __DW_PLATFORM_HH__
3
4#ifndef __INCLUDED_FROM_DW_CORE_HH__
5# error Do not include this file directly, use "core.hh" instead.
6#endif
7
8namespace dw {
9namespace core {
10
17{
18public:
19 /*
20 * -----------------------------------
21 * General
22 * -----------------------------------
23 */
24
29 virtual void setLayout (Layout *layout) = 0;
30
31 /*
32 * -------------------------
33 * Operations on views
34 * -------------------------
35 */
36
41 virtual void attachView (View *view) = 0;
42
47 virtual void detachView (View *view) = 0;
48
49 /*
50 * -----------------------------------
51 * Platform dependent properties
52 * -----------------------------------
53 */
54
58 virtual int textWidth (style::Font *font, const char *text, int len) = 0;
59
63 virtual char *textToUpper (const char *text, int len) = 0;
64
68 virtual char *textToLower (const char *text, int len) = 0;
69
73 virtual int nextGlyph (const char *text, int idx) = 0;
74
78 virtual int prevGlyph (const char *text, int idx) = 0;
79
83 virtual float dpiX () = 0;
84
88 virtual float dpiY () = 0;
89
90 /*
91 * ---------------------------------------------------------
92 * These are to encapsulate some platform dependencies
93 * ---------------------------------------------------------
94 */
95
104 virtual int addIdle (void (Layout::*func) ()) = 0;
105
109 virtual void removeIdle (int idleId) = 0;
110
111 /*
112 * ---------------------
113 * Style Resources
114 * ---------------------
115 */
116
131 bool tryEverything) = 0;
132
133 virtual bool fontExists (const char *name) = 0;
134
138 virtual style::Color *createColor (int color) = 0;
139
143 virtual style::Tooltip *createTooltip (const char *text) = 0;
144
148 virtual void cancelTooltip () = 0;
149
155 virtual Imgbuf *createImgbuf (Imgbuf::Type type, int width, int height,
156 double gamma) = 0;
157
161 virtual void copySelection(const char *text) = 0;
162
167};
168
169} // namespace core
170} // namespace dw
171
172#endif // __DW_PLATFORM_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
virtual float dpiX()=0
Return screen resolution in x-direction.
virtual int textWidth(style::Font *font, const char *text, int len)=0
Return the width of a text, with a given length and font.
virtual ui::ResourceFactory * getResourceFactory()=0
...
virtual void removeIdle(int idleId)=0
Remove an idle function, which has not been processed yet.
virtual int nextGlyph(const char *text, int idx)=0
Return the index of the next glyph in string text.
virtual void detachView(View *view)=0
This methods notifies the platform, that a view has been detached from the related layout.
virtual style::Tooltip * createTooltip(const char *text)=0
Create a tooltip.
virtual void copySelection(const char *text)=0
Copy selected text (0-terminated).
virtual void attachView(View *view)=0
This methods notifies the platform, that a view has been attached to the related layout.
virtual char * textToUpper(const char *text, int len)=0
Return the string resulting from transforming text to uppercase.
virtual style::Color * createColor(int color)=0
Create a color resource for a given 0xrrggbb value.
virtual void setLayout(Layout *layout)=0
This methods notifies the platform, that it has been attached to a layout.
virtual char * textToLower(const char *text, int len)=0
Return the string resulting from transforming text to lowercase.
virtual void cancelTooltip()=0
Cancel a tooltip (either shown or requested)
virtual int addIdle(void(Layout::*func)())=0
Add an idle function.
virtual float dpiY()=0
Return screen resolution in y-direction.
virtual style::Font * createFont(style::FontAttrs *attrs, bool tryEverything)=0
Create a (platform dependent) font.
virtual int prevGlyph(const char *text, int idx)=0
Return the index of the previous glyph in string text.
virtual Imgbuf * createImgbuf(Imgbuf::Type type, int width, int height, double gamma)=0
Create a (platform speficic) image buffer.
virtual bool fontExists(const char *name)=0
An interface to encapsulate platform dependent drawing.
Definition view.hh:17
A factory for the common resource.
Definition ui.hh:581
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
static Layout * layout
Dw is in this namespace, or sub namespaces of this one.