Author: manolo
Date: 2011-01-05 02:21:45 -0800 (Wed, 05 Jan 2011)
New Revision: 8190
Log:
Renamed Fl_Device::type() to Fl_Device::class_name() to avoid conflict or
confusion
with Fl_Widget::type(). Added a setter function Fl_Device::class_name(const
char *).
Modified:
branches/branch-1.3/FL/Fl_Device.H
branches/branch-1.3/FL/Fl_Paged_Device.H
branches/branch-1.3/FL/Fl_PostScript.H
branches/branch-1.3/FL/Fl_Printer.H
branches/branch-1.3/FL/x.H
branches/branch-1.3/src/Fl_Bitmap.cxx
branches/branch-1.3/src/Fl_Device.cxx
branches/branch-1.3/src/Fl_Double_Window.cxx
branches/branch-1.3/src/Fl_GDI_Printer.cxx
branches/branch-1.3/src/Fl_Paged_Device.cxx
branches/branch-1.3/src/Fl_Pixmap.cxx
branches/branch-1.3/src/Fl_PostScript.cxx
branches/branch-1.3/src/Fl_Printer.cxx
branches/branch-1.3/src/Fl_Quartz_Printer.mm
branches/branch-1.3/src/Fl_cocoa.mm
branches/branch-1.3/src/Fl_win32.cxx
branches/branch-1.3/src/fl_draw_image_win32.cxx
branches/branch-1.3/src/fl_draw_pixmap.cxx
branches/branch-1.3/src/fl_font_win32.cxx
branches/branch-1.3/src/fl_line_style.cxx
branches/branch-1.3/src/fl_rect.cxx
Modified: branches/branch-1.3/FL/Fl_Device.H
===================================================================
--- branches/branch-1.3/FL/Fl_Device.H 2011-01-04 22:04:54 UTC (rev 8189)
+++ branches/branch-1.3/FL/Fl_Device.H 2011-01-05 10:21:45 UTC (rev 8190)
@@ -63,24 +63,26 @@
\brief All graphical output devices and all graphics systems.
*/
class FL_EXPORT Fl_Device {
+private:
+ const char *type_; // pointer to class name
protected:
- /** \brief The device type */
- const char *type_;
+ /** \brief Sets the class name */
+ inline void class_name(const char *name) { type_ = name;};
/** \brief A string that identifies each subclass of Fl_Device.
- *
- Function type() applied to a device of this class returns this string.
+
+ Function class_name() applied to a device of this class returns this string.
*/
- static const char *device_type;
+ static const char *class_id;
public:
/**
- @brief An RTTI emulation of device classes.
+ \brief Returns the name of the class of this object.
*
- The type of an instance of an Fl_Device subclass can be checked with code
such as:
+ The class of an instance of an Fl_Device subclass can be checked with code
such as:
\code
- if ( instance->type() == Fl_Printer::device_type ) { ... }
+ if ( instance->class_name() == Fl_Printer::class_id ) { ... }
\endcode
*/
- inline const char *type() {return type_;};
+ inline const char *class_name() {return type_;};
};
/**
@@ -275,7 +277,7 @@
virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int
cy) {};
public:
- static const char *device_type;
+ static const char *class_id;
/** \brief The destructor */
virtual ~Fl_Graphics_Driver() {};
};
@@ -289,8 +291,8 @@
class FL_EXPORT Fl_Quartz_Graphics_Driver : public Fl_Graphics_Driver {
public:
/** \brief The constructor. */
- Fl_Quartz_Graphics_Driver() { type_ = device_type; };
- static const char *device_type;
+ Fl_Quartz_Graphics_Driver() { class_name( class_id); };
+ static const char *class_id;
void color(Fl_Color c);
void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
@@ -315,8 +317,8 @@
class FL_EXPORT Fl_GDI_Graphics_Driver : public Fl_Graphics_Driver {
public:
/** \brief The constructor. */
- Fl_GDI_Graphics_Driver() { type_ = device_type; };
- static const char *device_type;
+ Fl_GDI_Graphics_Driver() { class_name ( class_id); };
+ static const char *class_id;
void color(Fl_Color c);
void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
@@ -341,8 +343,8 @@
class Fl_Xlib_Graphics_Driver : public Fl_Graphics_Driver {
public:
/** \brief The constructor. */
- Fl_Xlib_Graphics_Driver() { type_ = device_type; };
- static const char *device_type;
+ Fl_Xlib_Graphics_Driver() { class_name ( class_id); };
+ static const char *class_id;
void color(Fl_Color c);
void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
@@ -369,7 +371,7 @@
/** \brief Constructor that sets the graphics driver to use for the created
surface. */
Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver =
graphics_driver; };
public:
- static const char *device_type;
+ static const char *class_id;
virtual void set_current(void);
/** \brief Sets the graphics driver of this drawing surface. */
inline void driver(Fl_Graphics_Driver *graphics_driver) {_driver =
graphics_driver;};
@@ -386,9 +388,9 @@
*/
class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
public:
- static const char *device_type;
+ static const char *class_id;
/** \brief A constructor that sets the graphics driver used by the display */
- Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(
graphics_driver) { type_ = device_type; };
+ Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(
graphics_driver) { class_name( class_id); };
/**
@brief Returns the platform's display device.
*/
Modified: branches/branch-1.3/FL/Fl_Paged_Device.H
===================================================================
--- branches/branch-1.3/FL/Fl_Paged_Device.H 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/FL/Fl_Paged_Device.H 2011-01-05 10:21:45 UTC (rev
8190)
@@ -130,11 +130,11 @@
void delete_image_list();
#endif
/** \brief The constructor */
- Fl_Paged_Device() : Fl_Surface_Device(NULL) {type_ = device_type;};
+ Fl_Paged_Device() : Fl_Surface_Device(NULL) {class_name( class_id);};
/** \brief The destructor */
virtual ~Fl_Paged_Device() {};
public:
- static const char *device_type;
+ static const char *class_id;
virtual int start_job(int pagecount, int *frompage = NULL, int *topage =
NULL);
virtual int start_page(void);
virtual int printable_rect(int *w, int *h);
Modified: branches/branch-1.3/FL/Fl_PostScript.H
===================================================================
--- branches/branch-1.3/FL/Fl_PostScript.H 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/FL/Fl_PostScript.H 2011-01-05 10:21:45 UTC (rev
8190)
@@ -63,7 +63,7 @@
*/
class Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
public:
- static const char *device_type;
+ static const char *class_id;
#ifndef FL_DOXYGEN
public:
enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
@@ -227,7 +227,7 @@
protected:
Fl_PostScript_Graphics_Driver *driver();
public:
- static const char *device_type;
+ static const char *class_id;
Fl_PostScript_File_Device();
~Fl_PostScript_File_Device();
int start_job(int pagecount, enum Fl_Paged_Device::Page_Format format =
Fl_Paged_Device::A4,
Modified: branches/branch-1.3/FL/Fl_Printer.H
===================================================================
--- branches/branch-1.3/FL/Fl_Printer.H 2011-01-04 22:04:54 UTC (rev 8189)
+++ branches/branch-1.3/FL/Fl_Printer.H 2011-01-05 10:21:45 UTC (rev 8190)
@@ -73,7 +73,7 @@
void absolute_printable_rect(int *x, int *y, int *w, int *h);
#endif
public:
- static const char *device_type;
+ static const char *class_id;
Fl_System_Printer(void);
int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
int start_page (void);
@@ -101,7 +101,7 @@
*/
class Fl_PostScript_Printer : public Fl_PostScript_File_Device {
public:
- static const char *device_type;
+ static const char *class_id;
int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL);
};
@@ -141,7 +141,7 @@
*/
class Fl_Printer : public Fl_Paged_Device {
public:
- static const char *device_type;
+ static const char *class_id;
/** \brief The constructor */
Fl_Printer(void);
int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
Modified: branches/branch-1.3/FL/x.H
===================================================================
--- branches/branch-1.3/FL/x.H 2011-01-04 22:04:54 UTC (rev 8189)
+++ branches/branch-1.3/FL/x.H 2011-01-05 10:21:45 UTC (rev 8190)
@@ -112,7 +112,7 @@
typedef ulong Fl_Offscreen;
# define fl_create_offscreen(w,h) \
XCreatePixmap(fl_display, \
- (fl_surface->type() == Fl_Display_Device::device_type ? \
+ (fl_surface->class_name() == Fl_Display_Device::class_id ? \
fl_window : fl_xid(Fl::first_window()) ) , \
w, h, fl_visual->depth)
// begin/end are macros that save the old state in local variables:
Modified: branches/branch-1.3/src/Fl_Bitmap.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Bitmap.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_Bitmap.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -304,7 +304,7 @@
HDC tempdc;
int save;
BOOL use_print_algo = false;
- if (fl_surface->type() == Fl_Printer::device_type) {
+ if (fl_surface->class_name() == Fl_Printer::class_id) {
static HMODULE hMod = NULL;
if (!hMod) {
hMod = LoadLibrary("MSIMG32.DLL");
Modified: branches/branch-1.3/src/Fl_Device.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Device.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_Device.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -29,18 +29,18 @@
#include <FL/Fl_Device.H>
#include <FL/Fl_Image.H>
-const char *Fl_Device::device_type = "Fl_Device";
-const char *Fl_Surface_Device::device_type = "Fl_Surface_Device";
-const char *Fl_Display_Device::device_type = "Fl_Display_Device";
-const char *Fl_Graphics_Driver::device_type = "Fl_Graphics_Driver";
+const char *Fl_Device::class_id = "Fl_Device";
+const char *Fl_Surface_Device::class_id = "Fl_Surface_Device";
+const char *Fl_Display_Device::class_id = "Fl_Display_Device";
+const char *Fl_Graphics_Driver::class_id = "Fl_Graphics_Driver";
#if defined(__APPLE__) || defined(FL_DOXYGEN)
-const char *Fl_Quartz_Graphics_Driver::device_type =
"Fl_Quartz_Graphics_Driver";
+const char *Fl_Quartz_Graphics_Driver::class_id = "Fl_Quartz_Graphics_Driver";
#endif
#if defined(WIN32) || defined(FL_DOXYGEN)
-const char *Fl_GDI_Graphics_Driver::device_type = "Fl_GDI_Graphics_Driver";
+const char *Fl_GDI_Graphics_Driver::class_id = "Fl_GDI_Graphics_Driver";
#endif
#if !(defined(__APPLE__) || defined(WIN32))
-const char *Fl_Xlib_Graphics_Driver::device_type = "Fl_Xlib_Graphics_Driver";
+const char *Fl_Xlib_Graphics_Driver::class_id = "Fl_Xlib_Graphics_Driver";
#endif
Modified: branches/branch-1.3/src/Fl_Double_Window.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Double_Window.cxx 2011-01-04 22:04:54 UTC
(rev 8189)
+++ branches/branch-1.3/src/Fl_Double_Window.cxx 2011-01-05 10:21:45 UTC
(rev 8190)
@@ -180,8 +180,8 @@
BOOL alpha_ok = 0;
// first try to alpha blend
// if to printer, always try alpha_blend
- int to_display = Fl_Surface_Device::surface()->type() ==
Fl_Display_Device::device_type; // true iff display output
- if ( (to_display && fl_can_do_alpha_blending()) ||
Fl_Surface_Device::surface()->type() == Fl_Printer::device_type) {
+ int to_display = Fl_Surface_Device::surface()->class_name() ==
Fl_Display_Device::class_id; // true iff display output
+ if ( (to_display && fl_can_do_alpha_blending()) ||
Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) {
alpha_ok = fl_alpha_blend(fl_gc, x, y, w, h, new_gc, srcx, srcy, w, h,
blendfunc);
}
// if that failed (it shouldn't), still copy the bitmap over, but now alpha
is 1
Modified: branches/branch-1.3/src/Fl_GDI_Printer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_GDI_Printer.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_GDI_Printer.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -36,7 +36,7 @@
Fl_System_Printer::Fl_System_Printer(void) : Fl_Paged_Device() {
hPr = NULL;
- type_ = device_type;
+ class_name(class_id);
driver(fl_graphics_driver);
}
Modified: branches/branch-1.3/src/Fl_Paged_Device.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Paged_Device.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_Paged_Device.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -32,7 +32,7 @@
#include <FL/Fl.H>
#include <FL/fl_draw.H>
-const char *Fl_Paged_Device::device_type = "Fl_Paged_Device";
+const char *Fl_Paged_Device::class_id = "Fl_Paged_Device";
/**
Modified: branches/branch-1.3/src/Fl_Pixmap.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Pixmap.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_Pixmap.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -145,7 +145,7 @@
}
fl_end_offscreen();
}
- if (fl_surface->type() == Fl_Printer::device_type) {
+ if (fl_surface->class_name() == Fl_Printer::class_id) {
typedef BOOL (WINAPI* fl_transp_func)
(HDC,int,int,int,int,HDC,int,int,int,int,UINT);
static HMODULE hMod = NULL;
static fl_transp_func fl_TransparentBlt = NULL;
Modified: branches/branch-1.3/src/Fl_PostScript.cxx
===================================================================
--- branches/branch-1.3/src/Fl_PostScript.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_PostScript.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -32,8 +32,8 @@
#include <FL/Fl_PostScript.H>
#include <FL/Fl_Native_File_Chooser.H>
-const char *Fl_PostScript_Graphics_Driver::device_type =
"Fl_PostScript_Graphics_Driver";
-const char *Fl_PostScript_File_Device::device_type =
"Fl_PostScript_File_Device";
+const char *Fl_PostScript_Graphics_Driver::class_id =
"Fl_PostScript_Graphics_Driver";
+const char *Fl_PostScript_File_Device::class_id = "Fl_PostScript_File_Device";
/** \brief Label of the PostScript file chooser window */
const char *Fl_PostScript_File_Device::file_chooser_title = "Select a .ps
file";
@@ -47,7 +47,7 @@
lang_level_ = 2;
mask = 0;
ps_filename_ = NULL;
- type_ = device_type;
+ class_name(class_id);
scale_x = scale_y = 1.;
bg_r = bg_g = bg_b = 255;
}
@@ -62,7 +62,7 @@
*/
Fl_PostScript_File_Device::Fl_PostScript_File_Device(void)
{
- type_ = device_type;
+ class_name(class_id);
#ifdef __APPLE__
gc = fl_gc; // the display context is used by fl_text_extents()
#endif
Modified: branches/branch-1.3/src/Fl_Printer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Printer.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_Printer.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -76,11 +76,11 @@
/** [this text may be customized at run-time] */
const char *Fl_Printer::property_cancel = "Cancel";
-const char *Fl_Printer::device_type = "Fl_Printer";
+const char *Fl_Printer::class_id = "Fl_Printer";
#if defined(__APPLE__) || defined(WIN32)
-const char *Fl_System_Printer::device_type = "Fl_Printer";
+const char *Fl_System_Printer::class_id = "Fl_Printer";
#elif !defined(FL_DOXYGEN)
-const char *Fl_PostScript_Printer::device_type = "Fl_Printer";
+const char *Fl_PostScript_Printer::class_id = "Fl_Printer";
#endif
#if defined(__APPLE__) || defined(WIN32)
Modified: branches/branch-1.3/src/Fl_Quartz_Printer.mm
===================================================================
--- branches/branch-1.3/src/Fl_Quartz_Printer.mm 2011-01-04 22:04:54 UTC
(rev 8189)
+++ branches/branch-1.3/src/Fl_Quartz_Printer.mm 2011-01-05 10:21:45 UTC
(rev 8190)
@@ -40,7 +40,7 @@
x_offset = 0;
y_offset = 0;
scale_x = scale_y = 1.;
- type_ = device_type;
+ class_name(class_id);
gc = 0;
driver(fl_graphics_driver);
}
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-01-04 22:04:54 UTC (rev 8189)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-01-05 10:21:45 UTC (rev 8190)
@@ -3256,7 +3256,7 @@
// so a CGRect matches exactly what is denoted x,y,w,h for clipping purposes
CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h) {
- if ( Fl_Surface_Device::surface()->type() == Fl_Printer::device_type )
return CGRectMake(x, y, w-1.5 , h-1.5 );
+ if ( Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id )
return CGRectMake(x, y, w-1.5 , h-1.5 );
return CGRectMake(x, y, w > 0 ? w - 0.9 : 0, h > 0 ? h - 0.9 : 0);
}
Modified: branches/branch-1.3/src/Fl_win32.cxx
===================================================================
--- branches/branch-1.3/src/Fl_win32.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/Fl_win32.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -1911,7 +1911,7 @@
}
Fl_Region XRectangleRegion(int x, int y, int w, int h) {
- if (Fl_Surface_Device::surface()->type() == Fl_Display_Device::device_type)
return CreateRectRgn(x,y,x+w,y+h);
+ if (Fl_Surface_Device::surface()->class_name() ==
Fl_Display_Device::class_id) return CreateRectRgn(x,y,x+w,y+h);
// because rotation may apply, the rectangle becomes a polygon in device
coords
POINT pt[4] = { {x, y}, {x + w, y}, {x + w, y + h}, {x, y + h} };
LPtoDP(fl_gc, pt, 4);
Modified: branches/branch-1.3/src/fl_draw_image_win32.cxx
===================================================================
--- branches/branch-1.3/src/fl_draw_image_win32.cxx 2011-01-04 22:04:54 UTC
(rev 8189)
+++ branches/branch-1.3/src/fl_draw_image_win32.cxx 2011-01-05 10:21:45 UTC
(rev 8190)
@@ -255,7 +255,7 @@
}
}
}
- if(Fl_Surface_Device::surface()->type() == Fl_Printer::device_type) {
+ if(Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) {
// if print context, device and logical units are not equal, so
SetDIBitsToDevice
// does not do the expected job, whereas StretchDIBits does it.
StretchDIBits(fl_gc, x, y+j-k, w, k, 0, 0, w, k,
Modified: branches/branch-1.3/src/fl_draw_pixmap.cxx
===================================================================
--- branches/branch-1.3/src/fl_draw_pixmap.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/fl_draw_pixmap.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -341,7 +341,7 @@
#endif
#ifdef __APPLE_QUARTZ__
- if (fl_graphics_driver->type() == Fl_Quartz_Graphics_Driver::device_type ) {
+ if (fl_graphics_driver->class_name() == Fl_Quartz_Graphics_Driver::class_id
) {
bool transparent = (transparent_index>=0);
transparent = true;
U32 *array = new U32[d.w * d.h], *q = array;
Modified: branches/branch-1.3/src/fl_font_win32.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_win32.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/fl_font_win32.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -250,7 +250,7 @@
// if printer context, extents shd be converted to logical coords
#define EXTENTS_UPDATE(x,y,w,h) \
- if (Fl_Surface_Device::surface()->type() == Fl_Printer::device_type) {
on_printer_extents_update(x,y,w,h); }
+ if (Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) {
on_printer_extents_update(x,y,w,h); }
static unsigned short *ext_buff = NULL; // UTF-16 converted version of input
UTF-8 string
static unsigned wc_len = 0; // current string buffer dimension
Modified: branches/branch-1.3/src/fl_line_style.cxx
===================================================================
--- branches/branch-1.3/src/fl_line_style.cxx 2011-01-04 22:04:54 UTC (rev
8189)
+++ branches/branch-1.3/src/fl_line_style.cxx 2011-01-05 10:21:45 UTC (rev
8190)
@@ -127,7 +127,7 @@
fl_quartz_line_width_ = (float)width;
fl_quartz_line_cap_ = Cap[(style>>8)&3];
// when printing kCGLineCapSquare seems better for solid lines
- if ( Fl_Surface_Device::surface()->type() == Fl_Printer::device_type &&
style == FL_SOLID && dashes == NULL ) {
+ if ( Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id &&
style == FL_SOLID && dashes == NULL ) {
fl_quartz_line_cap_ = kCGLineCapSquare;
}
fl_quartz_line_join_ = Join[(style>>12)&3];
Modified: branches/branch-1.3/src/fl_rect.cxx
===================================================================
--- branches/branch-1.3/src/fl_rect.cxx 2011-01-04 22:04:54 UTC (rev 8189)
+++ branches/branch-1.3/src/fl_rect.cxx 2011-01-05 10:21:45 UTC (rev 8190)
@@ -49,7 +49,7 @@
#ifdef __APPLE_QUARTZ__
extern float fl_quartz_line_width_;
-#define USINGQUARTZPRINTER (Fl_Surface_Device::surface()->type() ==
Fl_Printer::device_type)
+#define USINGQUARTZPRINTER (Fl_Surface_Device::surface()->class_name() ==
Fl_Printer::class_id)
#endif
#ifdef USE_X11
@@ -627,7 +627,7 @@
return XRectInRegion(r, x, y, w, h);
#elif defined(WIN32)
RECT rect;
- if (Fl_Surface_Device::surface()->type() == Fl_Printer::device_type) { // in
case of print context, convert coords from logical to device
+ if (Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) { //
in case of print context, convert coords from logical to device
POINT pt[2] = { {x, y}, {x + w, y + h} };
LPtoDP(fl_gc, pt, 2);
rect.left = pt[0].x; rect.top = pt[0].y; rect.right = pt[1].x; rect.bottom
= pt[1].y;
@@ -687,7 +687,7 @@
} else { // partial intersection
RECT rect;
GetRgnBox(temp, &rect);
- if(Fl_Surface_Device::surface()->type() == Fl_Printer::device_type) { //
if print context, convert coords from device to logical
+ if(Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) {
// if print context, convert coords from device to logical
POINT pt[2] = { {rect.left, rect.top}, {rect.right, rect.bottom} };
DPtoLP(fl_gc, pt, 2);
X = pt[0].x; Y = pt[0].y; W = pt[1].x - X; H = pt[1].y - Y;
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit