summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2012-03-18 18:48:29 +0000
committerManolo Gouy <Manolo>2012-03-18 18:48:29 +0000
commit32d4bc4099ac62a32166c9d39ddd47d6a193be2a (patch)
treed01eab46321ea19780aa7ca0614cdd258885e368 /FL
parent53ccc787591de6b4aea756f45c8d3cdd6611b818 (diff)
Fix STR#2810: removed all uses of function Fl_Device::class_name().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9293 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Device.H25
-rw-r--r--FL/Fl_Pixmap.H5
-rw-r--r--FL/x.H4
3 files changed, 29 insertions, 5 deletions
diff --git a/FL/Fl_Device.H b/FL/Fl_Device.H
index 7da51df50..dfb2663bf 100644
--- a/FL/Fl_Device.H
+++ b/FL/Fl_Device.H
@@ -73,6 +73,8 @@ public:
static const char *class_id;
/**
Returns the name of the class of this object.
+ Use of the class_name() function is discouraged because it will be removed from future FLTK versions.
+
The class of an instance of an Fl_Device subclass can be checked with code such as:
\code
if ( instance->class_name() == Fl_Printer::class_id ) { ... }
@@ -206,7 +208,7 @@ protected:
friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
friend FL_EXPORT void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
friend FL_EXPORT void gl_start();
-
+ friend void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
matrix *fl_matrix; /**< Points to the current coordinate transformation matrix */
/** \brief The constructor. */
@@ -360,7 +362,11 @@ protected:
the image offset by the cx and cy arguments.
*/
virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {}
-
+#if FLTK_ABI_VERSION >= 10302
+ virtual
+#endif
+ void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
+
public:
static const char *class_id;
virtual const char *class_name() {return class_id;};
@@ -424,6 +430,7 @@ public:
#if ! defined(FL_DOXYGEN)
static Fl_Offscreen create_offscreen_with_alpha(int w, int h);
#endif
+ void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
};
#endif
#if defined(WIN32) || defined(FL_DOXYGEN)
@@ -457,6 +464,19 @@ public:
#if ! defined(FL_DOXYGEN)
void copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy);
#endif
+ void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
+};
+
+/**
+ The graphics driver used when printing on MSWindows.
+ *
+ This class is implemented only on the MSWindows platform. It 's extremely similar to Fl_GDI_Graphics_Driver.
+ */
+class FL_EXPORT Fl_GDI_Printer_Graphics_Driver : public Fl_GDI_Graphics_Driver {
+public:
+ static const char *class_id;
+ const char *class_name() {return class_id;};
+ void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
};
#endif
#if !(defined(__APPLE__) || defined(WIN32))
@@ -487,6 +507,7 @@ public:
void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
int height();
int descent();
+ void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
};
#endif
diff --git a/FL/Fl_Pixmap.H b/FL/Fl_Pixmap.H
index 15cd38c5f..62980d0a2 100644
--- a/FL/Fl_Pixmap.H
+++ b/FL/Fl_Pixmap.H
@@ -3,7 +3,7 @@
//
// Pixmap header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2012 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
@@ -38,10 +38,13 @@ struct Fl_Menu_Item;
class FL_EXPORT Fl_Pixmap : public Fl_Image {
friend class Fl_Quartz_Graphics_Driver;
friend class Fl_GDI_Graphics_Driver;
+ friend class Fl_GDI_Printer_Graphics_Driver;
friend class Fl_Xlib_Graphics_Driver;
void copy_data();
void delete_data();
void set_data(const char * const *p);
+ int prepare(int XP, int YP, int WP, int HP, int cx, int cy,
+ int &X, int &Y, int &W, int &H);
protected:
diff --git a/FL/x.H b/FL/x.H
index 148e01a04..189c8050a 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -3,7 +3,7 @@
//
// X11 header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2012 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
@@ -86,7 +86,7 @@ extern FL_EXPORT ulong fl_event_time;
typedef ulong Fl_Offscreen;
# define fl_create_offscreen(w,h) \
XCreatePixmap(fl_display, \
- (Fl_Surface_Device::surface()->class_name() == Fl_Display_Device::class_id ? \
+ (Fl_Surface_Device::surface() == Fl_Display_Device::display_device() ? \
fl_window : fl_xid(Fl::first_window()) ) , \
w, h, fl_visual->depth)
// begin/end are macros that save the old state in local variables: