FLTK logo

[master] 4657e98 - Remove X11-specific code from platform-independent Fl_PostScript.cxx

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 4657e98 - Remove X11-specific code from platform-independent Fl_PostScript.cxx "ManoloFLTK" Mar 26, 2021  
 
commit 4657e988f7e351020876172218a5534e739bd18e
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Fri Mar 26 07:52:21 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Fri Mar 26 07:52:21 2021 +0100

    Remove X11-specific code from platform-independent Fl_PostScript.cxx

 FL/Fl_Graphics_Driver.H                      | 2 ++
 src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H | 1 -
 src/drivers/PostScript/Fl_PostScript.cxx     | 3 +--
 src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git FL/Fl_Graphics_Driver.H FL/Fl_Graphics_Driver.H
index 9d2b85f..58ea006 100644
--- FL/Fl_Graphics_Driver.H
+++ FL/Fl_Graphics_Driver.H
@@ -51,6 +51,7 @@ FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
 typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
 
 struct Fl_Fontdesc;
+typedef struct _PangoFontDescription PangoFontDescription;
 
 #define FL_REGION_STACK_SIZE 10
 #define FL_MATRIX_STACK_SIZE 32
@@ -370,6 +371,7 @@ public:
   virtual void overlay_rect(int x, int y, int w , int h);
   virtual float override_scale();
   virtual void restore_scale(float);
+  virtual PangoFontDescription* pango_font_description(Fl_Font fnum) { return NULL; }
 };
 
 #ifndef FL_DOXYGEN
diff --git src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H
index bbcb414..a0ded9b 100644
--- src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H
+++ src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H
@@ -46,7 +46,6 @@ public:
   int pages_;
   cairo_t *cr() { return cairo_; }
   PangoLayout *pango_layout() {return pango_layout_;};
-  virtual PangoFontDescription* pango_font_description(Fl_Font fnum) { return NULL; }
 
   void check_status(void);
 
diff --git src/drivers/PostScript/Fl_PostScript.cxx src/drivers/PostScript/Fl_PostScript.cxx
index c041923..470f6df 100644
--- src/drivers/PostScript/Fl_PostScript.cxx
+++ src/drivers/PostScript/Fl_PostScript.cxx
@@ -32,7 +32,6 @@
 #include <FL/math.h> // for M_PI
 #include <pango/pangocairo.h>
 #include <cairo/cairo-ps.h>
-#include "../Xlib/Fl_Xlib_Graphics_Driver.H"
 #endif
 
 const char *Fl_PostScript_File_Device::file_chooser_title = "Select a .ps file";
@@ -1503,7 +1502,7 @@ int Fl_PostScript_Graphics_Driver::start_eps(int width, int height) {
 }
 
 PangoFontDescription* Fl_PostScript_Graphics_Driver::pango_font_description(Fl_Font fnum) {
-  return Fl_Xlib_Graphics_Driver::pango_font_description(fnum);
+  return Fl_Graphics_Driver::default_driver().pango_font_description(fnum);
 }
 
 #endif // USE_PANGO
diff --git src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
index e4a3530..bae7640 100644
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
@@ -85,7 +85,7 @@ protected:
   static PangoFontMap *pfmap_;
   static PangoLayout *playout_;
 public:
-  static PangoFontDescription* pango_font_description(Fl_Font fnum) { return pfd_array[fnum]; }
+  virtual PangoFontDescription* pango_font_description(Fl_Font fnum) { return pfd_array[fnum]; }
 private:
   static PangoFontDescription **pfd_array; // one array element for each Fl_Font
   static int pfd_array_length;
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.