mirror of
https://github.com/fltk/fltk.git
synced 2026-05-23 15:56:10 +08:00
Merge of branch-1.3-Fl_Printer, with the following main changes:
(1) adding Fl_Device class (and more) for device abstraction (2) adding Fl_Pinter class (and more) for printing support. Todo: Code cleanup, update dependencies, remove/replace test print window. I'm looking into converting the test window popup in a global shortcut that would pop up the print dialog now... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7263 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+203
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* Fl_Device.H
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Fl_Device_H
|
||||
#define Fl_Device_H
|
||||
|
||||
#include <FL/x.H>
|
||||
#ifdef WIN32
|
||||
#include <Commdlg.h>
|
||||
#elif defined(__APPLE__)
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
class Fl_Image;
|
||||
class Fl_RGB_Image;
|
||||
class Fl_Pixmap;
|
||||
class Fl_Bitmap;
|
||||
class Fl_Display;
|
||||
extern Fl_Display *fl_display_device;
|
||||
typedef void (*Fl_Draw_Image_Cb)(void* ,int,int,int,uchar*);
|
||||
|
||||
/**
|
||||
@brief A pure virtual class subclassed to send graphics output to display, local files, or printers.
|
||||
*/
|
||||
class Fl_Device {
|
||||
protected:
|
||||
int type_;
|
||||
uchar bg_r_, bg_g_, bg_b_; // color for background and/or mixing if particular device does not support masking and/or alpha
|
||||
friend void fl_rect(int x, int y, int w, int h);
|
||||
friend void fl_rectf(int x, int y, int w, int h);
|
||||
friend void fl_line_style(int style, int width, char* dashes);
|
||||
friend void fl_xyline(int x, int y, int x1);
|
||||
friend void fl_xyline(int x, int y, int x1, int y2);
|
||||
friend void fl_xyline(int x, int y, int x1, int y2, int x3);
|
||||
friend void fl_yxline(int x, int y, int y1);
|
||||
friend void fl_yxline(int x, int y, int y1, int x2);
|
||||
friend void fl_yxline(int x, int y, int y1, int x2, int y3);
|
||||
friend void fl_line(int x, int y, int x1, int y1);
|
||||
friend void fl_line(int x, int y, int x1, int y1, int x2, int y2);
|
||||
friend void fl_draw(const char *str, int n, int x, int y);
|
||||
friend void fl_draw(int angle, const char *str, int n, int x, int y);
|
||||
friend void fl_font(Fl_Font face, Fl_Fontsize size);
|
||||
friend void fl_color(Fl_Color c);
|
||||
friend void fl_color(uchar r, uchar g, uchar b);
|
||||
friend void fl_point(int x, int y);
|
||||
friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2);
|
||||
friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2);
|
||||
friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
friend void fl_concat();
|
||||
friend void fl_reconcat();
|
||||
friend void fl_begin_points();
|
||||
friend void fl_begin_line();
|
||||
friend void fl_begin_loop();
|
||||
friend void fl_begin_polygon();
|
||||
friend void fl_vertex(double x, double y);
|
||||
friend void fl_curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3);
|
||||
friend void fl_circle(double x, double y, double r);
|
||||
friend void fl_arc(double x, double y, double r, double start, double a);
|
||||
friend void fl_arc(int x, int y, int w, int h, double a1, double a2);
|
||||
friend void fl_pie(int x, int y, int w, int h, double a1, double a2);
|
||||
friend void fl_end_points();
|
||||
friend void fl_end_line();
|
||||
friend void fl_end_loop();
|
||||
friend void fl_end_polygon();
|
||||
friend void fl_transformed_vertex(double x, double y);
|
||||
friend void fl_push_clip(int x, int y, int w, int h);
|
||||
friend int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
|
||||
friend int fl_not_clipped(int x, int y, int w, int h);
|
||||
friend void fl_push_no_clip();
|
||||
friend void fl_pop_clip();
|
||||
friend void fl_begin_complex_polygon();
|
||||
friend void fl_gap();
|
||||
friend void fl_end_complex_polygon();
|
||||
friend void fl_draw_image(const uchar*, int,int,int,int, int delta, int ldelta);
|
||||
friend void fl_draw_image_mono(const uchar*, int,int,int,int, int delta, int ld);
|
||||
friend void fl_draw_image(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta);
|
||||
friend void fl_draw_image_mono(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta);
|
||||
|
||||
virtual void rect(int x, int y, int w, int h);
|
||||
virtual void rectf(int x, int y, int w, int h);
|
||||
virtual void line_style(int style, int width=0, char* dashes=0);
|
||||
virtual void xyline(int x, int y, int x1);
|
||||
virtual void xyline(int x, int y, int x1, int y2);
|
||||
virtual void xyline(int x, int y, int x1, int y2, int x3);
|
||||
virtual void yxline(int x, int y, int y1);
|
||||
virtual void yxline(int x, int y, int y1, int x2);
|
||||
virtual void yxline(int x, int y, int y1, int x2, int y3);
|
||||
virtual void line(int x, int y, int x1, int y1);
|
||||
virtual void line(int x, int y, int x1, int y1, int x2, int y2);
|
||||
virtual void draw(const char *str, int n, int x, int y);
|
||||
virtual void draw(int angle, const char *str, int n, int x, int y);
|
||||
virtual void font(Fl_Font face, Fl_Fontsize size);
|
||||
virtual void color(Fl_Color c);
|
||||
virtual void color(uchar r, uchar g, uchar b);
|
||||
virtual void point(int x, int y);
|
||||
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
|
||||
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
|
||||
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
virtual void begin_points();
|
||||
virtual void begin_line();
|
||||
virtual void begin_loop();
|
||||
virtual void begin_polygon();
|
||||
virtual void vertex(double x, double y);
|
||||
virtual void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3);
|
||||
virtual void circle(double x, double y, double r);
|
||||
virtual void arc(double x, double y, double r, double start, double a);
|
||||
virtual void arc(int x, int y, int w, int h, double a1, double a2);
|
||||
virtual void pie(int x, int y, int w, int h, double a1, double a2);
|
||||
virtual void end_points();
|
||||
virtual void end_line();
|
||||
virtual void end_loop();
|
||||
virtual void end_polygon();
|
||||
virtual void begin_complex_polygon();
|
||||
virtual void gap();
|
||||
virtual void end_complex_polygon();
|
||||
virtual void transformed_vertex(double x, double y);
|
||||
virtual void push_clip(int x, int y, int w, int h);
|
||||
virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
|
||||
virtual int not_clipped(int x, int y, int w, int h);
|
||||
virtual void push_no_clip();
|
||||
virtual void pop_clip();
|
||||
// Images
|
||||
virtual void draw_image(const uchar*, int,int,int,int, int delta=3, int ldelta=0);
|
||||
virtual void draw_image_mono(const uchar*, int,int,int,int, int delta=1, int ld=0);
|
||||
virtual void draw_image(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=3);
|
||||
virtual void draw_image_mono(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=1);
|
||||
// Image classes
|
||||
virtual void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
|
||||
virtual void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
|
||||
virtual void draw(Fl_Bitmap * bmp,int XP, int YP, int WP, int HP, int cx, int cy);
|
||||
|
||||
public:
|
||||
enum device_types {
|
||||
xlib_display = 0, quartz_display, gdi_display,
|
||||
gdi_printer = 256, quartz_printer, postscript_device
|
||||
};
|
||||
/**
|
||||
@brief An RTTI emulation of device classes. It returns values < 256 if it is a screen device
|
||||
*/
|
||||
int type() {return type_;};
|
||||
/**
|
||||
@brief Sets this device (display, local file, printer) as the target of future graphics calls.
|
||||
*
|
||||
@return The current target device of graphics calls.
|
||||
*/
|
||||
virtual Fl_Device *set_current();
|
||||
|
||||
virtual ~Fl_Device() {};
|
||||
|
||||
/**
|
||||
@brief Returns the current target device of graphics calls.
|
||||
*/
|
||||
static Fl_Device *current();
|
||||
|
||||
/**
|
||||
@brief Returns the platform's display device.
|
||||
*/
|
||||
static Fl_Display *display_device() { return fl_display_device; };
|
||||
|
||||
};
|
||||
extern Fl_Device *fl_device;
|
||||
|
||||
/**
|
||||
@brief A virtual class subclassed for OS-specific display graphics.
|
||||
*/
|
||||
class Fl_Display : public Fl_Device {
|
||||
friend class Fl_PSfile_Device; //RK: temporary hack for font sizes
|
||||
};
|
||||
|
||||
#if defined(__APPLE__) || defined(FL_DOXYGEN)
|
||||
/**
|
||||
@brief The Mac OS X-specific display graphics class.
|
||||
*/
|
||||
class Fl_Quartz_Display : public Fl_Display {
|
||||
public:
|
||||
Fl_Quartz_Display() { type_ = quartz_display; };
|
||||
};
|
||||
#endif
|
||||
#if defined(WIN32) || defined(FL_DOXYGEN)
|
||||
/**
|
||||
@brief The MSWindows-specific display graphics class.
|
||||
*/
|
||||
class Fl_GDI_Display : public Fl_Display {
|
||||
public:
|
||||
Fl_GDI_Display() { type_ = gdi_display; };
|
||||
};
|
||||
#endif
|
||||
#if !( defined(__APPLE__) || defined(WIN32)) || defined(FL_DOXYGEN)
|
||||
/**
|
||||
@brief The X11-specific display graphics class.
|
||||
*/
|
||||
class Fl_Xlib_Display : public Fl_Display {
|
||||
public:
|
||||
Fl_Xlib_Display() { type_ = xlib_display; };
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // Fl_Device_H
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Fl_Gl_Printer.H
|
||||
*
|
||||
*/
|
||||
|
||||
#include <FL/Fl_Printer.H>
|
||||
#include <FL/Fl_Gl_Window.H>
|
||||
|
||||
/**
|
||||
* @brief To print Fl_Gl_Window's.
|
||||
*
|
||||
Because Fl_Printer::print_widget() prints only the background of Fl_Gl_Window's,
|
||||
this class is to be used to print them.
|
||||
*/
|
||||
class Fl_Gl_Printer : public Fl_Printer {
|
||||
public:
|
||||
/**
|
||||
@brief The constructor.
|
||||
*/
|
||||
Fl_Gl_Printer(void) : Fl_Printer() {}
|
||||
|
||||
/**
|
||||
@brief Prints an Fl_Gl_Window.
|
||||
*
|
||||
Under MSWindows, take care to move the print dialog window(s) out of the target OpenGL window(s)
|
||||
before closing them.
|
||||
@param[in] glw an Fl_Gl_Window to be printed.
|
||||
@param[in] delta_x Optional horizontal offset for positioning the window relatively
|
||||
to the current origin of graphics functions.
|
||||
@param[in] delta_y Same as above, vertically.
|
||||
*/
|
||||
void print_gl_window(Fl_Gl_Window *glw, int delta_x = 0, int delta_y = 0);
|
||||
};
|
||||
+539
File diff suppressed because it is too large
Load Diff
+105
-48
@@ -35,21 +35,25 @@
|
||||
|
||||
#include "Enumerations.H" // for the color names
|
||||
#include "Fl_Window.H" // for fl_set_spot()
|
||||
#include "Fl_Device.H"
|
||||
|
||||
// Image class...
|
||||
class Fl_Image;
|
||||
|
||||
// Label flags...
|
||||
FL_EXPORT extern char fl_draw_shortcut;
|
||||
extern Fl_Device *fl_device;
|
||||
|
||||
/** \addtogroup fl_attributes
|
||||
@{
|
||||
*/
|
||||
// Colors:
|
||||
FL_EXPORT void fl_color(Fl_Color i); // select indexed color
|
||||
//FL_EXPORT void fl_color(Fl_Color i); // select indexed color
|
||||
inline void fl_color(Fl_Color i) {fl_device->color(i); }; // select indexed color
|
||||
/** for back compatibility - use fl_color(Fl_Color c) instead */
|
||||
inline void fl_color(int c) {fl_color((Fl_Color)c);}
|
||||
FL_EXPORT void fl_color(uchar r, uchar g, uchar b); // select actual color
|
||||
//FL_EXPORT void fl_color(uchar r, uchar g, uchar b); // select actual color
|
||||
inline void fl_color(uchar r, uchar g, uchar b) {fl_device->color(r,g,b); }; // select actual color
|
||||
extern FL_EXPORT Fl_Color fl_color_;
|
||||
/**
|
||||
Returns the last fl_color() that was set.
|
||||
@@ -62,19 +66,27 @@ inline Fl_Color fl_color() {return fl_color_;}
|
||||
@{
|
||||
*/
|
||||
// clip:
|
||||
FL_EXPORT void fl_push_clip(int x, int y, int w, int h);
|
||||
//FL_EXPORT void fl_push_clip(int x, int y, int w, int h);
|
||||
inline void fl_push_clip(int x, int y, int w, int h) {fl_device->push_clip(x,y,w,h); };
|
||||
/** The fl_clip() name is deprecated and will be removed from future releases */
|
||||
#define fl_clip fl_push_clip
|
||||
FL_EXPORT void fl_push_no_clip();
|
||||
FL_EXPORT void fl_pop_clip();
|
||||
FL_EXPORT int fl_not_clipped(int x, int y, int w, int h);
|
||||
FL_EXPORT int fl_clip_box(int, int, int, int, int& x, int& y, int& w, int& h);
|
||||
//FL_EXPORT void fl_push_no_clip();
|
||||
inline void fl_push_no_clip() {fl_device->push_no_clip(); };
|
||||
//FL_EXPORT void fl_pop_clip();
|
||||
inline void fl_pop_clip() {fl_device->pop_clip(); };
|
||||
//FL_EXPORT int fl_not_clipped(int x, int y, int w, int h);
|
||||
inline int fl_not_clipped(int x, int y, int w, int h) {return fl_device->not_clipped(x,y,w,h); };
|
||||
//FL_EXPORT int fl_clip_box(int, int, int, int, int& x, int& y, int& w, int& h);
|
||||
inline int fl_clip_box(int x , int y, int w, int h, int& X, int& Y, int& W, int& H)
|
||||
{return fl_device->clip_box(x,y,w,h,X,Y,W,H); };
|
||||
|
||||
// points:
|
||||
FL_EXPORT void fl_point(int x, int y);
|
||||
//FL_EXPORT void fl_point(int x, int y);
|
||||
inline void fl_point(int x, int y) { fl_device->point(x,y); };
|
||||
|
||||
// line type:
|
||||
FL_EXPORT void fl_line_style(int style, int width=0, char* dashes=0);
|
||||
//FL_EXPORT void fl_line_style(int style, int width=0, char* dashes=0);
|
||||
inline void fl_line_style(int style, int width=0, char* dashes=0) {fl_device->line_style(style,width,dashes); };
|
||||
enum {
|
||||
FL_SOLID = 0, ///< line style: <tt>___________</tt>
|
||||
FL_DASH = 1, ///< line style: <tt>_ _ _ _ _ _</tt>
|
||||
@@ -92,10 +104,12 @@ enum {
|
||||
};
|
||||
|
||||
// rectangles tweaked to exactly fill the pixel rectangle:
|
||||
FL_EXPORT void fl_rect(int x, int y, int w, int h);
|
||||
//FL_EXPORT void fl_rect(int x, int y, int w, int h);
|
||||
inline void fl_rect(int x, int y, int w, int h) { fl_device->rect(x,y,w,h); };
|
||||
/** Draws a 1-pixel border \e inside the given bounding box */
|
||||
inline void fl_rect(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rect(x,y,w,h);}
|
||||
FL_EXPORT void fl_rectf(int x, int y, int w, int h);
|
||||
//FL_EXPORT void fl_rectf(int x, int y, int w, int h);
|
||||
inline void fl_rectf(int x, int y, int w, int h) { fl_device->rectf(x,y,w,h); };
|
||||
/** Colors a rectangle that exactly fills the given bounding box */
|
||||
inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rectf(x,y,w,h);}
|
||||
|
||||
@@ -109,30 +123,46 @@ inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_re
|
||||
FL_EXPORT void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b);
|
||||
|
||||
// line segments:
|
||||
FL_EXPORT void fl_line(int x, int y, int x1, int y1);
|
||||
FL_EXPORT void fl_line(int x, int y, int x1, int y1, int x2, int y2);
|
||||
//FL_EXPORT void fl_line(int x, int y, int x1, int y1);
|
||||
inline void fl_line(int x, int y, int x1, int y1) {fl_device->line(x,y,x1,y1); };
|
||||
//FL_EXPORT void fl_line(int x, int y, int x1, int y1, int x2, int y2);
|
||||
inline void fl_line(int x, int y, int x1, int y1, int x2, int y2) {fl_device->line(x,y,x1,y1,x2,y2); };
|
||||
|
||||
// closed line segments:
|
||||
FL_EXPORT void fl_loop(int x, int y, int x1, int y1, int x2, int y2);
|
||||
FL_EXPORT void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
//FL_EXPORT void fl_loop(int x, int y, int x1, int y1, int x2, int y2);
|
||||
inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {fl_device->loop(x,y,x1,y1,x2,y2); };
|
||||
//FL_EXPORT void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
|
||||
{fl_device->loop(x,y,x1,y1,x2,y2,x3,y3); };
|
||||
|
||||
// filled polygons
|
||||
FL_EXPORT void fl_polygon(int x, int y, int x1, int y1, int x2, int y2);
|
||||
FL_EXPORT void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
//FL_EXPORT void fl_polygon(int x, int y, int x1, int y1, int x2, int y2);
|
||||
inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {fl_device->polygon(x,y,x1,y1,x2,y2); };
|
||||
//FL_EXPORT void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
|
||||
{ fl_device->polygon(x,y,x1,y1,x2,y2,x3,y3); };
|
||||
|
||||
// draw rectilinear lines, horizontal segment first:
|
||||
FL_EXPORT void fl_xyline(int x, int y, int x1);
|
||||
FL_EXPORT void fl_xyline(int x, int y, int x1, int y2);
|
||||
FL_EXPORT void fl_xyline(int x, int y, int x1, int y2, int x3);
|
||||
//FL_EXPORT void fl_xyline(int x, int y, int x1);
|
||||
inline void fl_xyline(int x, int y, int x1) {fl_device->xyline(x,y,x1);};
|
||||
//FL_EXPORT void fl_xyline(int x, int y, int x1, int y2);
|
||||
inline void fl_xyline(int x, int y, int x1, int y2) {fl_device->xyline(x,y,x1,y2);};
|
||||
//FL_EXPORT void fl_xyline(int x, int y, int x1, int y2, int x3);
|
||||
inline void fl_xyline(int x, int y, int x1, int y2, int x3) {fl_device->xyline(x,y,x1,y2,x3);};
|
||||
|
||||
// draw rectilinear lines, vertical segment first:
|
||||
FL_EXPORT void fl_yxline(int x, int y, int y1);
|
||||
FL_EXPORT void fl_yxline(int x, int y, int y1, int x2);
|
||||
FL_EXPORT void fl_yxline(int x, int y, int y1, int x2, int y3);
|
||||
//FL_EXPORT void fl_yxline(int x, int y, int y1);
|
||||
inline void fl_yxline(int x, int y, int y1) {fl_device->yxline(x,y,y1);};
|
||||
//FL_EXPORT void fl_yxline(int x, int y, int y1, int x2);
|
||||
inline void fl_yxline(int x, int y, int y1, int x2) {fl_device->yxline(x,y,y1,x2);};
|
||||
//FL_EXPORT void fl_yxline(int x, int y, int y1, int x2, int y3);
|
||||
inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_device->yxline(x,y,y1,x2,y3);};
|
||||
|
||||
// circular lines and pie slices (code in fl_arci.C):
|
||||
FL_EXPORT void fl_arc(int x, int y, int w, int h, double a1, double a2);
|
||||
FL_EXPORT void fl_pie(int x, int y, int w, int h, double a1, double a2);
|
||||
//FL_EXPORT void fl_arc(int x, int y, int w, int h, double a1, double a2);
|
||||
inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {fl_device->arc(x,y,w,h,a1,a2); };
|
||||
//FL_EXPORT void fl_pie(int x, int y, int w, int h, double a1, double a2);
|
||||
inline void fl_pie(int x, int y, int w, int h, double a1, double a2) {fl_device->pie(x,y,w,h,a1,a2); };
|
||||
/** fl_chord declaration is a place holder - the function does not yet exist */
|
||||
FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // nyi
|
||||
|
||||
@@ -144,27 +174,44 @@ FL_EXPORT void fl_scale(double x);
|
||||
FL_EXPORT void fl_translate(double x, double y);
|
||||
FL_EXPORT void fl_rotate(double d);
|
||||
FL_EXPORT void fl_mult_matrix(double a, double b, double c, double d, double x,double y);
|
||||
FL_EXPORT void fl_begin_points();
|
||||
FL_EXPORT void fl_begin_line();
|
||||
FL_EXPORT void fl_begin_loop();
|
||||
FL_EXPORT void fl_begin_polygon();
|
||||
FL_EXPORT void fl_vertex(double x, double y);
|
||||
FL_EXPORT void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
|
||||
FL_EXPORT void fl_arc(double x, double y, double r, double start, double a);
|
||||
FL_EXPORT void fl_circle(double x, double y, double r);
|
||||
FL_EXPORT void fl_end_points();
|
||||
FL_EXPORT void fl_end_line();
|
||||
FL_EXPORT void fl_end_loop();
|
||||
FL_EXPORT void fl_end_polygon();
|
||||
FL_EXPORT void fl_begin_complex_polygon();
|
||||
FL_EXPORT void fl_gap();
|
||||
FL_EXPORT void fl_end_complex_polygon();
|
||||
//FL_EXPORT void fl_begin_points();
|
||||
inline void fl_begin_points() {fl_device->begin_points(); };
|
||||
//FL_EXPORT void fl_begin_line();
|
||||
inline void fl_begin_line() {fl_device->begin_line(); };
|
||||
//FL_EXPORT void fl_begin_loop();
|
||||
inline void fl_begin_loop() {fl_device->begin_loop(); };
|
||||
//FL_EXPORT void fl_begin_polygon();
|
||||
inline void fl_begin_polygon() {fl_device->begin_polygon(); };
|
||||
//FL_EXPORT void fl_vertex(double x, double y);
|
||||
inline void fl_vertex(double x, double y) {fl_device->vertex(x,y); };
|
||||
//FL_EXPORT void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
|
||||
inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
|
||||
{fl_device->curve(X0,Y0,X1,Y1,X2,Y2,X3,Y3); };
|
||||
//FL_EXPORT void fl_arc(double x, double y, double r, double start, double a);
|
||||
inline void fl_arc(double x, double y, double r, double start, double a) {fl_device->arc(x,y,r,start,a); };
|
||||
//FL_EXPORT void fl_circle(double x, double y, double r);
|
||||
inline void fl_circle(double x, double y, double r) {fl_device->circle(x,y,r); };
|
||||
//FL_EXPORT void fl_end_points();
|
||||
inline void fl_end_points() {fl_device->end_points(); };
|
||||
//FL_EXPORT void fl_end_line();
|
||||
inline void fl_end_line() {fl_device->end_line(); };
|
||||
//FL_EXPORT void fl_end_loop();
|
||||
inline void fl_end_loop() {fl_device->end_loop(); };
|
||||
//FL_EXPORT void fl_end_polygon();
|
||||
inline void fl_end_polygon() {fl_device->end_polygon(); };
|
||||
//FL_EXPORT void fl_begin_complex_polygon();
|
||||
inline void fl_begin_complex_polygon() {fl_device->begin_complex_polygon(); };
|
||||
//FL_EXPORT void fl_gap();
|
||||
inline void fl_gap() {fl_device->gap(); };
|
||||
//FL_EXPORT void fl_end_complex_polygon();
|
||||
inline void fl_end_complex_polygon() {fl_device->end_complex_polygon(); };
|
||||
// get and use transformed positions:
|
||||
FL_EXPORT double fl_transform_x(double x, double y);
|
||||
FL_EXPORT double fl_transform_y(double x, double y);
|
||||
FL_EXPORT double fl_transform_dx(double x, double y);
|
||||
FL_EXPORT double fl_transform_dy(double x, double y);
|
||||
FL_EXPORT void fl_transformed_vertex(double x, double y);
|
||||
//FL_EXPORT void fl_transformed_vertex(double x, double y);
|
||||
inline void fl_transformed_vertex(double x, double y) {fl_device->transformed_vertex(x,y); };
|
||||
/** @} */
|
||||
|
||||
/** \addtogroup fl_attributes
|
||||
@@ -181,7 +228,8 @@ FL_EXPORT void fl_transformed_vertex(double x, double y);
|
||||
*/
|
||||
|
||||
// Fonts:
|
||||
FL_EXPORT void fl_font(Fl_Font face, Fl_Fontsize size);
|
||||
//FL_EXPORT void fl_font(Fl_Font face, Fl_Fontsize size);
|
||||
inline void fl_font(Fl_Font face, Fl_Fontsize size) { fl_device->font(face,size); };
|
||||
extern FL_EXPORT Fl_Font fl_font_; ///< current font index
|
||||
|
||||
/**
|
||||
@@ -276,6 +324,7 @@ FL_EXPORT const char *fl_local_to_mac_roman(const char *t, int n=-1);
|
||||
to control characters.
|
||||
*/
|
||||
FL_EXPORT void fl_draw(const char* str, int x, int y);
|
||||
FL_EXPORT void fl_draw(int angle, const char* str, int x, int y);
|
||||
/**
|
||||
Draws a nul-terminated string starting at the given location and
|
||||
rotating \p angle degrees counterclockwise.
|
||||
@@ -283,16 +332,18 @@ FL_EXPORT void fl_draw(const char* str, int x, int y);
|
||||
function of the underlying OS and suported for Xft, Win32 and MacOS
|
||||
fltk subset.
|
||||
*/
|
||||
FL_EXPORT void fl_draw(int angle,const char* str, int x, int y);
|
||||
//FL_EXPORT void fl_draw(int angle,const char* str, int x, int y);
|
||||
/**
|
||||
Draws an array of \p n characters starting at the given location.
|
||||
*/
|
||||
FL_EXPORT void fl_draw(const char* str, int n, int x, int y);
|
||||
//FL_EXPORT void fl_draw(const char* str, int n, int x, int y);
|
||||
inline void fl_draw(const char* str, int n, int x, int y) {fl_device->draw(str,n,x,y); };
|
||||
/**
|
||||
Draws an array of \p n characters starting at the given location,
|
||||
rotating \p angle degrees counterclockwise.
|
||||
*/
|
||||
FL_EXPORT void fl_draw(int angle,const char* str, int n, int x, int y);
|
||||
//FL_EXPORT void fl_draw(int angle,const char* str, int n, int x, int y);
|
||||
inline void fl_draw(int angle,const char* str, int n, int x, int y) {fl_device->draw(angle,str,n,x,y); };
|
||||
/**
|
||||
Draws an array of \p n characters right to left starting at given location.
|
||||
*/
|
||||
@@ -356,13 +407,17 @@ typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
|
||||
any visual of 8 bits or less, and all common TrueColor visuals up
|
||||
to 32 bits.
|
||||
*/
|
||||
FL_EXPORT void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
|
||||
//FL_EXPORT void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
|
||||
inline void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0)
|
||||
{ fl_device->draw_image(buf, X, Y, W, H, D, L); };
|
||||
|
||||
/**
|
||||
Draw a gray-scale (1 channel) image.
|
||||
\see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L)
|
||||
*/
|
||||
FL_EXPORT void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
|
||||
//FL_EXPORT void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
|
||||
inline void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0)
|
||||
{ fl_device->draw_image_mono(buf, X, Y, W, H, D, L); };
|
||||
|
||||
/**
|
||||
Draw image using callback function to generate image data.
|
||||
@@ -396,7 +451,9 @@ FL_EXPORT void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int
|
||||
|
||||
If \p D is 4 or more, you must fill in the unused bytes with zero.
|
||||
*/
|
||||
FL_EXPORT void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
|
||||
//FL_EXPORT void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
|
||||
inline void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3)
|
||||
{ fl_device->draw_image(cb, data, X, Y, W, H, D); };
|
||||
|
||||
/**
|
||||
Draw gray-scale image using callback function to generate image data.
|
||||
|
||||
@@ -73,19 +73,19 @@ struct XPoint { int x, y; };
|
||||
struct XRectangle {int x, y, width, height;};
|
||||
|
||||
#ifdef __APPLE_COCOA__
|
||||
// necessary so a CGRect matches exactly what is denoted x,y,w,h for clipping purposes
|
||||
#define FL_CGRECTMAKE_COCOA(x,y,w,h) CGRectMake(x, y, w > 0 ? w - 0.9 : 0, h > 0 ? h - 0.9 : 0)
|
||||
|
||||
typedef void *Window; // this is really a pter to the subclass FLWindow of NSWindow
|
||||
typedef struct flCocoaRegion {
|
||||
int count;
|
||||
CGRect *rects;
|
||||
} *Fl_Region; // a region is the union of a series of rectangles
|
||||
extern CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h);
|
||||
|
||||
inline Fl_Region XRectangleRegion(int x, int y, int w, int h) {
|
||||
Fl_Region R = (Fl_Region)malloc(sizeof(*R));
|
||||
R->count = 1;
|
||||
R->rects = (CGRect *)malloc(sizeof(CGRect));
|
||||
*(R->rects) = FL_CGRECTMAKE_COCOA(x, y, w, h);
|
||||
*(R->rects) = fl_cgrectmake_cocoa(x, y, w, h);
|
||||
return R;
|
||||
}
|
||||
inline void XDestroyRegion(Fl_Region r) {
|
||||
|
||||
+3
-3
@@ -45,15 +45,15 @@
|
||||
#define VK_APPS 0x5D
|
||||
#endif
|
||||
|
||||
#include <FL/Fl_Device.H>
|
||||
|
||||
// some random X equivalents
|
||||
typedef HWND Window;
|
||||
typedef POINT XPoint;
|
||||
struct XRectangle {int x, y, width, height;};
|
||||
typedef HRGN Fl_Region;
|
||||
FL_EXPORT void fl_clip_region(Fl_Region);
|
||||
inline Fl_Region XRectangleRegion(int x, int y, int w, int h) {
|
||||
return CreateRectRgn(x,y,x+w,y+h);
|
||||
}
|
||||
extern Fl_Region XRectangleRegion(int x, int y, int w, int h);
|
||||
inline void XDestroyRegion(Fl_Region r) {DeleteObject(r);}
|
||||
inline void XClipBox(Fl_Region r,XRectangle* rect) {
|
||||
RECT win_rect; GetRgnBox(r,&win_rect);
|
||||
|
||||
+136
-124
@@ -5,8 +5,8 @@ CodeEditor.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H
|
||||
CodeEditor.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Text_Buffer.H
|
||||
CodeEditor.o: ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
CodeEditor.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
CodeEditor.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
CodeEditor.o: ../FL/Fl_Text_Buffer.H
|
||||
CodeEditor.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Scrollbar.H
|
||||
CodeEditor.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H
|
||||
Fl_Function_Type.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
|
||||
Fl_Function_Type.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Preferences.H
|
||||
@@ -25,8 +25,9 @@ Fl_Function_Type.o: ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Return_Button.H ../FL/fl_ask.H Fl_Type.h
|
||||
Fl_Function_Type.o: ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Plugin.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
Fl_Function_Type.o: ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Device.H
|
||||
Fl_Function_Type.o: ../FL/x.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Window.H
|
||||
Fl_Function_Type.o: ../FL/Fl_Menu_Bar.H ../FL/fl_show_input.H ../FL/fl_ask.H
|
||||
Fl_Function_Type.o: ../src/flstring.h ../config.h function_panel.h
|
||||
@@ -42,24 +43,25 @@ Fl_Group_Type.o: ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Widget.H ../FL/Fl_Image.H ../FL/Fl_Plugin.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Preferences.H Fluid_Image.h ../FL/Fl_Shared_Image.H
|
||||
Fl_Group_Type.o: ../FL/fl_draw.H ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H
|
||||
Fl_Group_Type.o: ../src/flstring.h ../config.h ../FL/Fl_Scroll.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Window.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Menu_Bar.H ../src/flstring.h ../config.h
|
||||
Fl_Group_Type.o: ../FL/Fl_Scroll.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
Fl_Group_Type.o: ../FL/Fl_Valuator.H
|
||||
Fl_Menu_Type.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
Fl_Menu_Type.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_Menu_Type.o: ../FL/fl_types.h Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Image.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
|
||||
Fl_Menu_Type.o: Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/fl_draw.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Tabs.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H
|
||||
Fl_Menu_Type.o: alignment_panel.h ../FL/Fl_Text_Buffer.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Device.H
|
||||
Fl_Menu_Type.o: ../FL/x.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Window.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Menu_Bar.H alignment_panel.h ../FL/Fl_Text_Buffer.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Scrollbar.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H
|
||||
Fl_Menu_Type.o: ../FL/Fl_Double_Window.H ../FL/Fl_Preferences.H
|
||||
@@ -75,19 +77,20 @@ Fl_Type.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_Type.o: ../FL/fl_types.h ../FL/Fl_Browser_.H ../FL/Fl_Group.H
|
||||
Fl_Type.o: ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
Fl_Type.o: ../FL/Fl_Valuator.H ../FL/fl_draw.H ../FL/Fl_Window.H
|
||||
Fl_Type.o: ../src/flstring.h ../config.h Fl_Type.h ../FL/Fl_Widget.H
|
||||
Fl_Type.o: ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
|
||||
Fl_Type.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
Fl_Type.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
Fl_Type.o: ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
Fl_Type.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H
|
||||
Fl_Type.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
Fl_Type.o: ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H undo.h ../FL/Fl_Pixmap.H
|
||||
Fl_Type.o: pixmaps/lock.xpm pixmaps/protected.xpm pixmaps/flWindow.xpm
|
||||
Fl_Type.o: pixmaps/flButton.xpm pixmaps/flCheckButton.xpm
|
||||
Fl_Type.o: pixmaps/flRoundButton.xpm pixmaps/flBox.xpm pixmaps/flGroup.xpm
|
||||
Fl_Type.o: pixmaps/flFunction.xpm pixmaps/flCode.xpm pixmaps/flCodeBlock.xpm
|
||||
Fl_Type.o: pixmaps/flComment.xpm pixmaps/flDeclaration.xpm
|
||||
Fl_Type.o: ../FL/Fl_Device.H ../FL/x.H ../src/flstring.h ../config.h
|
||||
Fl_Type.o: Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H
|
||||
Fl_Type.o: ../FL/Fl_Image.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
|
||||
Fl_Type.o: Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/Fl_Tabs.H
|
||||
Fl_Type.o: ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H
|
||||
Fl_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
|
||||
Fl_Type.o: ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H
|
||||
Fl_Type.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H undo.h
|
||||
Fl_Type.o: ../FL/Fl_Pixmap.H pixmaps/lock.xpm pixmaps/protected.xpm
|
||||
Fl_Type.o: pixmaps/flWindow.xpm pixmaps/flButton.xpm
|
||||
Fl_Type.o: pixmaps/flCheckButton.xpm pixmaps/flRoundButton.xpm
|
||||
Fl_Type.o: pixmaps/flBox.xpm pixmaps/flGroup.xpm pixmaps/flFunction.xpm
|
||||
Fl_Type.o: pixmaps/flCode.xpm pixmaps/flCodeBlock.xpm pixmaps/flComment.xpm
|
||||
Fl_Type.o: pixmaps/flData.xpm pixmaps/flDeclaration.xpm
|
||||
Fl_Type.o: pixmaps/flDeclarationBlock.xpm pixmaps/flClass.xpm
|
||||
Fl_Type.o: pixmaps/flTabs.xpm pixmaps/flInput.xpm pixmaps/flChoice.xpm
|
||||
Fl_Type.o: pixmaps/flMenuitem.xpm pixmaps/flMenubar.xpm pixmaps/flSubmenu.xpm
|
||||
@@ -112,10 +115,11 @@ Fl_Widget_Type.o: Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
Fl_Widget_Type.o: ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Window.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Group.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H alignment_panel.h
|
||||
Fl_Widget_Type.o: ../FL/Fl_Group.H ../FL/Fl_Device.H ../FL/x.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Window.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Menu_Bar.H alignment_panel.h
|
||||
Fl_Widget_Type.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H
|
||||
Fl_Widget_Type.o: ../FL/fl_draw.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H
|
||||
@@ -136,12 +140,13 @@ Fl_Window_Type.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
Fl_Window_Type.o: ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
Fl_Window_Type.o: ../FL/fl_message.H ../FL/fl_ask.H ../FL/fl_draw.H ../FL/x.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Round_Button.H ../FL/Fl_Light_Button.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Button.H Fl_Widget_Type.h Fl_Type.h
|
||||
Fl_Window_Type.o: ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
Fl_Window_Type.o: ../FL/fl_message.H ../FL/fl_ask.H ../FL/fl_draw.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Menu_Item.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Image.H ../FL/Fl_Round_Button.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H Fl_Widget_Type.h
|
||||
Fl_Window_Type.o: Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Plugin.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
Fl_Window_Type.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
Fl_Window_Type.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H
|
||||
@@ -165,18 +170,18 @@ Fluid_Image.o: ../FL/fl_types.h ../FL/Fl_Widget.H Fl_Type.h ../FL/Fl_Menu.H
|
||||
Fluid_Image.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
|
||||
Fluid_Image.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
Fluid_Image.o: ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Window.H
|
||||
Fluid_Image.o: ../FL/Fl_Group.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
Fluid_Image.o: ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
Fluid_Image.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H
|
||||
Fluid_Image.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
Fluid_Image.o: ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H ../src/flstring.h
|
||||
Fluid_Image.o: ../config.h ../FL/filename.H ../FL/Fl_File_Chooser.H
|
||||
Fluid_Image.o: ../FL/Fl_Double_Window.H ../FL/Fl_Button.H
|
||||
Fluid_Image.o: ../FL/Fl_Preferences.H ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H
|
||||
Fluid_Image.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
|
||||
Fluid_Image.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H
|
||||
Fluid_Image.o: ../FL/Fl.H ../FL/filename.H ../FL/Fl_Box.H
|
||||
Fluid_Image.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
|
||||
Fluid_Image.o: ../FL/Fl_Group.H ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Tabs.H
|
||||
Fluid_Image.o: ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H
|
||||
Fluid_Image.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
|
||||
Fluid_Image.o: ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H
|
||||
Fluid_Image.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H
|
||||
Fluid_Image.o: ../src/flstring.h ../config.h ../FL/filename.H
|
||||
Fluid_Image.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Double_Window.H
|
||||
Fluid_Image.o: ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H
|
||||
Fluid_Image.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
|
||||
Fluid_Image.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
Fluid_Image.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H
|
||||
Fluid_Image.o: ../FL/Fl_Box.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
|
||||
Fluid_Image.o: ../FL/Fl_Button.H ../FL/Fl_File_Input.H
|
||||
Fluid_Image.o: ../FL/Fl_Return_Button.H ../FL/fl_ask.H
|
||||
about_panel.o: about_panel.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
|
||||
@@ -192,21 +197,23 @@ align_widget.o: ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H
|
||||
align_widget.o: ../FL/Fl_Widget.H ../FL/Fl_Image.H ../FL/Fl_Plugin.H
|
||||
align_widget.o: ../FL/Fl_Preferences.H Fluid_Image.h ../FL/Fl_Shared_Image.H
|
||||
align_widget.o: ../FL/fl_draw.H ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
align_widget.o: ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
|
||||
align_widget.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H
|
||||
align_widget.o: ../FL/Fl_Menu_.H ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H
|
||||
align_widget.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Menu_Bar.H undo.h
|
||||
align_widget.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
align_widget.o: ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
align_widget.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H
|
||||
align_widget.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
align_widget.o: ../FL/Fl_Menu_Bar.H undo.h
|
||||
alignment_panel.o: alignment_panel.h ../FL/Fl.H ../FL/fl_utf8.h
|
||||
alignment_panel.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Xutf8.h
|
||||
alignment_panel.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
alignment_panel.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H
|
||||
alignment_panel.o: ../FL/fl_draw.H ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
alignment_panel.o: ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
alignment_panel.o: ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H
|
||||
alignment_panel.o: ../FL/Fl_Double_Window.H ../FL/Fl_Preferences.H
|
||||
alignment_panel.o: ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
|
||||
alignment_panel.o: ../FL/Fl_Tabs.H ../FL/Fl_Group.H ../FL/Fl_Box.H
|
||||
alignment_panel.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Check_Button.H
|
||||
alignment_panel.o: ../FL/Fl_Widget.H ../FL/Fl_Device.H ../FL/x.H
|
||||
alignment_panel.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
alignment_panel.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H
|
||||
alignment_panel.o: ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H
|
||||
alignment_panel.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Tabs.H
|
||||
alignment_panel.o: ../FL/Fl_Group.H ../FL/Fl_Box.H ../FL/Fl_Input.H
|
||||
alignment_panel.o: ../FL/Fl_Input_.H ../FL/Fl_Check_Button.H
|
||||
alignment_panel.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
|
||||
alignment_panel.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H
|
||||
alignment_panel.o: ../FL/Fl_Image.H ../FL/Fl_Spinner.H ../FL/Enumerations.H
|
||||
@@ -218,14 +225,14 @@ code.o: ../FL/Fl_Export.H ../FL/fl_types.h Fl_Type.h ../FL/Fl_Widget.H
|
||||
code.o: ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H
|
||||
code.o: ../FL/Fl_Image.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
|
||||
code.o: Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/fl_draw.H
|
||||
code.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H
|
||||
code.o: ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
code.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H
|
||||
code.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
code.o: ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H alignment_panel.h
|
||||
code.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
code.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
code.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H
|
||||
code.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Device.H ../FL/x.H
|
||||
code.o: ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H
|
||||
code.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
|
||||
code.o: ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H
|
||||
code.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H
|
||||
code.o: alignment_panel.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H
|
||||
code.o: ../FL/fl_draw.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
code.o: ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H
|
||||
code.o: ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H ../FL/Fl_Button.H
|
||||
code.o: ../FL/Fl_Box.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
|
||||
code.o: ../FL/Fl_Button.H ../FL/Fl_Spinner.H ../FL/Enumerations.H
|
||||
@@ -239,20 +246,21 @@ factory.o: ../src/flstring.h ../config.h undo.h Fl_Widget_Type.h Fl_Type.h
|
||||
factory.o: ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H
|
||||
factory.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
factory.o: ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Window.H
|
||||
factory.o: ../FL/Fl_Group.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H
|
||||
factory.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
|
||||
factory.o: ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H
|
||||
factory.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H
|
||||
factory.o: ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_Return_Button.H
|
||||
factory.o: ../FL/Fl_Button.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H
|
||||
factory.o: ../FL/Fl_Light_Button.H ../FL/Fl_Check_Button.H
|
||||
factory.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H ../FL/Fl_Browser.H
|
||||
factory.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
factory.o: ../FL/Fl_Valuator.H ../FL/Fl_Check_Browser.H
|
||||
factory.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_File_Icon.H
|
||||
factory.o: ../FL/filename.H ../FL/Fl_Counter.H ../FL/Fl_Spinner.H
|
||||
factory.o: ../FL/Enumerations.H ../FL/Fl_File_Input.H ../FL/Fl_Text_Display.H
|
||||
factory.o: ../FL/fl_draw.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H
|
||||
factory.o: ../FL/Fl_Group.H ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Tabs.H
|
||||
factory.o: ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
factory.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H
|
||||
factory.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
factory.o: ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Box.H
|
||||
factory.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
|
||||
factory.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H ../FL/Fl_Light_Button.H
|
||||
factory.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
|
||||
factory.o: ../FL/Fl_Round_Button.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
|
||||
factory.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
factory.o: ../FL/Fl_Check_Browser.H ../FL/Fl_File_Browser.H
|
||||
factory.o: ../FL/Fl_Browser.H ../FL/Fl_File_Icon.H ../FL/filename.H
|
||||
factory.o: ../FL/Fl_Counter.H ../FL/Fl_Spinner.H ../FL/Enumerations.H
|
||||
factory.o: ../FL/Fl_File_Input.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
factory.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H
|
||||
factory.o: ../FL/Fl_Text_Display.H ../FL/Fl_Clock.H ../FL/Fl_Help_View.H
|
||||
factory.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Progress.H ../FL/Fl_Adjuster.H
|
||||
factory.o: ../FL/Fl_Dial.H ../FL/Fl_Roller.H ../FL/Fl_Scrollbar.H
|
||||
@@ -264,8 +272,8 @@ file.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/fl_types.h ../FL/Xutf8.h
|
||||
file.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
file.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
file.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
file.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
file.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H
|
||||
file.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
file.o: ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H
|
||||
file.o: ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
|
||||
file.o: ../FL/Fl_Button.H ../FL/Fl_Tabs.H ../FL/Fl_Group.H ../FL/Fl_Box.H
|
||||
file.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Check_Button.H
|
||||
@@ -285,27 +293,28 @@ fluid.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Button.H
|
||||
fluid.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/Fl_Help_Dialog.H
|
||||
fluid.o: ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
fluid.o: ../FL/Fl_Help_View.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
fluid.o: ../FL/Fl_Valuator.H ../FL/fl_draw.H ../FL/Fl_Shared_Image.H
|
||||
fluid.o: ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
|
||||
fluid.o: ../FL/Fl_Image.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H
|
||||
fluid.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
|
||||
fluid.o: ../FL/fl_ask.H ../FL/fl_draw.H ../FL/Fl_File_Chooser.H
|
||||
fluid.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_Button.H ../FL/Fl_Preferences.H
|
||||
fluid.o: ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H
|
||||
fluid.o: ../FL/filename.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
|
||||
fluid.o: ../FL/Fl_Button.H ../FL/Fl_File_Input.H ../FL/Fl_Return_Button.H
|
||||
fluid.o: ../FL/fl_message.H ../FL/fl_ask.H ../FL/filename.H ../src/flstring.h
|
||||
fluid.o: ../config.h alignment_panel.h ../FL/Fl_Text_Buffer.H
|
||||
fluid.o: ../FL/Fl_Text_Display.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Tooltip.H
|
||||
fluid.o: ../FL/Fl_Widget.H ../FL/Fl_Tabs.H ../FL/Fl_Spinner.H
|
||||
fluid.o: ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H
|
||||
fluid.o: ../FL/Fl_Round_Button.H function_panel.h ../FL/Fl_Light_Button.H
|
||||
fluid.o: ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H CodeEditor.h
|
||||
fluid.o: ../FL/Fl_Window.H template_panel.h ../FL/Fl_Browser.H
|
||||
fluid.o: print_panel.cxx print_panel.h ../FL/Fl_Progress.H ../FL/Fl_Pixmap.H
|
||||
fluid.o: about_panel.h undo.h Fl_Type.h ../FL/Fl_Menu.H Fluid_Image.h
|
||||
fluid.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H
|
||||
fluid.o: ../FL/Fl_Menu_.H ../FL/Fl_Input_Choice.H
|
||||
fluid.o: ../FL/Fl_Valuator.H ../FL/fl_draw.H ../FL/Fl_Device.H ../FL/x.H
|
||||
fluid.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H
|
||||
fluid.o: ../FL/Fl_Browser_.H ../FL/Fl_Image.H ../FL/Fl_Menu_Bar.H
|
||||
fluid.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Plugin.H
|
||||
fluid.o: ../FL/Fl_Preferences.H ../FL/fl_ask.H ../FL/fl_draw.H
|
||||
fluid.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Choice.H ../FL/Fl_Menu_Button.H
|
||||
fluid.o: ../FL/Fl_Preferences.H ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H
|
||||
fluid.o: ../FL/Fl_File_Icon.H ../FL/filename.H ../FL/Fl_Check_Button.H
|
||||
fluid.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_File_Input.H
|
||||
fluid.o: ../FL/Fl_Return_Button.H ../FL/fl_message.H ../FL/fl_ask.H
|
||||
fluid.o: ../FL/filename.H ../src/flstring.h ../config.h alignment_panel.h
|
||||
fluid.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H
|
||||
fluid.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
|
||||
fluid.o: ../FL/Fl_Tabs.H ../FL/Fl_Spinner.H ../FL/Enumerations.H
|
||||
fluid.o: ../FL/Fl_Repeat_Button.H ../FL/Fl_Round_Button.H function_panel.h
|
||||
fluid.o: ../FL/Fl_Light_Button.H ../FL/Fl_Text_Editor.H
|
||||
fluid.o: ../FL/Fl_Text_Display.H CodeEditor.h ../FL/Fl_Window.H
|
||||
fluid.o: template_panel.h ../FL/Fl_Browser.H print_panel.cxx print_panel.h
|
||||
fluid.o: ../FL/Fl_Progress.H ../FL/Fl_Pixmap.H about_panel.h undo.h Fl_Type.h
|
||||
fluid.o: ../FL/Fl_Menu.H Fluid_Image.h ../FL/Fl_Shared_Image.H
|
||||
fluid.o: ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
fluid.o: ../FL/Fl_Input_Choice.H
|
||||
function_panel.o: function_panel.h ../FL/Fl.H ../FL/fl_utf8.h
|
||||
function_panel.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Xutf8.h
|
||||
function_panel.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
@@ -315,15 +324,16 @@ function_panel.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
|
||||
function_panel.o: ../FL/Fl_Light_Button.H ../FL/Fl_Box.H ../FL/Fl_Input.H
|
||||
function_panel.o: ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H
|
||||
function_panel.o: ../FL/Fl_Button.H ../FL/Fl_Button.H ../FL/Fl_Text_Editor.H
|
||||
function_panel.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
function_panel.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
function_panel.o: ../FL/Fl_Text_Buffer.H CodeEditor.h ../FL/Fl_Text_Buffer.H
|
||||
function_panel.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Window.H ../FL/Fl_Tabs.H
|
||||
function_panel.o: ../FL/Fl_Pixmap.H Fl_Type.h ../FL/Fl_Widget.H
|
||||
function_panel.o: ../FL/Fl_Menu.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
|
||||
function_panel.o: Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/fl_draw.H
|
||||
function_panel.o: ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
function_panel.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Menu_Bar.H undo.h
|
||||
function_panel.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Device.H
|
||||
function_panel.o: ../FL/x.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
function_panel.o: ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H CodeEditor.h
|
||||
function_panel.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Menu_Button.H
|
||||
function_panel.o: ../FL/Fl_Window.H ../FL/Fl_Tabs.H ../FL/Fl_Pixmap.H
|
||||
function_panel.o: Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H
|
||||
function_panel.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H Fluid_Image.h
|
||||
function_panel.o: ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Pack.H
|
||||
function_panel.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Input_Choice.H
|
||||
function_panel.o: ../FL/Fl_Menu_Bar.H undo.h
|
||||
template_panel.o: template_panel.h ../FL/Fl.H ../FL/fl_utf8.h
|
||||
template_panel.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Xutf8.h
|
||||
template_panel.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
@@ -341,12 +351,13 @@ undo.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
undo.o: Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H
|
||||
undo.o: ../FL/Fl_Widget.H ../FL/Fl_Image.H ../FL/Fl_Plugin.H
|
||||
undo.o: ../FL/Fl_Preferences.H Fluid_Image.h ../FL/Fl_Shared_Image.H
|
||||
undo.o: ../FL/fl_draw.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Tabs.H
|
||||
undo.o: ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
|
||||
undo.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H
|
||||
undo.o: ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
undo.o: ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H undo.h ../FL/Fl_Preferences.H
|
||||
undo.o: ../src/flstring.h ../config.h
|
||||
undo.o: ../FL/fl_draw.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Device.H
|
||||
undo.o: ../FL/x.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
|
||||
undo.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H
|
||||
undo.o: ../FL/Fl_Menu_.H ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H
|
||||
undo.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Window.H
|
||||
undo.o: ../FL/Fl_Menu_Bar.H undo.h ../FL/Fl_Preferences.H ../src/flstring.h
|
||||
undo.o: ../config.h
|
||||
widget_panel.o: widget_panel.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
|
||||
widget_panel.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H
|
||||
widget_panel.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Double_Window.H
|
||||
@@ -357,6 +368,7 @@ widget_panel.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Button.H
|
||||
widget_panel.o: ../FL/Fl_Box.H ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H
|
||||
widget_panel.o: ../FL/Fl_Input.H ../FL/Fl_Light_Button.H Shortcut_Button.h
|
||||
widget_panel.o: CodeEditor.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H
|
||||
widget_panel.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Scrollbar.H
|
||||
widget_panel.o: ../FL/Fl_Slider.H ../FL/Fl_Text_Buffer.H
|
||||
widget_panel.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
|
||||
widget_panel.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Device.H
|
||||
widget_panel.o: ../FL/x.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
widget_panel.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Return_Button.H
|
||||
widget_panel.o: ../FL/Fl_Button.H
|
||||
|
||||
@@ -156,6 +156,8 @@ UNINSTALL_DESKTOP = @UNINSTALL_DESKTOP@
|
||||
$(CXX) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CXXFLAGS) -x objective-c++ -c $< -o $@; \
|
||||
elif test `uname` = Darwin -a $< = Fl_Native_File_Chooser.cxx ; then \
|
||||
$(CXX) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CXXFLAGS) -x objective-c++ -c $< -o $@; \
|
||||
elif test `uname` = Darwin -a $< = Fl_Printer.cxx ; then \
|
||||
$(CXX) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CXXFLAGS) -x objective-c++ -c $< -o $@; \
|
||||
else \
|
||||
$(CXX) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CXXFLAGS) -c $< -o $@; \
|
||||
fi
|
||||
|
||||
+1
-1
@@ -1474,7 +1474,7 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
|
||||
XDestroyRegion(R);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
CGRect arg = FL_CGRECTMAKE_COCOA(X, Y, W, H);
|
||||
CGRect arg = fl_cgrectmake_cocoa(X, Y, W, H);
|
||||
int j; // don't add a rectangle totally inside the Fl_Region
|
||||
for(j = 0; j < i->region->count; j++) {
|
||||
if(CGRectContainsRect(i->region->rects[j], arg)) break;
|
||||
|
||||
+50
-6
@@ -37,6 +37,7 @@
|
||||
#include <FL/Fl_Widget.H>
|
||||
#include <FL/Fl_Menu_Item.H>
|
||||
#include <FL/Fl_Bitmap.H>
|
||||
#include <FL/Fl_Printer.H>
|
||||
#include "flstring.h"
|
||||
|
||||
#if defined(__APPLE_QUARTZ__)
|
||||
@@ -264,6 +265,10 @@ Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *array)
|
||||
}
|
||||
|
||||
void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
|
||||
if(fl_device->type() == Fl_Device::postscript_device) {
|
||||
((Fl_Virtual_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy);
|
||||
return;
|
||||
}
|
||||
if (!array) {
|
||||
draw_empty(XP, YP);
|
||||
return;
|
||||
@@ -293,12 +298,51 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
|
||||
#elif defined(WIN32)
|
||||
if (!id) id = fl_create_bitmap(w(), h(), array);
|
||||
|
||||
HDC tempdc = CreateCompatibleDC(fl_gc);
|
||||
int save = SaveDC(tempdc);
|
||||
SelectObject(tempdc, (HGDIOBJ)id);
|
||||
SelectObject(fl_gc, fl_brush());
|
||||
// secret bitblt code found in old MSWindows reference manual:
|
||||
BitBlt(fl_gc, X, Y, W, H, tempdc, cx, cy, 0xE20746L);
|
||||
typedef BOOL (WINAPI* fl_transp_func) (HDC,int,int,int,int,HDC,int,int,int,int,UINT);
|
||||
static fl_transp_func fl_TransparentBlt;
|
||||
HDC tempdc;
|
||||
int save;
|
||||
BOOL use_print_algo = false;
|
||||
if (fl_device->type() == Fl_Device::gdi_printer) {
|
||||
static HMODULE hMod = NULL;
|
||||
if (!hMod) {
|
||||
hMod = LoadLibrary("MSIMG32.DLL");
|
||||
if (hMod) fl_TransparentBlt = (fl_transp_func)GetProcAddress(hMod, "TransparentBlt");
|
||||
}
|
||||
if (hMod) use_print_algo = true;
|
||||
}
|
||||
if (use_print_algo) { // algorithm for bitmap output to Fl_GDI_Printer
|
||||
Fl_Offscreen tmp_id = fl_create_offscreen(W, H);
|
||||
fl_begin_offscreen(tmp_id);
|
||||
Fl_Color save_c = fl_color(); // save bitmap's desired color
|
||||
uchar r, g, b;
|
||||
Fl::get_color(save_c, r, g, b);
|
||||
r = 255-r;
|
||||
g = 255-g;
|
||||
b = 255-b;
|
||||
Fl_Color background = fl_rgb_color(r, g, b); // a color very different from the bitmap's
|
||||
fl_color(background);
|
||||
fl_rectf(0,0,W,H); // use this color as offscreen background
|
||||
fl_color(save_c); // back to bitmap's color
|
||||
tempdc = CreateCompatibleDC(fl_gc);
|
||||
save = SaveDC(tempdc);
|
||||
SelectObject(tempdc, (HGDIOBJ)id);
|
||||
SelectObject(fl_gc, fl_brush()); // use bitmap's desired color
|
||||
BitBlt(fl_gc, 0, 0, W, H, tempdc, 0, 0, 0xE20746L); // draw bitmap to offscreen
|
||||
fl_end_offscreen(); // offscreen data is in tmp_id
|
||||
SelectObject(tempdc, (HGDIOBJ)tmp_id); // use offscreen data
|
||||
// draw it to printer context with background color as transparent
|
||||
fl_TransparentBlt(fl_gc, X,Y,W,H, tempdc, cx, cy, w(), h(), RGB(r, g, b) );
|
||||
fl_delete_offscreen(tmp_id);
|
||||
}
|
||||
else { // algorithm for bitmap output to display
|
||||
tempdc = CreateCompatibleDC(fl_gc);
|
||||
save = SaveDC(tempdc);
|
||||
SelectObject(tempdc, (HGDIOBJ)id);
|
||||
SelectObject(fl_gc, fl_brush());
|
||||
// secret bitblt code found in old MSWindows reference manual:
|
||||
BitBlt(fl_gc, X, Y, W, H, tempdc, cx, cy, 0xE20746L);
|
||||
}
|
||||
RestoreDC(tempdc, save);
|
||||
DeleteDC(tempdc);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Fl_Device.cxx
|
||||
*
|
||||
*/
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Device.H>
|
||||
#include <FL/Fl_Printer.H>
|
||||
#include <FL/fl_draw.H>
|
||||
#include <FL/Fl_Image.H>
|
||||
|
||||
extern Fl_Device *fl_device;
|
||||
|
||||
void Fl_Device::draw(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy)
|
||||
{
|
||||
// presently, never gets called
|
||||
}
|
||||
|
||||
void Fl_Device::draw(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy)
|
||||
{
|
||||
// presently, never gets called
|
||||
}
|
||||
|
||||
void Fl_Device::draw(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy)
|
||||
{
|
||||
// presently, never gets called
|
||||
}
|
||||
|
||||
void Fl_Virtual_Printer::print_widget(Fl_Widget* widget, int delta_x, int delta_y)
|
||||
{
|
||||
int old_x, old_y, new_x, new_y, is_window;
|
||||
if ( ! widget->visible() ) return;
|
||||
is_window = (widget->as_window() != NULL);
|
||||
widget->damage(FL_DAMAGE_ALL);
|
||||
// set origin to the desired top-left position of the widget
|
||||
origin(&old_x, &old_y);
|
||||
new_x = old_x + delta_x;
|
||||
new_y = old_y + delta_y;
|
||||
if (!is_window) {
|
||||
new_x -= widget->x();
|
||||
new_y -= widget->y();
|
||||
}
|
||||
if (new_x != old_x || new_y != old_y) {
|
||||
translate(new_x - old_x, new_y - old_y );
|
||||
}
|
||||
// if widget is a window, clip all drawings to the window area
|
||||
if (is_window) fl_push_clip(0, 0, widget->w(), widget->h() );
|
||||
#ifdef __APPLE__
|
||||
CGContextRef save_gc = fl_gc;
|
||||
#elif defined(WIN32) // && !defined(__CYGWIN__)
|
||||
HDC save_gc = fl_gc;
|
||||
#else
|
||||
_XGC *save_gc = fl_gc; // FIXME
|
||||
#endif
|
||||
widget->draw();
|
||||
fl_gc = save_gc;
|
||||
if (is_window) fl_pop_clip();
|
||||
// find subwindows of widget and print them
|
||||
traverse(widget);
|
||||
// reset origin to where it was
|
||||
if (new_x != old_x || new_y != old_y) {
|
||||
untranslate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Fl_Virtual_Printer::traverse(Fl_Widget *widget)
|
||||
{
|
||||
Fl_Group *g = widget->as_group();
|
||||
if (!g) return;
|
||||
int n = g->children();
|
||||
for (int i = 0; i < n; i++) {
|
||||
Fl_Widget *c = g->child(i);
|
||||
if ( !c->visible() ) continue;
|
||||
if ( c->as_window() ) {
|
||||
print_widget(c, c->x(), c->y());
|
||||
}
|
||||
else traverse(c);
|
||||
}
|
||||
}
|
||||
|
||||
void Fl_Virtual_Printer::origin(int *x, int *y)
|
||||
{
|
||||
if (x) *x = x_offset;
|
||||
if (y) *y = y_offset;
|
||||
}
|
||||
|
||||
void Fl_Virtual_Printer::print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y)
|
||||
{
|
||||
Fl_Device::display_device()->set_current();
|
||||
Fl_Window *save_front = Fl::first_window();
|
||||
win->show();
|
||||
Fl::check();
|
||||
win->make_current();
|
||||
uchar *image_data = fl_read_image(NULL, x, y, w, h);
|
||||
save_front->show();
|
||||
this->set_current();
|
||||
Fl_RGB_Image *image = new Fl_RGB_Image(image_data, w, h);
|
||||
image->draw(delta_x, delta_y);
|
||||
add_image(image, image_data);
|
||||
}
|
||||
|
||||
void Fl_Virtual_Printer::add_image(Fl_Image *image, const uchar *data)
|
||||
{
|
||||
struct chain_elt *elt = (struct chain_elt *)calloc(sizeof(struct chain_elt), 1);
|
||||
elt->image = image;
|
||||
elt->data = data;
|
||||
if (image_list_) { elt->next = image_list_; }
|
||||
image_list_ = elt;
|
||||
}
|
||||
|
||||
void Fl_Virtual_Printer::delete_image_list()
|
||||
{
|
||||
while(image_list_) {
|
||||
struct chain_elt *next = image_list_->next;
|
||||
delete image_list_->image;
|
||||
if (image_list_->data) delete image_list_->data;
|
||||
free(image_list_);
|
||||
image_list_ = next;
|
||||
}
|
||||
}
|
||||
|
||||
Fl_Device *Fl_Virtual_Printer::set_current(void)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
fl_gc = (CGContextRef)gc;
|
||||
#elif defined(WIN32)
|
||||
fl_gc = (HDC)gc;
|
||||
#else
|
||||
fl_gc = (_XGC*)gc;
|
||||
#endif
|
||||
return this->Fl_Device::set_current();
|
||||
}
|
||||
|
||||
|
||||
int Fl_Virtual_Printer::start_job(int pagecount, int *frompage, int *topage) {return 1;}
|
||||
int Fl_Virtual_Printer::start_page (void) {return 1;}
|
||||
int Fl_Virtual_Printer::printable_rect(int *w, int *h) {return 1;}
|
||||
void Fl_Virtual_Printer::margins(int *left, int *top, int *right, int *bottom) {}
|
||||
void Fl_Virtual_Printer::origin(int x, int y) {}
|
||||
void Fl_Virtual_Printer::scale (float scale_x, float scale_y) {}
|
||||
void Fl_Virtual_Printer::rotate(float angle) {}
|
||||
int Fl_Virtual_Printer::end_page (void) {return 1;}
|
||||
void Fl_Virtual_Printer::end_job (void) {}
|
||||
void Fl_Virtual_Printer::translate(int x, int y) {}
|
||||
void Fl_Virtual_Printer::untranslate(void) {}
|
||||
|
||||
extern Fl_Device *fl_device;
|
||||
|
||||
Fl_Device *Fl_Device::set_current(void)
|
||||
{
|
||||
Fl_Device *current = fl_device;
|
||||
fl_device = this;
|
||||
return current;
|
||||
}
|
||||
|
||||
Fl_Device *Fl_Device::current(void)
|
||||
{
|
||||
return fl_device;
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Fl_GDI_Printer.cxx
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#include <FL/Fl_Printer.H>
|
||||
|
||||
|
||||
#include <FL/fl_ask.H>
|
||||
#include <math.h>
|
||||
|
||||
extern HWND fl_window;
|
||||
|
||||
Fl_GDI_Printer::Fl_GDI_Printer(void) : Fl_Virtual_Printer() {
|
||||
hPr = NULL;
|
||||
type_ = gdi_printer;
|
||||
}
|
||||
|
||||
static void WIN_SetupPrinterDeviceContext(HDC prHDC)
|
||||
{
|
||||
if ( !prHDC ) return;
|
||||
|
||||
fl_window = 0;
|
||||
fl_gc = prHDC;
|
||||
SetGraphicsMode(prHDC, GM_ADVANCED); // to allow for rotations
|
||||
SetMapMode(prHDC, MM_ANISOTROPIC);
|
||||
SetTextAlign(prHDC, TA_BASELINE|TA_LEFT);
|
||||
SetBkMode(prHDC, TRANSPARENT);
|
||||
// this matches 720 logical units to the number of device units in 10 inches of paper
|
||||
// thus the logical unit is the point (= 1/72 inch)
|
||||
SetWindowExtEx(prHDC, 720, 720, NULL);
|
||||
SetViewportExtEx(prHDC, 10*GetDeviceCaps(prHDC, LOGPIXELSX), 10*GetDeviceCaps(prHDC, LOGPIXELSY), NULL);
|
||||
}
|
||||
|
||||
|
||||
int Fl_GDI_Printer::start_job (int pagecount, int *frompage, int *topage)
|
||||
// returns 0 iff OK
|
||||
{
|
||||
DWORD commdlgerr;
|
||||
DOCINFO di;
|
||||
char docName [256];
|
||||
int err = 0;
|
||||
|
||||
abortPrint = FALSE;
|
||||
memset (&pd, 0, sizeof (PRINTDLG));
|
||||
pd.lStructSize = sizeof (PRINTDLG);
|
||||
pd.hwndOwner = GetForegroundWindow();
|
||||
pd.Flags = PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE | PD_NOSELECTION;
|
||||
pd.nMinPage = 1;
|
||||
pd.nMaxPage = pagecount;
|
||||
if (PrintDlg (&pd) != 0) {
|
||||
hPr = pd.hDC;
|
||||
if (hPr != NULL) {
|
||||
strcpy (docName, "FLTK");
|
||||
memset(&di, 0, sizeof(DOCINFO));
|
||||
di.cbSize = sizeof (DOCINFO);
|
||||
di.lpszDocName = (LPCSTR) docName;
|
||||
prerr = StartDoc (hPr, &di);
|
||||
if (prerr < 1) {
|
||||
abortPrint = TRUE;
|
||||
fl_alert ("StartDoc error %d", prerr);
|
||||
err = 1;
|
||||
}
|
||||
} else {
|
||||
commdlgerr = CommDlgExtendedError ();
|
||||
fl_alert ("Unable to create print context, error %lu",
|
||||
(unsigned long) commdlgerr);
|
||||
err = 1;
|
||||
}
|
||||
} else {
|
||||
err = 1;
|
||||
}
|
||||
if(!err) {
|
||||
if((pd.Flags & PD_PAGENUMS) != 0 ) {
|
||||
if (frompage) *frompage = pd.nFromPage;
|
||||
if (topage) *topage = pd.nToPage;
|
||||
}
|
||||
else {
|
||||
if (frompage) *frompage = 1;
|
||||
if (topage) *topage = pagecount;
|
||||
}
|
||||
x_offset = 0;
|
||||
y_offset = 0;
|
||||
this->set_current();
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::end_job (void)
|
||||
{
|
||||
Fl_Device::display_device()->set_current();
|
||||
if (hPr != NULL) {
|
||||
if (! abortPrint) {
|
||||
prerr = EndDoc (hPr);
|
||||
if (prerr < 0) {
|
||||
fl_alert ("EndDoc error %d", prerr);
|
||||
}
|
||||
}
|
||||
DeleteDC (hPr);
|
||||
if (pd.hDevMode != NULL) {
|
||||
GlobalFree (pd.hDevMode);
|
||||
}
|
||||
if (pd.hDevNames != NULL) {
|
||||
GlobalFree (pd.hDevNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::absolute_printable_rect(int *x, int *y, int *w, int *h)
|
||||
{
|
||||
POINT physPageSize;
|
||||
POINT pixelsPerInch;
|
||||
|
||||
if (hPr == NULL) return;
|
||||
SetWindowOrgEx(fl_gc, 0, 0, NULL);
|
||||
|
||||
physPageSize.x = GetDeviceCaps(hPr, HORZRES);
|
||||
physPageSize.y = GetDeviceCaps(hPr, VERTRES);
|
||||
DPtoLP(hPr, &physPageSize, 1);
|
||||
*w = physPageSize.x + 1;
|
||||
*h = physPageSize.y + 1;
|
||||
pixelsPerInch.x = GetDeviceCaps(hPr, LOGPIXELSX);
|
||||
pixelsPerInch.y = GetDeviceCaps(hPr, LOGPIXELSY);
|
||||
DPtoLP(hPr, &pixelsPerInch, 1);
|
||||
left_margin = (pixelsPerInch.x / 4);
|
||||
*w -= (pixelsPerInch.x / 2);
|
||||
top_margin = (pixelsPerInch.y / 4);
|
||||
*h -= (pixelsPerInch.y / 2);
|
||||
|
||||
*x = left_margin;
|
||||
*y = top_margin;
|
||||
origin(x_offset, y_offset);
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::margins(int *left, int *top, int *right, int *bottom)
|
||||
{
|
||||
int x, y, w, h;
|
||||
absolute_printable_rect(&x, &y, &w, &h);
|
||||
if (left) *left = x;
|
||||
if (top) *top = y;
|
||||
if (right) *right = x;
|
||||
if (bottom) *bottom = y;
|
||||
}
|
||||
|
||||
int Fl_GDI_Printer::printable_rect(int *w, int *h)
|
||||
{
|
||||
int x, y;
|
||||
absolute_printable_rect(&x, &y, w, h);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Fl_GDI_Printer::start_page (void)
|
||||
{
|
||||
int rsult, w, h;
|
||||
|
||||
rsult = 0;
|
||||
if (hPr != NULL) {
|
||||
WIN_SetupPrinterDeviceContext (hPr);
|
||||
prerr = StartPage (hPr);
|
||||
if (prerr < 0) {
|
||||
fl_alert ("StartPage error %d", prerr);
|
||||
rsult = 1;
|
||||
}
|
||||
printable_rect(&w, &h);
|
||||
origin(0, 0);
|
||||
image_list_ = NULL;
|
||||
fl_clip_region(0);
|
||||
gc = (void *)fl_gc;
|
||||
}
|
||||
return rsult;
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::origin (int deltax, int deltay)
|
||||
{
|
||||
SetWindowOrgEx(fl_gc, - left_margin - deltax, - top_margin - deltay, NULL);
|
||||
x_offset = deltax;
|
||||
y_offset = deltay;
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::scale (float scalex, float scaley)
|
||||
{
|
||||
int w, h;
|
||||
SetWindowExtEx(fl_gc, (int)(720 / scalex + 0.5), (int)(720 / scaley + 0.5), NULL);
|
||||
printable_rect(&w, &h);
|
||||
origin(0, 0);
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::rotate (float rot_angle)
|
||||
{
|
||||
XFORM mat;
|
||||
float angle;
|
||||
angle = - rot_angle * M_PI / 180.;
|
||||
mat.eM11 = cos(angle);
|
||||
mat.eM12 = sin(angle);
|
||||
mat.eM21 = - mat.eM12;
|
||||
mat.eM22 = mat.eM11;
|
||||
mat.eDx = mat.eDy = 0;
|
||||
SetWorldTransform(fl_gc, &mat);
|
||||
}
|
||||
|
||||
int Fl_GDI_Printer::end_page (void)
|
||||
{
|
||||
int rsult;
|
||||
|
||||
rsult = 0;
|
||||
if (hPr != NULL) {
|
||||
prerr = EndPage (hPr);
|
||||
if (prerr < 0) {
|
||||
abortPrint = TRUE;
|
||||
fl_alert ("EndPage error %d", prerr);
|
||||
rsult = 1;
|
||||
}
|
||||
}
|
||||
delete_image_list();
|
||||
gc = NULL;
|
||||
return rsult;
|
||||
}
|
||||
|
||||
static int translate_stack_depth = 0;
|
||||
const int translate_stack_max = 5;
|
||||
static int translate_stack_x[translate_stack_max];
|
||||
static int translate_stack_y[translate_stack_max];
|
||||
|
||||
static void do_translate(int x, int y)
|
||||
{
|
||||
XFORM tr;
|
||||
tr.eM11 = tr.eM22 = 1;
|
||||
tr.eM12 = tr.eM21 = 0;
|
||||
tr.eDx = x;
|
||||
tr.eDy = y;
|
||||
ModifyWorldTransform(fl_gc, &tr, MWT_LEFTMULTIPLY);
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::translate (int x, int y)
|
||||
{
|
||||
do_translate(x, y);
|
||||
if (translate_stack_depth < translate_stack_max) {
|
||||
translate_stack_x[translate_stack_depth] = x;
|
||||
translate_stack_y[translate_stack_depth] = y;
|
||||
translate_stack_depth++;
|
||||
}
|
||||
}
|
||||
|
||||
void Fl_GDI_Printer::untranslate (void)
|
||||
{
|
||||
if (translate_stack_depth > 0) {
|
||||
translate_stack_depth--;
|
||||
do_translate( - translate_stack_x[translate_stack_depth], - translate_stack_y[translate_stack_depth] );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
@@ -315,11 +315,15 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
|
||||
aglEnable( (GLContext)context, AGL_BUFFER_RECT );
|
||||
}
|
||||
#if defined(__APPLE_COCOA__)
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||
aglSetWindowRef(context, MACwindowRef(window) );
|
||||
#else
|
||||
aglSetDrawable( context, GetWindowPort( MACwindowRef(window) ) );
|
||||
if (aglSetWindowRef != NULL) {
|
||||
aglSetWindowRef(context, MACwindowRef(window) );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
aglSetDrawable( context, GetWindowPort( MACwindowRef(window) ) );
|
||||
|
||||
#else
|
||||
aglSetDrawable( context, GetWindowPort( fl_xid(window) ) );
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Fl_Gl_Printer.cxx
|
||||
*/
|
||||
|
||||
#include "FL/Fl_Gl_Printer.H"
|
||||
#include "Fl_Gl_Choice.H"
|
||||
#include "FL/Fl.H"
|
||||
#ifndef __APPLE__
|
||||
#include "FL/fl_draw.H"
|
||||
#endif
|
||||
|
||||
void Fl_Gl_Printer::print_gl_window(Fl_Gl_Window *glw, int x, int y)
|
||||
{
|
||||
#ifdef WIN32
|
||||
HDC save_gc = fl_gc;
|
||||
const int bytesperpixel = 3;
|
||||
#elif defined(__APPLE__)
|
||||
CGContextRef save_gc = fl_gc;
|
||||
const int bytesperpixel = 4;
|
||||
#else
|
||||
_XGC *save_gc = fl_gc; // FIXME Linux/Unix
|
||||
const int bytesperpixel = 3;
|
||||
#endif
|
||||
glw->redraw();
|
||||
Fl::check();
|
||||
glw->make_current();
|
||||
// select front buffer as our source for pixel data
|
||||
glReadBuffer(GL_FRONT);
|
||||
// Read OpenGL context pixels directly.
|
||||
// For extra safety, save & restore OpenGL states that are changed
|
||||
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 4); /* Force 4-byte alignment */
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
// Read a block of pixels from the frame buffer
|
||||
int mByteWidth = glw->w() * bytesperpixel;
|
||||
mByteWidth = (mByteWidth + 3) & ~3; // Align to 4 bytes
|
||||
uchar *baseAddress = (uchar*)malloc(mByteWidth * glw->h());
|
||||
glReadPixels(0, 0, glw->w(), glw->h(),
|
||||
#ifdef WIN32
|
||||
GL_RGB, GL_UNSIGNED_BYTE,
|
||||
#elif defined(__APPLE__)
|
||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
#else // FIXME Linux/Unix
|
||||
GL_RGB, GL_UNSIGNED_BYTE,
|
||||
#endif
|
||||
baseAddress);
|
||||
glPopClientAttrib();
|
||||
fl_gc = save_gc;
|
||||
#ifdef WIN32
|
||||
fl_draw_image(baseAddress + (glw->h() - 1) * mByteWidth, x, y , glw->w(), glw->h(), bytesperpixel, - mByteWidth);
|
||||
#elif defined(__APPLE__)
|
||||
CGColorSpaceRef cSpace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
|
||||
CGContextRef bitmap = CGBitmapContextCreate(baseAddress, glw->w(), glw->h(), 8, mByteWidth, cSpace,
|
||||
#if __BIG_ENDIAN__
|
||||
kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Big /* XRGB Big Endian */);
|
||||
#else
|
||||
kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little /* XRGB Little Endian */);
|
||||
#endif
|
||||
if(bitmap == NULL) return;
|
||||
CFRelease(cSpace);
|
||||
// Make an image out of our bitmap
|
||||
CGImageRef image = CGBitmapContextCreateImage(bitmap);
|
||||
if(image == NULL) return;
|
||||
CFRelease(bitmap);
|
||||
CGContextSaveGState(fl_gc);
|
||||
int w, h;
|
||||
this->printable_rect(&w, &h);
|
||||
CGContextTranslateCTM(fl_gc, 0, h);
|
||||
CGContextScaleCTM(fl_gc, 1.0f, -1.0f);
|
||||
CGRect rect = { { x, h - y - glw->h() }, { glw->w(), glw->h() } };
|
||||
Fl_X::q_begin_image(rect, 0, 0, glw->w(), glw->h());
|
||||
CGContextDrawImage(fl_gc, rect, image);
|
||||
Fl_X::q_end_image();
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CFRelease(image);
|
||||
#else // FIXME Linux/Unix
|
||||
fl_draw_image(baseAddress + (glw->h() - 1) * mByteWidth, x, y , glw->w(), glw->h(), bytesperpixel, - mByteWidth);
|
||||
#endif // WIN32
|
||||
free(baseAddress);
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <FL/Fl_Widget.H>
|
||||
#include <FL/Fl_Menu_Item.H>
|
||||
#include <FL/Fl_Image.H>
|
||||
#include <FL/Fl_Printer.H>
|
||||
#include "flstring.h"
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -434,6 +435,10 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i
|
||||
#endif // !WIN32 && !USE_QUARTZ
|
||||
|
||||
void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
|
||||
if(fl_device->type() == Fl_Device::postscript_device) {
|
||||
((Fl_Virtual_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy);
|
||||
return;
|
||||
}
|
||||
// Don't draw an empty image...
|
||||
if (!d() || !array) {
|
||||
draw_empty(XP, YP);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+53
-1
@@ -47,6 +47,7 @@
|
||||
#include <FL/Fl_Widget.H>
|
||||
#include <FL/Fl_Menu_Item.H>
|
||||
#include <FL/Fl_Pixmap.H>
|
||||
#include <FL/Fl_Printer.H>
|
||||
|
||||
#include <stdio.h>
|
||||
#include "flstring.h"
|
||||
@@ -74,6 +75,10 @@ void Fl_Pixmap::measure() {
|
||||
}
|
||||
|
||||
void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
|
||||
if(fl_device->type() == Fl_Device::postscript_device) {
|
||||
((Fl_Virtual_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy);
|
||||
return;
|
||||
}
|
||||
// ignore empty or bad pixmap data:
|
||||
if (!data()) {
|
||||
draw_empty(XP, YP);
|
||||
@@ -139,7 +144,54 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
|
||||
fl_restore_clip();
|
||||
}
|
||||
#elif defined(WIN32)
|
||||
if (mask) {
|
||||
if (fl_device->type() == Fl_Device::gdi_printer) {
|
||||
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;
|
||||
if (!hMod) {
|
||||
hMod = LoadLibrary("MSIMG32.DLL");
|
||||
if(hMod) fl_TransparentBlt = (fl_transp_func)GetProcAddress(hMod, "TransparentBlt");
|
||||
}
|
||||
if (hMod) {
|
||||
# define UNLIKELY_RGB_COLOR 2,3,4 // a nearly black color unlikely to occur in pixmaps
|
||||
# define WIN_COLOR RGB(2,3,4)
|
||||
Fl_Offscreen tmp_id = fl_create_offscreen(w(), h());
|
||||
fl_begin_offscreen(tmp_id);
|
||||
uchar *bitmap = 0;
|
||||
fl_mask_bitmap = &bitmap;
|
||||
// draw pixmap to offscreen using the unlikely color for background
|
||||
fl_draw_pixmap(data(), 0, 0, fl_rgb_color(UNLIKELY_RGB_COLOR) );
|
||||
fl_end_offscreen();
|
||||
HDC new_gc = CreateCompatibleDC(fl_gc);
|
||||
int save = SaveDC(new_gc);
|
||||
SelectObject(new_gc, (void*)tmp_id);
|
||||
// print all of offscreen but its parts using unlikely color
|
||||
fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, w(), h(), WIN_COLOR );
|
||||
RestoreDC(new_gc,save);
|
||||
// This is an approximate algorithm that fails to print pixmap pixels that would use the unlikely color.
|
||||
// It can be transformed into an exact algorithm by adding the following commented out statements
|
||||
// that print pixmap one more time hiding another color (any color would fit)
|
||||
/*
|
||||
# define UNLIKELY_RGB_COLOR2 4,3,2
|
||||
# define WIN_COLOR2 RGB(4,3,2)
|
||||
{
|
||||
fl_begin_offscreen(tmp_id);
|
||||
fl_draw_pixmap(data(), 0, 0, fl_rgb_color(UNLIKELY_RGB_COLOR2) );
|
||||
fl_end_offscreen();
|
||||
}
|
||||
save = SaveDC(new_gc);
|
||||
SelectObject(new_gc, (void*)tmp_id);
|
||||
fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, w(), h(), WIN_COLOR2 );
|
||||
RestoreDC(new_gc,save);
|
||||
*/
|
||||
DeleteDC(new_gc);
|
||||
fl_delete_offscreen(tmp_id);
|
||||
}
|
||||
else {
|
||||
fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
|
||||
}
|
||||
}
|
||||
else if (mask) {
|
||||
HDC new_gc = CreateCompatibleDC(fl_gc);
|
||||
int save = SaveDC(new_gc);
|
||||
SelectObject(new_gc, (void*)mask);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <FL/Fl_Printer.H>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <src/Fl_Quartz_Printer.mm>
|
||||
#elif defined(WIN32)
|
||||
#include <src/Fl_GDI_Printer.cxx>
|
||||
#endif
|
||||
|
||||
#include <src/Fl_PS_Printer.cxx>
|
||||
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
* Fl_Quartz_Printer.mm
|
||||
*
|
||||
*/
|
||||
#ifdef __APPLE__
|
||||
#include <FL/Fl_Printer.H>
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/fl_ask.H>
|
||||
#include <FL/fl_draw.H>
|
||||
#ifdef __APPLE_COCOA__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
|
||||
extern void fl_quartz_restore_line_style_();
|
||||
|
||||
Fl_Quartz_Printer::Fl_Quartz_Printer(void)
|
||||
{
|
||||
x_offset = 0;
|
||||
y_offset = 0;
|
||||
type_ = quartz_printer;
|
||||
}
|
||||
|
||||
int Fl_Quartz_Printer::start_job (int pagecount, int *frompage, int *topage)
|
||||
//printing using a Quartz graphics context
|
||||
//returns 0 iff OK
|
||||
{
|
||||
OSStatus status;
|
||||
Fl_X::q_release_context();
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && defined(__APPLE_COCOA__)
|
||||
if( [NSPrintPanel instancesRespondToSelector:@selector(runModalWithPrintInfo:)] &&
|
||||
[NSPrintInfo instancesRespondToSelector:@selector(PMPrintSession)] ) {
|
||||
NSAutoreleasePool *localPool;
|
||||
localPool = [[NSAutoreleasePool alloc] init];
|
||||
NSPrintInfo *info = [NSPrintInfo sharedPrintInfo];
|
||||
NSPageLayout *layout = [NSPageLayout pageLayout];
|
||||
NSInteger retval = [layout runModal];
|
||||
if(retval == NSOKButton) {
|
||||
NSPrintPanel *panel = [NSPrintPanel printPanel];
|
||||
retval = (NSInteger)[panel runModalWithPrintInfo:info];//from 10.5 only
|
||||
}
|
||||
if(retval != NSOKButton) {
|
||||
Fl::first_window()->show();
|
||||
[localPool release];
|
||||
return 1;
|
||||
}
|
||||
printSession = (PMPrintSession)[info PMPrintSession];
|
||||
pageFormat = (PMPageFormat)[info PMPageFormat];
|
||||
printSettings = (PMPrintSettings)[info PMPrintSettings];
|
||||
UInt32 from32, to32;
|
||||
PMGetFirstPage(printSettings, &from32);
|
||||
if (frompage) *frompage = (int)from32;
|
||||
PMGetLastPage(printSettings, &to32);
|
||||
if (topage) *topage = (int)to32;
|
||||
if(topage && *topage > pagecount) *topage = pagecount;
|
||||
status = PMSessionBeginCGDocumentNoDialog(printSession, printSettings, pageFormat);
|
||||
[localPool release];
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
|
||||
#if !__LP64__
|
||||
Boolean accepted;
|
||||
status = PMCreateSession(&printSession);
|
||||
if (status != noErr) return 1;
|
||||
status = PMCreatePageFormat(&pageFormat);
|
||||
status = PMSessionDefaultPageFormat(printSession, pageFormat);
|
||||
if (status != noErr) return 1;
|
||||
status = PMSessionPageSetupDialog(printSession, pageFormat, &accepted);
|
||||
if (status != noErr || !accepted) {
|
||||
Fl::first_window()->show();
|
||||
return 1;
|
||||
}
|
||||
status = PMCreatePrintSettings(&printSettings);
|
||||
if (status != noErr || printSettings == kPMNoPrintSettings) return 1;
|
||||
status = PMSessionDefaultPrintSettings (printSession, printSettings);
|
||||
if (status != noErr) return 1;
|
||||
PMSetPageRange(printSettings, 1, (UInt32)kPMPrintAllPages);
|
||||
status = PMSessionPrintDialog(printSession, printSettings, pageFormat, &accepted);
|
||||
if (!accepted) status = kPMCancel;
|
||||
if (status != noErr) {
|
||||
Fl::first_window()->show();
|
||||
return 1;
|
||||
}
|
||||
UInt32 from32, to32;
|
||||
PMGetFirstPage(printSettings, &from32);
|
||||
if (frompage) *frompage = (int)from32;
|
||||
PMGetLastPage(printSettings, &to32);
|
||||
if (topage) *topage = (int)to32;
|
||||
if(topage && *topage > pagecount) *topage = pagecount;
|
||||
CFStringRef mystring[1];
|
||||
mystring[0] = kPMGraphicsContextCoreGraphics;
|
||||
CFArrayRef array = CFArrayCreate(NULL, (const void **)mystring, 1, &kCFTypeArrayCallBacks);
|
||||
status = PMSessionSetDocumentFormatGeneration(printSession, kPMDocumentFormatDefault, array, NULL);
|
||||
CFRelease(array);
|
||||
status = PMSessionBeginDocumentNoDialog(printSession, printSettings, pageFormat);
|
||||
#endif //__LP64__
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && defined(__APPLE_COCOA__)
|
||||
}
|
||||
#endif
|
||||
if (status != noErr) return 1;
|
||||
y_offset = x_offset = 0;
|
||||
this->set_current();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Fl_Quartz_Printer::margins(int *left, int *top, int *right, int *bottom)
|
||||
{
|
||||
PMPaper paper;
|
||||
PMGetPageFormatPaper(pageFormat, &paper);
|
||||
PMOrientation orientation;
|
||||
PMGetOrientation(pageFormat, &orientation);
|
||||
PMPaperMargins margins;
|
||||
PMPaperGetMargins(paper, &margins);
|
||||
if(orientation == kPMPortrait) {
|
||||
if (left) *left = (int)(margins.left / scale_x + 0.5);
|
||||
if (top) *top = (int)(margins.top / scale_y + 0.5);
|
||||
if (right) *right = (int)(margins.right / scale_x + 0.5);
|
||||
if (bottom) *bottom = (int)(margins.bottom / scale_y + 0.5);
|
||||
}
|
||||
else {
|
||||
if (left) *left = (int)(margins.top / scale_x + 0.5);
|
||||
if (top) *top = (int)(margins.left / scale_y + 0.5);
|
||||
if (right) *right = (int)(margins.bottom / scale_x + 0.5);
|
||||
if (bottom) *bottom = (int)(margins.right / scale_y + 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
int Fl_Quartz_Printer::printable_rect(int *w, int *h)
|
||||
//returns 0 iff OK
|
||||
{
|
||||
OSStatus status;
|
||||
PMRect pmRect;
|
||||
int x, y;
|
||||
|
||||
status = PMGetAdjustedPageRect(pageFormat, &pmRect);
|
||||
if (status != noErr) return 1;
|
||||
|
||||
x = (int)pmRect.left;
|
||||
y = (int)pmRect.top;
|
||||
*w = (int)(pmRect.right - x) / scale_x + 1;
|
||||
*h = (int)(pmRect.bottom - y) / scale_y + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Fl_Quartz_Printer::origin(int x, int y)
|
||||
{
|
||||
x_offset = x;
|
||||
y_offset = y;
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextSaveGState(fl_gc);
|
||||
CGContextScaleCTM(fl_gc, scale_x, scale_y);
|
||||
CGContextTranslateCTM(fl_gc, x, y);
|
||||
CGContextRotateCTM(fl_gc, angle);
|
||||
CGContextSaveGState(fl_gc);
|
||||
}
|
||||
|
||||
void Fl_Quartz_Printer::scale (float s_x, float s_y)
|
||||
{
|
||||
scale_x = s_x;
|
||||
scale_y = s_y;
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextSaveGState(fl_gc);
|
||||
CGContextScaleCTM(fl_gc, scale_x, scale_y);
|
||||
CGContextRotateCTM(fl_gc, angle);
|
||||
x_offset = y_offset = 0;
|
||||
CGContextSaveGState(fl_gc);
|
||||
}
|
||||
|
||||
void Fl_Quartz_Printer::rotate (float rot_angle)
|
||||
{
|
||||
angle = - rot_angle * M_PI / 180.;
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextSaveGState(fl_gc);
|
||||
CGContextScaleCTM(fl_gc, scale_x, scale_y);
|
||||
CGContextTranslateCTM(fl_gc, x_offset, y_offset);
|
||||
CGContextRotateCTM(fl_gc, angle);
|
||||
CGContextSaveGState(fl_gc);
|
||||
}
|
||||
|
||||
void Fl_Quartz_Printer::translate(int x, int y)
|
||||
{
|
||||
CGContextSaveGState(fl_gc);
|
||||
CGContextTranslateCTM(fl_gc, x, y );
|
||||
CGContextSaveGState(fl_gc);
|
||||
}
|
||||
|
||||
void Fl_Quartz_Printer::untranslate(void)
|
||||
{
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextRestoreGState(fl_gc);
|
||||
}
|
||||
|
||||
int Fl_Quartz_Printer::start_page (void)
|
||||
{
|
||||
OSStatus status = PMSessionBeginPageNoDialog(printSession, pageFormat, NULL);
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
||||
if ( PMSessionGetCGGraphicsContext != NULL ) {
|
||||
status = PMSessionGetCGGraphicsContext(printSession, &fl_gc);
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
#if ! __LP64__
|
||||
status = PMSessionGetGraphicsContext(printSession,NULL,(void **)&fl_gc);
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
||||
}
|
||||
#endif
|
||||
PMRect pmRect;
|
||||
float win_scale_x, win_scale_y;
|
||||
|
||||
PMPaper paper;
|
||||
PMGetPageFormatPaper(pageFormat, &paper);
|
||||
PMPaperMargins margins;
|
||||
PMPaperGetMargins(paper, &margins);
|
||||
PMOrientation orientation;
|
||||
PMGetOrientation(pageFormat, &orientation);
|
||||
|
||||
status = PMGetAdjustedPageRect(pageFormat, &pmRect);
|
||||
double h = pmRect.bottom - pmRect.top;
|
||||
x_offset = 0;
|
||||
y_offset = 0;
|
||||
angle = 0;
|
||||
scale_x = scale_y = 1;
|
||||
win_scale_x = win_scale_y = 1;
|
||||
image_list_ = NULL;
|
||||
if(orientation == kPMPortrait)
|
||||
CGContextTranslateCTM(fl_gc, margins.left, margins.bottom + h);
|
||||
else
|
||||
CGContextTranslateCTM(fl_gc, margins.top, margins.right + h);
|
||||
CGContextScaleCTM(fl_gc, win_scale_x, - win_scale_y);
|
||||
fl_quartz_restore_line_style_();
|
||||
CGContextSetShouldAntialias(fl_gc, false);
|
||||
CGContextSaveGState(fl_gc);
|
||||
CGContextSaveGState(fl_gc);
|
||||
fl_line_style(FL_SOLID);
|
||||
fl_window = (void *)1; // TODO: something better
|
||||
fl_clip_region(0);
|
||||
if( status == noErr) gc = fl_gc;
|
||||
return status != noErr;
|
||||
}
|
||||
|
||||
int Fl_Quartz_Printer::end_page (void)
|
||||
{
|
||||
CGContextFlush(fl_gc);
|
||||
CGContextRestoreGState(fl_gc);
|
||||
CGContextRestoreGState(fl_gc);
|
||||
OSStatus status = PMSessionEndPageNoDialog(printSession);
|
||||
delete_image_list();
|
||||
gc = NULL;
|
||||
return status != noErr;
|
||||
}
|
||||
|
||||
void Fl_Quartz_Printer::end_job (void)
|
||||
{
|
||||
OSStatus status;
|
||||
|
||||
status = PMSessionError(printSession);
|
||||
if (status != noErr) {
|
||||
fl_alert ("PM Session error %d", (int)status);
|
||||
}
|
||||
PMSessionEndDocumentNoDialog(printSession);
|
||||
Fl_Device::display_device()->set_current();
|
||||
fl_gc = 0;
|
||||
Fl::first_window()->show();
|
||||
}
|
||||
|
||||
#endif // __APPLE__
|
||||
|
||||
+56
-5
@@ -90,6 +90,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
|
||||
#include <FL/Fl_Device.H>
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/x.H>
|
||||
#include <FL/Fl_Window.H>
|
||||
@@ -151,6 +152,10 @@ static void createAppleMenu(void);
|
||||
static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h);
|
||||
static void cocoaMouseHandler(NSEvent *theEvent);
|
||||
|
||||
static Fl_Quartz_Display fl_quartz_device;
|
||||
FL_EXPORT Fl_Display *fl_display_device = (Fl_Display*)&fl_quartz_device; // does not change
|
||||
FL_EXPORT Fl_Device *fl_device = (Fl_Device*)&fl_quartz_device; // the current target device of graphics operations
|
||||
|
||||
// public variables
|
||||
int fl_screen;
|
||||
CGContextRef fl_gc = 0;
|
||||
@@ -2490,7 +2495,7 @@ void Fl_X::q_begin_image(CGRect &rect, int cx, int cy, int w, int h) {
|
||||
rect.origin.x = -(mx.tx+0.5f) + rect.origin.x - cx;
|
||||
rect.origin.y = (mx.ty+0.5f) - rect.origin.y - h + cy;
|
||||
rect.size.width = w;
|
||||
rect.size.height = h;
|
||||
rect.size.height = h;
|
||||
}
|
||||
*/
|
||||
void Fl_X::q_begin_image(CGRect &rect, int cx, int cy, int w, int h) {
|
||||
@@ -2790,7 +2795,7 @@ static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h)
|
||||
Fl_Region outr = (Fl_Region)malloc(sizeof(*outr));
|
||||
outr->rects = (CGRect*)malloc(4 * r->count * sizeof(CGRect));
|
||||
outr->count = 0;
|
||||
CGRect rect = FL_CGRECTMAKE_COCOA(x, y, w, h);
|
||||
CGRect rect = fl_cgrectmake_cocoa(x, y, w, h);
|
||||
for( int i = 0; i < r->count; i++) {
|
||||
CGRect A = r->rects[i];
|
||||
CGRect test = CGRectIntersection(A, rect);
|
||||
@@ -2835,7 +2840,7 @@ Fl_Region MacRectRegionIntersect(Fl_Region current, int x,int y,int w, int h)
|
||||
*/
|
||||
{
|
||||
if (current == NULL) return XRectangleRegion(x,y,w,h);
|
||||
CGRect r = FL_CGRECTMAKE_COCOA(x, y, w, h);
|
||||
CGRect r = fl_cgrectmake_cocoa(x, y, w, h);
|
||||
Fl_Region outr = (Fl_Region)malloc(sizeof(*outr));
|
||||
outr->count = current->count;
|
||||
outr->rects =(CGRect*)malloc(outr->count * sizeof(CGRect));
|
||||
@@ -2968,6 +2973,7 @@ int MACscreen_init(XRectangle screens[])
|
||||
{
|
||||
}
|
||||
- (void)showPanel;
|
||||
- (void)printPanel;
|
||||
@end
|
||||
@implementation FLaboutItemTarget
|
||||
- (void)showPanel
|
||||
@@ -2979,6 +2985,37 @@ int MACscreen_init(XRectangle screens[])
|
||||
nil];
|
||||
[NSApp orderFrontStandardAboutPanelWithOptions:options];
|
||||
}
|
||||
#include <FL/Fl_Printer.H>
|
||||
- (void)printPanel
|
||||
{
|
||||
Fl_Printer printer;
|
||||
// Fl_PSfile_Device printer;
|
||||
int w, h;
|
||||
Fl_Window *win = Fl::first_window();
|
||||
if(!win) return;
|
||||
if( printer.start_job(1) ) return;
|
||||
if( printer.start_page() ) return;
|
||||
// scale the printer device so that the window fits on the page
|
||||
float scale = 1;
|
||||
printer.printable_rect(&w, &h);
|
||||
if (win->w()>w || win->h()>h) {
|
||||
scale = (float)w/win->w();
|
||||
if ((float)h/win->h() < scale) scale = (float)h/win->h();
|
||||
printer.scale(scale, scale);
|
||||
}
|
||||
#ifdef ROTATE
|
||||
printer.scale(scale * 0.8, scale * 0.8);
|
||||
printer.printable_rect(&w, &h);
|
||||
printer.origin(w/2, h/2 );
|
||||
printer.rotate(20.);
|
||||
printer.print_widget( win, - win->w()/2, - win->h()/2 );
|
||||
#else
|
||||
printer.print_widget( win);
|
||||
//printer.print_window_part( win, 0,0, win->w(), win->h() );
|
||||
#endif
|
||||
printer.end_page();
|
||||
printer.end_job();
|
||||
}
|
||||
@end
|
||||
|
||||
static NSMenu *appleMenu;
|
||||
@@ -2998,10 +3035,17 @@ static void createAppleMenu(void)
|
||||
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||
/* Add menu items */
|
||||
title = [@"About " stringByAppendingString:(NSString*)nsappname];
|
||||
[appleMenu addItemWithTitle:title action:@selector(showPanel) keyEquivalent:@""];
|
||||
menuItem = [appleMenu addItemWithTitle:title action:@selector(showPanel) keyEquivalent:@""];
|
||||
FLaboutItemTarget *about = [[FLaboutItemTarget alloc] init];
|
||||
[[appleMenu itemAtIndex:0] setTarget:about];
|
||||
[menuItem setTarget:about];
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
// temporary for testing Fl_Printer. Contains also printPanel of class FLaboutItemTarget.
|
||||
menuItem = [appleMenu addItemWithTitle:@"Print front window" action:@selector(printPanel) keyEquivalent:@"p"];
|
||||
[menuItem setTarget:about];
|
||||
[appleMenu setAutoenablesItems:NO];
|
||||
[menuItem setEnabled:YES];
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
// end of temporary for testing Fl_Printer
|
||||
// Services Menu
|
||||
services = [[NSMenu alloc] init];
|
||||
[appleMenu addItemWithTitle:@"Services" action:nil keyEquivalent:@""];
|
||||
@@ -3457,6 +3501,13 @@ WindowRef MACwindowRef(Fl_Window *w)
|
||||
{
|
||||
return (WindowRef)[(FLWindow*)Fl_X::i(w)->xid windowRef];
|
||||
}
|
||||
|
||||
// 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_Device::current()->type() == Fl_Device::quartz_printer) 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);
|
||||
}
|
||||
|
||||
#endif // FL_DOXYGEN
|
||||
|
||||
//
|
||||
|
||||
@@ -95,6 +95,10 @@
|
||||
for async mode proper operation, not mentioning the side effects...
|
||||
*/
|
||||
|
||||
static Fl_GDI_Display fl_gdi_device;
|
||||
FL_EXPORT Fl_Display *fl_display_device = (Fl_Display*)&fl_gdi_device; // does not change
|
||||
FL_EXPORT Fl_Device *fl_device = (Fl_Device*)&fl_gdi_device; // the current target device of graphics operations
|
||||
|
||||
// dynamic wsock dll handling api:
|
||||
#if defined(__CYGWIN__) && !defined(SOCKET)
|
||||
# define SOCKET int
|
||||
@@ -1777,6 +1781,8 @@ void Fl_Window::show() {
|
||||
if (!fl_capture) BringWindowToTop(i->xid);
|
||||
//ShowWindow(i->xid,fl_capture?SW_SHOWNOACTIVATE:SW_RESTORE);
|
||||
}
|
||||
void preparePrintFront(void);
|
||||
preparePrintFront();
|
||||
}
|
||||
|
||||
Fl_Window *Fl_Window::current_;
|
||||
@@ -1915,6 +1921,63 @@ void fl_cleanup_dc_list(void) { // clean up the list
|
||||
t = win_DC_list;
|
||||
} while(t);
|
||||
}
|
||||
|
||||
Fl_Region XRectangleRegion(int x, int y, int w, int h) {
|
||||
if (Fl_Device::current()->type() < 256) 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);
|
||||
return CreatePolygonRgn(pt, 4, ALTERNATE);
|
||||
}
|
||||
|
||||
// temporary for testing purposes of the Fl_Printer class
|
||||
// contains also preparePrintFront call above
|
||||
#include <FL/Fl_Printer.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
void printFront(Fl_Widget *o, void *data)
|
||||
{
|
||||
Fl_Printer printer;
|
||||
o->window()->hide();
|
||||
Fl_Window *win = Fl::first_window();
|
||||
if(!win) return;
|
||||
int w, h;
|
||||
if( printer.start_job(1) ) { o->window()->show(); return; }
|
||||
if( printer.start_page() ) { o->window()->show(); return; }
|
||||
printer.printable_rect(&w,&h);
|
||||
// scale the printer device so that the window fits on the page
|
||||
float scale = 1;
|
||||
if (win->w() > w || win->h() > h) {
|
||||
scale = (float)w/win->w();
|
||||
if ((float)h/win->h() < scale) scale = (float)h/win->h();
|
||||
printer.scale(scale, scale);
|
||||
}
|
||||
// #define ROTATE 20.0
|
||||
#ifdef ROTATE
|
||||
printer.scale(scale * 0.8, scale * 0.8);
|
||||
printer.printable_rect(&w, &h);
|
||||
printer.origin(w/2, h/2 );
|
||||
printer.rotate(ROTATE);
|
||||
printer.print_widget( win, - win->w()/2, - win->h()/2 );
|
||||
#else
|
||||
printer.print_widget( win );
|
||||
#endif
|
||||
//printer.print_window_part( win, 0,0, win->w(), win->h(), - win->w()/2, - win->h()/2 );
|
||||
printer.end_page();
|
||||
printer.end_job();
|
||||
o->window()->show();
|
||||
}
|
||||
|
||||
void preparePrintFront(void)
|
||||
{
|
||||
static BOOL first=TRUE;
|
||||
if(!first) return;
|
||||
first=FALSE;
|
||||
static Fl_Window w(0,0,120,30);
|
||||
static Fl_Button b(0,0,w.w(),w.h(), "Print front window");
|
||||
b.callback(printFront);
|
||||
w.end();
|
||||
w.show();
|
||||
}
|
||||
#endif // FL_DOXYGEN
|
||||
|
||||
//
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
# include <X11/Xlocale.h>
|
||||
# include <X11/Xlib.h>
|
||||
|
||||
static Fl_Xlib_Display fl_xlib_device;
|
||||
FL_EXPORT Fl_Display *fl_display_device = (Fl_Display*)&fl_xlib_device; // does not change
|
||||
FL_EXPORT Fl_Device *fl_device = (Fl_Device*)&fl_xlib_device; // the current target device of graphics operations
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// interface to poll/select call:
|
||||
|
||||
@@ -1731,6 +1735,8 @@ void Fl_Window::show() {
|
||||
} else {
|
||||
XMapRaised(fl_display, i->xid);
|
||||
}
|
||||
void preparePrintFront(void);
|
||||
preparePrintFront();
|
||||
}
|
||||
|
||||
Window fl_window;
|
||||
@@ -1753,6 +1759,57 @@ void Fl_Window::make_current() {
|
||||
|
||||
}
|
||||
|
||||
// temporary for testing purposes of the Fl_Printer class
|
||||
// contains also preparePrintFront call above
|
||||
#include <FL/Fl_Printer.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
void printFront(Fl_Widget *o, void *data)
|
||||
{
|
||||
Fl_Printer printer;
|
||||
o->window()->hide();
|
||||
Fl_Window *win = Fl::first_window();
|
||||
if(!win) return;
|
||||
int w, h;
|
||||
if( printer.start_job(1) ) { o->window()->show(); return; }
|
||||
if( printer.start_page() ) { o->window()->show(); return; }
|
||||
printer.printable_rect(&w,&h);
|
||||
// scale the printer device so that the window fits on the page
|
||||
float scale = 1;
|
||||
if (win->w() > w || win->h() > h) {
|
||||
scale = (float)w/win->w();
|
||||
if ((float)h/win->h() < scale) scale = (float)h/win->h();
|
||||
printer.scale(scale, scale);
|
||||
}
|
||||
|
||||
// #define ROTATE 20.0
|
||||
#ifdef ROTATE
|
||||
printer.scale(scale * 0.8, scale * 0.8);
|
||||
printer.printable_rect(&w, &h);
|
||||
printer.origin(w/2, h/2 );
|
||||
printer.rotate(ROTATE);
|
||||
printer.print_widget( win, - win->w()/2, - win->h()/2 );
|
||||
#else
|
||||
printer.print_widget( win );
|
||||
#endif
|
||||
|
||||
//printer.print_window_part( win, 0,0,win->w(), win->h() );
|
||||
printer.end_page();
|
||||
printer.end_job();
|
||||
o->window()->show();
|
||||
}
|
||||
|
||||
void preparePrintFront(void)
|
||||
{
|
||||
static int first=1;
|
||||
if(!first) return;
|
||||
first=0;
|
||||
static Fl_Window w(0,0,150,30);
|
||||
static Fl_Button b(0,0,w.w(),w.h(), "Print front window");
|
||||
b.callback(printFront);
|
||||
w.end();
|
||||
w.show();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
+7
-1
@@ -42,6 +42,7 @@ CPPFILES = \
|
||||
Fl_Color_Chooser.cxx \
|
||||
Fl_Counter.cxx \
|
||||
Fl_Dial.cxx \
|
||||
Fl_Device.cxx \
|
||||
Fl_Double_Window.cxx \
|
||||
Fl_File_Browser.cxx \
|
||||
Fl_File_Chooser.cxx \
|
||||
@@ -69,6 +70,7 @@ CPPFILES = \
|
||||
Fl_Pixmap.cxx \
|
||||
Fl_Positioner.cxx \
|
||||
Fl_Preferences.cxx \
|
||||
Fl_Printer.cxx \
|
||||
Fl_Progress.cxx \
|
||||
Fl_Repeat_Button.cxx \
|
||||
Fl_Return_Button.cxx \
|
||||
@@ -161,7 +163,8 @@ CPPFILES = \
|
||||
fl_symbols.cxx \
|
||||
fl_vertex.cxx \
|
||||
screen_xywh.cxx \
|
||||
fl_utf8.cxx
|
||||
fl_utf8.cxx \
|
||||
ps_image.cxx
|
||||
|
||||
FLCPPFILES = \
|
||||
forms_compatability.cxx \
|
||||
@@ -175,6 +178,7 @@ GLCPPFILES = \
|
||||
Fl_Gl_Choice.cxx \
|
||||
Fl_Gl_Overlay.cxx \
|
||||
Fl_Gl_Window.cxx \
|
||||
Fl_Gl_Printer.cxx \
|
||||
freeglut_geometry.cxx \
|
||||
freeglut_stroke_mono_roman.cxx \
|
||||
freeglut_stroke_roman.cxx \
|
||||
@@ -488,6 +492,7 @@ fl_font.o: fl_font_mac.cxx fl_font_x.cxx fl_font_xft.cxx fl_font_win32.cxx
|
||||
fl_read_image.o: fl_read_image_mac.cxx fl_read_image_win32.cxx
|
||||
fl_set_fonts.o: fl_set_fonts_mac.cxx fl_set_fonts_x.cxx \
|
||||
fl_set_fonts_xft.cxx fl_set_fonts_win32.cxx
|
||||
Fl_Printer.o: Fl_Quartz_Printer.mm Fl_GDI_Printer.cxx Fl_PS_Printer.cxx
|
||||
|
||||
fl_arci.o: ../FL/mac.H ../FL/win32.H
|
||||
Fl_arg.o: ../FL/mac.H ../FL/win32.H
|
||||
@@ -521,6 +526,7 @@ fl_overlay_visual.o: ../FL/mac.H ../FL/win32.H
|
||||
Fl_Overlay_Window.o: ../FL/mac.H ../FL/win32.H
|
||||
Fl_own_colormap.o: ../FL/mac.H ../FL/win32.H
|
||||
Fl_Pixmap.o: ../FL/mac.H ../FL/win32.H
|
||||
Fl_Printer.o: ../FL/mac.H ../FL/win32.H
|
||||
fl_read_image.o: ../FL/mac.H ../FL/win32.H
|
||||
fl_read_image_mac.o: ../FL/mac.H ../FL/win32.H
|
||||
fl_read_image_win32.o: ../FL/mac.H ../FL/win32.H
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ static double _fl_hypot(double x, double y) {
|
||||
counter-clockwise from 3 o'clock. If \p end is less than \p start
|
||||
then it draws the arc in a clockwise direction.
|
||||
*/
|
||||
void fl_arc(double x, double y, double r, double start, double end) {
|
||||
void Fl_Device::arc(double x, double y, double r, double start, double end) {
|
||||
|
||||
// draw start point accurately:
|
||||
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@
|
||||
counter-clockwise from 3 o'clock. \p a2 must be greater
|
||||
than or equal to \p a1.
|
||||
*/
|
||||
void fl_arc(int x,int y,int w,int h,double a1,double a2) {
|
||||
void Fl_Device::arc(int x,int y,int w,int h,double a1,double a2) {
|
||||
if (w <= 0 || h <= 0) return;
|
||||
|
||||
#if defined(USE_X11)
|
||||
@@ -120,7 +120,7 @@ void fl_arc(int x,int y,int w,int h,double a1,double a2) {
|
||||
counter-clockwise from 3 o'clock. \p a2 must be greater
|
||||
than or equal to \p a1.
|
||||
*/
|
||||
void fl_pie(int x,int y,int w,int h,double a1,double a2) {
|
||||
void Fl_Device::pie(int x,int y,int w,int h,double a1,double a2) {
|
||||
if (w <= 0 || h <= 0) return;
|
||||
|
||||
#if defined(USE_X11)
|
||||
|
||||
+2
-2
@@ -171,7 +171,7 @@ ulong fl_xpixel(uchar r,uchar g,uchar b) {
|
||||
the foreground is not set for the current window.
|
||||
\param[in] r,g,b color components
|
||||
*/
|
||||
void fl_color(uchar r,uchar g,uchar b) {
|
||||
void Fl_Device::color(uchar r,uchar g,uchar b) {
|
||||
fl_color_ = fl_rgb_color(r, g, b);
|
||||
if(!fl_gc) return; // don't get a default gc if current window is not yet created/valid
|
||||
XSetForeground(fl_display, fl_gc, fl_xpixel(r,g,b));
|
||||
@@ -328,7 +328,7 @@ Fl_Color fl_color_;
|
||||
the foreground is not set for the current window.
|
||||
\param[in] i color
|
||||
*/
|
||||
void fl_color(Fl_Color i) {
|
||||
void Fl_Device::color(Fl_Color i) {
|
||||
if (i & 0xffffff00) {
|
||||
unsigned rgb = (unsigned)i;
|
||||
fl_color((uchar)(rgb >> 24), (uchar)(rgb >> 16), (uchar)(rgb >> 8));
|
||||
|
||||
@@ -49,7 +49,7 @@ Fl_XMap* fl_current_xmap;
|
||||
|
||||
Fl_Color fl_color_;
|
||||
|
||||
void fl_color(Fl_Color i) {
|
||||
void Fl_Device::color(Fl_Color i) {
|
||||
fl_color_ = i;
|
||||
int index;
|
||||
uchar r, g, b;
|
||||
@@ -78,7 +78,7 @@ void fl_color(Fl_Color i) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void fl_color(uchar r, uchar g, uchar b) {
|
||||
void Fl_Device::color(uchar r, uchar g, uchar b) {
|
||||
fl_color_ = fl_rgb_color(r, g, b);
|
||||
#if defined(__APPLE_QUARTZ__)
|
||||
float fr = r/255.0f;
|
||||
|
||||
@@ -94,7 +94,7 @@ static void set_xmap(Fl_XMap& xmap, COLORREF c) {
|
||||
|
||||
Fl_Color fl_color_;
|
||||
|
||||
void fl_color(Fl_Color i) {
|
||||
void Fl_Device::color(Fl_Color i) {
|
||||
if (i & 0xffffff00) {
|
||||
unsigned rgb = (unsigned)i;
|
||||
fl_color((uchar)(rgb >> 24), (uchar)(rgb >> 16), (uchar)(rgb >> 8));
|
||||
@@ -118,7 +118,7 @@ void fl_color(Fl_Color i) {
|
||||
}
|
||||
}
|
||||
|
||||
void fl_color(uchar r, uchar g, uchar b) {
|
||||
void Fl_Device::color(uchar r, uchar g, uchar b) {
|
||||
static Fl_XMap xmap;
|
||||
COLORREF c = RGB(r,g,b);
|
||||
fl_color_ = fl_rgb_color(r, g, b);
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@
|
||||
\param[in] X2,Y2 curve control point
|
||||
\param[in] X3,Y3 curve end point
|
||||
*/
|
||||
void fl_curve(double X0, double Y0,
|
||||
void Fl_Device::curve(double X0, double Y0,
|
||||
double X1, double Y1,
|
||||
double X2, double Y2,
|
||||
double X3, double Y3) {
|
||||
|
||||
@@ -543,17 +543,17 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
}
|
||||
}
|
||||
|
||||
void fl_draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
void Fl_Device::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
innards(buf,x,y,w,h,d,l,(d<3&&d>-3),0,0);
|
||||
}
|
||||
void fl_draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
void Fl_Device::draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
int x, int y, int w, int h,int d) {
|
||||
innards(0,x,y,w,h,d,0,(d<3&&d>-3),cb,data);
|
||||
}
|
||||
void fl_draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
void Fl_Device::draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
innards(buf,x,y,w,h,d,l,1,0,0);
|
||||
}
|
||||
void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data,
|
||||
void Fl_Device::draw_image_mono(Fl_Draw_Image_Cb cb, void* data,
|
||||
int x, int y, int w, int h,int d) {
|
||||
innards(0,x,y,w,h,d,0,1,cb,data);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
|
||||
#define MAXBUFFER 0x40000 // 256k
|
||||
|
||||
static void dataReleaseCB(void *info, const void *data, size_t size)
|
||||
{
|
||||
delete[] (uchar *)data;
|
||||
}
|
||||
|
||||
/**
|
||||
* draw an image based on the input parameters
|
||||
*
|
||||
@@ -73,7 +78,17 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
lut = CGColorSpaceCreateDeviceGray();
|
||||
else
|
||||
lut = CGColorSpaceCreateDeviceRGB();
|
||||
CGDataProviderRef src = CGDataProviderCreateWithData( 0L, array, linedelta*H, 0L);
|
||||
// a release callback is necessary when the fl_gc is a print context because the image data
|
||||
// must be kept until the page is closed. Thus tmpBuf can't be deleted here. It's too early.
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
||||
typedef void (*CGDataProviderReleaseDataCallback) (
|
||||
void *info,
|
||||
const void *data,
|
||||
size_t size
|
||||
);
|
||||
#endif
|
||||
CGDataProviderReleaseDataCallback releaseCB = ( cb ? dataReleaseCB : NULL);
|
||||
CGDataProviderRef src = CGDataProviderCreateWithData( 0L, array, linedelta*H, releaseCB);
|
||||
CGImageRef img = CGImageCreate( W, H, 8, 8*delta, linedelta,
|
||||
//lut, delta&1?kCGImageAlphaNone:kCGImageAlphaNoneSkipLast,
|
||||
lut, delta&1?kCGImageAlphaNone:kCGImageAlphaLast,
|
||||
@@ -89,9 +104,6 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
}
|
||||
CGColorSpaceRelease(lut);
|
||||
CGDataProviderRelease(src);
|
||||
if (cb) {
|
||||
delete[] tmpBuf;
|
||||
}
|
||||
if (img) return; // else fall through to slow mode
|
||||
// following the very save (and very slow) way to write the image into the give port
|
||||
CGContextSetShouldAntialias(fl_gc, false);
|
||||
@@ -140,17 +152,17 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
#endif
|
||||
}
|
||||
|
||||
void fl_draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
void Fl_Device::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
innards(buf,x,y,w,h,d,l,(d<3&&d>-3),0,0);
|
||||
}
|
||||
void fl_draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
void Fl_Device::draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
int x, int y, int w, int h,int d) {
|
||||
innards(0,x,y,w,h,d,0,(d<3&&d>-3),cb,data);
|
||||
}
|
||||
void fl_draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
void Fl_Device::draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
innards(buf,x,y,w,h,d,l,1,0,0);
|
||||
}
|
||||
void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data,
|
||||
void Fl_Device::draw_image_mono(Fl_Draw_Image_Cb cb, void* data,
|
||||
int x, int y, int w, int h,int d) {
|
||||
innards(0,x,y,w,h,d,0,1,cb,data);
|
||||
}
|
||||
|
||||
+10
-10
@@ -254,21 +254,21 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
}
|
||||
}
|
||||
}
|
||||
SetDIBitsToDevice(fl_gc, x, y+j-k, w, k, 0, 0, 0, k,
|
||||
(LPSTR)((uchar*)buffer+(blocking-k)*linesize),
|
||||
&bmi,
|
||||
SetDIBitsToDevice(fl_gc, x, y+j-k, w, k, 0, 0, 0, k,
|
||||
(LPSTR)((uchar*)buffer+(blocking-k)*linesize),
|
||||
&bmi,
|
||||
#if USE_COLORMAP
|
||||
indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS
|
||||
indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS
|
||||
#else
|
||||
DIB_RGB_COLORS
|
||||
DIB_RGB_COLORS
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static int fl_abs(int v) { return v<0 ? -v : v; }
|
||||
|
||||
void fl_draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
void Fl_Device::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) {
|
||||
d ^= FL_IMAGE_WITH_ALPHA;
|
||||
innards(buf,x,y,w,h,d,l,fl_abs(d),0,0);
|
||||
@@ -277,7 +277,7 @@ void fl_draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
}
|
||||
}
|
||||
|
||||
void fl_draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
void Fl_Device::draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
int x, int y, int w, int h,int d) {
|
||||
if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) {
|
||||
d ^= FL_IMAGE_WITH_ALPHA;
|
||||
@@ -287,7 +287,7 @@ void fl_draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
}
|
||||
}
|
||||
|
||||
void fl_draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
void Fl_Device::draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) {
|
||||
d ^= FL_IMAGE_WITH_ALPHA;
|
||||
innards(buf,x,y,w,h,d,l,1,0,0);
|
||||
@@ -296,7 +296,7 @@ void fl_draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int
|
||||
}
|
||||
}
|
||||
|
||||
void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data,
|
||||
void Fl_Device::draw_image_mono(Fl_Draw_Image_Cb cb, void* data,
|
||||
int x, int y, int w, int h,int d) {
|
||||
if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) {
|
||||
d ^= FL_IMAGE_WITH_ALPHA;
|
||||
|
||||
+3
-3
@@ -245,7 +245,7 @@ Fl_Font fl_font_ = 0;
|
||||
Fl_Fontsize fl_size_ = 0;
|
||||
|
||||
|
||||
void fl_font(Fl_Font fnum, Fl_Fontsize size) {
|
||||
void Fl_Device::font(Fl_Font fnum, Fl_Fontsize size) {
|
||||
if (fnum==-1) {
|
||||
fl_font_ = 0;
|
||||
fl_size_ = 0;
|
||||
@@ -408,7 +408,7 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) {
|
||||
|
||||
void fl_draw(const char *str, int n, float x, float y);
|
||||
|
||||
void fl_draw(const char* str, int n, int x, int y) {
|
||||
void Fl_Device::draw(const char* str, int n, int x, int y) {
|
||||
fl_draw(str, n, (float)x-0.0f, (float)y-0.5f);
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ void fl_draw(const char *str, int n, float x, float y) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void fl_draw(int angle, const char *str, int n, int x, int y) {
|
||||
void Fl_Device::draw(int angle, const char *str, int n, int x, int y) {
|
||||
#if defined(__APPLE_COCOA__)
|
||||
CGContextSaveGState(fl_gc);
|
||||
CGContextTranslateCTM(fl_gc, x, y);
|
||||
|
||||
+20
-3
@@ -143,7 +143,7 @@ void fl_font(Fl_Font fnum, Fl_Fontsize size, int angle) {
|
||||
fl_fontsize = find(fnum, size, angle);
|
||||
}
|
||||
|
||||
void fl_font(Fl_Font fnum, Fl_Fontsize size) {
|
||||
void Fl_Device::font(Fl_Font fnum, Fl_Fontsize size) {
|
||||
fl_font(fnum, size, 0);
|
||||
}
|
||||
|
||||
@@ -234,6 +234,21 @@ static void GetGlyphIndices_init() {
|
||||
have_loaded_GetGlyphIndices = -1; // set this non-zero when we have attempted to load GetGlyphIndicesW
|
||||
} // GetGlyphIndices_init function
|
||||
|
||||
static void on_printer_extents_update(int &dx, int &dy, int &w, int &h)
|
||||
// converts text extents from device coords to logical coords
|
||||
{
|
||||
POINT pt[3] = { {0, 0}, {dx, dy}, {dx+w, dy+h} };
|
||||
DPtoLP(fl_gc, pt, 3);
|
||||
w = pt[2].x - pt[1].x;
|
||||
h = pt[2].y - pt[1].y;
|
||||
dx = pt[1].x - pt[0].x;
|
||||
dy = pt[1].y - pt[0].y;
|
||||
}
|
||||
|
||||
// if printer context, extents shd be converted to logical coords
|
||||
#define EXTENTS_UPDATE(x,y,w,h) \
|
||||
if (Fl_Device::current()->type() == Fl_Device::gdi_printer) { 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
|
||||
static WORD *gi = NULL; // glyph indices array
|
||||
@@ -303,6 +318,7 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) {
|
||||
h = maxh + miny;
|
||||
dx = minx;
|
||||
dy = -miny;
|
||||
EXTENTS_UPDATE(dx, dy, w, h);
|
||||
return; // normal exit
|
||||
|
||||
exit_error:
|
||||
@@ -311,10 +327,11 @@ exit_error:
|
||||
h = fl_height();
|
||||
dx = 0;
|
||||
dy = fl_descent() - h;
|
||||
EXTENTS_UPDATE(dx, dy, w, h);
|
||||
return;
|
||||
} // fl_text_extents
|
||||
|
||||
void fl_draw(const char* str, int n, int x, int y) {
|
||||
void Fl_Device::draw(const char* str, int n, int x, int y) {
|
||||
int i = 0;
|
||||
int lx = 0;
|
||||
char *end = (char *)&str[n];
|
||||
@@ -342,7 +359,7 @@ void fl_draw(const char* str, int n, int x, int y) {
|
||||
SetTextColor(fl_gc, oldColor);
|
||||
}
|
||||
|
||||
void fl_draw(int angle, const char* str, int n, int x, int y) {
|
||||
void Fl_Device::draw(int angle, const char* str, int n, int x, int y) {
|
||||
fl_font(fl_font_, fl_size_, angle);
|
||||
// fl_draw(str, n, (int)x, (int)y);
|
||||
int i = 0, i2=0;
|
||||
|
||||
+23
-23
@@ -132,7 +132,7 @@ void fl_font(Fl_Font fnum, Fl_Fontsize size, int angle) {
|
||||
fl_xftfont = (void*)f->font;
|
||||
}
|
||||
|
||||
void fl_font(Fl_Font fnum, Fl_Fontsize size) {
|
||||
void Fl_Device::font(Fl_Font fnum, Fl_Fontsize size) {
|
||||
fl_font(fnum,size,0);
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ extern XVisualInfo* fl_overlay_visual;
|
||||
// still exists in an XftDraw structure. It would be nice if this is not
|
||||
// true, a lot of junk is needed to try to stop this:
|
||||
|
||||
static XftDraw* draw;
|
||||
static XftDraw* draw_;
|
||||
static Window draw_window;
|
||||
#if USE_OVERLAY
|
||||
static XftDraw* draw_overlay;
|
||||
@@ -491,36 +491,36 @@ static Window draw_overlay_window;
|
||||
|
||||
void fl_destroy_xft_draw(Window id) {
|
||||
if (id == draw_window)
|
||||
XftDrawChange(draw, draw_window = fl_message_window);
|
||||
XftDrawChange(draw_, draw_window = fl_message_window);
|
||||
#if USE_OVERLAY
|
||||
if (id == draw_overlay_window)
|
||||
XftDrawChange(draw_overlay, draw_overlay_window = fl_message_window);
|
||||
#endif
|
||||
}
|
||||
|
||||
void fl_draw(const char *str, int n, int x, int y) {
|
||||
void Fl_Device::draw(const char *str, int n, int x, int y) {
|
||||
if ( !current_font ) {
|
||||
fl_font(FL_HELVETICA, 14);
|
||||
}
|
||||
#if USE_OVERLAY
|
||||
XftDraw*& draw = fl_overlay ? draw_overlay : ::draw;
|
||||
XftDraw*& draw_ = fl_overlay ? draw_overlay : ::draw_;
|
||||
if (fl_overlay) {
|
||||
if (!draw)
|
||||
draw = XftDrawCreate(fl_display, draw_overlay_window = fl_window,
|
||||
if (!draw_)
|
||||
draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window,
|
||||
fl_overlay_visual->visual, fl_overlay_colormap);
|
||||
else //if (draw_overlay_window != fl_window)
|
||||
XftDrawChange(draw, draw_overlay_window = fl_window);
|
||||
XftDrawChange(draw_, draw_overlay_window = fl_window);
|
||||
} else
|
||||
#endif
|
||||
if (!draw)
|
||||
draw = XftDrawCreate(fl_display, draw_window = fl_window,
|
||||
if (!draw_)
|
||||
draw_ = XftDrawCreate(fl_display, draw_window = fl_window,
|
||||
fl_visual->visual, fl_colormap);
|
||||
else //if (draw_window != fl_window)
|
||||
XftDrawChange(draw, draw_window = fl_window);
|
||||
XftDrawChange(draw_, draw_window = fl_window);
|
||||
|
||||
Region region = fl_clip_region();
|
||||
if (region && XEmptyRegion(region)) return;
|
||||
XftDrawSetClip(draw, region);
|
||||
XftDrawSetClip(draw_, region);
|
||||
|
||||
// Use fltk's color allocator, copy the results to match what
|
||||
// XftCollorAllocValue returns:
|
||||
@@ -532,10 +532,10 @@ void fl_draw(const char *str, int n, int x, int y) {
|
||||
color.color.blue = ((int)b)*0x101;
|
||||
color.color.alpha = 0xffff;
|
||||
|
||||
XftDrawStringUtf8(draw, &color, current_font, x, y, (XftChar8 *)str, n);
|
||||
XftDrawStringUtf8(draw_, &color, current_font, x, y, (XftChar8 *)str, n);
|
||||
}
|
||||
|
||||
void fl_draw(int angle, const char *str, int n, int x, int y) {
|
||||
void Fl_Device::draw(int angle, const char *str, int n, int x, int y) {
|
||||
fl_font(fl_font_, fl_size_, angle);
|
||||
fl_draw(str, n, (int)x, (int)y);
|
||||
fl_font(fl_font_, fl_size_);
|
||||
@@ -547,24 +547,24 @@ void fl_draw(const char* str, int n, float x, float y) {
|
||||
|
||||
static void fl_drawUCS4(const FcChar32 *str, int n, int x, int y) {
|
||||
#if USE_OVERLAY
|
||||
XftDraw*& draw = fl_overlay ? draw_overlay : ::draw;
|
||||
XftDraw*& draw_ = fl_overlay ? draw_overlay : ::draw_;
|
||||
if (fl_overlay) {
|
||||
if (!draw)
|
||||
draw = XftDrawCreate(fl_display, draw_overlay_window = fl_window,
|
||||
if (!draw_)
|
||||
draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window,
|
||||
fl_overlay_visual->visual, fl_overlay_colormap);
|
||||
else //if (draw_overlay_window != fl_window)
|
||||
XftDrawChange(draw, draw_overlay_window = fl_window);
|
||||
XftDrawChange(draw_, draw_overlay_window = fl_window);
|
||||
} else
|
||||
#endif
|
||||
if (!draw)
|
||||
draw = XftDrawCreate(fl_display, draw_window = fl_window,
|
||||
if (!draw_)
|
||||
draw_ = XftDrawCreate(fl_display, draw_window = fl_window,
|
||||
fl_visual->visual, fl_colormap);
|
||||
else //if (draw_window != fl_window)
|
||||
XftDrawChange(draw, draw_window = fl_window);
|
||||
XftDrawChange(draw_, draw_window = fl_window);
|
||||
|
||||
Region region = fl_clip_region();
|
||||
if (region && XEmptyRegion(region)) return;
|
||||
XftDrawSetClip(draw, region);
|
||||
XftDrawSetClip(draw_, region);
|
||||
|
||||
// Use fltk's color allocator, copy the results to match what
|
||||
// XftCollorAllocValue returns:
|
||||
@@ -576,7 +576,7 @@ static void fl_drawUCS4(const FcChar32 *str, int n, int x, int y) {
|
||||
color.color.blue = ((int)b)*0x101;
|
||||
color.color.alpha = 0xffff;
|
||||
|
||||
XftDrawString32(draw, &color, current_font, x, y, (FcChar32 *)str, n);
|
||||
XftDrawString32(draw_, &color, current_font, x, y, (FcChar32 *)str, n);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void fl_quartz_restore_line_style_() {
|
||||
\note The \p dashes array does not work under Windows 95, 98 or Me,
|
||||
since those operating systems do not support complex line styles.
|
||||
*/
|
||||
void fl_line_style(int style, int width, char* dashes) {
|
||||
void Fl_Device::line_style(int style, int width, char* dashes) {
|
||||
|
||||
#if defined(USE_X11)
|
||||
int ndashes = dashes ? strlen(dashes) : 0;
|
||||
@@ -143,6 +143,8 @@ void fl_line_style(int style, int width, char* dashes) {
|
||||
if (width<1) width = 1;
|
||||
fl_quartz_line_width_ = (float)width;
|
||||
fl_quartz_line_cap_ = Cap[(style>>8)&3];
|
||||
// when printing kCGLineCapSquare seems better for solid lines
|
||||
if (Fl_Device::current()->type() == quartz_printer && style == FL_SOLID) fl_quartz_line_cap_ = kCGLineCapSquare;
|
||||
fl_quartz_line_join_ = Join[(style>>12)&3];
|
||||
char *d = dashes;
|
||||
static CGFloat pattern[16];
|
||||
|
||||
+59
-41
@@ -43,12 +43,16 @@
|
||||
|
||||
#ifdef __APPLE_QUARTZ__
|
||||
extern float fl_quartz_line_width_;
|
||||
#ifdef __APPLE_COCOA__
|
||||
#define USINGQUARTZPRINTER (Fl_Device::current()->type() == quartz_printer)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
Draws a 1-pixel border \e inside the given bounding box
|
||||
*/
|
||||
void fl_rect(int x, int y, int w, int h) {
|
||||
void Fl_Device::rect(int x, int y, int w, int h) {
|
||||
|
||||
if (w<=0 || h<=0) return;
|
||||
#if defined(USE_X11)
|
||||
XDrawRectangle(fl_display, fl_window, fl_gc, x, y, w-1, h-1);
|
||||
@@ -60,14 +64,14 @@ void fl_rect(int x, int y, int w, int h) {
|
||||
LineTo(fl_gc, x, y);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
CGRect rect = CGRectMake(x, y, w-1, h-1);
|
||||
CGContextStrokeRect(fl_gc, rect);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -79,7 +83,7 @@ void fl_rect(int x, int y, int w, int h) {
|
||||
/**
|
||||
Colors a rectangle that exactly fills the given bounding box
|
||||
*/
|
||||
void fl_rectf(int x, int y, int w, int h) {
|
||||
void Fl_Device::rectf(int x, int y, int w, int h) {
|
||||
if (w<=0 || h<=0) return;
|
||||
#if defined(USE_X11)
|
||||
if (w && h) XFillRectangle(fl_display, fl_window, fl_gc, x, y, w, h);
|
||||
@@ -90,14 +94,14 @@ void fl_rectf(int x, int y, int w, int h) {
|
||||
FillRect(fl_gc, &rect, fl_brush());
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
CGRect rect = CGRectMake(x, y, w-1, h-1);
|
||||
CGContextFillRect(fl_gc, rect);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -109,14 +113,14 @@ void fl_rectf(int x, int y, int w, int h) {
|
||||
/**
|
||||
Draws a horizontal line from (x,y) to (x1,y)
|
||||
*/
|
||||
void fl_xyline(int x, int y, int x1) {
|
||||
void Fl_Device::xyline(int x, int y, int x1) {
|
||||
#if defined(USE_X11)
|
||||
XDrawLine(fl_display, fl_window, fl_gc, x, y, x1, y);
|
||||
#elif defined(WIN32)
|
||||
MoveToEx(fl_gc, x, y, 0L); LineTo(fl_gc, x1+1, y);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
@@ -124,7 +128,7 @@ void fl_xyline(int x, int y, int x1) {
|
||||
CGContextAddLineToPoint(fl_gc, x1, y);
|
||||
CGContextStrokePath(fl_gc);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -136,7 +140,7 @@ void fl_xyline(int x, int y, int x1) {
|
||||
/**
|
||||
Draws a horizontal line from (x,y) to (x1,y), then vertical from (x1,y) to (x1,y2)
|
||||
*/
|
||||
void fl_xyline(int x, int y, int x1, int y2) {
|
||||
void Fl_Device::xyline(int x, int y, int x1, int y2) {
|
||||
#if defined (USE_X11)
|
||||
XPoint p[3];
|
||||
p[0].x = x; p[0].y = p[1].y = y;
|
||||
@@ -150,7 +154,7 @@ void fl_xyline(int x, int y, int x1, int y2) {
|
||||
LineTo(fl_gc, x1, y2);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
@@ -159,7 +163,7 @@ void fl_xyline(int x, int y, int x1, int y2) {
|
||||
CGContextAddLineToPoint(fl_gc, x1, y2);
|
||||
CGContextStrokePath(fl_gc);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -172,7 +176,7 @@ void fl_xyline(int x, int y, int x1, int y2) {
|
||||
Draws a horizontal line from (x,y) to (x1,y), then a vertical from (x1,y) to (x1,y2)
|
||||
and then another horizontal from (x1,y2) to (x3,y2)
|
||||
*/
|
||||
void fl_xyline(int x, int y, int x1, int y2, int x3) {
|
||||
void Fl_Device::xyline(int x, int y, int x1, int y2, int x3) {
|
||||
#if defined(USE_X11)
|
||||
XPoint p[4];
|
||||
p[0].x = x; p[0].y = p[1].y = y;
|
||||
@@ -188,7 +192,7 @@ void fl_xyline(int x, int y, int x1, int y2, int x3) {
|
||||
LineTo(fl_gc, x3, y2);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
@@ -198,7 +202,7 @@ void fl_xyline(int x, int y, int x1, int y2, int x3) {
|
||||
CGContextAddLineToPoint(fl_gc, x3, y2);
|
||||
CGContextStrokePath(fl_gc);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -210,7 +214,7 @@ void fl_xyline(int x, int y, int x1, int y2, int x3) {
|
||||
/**
|
||||
Draws a vertical line from (x,y) to (x,y1)
|
||||
*/
|
||||
void fl_yxline(int x, int y, int y1) {
|
||||
void Fl_Device::yxline(int x, int y, int y1) {
|
||||
#if defined(USE_X11)
|
||||
XDrawLine(fl_display, fl_window, fl_gc, x, y, x, y1);
|
||||
#elif defined(WIN32)
|
||||
@@ -219,7 +223,7 @@ void fl_yxline(int x, int y, int y1) {
|
||||
MoveToEx(fl_gc, x, y, 0L); LineTo(fl_gc, x, y1);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
@@ -227,7 +231,7 @@ void fl_yxline(int x, int y, int y1) {
|
||||
CGContextAddLineToPoint(fl_gc, x, y1);
|
||||
CGContextStrokePath(fl_gc);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -239,7 +243,7 @@ void fl_yxline(int x, int y, int y1) {
|
||||
/**
|
||||
Draws a vertical line from (x,y) to (x,y1), then a horizontal from (x,y1) to (x2,y1)
|
||||
*/
|
||||
void fl_yxline(int x, int y, int y1, int x2) {
|
||||
void Fl_Device::yxline(int x, int y, int y1, int x2) {
|
||||
#if defined(USE_X11)
|
||||
XPoint p[3];
|
||||
p[0].x = p[1].x = x; p[0].y = y;
|
||||
@@ -253,7 +257,7 @@ void fl_yxline(int x, int y, int y1, int x2) {
|
||||
LineTo(fl_gc, x2, y1);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
@@ -262,7 +266,7 @@ void fl_yxline(int x, int y, int y1, int x2) {
|
||||
CGContextAddLineToPoint(fl_gc, x2, y1);
|
||||
CGContextStrokePath(fl_gc);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -275,7 +279,7 @@ void fl_yxline(int x, int y, int y1, int x2) {
|
||||
Draws a vertical line from (x,y) to (x,y1) then a horizontal from (x,y1)
|
||||
to (x2,y1), then another vertical from (x2,y1) to (x2,y3)
|
||||
*/
|
||||
void fl_yxline(int x, int y, int y1, int x2, int y3) {
|
||||
void Fl_Device::yxline(int x, int y, int y1, int x2, int y3) {
|
||||
#if defined(USE_X11)
|
||||
XPoint p[4];
|
||||
p[0].x = p[1].x = x; p[0].y = y;
|
||||
@@ -291,7 +295,7 @@ void fl_yxline(int x, int y, int y1, int x2, int y3) {
|
||||
LineTo(fl_gc, x2, y3);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#endif
|
||||
@@ -301,7 +305,7 @@ void fl_yxline(int x, int y, int y1, int x2, int y3) {
|
||||
CGContextAddLineToPoint(fl_gc, x2, y3);
|
||||
CGContextStrokePath(fl_gc);
|
||||
#ifdef __APPLE_COCOA__
|
||||
if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
if (fl_quartz_line_width_==1.0f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
#endif
|
||||
@@ -313,7 +317,7 @@ void fl_yxline(int x, int y, int y1, int x2, int y3) {
|
||||
/**
|
||||
Draws a line from (x,y) to (x1,y1)
|
||||
*/
|
||||
void fl_line(int x, int y, int x1, int y1) {
|
||||
void Fl_Device::line(int x, int y, int x1, int y1) {
|
||||
#if defined(USE_X11)
|
||||
XDrawLine(fl_display, fl_window, fl_gc, x, y, x1, y1);
|
||||
#elif defined(WIN32)
|
||||
@@ -344,7 +348,7 @@ void fl_line(int x, int y, int x1, int y1) {
|
||||
/**
|
||||
Draws a line from (x,y) to (x1,y1) and another from (x1,y1) to (x2,y2)
|
||||
*/
|
||||
void fl_line(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
void Fl_Device::line(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
#if defined(USE_X11)
|
||||
XPoint p[3];
|
||||
p[0].x = x; p[0].y = y;
|
||||
@@ -381,7 +385,7 @@ void fl_line(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
/**
|
||||
Outlines a 3-sided polygon with lines
|
||||
*/
|
||||
void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
void Fl_Device::loop(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
#if defined(USE_X11)
|
||||
XPoint p[4];
|
||||
p[0].x = x; p[0].y = y;
|
||||
@@ -414,7 +418,7 @@ void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
/**
|
||||
Outlines a 4-sided polygon with lines
|
||||
*/
|
||||
void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
|
||||
void Fl_Device::loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
|
||||
#if defined(USE_X11)
|
||||
XPoint p[5];
|
||||
p[0].x = x; p[0].y = y;
|
||||
@@ -450,7 +454,7 @@ void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
|
||||
/**
|
||||
Fills a 3-sided polygon. The polygon must be convex.
|
||||
*/
|
||||
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
void Fl_Device::polygon(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
XPoint p[4];
|
||||
p[0].x = x; p[0].y = y;
|
||||
p[1].x = x1; p[1].y = y1;
|
||||
@@ -482,7 +486,7 @@ void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
/**
|
||||
Fills a 4-sided polygon. The polygon must be convex.
|
||||
*/
|
||||
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
|
||||
void Fl_Device::polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
|
||||
XPoint p[5];
|
||||
p[0].x = x; p[0].y = y;
|
||||
p[1].x = x1; p[1].y = y1;
|
||||
@@ -516,7 +520,7 @@ void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
|
||||
/**
|
||||
Draws a single pixel at the given coordinates
|
||||
*/
|
||||
void fl_point(int x, int y) {
|
||||
void Fl_Device::point(int x, int y) {
|
||||
#if defined(USE_X11)
|
||||
XDrawPoint(fl_display, fl_window, fl_gc, x, y);
|
||||
#elif defined(WIN32)
|
||||
@@ -645,7 +649,7 @@ Fl_Region fl_clip_region() {
|
||||
new region onto the stack.
|
||||
\param[in] x,y,w,h position and size
|
||||
*/
|
||||
void fl_push_clip(int x, int y, int w, int h) {
|
||||
void Fl_Device::push_clip(int x, int y, int w, int h) {
|
||||
Fl_Region r;
|
||||
if (w > 0 && h > 0) {
|
||||
r = XRectangleRegion(x,y,w,h);
|
||||
@@ -694,7 +698,7 @@ void fl_push_clip(int x, int y, int w, int h) {
|
||||
/**
|
||||
Pushes an empty clip region onto the stack so nothing will be clipped.
|
||||
*/
|
||||
void fl_push_no_clip() {
|
||||
void Fl_Device::push_no_clip() {
|
||||
if (rstackptr < STACK_MAX) rstack[++rstackptr] = 0;
|
||||
else Fl::warning("fl_push_no_clip: clip stack overflow!\n");
|
||||
fl_restore_clip();
|
||||
@@ -708,7 +712,7 @@ void fl_push_no_clip() {
|
||||
Unpredictable results may occur if the clip stack is not empty when
|
||||
you return to FLTK.
|
||||
*/
|
||||
void fl_pop_clip() {
|
||||
void Fl_Device::pop_clip() {
|
||||
if (rstackptr > 0) {
|
||||
Fl_Region oldr = rstack[rstackptr--];
|
||||
if (oldr) XDestroyRegion(oldr);
|
||||
@@ -726,7 +730,7 @@ void fl_pop_clip() {
|
||||
Under X this returns 2 if the rectangle is partially clipped,
|
||||
and 1 if it is entirely inside the clip region.
|
||||
*/
|
||||
int fl_not_clipped(int x, int y, int w, int h) {
|
||||
int Fl_Device::not_clipped(int x, int y, int w, int h) {
|
||||
if (x+w <= 0 || y+h <= 0) return 0;
|
||||
Fl_Region r = rstack[rstackptr];
|
||||
#if defined (USE_X11)
|
||||
@@ -734,12 +738,19 @@ int fl_not_clipped(int x, int y, int w, int h) {
|
||||
#elif defined(WIN32)
|
||||
if (!r) return 1;
|
||||
RECT rect;
|
||||
rect.left = x; rect.top = y; rect.right = x+w; rect.bottom = y+h;
|
||||
if (Fl_Device::current()->type() == Fl_Device::gdi_printer) { // 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;
|
||||
}
|
||||
else {
|
||||
rect.left = x; rect.top = y; rect.right = x+w; rect.bottom = y+h;
|
||||
}
|
||||
return RectInRegion(r,&rect);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
if (!r) return 1;
|
||||
#ifdef __APPLE_COCOA__
|
||||
CGRect arg = FL_CGRECTMAKE_COCOA(x, y, w, h);
|
||||
CGRect arg = fl_cgrectmake_cocoa(x, y, w, h);
|
||||
for(int i = 0; i < r->count; i++) {
|
||||
CGRect test = CGRectIntersection(r->rects[i], arg);
|
||||
if( ! CGRectIsEmpty(test)) return 1;
|
||||
@@ -770,7 +781,7 @@ int fl_not_clipped(int x, int y, int w, int h) {
|
||||
completely outside the region.
|
||||
\returns Non-zero if the resulting rectangle is different to the original.
|
||||
*/
|
||||
int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){
|
||||
int Fl_Device::clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){
|
||||
X = x; Y = y; W = w; H = h;
|
||||
Fl_Region r = rstack[rstackptr];
|
||||
if (!r) return 0;
|
||||
@@ -806,10 +817,17 @@ int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){
|
||||
ret = 2;
|
||||
} else if (EqualRgn(temp, rr)) { // complete
|
||||
ret = 0;
|
||||
} else { // parital intersection
|
||||
} else { // partial intersection
|
||||
RECT rect;
|
||||
GetRgnBox(temp, &rect);
|
||||
X = rect.left; Y = rect.top; W = rect.right - X; H = rect.bottom - Y;
|
||||
if(Fl_Device::current()->type() == Fl_Device::gdi_printer) { // 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;
|
||||
}
|
||||
else {
|
||||
X = rect.left; Y = rect.top; W = rect.right - X; H = rect.bottom - Y;
|
||||
}
|
||||
ret = 1;
|
||||
}
|
||||
DeleteObject(temp);
|
||||
@@ -817,7 +835,7 @@ int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){
|
||||
return ret;
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
#ifdef __APPLE_COCOA__
|
||||
CGRect arg = FL_CGRECTMAKE_COCOA(x, y, w, h);
|
||||
CGRect arg = fl_cgrectmake_cocoa(x, y, w, h);
|
||||
CGRect u = CGRectMake(0,0,0,0);
|
||||
CGRect test;
|
||||
for(int i = 0; i < r->count; i++) {
|
||||
|
||||
+23
-22
@@ -49,6 +49,7 @@ struct matrix {double a, b, c, d, x, y;};
|
||||
static matrix m = {1, 0, 0, 1, 0, 0};
|
||||
|
||||
static matrix stack[32];
|
||||
matrix * fl_matrix = &m;
|
||||
static int sptr = 0;
|
||||
|
||||
/**
|
||||
@@ -147,22 +148,22 @@ enum {LINE, LOOP, POLYGON, POINT_};
|
||||
/**
|
||||
Starts drawing a list of points. Points are added to the list with fl_vertex()
|
||||
*/
|
||||
void fl_begin_points() {n = 0; what = POINT_;}
|
||||
void Fl_Device::begin_points() {n = 0; what = POINT_;}
|
||||
|
||||
/**
|
||||
Starts drawing a list of lines.
|
||||
*/
|
||||
void fl_begin_line() {n = 0; what = LINE;}
|
||||
void Fl_Device::begin_line() {n = 0; what = LINE;}
|
||||
|
||||
/**
|
||||
Starts drawing a closed sequence of lines.
|
||||
*/
|
||||
void fl_begin_loop() {n = 0; what = LOOP;}
|
||||
void Fl_Device::begin_loop() {n = 0; what = LOOP;}
|
||||
|
||||
/**
|
||||
Starts drawing a convex filled polygon.
|
||||
*/
|
||||
void fl_begin_polygon() {n = 0; what = POLYGON;}
|
||||
void Fl_Device::begin_polygon() {n = 0; what = POLYGON;}
|
||||
|
||||
/**
|
||||
Transforms coordinate using the current transformation matrix.
|
||||
@@ -204,7 +205,7 @@ static void fl_transformed_vertex(COORD_T x, COORD_T y) {
|
||||
Adds coordinate pair to the vertex list without further transformations.
|
||||
\param[in] xf,yf transformed coordinate
|
||||
*/
|
||||
void fl_transformed_vertex(double xf, double yf) {
|
||||
void Fl_Device::transformed_vertex(double xf, double yf) {
|
||||
#ifdef __APPLE_QUARTZ__
|
||||
fl_transformed_vertex(COORD_T(xf), COORD_T(yf));
|
||||
#else
|
||||
@@ -216,14 +217,14 @@ void fl_transformed_vertex(double xf, double yf) {
|
||||
Adds a single vertex to the current path.
|
||||
\param[in] x,y coordinate
|
||||
*/
|
||||
void fl_vertex(double x,double y) {
|
||||
void Fl_Device::vertex(double x,double y) {
|
||||
fl_transformed_vertex(x*m.a + y*m.c + m.x, x*m.b + y*m.d + m.y);
|
||||
}
|
||||
|
||||
/**
|
||||
Ends list of points, and draws.
|
||||
*/
|
||||
void fl_end_points() {
|
||||
void Fl_Device::end_points() {
|
||||
#if defined(USE_X11)
|
||||
if (n>1) XDrawPoints(fl_display, fl_window, fl_gc, p, n, 0);
|
||||
#elif defined(WIN32)
|
||||
@@ -252,7 +253,7 @@ void fl_end_points() {
|
||||
/**
|
||||
Ends list of lines, and draws.
|
||||
*/
|
||||
void fl_end_line() {
|
||||
void Fl_Device::end_line() {
|
||||
if (n < 2) {
|
||||
fl_end_points();
|
||||
return;
|
||||
@@ -285,7 +286,7 @@ static void fixloop() { // remove equal points from closed path
|
||||
/**
|
||||
Ends closed sequence of lines, and draws.
|
||||
*/
|
||||
void fl_end_loop() {
|
||||
void Fl_Device::end_loop() {
|
||||
fixloop();
|
||||
if (n>2) fl_transformed_vertex((COORD_T)p[0].x, (COORD_T)p[0].y);
|
||||
fl_end_line();
|
||||
@@ -294,7 +295,7 @@ void fl_end_loop() {
|
||||
/**
|
||||
Ends convex filled polygon, and draws.
|
||||
*/
|
||||
void fl_end_polygon() {
|
||||
void Fl_Device::end_polygon() {
|
||||
fixloop();
|
||||
if (n < 3) {
|
||||
fl_end_line();
|
||||
@@ -325,7 +326,7 @@ void fl_end_polygon() {
|
||||
#endif
|
||||
}
|
||||
|
||||
static int gap;
|
||||
static int gap_;
|
||||
#if defined(WIN32)
|
||||
static int counts[20];
|
||||
static int numcount;
|
||||
@@ -345,9 +346,9 @@ static int numcount;
|
||||
whether "even/odd" or "non-zero" winding rules are used to fill them.
|
||||
Holes should be drawn in the opposite direction to the outside loop.
|
||||
*/
|
||||
void fl_begin_complex_polygon() {
|
||||
void Fl_Device::begin_complex_polygon() {
|
||||
fl_begin_polygon();
|
||||
gap = 0;
|
||||
gap_ = 0;
|
||||
#if defined(WIN32)
|
||||
numcount = 0;
|
||||
#endif
|
||||
@@ -359,23 +360,23 @@ void fl_begin_complex_polygon() {
|
||||
It is unnecessary but harmless to call fl_gap() before the first vertex,
|
||||
after the last vertex, or several times in a row.
|
||||
*/
|
||||
void fl_gap() {
|
||||
while (n>gap+2 && p[n-1].x == p[gap].x && p[n-1].y == p[gap].y) n--;
|
||||
if (n > gap+2) {
|
||||
fl_transformed_vertex((COORD_T)p[gap].x, (COORD_T)p[gap].y);
|
||||
void Fl_Device::gap() {
|
||||
while (n>gap_+2 && p[n-1].x == p[gap_].x && p[n-1].y == p[gap_].y) n--;
|
||||
if (n > gap_+2) {
|
||||
fl_transformed_vertex((COORD_T)p[gap_].x, (COORD_T)p[gap_].y);
|
||||
#if defined(WIN32)
|
||||
counts[numcount++] = n-gap;
|
||||
counts[numcount++] = n-gap_;
|
||||
#endif
|
||||
gap = n;
|
||||
gap_ = n;
|
||||
} else {
|
||||
n = gap;
|
||||
n = gap_;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Ends complex filled polygon, and draws.
|
||||
*/
|
||||
void fl_end_complex_polygon() {
|
||||
void Fl_Device::end_complex_polygon() {
|
||||
fl_gap();
|
||||
if (n < 3) {
|
||||
fl_end_line();
|
||||
@@ -417,7 +418,7 @@ void fl_end_complex_polygon() {
|
||||
a complex polygon you must use fl_arc()
|
||||
\param[in] x,y,r center and radius of circle
|
||||
*/
|
||||
void fl_circle(double x, double y,double r) {
|
||||
void Fl_Device::circle(double x, double y,double r) {
|
||||
double xt = fl_transform_x(x,y);
|
||||
double yt = fl_transform_y(x,y);
|
||||
double rx = r * (m.c ? sqrt(m.a*m.a+m.c*m.c) : fabs(m.a));
|
||||
|
||||
+249
-165
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// "$Id$"
|
||||
//
|
||||
// Print panel for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2009 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA.
|
||||
//
|
||||
// Please report all bugs and problems on the following page:
|
||||
//
|
||||
// http://www.fltk.org/str.php
|
||||
//
|
||||
|
||||
//
|
||||
// This is a temporary file. It is only for development and will
|
||||
// probably be removed later.
|
||||
//
|
||||
|
||||
#ifndef print_panel_h
|
||||
#define print_panel_h
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Double_Window.H>
|
||||
#include <FL/Fl_Group.H>
|
||||
#include <FL/Fl_Choice.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Box.H>
|
||||
#include <FL/Fl_Round_Button.H>
|
||||
#include <FL/Fl_Input.H>
|
||||
#include <FL/Fl_Spinner.H>
|
||||
#include <FL/Fl_Check_Button.H>
|
||||
#include <FL/Fl_Return_Button.H>
|
||||
#include <FL/Fl_Progress.H>
|
||||
static Fl_Double_Window* make_print_panel();
|
||||
static void print_cb(Fl_Return_Button *, void *);
|
||||
static void print_load();
|
||||
static void print_update_status();
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id$".
|
||||
//
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,6 +49,7 @@ CPPFILES =\
|
||||
cursor.cxx \
|
||||
curve.cxx \
|
||||
demo.cxx \
|
||||
device.cxx \
|
||||
doublebuffer.cxx \
|
||||
editor.cxx \
|
||||
fast_slow.cxx \
|
||||
@@ -82,6 +83,7 @@ CPPFILES =\
|
||||
pixmap_browser.cxx \
|
||||
pixmap.cxx \
|
||||
preferences.cxx \
|
||||
device.cxx \
|
||||
radio.cxx \
|
||||
resizebox.cxx \
|
||||
resize.cxx \
|
||||
@@ -119,6 +121,7 @@ ALL = \
|
||||
cursor$(EXEEXT) \
|
||||
curve$(EXEEXT) \
|
||||
demo$(EXEEXT) \
|
||||
device$(EXEEXT) \
|
||||
doublebuffer$(EXEEXT) \
|
||||
editor$(EXEEXT) \
|
||||
fast_slow$(EXEEXT) \
|
||||
@@ -148,6 +151,7 @@ ALL = \
|
||||
pixmap$(EXEEXT) \
|
||||
pixmap_browser$(EXEEXT) \
|
||||
preferences$(EXEEXT) \
|
||||
device$(EXEEXT) \
|
||||
radio$(EXEEXT) \
|
||||
resize$(EXEEXT) \
|
||||
resizebox$(EXEEXT) \
|
||||
@@ -317,6 +321,10 @@ demo$(EXEEXT): demo.o
|
||||
echo Linking $@...
|
||||
$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ demo.o $(LINKFLTKFORMS) $(LDLIBS)
|
||||
|
||||
device$(EXEEXT): device.o $(IMGLIBNAME)
|
||||
echo Linking $@...
|
||||
$(CXX) $(ARCHFLAGS) $(LDFLAGS) device.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
|
||||
|
||||
doublebuffer$(EXEEXT): doublebuffer.o
|
||||
|
||||
editor$(EXEEXT): editor.o
|
||||
@@ -404,6 +412,8 @@ pixmap_browser$(EXEEXT): pixmap_browser.o $(IMGLIBNAME)
|
||||
preferences$(EXEEXT): preferences.o
|
||||
preferences.cxx: preferences.fl ../fluid/fluid$(EXEEXT)
|
||||
|
||||
device$(EXEEXT): device.o
|
||||
|
||||
radio$(EXEEXT): radio.o
|
||||
radio.cxx: radio.fl ../fluid/fluid$(EXEEXT)
|
||||
|
||||
|
||||
@@ -157,8 +157,41 @@ void makeform(const char *name) {
|
||||
form->end();
|
||||
}
|
||||
|
||||
// added to demo printing
|
||||
#include <FL/Fl_Sys_Menu_Bar.H>
|
||||
#include <FL/Fl_Gl_Printer.H>
|
||||
|
||||
void print_cb(Fl_Widget *w, void *data)
|
||||
{
|
||||
Fl_Gl_Printer printer;
|
||||
Fl_Window *win = Fl::first_window();
|
||||
if(!win) return;
|
||||
if( printer.start_job(1) ) return;
|
||||
if( printer.start_page() ) return;
|
||||
printer.scale(0.68,0.68);
|
||||
printer.print_widget( win );
|
||||
printer.print_gl_window( cube, cube->x(), cube->y() );
|
||||
printer.print_gl_window( cube2, cube2->x(), cube2->y() );
|
||||
printer.end_page();
|
||||
printer.end_job();
|
||||
}
|
||||
// end of printing demo
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
makeform(argv[0]);
|
||||
// added to demo printing
|
||||
form->begin();
|
||||
static Fl_Menu_Item items[] = {
|
||||
{ "Menu", 0, 0, 0, FL_SUBMENU },
|
||||
{ "Print", 0, print_cb, 0, 0 },
|
||||
{ 0 },
|
||||
{ 0 }
|
||||
};
|
||||
Fl_Sys_Menu_Bar *menubar_;
|
||||
menubar_ = new Fl_Sys_Menu_Bar(0, 0, 40, 25);
|
||||
menubar_->menu(items);
|
||||
form->end();
|
||||
// end of printing demo
|
||||
speed->bounds(4,0);
|
||||
speed->value(cube->speed = cube2->speed = 1.0);
|
||||
size->bounds(4,0.01);
|
||||
|
||||
+735
File diff suppressed because it is too large
Load Diff
@@ -1420,9 +1420,38 @@ menu(int choice)
|
||||
}
|
||||
}
|
||||
|
||||
// added to demo printing
|
||||
#include <FL/Fl_Sys_Menu_Bar.H>
|
||||
#include <FL/Fl_Gl_Printer.H>
|
||||
|
||||
void print_cb(Fl_Widget *w, void *data)
|
||||
{
|
||||
Fl_Gl_Printer printer;
|
||||
Fl_Window *win = Fl::first_window();
|
||||
if(!win) return;
|
||||
if( printer.start_job(1) ) return;
|
||||
if( printer.start_page() ) return;
|
||||
printer.scale(0.68,0.68);
|
||||
printer.print_gl_window( (Fl_Gl_Window*)win );
|
||||
printer.end_page();
|
||||
printer.end_job();
|
||||
}
|
||||
// end of printing demo
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
// added to demo printing
|
||||
static Fl_Menu_Item items[] = {
|
||||
{ "Menu", 0, 0, 0, FL_SUBMENU },
|
||||
{ "Print", 0, print_cb, 0, 0 },
|
||||
{ 0 },
|
||||
{ 0 }
|
||||
};
|
||||
Fl_Sys_Menu_Bar *menubar_;
|
||||
menubar_ = new Fl_Sys_Menu_Bar(0, 0, 1, 25);
|
||||
menubar_->menu(items);
|
||||
// end of printing demo
|
||||
long i;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
@@ -124,6 +124,7 @@ int main(int argc, char **argv) {
|
||||
Fl_Double_Window window(400,400); ::w = &window;
|
||||
window.color(FL_WHITE);
|
||||
Fl_Button b(140,160,120,120,"Image w/Alpha"); ::b = &b;
|
||||
b.color(FL_YELLOW);
|
||||
|
||||
Fl_RGB_Image *rgb;
|
||||
Fl_Image *dergb;
|
||||
|
||||
+64
-17
@@ -7,10 +7,11 @@ unittests.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Hold_Browser.H
|
||||
unittests.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
|
||||
unittests.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Image.H
|
||||
unittests.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/fl_draw.H
|
||||
unittests.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Group.H ../FL/Fl_Box.H
|
||||
unittests.o: ../FL/fl_draw.H unittest_about.cxx unittest_points.cxx
|
||||
unittests.o: unittest_lines.cxx unittest_rects.cxx unittest_circles.cxx
|
||||
unittests.o: unittest_text.cxx unittest_images.cxx unittest_viewport.cxx
|
||||
unittests.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Shared_Image.H
|
||||
unittests.o: ../FL/Fl_Group.H ../FL/Fl_Box.H ../FL/fl_draw.H
|
||||
unittests.o: unittest_about.cxx unittest_points.cxx unittest_lines.cxx
|
||||
unittests.o: unittest_rects.cxx unittest_circles.cxx unittest_text.cxx
|
||||
unittests.o: unittest_images.cxx unittest_viewport.cxx
|
||||
unittests.o: unittest_scrollbarsize.cxx ../FL/Fl_Browser.H
|
||||
unittests.o: ../FL/Fl_Value_Slider.H
|
||||
adjuster.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
@@ -116,6 +117,10 @@ cube.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
cube.o: ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_Radio_Light_Button.H
|
||||
cube.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Slider.H
|
||||
cube.o: ../FL/Fl_Valuator.H ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H ../FL/gl.h
|
||||
cube.o: ../FL/Fl_Sys_Menu_Bar.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H
|
||||
cube.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Gl_Printer.H
|
||||
cube.o: ../FL/Fl_Printer.H ../FL/Fl_Device.H ../FL/x.H ../FL/fl_draw.H
|
||||
cube.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Bitmap.H
|
||||
CubeMain.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
|
||||
CubeMain.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H
|
||||
CubeMain.o: ../FL/Fl_Export.H ../FL/fl_types.h CubeViewUI.h
|
||||
@@ -148,6 +153,23 @@ demo.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
demo.o: ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_Choice.H
|
||||
demo.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
|
||||
demo.o: ../FL/filename.H ../FL/x.H
|
||||
device.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
device.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
device.o: ../FL/fl_types.h ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
|
||||
device.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
device.o: ../FL/Fl_Light_Button.H ../FL/fl_draw.H ../FL/Fl_Clock.H
|
||||
device.o: ../test/pixmaps/porsche.xpm ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
|
||||
device.o: ../FL/Fl_Bitmap.H ../FL/Fl_Round_Button.H ../FL/Fl_Light_Button.H
|
||||
device.o: ../FL/Fl_Button.H ../FL/Fl_Printer.H ../FL/Fl_Device.H ../FL/x.H
|
||||
device.o: ../FL/Fl_RGB_Image.H ../FL/Fl_File_Chooser.H
|
||||
device.o: ../FL/Fl_Double_Window.H ../FL/Fl_Group.H ../FL/Fl_Choice.H
|
||||
device.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Menu_Button.H
|
||||
device.o: ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H
|
||||
device.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
|
||||
device.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
device.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H ../FL/Fl_Box.H
|
||||
device.o: ../FL/Fl_Check_Button.H ../FL/Fl_File_Input.H ../FL/Fl_Input.H
|
||||
device.o: ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H
|
||||
doublebuffer.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
doublebuffer.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
doublebuffer.o: ../FL/fl_types.h ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
|
||||
@@ -168,7 +190,7 @@ editor.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
|
||||
editor.o: ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
editor.o: ../FL/Fl_Return_Button.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Text_Buffer.H
|
||||
editor.o: ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
editor.o: ../FL/Fl_Text_Buffer.H
|
||||
editor.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Text_Buffer.H
|
||||
fast_slow.o: fast_slow.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
|
||||
fast_slow.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H
|
||||
fast_slow.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Double_Window.H
|
||||
@@ -200,13 +222,13 @@ fonts.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Image.H
|
||||
fonts.o: ../FL/fl_draw.H ../FL/Fl_Box.H ../FL/fl_ask.H
|
||||
forms.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
forms.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
forms.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
|
||||
forms.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
|
||||
forms.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
|
||||
forms.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
forms.o: ../FL/Fl_Valuator.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
|
||||
forms.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Fl_Button.H
|
||||
forms.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
|
||||
forms.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_Device.H ../FL/x.H
|
||||
forms.o: ../FL/Xutf8.h ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
|
||||
forms.o: ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
|
||||
forms.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
|
||||
forms.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
forms.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
forms.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
|
||||
forms.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H
|
||||
forms.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
|
||||
forms.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H ../FL/fl_ask.H
|
||||
@@ -242,6 +264,11 @@ glpuzzle.o: ../config.h ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H
|
||||
glpuzzle.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H
|
||||
glpuzzle.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
glpuzzle.o: ../FL/Fl_Widget.H ../FL/glu.h trackball.c trackball.h
|
||||
glpuzzle.o: ../FL/Fl_Sys_Menu_Bar.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H
|
||||
glpuzzle.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/x.H ../FL/Xutf8.h
|
||||
glpuzzle.o: ../FL/Fl_Gl_Printer.H ../FL/Fl_Printer.H ../FL/Fl_Device.H
|
||||
glpuzzle.o: ../FL/x.H ../FL/fl_draw.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
|
||||
glpuzzle.o: ../FL/Fl_Bitmap.H ../FL/Fl_Gl_Window.H
|
||||
hello.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
hello.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
hello.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
@@ -253,7 +280,7 @@ help.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Button.H
|
||||
help.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Box.H
|
||||
help.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Fl_Scrollbar.H
|
||||
help.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
|
||||
help.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
|
||||
help.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
|
||||
iconize.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
iconize.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
iconize.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Fl_Group.H
|
||||
@@ -323,6 +350,9 @@ mandelbrot.o: ../FL/Fl_Export.H ../FL/fl_types.h mandelbrot.h ../FL/Fl_Box.H
|
||||
mandelbrot.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Double_Window.H
|
||||
mandelbrot.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
mandelbrot.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_draw.H
|
||||
mandelbrot.o: ../FL/Fl_Button.H ../FL/Fl_Printer.H ../FL/Fl_Device.H
|
||||
mandelbrot.o: ../FL/x.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
|
||||
mandelbrot.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Bitmap.H
|
||||
menubar.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
menubar.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
menubar.o: ../FL/fl_types.h ../FL/Fl_Box.H ../FL/Fl_Double_Window.H
|
||||
@@ -418,6 +448,23 @@ preferences.o: ../FL/Fl_Round_Button.H ../FL/Fl_Light_Button.H
|
||||
preferences.o: ../FL/Fl_Button.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H
|
||||
preferences.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
preferences.o: ../FL/filename.H ../FL/fl_ask.H
|
||||
device.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
device.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
device.o: ../FL/fl_types.h ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
|
||||
device.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
device.o: ../FL/Fl_Light_Button.H ../FL/fl_draw.H ../FL/Fl_Clock.H
|
||||
device.o: ../test/pixmaps/porsche.xpm ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
|
||||
device.o: ../FL/Fl_Bitmap.H ../FL/Fl_Round_Button.H ../FL/Fl_Light_Button.H
|
||||
device.o: ../FL/Fl_Button.H ../FL/Fl_Printer.H ../FL/Fl_Device.H ../FL/x.H
|
||||
device.o: ../FL/Fl_RGB_Image.H ../FL/Fl_File_Chooser.H
|
||||
device.o: ../FL/Fl_Double_Window.H ../FL/Fl_Group.H ../FL/Fl_Choice.H
|
||||
device.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Menu_Button.H
|
||||
device.o: ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H
|
||||
device.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
|
||||
device.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
|
||||
device.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H ../FL/Fl_Box.H
|
||||
device.o: ../FL/Fl_Check_Button.H ../FL/Fl_File_Input.H ../FL/Fl_Input.H
|
||||
device.o: ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H
|
||||
radio.o: radio.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
|
||||
radio.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H
|
||||
radio.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Double_Window.H
|
||||
@@ -475,10 +522,10 @@ sudoku.o: ../FL/Fl_Button.H ../FL/Fl_Group.H ../FL/fl_ask.H ../FL/fl_draw.H
|
||||
sudoku.o: ../FL/Fl_Help_Dialog.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
sudoku.o: ../FL/Fl_Box.H ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Fl_Scrollbar.H
|
||||
sudoku.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
|
||||
sudoku.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/Fl_Preferences.H
|
||||
sudoku.o: ../FL/Fl_Sys_Menu_Bar.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H
|
||||
sudoku.o: ../FL/Fl_Menu_Item.H ../FL/x.H ../FL/x.H ../FL/math.h
|
||||
sudoku.o: pixmaps/sudoku.xbm ../config.h
|
||||
sudoku.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Shared_Image.H
|
||||
sudoku.o: ../FL/Fl_Image.H ../FL/Fl_Preferences.H ../FL/Fl_Sys_Menu_Bar.H
|
||||
sudoku.o: ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/x.H
|
||||
sudoku.o: ../FL/math.h pixmaps/sudoku.xbm ../config.h
|
||||
symbols.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
|
||||
symbols.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
symbols.o: ../FL/fl_types.h ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "mandelbrot_ui.h"
|
||||
#include <FL/fl_draw.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Printer.H>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -43,8 +45,30 @@ void set_idle() {
|
||||
|
||||
static void window_callback(Fl_Widget*, void*) {exit(0);}
|
||||
|
||||
static void print(Fl_Widget *o, void *data)
|
||||
{
|
||||
Fl_Printer printer;
|
||||
Fl_Window *win = o->window();
|
||||
if(!win->visible()) return;
|
||||
win->make_current();
|
||||
uchar *image_data = fl_read_image(NULL, 0, 0, win->w(), win->h(), 0);
|
||||
if( printer.start_job(1) ) return;
|
||||
if( printer.start_page() ) return;
|
||||
printer.scale(.7,.7);
|
||||
fl_draw_image(image_data, 0,0, win->w(), win->h());
|
||||
printer.end_page();
|
||||
delete image_data;
|
||||
printer.end_job();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
mbrot.make_window();
|
||||
mbrot.window->begin();
|
||||
Fl_Button* o = new Fl_Button(0, 0, 0, 0, NULL);
|
||||
o->callback(print,NULL);
|
||||
o->shortcut(FL_CTRL+'p');
|
||||
mbrot.window->end();
|
||||
|
||||
mbrot.d->X = -.75;
|
||||
mbrot.d->scale = 2.5;
|
||||
mbrot.update_label();
|
||||
|
||||
@@ -52,7 +52,7 @@ d->new_display();}
|
||||
}
|
||||
Fl_Box {} {
|
||||
label {left: click = zoom out, drag = zoom in
|
||||
right click: Julia set}
|
||||
right click: Julia set, ctrl-P: Print}
|
||||
xywh {240 50 190 30} labelsize 10 align 24 deactivate
|
||||
}
|
||||
Fl_Slider {} {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user