FLTK 1.3.3

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

Fl_Device.H
Go to the documentation of this file.
1 //
2 // "$Id: Fl_Device.H 10409 2014-10-29 20:11:02Z cand $"
3 //
4 // Definition of classes Fl_Device, Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device
5 // for the Fast Light Tool Kit (FLTK).
6 //
7 // Copyright 2010-2012 by Bill Spitzak and others.
8 //
9 // This library is free software. Distribution and use rights are outlined in
10 // the file "COPYING" which should have been included with this file. If this
11 // file is missing or damaged, see the license at:
12 //
13 // http://www.fltk.org/COPYING.php
14 //
15 // Please report all bugs and problems on the following page:
16 //
17 // http://www.fltk.org/str.php
18 //
19
25 #ifndef Fl_Device_H
26 #define Fl_Device_H
27
28 #include <FL/x.H>
29 #include <FL/Fl_Plugin.H>
30 #include <FL/Fl_Image.H>
31 #include <FL/Fl_Bitmap.H>
32 #include <FL/Fl_Pixmap.H>
33 #include <FL/Fl_RGB_Image.H>
34 #include <stdlib.h>
35
36 class Fl_Graphics_Driver;
37 class Fl_Font_Descriptor;
39 FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
40
49 typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
50
51 // typedef what the x,y fields in a point are:
52 #ifdef WIN32
53 typedef int COORD_T;
54 # define XPOINT XPoint
55 #elif defined(__APPLE__)
56 typedef float COORD_T;
57 typedef struct { float x; float y; } QPoint;
58 # define XPOINT QPoint
59 extern float fl_quartz_line_width_;
60 #else
61 typedef short COORD_T;
62 # define XPOINT XPoint
63 #endif
64
68 class FL_EXPORT Fl_Device {
69 public:
73 static const char *class_id;
83 virtual const char *class_name() {return class_id;};
90 virtual ~Fl_Device() {};
91 };
92
93 #define FL_REGION_STACK_SIZE 10
94 #define FL_MATRIX_STACK_SIZE 32
95
103 class FL_EXPORT Fl_Graphics_Driver : public Fl_Device {
104 public:
107 struct matrix {double a, b, c, d, x, y;};
108 private:
109 static const matrix m0;
110 Fl_Font font_; // current font
111 Fl_Fontsize size_; // current font size
112 Fl_Color color_; // current color
113 int sptr;
114 static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
115 matrix stack[FL_MATRIX_STACK_SIZE];
116 matrix m;
117 int n, p_size, gap_;
118 XPOINT *p;
119 int what;
120 int fl_clip_state_number;
121 int rstackptr;
122 static const int region_stack_max = FL_REGION_STACK_SIZE - 1;
123 Fl_Region rstack[FL_REGION_STACK_SIZE];
124 #ifdef WIN32
125 int numcount;
126 int counts[20];
127 #endif
128 Fl_Font_Descriptor *font_descriptor_;
129 void transformed_vertex0(COORD_T x, COORD_T y);
130 void fixloop();
131
132 protected:
133 #ifndef FL_DOXYGEN
134 enum {LINE, LOOP, POLYGON, POINT_};
135 inline int vertex_no() { return n; }
136 inline XPOINT *vertices() {return p;}
137 inline int vertex_kind() {return what;}
138 #endif
139 /* ** \brief red color for background and/or mixing if device does not support masking or alpha *
140 uchar bg_r_;
141 ** \brief green color for background and/or mixing if device does not support masking or alpha *
142 uchar bg_g_;
143 ** \brief blue color for background and/or mixing if device does not support masking or alpha *
144 uchar bg_b_; */
145 friend class Fl_Pixmap;
146 friend class Fl_Bitmap;
147 friend class Fl_RGB_Image;
148 friend void fl_rect(int x, int y, int w, int h);
149 friend void fl_rectf(int x, int y, int w, int h);
150 friend void fl_line_style(int style, int width, char* dashes);
151 friend void fl_xyline(int x, int y, int x1);
152 friend void fl_xyline(int x, int y, int x1, int y2);
153 friend void fl_xyline(int x, int y, int x1, int y2, int x3);
154 friend void fl_yxline(int x, int y, int y1);
155 friend void fl_yxline(int x, int y, int y1, int x2);
156 friend void fl_yxline(int x, int y, int y1, int x2, int y3);
157 friend void fl_line(int x, int y, int x1, int y1);
158 friend void fl_line(int x, int y, int x1, int y1, int x2, int y2);
159 friend void fl_draw(const char *str, int n, int x, int y);
160 #ifdef __APPLE__
161 friend void fl_draw(const char *str, int n, float x, float y);
162 #endif
163 friend void fl_draw(int angle, const char *str, int n, int x, int y);
164 friend void fl_rtl_draw(const char *str, int n, int x, int y);
165 friend void fl_font(Fl_Font face, Fl_Fontsize size);
166 friend void fl_color(Fl_Color c);
167 friend void fl_color(uchar r, uchar g, uchar b);
168 friend void fl_point(int x, int y);
169 friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2);
170 friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
171 friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2);
172 friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
173 friend void fl_begin_points();
174 friend void fl_begin_line();
175 friend void fl_begin_loop();
176 friend void fl_begin_polygon();
177 friend void fl_vertex(double x, double y);
178 friend void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
179 friend void fl_circle(double x, double y, double r);
180 friend void fl_arc(double x, double y, double r, double start, double end);
181 friend void fl_arc(int x, int y, int w, int h, double a1, double a2);
182 friend void fl_pie(int x, int y, int w, int h, double a1, double a2);
183 friend void fl_end_points();
184 friend void fl_end_line();
185 friend void fl_end_loop();
186 friend void fl_end_polygon();
187 friend void fl_transformed_vertex(double xf, double yf);
188 friend void fl_push_clip(int x, int y, int w, int h);
189 friend int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
190 friend int fl_not_clipped(int x, int y, int w, int h);
191 friend void fl_push_no_clip();
192 friend void fl_pop_clip();
193 friend void fl_begin_complex_polygon();
194 friend void fl_gap();
195 friend void fl_end_complex_polygon();
196 friend void fl_push_matrix();
197 friend void fl_pop_matrix();
198 friend void fl_mult_matrix(double a, double b, double c, double d, double x, double y);
199 friend void fl_scale(double x, double y);
200 friend void fl_scale(double x);
201 friend void fl_translate(double x, double y);
202 friend void fl_rotate(double d);
203 friend double fl_transform_x(double x, double y);
204 friend double fl_transform_y(double x, double y);
205 friend double fl_transform_dx(double x, double y);
206 friend double fl_transform_dy(double x, double y);
207 friend Fl_Region fl_clip_region();
208 friend void fl_clip_region(Fl_Region r);
209 friend void fl_restore_clip();
210
211 friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
212 friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
213 friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
214 friend FL_EXPORT void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
215 friend FL_EXPORT void gl_start();
216 friend void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
217 matrix *fl_matrix;
220 Fl_Graphics_Driver();
222 virtual void rect(int x, int y, int w, int h);
224 virtual void rectf(int x, int y, int w, int h);
226 virtual void line_style(int style, int width=0, char* dashes=0);
228 virtual void xyline(int x, int y, int x1);
230 virtual void xyline(int x, int y, int x1, int y2);
232 virtual void xyline(int x, int y, int x1, int y2, int x3);
234 virtual void yxline(int x, int y, int y1);
236 virtual void yxline(int x, int y, int y1, int x2);
238 virtual void yxline(int x, int y, int y1, int x2, int y3);
240 virtual void line(int x, int y, int x1, int y1);
242 virtual void line(int x, int y, int x1, int y1, int x2, int y2);
244 virtual void draw(const char *str, int n, int x, int y) {}
245 #ifdef __APPLE__
246 virtual void draw(const char *str, int n, float x, float y) { draw(str, n, (int)(x+0.5), (int)(y+0.5));}
247 #endif
248
249 virtual void draw(int angle, const char *str, int n, int x, int y) {}
251 virtual void rtl_draw(const char *str, int n, int x, int y) {};
253 virtual void color(Fl_Color c) {color_ = c;}
255 virtual void color(uchar r, uchar g, uchar b) {}
257 virtual void point(int x, int y);
259 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
261 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
263 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
265 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
267 virtual void begin_points();
269 virtual void begin_line();
271 virtual void begin_loop();
273 virtual void begin_polygon();
275 virtual void vertex(double x, double y);
277 virtual void curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
279 virtual void circle(double x, double y, double r);
281 virtual void arc(double x, double y, double r, double start, double end);
283 virtual void arc(int x, int y, int w, int h, double a1, double a2);
285 virtual void pie(int x, int y, int w, int h, double a1, double a2);
287 virtual void end_points();
289 virtual void end_line();
291 virtual void end_loop();
293 virtual void end_polygon();
295 virtual void begin_complex_polygon();
297 virtual void gap();
299 virtual void end_complex_polygon();
301 virtual void transformed_vertex(double xf, double yf);
303 virtual void push_clip(int x, int y, int w, int h);
305 virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
307 virtual int not_clipped(int x, int y, int w, int h);
309 virtual void push_no_clip();
311 virtual void pop_clip();
312
314 void push_matrix();
316 void pop_matrix();
318 void mult_matrix(double a, double b, double c, double d, double x, double y);
320 inline void scale(double x, double y) { mult_matrix(x,0,0,y,0,0); }
322 inline void scale(double x) { mult_matrix(x,0,0,x,0,0); }
324 inline void translate(double x,double y) { mult_matrix(1,0,0,1,x,y); }
326 void rotate(double d);
328 double transform_x(double x, double y);
330 double transform_y(double x, double y);
332 double transform_dx(double x, double y);
334 double transform_dy(double x, double y);
336 Fl_Region clip_region();
338 void clip_region(Fl_Region r);
340 void restore_clip();
341
342 // Images
344 virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) {}
346 virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) {}
348 virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) {}
350 virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) {}
351 // Image classes
357 virtual void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) {}
363 virtual void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) {}
369 virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {}
370 #if FLTK_ABI_VERSION >= 10301
371 virtual
372 #endif
373 void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
374
375 public:
376 static const char *class_id;
377 virtual const char *class_name() {return class_id;};
379 virtual void font(Fl_Font face, Fl_Fontsize fsize) {font_ = face; size_ = fsize;}
381 Fl_Font font() {return font_; }
383 Fl_Fontsize size() {return size_; }
385 virtual double width(const char *str, int n) {return 0;}
387 virtual inline double width(unsigned int c) { char ch = (char)c; return width(&ch, 1); }
389 virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
391 virtual int height() {return size();}
393 virtual int descent() {return 0;}
395 Fl_Color color() {return color_;}
397 inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
399 inline void font_descriptor(Fl_Font_Descriptor *d) { font_descriptor_ = d;}
401 virtual ~Fl_Graphics_Driver() { if (p) free(p); }
402 };
403
404 #if defined(__APPLE__) || defined(FL_DOXYGEN)
405
410 class FL_EXPORT Fl_Quartz_Graphics_Driver : public Fl_Graphics_Driver {
411 public:
412 static const char *class_id;
413 const char *class_name() {return class_id;};
414 void color(Fl_Color c);
415 void color(uchar r, uchar g, uchar b);
416 void draw(const char* str, int n, int x, int y);
417 #ifdef __APPLE__
418 void draw(const char *str, int n, float x, float y);
419 #endif
420 void draw(int angle, const char *str, int n, int x, int y);
421 void rtl_draw(const char* str, int n, int x, int y);
422 void font(Fl_Font face, Fl_Fontsize size);
423 void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
424 void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
425 void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
426 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
427 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
428 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
429 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
430 double width(const char *str, int n);
431 double width(unsigned int c);
432 void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
433 int height();
434 int descent();
435 #if ! defined(FL_DOXYGEN)
436 static Fl_Offscreen create_offscreen_with_alpha(int w, int h);
437 #endif
438 void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
439 };
440 #endif
441 #if defined(WIN32) || defined(FL_DOXYGEN)
442
447 class FL_EXPORT Fl_GDI_Graphics_Driver : public Fl_Graphics_Driver {
448 public:
449 static const char *class_id;
450 const char *class_name() {return class_id;};
451 void color(Fl_Color c);
452 void color(uchar r, uchar g, uchar b);
453 void draw(const char* str, int n, int x, int y);
454 void draw(int angle, const char *str, int n, int x, int y);
455 void rtl_draw(const char* str, int n, int x, int y);
456 void font(Fl_Font face, Fl_Fontsize size);
457 void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
458 void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
459 void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
460 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
461 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
462 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
463 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
464 double width(const char *str, int n);
465 double width(unsigned int c);
466 void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
467 int height();
468 int descent();
469 #if ! defined(FL_DOXYGEN)
470 void copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy);
471 #endif
472 void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
473 };
474
480 class FL_EXPORT Fl_GDI_Printer_Graphics_Driver : public Fl_GDI_Graphics_Driver {
481 public:
482 static const char *class_id;
483 const char *class_name() {return class_id;};
484 void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
485 void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
486 };
487 #endif
488 #if !(defined(__APPLE__) || defined(WIN32))
489
494 class FL_EXPORT Fl_Xlib_Graphics_Driver : public Fl_Graphics_Driver {
495 public:
496 static const char *class_id;
497 const char *class_name() {return class_id;};
498 void color(Fl_Color c);
499 void color(uchar r, uchar g, uchar b);
500 void draw(const char* str, int n, int x, int y);
501 void draw(int angle, const char *str, int n, int x, int y);
502 void rtl_draw(const char* str, int n, int x, int y);
503 void font(Fl_Font face, Fl_Fontsize size);
504 void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
505 void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
506 void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
507 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
508 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
509 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
510 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
511 double width(const char *str, int n);
512 double width(unsigned int c);
513 void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
514 int height();
515 int descent();
516 void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
517 };
518 #endif
519
523 class FL_EXPORT Fl_Surface_Device : public Fl_Device {
525 Fl_Graphics_Driver *_driver;
526 static Fl_Surface_Device *_surface; // the surface that currently receives graphics output
527 protected:
529 Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver; };
530 public:
531 static const char *class_id;
532 const char *class_name() {return class_id;};
533 virtual void set_current(void);
535 inline void driver(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver;};
537 inline Fl_Graphics_Driver *driver() {return _driver; };
539 static inline Fl_Surface_Device *surface() {return _surface; };
541 virtual ~Fl_Surface_Device() {}
542 };
543
547 class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
548 static Fl_Display_Device *_display; // the platform display device
549 public:
550 static const char *class_id;
551 const char *class_name() {return class_id;};
553 Fl_Display_Device(Fl_Graphics_Driver *graphics_driver);
555 static inline Fl_Display_Device *display_device() {return _display;};
556 };
557
563 class FL_EXPORT Fl_Device_Plugin : public Fl_Plugin {
564 public:
566 Fl_Device_Plugin(const char *pluginName)
567 : Fl_Plugin(klass(), pluginName) { }
569 virtual const char *klass() { return "fltk:device"; }
571 virtual const char *name() = 0;
577 virtual int print(Fl_Widget* w, int x, int y, int height) = 0;
578 };
579
580 #endif // Fl_Device_H
581
582 //
583 // End of "$Id: Fl_Device.H 10409 2014-10-29 20:11:02Z cand $".
584 //
Fl_Widget
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:100
Fl_Graphics_Driver::color
virtual void color(uchar r, uchar g, uchar b)
see fl_color(uchar r, uchar g, uchar b).
Definition: Fl_Device.H:255
fl_end_complex_polygon
void fl_end_complex_polygon()
Ends complex filled polygon, and draws.
Definition: fl_draw.H:466
fl_loop
void fl_loop(int x, int y, int x1, int y1, int x2, int y2)
Outlines a 3-sided polygon with lines.
Definition: fl_draw.H:233
fl_transform_dx
double fl_transform_dx(double x, double y)
Transforms distance using current transformation matrix.
Definition: fl_draw.H:482
Fl_Device_Plugin::klass
virtual const char * klass()
Returns the class name.
Definition: Fl_Device.H:569
Fl_Surface_Device::~Fl_Surface_Device
virtual ~Fl_Surface_Device()
The destructor.
Definition: Fl_Device.H:541
fl_clip_box
int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
Intersects the rectangle with the current clip region and returns the bounding box of the result...
Definition: fl_draw.H:126
Fl_Pixmap
The Fl_Pixmap class supports caching and drawing of colormap (pixmap) images, including transparency...
Definition: Fl_Pixmap.H:41
fl_point
void fl_point(int x, int y)
Draws a single pixel at the given coordinates.
Definition: fl_draw.H:147
Fl_Surface_Device::class_name
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:532
fl_clip_region
void fl_clip_region(Fl_Region r)
Replaces the top of the clipping stack with a clipping region of any shape.
Definition: fl_draw.H:136
Fl_Graphics_Driver::text_extents
virtual void text_extents(const char *, int n, int &dx, int &dy, int &w, int &h)
see fl_text_extents(const char*, int n, int& dx, int& dy, int& w, int& h).
Definition: Fl_Device.cxx:64
fl_push_matrix
void fl_push_matrix()
Saves the current transformation matrix on the stack.
Definition: fl_draw.H:326
Fl_Surface_Device
A surface that's susceptible to receive graphical output.
Definition: Fl_Device.H:523
fl_transformed_vertex
void fl_transformed_vertex(double xf, double yf)
Adds coordinate pair to the vertex list without further transformations.
Definition: fl_draw.H:492
fl_gap
void fl_gap()
Call fl_gap() to separate loops of the path.
Definition: fl_draw.H:462
fl_not_clipped
int fl_not_clipped(int x, int y, int w, int h)
Does the rectangle intersect the current clip region?
Definition: fl_draw.H:114
Fl_Device::class_id
static const char * class_id
A string that identifies each subclass of Fl_Device.
Definition: Fl_Device.H:73
fl_rotate
void fl_rotate(double d)
Concatenates rotation transformation onto the current one.
Definition: fl_draw.H:350
fl_draw_image
void fl_draw_image(const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)
Draws an 8-bit per color RGB or luminance image.
Definition: fl_draw.H:680
fl_color
void fl_color(Fl_Color c)
Sets the color for all subsequent drawing operations.
Definition: fl_draw.H:52
Fl_Graphics_Driver::draw_image_mono
virtual void draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D=1, int L=0)
see fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L).
Definition: Fl_Device.H:346
Fl_Device::class_name
virtual const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:83
Fl_Graphics_Driver::draw_image_mono
virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=1)
see fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D)...
Definition: Fl_Device.H:350
Fl_Graphics_Driver::size
Fl_Fontsize size()
see fl_size().
Definition: Fl_Device.H:383
Fl_Font_Descriptor
This a structure for an actual system font, with junk to help choose it and info on character sizes...
Definition: Fl_Font.H:41
gl_start
FL_EXPORT void gl_start()
Creates an OpenGL context.
Definition: gl_start.cxx:56
Fl_Draw_Image_Cb
void(* Fl_Draw_Image_Cb)(void *data, int x, int y, int w, uchar *buf)
signature of image generation callback function.
Definition: Fl_Device.H:49
Fl_Graphics_Driver::draw
virtual void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_Pixmap object to the device.
Definition: Fl_Device.H:363
fl_begin_polygon
void fl_begin_polygon()
Starts drawing a convex filled polygon.
Definition: fl_draw.H:374
fl_begin_complex_polygon
void fl_begin_complex_polygon()
Starts drawing a complex filled polygon.
Definition: fl_draw.H:455
fl_pop_clip
void fl_pop_clip()
Restores the previous clip region.
Definition: fl_draw.H:103
Fl_Quartz_Graphics_Driver
The Mac OS X-specific graphics class.
Definition: Fl_Device.H:410
fl_begin_line
void fl_begin_line()
Starts drawing a list of lines.
Definition: fl_draw.H:366
Fl_Surface_Device::driver
void driver(Fl_Graphics_Driver *graphics_driver)
Sets the graphics driver of this drawing surface.
Definition: Fl_Device.H:535
Fl_Display_Device::display_device
static Fl_Display_Device * display_device()
Returns the platform display device.
Definition: Fl_Device.H:555
Fl_Image.H
Fl_Image, Fl_RGB_Image classes.
Fl_Graphics_Driver::scale
void scale(double x)
see fl_scale(double x).
Definition: Fl_Device.H:322
Fl_RGB_Image
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:183
Fl_Graphics_Driver::copy_offscreen
void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy)
see fl_copy_offscreen()
Definition: Fl_Double_Window.cxx:121
Fl_Graphics_Driver::rtl_draw
virtual void rtl_draw(const char *str, int n, int x, int y)
see fl_rtl_draw(const char *str, int n, int x, int y).
Definition: Fl_Device.H:251
Fl_RGB_Image::draw
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0)
Draws the image with a bounding box.
Definition: Fl_Image.cxx:523
fl_end_line
void fl_end_line()
Ends list of lines, and draws.
Definition: fl_draw.H:432
Fl_Graphics_Driver::height
virtual int height()
see fl_height().
Definition: Fl_Device.H:391
Fl_Graphics_Driver::font_descriptor
Fl_Font_Descriptor * font_descriptor()
Returns a pointer to the current Fl_Font_Descriptor for the graphics driver.
Definition: Fl_Device.H:397
Fl_Graphics_Driver::draw
virtual void draw(int angle, const char *str, int n, int x, int y)
see fl_draw(int angle, const char *str, int n, int x, int y).
Definition: Fl_Device.H:249
fl_end_loop
void fl_end_loop()
Ends closed sequence of lines, and draws.
Definition: fl_draw.H:436
fl_curve
void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
Adds a series of points on a Bezier curve to the path.
Definition: fl_draw.H:388
fl_graphics_driver
FL_EXPORT Fl_Graphics_Driver * fl_graphics_driver
Points to the driver that currently receives all graphics requests.
Definition: Fl_Device.cxx:46
Fl_Xlib_Graphics_Driver
The Xlib-specific graphics class.
Definition: Fl_Device.H:494
Fl_Graphics_Driver::fl_matrix
matrix * fl_matrix
Points to the current coordinate transformation matrix.
Definition: Fl_Device.H:217
Fl_Graphics_Driver::descent
virtual int descent()
see fl_descent().
Definition: Fl_Device.H:393
Fl_Display_Device::class_name
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:551
fl_transform_dy
double fl_transform_dy(double x, double y)
Transforms distance using current transformation matrix.
Definition: fl_draw.H:487
fl_end_polygon
void fl_end_polygon()
Ends convex filled polygon, and draws.
Definition: fl_draw.H:440
Fl_GDI_Graphics_Driver::draw
void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
Fl_Graphics_Driver::color
Fl_Color color()
see fl_color(void).
Definition: Fl_Device.H:395
fl_mult_matrix
void fl_mult_matrix(double a, double b, double c, double d, double x, double y)
Concatenates another transformation onto the current one.
Definition: fl_draw.H:357
fl_begin_points
void fl_begin_points()
Starts drawing a list of points.
Definition: fl_draw.H:362
fl_line_style
void fl_line_style(int style, int width=0, char *dashes=0)
Sets how to draw lines (the "pen").
Definition: fl_draw.H:177
fl_transform_x
double fl_transform_x(double x, double y)
Transforms coordinate using the current transformation matrix.
Definition: fl_draw.H:472
fl_scale
void fl_scale(double x, double y)
Concatenates scaling transformation onto the current one.
Definition: fl_draw.H:335
Fl_GDI_Graphics_Driver::class_name
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:450
Fl_Graphics_Driver::width
virtual double width(unsigned int c)
see fl_width(unsigned int n).
Definition: Fl_Device.H:387
fl_end_points
void fl_end_points()
Ends list of points, and draws.
Definition: fl_draw.H:428
Fl_Graphics_Driver::font
Fl_Font font()
see fl_font(void).
Definition: Fl_Device.H:381
Fl_Device_Plugin
This plugin socket allows the integration of new device drivers for special window or screen types...
Definition: Fl_Device.H:563
Fl_Image::data
const char *const * data() const
Returns a pointer to the current image data array.
Definition: Fl_Image.H:120
Fl_Surface_Device::Fl_Surface_Device
Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver)
Constructor that sets the graphics driver to use for the created surface.
Definition: Fl_Device.H:529
Fl_Graphics_Driver::matrix
A 2D coordinate transformation matrix.
Definition: Fl_Device.H:107
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:768
Fl_Surface_Device::surface
static Fl_Surface_Device * surface()
the surface that currently receives graphics output
Definition: Fl_Device.H:539
Fl_Plugin
Fl_Plugin allows link-time and run-time integration of binary modules.
Definition: Fl_Plugin.H:61
fl_rectf
void fl_rectf(int x, int y, int w, int h)
Colors with current color a rectangle that exactly fills the given bounding box.
Definition: fl_draw.H:206
Fl_Graphics_Driver::font
virtual void font(Fl_Font face, Fl_Fontsize fsize)
see fl_font(Fl_Font face, Fl_Fontsize size).
Definition: Fl_Device.H:379
fl_draw
FL_EXPORT void fl_draw(const char *str, int x, int y)
Draws a nul-terminated UTF-8 string starting at the given x, y location.
Definition: fl_font.cxx:64
Fl_Graphics_Driver::translate
void translate(double x, double y)
see fl_translate(double x, double y).
Definition: Fl_Device.H:324
fl_begin_loop
void fl_begin_loop()
Starts drawing a closed sequence of lines.
Definition: fl_draw.H:370
Fl_Graphics_Driver::~Fl_Graphics_Driver
virtual ~Fl_Graphics_Driver()
The destructor.
Definition: Fl_Device.H:401
Fl_Device::~Fl_Device
virtual ~Fl_Device()
Virtual destructor.
Definition: Fl_Device.H:90
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)
Draws a gray-scale (1 channel) image.
Definition: fl_draw.H:687
Fl_GDI_Printer_Graphics_Driver::class_name
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:483
Fl_Image::d
int d() const
Returns the current image depth.
Definition: Fl_Image.H:102
fl_yxline
void fl_yxline(int x, int y, int y1)
Draws a vertical line from (x,y) to (x,y1)
Definition: fl_draw.H:270
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:796
fl_push_no_clip
void fl_push_no_clip()
Pushes an empty clip region onto the stack so nothing will be clipped.
Definition: fl_draw.H:95
fl_transform_y
double fl_transform_y(double x, double y)
Transforms coordinate using the current transformation matrix.
Definition: fl_draw.H:477
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:739
Fl_Graphics_Driver::draw_image
virtual void draw_image(const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)
see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L).
Definition: Fl_Device.H:344
Fl_Graphics_Driver
A virtual class subclassed for each graphics driver FLTK uses.
Definition: Fl_Device.H:103
fl_translate
void fl_translate(double x, double y)
Concatenates translation transformation onto the current one.
Definition: fl_draw.H:345
Fl_Image::w
int w() const
Returns the current image width in pixels.
Definition: Fl_Image.H:93
Fl_Graphics_Driver::scale
void scale(double x, double y)
see fl_scale(double x, double y).
Definition: Fl_Device.H:320
fl_vertex
void fl_vertex(double x, double y)
Adds a single vertex to the current path.
Definition: fl_draw.H:379
Fl_Bitmap
The Fl_Bitmap class supports caching and drawing of mono-color (bitmap) images.
Definition: Fl_Bitmap.H:33
fl_pop_matrix
void fl_pop_matrix()
Restores the current transformation matrix from the stack.
Definition: fl_draw.H:330
fl_polygon
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)
Fills a 3-sided polygon.
Definition: fl_draw.H:244
Fl_Graphics_Driver::color
virtual void color(Fl_Color c)
see fl_color(Fl_Color c).
Definition: Fl_Device.H:253
Fl_Graphics_Driver::draw
virtual void draw(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_RGB_Image object to the device.
Definition: Fl_Device.H:357
fl_xyline
void fl_xyline(int x, int y, int x1)
Draws a horizontal line from (x,y) to (x1,y)
Definition: fl_draw.H:255
Fl_Image::h
int h() const
Returns the current image height in pixels.
Definition: Fl_Image.H:96
fl_restore_clip
void fl_restore_clip()
Undoes any clobbering of clip done by your program.
Definition: fl_draw.H:129
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_Double_Window.cxx:98
Fl_Device_Plugin::Fl_Device_Plugin
Fl_Device_Plugin(const char *pluginName)
The constructor.
Definition: Fl_Device.H:566
Fl_GDI_Printer_Graphics_Driver
The graphics driver used when printing on MSWindows.
Definition: Fl_Device.H:480
fl_rtl_draw
void fl_rtl_draw(const char *str, int n, int x, int y)
Draws a UTF-8 string of length n bytes right to left starting at the given x, y location.
Definition: fl_draw.H:627
fl_line
void fl_line(int x, int y, int x1, int y1)
Draws a line from (x,y) to (x1,y1)
Definition: fl_draw.H:223
Fl_Xlib_Graphics_Driver::class_name
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:497
fl_arc
void fl_arc(int x, int y, int w, int h, double a1, double a2)
Draw ellipse sections using integer coordinates.
Definition: fl_draw.H:304
Fl_Graphics_Driver::draw
virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_Bitmap object to the device.
Definition: Fl_Device.H:369
Fl_GDI_Graphics_Driver
The MSWindows-specific graphics class.
Definition: Fl_Device.H:447
Fl_Display_Device
A display to which the computer can draw.
Definition: Fl_Device.H:547
Fl_Graphics_Driver::width
virtual double width(const char *str, int n)
see fl_width(const char *str, int n).
Definition: Fl_Device.H:385
Fl_Graphics_Driver::font_descriptor
void font_descriptor(Fl_Font_Descriptor *d)
Sets the current Fl_Font_Descriptor for the graphics driver.
Definition: Fl_Device.H:399
Fl_Quartz_Graphics_Driver::class_name
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:413
Fl_Graphics_Driver::draw
virtual void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
Definition: Fl_Device.H:244
uchar
unsigned char uchar
unsigned char
Definition: fl_types.h:30
fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Sets the current font, which is then used in various drawing routines.
Definition: fl_draw.H:509
fl_rect
void fl_rect(int x, int y, int w, int h)
Draws a 1-pixel border inside the given bounding box.
Definition: fl_draw.H:201
Fl_Graphics_Driver::draw_image
virtual void draw_image(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=3)
see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D).
Definition: Fl_Device.H:348
fl_push_clip
void fl_push_clip(int x, int y, int w, int h)
Intersects the current clip region with a rectangle and pushes this new region onto the stack...
Definition: fl_draw.H:82
fl_pie
void fl_pie(int x, int y, int w, int h, double a1, double a2)
Draw filled ellipse sections using integer coordinates.
Definition: fl_draw.H:317
Fl_Surface_Device::driver
Fl_Graphics_Driver * driver()
Returns the graphics driver of this drawing surface.
Definition: Fl_Device.H:537
Fl_Device
All graphical output devices and all graphics systems.
Definition: Fl_Device.H:68
Fl_Graphics_Driver::class_name
virtual const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:377
fl_circle
void fl_circle(double x, double y, double r)
fl_circle() is equivalent to fl_arc(x,y,r,0,360), but may be faster.
Definition: fl_draw.H:424
- © 1998-2014 by Bill Spitzak and others.