NTK 1.3.0
Fl_Device.H
Go to the documentation of this file.
1//
2// "$Id: Fl_Device.H 8529 2011-03-23 12:49:30Z AlbrechtS $"
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-2011 by Bill Spitzak and others.
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Library General Public
11// License as published by the Free Software Foundation; either
12// version 2 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Library General Public License for more details.
18//
19// You should have received a copy of the GNU Library General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22// USA.
23//
24// Please report all bugs and problems on the following page:
25//
26// http://www.fltk.org/str.php
27//
33#ifndef Fl_Device_H
34#define Fl_Device_H
35
36#include <FL/x.H>
37#include <FL/Fl_Plugin.H>
38#include <FL/Fl_Image.H>
39#include <FL/Fl_Bitmap.H>
40#include <FL/Fl_Pixmap.H>
41#include <FL/Fl_RGB_Image.H>
42
43#include <FL/Fl_Cairo.H>
44
49
58typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
59
60// typedef what the x,y fields in a point are:
61#ifdef WIN32
62typedef int COORD_T;
63# define XPOINT XPoint
64#elif defined(__APPLE__)
65typedef float COORD_T;
66typedef struct { float x; float y; } QPoint;
67# define XPOINT QPoint
68extern float fl_quartz_line_width_;
69#else
70typedef short COORD_T;
71# define XPOINT XPoint
72#endif
73
77class FL_EXPORT Fl_Device {
78public:
82 static const char *class_id;
90 virtual const char *class_name() {return class_id;};
97 virtual ~Fl_Device() {};
98};
99
100#define FL_REGION_STACK_SIZE 10
101#define FL_MATRIX_STACK_SIZE 32
110class FL_EXPORT Fl_Graphics_Driver : public Fl_Device {
111public:
114 struct matrix {double a, b, c, d, x, y;};
115private:
116 static const matrix m0;
117 static Fl_Font font_; // current font
118 static Fl_Fontsize size_; // current font size
119 static Fl_Color color_; // current color
120 static int sptr;
121 static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
122 static matrix stack[FL_MATRIX_STACK_SIZE];
123 static matrix m;
124protected:
125 enum {LINE, LOOP, POLYGON, POINT_};
126 static int n;
127 static int p_size;
128 static int gap_;
129 static XPOINT *p;
130 static int what;
131private:
132 static int fl_clip_state_number;
133 static int rstackptr;
134 static const int region_stack_max = FL_REGION_STACK_SIZE - 1;
135 static Fl_Region rstack[FL_REGION_STACK_SIZE];
136#ifdef WIN32
137 int numcount;
138 int counts[20];
139#endif
140 Fl_Font_Descriptor *font_descriptor_;
141
142public:
143
146protected:
147 void transformed_vertex0(COORD_T x, COORD_T y);
148 void fixloop();
149
150/* ** \brief red color for background and/or mixing if device does not support masking or alpha *
151 uchar bg_r_;
152 ** \brief green color for background and/or mixing if device does not support masking or alpha *
153 uchar bg_g_;
154 ** \brief blue color for background and/or mixing if device does not support masking or alpha *
155 uchar bg_b_; */
156 friend class Fl_Pixmap;
157 friend class Fl_Bitmap;
158 friend class Fl_RGB_Image;
159 friend void fl_rect(int x, int y, int w, int h);
160 friend void fl_rectf(int x, int y, int w, int h);
161 friend void fl_line_style(int style, int width, char* dashes);
162 friend void fl_xyline(int x, int y, int x1);
163 friend void fl_xyline(int x, int y, int x1, int y2);
164 friend void fl_xyline(int x, int y, int x1, int y2, int x3);
165 friend void fl_yxline(int x, int y, int y1);
166 friend void fl_yxline(int x, int y, int y1, int x2);
167 friend void fl_yxline(int x, int y, int y1, int x2, int y3);
168 friend void fl_line(int x, int y, int x1, int y1);
169 friend void fl_line(int x, int y, int x1, int y1, int x2, int y2);
170 friend void fl_draw(const char *str, int n, int x, int y);
171#ifdef __APPLE__
172 friend void fl_draw(const char *str, int n, float x, float y);
173#endif
174 friend void fl_draw(int angle, const char *str, int n, int x, int y);
175 friend void fl_rtl_draw(const char *str, int n, int x, int y);
176 friend void fl_font(Fl_Font face, Fl_Fontsize size);
177 friend void fl_color(Fl_Color c);
178 friend void fl_color(uchar r, uchar g, uchar b);
179 friend void fl_point(int x, int y);
180 friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2);
181 friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
182 friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2);
183 friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
184 friend void fl_begin_points();
185 friend void fl_begin_line();
186 friend void fl_begin_loop();
187 friend void fl_begin_polygon();
188 friend void fl_vertex(double x, double y);
189 friend void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
190 friend void fl_circle(double x, double y, double r);
191 friend void fl_arc(double x, double y, double r, double start, double end);
192 friend void fl_arc(int x, int y, int w, int h, double a1, double a2);
193 friend void fl_pie(int x, int y, int w, int h, double a1, double a2);
194 friend void fl_end_points();
195 friend void fl_end_line();
196 friend void fl_end_loop();
197 friend void fl_end_polygon();
198 friend void fl_transformed_vertex(double xf, double yf);
199 friend void fl_push_clip(int x, int y, int w, int h);
200 friend int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
201 friend int fl_not_clipped(int x, int y, int w, int h);
202 friend void fl_push_no_clip();
203 friend void fl_pop_clip();
204 friend void fl_begin_complex_polygon();
205 friend void fl_gap();
206 friend void fl_end_complex_polygon();
207 friend void fl_push_matrix();
208 friend void fl_pop_matrix();
209 friend void fl_mult_matrix(double a, double b, double c, double d, double x, double y );
210 friend void fl_scale(double x, double y);
211 friend void fl_scale(double x);
212 friend void fl_translate(double x, double y);
213 friend void fl_rotate(double d);
214 friend double fl_transform_x(double x, double y);
215 friend double fl_transform_y(double x, double y);
216 friend double fl_transform_dx(double x, double y);
217 friend double fl_transform_dy(double x, double y);
218 friend Fl_Region fl_clip_region();
219 friend void fl_clip_region(Fl_Region r);
220 friend void fl_restore_clip();
221
222 friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
223 friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
224 friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
225 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);
226 friend FL_EXPORT void gl_start();
227
231 virtual void rect(int x, int y, int w, int h);
233 virtual void rectf(int x, int y, int w, int h);
235 virtual void line_style(int style, int width=0, char* dashes=0);
237 virtual void xyline(int x, int y, int x1);
239 virtual void xyline(int x, int y, int x1, int y2);
241 virtual void xyline(int x, int y, int x1, int y2, int x3);
243 virtual void yxline(int x, int y, int y1);
245 virtual void yxline(int x, int y, int y1, int x2);
247 virtual void yxline(int x, int y, int y1, int x2, int y3);
249 virtual void line(int x, int y, int x1, int y1);
251 virtual void line(int x, int y, int x1, int y1, int x2, int y2);
253 virtual void draw(const char *str, int n, int x, int y) = 0;
254#ifdef __APPLE__
255 virtual void draw(const char *str, int n, float x, float y) = 0;
256#endif
258 virtual void draw(int angle, const char *str, int n, int x, int y) = 0;
260 virtual void rtl_draw(const char *str, int n, int x, int y) = 0;
262 virtual void color(Fl_Color c) {color_ = c;}
264 virtual void color(uchar r, uchar g, uchar b) = 0;
266 virtual void point(int x, int y);
268 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
270 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
272 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
274 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
276 virtual void begin_points();
278 virtual void begin_line();
280 virtual void begin_loop();
282 virtual void begin_polygon();
284 virtual void vertex(double x, double y);
286 virtual void curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
288 virtual void circle(double x, double y, double r);
290 virtual void arc(double x, double y, double r, double start, double end);
292 virtual void arc(int x, int y, int w, int h, double a1, double a2);
294 virtual void pie(int x, int y, int w, int h, double a1, double a2);
296 virtual void end_points();
298 virtual void end_line();
300 virtual void end_loop();
302 virtual void end_polygon();
304 virtual void begin_complex_polygon();
306 virtual void gap();
308 virtual void end_complex_polygon();
310 virtual void transformed_vertex(double xf, double yf);
312 virtual void push_clip(int x, int y, int w, int h);
314 virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
316 virtual int not_clipped(int x, int y, int w, int h);
318 virtual void push_no_clip();
320 virtual void pop_clip();
321
323 virtual void push_matrix();
325 virtual void pop_matrix();
327 virtual void mult_matrix(double a, double b, double c, double d, double x, double y);
329 virtual void scale(double x, double y) { mult_matrix(x,0,0,y,0,0); }
331 virtual void scale(double x) { scale( x, x ); }
333 virtual void translate(double x,double y) { mult_matrix(1,0,0,1,x,y); }
335 virtual void rotate(double d);
337 double transform_x(double x, double y);
339 double transform_y(double x, double y);
341 double transform_dx(double x, double y);
343 double transform_dy(double x, double y);
345 Fl_Region clip_region();
347 void clip_region(Fl_Region r);
349 virtual void restore_clip();
350
351 // Images
353 virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) = 0;
355 virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) = 0;
357 virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) = 0;
359 virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) = 0;
360 // Image classes
366 virtual void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) = 0;
372 virtual void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) = 0;
378 virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) = 0;
379
380public:
381 static const char *class_id;
382 virtual const char *class_name() {return class_id;};
384 virtual void font(Fl_Font face, Fl_Fontsize size) {font_ = face; size_ = size;}
386 Fl_Font font() {return font_; }
388 Fl_Fontsize size() {return size_; }
390 virtual double width(const char *str, int n) = 0;
392 virtual inline double width(unsigned int c) { char ch = (char)c; return width(&ch, 1); }
394 virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
396 virtual int height() = 0;
398 virtual int descent() = 0;
400 Fl_Color color() {return color_;}
402 inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
404 inline void font_descriptor(Fl_Font_Descriptor *d) { font_descriptor_ = d;}
407};
408
409#if defined(__APPLE__) || defined(FL_DOXYGEN)
416public:
417 static const char *class_id;
418 const char *class_name() {return class_id;};
419 void color(Fl_Color c);
420 void color(uchar r, uchar g, uchar b);
421 void draw(const char* str, int n, int x, int y);
422#ifdef __APPLE__
423 void draw(const char *str, int n, float x, float y);
424#endif
425 void draw(int angle, const char *str, int n, int x, int y);
426 void rtl_draw(const char* str, int n, int x, int y);
427 void font(Fl_Font face, Fl_Fontsize size);
428 void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
429 void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
430 void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
431 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
432 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
433 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
434 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
435 double width(const char *str, int n);
436 double width(unsigned int c);
437 void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
438 int height();
439 int descent();
440};
441#endif
442#if defined(WIN32) || defined(FL_DOXYGEN)
449public:
450 static const char *class_id;
451 const char *class_name() {return class_id;};
452 void color(Fl_Color c);
453 void color(uchar r, uchar g, uchar b);
454 void draw(const char* str, int n, int x, int y);
455 void draw(int angle, const char *str, int n, int x, int y);
456 void rtl_draw(const char* str, int n, int x, int y);
457 void font(Fl_Font face, Fl_Fontsize size);
458 void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
459 void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
460 void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
461 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
462 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
463 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
464 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
465 double width(const char *str, int n);
466 double width(unsigned int c);
467 void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
468 int height();
469 int descent();
470};
471#endif
472#if !(defined(__APPLE__) || defined(WIN32))
479public:
480 static const char *class_id;
481 const char *class_name() {return class_id;};
482 virtual void color(Fl_Color c);
483 virtual void color(uchar r, uchar g, uchar b);
484 void draw(const char* str, int n, int x, int y);
485 void draw(int angle, const char *str, int n, int x, int y);
486 void rtl_draw(const char* str, int n, int x, int y);
488 void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
489 void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
490 void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
491 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
492 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
493 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
494 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
495 double width(const char *str, int n);
496 double width(unsigned int c);
497 void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
498 int height();
499 int descent();
500};
501
503
504 static cairo_matrix_t m;
505 static cairo_matrix_t stack[FL_MATRIX_STACK_SIZE];
506 static int sptr;
507
508public:
509
510 static const char *class_id;
511
512// void set_current(void);
513
515
516 /* static const char *class_id; */
517 /* const char *class_name() {return class_id;}; */
518
519 void color(Fl_Color c);
520 void color(uchar r, uchar g, uchar b);
521
522 void color ( Fl_Color c, uchar a );
523 void color (uchar r, uchar g, uchar b, uchar a );
524
525 void line_style(int style, int width=0, char* dashes=0);
526
527 void arc( int x, int y, int w, int h, double a1, double a2 );
528 void pie( int x, int y, int w, int h, double a1, double a2 );
529 void arc( double x, double y, double r, double a1, double a2 );
530 void line( int x1, int y1, int x2, int y2 );
531 void line( int x1, int y1, int x2, int y2, int x3, int y3 );
532 void rect ( int x, int y, int w, int h );
533 void end_points ( void );
534 void rectf ( int x, int y, int w, int h );
535 void circle ( double x, double y, double r );
536 void end_line ( void );
537 void end_loop ( void );
538 void end_complex_polygon ( void );
539 void end_polygon ( void );
540 void curve( double x, double y, double x1, double y1, double x2, double y2, double x3, double y3 );
541 void gap();
542
543 void loop ( int x, int y, int x1, int y1, int x2, int y2 );
544 void polygon ( int x, int y, int x1, int y1, int x2, int y2 );
545 void loop ( int x, int y, int x1, int y1, int x2, int y2, int x3, int y3 );
546 void polygon ( int x, int y, int x1, int y1, int x2, int y2, int x3, int y3 );
547 void xyline(int x, int y, int x1);
548 void xyline(int x, int y, int x1, int y2);
549 void xyline(int x, int y, int x1, int y2, int x3);
550 void yxline(int x, int y, int y1);
551 void yxline(int x, int y, int y1, int x2);
552 void yxline(int x, int y, int y1, int x2, int y3);
553
554
555 virtual void begin_points();
556 virtual void begin_line();
557 virtual void begin_loop();
558 virtual void begin_polygon();
559 virtual void begin_complex_polygon();
560
561 void vertex( double x, double y );
562 virtual void push_matrix();
563 virtual void pop_matrix();
564 virtual void mult_matrix(double a, double b, double c, double d, double x, double y);
565 virtual void rotate(double d);
566 virtual void scale(double x, double y);
567 virtual void translate(double x,double y);
568
569 /* void draw(const char* str, int n, int x, int y); */
570 /* void draw(int angle, const char *str, int n, int x, int y); */
571 /* void rtl_draw(const char* str, int n, int x, int y); */
572 /* void font(Fl_Font face, Fl_Fontsize size); */
573 /* void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy); */
574 /* void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy); */
575 void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
576 /* void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0); */
577 /* void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3); */
578 /* void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0); */
579 /* void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1); */
580 /* double width(const char *str, int n); */
581 /* double width(unsigned int c); */
582 /* void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h); */
583 /* int height(); */
584 /* int descent(); */
585
586};
587#endif
588
592class FL_EXPORT Fl_Surface_Device : public Fl_Device {
594 Fl_Graphics_Driver *_driver;
595public:
596 static Fl_Surface_Device *_surface; // the surface that currently receives graphics output
597protected:
599 Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver; };
600public:
601 static const char *class_id;
602 const char *class_name() {return class_id;};
603 virtual void set_current(void);
605 inline void driver(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver;};
607 inline Fl_Graphics_Driver *driver() {return _driver; };
609 static inline Fl_Surface_Device *surface() {return _surface; };
612};
613
617class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
618public:
619static Fl_Display_Device *_display; // the platform display device
620public:
621 static const char *class_id;
622 const char *class_name() {return class_id;};
624 Fl_Display_Device(Fl_Graphics_Driver *graphics_driver);
626 static inline Fl_Display_Device *display_device() {return _display;};
627};
628
634class FL_EXPORT Fl_Device_Plugin : public Fl_Plugin {
635public:
637 Fl_Device_Plugin(const char *name)
638 : Fl_Plugin(klass(), name) { }
640 virtual const char *klass() { return "fltk:device"; }
642 virtual const char *name() = 0;
648 virtual int print(Fl_Widget* w, int x, int y, int height) = 0;
649};
650
651#endif // Fl_Device_H
652
653//
654// End of "$Id: Fl_Device.H 8529 2011-03-23 12:49:30Z AlbrechtS $".
655//
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:707
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:764
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:736
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:58
FL_EXPORT Fl_Graphics_Driver * fl_graphics_driver
Points to the driver that currently receives all graphics requests.
The Fl_Bitmap class supports caching and drawing of mono-color (bitmap) images.
Definition: Fl_Bitmap.H:42
Definition: Fl_Device.H:502
void pie(int x, int y, int w, int h, double a1, double a2)
see fl_pie(int x, int y, int w, int h, double a1, double a2).
Definition: Fl_Cairo_Graphics_Driver.cxx:438
void line(int x1, int y1, int x2, int y2)
see fl_line(int x, int y, int x1, int y1).
Definition: Fl_Cairo_Graphics_Driver.cxx:451
void xyline(int x, int y, int x1)
see fl_xyline(int x, int y, int x1).
Definition: Fl_Cairo_Graphics_Driver.cxx:753
virtual void begin_points()
see fl_begin_points().
Definition: Fl_Cairo_Graphics_Driver.cxx:571
void end_polygon(void)
see fl_end_polygon().
Definition: Fl_Cairo_Graphics_Driver.cxx:679
void rectf(int x, int y, int w, int h)
see fl_rectf(int x, int y, int w, int h).
Definition: Fl_Cairo_Graphics_Driver.cxx:546
virtual void begin_complex_polygon()
see fl_begin_complex_polygon().
Definition: Fl_Cairo_Graphics_Driver.cxx:589
virtual void pop_matrix()
see fl_pop_matrix().
Definition: Fl_Cairo_Graphics_Driver.cxx:170
virtual void begin_loop()
see fl_begin_loop().
Definition: Fl_Cairo_Graphics_Driver.cxx:583
void end_complex_polygon(void)
see fl_end_complex_polygon().
Definition: Fl_Cairo_Graphics_Driver.cxx:660
void polygon(int x, int y, int x1, int y1, int x2, int y2)
see fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2).
Definition: Fl_Cairo_Graphics_Driver.cxx:706
void rect(int x, int y, int w, int h)
see fl_rect(int x, int y, int w, int h).
Definition: Fl_Cairo_Graphics_Driver.cxx:520
void end_line(void)
see fl_end_line().
Definition: Fl_Cairo_Graphics_Driver.cxx:595
void vertex(double x, double y)
see fl_vertex(double x, double y).
Definition: Fl_Cairo_Graphics_Driver.cxx:643
void arc(int x, int y, int w, int h, double a1, double a2)
see fl_arc(int x, int y, int w, int h, double a1, double a2).
Definition: Fl_Cairo_Graphics_Driver.cxx:416
void circle(double x, double y, double r)
see fl_circle(double x, double y, double r).
Definition: Fl_Cairo_Graphics_Driver.cxx:339
virtual void rotate(double d)
see fl_rotate(double d).
Definition: Fl_Cairo_Graphics_Driver.cxx:194
void line_style(int style, int width=0, char *dashes=0)
see fl_line_style(int style, int width, char* dashes).
Definition: Fl_Cairo_Graphics_Driver.cxx:212
void end_loop(void)
see fl_end_loop().
Definition: Fl_Cairo_Graphics_Driver.cxx:626
virtual void begin_line()
see fl_begin_line().
Definition: Fl_Cairo_Graphics_Driver.cxx:565
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_RGB_Image object to the device.
Definition: Fl_Cairo_Graphics_Driver.cxx:889
void gap()
see fl_gap().
Definition: Fl_Cairo_Graphics_Driver.cxx:655
virtual void begin_polygon()
see fl_begin_polygon().
Definition: Fl_Cairo_Graphics_Driver.cxx:577
void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3)
see fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3,...
Definition: Fl_Cairo_Graphics_Driver.cxx:698
virtual void mult_matrix(double a, double b, double c, double d, double x, double y)
see fl_mult_matrix(double a, double b, double c, double d, double x, double y).
Definition: Fl_Cairo_Graphics_Driver.cxx:201
void loop(int x, int y, int x1, int y1, int x2, int y2)
see fl_loop(int x0, int y0, int x1, int y1, int x2, int y2).
Definition: Fl_Cairo_Graphics_Driver.cxx:729
void end_points(void)
see fl_end_points().
Definition: Fl_Cairo_Graphics_Driver.cxx:615
virtual void translate(double x, double y)
see fl_translate(double x, double y).
Definition: Fl_Cairo_Graphics_Driver.cxx:180
virtual void scale(double x, double y)
see fl_scale(double x, double y).
Definition: Fl_Cairo_Graphics_Driver.cxx:187
virtual void push_matrix()
see fl_push_matrix().
Definition: Fl_Cairo_Graphics_Driver.cxx:158
void yxline(int x, int y, int y1)
see fl_yxline(int x, int y, int y1).
Definition: Fl_Cairo_Graphics_Driver.cxx:815
This plugin socket allows the integration of new device drivers for special window or screen types.
Definition: Fl_Device.H:634
virtual const char * klass()
Returns the class name.
Definition: Fl_Device.H:640
virtual const char * name()=0
Returns the plugin name.
Fl_Device_Plugin(const char *name)
The constructor.
Definition: Fl_Device.H:637
virtual int print(Fl_Widget *w, int x, int y, int height)=0
Prints a widget.
All graphical output devices and all graphics systems.
Definition: Fl_Device.H:77
virtual const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:90
virtual ~Fl_Device()
Virtual destructor.
Definition: Fl_Device.H:97
static const char * class_id
A string that identifies each subclass of Fl_Device.
Definition: Fl_Device.H:82
A display to which the computer can draw.
Definition: Fl_Device.H:617
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:622
static Fl_Display_Device * display_device()
Returns the platform display device.
Definition: Fl_Device.H:626
This a structure for an actual system font, with junk to help choose it and info on character sizes.
Definition: Fl_Font.H:50
The MSWindows-specific graphics class.
Definition: Fl_Device.H:448
int height()
see fl_height().
void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_Bitmap object to the device.
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).
int descent()
see fl_descent().
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.
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).
double width(unsigned int c)
see fl_width(unsigned int n).
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).
void font(Fl_Font face, Fl_Fontsize size)
see fl_font(Fl_Font face, Fl_Fontsize size).
double width(const char *str, int n)
see fl_width(const char *str, int n).
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:451
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_RGB_Image object to the device.
void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
A virtual class subclassed for each graphics driver FLTK uses.
Definition: Fl_Device.H:110
virtual int height()=0
see fl_height().
virtual int descent()=0
see fl_descent().
virtual void draw_image(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=3)=0
see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D).
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)
Draws a gray-scale image using a callback function to generate image data.
virtual void draw_image(const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)=0
see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L).
virtual void draw(int angle, const char *str, int n, int x, int y)=0
see fl_draw(int angle, const char *str, int n, int x, int y).
virtual const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:382
virtual void color(uchar r, uchar g, uchar b)=0
see fl_color(uchar r, uchar g, uchar b).
void font_descriptor(Fl_Font_Descriptor *d)
Sets the current Fl_Font_Descriptor for the graphics driver.
Definition: Fl_Device.H:404
Fl_Color color()
see fl_color(void).
Definition: Fl_Device.H:400
virtual void rtl_draw(const char *str, int n, int x, int y)=0
see fl_rtl_draw(const char *str, int n, int x, int y).
virtual void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)=0
Draws an Fl_Pixmap object to the device.
static matrix * fl_matrix
Points to the current coordinate transformation matrix.
Definition: Fl_Device.H:144
virtual void draw(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)=0
Draws an Fl_RGB_Image object to the device.
virtual void scale(double x)
see fl_scale(double x).
Definition: Fl_Device.H:331
Fl_Font_Descriptor * font_descriptor()
Returns a pointer to the current Fl_Font_Descriptor for the graphics driver.
Definition: Fl_Device.H:402
virtual void draw(const char *str, int n, int x, int y)=0
see fl_draw(const char *str, int n, int x, int y).
virtual double width(const char *str, int n)=0
see fl_width(const char *str, int n).
virtual void scale(double x, double y)
see fl_scale(double x, double y).
Definition: Fl_Device.H:329
virtual void draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D=1, int L=0)=0
see fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L).
virtual void color(Fl_Color c)
see fl_color(Fl_Color c).
Definition: Fl_Device.H:262
virtual void translate(double x, double y)
see fl_translate(double x, double y).
Definition: Fl_Device.H:333
virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=1)=0
see fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D).
virtual ~Fl_Graphics_Driver()
The destructor.
Definition: Fl_Device.H:406
Fl_Fontsize size()
see fl_size().
Definition: Fl_Device.H:388
virtual void font(Fl_Font face, Fl_Fontsize size)
see fl_font(Fl_Font face, Fl_Fontsize size).
Definition: Fl_Device.H:384
Fl_Font font()
see fl_font(void).
Definition: Fl_Device.H:386
virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)=0
Draws an Fl_Bitmap object to the device.
virtual double width(unsigned int c)
see fl_width(unsigned int n).
Definition: Fl_Device.H:392
const char *const * data() const
Returns a pointer to the current image data array.
Definition: Fl_Image.H:118
int w() const
Returns the current image width in pixels.
Definition: Fl_Image.H:91
int h() const
Returns the current image height in pixels.
Definition: Fl_Image.H:94
int d() const
Returns the current image depth.
Definition: Fl_Image.H:100
The Fl_Pixmap class supports caching and drawing of colormap (pixmap) images, including transparency.
Definition: Fl_Pixmap.H:47
Fl_Plugin allows link-time and run-time integration of binary modules.
Definition: Fl_Plugin.H:70
The Mac OS X-specific graphics class.
Definition: Fl_Device.H:415
void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_Bitmap object to the device.
int height()
see fl_height().
double width(unsigned int c)
see fl_width(unsigned int n).
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_RGB_Image object to the device.
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).
int descent()
see fl_descent().
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.
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:418
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).
void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
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).
void font(Fl_Font face, Fl_Fontsize size)
see fl_font(Fl_Font face, Fl_Fontsize size).
double width(const char *str, int n)
see fl_width(const char *str, int n).
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:175
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:435
A surface that's susceptible to receive graphical output.
Definition: Fl_Device.H:592
void driver(Fl_Graphics_Driver *graphics_driver)
Sets the graphics driver of this drawing surface.
Definition: Fl_Device.H:605
virtual ~Fl_Surface_Device()
The destructor.
Definition: Fl_Device.H:611
Fl_Graphics_Driver * driver()
Returns the graphics driver of this drawing surface.
Definition: Fl_Device.H:607
Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver)
Constructor that sets the graphics driver to use for the created surface.
Definition: Fl_Device.H:599
static Fl_Surface_Device * surface()
the surface that currently receives graphics output
Definition: Fl_Device.H:609
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:602
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:111
The Xlib-specific graphics class.
Definition: Fl_Device.H:478
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Device.H:481
double width(const char *str, int n)
see fl_width(const char *str, int n).
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_draw_image.cxx:538
double width(unsigned int c)
see fl_width(unsigned int n).
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).
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).
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).
int height()
see fl_height().
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_draw_image.cxx:531
int descent()
see fl_descent().
void font(Fl_Font face, Fl_Fontsize size)
see fl_font(Fl_Font face, Fl_Fontsize size).
void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
unsigned char uchar
unsigned char
Definition: fl_types.h:39
FL_EXPORT void gl_start()
Creates an OpenGL context.
Definition: gl_start.cxx:64
void fl_font(Fl_Font face, Fl_Fontsize size)
Sets the current font, which is then used in various drawing routines.
Definition: fl_draw.H:502
void fl_color(Fl_Color c)
Sets the color for all subsequent drawing operations.
Definition: fl_draw.H:61
void fl_push_no_clip()
Pushes an empty clip region onto the stack so nothing will be clipped.
Definition: fl_draw.H:104
void fl_begin_complex_polygon()
Starts drawing a complex filled polygon.
Definition: fl_draw.H:448
void fl_vertex(double x, double y)
Adds a single vertex to the current path.
Definition: fl_draw.H:390
void fl_point(int x, int y)
Draws a single pixel at the given coordinates.
Definition: fl_draw.H:156
void fl_gap()
Call fl_gap() to separate loops of the path.
Definition: fl_draw.H:455
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:217
int fl_not_clipped(int x, int y, int w, int h)
Does the rectangle intersect the current clip region?
Definition: fl_draw.H:123
void fl_translate(double x, double y)
Concatenates translation transformation onto the current one.
Definition: fl_draw.H:356
void fl_begin_points()
Starts drawing a list of points.
Definition: fl_draw.H:373
double fl_transform_dy(double x, double y)
Transforms distance using current transformation matrix.
Definition: fl_draw.H:480
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:315
void fl_begin_loop()
Starts drawing a closed sequence of lines.
Definition: fl_draw.H:381
void fl_transformed_vertex(double xf, double yf)
Adds coordinate pair to the vertex list without further transformations.
Definition: fl_draw.H:485
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:399
void fl_rtl_draw(const char *str, int n, int x, int y)
Draws an array of n characters right to left starting at given location.
Definition: fl_draw.H:615
double fl_transform_dx(double x, double y)
Transforms distance using current transformation matrix.
Definition: fl_draw.H:475
void fl_end_loop()
Ends closed sequence of lines, and draws.
Definition: fl_draw.H:429
void fl_scale(double x, double y)
Concatenates scaling transformation onto the current one.
Definition: fl_draw.H:346
void fl_begin_polygon()
Starts drawing a convex filled polygon.
Definition: fl_draw.H:385
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:212
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:135
void fl_line_style(int style, int width=0, char *dashes=0)
Sets how to draw lines (the "pen").
Definition: fl_draw.H:186
void fl_pop_clip()
Restores the previous clip region.
Definition: fl_draw.H:112
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:244
void fl_yxline(int x, int y, int y1)
Draws a vertical line from (x,y) to (x,y1)
Definition: fl_draw.H:281
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)
Fills a 3-sided polygon.
Definition: fl_draw.H:255
void fl_end_line()
Ends list of lines, and draws.
Definition: fl_draw.H:425
void fl_pop_matrix()
Restores the current transformation matrix from the stack.
Definition: fl_draw.H:341
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:145
void fl_rotate(double d)
Concatenates rotation transformation onto the current one.
Definition: fl_draw.H:361
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:328
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:368
double fl_transform_x(double x, double y)
Transforms coordinate using the current transformation matrix.
Definition: fl_draw.H:465
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:91
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:417
void fl_push_matrix()
Saves the current transformation matrix on the stack.
Definition: fl_draw.H:337
void fl_end_complex_polygon()
Ends complex filled polygon, and draws.
Definition: fl_draw.H:459
FL_EXPORT void fl_draw(const char *str, int x, int y)
Draws a nul-terminated string starting at the given location.
Definition: fl_font.cxx:73
void fl_xyline(int x, int y, int x1)
Draws a horizontal line from (x,y) to (x1,y)
Definition: fl_draw.H:266
void fl_end_polygon()
Ends convex filled polygon, and draws.
Definition: fl_draw.H:433
void fl_begin_line()
Starts drawing a list of lines.
Definition: fl_draw.H:377
void fl_line(int x, int y, int x1, int y1)
Draws a line from (x,y) to (x1,y1)
Definition: fl_draw.H:234
double fl_transform_y(double x, double y)
Transforms coordinate using the current transformation matrix.
Definition: fl_draw.H:470
void fl_end_points()
Ends list of points, and draws.
Definition: fl_draw.H:421
void fl_restore_clip()
Undoes any clobbering of clip done by your program.
Definition: fl_draw.H:138
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:668
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:675
A 2D coordinate transformation matrix.
Definition: Fl_Device.H:114