FLTK 1.4.5: Fl_Graphics_Driver.H Source File

FLTK 1.4.5

Loading...
Searching...
No Matches
Fl_Graphics_Driver.H
1//
2// Declaration of classes Fl_Graphics_Driver, Fl_Scalable_Graphics_Driver,
3// and Fl_Font_Descriptor for the Fast Light Tool Kit (FLTK).
4//
5// Copyright 2010-2025 by Bill Spitzak and others.
6//
7// This library is free software. Distribution and use rights are outlined in
8// the file "COPYING" which should have been included with this file. If this
9// file is missing or damaged, see the license at:
10//
11// https://www.fltk.org/COPYING.php
12//
13// Please see the following page on how to report bugs and issues:
14//
15// https://www.fltk.org/bugs.php
16//
17
23
27
28#ifndef FL_GRAPHICS_DRIVER_H
29#define FL_GRAPHICS_DRIVER_H
30
31#include <FL/Fl_Device.H>
32#include <FL/Fl_Image.H>
33#include <FL/Fl_Bitmap.H>
34#include <FL/Fl_Pixmap.H>
35#include <FL/Fl_RGB_Image.H>
36
37class Fl_Graphics_Driver;
38class Fl_Font_Descriptor;
39class Fl_Image_Surface;
40FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
41
50typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
51
52struct Fl_Fontdesc;
53typedef struct _PangoFontDescription PangoFontDescription;
54
55// FIXME: The following constants are deprecated and will be removed in FLTK 1.5.0
56// in favor of dynamic clipping stack allocation. This needs C++11 features.
57// See issue #1139: "FL_REGION_STACK_SIZE could be increased"
58// and issue #1140: "Fix static array allocation".
59
60#if FL_ABI_VERSION >= 10401
61# define FL_REGION_STACK_SIZE 64
62#else
63# define FL_REGION_STACK_SIZE 10
64#endif
65
66#define FL_MATRIX_STACK_SIZE 32
67
86class FL_EXPORT Fl_Graphics_Driver {
87 friend class Fl_Surface_Device;
88 friend class Fl_Pixmap;
89 friend class Fl_Bitmap;
90 friend class Fl_RGB_Image;
91 friend class Fl_SVG_Image;
92 friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
93 friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
94 friend void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
95 friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
96 friend void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
97 friend int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg);
98 friend FL_EXPORT int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg);
99 friend FL_EXPORT void gl_start();
100 /* ============== Implementation note about image drawing =========================
101 A graphics driver can implement up to 6 virtual member functions to draw images:
102 virtual void draw_pixmap(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy)
103 virtual void draw_bitmap(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy)
104 virtual void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy)
105and
106 virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy)
107 virtual void draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy)
108 virtual void draw_fixed(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy)
109 - The 1st group of functions is used when the driver can directly map the image data,
110 sized at data_w() x data_h(), to the image drawing area, sized at w()*scale x h()*scale
111 where scale is the current GUI scale factor.
112 - If the driver does not support such scale-and-draw operation for a given image type,
113 it should implement the draw_fixed() function which is called by the library after the
114 image has been internally resized to the drawing size and cached.
115 - The platform-independent Fl_Graphics_Driver class implements the 1st group of functions.
116 Each resizes the image, caches it, and calls the platform-specific implementation of
117 draw_fixed(image-class *,....) with the cached image.
118 - Consider an image object, say from class Fl_RGB_Image. Fl_RGB_Image::draw()
119 calls the virtual member function draw_rgb(Fl_RGB_Image *,....). If Fl_XXX_Graphics_Driver
120 re-implements this function, this code runs and is expected to draw the image
121 adequately scaled to its drawing size. If Fl_XXX_Graphics_Driver does not re-implement
122 this function, Fl_Graphics_Driver::draw_rgb(Fl_RGB_Image *,....) runs. It internally
123 resizes the image, caches it, and calls Fl_XXX_Graphics_Driver::draw_fixed(Fl_RGB_Image *,....)
124 that draws the image from its cached form which already has the adequate size.
125 - Some drivers implement, for a given image class, only the function of the 1st group or
126 only draw_fixed() as in these examples:
127 - Fl_Quartz_Graphics_Driver implements only draw_rgb(Fl_RGB_Image *,....) because it
128 can perform the scale-and-draw operation whatever the RGB image and the required scaling.
129 - Fl_Xlib_Graphics_Driver implements only draw_fixed(Fl_Pixmap *,....). The library
130 takes care of resizing and caching the Pixmap to the adequate drawing size.
131 - Some drivers implement, for a given image class, the function of both groups, e.g. :
132 Fl_GDI_Graphics_Driver implements both draw_rgb(Fl_RGB_Image *,....) and
133 draw_fixed(Fl_RGB_Image *,....) because scale-and-draw may require function Alphablend()
134 from MSIMG32.DLL. In the absence of that, the draw_rgb() implementation calls
135 Fl_Graphics_Driver::draw_rgb() which runs Fl_GDI_Graphics_Driver::draw_fixed(Fl_RGB_Image*,...).
136
137 Graphics drivers also implement cache(Fl_Pixmap*), cache(Fl_Bitmap*) and cache(Fl_RGB_Image*)
138 to compute the cached form of all image types, and uncache(Fl_RGB_Image *,...),
139 uncache_pixmap(fl_uintptr_t) and delete_bitmask(fl_uintptr_t) to destroy cached image forms.
140 Graphics drivers that use the mask_ variable of class Fl_Pixmap to cache an Fl_Pixmap
141 object also reimplement the uchar **Fl_Graphics_Driver::mask_bitmap() member function.
142 */
143private:
144 virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy);
145 virtual void draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy);
146 virtual void draw_fixed(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy);
147 // the default implementation of make_unused_color_() is most probably enough
148 virtual void make_unused_color_(unsigned char &r, unsigned char &g, unsigned char &b, int color_count, void **data);
149 // some platforms may need to reimplement this
150 virtual void set_current_();
151 void draw_image_general_(const uchar *buf, int X, int Y, int W, int H, int D, int L);
152 void draw_image_mono_general_(const uchar *buf, int X, int Y, int W, int H, int D, int L);
153 float scale_; // scale between FLTK and drawing coordinates: drawing = FLTK * scale_
154public:
156 static Fl_Graphics_Driver *newMainGraphicsDriver();
158 struct matrix {double a, b, c, d, x, y;};
160 typedef enum {
161 NATIVE = 1,
162 PRINTER = 2
163 } driver_feature;
164
165protected:
166 int fl_clip_state_number;
167 static const matrix m0;
168 Fl_Font font_;
169 Fl_Fontsize size_;
170 Fl_Color color_;
171 int sptr;
172 static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
173 matrix stack[FL_MATRIX_STACK_SIZE];
174 matrix m;
175 int n;
176 int gap_;
177 enum SHAPE {NONE=0, LINE, LOOP, POLYGON, POINTS, COMPLEX_POLYGON} what;
178 int rstackptr;
179 static const int region_stack_max = FL_REGION_STACK_SIZE - 1;
180 Fl_Region rstack[FL_REGION_STACK_SIZE];
181 Fl_Font_Descriptor *font_descriptor_;
182 int p_size;
183 typedef struct { float x; float y; } XPOINT;
184 XPOINT *xpoint;
185 virtual void global_gc();
186 virtual void cache(Fl_Pixmap *img);
187 virtual void cache(Fl_Bitmap *img);
188 virtual void cache(Fl_RGB_Image *img);
189 virtual void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_);
190 // --- implementation is in src/drivers/xxx/Fl_xxx_Graphics_Driver_image.cxx
191 virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
192 virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
193 virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
194 virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
195 virtual void draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
196 virtual void draw_pixmap(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
197 virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
198 virtual void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
199
201 static void change_image_size(Fl_Image *img, int W, int H) {
202 img->w(W);
203 img->h(H);
204 }
205 // Support function for image drawing
206 virtual void uncache_pixmap(fl_uintptr_t p);
207 // accessor functions to protected image members
208 int start_image(Fl_Image *img, int XP, int YP, int WP, int HP, int &cx, int &cy,
209 int &X, int &Y, int &W, int &H);
211 static fl_uintptr_t* id(Fl_RGB_Image *rgb) {return &(rgb->id_);}
213 static fl_uintptr_t* id(Fl_Pixmap *pm) {return &(pm->id_);}
215 static fl_uintptr_t* id(Fl_Bitmap *bm) {return &(bm->id_);}
217 static fl_uintptr_t* mask(Fl_RGB_Image *rgb) {return &(rgb->mask_);}
219 static fl_uintptr_t* mask(Fl_Pixmap *pm) {return &(pm->mask_);}
221 static void cache_w_h(Fl_Pixmap *pm, int*& pwidth, int*& pheight) {
222 pwidth = &(pm->cache_w_);
223 pheight = &(pm->cache_h_);
224 }
226 static void cache_w_h(Fl_Bitmap *bm, int*& pwidth, int*& pheight) {
227 pwidth = &(bm->cache_w_);
228 pheight = &(bm->cache_h_);
229 }
231 static void cache_w_h(Fl_RGB_Image *rgb, int*& pwidth, int*& pheight) {
232 pwidth = &(rgb->cache_w_);
233 pheight = &(rgb->cache_h_);
234 }
235 static Fl_Offscreen get_offscreen_and_delete_image_surface(Fl_Image_Surface*);
237 static void draw_empty(Fl_Image* img, int X, int Y) {img->draw_empty(X, Y);}
238
239 Fl_Graphics_Driver();
240 virtual void cache_size(Fl_Image *img, int &width, int &height);
241 void cache_size_finalize(Fl_Image *img, int &width, int &height);
242 static unsigned need_pixmap_bg_color;
243public:
244 virtual ~Fl_Graphics_Driver();
245 static Fl_Graphics_Driver &default_driver();
246 // support of "complex shapes"
247 void push_matrix();
248 void pop_matrix();
249 void load_identity();
250 void load_matrix(double a, double b, double c, double d, double x, double y);
251 void mult_matrix(double a, double b, double c, double d, double x, double y);
252 void rotate(double d);
253 void translate(double x,double y);
254 double transform_x(double x, double y);
255 double transform_y(double x, double y);
256 double transform_dx(double x, double y);
257 double transform_dy(double x, double y);
259 inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
261 inline void font_descriptor(Fl_Font_Descriptor *d) { font_descriptor_ = d;}
263 float scale() { return scale_; }
265 virtual void scale(float f);
267 virtual char can_do_alpha_blending();
268 virtual void point(int x, int y);
269 virtual void rect(int x, int y, int w, int h);
270 virtual void focus_rect(int x, int y, int w, int h);
271 virtual void rectf(int x, int y, int w, int h);
272 virtual void _rbox(int fill, int x, int y, int w, int h, int r);
273 virtual void rounded_rect(int x, int y, int w, int h, int r);
274 virtual void rounded_rectf(int x, int y, int w, int h, int r);
275 // the default implementation is most likely enough
276 virtual void colored_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b);
277 virtual void line(int x, int y, int x1, int y1);
279 virtual void line(int x, int y, int x1, int y1, int x2, int y2);
281 virtual void xyline(int x, int y, int x1);
283 virtual void xyline(int x, int y, int x1, int y2);
285 virtual void xyline(int x, int y, int x1, int y2, int x3);
287 virtual void yxline(int x, int y, int y1);
289 virtual void yxline(int x, int y, int y1, int x2);
291 virtual void yxline(int x, int y, int y1, int x2, int y3);
293 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
295 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
296 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
298 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
299 // --- clipping
300 virtual void push_clip(int x, int y, int w, int h);
301 virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
302 virtual int not_clipped(int x, int y, int w, int h);
304 virtual void push_no_clip(); // has default implementation
306 virtual void pop_clip(); // has default implementation
307 virtual Fl_Region clip_region(); // has default implementation
308 virtual void clip_region(Fl_Region r); // has default implementation
309 virtual void restore_clip();
310 virtual void begin_points();
311 virtual void begin_line();
312 virtual void begin_loop();
313 virtual void begin_polygon();
314 virtual void begin_complex_polygon();
315 virtual void transformed_vertex(double xf, double yf);
316 virtual void transformed_vertex0(float x, float y);
317 virtual void vertex(double x, double y);
318 virtual void end_points();
319 virtual void end_line();
320 virtual void end_loop();
321 virtual void fixloop();
322 virtual void end_polygon();
323 virtual void end_complex_polygon();
324 // default implementation is most probably enough
325 virtual bool can_fill_non_convex_polygon() { return true; }
326 virtual void gap();
327 virtual void circle(double x, double y, double r);
328 virtual void arc(double x, double y, double r, double start, double end);
329 virtual void arc(int x, int y, int w, int h, double a1, double a2);
330 virtual void pie(int x, int y, int w, int h, double a1, double a2);
331 // To support fl_draw_circle(int x, int y, int d, Fl_Color color),
332 // the default implementation is most probably enough.
333 virtual void draw_circle(int x, int y, int d, Fl_Color c);
334 virtual void curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
335 virtual void line_style(int style, int width=0, char* dashes=0);
336 virtual void color(Fl_Color c);
337 virtual void set_color(Fl_Color i, unsigned int c);
338 virtual void free_color(Fl_Color i, int overlay);
339 virtual Fl_Color color();
340 virtual void color(uchar r, uchar g, uchar b);
341 virtual void draw(const char *str, int nChars, int x, int y);
342 virtual void draw(const char *str, int nChars, float x, float y);
343 virtual void draw(int angle, const char *str, int nChars, int x, int y);
344 virtual void rtl_draw(const char *str, int nChars, int x, int y);
345 virtual int has_feature(driver_feature feature);
346 virtual void font(Fl_Font face, Fl_Fontsize fsize);
347 virtual Fl_Font font();
348 virtual Fl_Fontsize size();
349 virtual double width(const char *str, int nChars);
350 virtual double width(unsigned int c);
351 virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
352 virtual int height();
353 virtual int descent();
354 virtual void gc(void*);
355 virtual void *gc(void);
356 virtual uchar **mask_bitmap();
357 // default implementation may be enough
358 virtual float scale_font_for_PostScript(Fl_Font_Descriptor *desc, int s);
359 // default implementation may be enough
360 virtual float scale_bitmap_for_PostScript();
361 // each platform implements these 3 functions its own way
362 virtual void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h);
363 virtual Fl_Region XRectangleRegion(int x, int y, int w, int h);
364 virtual void XDestroyRegion(Fl_Region r);
365 virtual const char* get_font_name(Fl_Font fnum, int* ap);
366 virtual int get_font_sizes(Fl_Font fnum, int*& sizep);
367 virtual Fl_Font set_fonts(const char *name);
368 virtual Fl_Fontdesc* calc_fl_fonts(void);
369 virtual unsigned font_desc_size();
370 virtual const char *font_name(int num);
371 virtual void font_name(int num, const char *name);
372 // Defaut implementation may be enough
373 virtual void overlay_rect(int x, int y, int w , int h);
374 virtual float override_scale();
375 virtual void restore_scale(float);
376 virtual PangoFontDescription* pango_font_description() { return NULL; }
377 virtual void antialias(int state);
378 virtual int antialias();
379 virtual void delete_bitmask(fl_uintptr_t bm);
380};
381
382#ifndef FL_DOXYGEN
383
384/* This class is not part of FLTK's public API.
385 Platforms usually define a derived class called Fl_XXX_Font_Descriptor
386 containing extra platform-specific data/functions.
387 This is a class for an actual system font, with junk to
388 help choose it and info on character sizes. Each Fl_Fontdesc has a
389 linked list of these. These are created the first time each system
390 font/size combination is used.
391 */
392class Fl_Font_Descriptor {
393public:
395 Fl_Font_Descriptor *next;
396 Fl_Fontsize size;
397 Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
398 virtual /* FL_EXPORT */ ~Fl_Font_Descriptor() {}
399 int ascent, descent;
400 unsigned int listbase;// base of display list, 0 = none
401};
402
403// This struct is not part of FLTK's public API.
404struct Fl_Fontdesc {
405 const char *name;
406 char fontname[128]; // "Pretty" font name
407 Fl_Font_Descriptor *first; // linked list of sizes of this style
408};
409
410/* Abstract class Fl_Scalable_Graphics_Driver is platform-independent.
411 It supports the scaling of all graphics coordinates by a
412 float factor helpful to support HiDPI displays.
413 This class does :
414 - compute scaled coordinates
415 - scale the cached offscreen of image objects
416 - scale the pixel arrays used when performing direct image draws
417 - call the member functions of a platform-specific,
418 Fl_Scalable_Graphics_Driver-derived class that do the drawings with adequately
419 scaled coordinates. The member functions are named with the _unscaled suffix.
420 - scale and unscale the clipping region.
421
422 This class is presently used by the X11 and Windows platforms to support HiDPI displays.
423 In the future, it may also be used by other platforms.
424 */
425class FL_EXPORT Fl_Scalable_Graphics_Driver : public Fl_Graphics_Driver {
426 Fl_Fontsize fontsize_; // scale-independent font size value
427public:
428 Fl_Scalable_Graphics_Driver();
429 static int floor(int x, float s);
430 inline int floor(int x) { return Fl_Scalable_Graphics_Driver::floor(x, scale()); }
431protected:
432 int line_width_;
433#if FL_ABI_VERSION >= 10403 // Issue #1214
434 bool is_solid_;
435#endif
436 virtual Fl_Region scale_clip(float f);
437 void unscale_clip(Fl_Region r);
438 void point(int x, int y) FL_OVERRIDE;
439 virtual void point_unscaled(float x, float y);
440 void rect(int x, int y, int w, int h) FL_OVERRIDE;
441 void rectf(int x, int y, int w, int h) FL_OVERRIDE;
442 virtual void rect_unscaled(int x, int y, int w, int h);
443 virtual void rectf_unscaled(int x, int y, int w, int h);
444 void line(int x, int y, int x1, int y1) FL_OVERRIDE;
445 virtual void line_unscaled(int x, int y, int x1, int y1);
446 void line(int x, int y, int x1, int y1, int x2, int y2) FL_OVERRIDE;
447 virtual void line_unscaled(int x, int y, int x1, int y1, int x2, int y2);
448 void xyline(int x, int y, int x1) FL_OVERRIDE;
449 virtual void xyline_unscaled(int x, int y, int x1);
450 void xyline(int x, int y, int x1, int y2) FL_OVERRIDE {Fl_Graphics_Driver::xyline(x, y, x1, y2);}
451 void xyline(int x, int y, int x1, int y2, int x3) FL_OVERRIDE {Fl_Graphics_Driver::xyline(x, y, x1, y2, x3);}
452 void yxline(int x, int y, int y1) FL_OVERRIDE;
453 virtual void yxline_unscaled(int x, int y, int y1);
454 void yxline(int x, int y, int y1, int x2) FL_OVERRIDE {Fl_Graphics_Driver::yxline(x, y, y1, x2);}
455 void yxline(int x, int y, int y1, int x2, int y3) FL_OVERRIDE {Fl_Graphics_Driver::yxline(x, y, y1, x2, y3);}
456 void loop(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE;
457 virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2);
458 void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE;
459 virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
460 void polygon(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE;
461 virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2);
462 void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE;
463 virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
464 void circle(double x, double y, double r) FL_OVERRIDE;
465 virtual void ellipse_unscaled(double xt, double yt, double rx, double ry);
466 void font(Fl_Font face, Fl_Fontsize size) FL_OVERRIDE;
467 Fl_Font font() FL_OVERRIDE;
468 virtual void font_unscaled(Fl_Font face, Fl_Fontsize size);
469 double width(const char *str, int n) FL_OVERRIDE;
470 double width(unsigned int c) FL_OVERRIDE;
471 virtual double width_unscaled(const char *str, int n);
472 virtual double width_unscaled(unsigned int c);
473 Fl_Fontsize size() FL_OVERRIDE;
474 virtual Fl_Fontsize size_unscaled();
475 void text_extents(const char *str, int n, int &dx, int &dy, int &w, int &h) FL_OVERRIDE;
476 virtual void text_extents_unscaled(const char *str, int n, int &dx, int &dy, int &w, int &h);
477 int height() FL_OVERRIDE;
478 int descent() FL_OVERRIDE;
479 virtual int height_unscaled();
480 virtual int descent_unscaled();
481 void draw(const char *str, int n, int x, int y) FL_OVERRIDE;
482 virtual void draw_unscaled(const char *str, int n, int x, int y);
483 void draw(int angle, const char *str, int n, int x, int y) FL_OVERRIDE;
484 virtual void draw_unscaled(int angle, const char *str, int n, int x, int y);
485 void draw(const char *str, int nChars, float x, float y) FL_OVERRIDE;
486 void rtl_draw(const char* str, int n, int x, int y) FL_OVERRIDE;
487 virtual void rtl_draw_unscaled(const char* str, int n, int x, int y);
488 void arc(double x, double y, double r, double start, double end) FL_OVERRIDE;
489 void arc(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE;
490 virtual void arc_unscaled(int x, int y, int w, int h, double a1, double a2);
491 void pie(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE;
492 virtual void pie_unscaled(int x, int y, int w, int h, double a1, double a2);
493 void draw_circle(int x, int y, int d, Fl_Color c) FL_OVERRIDE;
494 void line_style(int style, int width=0, char* dashes=0) FL_OVERRIDE;
495 virtual void line_style_unscaled(int style, int width, char* dashes);
496 void draw_image_rescale(void *buf, Fl_Draw_Image_Cb cb, int X, int Y, int W, int H, int D, int L, bool mono);
497 virtual void draw_image_unscaled(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
498 virtual void draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
499 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) FL_OVERRIDE;
500 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) FL_OVERRIDE;
501 virtual void draw_image_mono_unscaled(const uchar* buf, int x, int y, int w, int h, int d, int l);
502 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) FL_OVERRIDE;
503 virtual void draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
504 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) FL_OVERRIDE;
505
506 void transformed_vertex(double xf, double yf) FL_OVERRIDE;
507 void vertex(double x, double y) FL_OVERRIDE;
508 float override_scale() FL_OVERRIDE;
509 void restore_scale(float) FL_OVERRIDE;
510 virtual void *change_pen_width(int lwidth);
511 virtual void reset_pen_width(void *data);
512};
513#endif // FL_DOXYGEN
514
515#endif // FL_GRAPHICS_DRIVER_H
516
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1063
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1092
Fl_Device.H
declaration of classes Fl_Surface_Device, Fl_Display_Device, Fl_Device_Plugin.
fl_graphics_driver
Fl_Graphics_Driver * fl_graphics_driver
Points to the driver that currently receives all graphics requests.
Definition Fl_Graphics_Driver.cxx:23
Fl_Image.H
Fl_Image, Fl_RGB_Image classes.
Fl_Image_Surface
Directs all graphics requests to an Fl_Image.
Definition Fl_Image_Surface.H:65
Fl_Image::h
void h(int H)
Sets the height of the image data.
Definition Fl_Image.H:93
Fl_Image::w
void w(int W)
Sets the width of the image data.
Definition Fl_Image.H:87
Fl_Image::draw_empty
void draw_empty(int X, int Y)
The protected method draw_empty() draws a box with an X in it.
Definition Fl_Image.cxx:71
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
uchar
unsigned char uchar
unsigned char
Definition fl_types.h:30
gl_start
void gl_start()
Creates an OpenGL context.
Definition gl_start.cxx:58
fl_draw_pixmap
int fl_draw_pixmap(const char *const *cdata, int x, int y, Fl_Color bg=FL_GRAY)
Draw XPM image data, with the top-left corner at the given position.
Definition fl_draw_pixmap.cxx:184
fl_copy_offscreen
void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy)
Copy a rectangular area of the given offscreen buffer into the current drawing destination.
Definition fl_draw.H:784
fl_draw_image
void fl_draw_image(const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)
Draw an 8-bit per color RGB or luminance image.
Definition fl_draw.H:1122
fl_draw_image_mono
void fl_draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D=1, int L=0)
Draw a gray-scale (1 channel) image.
Definition fl_draw.H:1130
Fl_Offscreen
opaque Fl_Offscreen
Platform-specific value representing an offscreen drawing buffer.
Definition platform_types.h:46
fl_uintptr_t
opaque fl_uintptr_t
An unsigned integral type large enough to store a pointer or an unsigned long value.
Definition platform_types.h:36
Fl_Region
struct opaque * Fl_Region
Pointer to a platform-specific structure representing a collection of rectangles.
Definition platform_types.h:56