summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Device.H16
-rw-r--r--FL/Fl_Gl_Window.H7
-rw-r--r--FL/Fl_Group.H2
-rw-r--r--FL/Fl_Widget.H19
-rw-r--r--FL/Fl_Window.H2
5 files changed, 38 insertions, 8 deletions
diff --git a/FL/Fl_Device.H b/FL/Fl_Device.H
index bf611e1d8..31d27c92f 100644
--- a/FL/Fl_Device.H
+++ b/FL/Fl_Device.H
@@ -7,6 +7,7 @@
#define Fl_Device_H
#include <FL/x.H>
+#include <FL/Fl_Plugin.H>
#ifdef WIN32
#include <Commdlg.h>
#elif defined(__APPLE__)
@@ -19,6 +20,7 @@ class Fl_RGB_Image;
class Fl_Pixmap;
class Fl_Bitmap;
class Fl_Display;
+class Fl_Virtual_Printer;
extern Fl_Display *fl_display_device;
typedef void (*Fl_Draw_Image_Cb)(void* ,int,int,int,uchar*);
@@ -200,4 +202,18 @@ public:
};
#endif
+/*
+ This plugin socket allows the integration of new device drivers for special
+ window or screen types. It is currently used to provide an automated printing
+ service for OpenGL windows, if linked with fltk_gl.
+ */
+class Fl_Device_Plugin : public Fl_Plugin {
+public:
+ Fl_Device_Plugin(const char *name)
+ : Fl_Plugin(klass(), name) { }
+ virtual const char *klass() { return "fltk:device"; }
+ virtual const char *name() = 0;
+ virtual int print(Fl_Virtual_Printer*, Fl_Widget*, int x, int y) { return 0; }
+};
+
#endif // Fl_Device_H
diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H
index dac0a096f..9842aed41 100644
--- a/FL/Fl_Gl_Window.H
+++ b/FL/Fl_Gl_Window.H
@@ -205,6 +205,13 @@ public:
*/
void make_overlay_current();
+ /** Returns an Fl_Gl_Window pointer if this widget is an Fl_Gl_Window.
+ \retval NULL if this widget is not derived from Fl_Gl_Window.
+ \note This method is provided to avoid dynamic_cast.
+ \todo More documentation ...
+ */
+ virtual Fl_Gl_Window* as_gl_window() {return this;}
+
~Fl_Gl_Window();
/**
Creates a new Fl_Gl_Window widget using the given size, and label string.
diff --git a/FL/Fl_Group.H b/FL/Fl_Group.H
index 7e1630d0b..cde3e8cb2 100644
--- a/FL/Fl_Group.H
+++ b/FL/Fl_Group.H
@@ -182,7 +182,7 @@ public:
\note This method is provided to avoid dynamic_cast.
\todo More documentation ...
*/
- virtual Fl_Group* as_group() const { return (Fl_Group*)this; }
+ virtual Fl_Group* as_group() { return this; }
// back compatibility functions:
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 95351f9f2..a3a2d6ad6 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -930,16 +930,23 @@ public:
\note This method is provided to avoid dynamic_cast.
\todo More documentation ...
*/
- virtual Fl_Group* as_group() const {return 0;}
+ virtual Fl_Group* as_group() {return 0;}
/** Returns an Fl_Window pointer if this widget is an Fl_Window.
+
+ \retval NULL if this widget is not derived from Fl_Window.
+ \note This method is provided to avoid dynamic_cast.
+ \todo More documentation ...
+ */
+ virtual Fl_Window* as_window() {return 0;}
- \retval NULL if this widget is not derived from Fl_Window.
- \note This method is provided to avoid dynamic_cast.
- \todo More documentation ...
+ /** Returns an Fl_Gl_Window pointer if this widget is an Fl_Gl_Window.
+ \retval NULL if this widget is not derived from Fl_Gl_Window.
+ \note This method is provided to avoid dynamic_cast.
+ \todo More documentation ...
*/
- virtual Fl_Window* as_window() const {return 0;}
-
+ virtual class Fl_Gl_Window* as_gl_window() {return 0;}
+
/** For back compatibility only.
\deprecated Use selection_color() instead.
*/
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H
index b2430e958..c9dd1af08 100644
--- a/FL/Fl_Window.H
+++ b/FL/Fl_Window.H
@@ -421,7 +421,7 @@ public:
\note This method is provided to avoid dynamic_cast.
\todo More documentation ...
*/
- virtual Fl_Window* as_window() const { return (Fl_Window*)this; }
+ virtual Fl_Window* as_window() { return this; }
// for back-compatibility only:
/**