geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Platform.h
Go to the documentation of this file.
1// Scintilla source code edit control
2/** @file Platform.h
3 ** Interface to platform facilities. Also includes some basic utilities.
4 ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows.
5 **/
6// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
7// The License.txt file describes the conditions under which this software may be distributed.
8
9#ifndef PLATFORM_H
10#define PLATFORM_H
11
12// PLAT_GTK = GTK+ on Linux or Win32
13// PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32
14// PLAT_WIN = Win32 API on Win32 OS
15// PLAT_WX is wxWindows on any supported platform
16// PLAT_TK = Tcl/TK on Linux or Win32
17
18#define PLAT_GTK 0
19#define PLAT_GTK_WIN32 0
20#define PLAT_GTK_MACOSX 0
21#define PLAT_MACOSX 0
22#define PLAT_WIN 0
23#define PLAT_WX 0
24#define PLAT_QT 0
25#define PLAT_FOX 0
26#define PLAT_CURSES 0
27#define PLAT_TK 0
28#define PLAT_HAIKU 0
29
30#if defined(FOX)
31#undef PLAT_FOX
32#define PLAT_FOX 1
33
34#elif defined(__WX__)
35#undef PLAT_WX
36#define PLAT_WX 1
37
38#elif defined(CURSES)
39#undef PLAT_CURSES
40#define PLAT_CURSES 1
41
42#elif defined(__HAIKU__)
43#undef PLAT_HAIKU
44#define PLAT_HAIKU 1
45
46#elif defined(SCINTILLA_QT)
47#undef PLAT_QT
48#define PLAT_QT 1
49
50#elif defined(TK)
51#undef PLAT_TK
52#define PLAT_TK 1
53
54#elif defined(GTK)
55#undef PLAT_GTK
56#define PLAT_GTK 1
57
58#if defined(__WIN32__) || defined(_MSC_VER)
59#undef PLAT_GTK_WIN32
60#define PLAT_GTK_WIN32 1
61#endif
62
63#if defined(__APPLE__)
64#undef PLAT_GTK_MACOSX
65#define PLAT_GTK_MACOSX 1
66#endif
67
68#elif defined(__APPLE__)
69
70#undef PLAT_MACOSX
71#define PLAT_MACOSX 1
72
73#else
74#undef PLAT_WIN
75#define PLAT_WIN 1
76
77#endif
78
79namespace Scintilla {
80
81typedef float XYPOSITION;
82typedef double XYACCUMULATOR;
83
84// Underlying the implementation of the platform classes are platform specific types.
85// Sometimes these need to be passed around by client code so they are defined here
86
87typedef void *FontID;
88typedef void *SurfaceID;
89typedef void *WindowID;
90typedef void *MenuID;
91typedef void *TickerID;
92typedef void *Function;
93typedef void *IdlerID;
94
95/**
96 * A geometric point class.
97 * Point is similar to the Win32 POINT and GTK+ GdkPoint types.
98 */
99class Point {
100public:
103
104 constexpr explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) noexcept : x(x_), y(y_) {
105 }
106
107 static constexpr Point FromInts(int x_, int y_) noexcept {
108 return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(y_));
109 }
110
111 constexpr bool operator!=(Point other) const noexcept {
112 return (x != other.x) || (y != other.y);
113 }
114
115 constexpr Point operator+(Point other) const noexcept {
116 return Point(x + other.x, y + other.y);
117 }
118
119 constexpr Point operator-(Point other) const noexcept {
120 return Point(x - other.x, y - other.y);
121 }
122
123 // Other automatically defined methods (assignment, copy constructor, destructor) are fine
124};
125
126/**
127 * A geometric rectangle class.
128 * PRectangle is similar to Win32 RECT.
129 * PRectangles contain their top and left sides, but not their right and bottom sides.
130 */
132public:
137
138 constexpr explicit PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) noexcept :
139 left(left_), top(top_), right(right_), bottom(bottom_) {
140 }
141
142 static constexpr PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept {
143 return PRectangle(static_cast<XYPOSITION>(left_), static_cast<XYPOSITION>(top_),
144 static_cast<XYPOSITION>(right_), static_cast<XYPOSITION>(bottom_));
145 }
146
147 // Other automatically defined methods (assignment, copy constructor, destructor) are fine
148
149 constexpr bool operator==(const PRectangle &rc) const noexcept {
150 return (rc.left == left) && (rc.right == right) &&
151 (rc.top == top) && (rc.bottom == bottom);
152 }
153 constexpr bool Contains(Point pt) const noexcept {
154 return (pt.x >= left) && (pt.x <= right) &&
155 (pt.y >= top) && (pt.y <= bottom);
156 }
157 constexpr bool ContainsWholePixel(Point pt) const noexcept {
158 // Does the rectangle contain all of the pixel to left/below the point
159 return (pt.x >= left) && ((pt.x+1) <= right) &&
160 (pt.y >= top) && ((pt.y+1) <= bottom);
161 }
162 constexpr bool Contains(PRectangle rc) const noexcept {
163 return (rc.left >= left) && (rc.right <= right) &&
164 (rc.top >= top) && (rc.bottom <= bottom);
165 }
166 constexpr bool Intersects(PRectangle other) const noexcept {
167 return (right > other.left) && (left < other.right) &&
168 (bottom > other.top) && (top < other.bottom);
169 }
170 void Move(XYPOSITION xDelta, XYPOSITION yDelta) noexcept {
171 left += xDelta;
172 top += yDelta;
173 right += xDelta;
174 bottom += yDelta;
175 }
176 constexpr XYPOSITION Width() const noexcept { return right - left; }
177 constexpr XYPOSITION Height() const noexcept { return bottom - top; }
178 constexpr bool Empty() const noexcept {
179 return (Height() <= 0) || (Width() <= 0);
180 }
181};
182
183/**
184 * Holds an RGB colour with 8 bits for each component.
185 */
186constexpr const float componentMaximum = 255.0f;
188 int co;
189public:
190 constexpr explicit ColourDesired(int co_=0) noexcept : co(co_) {
191 }
192
193 constexpr ColourDesired(unsigned int red, unsigned int green, unsigned int blue) noexcept :
194 co(red | (green << 8) | (blue << 16)) {
195 }
196
197 constexpr bool operator==(const ColourDesired &other) const noexcept {
198 return co == other.co;
199 }
200
201 constexpr int AsInteger() const noexcept {
202 return co;
203 }
204
205 // Red, green and blue values as bytes 0..255
206 constexpr unsigned char GetRed() const noexcept {
207 return co & 0xff;
208 }
209 constexpr unsigned char GetGreen() const noexcept {
210 return (co >> 8) & 0xff;
211 }
212 constexpr unsigned char GetBlue() const noexcept {
213 return (co >> 16) & 0xff;
214 }
215
216 // Red, green and blue values as float 0..1.0
217 constexpr float GetRedComponent() const noexcept {
218 return GetRed() / componentMaximum;
219 }
220 constexpr float GetGreenComponent() const noexcept {
221 return GetGreen() / componentMaximum;
222 }
223 constexpr float GetBlueComponent() const noexcept {
224 return GetBlue() / componentMaximum;
225 }
226};
227
228/**
229* Holds an RGBA colour.
230*/
232public:
233 constexpr explicit ColourAlpha(int co_ = 0) noexcept : ColourDesired(co_) {
234 }
235
236 constexpr ColourAlpha(unsigned int red, unsigned int green, unsigned int blue) noexcept :
237 ColourDesired(red | (green << 8) | (blue << 16)) {
238 }
239
240 constexpr ColourAlpha(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha) noexcept :
241 ColourDesired(red | (green << 8) | (blue << 16) | (alpha << 24)) {
242 }
243
244 constexpr ColourAlpha(ColourDesired cd, unsigned int alpha) noexcept :
245 ColourDesired(cd.AsInteger() | (alpha << 24)) {
246 }
247
248 constexpr ColourDesired GetColour() const noexcept {
249 return ColourDesired(AsInteger() & 0xffffff);
250 }
251
252 constexpr unsigned char GetAlpha() const noexcept {
253 return (AsInteger() >> 24) & 0xff;
254 }
255
256 constexpr float GetAlphaComponent() const noexcept {
257 return GetAlpha() / componentMaximum;
258 }
259
260 ColourAlpha MixedWith(ColourAlpha other) const noexcept {
261 const unsigned int red = (GetRed() + other.GetRed()) / 2;
262 const unsigned int green = (GetGreen() + other.GetGreen()) / 2;
263 const unsigned int blue = (GetBlue() + other.GetBlue()) / 2;
264 const unsigned int alpha = (GetAlpha() + other.GetAlpha()) / 2;
265 return ColourAlpha(red, green, blue, alpha);
266 }
267};
268
269/**
270* Holds an element of a gradient with an RGBA colour and a relative position.
271*/
273public:
274 float position;
276 ColourStop(float position_, ColourAlpha colour_) noexcept :
277 position(position_), colour(colour_) {
278 }
279};
280
281/**
282 * Font management.
283 */
284
286 const char *faceName;
287 float size;
289 bool italic;
293
295 const char *faceName_,
296 float size_=10,
297 int weight_=400,
298 bool italic_=false,
299 int extraFontFlag_=0,
300 int technology_=0,
301 int characterSet_=0) noexcept :
302
303 faceName(faceName_),
304 size(size_),
305 weight(weight_),
306 italic(italic_),
307 extraFontFlag(extraFontFlag_),
308 technology(technology_),
309 characterSet(characterSet_)
310 {
311 }
312
313};
314
315class Font {
316protected:
318public:
319 Font() noexcept;
320 // Deleted so Font objects can not be copied
321 Font(const Font &) = delete;
322 Font(Font &&) = delete;
323 Font &operator=(const Font &) = delete;
324 Font &operator=(Font &&) = delete;
325 virtual ~Font();
326
327 virtual void Create(const FontParameters &fp);
328 virtual void Release();
329
330 FontID GetID() const noexcept { return fid; }
331 // Alias another font - caller guarantees not to Release
332 void SetID(FontID fid_) noexcept { fid = fid_; }
333 friend class Surface;
334 friend class SurfaceImpl;
335};
336
337/**
338 * A surface abstracts a place to draw.
339 */
340class Surface {
341public:
342 Surface() noexcept = default;
343 Surface(const Surface &) = delete;
344 Surface(Surface &&) = delete;
345 Surface &operator=(const Surface &) = delete;
346 Surface &operator=(Surface &&) = delete;
347 virtual ~Surface() {}
348 static Surface *Allocate(int technology);
349
350 virtual void Init(WindowID wid)=0;
351 virtual void Init(SurfaceID sid, WindowID wid)=0;
352 virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0;
353
354 virtual void Release()=0;
355 virtual bool Initialised()=0;
356 virtual void PenColour(ColourDesired fore)=0;
357 virtual int LogPixelsY()=0;
358 virtual int DeviceHeightFont(int points)=0;
359 virtual void MoveTo(int x_, int y_)=0;
360 virtual void LineTo(int x_, int y_)=0;
361 virtual void Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back)=0;
362 virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
363 virtual void FillRectangle(PRectangle rc, ColourDesired back)=0;
364 virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
366 virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
367 ColourDesired outline, int alphaOutline, int flags)=0;
369 virtual void GradientRectangle(PRectangle rc, const std::vector<ColourStop> &stops, GradientOptions options)=0;
370 virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) = 0;
371 virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
372 virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0;
373
374 virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) = 0;
375 virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) = 0;
376 virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore) = 0;
377 virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions) = 0;
378 virtual XYPOSITION WidthText(Font &font_, const char *s, int len) = 0;
379 virtual XYPOSITION Ascent(Font &font_)=0;
380 virtual XYPOSITION Descent(Font &font_)=0;
381 virtual XYPOSITION InternalLeading(Font &font_)=0;
382 virtual XYPOSITION Height(Font &font_)=0;
384
385 virtual void SetClip(PRectangle rc)=0;
386 virtual void FlushCachedState()=0;
387
388 virtual void SetUnicodeMode(bool unicodeMode_)=0;
389 virtual void SetDBCSMode(int codePage)=0;
390};
391
392/**
393 * Class to hide the details of window manipulation.
394 * Does not own the window which will normally have a longer life than this object.
395 */
396class Window {
397protected:
399public:
400 Window() noexcept : wid(nullptr), cursorLast(cursorInvalid) {
401 }
402 Window(const Window &source) = delete;
403 Window(Window &&) = delete;
404 Window &operator=(WindowID wid_) noexcept {
405 wid = wid_;
407 return *this;
408 }
409 Window &operator=(const Window &) = delete;
410 Window &operator=(Window &&) = delete;
411 virtual ~Window();
412 WindowID GetID() const noexcept { return wid; }
413 bool Created() const noexcept { return wid != nullptr; }
414 void Destroy();
415 PRectangle GetPosition() const;
416 void SetPosition(PRectangle rc);
417 void SetPositionRelative(PRectangle rc, const Window *relativeTo);
419 void Show(bool show=true);
420 void InvalidateAll();
422 virtual void SetFont(Font &font);
424 void SetCursor(Cursor curs);
426private:
428};
429
430/**
431 * Listbox management.
432 */
433
434// ScintillaBase implements IListBoxDelegate to receive ListBoxEvents from a ListBox
435
438 ListBoxEvent(EventType event_) noexcept : event(event_) {
439 }
440};
441
443public:
444 virtual void ListNotify(ListBoxEvent *plbe)=0;
445};
446
447class ListBox : public Window {
448public:
449 ListBox() noexcept;
450 ~ListBox() override;
451 static ListBox *Allocate();
452
453 void SetFont(Font &font) override =0;
454 virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0;
455 virtual void SetAverageCharWidth(int width)=0;
456 virtual void SetVisibleRows(int rows)=0;
457 virtual int GetVisibleRows() const=0;
459 virtual int CaretFromEdge()=0;
460 virtual void Clear()=0;
461 virtual void Append(char *s, int type = -1)=0;
462 virtual int Length()=0;
463 virtual void Select(int n)=0;
464 virtual int GetSelection()=0;
465 virtual int Find(const char *prefix)=0;
466 virtual void GetValue(int n, char *value, int len)=0;
467 virtual void RegisterImage(int type, const char *xpm_data)=0;
468 virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) = 0;
469 virtual void ClearRegisteredImages()=0;
470 virtual void SetDelegate(IListBoxDelegate *lbDelegate)=0;
471 virtual void SetList(const char* list, char separator, char typesep)=0;
472};
473
474/**
475 * Menu management.
476 */
477class Menu {
479public:
480 Menu() noexcept;
481 MenuID GetID() const noexcept { return mid; }
482 void CreatePopUp();
483 void Destroy();
484 void Show(Point pt, Window &w);
485};
486
487/**
488 * Dynamic Library (DLL/SO/...) loading
489 */
491public:
492 virtual ~DynamicLibrary() = default;
493
494 /// @return Pointer to function "name", or NULL on failure.
495 virtual Function FindFunction(const char *name) = 0;
496
497 /// @return true if the library was loaded successfully.
498 virtual bool IsValid() = 0;
499
500 /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded.
501 static DynamicLibrary *Load(const char *modulePath);
502};
503
504#if defined(__clang__)
505# if __has_feature(attribute_analyzer_noreturn)
506# define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
507# else
508# define CLANG_ANALYZER_NORETURN
509# endif
510#else
511# define CLANG_ANALYZER_NORETURN
512#endif
513
514/**
515 * Platform class used to retrieve system wide parameters such as double click speed
516 * and chrome colour. Not a creatable object, more of a module with several functions.
517 */
518class Platform {
519public:
520 Platform() = default;
521 Platform(const Platform &) = delete;
522 Platform(Platform &&) = delete;
523 Platform &operator=(const Platform &) = delete;
525 ~Platform() = default;
526 static ColourDesired Chrome();
528 static const char *DefaultFont();
529 static int DefaultFontSize();
530 static unsigned int DoubleClickTime();
531 static void DebugDisplay(const char *s);
532 static constexpr long LongFromTwoShorts(short a,short b) noexcept {
533 return (a) | ((b) << 16);
534 }
535
536 static void DebugPrintf(const char *format, ...);
537 static bool ShowAssertionPopUps(bool assertionPopUps_);
538 static void Assert(const char *c, const char *file, int line) CLANG_ANALYZER_NORETURN;
539};
540
541#ifdef NDEBUG
542#define PLATFORM_ASSERT(c) ((void)0)
543#else
544#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Scintilla::Platform::Assert(#c, __FILE__, __LINE__))
545#endif
546
547}
548
549#endif
#define CLANG_ANALYZER_NORETURN
Definition: Platform.h:511
Holds an RGBA colour.
Definition: Platform.h:231
constexpr ColourAlpha(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha) noexcept
Definition: Platform.h:240
constexpr unsigned char GetAlpha() const noexcept
Definition: Platform.h:252
constexpr ColourAlpha(ColourDesired cd, unsigned int alpha) noexcept
Definition: Platform.h:244
constexpr ColourAlpha(unsigned int red, unsigned int green, unsigned int blue) noexcept
Definition: Platform.h:236
ColourAlpha MixedWith(ColourAlpha other) const noexcept
Definition: Platform.h:260
constexpr float GetAlphaComponent() const noexcept
Definition: Platform.h:256
constexpr ColourDesired GetColour() const noexcept
Definition: Platform.h:248
constexpr ColourAlpha(int co_=0) noexcept
Definition: Platform.h:233
constexpr unsigned char GetRed() const noexcept
Definition: Platform.h:206
constexpr int AsInteger() const noexcept
Definition: Platform.h:201
constexpr unsigned char GetBlue() const noexcept
Definition: Platform.h:212
constexpr ColourDesired(unsigned int red, unsigned int green, unsigned int blue) noexcept
Definition: Platform.h:193
constexpr ColourDesired(int co_=0) noexcept
Definition: Platform.h:190
constexpr bool operator==(const ColourDesired &other) const noexcept
Definition: Platform.h:197
constexpr float GetRedComponent() const noexcept
Definition: Platform.h:217
constexpr float GetGreenComponent() const noexcept
Definition: Platform.h:220
constexpr unsigned char GetGreen() const noexcept
Definition: Platform.h:209
constexpr float GetBlueComponent() const noexcept
Definition: Platform.h:223
Holds an element of a gradient with an RGBA colour and a relative position.
Definition: Platform.h:272
ColourStop(float position_, ColourAlpha colour_) noexcept
Definition: Platform.h:276
ColourAlpha colour
Definition: Platform.h:275
Dynamic Library (DLL/SO/...) loading.
Definition: Platform.h:490
static DynamicLibrary * Load(const char *modulePath)
Definition: PlatGTK.cxx:1984
virtual bool IsValid()=0
virtual ~DynamicLibrary()=default
virtual Function FindFunction(const char *name)=0
virtual void Create(const FontParameters &fp)
Definition: PlatGTK.cxx:123
Font() noexcept
Definition: PlatGTK.cxx:119
FontID GetID() const noexcept
Definition: Platform.h:330
virtual void Release()
Definition: PlatGTK.cxx:128
void SetID(FontID fid_) noexcept
Definition: Platform.h:332
virtual void ListNotify(ListBoxEvent *plbe)=0
virtual PRectangle GetDesiredRect()=0
static ListBox * Allocate()
Definition: PlatGTK.cxx:1255
~ListBox() override
Definition: PlatGTK.cxx:1174
virtual int CaretFromEdge()=0
virtual void Select(int n)=0
virtual int GetVisibleRows() const =0
virtual void SetVisibleRows(int rows)=0
virtual void SetDelegate(IListBoxDelegate *lbDelegate)=0
virtual void SetAverageCharWidth(int width)=0
virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage)=0
virtual void GetValue(int n, char *value, int len)=0
virtual int GetSelection()=0
virtual void ClearRegisteredImages()=0
virtual void Clear()=0
ListBox() noexcept
Definition: PlatGTK.cxx:1171
virtual void SetList(const char *list, char separator, char typesep)=0
void SetFont(Font &font) override=0
virtual int Find(const char *prefix)=0
virtual void Append(char *s, int type=-1)=0
virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0
virtual int Length()=0
virtual void RegisterImage(int type, const char *xpm_data)=0
Menu management.
Definition: Platform.h:477
Menu() noexcept
Definition: PlatGTK.cxx:1900
MenuID GetID() const noexcept
Definition: Platform.h:481
void Show(Point pt, Window &w)
Definition: PlatGTK.cxx:1922
void CreatePopUp()
Definition: PlatGTK.cxx:1902
A geometric rectangle class.
Definition: Platform.h:131
static constexpr PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept
Definition: Platform.h:142
void Move(XYPOSITION xDelta, XYPOSITION yDelta) noexcept
Definition: Platform.h:170
constexpr bool ContainsWholePixel(Point pt) const noexcept
Definition: Platform.h:157
constexpr bool Intersects(PRectangle other) const noexcept
Definition: Platform.h:166
constexpr bool Empty() const noexcept
Definition: Platform.h:178
constexpr PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_=0) noexcept
Definition: Platform.h:138
XYPOSITION right
Definition: Platform.h:135
constexpr bool Contains(PRectangle rc) const noexcept
Definition: Platform.h:162
constexpr bool operator==(const PRectangle &rc) const noexcept
Definition: Platform.h:149
constexpr XYPOSITION Height() const noexcept
Definition: Platform.h:177
constexpr XYPOSITION Width() const noexcept
Definition: Platform.h:176
XYPOSITION bottom
Definition: Platform.h:136
constexpr bool Contains(Point pt) const noexcept
Definition: Platform.h:153
Platform class used to retrieve system wide parameters such as double click speed and chrome colour.
Definition: Platform.h:518
Platform & operator=(const Platform &)=delete
static const char * DefaultFont()
Definition: PlatGTK.cxx:1996
static bool ShowAssertionPopUps(bool assertionPopUps_)
Definition: PlatGTK.cxx:2039
static void DebugPrintf(const char *format,...)
Definition: PlatGTK.cxx:2032
static ColourDesired Chrome()
Definition: PlatGTK.cxx:1988
static int DefaultFontSize()
Definition: PlatGTK.cxx:2004
static constexpr long LongFromTwoShorts(short a, short b) noexcept
Definition: Platform.h:532
Platform(Platform &&)=delete
static ColourDesired ChromeHighlight()
Definition: PlatGTK.cxx:1992
static void Assert(const char *c, const char *file, int line)
Definition: PlatGTK.cxx:2045
Platform(const Platform &)=delete
static void DebugDisplay(const char *s)
Definition: PlatGTK.cxx:2016
static unsigned int DoubleClickTime()
Definition: PlatGTK.cxx:2012
Platform & operator=(Platform &&)=delete
A geometric point class.
Definition: Platform.h:99
constexpr bool operator!=(Point other) const noexcept
Definition: Platform.h:111
static constexpr Point FromInts(int x_, int y_) noexcept
Definition: Platform.h:107
XYPOSITION y
Definition: Platform.h:102
constexpr Point(XYPOSITION x_=0, XYPOSITION y_=0) noexcept
Definition: Platform.h:104
constexpr Point operator+(Point other) const noexcept
Definition: Platform.h:115
constexpr Point operator-(Point other) const noexcept
Definition: Platform.h:119
XYPOSITION x
Definition: Platform.h:101
A surface abstracts a place to draw.
Definition: Platform.h:340
virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0
virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0
virtual XYPOSITION Descent(Font &font_)=0
virtual int DeviceHeightFont(int points)=0
virtual void SetClip(PRectangle rc)=0
virtual XYPOSITION Height(Font &font_)=0
virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0
virtual void Init(SurfaceID sid, WindowID wid)=0
static Surface * Allocate(int technology)
Definition: PlatGTK.cxx:964
virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage)=0
virtual void PenColour(ColourDesired fore)=0
virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore)=0
virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0
virtual XYPOSITION AverageCharWidth(Font &font_)=0
Surface() noexcept=default
virtual void Release()=0
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0
virtual void Init(WindowID wid)=0
virtual void Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back)=0
virtual bool Initialised()=0
virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0
virtual void MoveTo(int x_, int y_)=0
virtual int LogPixelsY()=0
virtual XYPOSITION Ascent(Font &font_)=0
virtual void SetDBCSMode(int codePage)=0
virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0
virtual void LineTo(int x_, int y_)=0
virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0
virtual void FillRectangle(PRectangle rc, ColourDesired back)=0
virtual void FlushCachedState()=0
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int flags)=0
virtual void GradientRectangle(PRectangle rc, const std::vector< ColourStop > &stops, GradientOptions options)=0
virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0
virtual void SetUnicodeMode(bool unicodeMode_)=0
virtual XYPOSITION InternalLeading(Font &font_)=0
Class to hide the details of window manipulation.
Definition: Platform.h:396
PRectangle GetMonitorRect(Point pt)
Definition: PlatGTK.cxx:1134
Window() noexcept
Definition: Platform.h:400
virtual ~Window()
Definition: PlatGTK.cxx:968
Window(const Window &source)=delete
bool Created() const noexcept
Definition: Platform.h:413
virtual void SetFont(Font &font)
Definition: PlatGTK.cxx:1084
Window & operator=(WindowID wid_) noexcept
Definition: Platform.h:404
WindowID wid
Definition: Platform.h:398
Cursor cursorLast
Definition: Platform.h:427
Window & operator=(Window &&)=delete
PRectangle GetClientPosition() const
Definition: PlatGTK.cxx:1059
Window & operator=(const Window &)=delete
PRectangle GetPosition() const
Definition: PlatGTK.cxx:987
Window(Window &&)=delete
void SetPositionRelative(PRectangle rc, const Window *relativeTo)
Definition: PlatGTK.cxx:1031
void InvalidateRectangle(PRectangle rc)
Definition: PlatGTK.cxx:1075
void SetPosition(PRectangle rc)
Definition: PlatGTK.cxx:1003
WindowID GetID() const noexcept
Definition: Platform.h:412
void SetCursor(Cursor curs)
Definition: PlatGTK.cxx:1088
void InvalidateAll()
Definition: PlatGTK.cxx:1069
void Show(bool show=true)
Definition: PlatGTK.cxx:1064
default
Definition: filetypes.c:4
const gchar * name
Definition: document.c:3219
#define fill(Order, Group, Idx, Charset, Name)
Definition: encodings.c:62
vString * line
Definition: geany_cobol.c:133
CobolFormat format
Definition: geany_cobol.c:137
tokenInfo * list
Styling buffer using one element for each run rather than using a filled buffer.
Definition: Converter.h:9
double XYACCUMULATOR
Definition: Platform.h:82
void * FontID
Definition: Platform.h:87
void * SurfaceID
Definition: Platform.h:88
float XYPOSITION
Definition: Platform.h:81
void * IdlerID
Definition: Platform.h:93
void * WindowID
Definition: Platform.h:89
constexpr const float componentMaximum
Holds an RGB colour with 8 bits for each component.
Definition: Platform.h:186
void * MenuID
Definition: Platform.h:90
void * TickerID
Definition: Platform.h:91
void * Function
Definition: Platform.h:92
Font management.
Definition: Platform.h:285
FontParameters(const char *faceName_, float size_=10, int weight_=400, bool italic_=false, int extraFontFlag_=0, int technology_=0, int characterSet_=0) noexcept
Definition: Platform.h:294
const char * faceName
Definition: Platform.h:286
Listbox management.
Definition: Platform.h:436
ListBoxEvent(EventType event_) noexcept
Definition: Platform.h:438
enum Scintilla::ListBoxEvent::EventType event