summaryrefslogtreecommitdiff
path: root/FL
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 /FL
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 'FL')
-rw-r--r--FL/wayland.H2
-rw-r--r--FL/x11.H7
2 files changed, 7 insertions, 2 deletions
diff --git a/FL/wayland.H b/FL/wayland.H
index 9d2b48925..34098a9d5 100644
--- a/FL/wayland.H
+++ b/FL/wayland.H
@@ -35,7 +35,7 @@ extern FL_EXPORT struct wld_window *fl_wl_xid(const Fl_Window *win);
/** Returns the Fl_Window corresponding to a given the platform-specific window reference */
extern FL_EXPORT Fl_Window *fl_wl_find(struct wld_window *);
/** Returns the cairo context associated to the current window or Fl_Image_Surface */
-extern FL_EXPORT cairo_t *fl_wl_cairo();
+extern FL_EXPORT cairo_t *fl_wl_gc();
/** Returns the wl_compositor of the current Wayland session.
This allows, for example, to create a wl_surface with
\code
diff --git a/FL/x11.H b/FL/x11.H
index a86b605f2..73af4e7fc 100644
--- a/FL/x11.H
+++ b/FL/x11.H
@@ -32,7 +32,8 @@ extern Window fl_x11_xid(const Fl_Window *win);
extern Fl_Window *fl_x11_find(Window xid);
/** Returns the X11-specific currently active graphics context. */
extern GC fl_x11_gc();
-
+/** Returns the Cairo-specific currently active graphics context (OPTION_USE_CAIRO=On) */
+extern cairo_t* fl_cairo_gc();
#else // ! FL_DOXYGEN
#ifndef FL_PLATFORM_H
@@ -65,6 +66,10 @@ extern FL_EXPORT Colormap fl_colormap;
// drawing functions:
extern FL_EXPORT GC fl_gc;
+#if FLTK_USE_CAIRO
+ typedef struct _cairo cairo_t;
+ extern FL_EXPORT cairo_t* fl_cairo_gc();
+#endif
extern FL_EXPORT GC fl_x11_gc();
FL_EXPORT ulong fl_xpixel(Fl_Color i);
FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b);