Remove unused arguments from the Fl_Device_Plugin::print() member function.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13141 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-11-30 09:01:12 +00:00
parent b511f6a7a4
commit c33d3c6aaa
3 changed files with 10 additions and 14 deletions

View File

@ -118,18 +118,14 @@ public:
virtual const char *klass() { return "fltk:device"; }
/** \brief Returns the plugin name */
virtual const char *name() = 0;
/** \brief Prints a widget
\param w the widget
\param x,y offsets where to print relatively to coordinates origin
\param height height of the current drawing area
*/
virtual int print(Fl_Widget* w, int x, int y, int height) = 0;
/** captures a rectangle of a widget as an image
/** \brief Prints a widget */
virtual int print(Fl_Widget* w) = 0;
/** Captures a rectangle of a widget as an image
\return The captured pixels as an RGB image
*/
virtual Fl_RGB_Image* rectangle_capture(Fl_Widget *widget, int x, int y, int w, int h) = 0;
/** Returns the window's GL context */
virtual GLContext context(class Fl_Window *glw) = 0;
virtual GLContext context(Fl_Widget *widget) = 0;
};
#endif // Fl_Device_H

View File

@ -30,12 +30,12 @@ class Fl_Gl_Device_Plugin : public Fl_Device_Plugin {
public:
Fl_Gl_Device_Plugin() : Fl_Device_Plugin(name()) { }
virtual const char *name() { return "opengl.device.fltk.org"; }
virtual int print(Fl_Widget *w, int x, int y, int height /*useless*/) {
virtual int print(Fl_Widget *w) {
Fl_Gl_Window *glw = w->as_gl_window();
if (!glw) return 0;
Fl_RGB_Image *img = Fl_OpenGL_Display_Device::capture_gl_rectangle(glw, 0, 0, glw->w(), glw->h());
img->scale(glw->w(), glw->h());
img->draw(x, y);
img->draw(0, 0);
delete img;
return 1;
}
@ -44,9 +44,9 @@ public:
if (!glw) return NULL;
return Fl_OpenGL_Display_Device::capture_gl_rectangle(glw, x, y, w, h);
}
virtual GLContext context(Fl_Window *window) {
Fl_Gl_Window *glw = window->as_gl_window();
return glw ? glw->context() : 0;
virtual GLContext context(Fl_Widget *widget) {
Fl_Gl_Window *glw = widget->as_gl_window();
return glw ? glw->context() : (GLContext)0;
}
};

View File

@ -71,7 +71,7 @@ void Fl_Widget_Surface::draw(Fl_Widget* widget, int delta_x, int delta_y)
Fl_Plugin_Manager pm("fltk:device");
Fl_Device_Plugin *pi = (Fl_Device_Plugin*)pm.plugin("opengl.device.fltk.org");
if (pi) {
drawn_by_plugin = pi->print(widget, 0, 0, 0);
drawn_by_plugin = pi->print(widget);
}
}
if (!drawn_by_plugin) {