summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-06 19:47:06 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-06 19:47:06 +0100
commitf8db18597a545c245b885ad18dbfb8862161966a (patch)
treee093eea6a0fcb62f9a110e85b80b40ba64a17930 /src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
parent272bc2560cad49bc5d504e2cede7c55d4518791a (diff)
Complete class Fl_Cairo_Graphics_Driver using Fl_Wayland_Graphics_Driver
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H60
1 files changed, 3 insertions, 57 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
index 19991c531..8023c6c94 100644
--- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
@@ -42,22 +42,16 @@
gives the stride of this buffer;
- size_t data_size
gives the total buffer size in bytes (thus, data_size / stride gives the buffer height);
- - bool draw_buffer_needs_commit
- is TRUE when draw_buffer has been modified and needs being committed for display, and
- FALSE after having been committed but before having been modified;
- struct wl_callback *cb
is used to synchronize drawing with the compositor during progressive drawing.
When a graphics scene is to be committed, the data_size bytes of draw_buffer are copied by memcpy()
starting at data, and wl_buffer is attached to the wl_surface which is committed for display
- by wl_surface_commit(). Finally, draw_buffer_needs_commit is set to FALSE.
-
- All drawing functions have Cairo write to draw_buffer and turn draw_buffer_needs_commit to TRUE.
-*/
+ by wl_surface_commit().
+ */
#include "../Cairo/Fl_Cairo_Graphics_Driver.H"
-#include <cairo/cairo.h>
#include <stdint.h> // for uint32_t
typedef struct _PangoLayout PangoLayout;
@@ -75,34 +69,19 @@ struct fl_wld_buffer {
};
struct wld_window;
+
class FL_EXPORT Fl_Wayland_Graphics_Driver : public Fl_Cairo_Graphics_Driver {
private:
struct fl_wld_buffer *buffer_;
PangoLayout *dummy_pango_layout_; // used to measure text width before showing a window
- int linestyle_;
- void draw_cached_pattern_(Fl_Image *img, cairo_pattern_t *pat, int X, int Y, int W, int H, int cx, int cy);
public:
Fl_Wayland_Graphics_Driver();
~Fl_Wayland_Graphics_Driver();
static const uint32_t wld_format;
- static const cairo_format_t cairo_format;
void activate(struct fl_wld_buffer *buffer, float scale);
void font(Fl_Font fnum, Fl_Fontsize s);
Fl_Font font() { return Fl_Graphics_Driver::font(); }
- void draw(const char* s, int nBytes, int x, int y) { draw(s, nBytes, float(x), float(y)); }
- void draw(const char* s, int nBytes, float x, float y);
- void draw(int angle, const char *str, int n, int x, int y);
- void rtl_draw(const char* str, int n, int x, int y);
- int height();
- int descent();
- double width(const char *str, int n);
- double width(unsigned c);
- void text_extents(const char* txt, int n, int& dx, int& dy, int& w, int& h);
- int not_clipped(int x, int y, int w, int h);
- int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
- void restore_clip();
void clip_region(Fl_Region r);
- void line_style(int style, int width=0, char* dashes=0);
Fl_Region XRectangleRegion(int x, int y, int w, int h);
void add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H);
void XDestroyRegion(Fl_Region r);
@@ -112,45 +91,12 @@ public:
void font_name(int num, const char *name);
const char* get_font_name(Fl_Font fnum, int* ap);
int get_font_sizes(Fl_Font fnum, int*& sizep);
- void point(int x, int y);
void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen osrc, int srcx, int srcy);
- void draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD);
- void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3);
- void begin_points();
- void end_points();
- void transformed_vertex(double x, double y);
- void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy);
- void cache(Fl_RGB_Image *rgb);
- void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_);
- void draw_bitmap(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy);
- void cache(Fl_Bitmap *img);
- void delete_bitmask(Fl_Bitmask bm);
- void cache(Fl_Pixmap *pxm);
- void draw_pixmap(Fl_Pixmap *rgb,int XP, int YP, int WP, int HP, int cx, int cy);
- void uncache_pixmap(fl_uintptr_t p);
- void overlay_rect(int x, int y, int w , int h);
static void init_built_in_fonts();
static struct fl_wld_buffer *create_shm_buffer(int width, int height);
static void buffer_release(struct wld_window *window);
static void buffer_commit(struct wld_window *window);
static void cairo_init(struct fl_wld_buffer *buffer, int width, int height, int stride, cairo_format_t format);
- void line(int x1, int y1, int x2, int y2);
- void line(int x1, int y1, int x2, int y2, int x3, int y3);
- void xyline(int x, int y, int x1);
- void xyline(int x, int y, int x1, int y2);
- void xyline(int x, int y, int x1, int y2, int x3);
- void yxline(int x, int y, int y1);
- void yxline(int x, int y, int y1, int x2);
- void yxline(int x, int y, int y1, int x2, int y3);
- void loop(int x0, int y0, int x1, int y1, int x2, int y2);
- void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
- void rect(int x, int y, int w, int h);
- void rectf(int x, int y, int w, int h);
- void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
- void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
- void end_loop();
- void end_line();
- void end_polygon();
void set_spot(int font, int height, int x, int y, int w, int h, Fl_Window *win);
void reset_spot();
};