summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-04-13 10:02:40 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-04-13 10:02:40 +0200
commitcaaa11a96f8448bd78cb270e4861f5e9ff1a6763 (patch)
tree1d3e10cce9d26b62ca053f8d911dcd81d098942c /src/drivers
parente6c9deb4a4fca8e7f0241e74ec242213628de6b6 (diff)
Standardize API to "graphics context" across platforms
Rename fl_wl_cairo() to fl_wl_gc() Add function cairo_t* fl_cairo_gc() under OPTION_USE_CAIRO
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx4
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H2
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx9
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx2
4 files changed, 5 insertions, 12 deletions
diff --git a/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
index d673c3dfa..3ad9a0d88 100644
--- a/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
+++ b/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
@@ -62,3 +62,7 @@ void Fl_X11_Cairo_Graphics_Driver::gc(void *value) {
void *Fl_X11_Cairo_Graphics_Driver::gc() {
return gc_;
}
+
+extern FL_EXPORT cairo_t* fl_cairo_gc() {
+ return ((Fl_Cairo_Graphics_Driver*)fl_graphics_driver)->cr();
+}
diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
index 5e3b13f8b..b9dbb78be 100644
--- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
@@ -80,8 +80,6 @@ public:
static void buffer_release(struct wld_window *window);
static void buffer_commit(struct wld_window *window, struct flCairoRegion *r = NULL);
static void cairo_init(struct fl_wld_buffer *buffer, int width, int height, int stride, cairo_format_t format);
- void *gc() FL_OVERRIDE;
- void gc(void *gc) FL_OVERRIDE;
};
#endif // FL_WAYLAND_GRAPHICS_DRIVER_H
diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
index d9eedb317..9b26f8439 100644
--- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
@@ -208,12 +208,3 @@ void Fl_Wayland_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_O
cairo_surface_destroy(surf);
cairo_restore(cairo_);
}
-
-
-void Fl_Wayland_Graphics_Driver::gc(void *off) {} // equivalent is done by set_buffer()
-
-
-void *Fl_Wayland_Graphics_Driver::gc() {
- return buffer_;
-}
-
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 37d6e4842..e65229624 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -1817,7 +1817,7 @@ FL_EXPORT struct wl_surface *fl_wl_surface(struct wld_window *xid) {
}
-cairo_t *fl_wl_cairo() {
+cairo_t *fl_wl_gc() {
return ((Fl_Cairo_Graphics_Driver*)fl_graphics_driver)->cr();
}