mirror of https://github.com/fltk/fltk
Rename class Fl_Display_Cairo_Graphics_Driver to Fl_X11_Cairo_Graphics_Driver
This commit is contained in:
parent
b055b82eb2
commit
868ab9696f
|
@ -276,7 +276,7 @@ cairo_image_surface_create_for_data() for the window's or offscreen's \c draw_bu
|
|||
|
||||
Class \c Fl_Cairo_Graphics_Driver is also used
|
||||
by the X11 leg of the hybrid Wayland-X11 platform because this leg draws to the display with
|
||||
an \c Fl_Display_Cairo_Graphics_Driver object which derives from class
|
||||
an \c Fl_X11_Cairo_Graphics_Driver object which derives from class
|
||||
\c Fl_Cairo_Graphics_Driver. Finally, \c Fl_Cairo_Graphics_Driver is also used, in the form of
|
||||
an object from its derived class \c Fl_PostScript_Graphics_Driver, when the hybrid Wayland-X11
|
||||
platform draws PostScript, or when the classic X11 platform uses Pango and draws PostScript.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# CMakeLists.txt to build the FLTK library using CMake (www.cmake.org)
|
||||
#
|
||||
# Copyright 1998-2022 by Bill Spitzak and others.
|
||||
# Copyright 1998-2023 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
|
@ -226,7 +226,7 @@ if (FLTK_USE_X11 AND NOT OPTION_USE_WAYLAND)
|
|||
if (FLTK_USE_CAIRO)
|
||||
set (DRIVER_FILES ${DRIVER_FILES}
|
||||
drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
|
||||
drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.cxx
|
||||
drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
|
||||
)
|
||||
else ()
|
||||
if (USE_XFT)
|
||||
|
@ -265,7 +265,7 @@ if (FLTK_USE_X11 AND NOT OPTION_USE_WAYLAND)
|
|||
if (FLTK_USE_CAIRO)
|
||||
set (DRIVER_HEADER_FILES ${DRIVER_HEADER_FILES}
|
||||
drivers/Cairo/Fl_Cairo_Graphics_Driver.H
|
||||
drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H
|
||||
drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.H
|
||||
)
|
||||
elseif (USE_PANGO)
|
||||
set (DRIVER_HEADER_FILES ${DRIVER_HEADER_FILES}
|
||||
|
@ -297,7 +297,7 @@ elseif (OPTION_USE_WAYLAND)
|
|||
endif (OPTION_USE_KDIALOG)
|
||||
if (FLTK_USE_X11)
|
||||
list (APPEND DRIVER_FILES
|
||||
drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.cxx
|
||||
drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
|
||||
drivers/X11/Fl_X11_Screen_Driver.cxx
|
||||
drivers/X11/Fl_X11_Window_Driver.cxx
|
||||
drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx
|
||||
|
@ -313,7 +313,7 @@ elseif (OPTION_USE_WAYLAND)
|
|||
drivers/Wayland/Fl_Wayland_Window_Driver.H
|
||||
drivers/Wayland/Fl_Wayland_Graphics_Driver.H
|
||||
drivers/Cairo/Fl_Cairo_Graphics_Driver.H
|
||||
drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H
|
||||
drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.H
|
||||
drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.H
|
||||
drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H
|
||||
drivers/Unix/Fl_Unix_System_Driver.H
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// implementation of classes Fl_Surface_Device and Fl_Display_Device for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 2010-2022 by Bill Spitzak and others.
|
||||
// Copyright 2010-2023 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
@ -57,11 +57,11 @@
|
|||
+- Fl_Xlib_Graphics_Driver: X11-specific graphics driver
|
||||
+- Fl_GDI_Graphics_Driver: Windows-specific graphics driver
|
||||
+- Fl_GDI_Printer_Graphics_Driver: re-implements a few member functions especially for output to printer
|
||||
+- Fl_Cairo_Graphics_Driver: for X11+Pango (PostScript) and Wayland platforms
|
||||
+- Fl_Cairo_Graphics_Driver: full FLTK drawing API based on Cairo and Pango
|
||||
+- Fl_Wayland_Graphics_Driver: Wayland-specific graphics driver
|
||||
+- Fl_Display_Cairo_Graphics_Driver: used by X11 leg of hybrid Wayland/X11 platform
|
||||
+- Fl_X11_Cairo_Graphics_Driver: used by X11 leg of hybrid Wayland/X11 platform
|
||||
+- Fl_PostScript_Graphics_Driver: for PostScript drawing with X11+Pango platform
|
||||
+- Fl_OpenGL_Graphics_Driver: draw to an Fl_Gl_Window (only partial implementation)
|
||||
+- Fl_OpenGL_Graphics_Driver: draw to an Fl_Gl_Window
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
# include "drivers/X11/Fl_X11_Window_Driver.H"
|
||||
# include "drivers/Unix/Fl_Unix_System_Driver.H"
|
||||
#if FLTK_USE_CAIRO
|
||||
# include "drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H"
|
||||
# include "drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.H"
|
||||
#else
|
||||
# include "drivers/Xlib/Fl_Xlib_Graphics_Driver.H"
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# Library Makefile for the Fast Light Tool Kit (FLTK).
|
||||
#
|
||||
# Copyright 1998-2022 by Bill Spitzak and others.
|
||||
# Copyright 1998-2023 by Bill Spitzak and others.
|
||||
#
|
||||
# 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
|
||||
|
@ -287,7 +287,7 @@ XLIBCPPFILES = \
|
|||
# These graphics driver files are used under condition: BUILD_CAIRO
|
||||
CAIROGDFILES = \
|
||||
drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx \
|
||||
drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.cxx
|
||||
drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
|
||||
|
||||
# These graphics driver files are used under condition: BUILD_X11 AND BUILD_XFT
|
||||
XLIBGDFILES = drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx \
|
||||
|
@ -320,7 +320,7 @@ WLCPPFILES = \
|
|||
WLX11CPPFILES = \
|
||||
drivers/X11/Fl_X11_Screen_Driver.cxx \
|
||||
drivers/X11/Fl_X11_Window_Driver.cxx \
|
||||
drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.cxx \
|
||||
drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx \
|
||||
drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx \
|
||||
drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx \
|
||||
Fl_x.cxx \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// Support for using Cairo to draw into X11 windows for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 2022 by Bill Spitzak and others.
|
||||
// Copyright 2022-2023 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
|
||||
/* \file
|
||||
Declaration of class Fl_Display_Cairo_Graphics_Driver.
|
||||
Declaration of class Fl_X11_Cairo_Graphics_Driver.
|
||||
*/
|
||||
|
||||
#ifndef FL_DISPLAY_CAIRO_GRAPHICS_DRIVER_H
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "Fl_Cairo_Graphics_Driver.H"
|
||||
|
||||
class Fl_Display_Cairo_Graphics_Driver : public Fl_Cairo_Graphics_Driver {
|
||||
class Fl_X11_Cairo_Graphics_Driver : public Fl_Cairo_Graphics_Driver {
|
||||
private:
|
||||
static void *gc_;
|
||||
public:
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// Support for using Cairo to draw into X11 windows for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 2022 by Bill Spitzak and others.
|
||||
// Copyright 2022-2023 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
@ -15,17 +15,17 @@
|
|||
//
|
||||
|
||||
/* \file
|
||||
Implementation of class Fl_Display_Cairo_Graphics_Driver .
|
||||
Implementation of class Fl_X11_Cairo_Graphics_Driver.
|
||||
*/
|
||||
|
||||
#include "Fl_Display_Cairo_Graphics_Driver.H"
|
||||
#include "Fl_X11_Cairo_Graphics_Driver.H"
|
||||
#include <FL/platform.H>
|
||||
#include <cairo/cairo.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
void *Fl_Display_Cairo_Graphics_Driver::gc_ = NULL;
|
||||
void *Fl_X11_Cairo_Graphics_Driver::gc_ = NULL;
|
||||
GC fl_gc;
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ ulong fl_xpixel(Fl_Color i) {
|
|||
}
|
||||
|
||||
|
||||
void Fl_Display_Cairo_Graphics_Driver::scale(float f) {
|
||||
void Fl_X11_Cairo_Graphics_Driver::scale(float f) {
|
||||
Fl_Graphics_Driver::scale(f);
|
||||
if (cairo_) {
|
||||
cairo_restore(cairo_);
|
||||
|
@ -48,17 +48,17 @@ void Fl_Display_Cairo_Graphics_Driver::scale(float f) {
|
|||
}
|
||||
|
||||
|
||||
void Fl_Display_Cairo_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
|
||||
void Fl_X11_Cairo_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
|
||||
XCopyArea(fl_display, pixmap, fl_window, (GC)Fl_Graphics_Driver::default_driver().gc(), int(srcx*scale()), int(srcy*scale()), int(w*scale()), int(h*scale()), int(x*scale()), int(y*scale()));
|
||||
}
|
||||
|
||||
|
||||
void Fl_Display_Cairo_Graphics_Driver::gc(void *value) {
|
||||
void Fl_X11_Cairo_Graphics_Driver::gc(void *value) {
|
||||
gc_ = value;
|
||||
fl_gc = (GC)gc_;
|
||||
}
|
||||
|
||||
|
||||
void *Fl_Display_Cairo_Graphics_Driver::gc() {
|
||||
void *Fl_X11_Cairo_Graphics_Driver::gc() {
|
||||
return gc_;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// Wayland-specific code to initialize wayland support.
|
||||
//
|
||||
// Copyright 2022 by Bill Spitzak and others.
|
||||
// Copyright 2022-2023 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
@ -24,7 +24,7 @@
|
|||
#ifdef FLTK_USE_X11
|
||||
# include "../Xlib/Fl_Xlib_Copy_Surface_Driver.H"
|
||||
# include <cairo-xlib.h>
|
||||
# include "../Cairo/Fl_Display_Cairo_Graphics_Driver.H"
|
||||
# include "../Cairo/Fl_X11_Cairo_Graphics_Driver.H"
|
||||
# include "../X11/Fl_X11_Screen_Driver.H"
|
||||
# include "../X11/Fl_X11_Window_Driver.H"
|
||||
# include "../Xlib/Fl_Xlib_Image_Surface_Driver.H"
|
||||
|
@ -119,7 +119,7 @@ Fl_System_Driver *Fl_System_Driver::newSystemDriver() {
|
|||
|
||||
Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver() {
|
||||
#ifdef FLTK_USE_X11
|
||||
if (!attempt_wayland()) return new Fl_Display_Cairo_Graphics_Driver();
|
||||
if (!attempt_wayland()) return new Fl_X11_Cairo_Graphics_Driver();
|
||||
#endif
|
||||
return new Fl_Wayland_Graphics_Driver();
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "Fl_X11_Screen_Driver.H"
|
||||
#if FLTK_USE_CAIRO
|
||||
# include <cairo-xlib.h>
|
||||
# include "../Cairo/Fl_Display_Cairo_Graphics_Driver.H"
|
||||
# include "../Cairo/Fl_X11_Cairo_Graphics_Driver.H"
|
||||
#else
|
||||
# include "../Xlib/Fl_Xlib_Graphics_Driver.H"
|
||||
#endif // FLTK_USE_CAIRO
|
||||
|
@ -173,7 +173,7 @@ void Fl_X11_Window_Driver::flush_double(int erase_overlay)
|
|||
pWindow->clear_damage(FL_DAMAGE_ALL);
|
||||
}
|
||||
#if FLTK_USE_CAIRO
|
||||
((Fl_Display_Cairo_Graphics_Driver*)fl_graphics_driver)->set_cairo(cairo_);
|
||||
((Fl_X11_Cairo_Graphics_Driver*)fl_graphics_driver)->set_cairo(cairo_);
|
||||
#endif
|
||||
if (pWindow->damage() & ~FL_DAMAGE_EXPOSE) {
|
||||
fl_clip_region(i->region); i->region = 0;
|
||||
|
@ -205,7 +205,7 @@ void Fl_X11_Window_Driver::flush_overlay()
|
|||
cairo_t *overlay_cairo = cairo_create(s);
|
||||
cairo_surface_destroy(s);
|
||||
cairo_save(overlay_cairo);
|
||||
((Fl_Display_Cairo_Graphics_Driver*)fl_graphics_driver)->set_cairo(overlay_cairo);
|
||||
((Fl_X11_Cairo_Graphics_Driver*)fl_graphics_driver)->set_cairo(overlay_cairo);
|
||||
#endif
|
||||
pWindow->as_overlay_window()->draw_overlay();
|
||||
#if FLTK_USE_CAIRO
|
||||
|
@ -418,7 +418,7 @@ void Fl_X11_Window_Driver::make_current() {
|
|||
cairo_surface_destroy(s);
|
||||
cairo_save(cairo_);
|
||||
}
|
||||
((Fl_Display_Cairo_Graphics_Driver*)fl_graphics_driver)->set_cairo(cairo_);
|
||||
((Fl_X11_Cairo_Graphics_Driver*)fl_graphics_driver)->set_cairo(cairo_);
|
||||
}
|
||||
fl_graphics_driver->scale(scale);
|
||||
#elif USE_XFT
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// X11-specific code to initialize wayland support.
|
||||
//
|
||||
// Copyright 2022 by Bill Spitzak and others.
|
||||
// Copyright 2022-2023 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
@ -18,7 +18,7 @@
|
|||
#include <FL/platform.H>
|
||||
#include "../Xlib/Fl_Xlib_Copy_Surface_Driver.H"
|
||||
#if FLTK_USE_CAIRO
|
||||
# include "../Cairo/Fl_Display_Cairo_Graphics_Driver.H"
|
||||
# include "../Cairo/Fl_X11_Cairo_Graphics_Driver.H"
|
||||
#else
|
||||
# include "../Xlib/Fl_Xlib_Graphics_Driver.H"
|
||||
#endif
|
||||
|
@ -133,7 +133,7 @@ FL_EXPORT Fl_Fontdesc* fl_fonts = (Fl_Fontdesc*)built_in_table;
|
|||
Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver()
|
||||
{
|
||||
#if FLTK_USE_CAIRO
|
||||
return new Fl_Display_Cairo_Graphics_Driver();
|
||||
return new Fl_X11_Cairo_Graphics_Driver();
|
||||
#else
|
||||
return new Fl_Xlib_Graphics_Driver();
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// Copy-to-clipboard code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2018 by Bill Spitzak and others.
|
||||
// Copyright 1998-2023 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
@ -22,7 +22,7 @@
|
|||
#include "../X11/Fl_X11_Screen_Driver.H"
|
||||
#if FLTK_USE_CAIRO
|
||||
# include <cairo-xlib.h>
|
||||
# include "../Cairo/Fl_Display_Cairo_Graphics_Driver.H"
|
||||
# include "../Cairo/Fl_X11_Cairo_Graphics_Driver.H"
|
||||
# include <cairo/cairo.h>
|
||||
#else
|
||||
# include "Fl_Xlib_Graphics_Driver.H"
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
Fl_Xlib_Copy_Surface_Driver::Fl_Xlib_Copy_Surface_Driver(int w, int h) : Fl_Copy_Surface_Driver(w, h) {
|
||||
#if FLTK_USE_CAIRO
|
||||
driver(new Fl_Display_Cairo_Graphics_Driver());
|
||||
driver(new Fl_X11_Cairo_Graphics_Driver());
|
||||
#else
|
||||
driver(new Fl_Xlib_Graphics_Driver());
|
||||
#endif
|
||||
|
@ -46,7 +46,7 @@ Fl_Xlib_Copy_Surface_Driver::Fl_Xlib_Copy_Surface_Driver(int w, int h) : Fl_Copy
|
|||
cairo_surface_destroy(surf);
|
||||
cairo_scale(cairo_, 1/s, 1/s);
|
||||
cairo_save(cairo_);
|
||||
((Fl_Display_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
((Fl_X11_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
#endif
|
||||
driver()->push_no_clip();
|
||||
fl_window = xid;
|
||||
|
@ -78,7 +78,7 @@ void Fl_Xlib_Copy_Surface_Driver::set_current() {
|
|||
oldwindow = fl_window;
|
||||
fl_window = xid;
|
||||
#if FLTK_USE_CAIRO
|
||||
((Fl_Display_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
((Fl_X11_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// Draw-to-image code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2018 by Bill Spitzak and others.
|
||||
// Copyright 1998-2023 by Bill Spitzak and others.
|
||||
//
|
||||
// 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
|
||||
|
@ -19,7 +19,7 @@
|
|||
#include "../../Fl_Screen_Driver.H"
|
||||
#if FLTK_USE_CAIRO
|
||||
# include <cairo-xlib.h>
|
||||
# include "../Cairo/Fl_Display_Cairo_Graphics_Driver.H"
|
||||
# include "../Cairo/Fl_X11_Cairo_Graphics_Driver.H"
|
||||
#else
|
||||
# include "Fl_Xlib_Graphics_Driver.H"
|
||||
#endif // FLTK_USE_CAIRO
|
||||
|
@ -38,12 +38,12 @@ Fl_Xlib_Image_Surface_Driver::Fl_Xlib_Image_Surface_Driver(int w, int h, int hig
|
|||
offscreen = (Fl_Offscreen)XCreatePixmap(fl_display, RootWindow(fl_display, fl_screen), w, h, fl_visual->depth);
|
||||
}
|
||||
#if FLTK_USE_CAIRO
|
||||
driver(new Fl_Display_Cairo_Graphics_Driver());
|
||||
driver(new Fl_X11_Cairo_Graphics_Driver());
|
||||
cairo_surface_t *s = cairo_xlib_surface_create(fl_display, offscreen, fl_visual->visual, w, h);
|
||||
cairo_ = cairo_create(s);
|
||||
cairo_surface_destroy(s);
|
||||
cairo_save(cairo_);
|
||||
((Fl_Display_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
((Fl_X11_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
#else
|
||||
driver(new Fl_Xlib_Graphics_Driver());
|
||||
#endif
|
||||
|
@ -63,7 +63,7 @@ void Fl_Xlib_Image_Surface_Driver::set_current() {
|
|||
pre_window = fl_window;
|
||||
fl_window = offscreen;
|
||||
#if FLTK_USE_CAIRO
|
||||
((Fl_Display_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
((Fl_X11_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue