2016-02-09 21:25:02 +03:00
|
|
|
//
|
2021-02-12 02:39:13 +03:00
|
|
|
// Declaration of classes Fl_Graphics_Driver, Fl_Scalable_Graphics_Driver,
|
|
|
|
// and Fl_Font_Descriptor for the Fast Light Tool Kit (FLTK).
|
2016-02-09 21:25:02 +03:00
|
|
|
//
|
2021-02-12 02:39:13 +03:00
|
|
|
// Copyright 2010-2021 by Bill Spitzak and others.
|
2016-02-09 21:25:02 +03:00
|
|
|
//
|
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2016-02-09 21:25:02 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2016-02-09 21:25:02 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2016-02-09 21:25:02 +03:00
|
|
|
//
|
|
|
|
|
2018-06-23 19:47:40 +03:00
|
|
|
/**
|
2018-06-23 23:50:22 +03:00
|
|
|
\cond DriverDev
|
|
|
|
\addtogroup DriverDeveloper
|
|
|
|
\{
|
2018-06-23 19:47:40 +03:00
|
|
|
*/
|
|
|
|
|
2016-02-09 21:25:02 +03:00
|
|
|
/** \file Fl_Graphics_Driver.H
|
2021-02-12 02:39:13 +03:00
|
|
|
\brief Declaration of class Fl_Graphics_Driver.
|
2016-02-09 21:25:02 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FL_GRAPHICS_DRIVER_H
|
|
|
|
#define FL_GRAPHICS_DRIVER_H
|
|
|
|
|
2016-02-09 21:52:21 +03:00
|
|
|
#include <FL/Fl_Device.H>
|
2016-02-09 21:25:02 +03:00
|
|
|
#include <FL/Fl_Image.H>
|
|
|
|
#include <FL/Fl_Bitmap.H>
|
|
|
|
#include <FL/Fl_Pixmap.H>
|
|
|
|
#include <FL/Fl_RGB_Image.H>
|
|
|
|
|
|
|
|
class Fl_Graphics_Driver;
|
2017-05-17 14:54:18 +03:00
|
|
|
class Fl_Font_Descriptor;
|
2018-05-06 18:03:04 +03:00
|
|
|
class Fl_Image_Surface;
|
2016-02-09 21:25:02 +03:00
|
|
|
/** \brief Points to the driver that currently receives all graphics requests */
|
|
|
|
FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
|
|
|
|
|
|
|
|
/**
|
|
|
|
signature of image generation callback function.
|
|
|
|
\param[in] data user data passed to function
|
|
|
|
\param[in] x,y,w position and width of scan line in image
|
|
|
|
\param[out] buf buffer for generated image data. You must copy \p w
|
|
|
|
pixels from scanline \p y, starting at pixel \p x
|
|
|
|
to this buffer.
|
|
|
|
*/
|
|
|
|
typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
|
|
|
|
|
2016-09-23 16:56:07 +03:00
|
|
|
struct Fl_Fontdesc;
|
2021-03-26 09:52:21 +03:00
|
|
|
typedef struct _PangoFontDescription PangoFontDescription;
|
2016-02-09 21:25:02 +03:00
|
|
|
|
|
|
|
#define FL_REGION_STACK_SIZE 10
|
|
|
|
#define FL_MATRIX_STACK_SIZE 32
|
2018-06-23 19:47:40 +03:00
|
|
|
|
2016-02-09 21:25:02 +03:00
|
|
|
/**
|
2017-05-17 14:54:18 +03:00
|
|
|
An abstract class subclassed for each graphics driver FLTK uses.
|
2016-02-09 21:25:02 +03:00
|
|
|
Typically, FLTK applications do not use directly objects from this class. Rather, they perform
|
|
|
|
drawing operations (e.g., fl_rectf()) that operate on the current drawing surface (see Fl_Surface_Device).
|
|
|
|
Drawing operations are functionally presented in \ref drawing and as function lists
|
2017-05-17 14:54:18 +03:00
|
|
|
in the \ref fl_drawings and \ref fl_attributes modules.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2018-06-23 19:47:40 +03:00
|
|
|
<tt>Fl_Surface_Device::surface()->driver()</tt>
|
2020-07-01 19:03:10 +03:00
|
|
|
gives at any time the graphics driver used by all drawing operations.
|
2017-05-17 14:54:18 +03:00
|
|
|
For compatibility with older FLTK versions, the \ref fl_graphics_driver global variable gives the same result.
|
|
|
|
Its value changes when
|
|
|
|
drawing operations are directed to another drawing surface by Fl_Surface_Device::push_current() /
|
|
|
|
Fl_Surface_Device::pop_current() / Fl_Surface_Device::set_current().
|
2016-02-09 21:52:21 +03:00
|
|
|
|
2018-06-23 19:47:40 +03:00
|
|
|
The Fl_Graphics_Driver class is essential for developers of the FLTK library.
|
2017-05-17 14:54:18 +03:00
|
|
|
Each platform supported by FLTK requires to create a derived class of Fl_Graphics_Driver that
|
|
|
|
implements all its virtual member functions according to the platform.
|
|
|
|
*/
|
2016-02-25 20:56:48 +03:00
|
|
|
class FL_EXPORT Fl_Graphics_Driver {
|
2016-02-18 19:21:51 +03:00
|
|
|
friend class Fl_Surface_Device;
|
2018-06-15 10:42:17 +03:00
|
|
|
friend class Fl_Display_Device;
|
2017-12-18 11:52:55 +03:00
|
|
|
friend class Fl_Screen_Driver;
|
|
|
|
friend class Fl_Window_Driver;
|
2016-02-09 21:25:02 +03:00
|
|
|
friend class Fl_Pixmap;
|
|
|
|
friend class Fl_Bitmap;
|
|
|
|
friend class Fl_RGB_Image;
|
2020-07-30 18:41:22 +03:00
|
|
|
friend class Fl_SVG_Image;
|
2017-03-16 15:47:49 +03:00
|
|
|
friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
|
|
|
|
friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
|
|
|
|
friend void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
|
|
|
|
friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
|
|
|
|
friend void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
|
2018-04-18 18:03:51 +03:00
|
|
|
friend int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg);
|
2017-07-13 00:51:42 +03:00
|
|
|
friend FL_EXPORT void gl_start();
|
2018-02-07 18:34:44 +03:00
|
|
|
friend FL_EXPORT void gl_finish();
|
2017-07-13 00:51:42 +03:00
|
|
|
friend FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *array);
|
|
|
|
friend FL_EXPORT void fl_delete_bitmask(Fl_Bitmask);
|
Image drawing: simplify the code organisation to better support Fl_Image::scale().
Graphics drivers now use up to 6 virtual member functions to support Fl_Image
drawing in the context of GUI and image rescaling :
virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
and
virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-12 16:07:00 +03:00
|
|
|
/* ============== Implementation note about image drawing =========================
|
2018-04-14 18:10:59 +03:00
|
|
|
A graphics driver can implement up to 6 virtual member functions to draw images:
|
|
|
|
virtual void draw_pixmap(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy)
|
|
|
|
virtual void draw_bitmap(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy)
|
|
|
|
virtual void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy)
|
|
|
|
and
|
|
|
|
virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy)
|
|
|
|
virtual void draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy)
|
|
|
|
virtual void draw_fixed(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy)
|
|
|
|
- The 1st group of functions is used when the driver can directly map the image data,
|
Image drawing: simplify the code organisation to better support Fl_Image::scale().
Graphics drivers now use up to 6 virtual member functions to support Fl_Image
drawing in the context of GUI and image rescaling :
virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
and
virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-12 16:07:00 +03:00
|
|
|
sized at data_w() x data_h(), to the image drawing area, sized at w()*scale x h()*scale
|
|
|
|
where scale is the current GUI scale factor.
|
2018-04-15 09:44:50 +03:00
|
|
|
- If the driver does not support such scale-and-draw operation for a given image type,
|
|
|
|
it should implement the draw_fixed() function which is called by the library after the
|
|
|
|
image has been internally resized to the drawing size and cached.
|
2018-04-14 18:10:59 +03:00
|
|
|
- The platform-independent Fl_Graphics_Driver class implements the 1st group of functions.
|
|
|
|
Each resizes the image, caches it, and calls the platform-specific implementation of
|
|
|
|
draw_fixed(image-class *,....) with the cached image.
|
|
|
|
- Consider an image object, say from class Fl_RGB_Image. Fl_RGB_Image::draw()
|
|
|
|
calls the virtual member function draw_rgb(Fl_RGB_Image *,....). If Fl_XXX_Graphics_Driver
|
|
|
|
re-implements this function, this code runs and is expected to draw the image
|
|
|
|
adequately scaled to its drawing size. If Fl_XXX_Graphics_Driver does not re-implement
|
|
|
|
this function, Fl_Graphics_Driver::draw_rgb(Fl_RGB_Image *,....) runs. It internally
|
|
|
|
resizes the image, caches it, and calls Fl_XXX_Graphics_Driver::draw_fixed(Fl_RGB_Image *,....)
|
|
|
|
that draws the image from its cached form which already has the adequate size.
|
|
|
|
- Some drivers implement, for a given image class, only the function of the 1st group or
|
|
|
|
only draw_fixed() as in these examples:
|
Image drawing: simplify the code organisation to better support Fl_Image::scale().
Graphics drivers now use up to 6 virtual member functions to support Fl_Image
drawing in the context of GUI and image rescaling :
virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
and
virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-12 16:07:00 +03:00
|
|
|
- Fl_Quartz_Graphics_Driver implements only draw_rgb(Fl_RGB_Image *,....) because it
|
|
|
|
can perform the scale-and-draw operation whatever the RGB image and the required scaling.
|
2018-04-15 09:44:50 +03:00
|
|
|
- Fl_Xlib_Graphics_Driver implements only draw_fixed(Fl_Pixmap *,....). The library
|
2018-04-14 18:10:59 +03:00
|
|
|
takes care of resizing and caching the Pixmap to the adequate drawing size.
|
2018-04-15 09:44:50 +03:00
|
|
|
- Some drivers implement, for a given image class, the function of both groups, e.g. :
|
|
|
|
Fl_GDI_Graphics_Driver implements both draw_rgb(Fl_RGB_Image *,....) and
|
|
|
|
draw_fixed(Fl_RGB_Image *,....) because scale-and-draw may require function Alphablend()
|
|
|
|
from MSIMG32.DLL. In the absence of that, the draw_rgb() implementation calls
|
|
|
|
Fl_Graphics_Driver::draw_rgb() which runs Fl_GDI_Graphics_Driver::draw_fixed(Fl_RGB_Image*,...).
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2018-04-15 09:44:50 +03:00
|
|
|
Graphics drivers also implement cache(Fl_Pixmap*), cache(Fl_Bitmap*) and cache(Fl_RGB_Image*)
|
2018-04-16 11:03:16 +03:00
|
|
|
to compute the cached form of all image types, and uncache(Fl_RGB_Image *,...),
|
|
|
|
uncache_pixmap(fl_uintptr_t) and delete_bitmask(Fl_Bitmask) to destroy cached image forms.
|
2018-04-16 16:21:54 +03:00
|
|
|
Graphics drivers that use the mask_ variable of class Fl_Pixmap to cache an Fl_Pixmap
|
|
|
|
object also reimplement the uchar **Fl_Graphics_Driver::mask_bitmap() member function.
|
Image drawing: simplify the code organisation to better support Fl_Image::scale().
Graphics drivers now use up to 6 virtual member functions to support Fl_Image
drawing in the context of GUI and image rescaling :
virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
and
virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-12 16:07:00 +03:00
|
|
|
*/
|
2018-04-14 18:26:42 +03:00
|
|
|
private:
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy);
|
|
|
|
virtual void draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy);
|
|
|
|
virtual void draw_fixed(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy);
|
2018-04-18 18:03:51 +03:00
|
|
|
// the default implementation of make_unused_color_() is most probably enough
|
2021-02-16 13:58:07 +03:00
|
|
|
virtual void make_unused_color_(unsigned char &r, unsigned char &g, unsigned char &b, int color_count, void **data);
|
2017-08-24 15:40:29 +03:00
|
|
|
// some platforms may need to reimplement this
|
|
|
|
virtual void set_current_();
|
2018-04-19 13:39:46 +03:00
|
|
|
float scale_; // scale between FLTK and drawing coordinates: drawing = FLTK * scale_
|
2018-06-15 10:42:17 +03:00
|
|
|
public:
|
2018-07-10 13:51:02 +03:00
|
|
|
/** Creates the graphics driver that is used for core operations. */
|
|
|
|
static Fl_Graphics_Driver *newMainGraphicsDriver();
|
2016-02-09 21:25:02 +03:00
|
|
|
/** A 2D coordinate transformation matrix */
|
|
|
|
struct matrix {double a, b, c, d, x, y;};
|
|
|
|
/** Features that a derived class may possess. */
|
|
|
|
typedef enum {
|
|
|
|
NATIVE = 1, /**< native graphics driver for the platform */
|
|
|
|
PRINTER = 2 /**< graphics driver for a printer drawing surface */
|
|
|
|
} driver_feature;
|
|
|
|
|
|
|
|
protected:
|
2016-04-24 11:38:11 +03:00
|
|
|
int fl_clip_state_number; ///< For internal use by FLTK
|
|
|
|
static const matrix m0; ///< For internal use by FLTK
|
|
|
|
Fl_Font font_; ///< current font
|
|
|
|
Fl_Fontsize size_; ///< current font size
|
|
|
|
Fl_Color color_; ///< current color
|
|
|
|
int sptr;///< For internal use by FLTK
|
|
|
|
static const int matrix_stack_size = FL_MATRIX_STACK_SIZE; ///< For internal use by FLTK
|
|
|
|
matrix stack[FL_MATRIX_STACK_SIZE]; ///< For internal use by FLTK
|
|
|
|
matrix m; ///< current transformation matrix
|
|
|
|
int n; ///< For internal use by FLTK
|
|
|
|
int gap_; ///< For internal use by FLTK
|
|
|
|
int what; ///< For internal use by FLTK
|
|
|
|
int rstackptr; ///< For internal use by FLTK
|
|
|
|
static const int region_stack_max = FL_REGION_STACK_SIZE - 1; ///< For internal use by FLTK
|
|
|
|
Fl_Region rstack[FL_REGION_STACK_SIZE]; ///< For internal use by FLTK
|
|
|
|
Fl_Font_Descriptor *font_descriptor_; ///< For internal use by FLTK
|
2021-03-01 17:10:52 +03:00
|
|
|
int p_size;
|
|
|
|
typedef struct { float x; float y; } XPOINT;
|
|
|
|
XPOINT *p;
|
2016-02-09 21:25:02 +03:00
|
|
|
#ifndef FL_DOXYGEN
|
|
|
|
enum {LINE, LOOP, POLYGON, POINT_};
|
|
|
|
inline int vertex_no() { return n; }
|
|
|
|
inline int vertex_kind() {return what;}
|
|
|
|
#endif
|
|
|
|
matrix *fl_matrix; /**< Points to the current coordinate transformation matrix */
|
2016-04-24 11:38:11 +03:00
|
|
|
virtual void global_gc();
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void cache(Fl_Pixmap *img);
|
|
|
|
virtual void cache(Fl_Bitmap *img);
|
|
|
|
virtual void cache(Fl_RGB_Image *img);
|
|
|
|
virtual void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_);
|
2016-04-24 19:22:38 +03:00
|
|
|
// --- implementation is in src/drivers/xxx/Fl_xxx_Graphics_Driver_image.cxx
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
|
|
|
|
virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
|
|
|
|
virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
|
|
|
|
virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
|
Image drawing: simplify the code organisation to better support Fl_Image::scale().
Graphics drivers now use up to 6 virtual member functions to support Fl_Image
drawing in the context of GUI and image rescaling :
virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
and
virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-12 16:07:00 +03:00
|
|
|
virtual void draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
|
|
|
|
virtual void draw_pixmap(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
|
|
|
|
virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
|
2017-03-16 15:47:49 +03:00
|
|
|
virtual void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
|
|
|
|
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual Fl_Bitmask create_bitmask(int w, int h, const uchar *array);
|
|
|
|
virtual void delete_bitmask(Fl_Bitmask bm);
|
2017-05-17 14:54:18 +03:00
|
|
|
/** For internal library use only */
|
|
|
|
static void change_image_size(Fl_Image *img, int W, int H) {
|
|
|
|
img->w(W);
|
|
|
|
img->h(H);
|
|
|
|
}
|
2016-11-09 00:59:26 +03:00
|
|
|
// Support function for image drawing
|
|
|
|
virtual void uncache_pixmap(fl_uintptr_t p);
|
2016-11-03 00:08:15 +03:00
|
|
|
// accessor functions to protected image members
|
2016-11-05 09:00:52 +03:00
|
|
|
int start_image(Fl_Image *img, int XP, int YP, int WP, int HP, int &cx, int &cy,
|
|
|
|
int &X, int &Y, int &W, int &H);
|
2017-05-17 14:54:18 +03:00
|
|
|
/** Accessor to a private member variable of Fl_RGB_Image */
|
2016-11-03 00:08:15 +03:00
|
|
|
static fl_uintptr_t* id(Fl_RGB_Image *rgb) {return &(rgb->id_);}
|
2017-05-17 14:54:18 +03:00
|
|
|
/** Accessor to a private member variable of Fl_Pixmap */
|
2016-11-03 00:08:15 +03:00
|
|
|
static fl_uintptr_t* id(Fl_Pixmap *pm) {return &(pm->id_);}
|
2017-05-17 14:54:18 +03:00
|
|
|
/** Accessor to a private member variable of Fl_Bitmap */
|
2016-11-03 00:08:15 +03:00
|
|
|
static fl_uintptr_t* id(Fl_Bitmap *bm) {return &(bm->id_);}
|
2017-05-17 14:54:18 +03:00
|
|
|
/** Accessor to a private member variable of Fl_RGB_Image */
|
2016-11-03 00:08:15 +03:00
|
|
|
static fl_uintptr_t* mask(Fl_RGB_Image *rgb) {return &(rgb->mask_);}
|
2017-05-17 14:54:18 +03:00
|
|
|
/** Accessor to a private member variable of Fl_Pixmap */
|
2016-11-03 00:08:15 +03:00
|
|
|
static fl_uintptr_t* mask(Fl_Pixmap *pm) {return &(pm->mask_);}
|
2018-03-28 16:00:12 +03:00
|
|
|
/** Accessor to private member variables of Fl_Pixmap */
|
|
|
|
static void cache_w_h(Fl_Pixmap *pm, int*& pwidth, int*& pheight) {
|
|
|
|
pwidth = &(pm->cache_w_);
|
|
|
|
pheight = &(pm->cache_h_);
|
|
|
|
}
|
|
|
|
/** Accessor to private member variables of Fl_Bitmap */
|
|
|
|
static void cache_w_h(Fl_Bitmap *bm, int*& pwidth, int*& pheight) {
|
|
|
|
pwidth = &(bm->cache_w_);
|
|
|
|
pheight = &(bm->cache_h_);
|
|
|
|
}
|
|
|
|
/** Accessor to private member variables of Fl_RGB_Image */
|
|
|
|
static void cache_w_h(Fl_RGB_Image *rgb, int*& pwidth, int*& pheight) {
|
|
|
|
pwidth = &(rgb->cache_w_);
|
|
|
|
pheight = &(rgb->cache_h_);
|
|
|
|
}
|
2018-05-06 18:03:04 +03:00
|
|
|
static Fl_Offscreen get_offscreen_and_delete_image_surface(Fl_Image_Surface*);
|
2017-05-17 14:54:18 +03:00
|
|
|
/** For internal library use only */
|
2016-11-03 00:08:15 +03:00
|
|
|
static void draw_empty(Fl_Image* img, int X, int Y) {img->draw_empty(X, Y);}
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2016-02-09 21:25:02 +03:00
|
|
|
Fl_Graphics_Driver();
|
2020-11-12 09:46:00 +03:00
|
|
|
virtual void cache_size(Fl_Image *img, int &width, int &height);
|
2021-02-24 16:52:36 +03:00
|
|
|
void cache_size_finalize(Fl_Image *img, int &width, int &height);
|
2018-04-18 18:03:51 +03:00
|
|
|
static unsigned need_pixmap_bg_color;
|
2018-03-12 12:42:45 +03:00
|
|
|
public:
|
2016-04-24 11:38:11 +03:00
|
|
|
virtual ~Fl_Graphics_Driver() {} ///< Destructor
|
2016-04-17 18:36:23 +03:00
|
|
|
static Fl_Graphics_Driver &default_driver();
|
2018-03-11 17:49:09 +03:00
|
|
|
/** Current scale factor between FLTK and drawing units: drawing = FLTK * scale() */
|
2017-12-18 11:52:55 +03:00
|
|
|
float scale() { return scale_; }
|
2018-08-08 23:08:10 +03:00
|
|
|
/** Sets the current value of the scaling factor */
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void scale(float f);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** Return whether the graphics driver can do alpha blending */
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual char can_do_alpha_blending();
|
2016-02-09 21:25:02 +03:00
|
|
|
// --- implementation is in src/fl_rect.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_rect.cxx
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_point() */
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void point(int x, int y);
|
|
|
|
virtual void rect(int x, int y, int w, int h);
|
2016-02-09 21:25:02 +03:00
|
|
|
virtual void focus_rect(int x, int y, int w, int h);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void rectf(int x, int y, int w, int h);
|
|
|
|
virtual void line(int x, int y, int x1, int y1);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_line(int, int, int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void line(int x, int y, int x1, int y1, int x2, int y2);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_xyline(int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void xyline(int x, int y, int x1);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_xyline(int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void xyline(int x, int y, int x1, int y2);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_xyline(int, int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void xyline(int x, int y, int x1, int y2, int x3);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_yxline(int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void yxline(int x, int y, int y1);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_yxline(int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void yxline(int x, int y, int y1, int x2);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_yxline(int, int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void yxline(int x, int y, int y1, int x2, int y3);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_loop(int, int, int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_loop(int, int, int, int, int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_polygon(int, int, int, int, int, int, int, int) */
|
2018-12-04 14:57:32 +03:00
|
|
|
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
2016-02-09 21:25:02 +03:00
|
|
|
// --- clipping
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void push_clip(int x, int y, int w, int h);
|
|
|
|
virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
|
|
|
|
virtual int not_clipped(int x, int y, int w, int h);
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_push_no_clip() */
|
2018-12-04 17:11:03 +03:00
|
|
|
virtual void push_no_clip(); // has default implementation
|
2016-04-24 11:38:11 +03:00
|
|
|
/** see fl_pop_clip() */
|
2018-12-04 17:11:03 +03:00
|
|
|
virtual void pop_clip(); // has default implementation
|
2016-02-09 21:25:02 +03:00
|
|
|
virtual Fl_Region clip_region(); // has default implementation
|
|
|
|
virtual void clip_region(Fl_Region r); // has default implementation
|
|
|
|
virtual void restore_clip();
|
|
|
|
// --- implementation is in src/fl_vertex.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_vertex.cxx
|
|
|
|
virtual void push_matrix();
|
|
|
|
virtual void pop_matrix();
|
|
|
|
virtual void mult_matrix(double a, double b, double c, double d, double x, double y);
|
|
|
|
virtual void rotate(double d);
|
|
|
|
virtual void translate(double x,double y);
|
|
|
|
virtual void begin_points();
|
|
|
|
virtual void begin_line();
|
|
|
|
virtual void begin_loop();
|
|
|
|
virtual void begin_polygon();
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void begin_complex_polygon();
|
2016-02-09 21:25:02 +03:00
|
|
|
virtual double transform_x(double x, double y);
|
|
|
|
virtual double transform_y(double x, double y);
|
|
|
|
virtual double transform_dx(double x, double y);
|
|
|
|
virtual double transform_dy(double x, double y);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void transformed_vertex(double xf, double yf);
|
2021-03-01 17:10:52 +03:00
|
|
|
virtual void transformed_vertex0(float x, float y);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void vertex(double x, double y);
|
|
|
|
virtual void end_points();
|
|
|
|
virtual void end_line();
|
|
|
|
virtual void end_loop();
|
2021-03-01 17:47:23 +03:00
|
|
|
virtual void fixloop();
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void end_polygon();
|
|
|
|
virtual void end_complex_polygon();
|
|
|
|
virtual void gap();
|
|
|
|
virtual void circle(double x, double y, double r);
|
2016-02-09 21:25:02 +03:00
|
|
|
// --- implementation is in src/fl_arc.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_arc.cxx if needed
|
|
|
|
virtual void arc(double x, double y, double r, double start, double end);
|
|
|
|
// --- implementation is in src/fl_arci.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_arci.cxx
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void arc(int x, int y, int w, int h, double a1, double a2);
|
|
|
|
virtual void pie(int x, int y, int w, int h, double a1, double a2);
|
2016-02-09 21:25:02 +03:00
|
|
|
// --- implementation is in src/fl_curve.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_curve.cxx if needed
|
|
|
|
virtual void curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
|
|
|
|
// --- implementation is in src/fl_line_style.cxx which includes src/cfg_gfx/xxx_line_style.cxx
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void line_style(int style, int width=0, char* dashes=0);
|
2016-02-09 21:25:02 +03:00
|
|
|
// --- implementation is in src/fl_color.cxx which includes src/cfg_gfx/xxx_color.cxx
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void color(Fl_Color c);
|
2016-04-17 18:01:20 +03:00
|
|
|
virtual void set_color(Fl_Color i, unsigned int c);
|
|
|
|
virtual void free_color(Fl_Color i, int overlay);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual Fl_Color color();
|
|
|
|
virtual void color(uchar r, uchar g, uchar b);
|
|
|
|
virtual void draw(const char *str, int nChars, int x, int y);
|
|
|
|
virtual void draw(const char *str, int nChars, float x, float y);
|
|
|
|
virtual void draw(int angle, const char *str, int nChars, int x, int y);
|
|
|
|
virtual void rtl_draw(const char *str, int nChars, int x, int y);
|
|
|
|
virtual int has_feature(driver_feature feature);
|
|
|
|
virtual void font(Fl_Font face, Fl_Fontsize fsize);
|
|
|
|
virtual Fl_Font font();
|
|
|
|
virtual Fl_Fontsize size();
|
|
|
|
virtual double width(const char *str, int nChars);
|
|
|
|
virtual double width(unsigned int c);
|
2016-02-09 21:25:02 +03:00
|
|
|
virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual int height();
|
|
|
|
virtual int descent();
|
2016-04-24 11:38:11 +03:00
|
|
|
/** Return the current Fl_Font_Descriptor */
|
2016-09-26 09:26:59 +03:00
|
|
|
inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void font_descriptor(Fl_Font_Descriptor *d);
|
|
|
|
virtual void gc(void*);
|
|
|
|
virtual void *gc(void);
|
|
|
|
virtual uchar **mask_bitmap();
|
2016-03-30 19:27:41 +03:00
|
|
|
// default implementation may be enough
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual float scale_font_for_PostScript(Fl_Font_Descriptor *desc, int s);
|
2016-03-30 20:09:15 +03:00
|
|
|
// default implementation may be enough
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual float scale_bitmap_for_PostScript();
|
2016-04-17 17:22:02 +03:00
|
|
|
virtual void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win);
|
|
|
|
virtual void reset_spot();
|
2016-03-30 23:16:40 +03:00
|
|
|
// each platform implements these 3 functions its own way
|
2016-04-17 18:36:23 +03:00
|
|
|
virtual void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h);
|
|
|
|
virtual Fl_Region XRectangleRegion(int x, int y, int w, int h);
|
|
|
|
virtual void XDestroyRegion(Fl_Region r);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual const char* get_font_name(Fl_Font fnum, int* ap);
|
|
|
|
virtual int get_font_sizes(Fl_Font fnum, int*& sizep);
|
|
|
|
virtual Fl_Font set_fonts(const char *name);
|
|
|
|
virtual Fl_Fontdesc* calc_fl_fonts(void);
|
2018-02-07 18:34:44 +03:00
|
|
|
virtual unsigned font_desc_size();
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual const char *font_name(int num);
|
|
|
|
virtual void font_name(int num, const char *name);
|
|
|
|
// Defaut implementation may be enough
|
|
|
|
virtual void overlay_rect(int x, int y, int w , int h);
|
2021-02-27 10:18:01 +03:00
|
|
|
virtual float override_scale();
|
2021-02-25 13:06:54 +03:00
|
|
|
virtual void restore_scale(float);
|
2021-03-26 09:52:21 +03:00
|
|
|
virtual PangoFontDescription* pango_font_description(Fl_Font fnum) { return NULL; }
|
2016-02-09 21:25:02 +03:00
|
|
|
};
|
|
|
|
|
2017-05-17 14:54:18 +03:00
|
|
|
#ifndef FL_DOXYGEN
|
2018-02-07 18:34:44 +03:00
|
|
|
|
|
|
|
/* This class is not part of FLTK's public API.
|
|
|
|
Platforms usually define a derived class called Fl_XXX_Font_Descriptor
|
|
|
|
containing extra platform-specific data/functions.
|
|
|
|
This is a class for an actual system font, with junk to
|
|
|
|
help choose it and info on character sizes. Each Fl_Fontdesc has a
|
|
|
|
linked list of these. These are created the first time each system
|
|
|
|
font/size combination is used.
|
|
|
|
*/
|
|
|
|
class Fl_Font_Descriptor {
|
|
|
|
public:
|
|
|
|
/** linked list for this Fl_Fontdesc */
|
|
|
|
Fl_Font_Descriptor *next;
|
|
|
|
Fl_Fontsize size; /**< font size */
|
|
|
|
Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
|
|
|
|
FL_EXPORT ~Fl_Font_Descriptor() {}
|
|
|
|
short ascent, descent, q_width;
|
|
|
|
unsigned int listbase;// base of display list, 0 = none
|
|
|
|
};
|
|
|
|
|
|
|
|
// This struct is not part of FLTK's public API.
|
|
|
|
struct Fl_Fontdesc {
|
|
|
|
const char *name;
|
|
|
|
char fontname[128]; // "Pretty" font name
|
|
|
|
Fl_Font_Descriptor *first; // linked list of sizes of this style
|
|
|
|
};
|
|
|
|
|
2017-05-17 14:54:18 +03:00
|
|
|
/* Abstract class Fl_Scalable_Graphics_Driver is platform-independent.
|
|
|
|
It supports the scaling of all graphics coordinates by a
|
|
|
|
float factor helpful to support HiDPI displays.
|
|
|
|
This class does :
|
|
|
|
- compute scaled coordinates
|
|
|
|
- scale the cached offscreen of image objects
|
|
|
|
- scale the pixel arrays used when performing direct image draws
|
|
|
|
- call the member functions of a platform-specific,
|
2020-07-01 19:03:10 +03:00
|
|
|
Fl_Scalable_Graphics_Driver-derived class that do the drawings with adequately
|
2017-05-17 14:54:18 +03:00
|
|
|
scaled coordinates. The member functions are named with the _unscaled suffix.
|
|
|
|
- scale and unscale the clipping region.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2018-03-07 14:55:38 +03:00
|
|
|
This class is presently used by the X11 and Windows platforms to support HiDPI displays.
|
|
|
|
In the future, it may also be used by other platforms.
|
2017-05-17 14:54:18 +03:00
|
|
|
*/
|
2017-07-13 00:51:42 +03:00
|
|
|
class FL_EXPORT Fl_Scalable_Graphics_Driver : public Fl_Graphics_Driver {
|
2017-05-17 14:54:18 +03:00
|
|
|
public:
|
|
|
|
Fl_Scalable_Graphics_Driver();
|
2021-03-11 18:05:20 +03:00
|
|
|
// This function aims to compute accurately int(x * s) in
|
|
|
|
// presence of rounding errors existing with floating point numbers
|
|
|
|
// and that sometimes differ between 32 and 64 bits.
|
|
|
|
static inline int floor(int x, float s) { return int(x * s + 0.001f); }
|
|
|
|
inline int floor(int x) { return Fl_Scalable_Graphics_Driver::floor(x, scale()); }
|
2017-05-17 14:54:18 +03:00
|
|
|
protected:
|
2017-06-21 19:08:32 +03:00
|
|
|
int line_width_;
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual Fl_Region scale_clip(float f);
|
2017-05-17 14:54:18 +03:00
|
|
|
void unscale_clip(Fl_Region r);
|
|
|
|
virtual void point(int x, int y);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void point_unscaled(float x, float y);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void rect(int x, int y, int w, int h);
|
|
|
|
virtual void rectf(int x, int y, int w, int h);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void rectf_unscaled(int x, int y, int w, int h);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void line(int x, int y, int x1, int y1);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void line_unscaled(int x, int y, int x1, int y1);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void line(int x, int y, int x1, int y1, int x2, int y2);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void line_unscaled(int x, int y, int x1, int y1, int x2, int y2);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void xyline(int x, int y, int x1);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void xyline_unscaled(int x, int y, int x1);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void yxline(int x, int y, int y1);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void yxline_unscaled(int x, int y, int y1);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void circle(double x, double y, double r);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void ellipse_unscaled(double xt, double yt, double rx, double ry);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void font(Fl_Font face, Fl_Fontsize size);
|
2021-02-24 16:52:36 +03:00
|
|
|
virtual Fl_Font font();
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void font_unscaled(Fl_Font face, Fl_Fontsize size);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual double width(const char *str, int n);
|
|
|
|
virtual double width(unsigned int c);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual double width_unscaled(const char *str, int n);
|
|
|
|
virtual double width_unscaled(unsigned int c);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual Fl_Fontsize size();
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual Fl_Fontsize size_unscaled();
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void text_extents(const char *str, int n, int &dx, int &dy, int &w, int &h);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void text_extents_unscaled(const char *str, int n, int &dx, int &dy, int &w, int &h);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual int height();
|
|
|
|
virtual int descent();
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual int height_unscaled();
|
|
|
|
virtual int descent_unscaled();
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void draw(const char *str, int n, int x, int y);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void draw_unscaled(const char *str, int n, int x, int y);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void draw(int angle, const char *str, int n, int x, int y);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void draw_unscaled(int angle, const char *str, int n, int x, int y);
|
2021-02-24 16:52:36 +03:00
|
|
|
virtual void draw(const char *str, int nChars, float x, float y);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void rtl_draw(const char* str, int n, int x, int y);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void rtl_draw_unscaled(const char* str, int n, int x, int y);
|
2021-02-24 16:52:36 +03:00
|
|
|
virtual void arc(double x, double y, double r, double start, double end);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void arc(int x, int y, int w, int h, double a1, double a2);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void arc_unscaled(int x, int y, int w, int h, double a1, double a2);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void pie(int x, int y, int w, int h, double a1, double a2);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void pie_unscaled(int x, int y, int w, int h, double a1, double a2);
|
2017-05-17 14:54:18 +03:00
|
|
|
virtual void line_style(int style, int width=0, char* dashes=0);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void line_style_unscaled(int style, int width, char* dashes);
|
|
|
|
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);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void draw_image_unscaled(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
|
|
|
|
virtual void draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
|
2017-05-17 14:54:18 +03:00
|
|
|
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
|
|
|
|
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void draw_image_mono_unscaled(const uchar* buf, int x, int y, int w, int h, int d, int l);
|
2017-05-17 14:54:18 +03:00
|
|
|
void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
|
2019-03-12 12:55:01 +03:00
|
|
|
virtual void draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
|
2017-05-17 14:54:18 +03:00
|
|
|
void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
|
|
|
|
|
|
|
|
void transformed_vertex(double xf, double yf);
|
|
|
|
void vertex(double x, double y);
|
2021-02-27 10:18:01 +03:00
|
|
|
virtual float override_scale();
|
2021-02-25 13:06:54 +03:00
|
|
|
virtual void restore_scale(float);
|
2021-03-11 18:05:20 +03:00
|
|
|
virtual void *change_pen_width(int lwidth);
|
|
|
|
virtual void reset_pen_width(void *data);
|
2017-05-17 14:54:18 +03:00
|
|
|
};
|
|
|
|
#endif // FL_DOXYGEN
|
|
|
|
|
2016-02-09 21:25:02 +03:00
|
|
|
#endif // FL_GRAPHICS_DRIVER_H
|
|
|
|
|
2018-06-23 19:47:40 +03:00
|
|
|
/**
|
2018-06-23 23:50:22 +03:00
|
|
|
\}
|
|
|
|
\endcond
|
2018-06-23 19:47:40 +03:00
|
|
|
*/
|