Author: matt Date: 2010-04-04 13:03:55 -0700 (Sun, 04 Apr 2010) New Revision: 7420 Log: Ported more names around the device system.
Added: branches/branch-3.0/fltk3/AbstractPrinter.h branches/branch-3.0/fltk3/PSFileDevice.h Removed: branches/branch-3.0/fltk3/Fl_Abstract_Printer.H branches/branch-3.0/fltk3/Fl_PSfile_Device.H Modified: branches/branch-3.0/fltk3/Device.h branches/branch-3.0/fltk3/Fl_Printer.H branches/branch-3.0/ide/Xcode3/FLTK.xcodeproj/project.pbxproj branches/branch-3.0/src/Fl_Abstract_Printer.cxx branches/branch-3.0/src/Fl_GDI_Printer.cxx branches/branch-3.0/src/Fl_Gl_Device_Plugin.cxx branches/branch-3.0/src/Fl_Menu_.cxx branches/branch-3.0/src/Fl_PS_Printer.cxx branches/branch-3.0/src/Fl_cocoa.mm branches/branch-3.0/src/Fl_win32.cxx branches/branch-3.0/src/Fl_x.cxx branches/branch-3.0/src/ps_image.cxx Copied: branches/branch-3.0/fltk3/AbstractPrinter.h (from rev 7419, branches/branch-3.0/fltk3/Fl_Abstract_Printer.H) =================================================================== --- branches/branch-3.0/fltk3/AbstractPrinter.h (rev 0) +++ branches/branch-3.0/fltk3/AbstractPrinter.h 2010-04-04 20:03:55 UTC (rev 7420) @@ -0,0 +1,104 @@ +// +// "$Id: fltk3::AbstractPrinter.H 7337 2010-03-25 16:05:00Z manolo $" +// +// Printing support for the Fast Light Tool Kit (FLTK). +// +// Copyright 2010 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 +// + +/** \file fltk3::AbstractPrinter.H + \brief declaration of class fltk3::AbstractPrinter. + */ + +#ifndef Fltk3_Abstract_Printer_H +#define Fltk3_Abstract_Printer_H + +#include <fltk3/Device.h> + + +class Fl_Pixmap; +class Fl_RGB_Image; +class Fl_Bitmap; +class Fl_Image; + +namespace fltk3 { + +/** + \brief A virtual class for print support with several platform-specific implementations. + * + This class has no public constructor: don't instantiate it; use Fl_Printer or fltk3::PSFileDevice instead. + */ +class AbstractPrinter : public Device { + friend class ::Fl_Pixmap; + friend class ::Fl_RGB_Image; + friend class ::Fl_Bitmap; +private: +#ifdef __APPLE__ + struct chain_elt { + Fl_Image *image; + const uchar *data; + struct chain_elt *next; + }; + void add_image(Fl_Image *image, const uchar *data); // adds an image to the page image list +#endif + void traverse(fltk3::Widget *widget); // finds subwindows of widget and prints them +protected: + /** \brief horizontal offset to the origin of graphics coordinates */ + int x_offset; + /** \brief vertical offset to the origin of graphics coordinates */ + int y_offset; + /** \brief chained list of Fl_Image's used in this page */ + struct chain_elt *image_list_; + /** \brief the printer's graphics context, if there's one, NULL otherwise */ + void *gc; + /** \brief the constructor */ + AbstractPrinter(void) { gc = NULL; bg_r_ = bg_g_ = bg_b_ = 0; }; +#ifdef __APPLE__ + /** \brief deletes the page image list */ + void delete_image_list(); +#endif +public: + fltk3::Device *set_current(void); + virtual int start_job(int pagecount, int *frompage = NULL, int *topage = NULL); + virtual int start_page(void); + virtual int printable_rect(int *w, int *h); + virtual void margins(int *left, int *top, int *right, int *bottom); + virtual void origin(int x, int y); + void origin(int *x, int *y); + virtual void scale(float scale_x, float scale_y); + virtual void rotate(float angle); + virtual void translate(int x, int y); + virtual void untranslate(void); + void print_widget(fltk3::Widget* widget, int delta_x = 0, int delta_y = 0); + void print_window_part(fltk3::Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0); + virtual int end_page (void); + virtual void end_job (void); +}; + +} // Namespace fltk3 + +#endif // Fl_Abstract_Printer_H + +// +// End of "$Id: fltk3::AbstractPrinter.H 7337 2010-03-25 16:05:00Z manolo $" +// + Modified: branches/branch-3.0/fltk3/Device.h =================================================================== --- branches/branch-3.0/fltk3/Device.h 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/fltk3/Device.h 2010-04-04 20:03:55 UTC (rev 7420) @@ -1,8 +1,8 @@ // // "$Id: Device.H 7330 2010-03-25 13:59:00Z manolo $" // -// Definition of classes Device, Fl_Display, Fl_Quartz_Display, Fl_GDI_Display, -// and Fl_Xlib_Display for the Fast Light Tool Kit (FLTK). +// Definition of classes Device, fltk3::Display, fltk3::QuartzDisplay, fltk3::GDIDisplay, +// and fltk3::XlibDisplay for the Fast Light Tool Kit (FLTK). // // Copyright 2010 by Bill Spitzak and others. // @@ -26,7 +26,7 @@ // http://www.fltk.org/str.php // /** \file Device.H - \brief declaration of classes Device, Fl_Display. + \brief declaration of classes Device, fltk3::Display. */ #ifndef Fltk3_Device_H @@ -52,14 +52,14 @@ namespace fltk3 { class Widget; class Device; + class Display; + class AbstractPrinter; } -class Fl_Display; -class Fl_Abstract_Printer; /** \brief Points to the device that currently receives all graphics requests */ FL_EXPORT extern fltk3::Device *fl_device; /** \brief Points to the platform's display device */ -FL_EXPORT extern Fl_Display *fl_display_device; +FL_EXPORT extern fltk3::Display *fl_display_device; /** signature of image generation callback function. @@ -324,45 +324,50 @@ /** @brief Returns the platform's display device. */ - static Fl_Display *display_device() { return fl_display_device; }; + static fltk3::Display *display_device() { return fl_display_device; }; }; extern FL_EXPORT fltk3::Device *fl_device; + +namespace fltk3 { + /** @brief A virtual class subclassed for OS-specific display graphics. */ -class Fl_Display : public fltk3::Device { - friend class Fl_PSfile_Device; +class Display : public Device { + friend class PSFileDevice; }; #if defined(__APPLE__) || defined(FL_DOXYGEN) /** @brief The Mac OS X-specific display graphics class. */ -class Fl_Quartz_Display : public Fl_Display { +class QuartzDisplay : public Display { public: - Fl_Quartz_Display() { type_ = quartz_display; }; + QuartzDisplay() { type_ = quartz_display; }; }; #endif #if defined(WIN32) || defined(FL_DOXYGEN) /** @brief The MSWindows-specific display graphics class. */ -class Fl_GDI_Display : public Fl_Display { +class GDIDisplay : public Display { public: - Fl_GDI_Display() { type_ = gdi_display; }; + GDIDisplay() { 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 { +class XlibDisplay : public Display { public: - Fl_Xlib_Display() { type_ = xlib_display; }; + XlibDisplay() { type_ = xlib_display; }; }; #endif + +} // namespace fltk3 #endif // Device_H Deleted: branches/branch-3.0/fltk3/Fl_Abstract_Printer.H Deleted: branches/branch-3.0/fltk3/Fl_PSfile_Device.H Modified: branches/branch-3.0/fltk3/Fl_Printer.H =================================================================== --- branches/branch-3.0/fltk3/Fl_Printer.H 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/fltk3/Fl_Printer.H 2010-04-04 20:03:55 UTC (rev 7420) @@ -31,7 +31,7 @@ #ifndef Fl_Printer_H #define Fl_Printer_H -#include <fltk3/Fl_Abstract_Printer.H> +#include <fltk3/AbstractPrinter.h> #include <fltk3/draw.h> #include <fltk3/Fl_Pixmap.H> #include <fltk3/Fl_RGB_Image.H> @@ -53,7 +53,7 @@ In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls and finish by end_page() and end_job() calls. <p>On Xlib-based platforms (<i>e.g.</i>, Linux, Unix), this class is implemented as - a subclass of Fl_PSfile_Device. + a subclass of fltk3::PSFileDevice. <p>On Xlib-based platforms, the static public attributes of this class can be used to set the print dialog to other languages than English. For example, the "Printer:" dialog item Fl_Printer::dialog_printer can be set to French with: @@ -62,11 +62,11 @@ Fl_Printer myprinter; myprinter.start_job(); \endcode - Use Fl_PSfile_Device::file_chooser_title to customize the title of the file chooser dialog that opens + Use fltk3::PSFileDevice::file_chooser_title to customize the title of the file chooser dialog that opens when using the "Print To File" option of the print dialog. - \see Fl_PSfile_Device. + \see fltk3::PSFileDevice. */ -class Fl_Printer : public Fl_Abstract_Printer { +class Fl_Printer : public fltk3::AbstractPrinter { private: #ifdef __APPLE__ float scale_x; @@ -155,9 +155,9 @@ #else -#include <fltk3/Fl_PSfile_Device.H> +#include <fltk3/PSFileDevice.H> -class Fl_Printer : public Fl_PSfile_Device { +class Fl_Printer : public fltk3::PSFileDevice { public: static const char *dialog_title; // all of this must be duplicated above for correct documentation static const char *dialog_printer; @@ -204,7 +204,7 @@ \param w the widget \param x,y offsets where to print relatively to coordinates origin */ - virtual int print(Fl_Abstract_Printer* p, fltk3::Widget* w, int x, int y) { return 0; } + virtual int print(fltk3::AbstractPrinter* p, fltk3::Widget* w, int x, int y) { return 0; } }; #endif // Fl_Printer_H Copied: branches/branch-3.0/fltk3/PSFileDevice.h (from rev 7417, branches/branch-3.0/fltk3/Fl_PSfile_Device.H) =================================================================== --- branches/branch-3.0/fltk3/PSFileDevice.h (rev 0) +++ branches/branch-3.0/fltk3/PSFileDevice.h 2010-04-04 20:03:55 UTC (rev 7420) @@ -0,0 +1,273 @@ +// +// "$Id: fltk3::PSFileDevice.H 7356 2010-03-29 12:52:28Z manolo $" +// +// Support for graphics output to PostScript file for the Fast Light Tool Kit (FLTK). +// +// Copyright 2010 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 +// + +#include "Fl_Printer.H" // must stay here + +#ifndef Fltk3_PSfile_Device_H +#define Fltk3_PSfile_Device_H + +#define NO_PAGE_FORMATS 30 /* MSVC6 compilation fix */ + +namespace fltk3 { + +/** + \brief Sends all graphics to a local PostScript file; same API as Fl_Printer class. + * + This class has the same API as class Fl_Printer except for start_job() member function. + <p>PostScript text output is presently implemented only for the latin character set. + FLTK's standard fonts are output using PostScript's standard fonts: Helvetica, Courier, + Times (and their bold, oblique, italic variants), Symbol, ZapfDingbats. + */ +FL_EXPORT class PSFileDevice : public AbstractPrinter { + public: + /** + \brief Possible page formats. + */ + enum Page_Format { + A0 = 0, + A1, + A2, + A3, + A4, + A5, + A6, + A7, + A8, + A9, + B0, + B1, + B2, + B3, + B4, + B5, + B6, + B7, + B8, + B9, + B10, + C5E, + DLE, + EXECUTIVE, + FOLIO, + LEDGER, + LEGAL, + LETTER, + TABLOID, + ENVELOPE, + MEDIA = 0x1000 + }; + + /** + \brief Possible page layouts. + */ + enum Page_Layout {PORTRAIT = 0, LANDSCAPE = 0x100, REVERSED = 0x200, ORIENTATION = 0x300}; + +#ifndef FL_DOXYGEN + private: + enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS}; + + class Clip{ + public: + int x, y, w, h; + Clip *prev; + }; + Clip * clip_; + + int lang_level_; + int font_; + int size_; + Fl_Color color_; + int gap_; + int pages_; + + double width_; + double height_; + + int shape_; + int linewidth_;// need for clipping, lang level 1-2 + int linestyle_;// + int interpolate_; //interpolation of images + unsigned char cr_,cg_,cb_; + char linedash_[256];//should be enought + void concat(); // transform ror scalable dradings... + void reconcat(); //invert + void recover(); //recovers the state afrer grestore (such as line styles...) + void reset(); + + uchar * mask; + int mx; // width of mask; + int my; // mask lines + //Fl_Color bg_; + int (*close_cmd_)(FILE *); + int page_policy_; + int nPages; + int orientation_; + + float scale_x; + float scale_y; + float angle; + int left_margin; + int top_margin; + protected: + typedef struct page_format { + int width; + int height; + const char *name; + } page_format; + + FILE *output; + double pw_, ph_; + static const page_format page_formats[NO_PAGE_FORMATS]; + + uchar bg_r, bg_g, bg_b; + int start_postscript (int pagecount, enum Page_Format format, enum Page_Layout layout); + /* int alpha_mask(const uchar * data, int w, int h, int D, int LD=0); + */ + void draw(const char* s, int n, int x, int y) {transformed_draw(s,n,x,y); }; + void draw(int angle, const char *str, int n, int x, int y); + void transformed_draw(const char* s, int n, double x, double y); //precise text placing + void transformed_draw(const char* s, double x, double y); + int alpha_mask(const uchar * data, int w, int h, int D, int LD=0); + void draw_scaled_image(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0); + void draw_scaled_image_mono(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0); + void draw_scaled_image(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D); + void draw_scaled_image_mono(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D); + + enum Page_Format page_format_; + char *ps_filename_; + // implementation of drawing methods + void color(Fl_Color c); + //void bg_color(Fl_Color bg); + void color(uchar r, uchar g, uchar b); + Fl_Color color(){return color_;}; + + void push_clip(int x, int y, int w, int h); + int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H); + int not_clipped(int x, int y, int w, int h); + void push_no_clip(); + void pop_clip(); + + void line_style(int style, int width=0, char* dashes=0); + + void rect(int x, int y, int w, int h); + void rectf(int x, int y, int w, int h); + + void xyline(int x, int y, int x1); + void xyline(int x, int y, int x1, int y2); + void xyline(int x, int y, int x1, int y2, int x3); + + void yxline(int x, int y, int y1); + void yxline(int x, int y, int y1, int x2); + void yxline(int x, int y, int y1, int x2, int y3); + + void line(int x1, int y1, int x2, int y2); + void line(int x1, int y1, int x2, int y2, int x3, int y3); + + void loop(int x0, int y0, int x1, int y1, int x2, int y2); + void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); + void polygon(int x0, int y0, int x1, int y1, int x2, int y2); + void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); + void point(int x, int y); + + void begin_points(); + void begin_line(); + void begin_loop(); + void begin_polygon(); + void vertex(double x, double y); + void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3); + void circle(double x, double y, double r); + void arc(double x, double y, double r, double start, double a); + void arc(int x, int y, int w, int h, double a1, double a2); + void pie(int x, int y, int w, int h, double a1, double a2); + void end_points(); + void end_line(); + void end_loop(); + void end_polygon(); + void begin_complex_polygon(){begin_polygon();}; + void gap(){gap_=1;}; + void end_complex_polygon(){end_polygon();}; + void transformed_vertex(double x, double y); + + void font(int face, int size); + int font(){return font_;}; + int size(){return size_;}; + double width(unsigned c); + double width(const char* s, int n); + int descent(); + int height(); + + void draw_image(const uchar* d, int x,int y,int w,int h, int delta=3, int ldelta=0){draw_scaled_image(d,x,y,w,h,w,h,delta,ldelta);}; + void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0){draw_scaled_image_mono(d,x,y,w,h,w,h,delta,ld);}; + void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3){draw_scaled_image(call,data, x, y, w, h, w, h, delta);}; + void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1){draw_scaled_image_mono(call, data, x, y, w, h, w, h, delta);}; + + void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy); + void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy); + void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy); + + public: + void page_policy(int p); + int page_policy(){return page_policy_;}; + void close_command( int (*cmd)(FILE *)){close_cmd_=cmd;}; + FILE * file() {return output;}; + //void orientation (int o); + //fltk3::PSFileDevice(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor + //fltk3::PSFileDevice(FILE *o, int lang_level, int x, int y, int w, int h); //eps constructor + void interpolate(int i){interpolate_=i;}; + int interpolate(){return interpolate_;} + + void page(double pw, double ph, int media = 0); + void page(int format); + + void place(double x, double y, double tx, double ty, double scale = 1); + int start_page (void); + int printable_rect(int *w, int *h); + void margins(int *left, int *top, int *right, int *bottom); + void origin(int x, int y); + void scale (float scale_x, float scale_y); + void rotate(float angle); + void translate(int x, int y); + void untranslate(void); + int end_page (void); + void end_job(void); +#endif // FL_DOXYGEN + PSFileDevice(void); + int start_job(int pagecount, enum Page_Format format = A4, enum Page_Layout layout = PORTRAIT); + int start_job(FILE *ps_output, int pagecount, enum Page_Format format = A4, enum Page_Layout layout = PORTRAIT); + virtual ~PSFileDevice(); + + /** [this text may be customized at run-time] */ + static const char *file_chooser_title; +}; + +} + +#endif // Fl_PSfile_Device_H + +// +// End of "$Id: fltk3::PSFileDevice.H 7356 2010-03-29 12:52:28Z manolo $" +// Modified: branches/branch-3.0/ide/Xcode3/FLTK.xcodeproj/project.pbxproj =================================================================== --- branches/branch-3.0/ide/Xcode3/FLTK.xcodeproj/project.pbxproj 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/ide/Xcode3/FLTK.xcodeproj/project.pbxproj 2010-04-04 20:03:55 UTC (rev 7420) @@ -5526,14 +5526,14 @@ name = forms; sourceTree = "<group>"; }; - 580C162D2902D7A4879534EF /* arc */ = { + 580C162D2902D7A4879534EF /* 123 arc */ = { isa = PBXGroup; children = ( 1744E1250A97A2CD350F732F /* arc.cxx */, C920562411667E650070F7FC /* arc1.cxx */, C920562511667E650070F7FC /* arc2.cxx */, ); - name = arc; + name = "123 arc"; sourceTree = "<group>"; }; 5FC9447FDC36128608A852BA /* glpuzzle */ = { @@ -5575,7 +5575,7 @@ children = ( 8F4A9C8D7772A59E17445DEB /* Demo */, 62276F2F524C874B6A0EB5B0 /* adjuster */, - 580C162D2902D7A4879534EF /* arc */, + 580C162D2902D7A4879534EF /* 123 arc */, 91FDF99B89F9FF9129E85003 /* ask */, 86CA4FED4095C8CF53154A82 /* bitmap */, 06DFADCF98F35FEDD23C6865 /* blocks */, Modified: branches/branch-3.0/src/Fl_Abstract_Printer.cxx =================================================================== --- branches/branch-3.0/src/Fl_Abstract_Printer.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_Abstract_Printer.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -1,7 +1,7 @@ // // "$Id$" // -// implementation of Fl_Abstract_Printer class for the Fast Light Tool Kit (FLTK). +// implementation of fltk3::AbstractPrinter class for the Fast Light Tool Kit (FLTK). // // Copyright 2010 by Bill Spitzak and others. // @@ -24,8 +24,8 @@ // // http://www.fltk.org/str.php // -/** \file Fl_Abstract_Printer.cxx - \brief implementation of class Fl_Abstract_Printer. +/** \file fltk3::AbstractPrinter.cxx + \brief implementation of class fltk3::AbstractPrinter. */ #include <fltk3/run.h> @@ -44,7 +44,7 @@ to the current origin of graphics functions. @param[in] delta_y Same as above, vertically. */ -void Fl_Abstract_Printer::print_widget(fltk3::Widget* widget, int delta_x, int delta_y) +void fltk3::AbstractPrinter::print_widget(fltk3::Widget* widget, int delta_x, int delta_y) { int old_x, old_y, new_x, new_y, is_window; if ( ! widget->visible() ) return; @@ -83,7 +83,7 @@ } -void Fl_Abstract_Printer::traverse(fltk3::Widget *widget) +void fltk3::AbstractPrinter::traverse(fltk3::Widget *widget) { fltk3::Group *g = widget->as_group(); if (!g) return; @@ -104,7 +104,7 @@ @param[out] x If non-null, *x is set to the horizontal page offset of graphics origin. @param[out] y Same as above, vertically. */ -void Fl_Abstract_Printer::origin(int *x, int *y) +void fltk3::AbstractPrinter::origin(int *x, int *y) { if (x) *x = x_offset; if (y) *y = y_offset; @@ -121,7 +121,7 @@ @param delta_x Optional horizontal offset from current graphics origin where to print the captured rectangle. @param delta_y As above, vertically. */ -void Fl_Abstract_Printer::print_window_part(fltk3::Window *win, int x, int y, int w, int h, int delta_x, int delta_y) +void fltk3::AbstractPrinter::print_window_part(fltk3::Window *win, int x, int y, int w, int h, int delta_x, int delta_y) { int slice, width, offset, count = 0; fltk3::Device::display_device()->set_current(); @@ -156,7 +156,7 @@ } #ifdef __APPLE__ -void Fl_Abstract_Printer::add_image(Fl_Image *image, const uchar *data) +void fltk3::AbstractPrinter::add_image(Fl_Image *image, const uchar *data) { struct chain_elt *elt = (struct chain_elt *)calloc(sizeof(struct chain_elt), 1); elt->image = image; @@ -165,7 +165,7 @@ image_list_ = elt; } -void Fl_Abstract_Printer::delete_image_list() +void fltk3::AbstractPrinter::delete_image_list() { while(image_list_) { struct chain_elt *next = image_list_->next; @@ -177,7 +177,7 @@ } #endif -fltk3::Device *Fl_Abstract_Printer::set_current(void) +fltk3::Device *fltk3::AbstractPrinter::set_current(void) { #ifdef __APPLE__ fl_gc = (CGContextRef)gc; @@ -198,7 +198,7 @@ @param[out] topage if non-null, *topage is set to the last page the user wants printed @return 0 iff OK */ -int Fl_Abstract_Printer::start_job(int pagecount, int *frompage, int *topage) {return 1;} +int fltk3::AbstractPrinter::start_job(int pagecount, int *frompage, int *topage) {return 1;} /** @brief Starts a new printed page @@ -207,7 +207,7 @@ and with origin at the top left of the printable page area. @return 0 iff OK */ -int Fl_Abstract_Printer::start_page (void) {return 1;} +int fltk3::AbstractPrinter::start_page (void) {return 1;} /** @brief Computes the width and height of the printable area of the page. @@ -217,7 +217,7 @@ Values account for the user-selected paper type and print orientation. @return 0 iff OK. */ -int Fl_Abstract_Printer::printable_rect(int *w, int *h) {return 1;} +int fltk3::AbstractPrinter::printable_rect(int *w, int *h) {return 1;} /** @brief Computes the dimensions of margins that lie between the printable page area and @@ -230,7 +230,7 @@ @param[out] right If non-null, *right is set to the right margin size. @param[out] bottom If non-null, *bottom is set to the bottom margin size. */ -void Fl_Abstract_Printer::margins(int *left, int *top, int *right, int *bottom) {} +void fltk3::AbstractPrinter::margins(int *left, int *top, int *right, int *bottom) {} /** @brief Sets the position in page coordinates of the origin of graphics functions. @@ -243,7 +243,7 @@ @param[in] x Horizontal position in page coordinates of the desired origin of graphics functions. @param[in] y Same as above, vertically. */ -void Fl_Abstract_Printer::origin(int x, int y) {} +void fltk3::AbstractPrinter::origin(int x, int y) {} /** @brief Changes the scaling of page coordinates. @@ -254,7 +254,7 @@ @param scale_x Horizontal dimensions of plot are multiplied by this quantity. @param scale_y Same as above, vertically. */ -void Fl_Abstract_Printer::scale (float scale_x, float scale_y) {} +void fltk3::AbstractPrinter::scale (float scale_x, float scale_y) {} /** @brief Rotates the graphics operations relatively to paper. @@ -263,19 +263,19 @@ On MSWindows, Fl_RGB_Image's don't rotate well; print_window_part() is an efficient workaround. @param angle Rotation angle in counterclockwise degrees. */ -void Fl_Abstract_Printer::rotate(float angle) {} +void fltk3::AbstractPrinter::rotate(float angle) {} /** @brief To be called at the end of each page. * @return 0 iff OK. */ -int Fl_Abstract_Printer::end_page (void) {return 1;} +int fltk3::AbstractPrinter::end_page (void) {return 1;} /** @brief To be called at the end of a print job. */ -void Fl_Abstract_Printer::end_job (void) {} +void fltk3::AbstractPrinter::end_job (void) {} /** @brief Translates the current graphics origin accounting for the current rotation. @@ -284,12 +284,12 @@ Each translate() call must be matched by an untranslate() call. Successive translate() calls add up their effects. */ -void Fl_Abstract_Printer::translate(int x, int y) {} +void fltk3::AbstractPrinter::translate(int x, int y) {} /** @brief Undoes the effect of a previous translate() call. */ -void Fl_Abstract_Printer::untranslate(void) {} +void fltk3::AbstractPrinter::untranslate(void) {} // // End of "$Id$". Modified: branches/branch-3.0/src/Fl_GDI_Printer.cxx =================================================================== --- branches/branch-3.0/src/Fl_GDI_Printer.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_GDI_Printer.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -34,7 +34,7 @@ extern HWND fl_window; -Fl_Printer::Fl_Printer(void) : Fl_Abstract_Printer() { +Fl_Printer::Fl_Printer(void) : fltk3::AbstractPrinter() { hPr = NULL; type_ = gdi_printer; } Modified: branches/branch-3.0/src/Fl_Gl_Device_Plugin.cxx =================================================================== --- branches/branch-3.0/src/Fl_Gl_Device_Plugin.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_Gl_Device_Plugin.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -40,7 +40,7 @@ } #endif -static void print_gl_window(Fl_Abstract_Printer *printer, Fl_Gl_Window *glw, int x, int y) +static void print_gl_window(fltk3::AbstractPrinter *printer, Fl_Gl_Window *glw, int x, int y) { #ifdef WIN32 HDC save_gc = fl_gc; @@ -137,7 +137,7 @@ \param w the widget \param x,y offsets where to print relatively to coordinates origin */ - virtual int print(Fl_Abstract_Printer *p, fltk3::Widget *w, int x, int y) { + virtual int print(fltk3::AbstractPrinter *p, fltk3::Widget *w, int x, int y) { Fl_Gl_Window *glw = w->as_gl_window(); if (!glw) return 0; print_gl_window(p, glw, x, y); Modified: branches/branch-3.0/src/Fl_Menu_.cxx =================================================================== --- branches/branch-3.0/src/Fl_Menu_.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_Menu_.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -329,6 +329,7 @@ } } + // // End of "$Id$". // Modified: branches/branch-3.0/src/Fl_PS_Printer.cxx =================================================================== --- branches/branch-3.0/src/Fl_PS_Printer.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_PS_Printer.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -29,15 +29,15 @@ #include <fltk3/ask.h> #include <fltk3/draw.h> #include <stdio.h> -#include <fltk3/Fl_PSfile_Device.H> +#include <fltk3/PSFileDevice.H> #include <fltk3/Fl_Native_File_Chooser.H> -const char *Fl_PSfile_Device::file_chooser_title = "Select a .ps file"; +const char *fltk3::PSFileDevice::file_chooser_title = "Select a .ps file"; /** @brief The constructor. */ -Fl_PSfile_Device::Fl_PSfile_Device(void) +fltk3::PSFileDevice::PSFileDevice(void) { close_cmd_ = 0; //lang_level_ = 3; @@ -53,16 +53,16 @@ /** @brief Begins the session where all graphics requests will go to a local PostScript file. * - Opens a file dialog entitled with Fl_PSfile_Device::file_chooser_title to select an output PostScript file. + Opens a file dialog entitled with fltk3::PSFileDevice::file_chooser_title to select an output PostScript file. @param pagecount The total number of pages to be created. @param format Desired page format. @param layout Desired page layout. @return 0 iff OK, 1 if user cancelled the file dialog, 2 if fopen failed on user-selected output file. */ -int Fl_PSfile_Device::start_job (int pagecount, enum Page_Format format, enum Page_Layout layout) +int fltk3::PSFileDevice::start_job (int pagecount, enum Page_Format format, enum Page_Layout layout) { Fl_Native_File_Chooser fnfc; - fnfc.title(Fl_PSfile_Device::file_chooser_title); + fnfc.title(fltk3::PSFileDevice::file_chooser_title); fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); fnfc.options(Fl_Native_File_Chooser::SAVEAS_CONFIRM); fnfc.filter("PostScript\t*.ps\n"); @@ -85,7 +85,7 @@ @param layout Desired page layout. @return always 0. */ -int Fl_PSfile_Device::start_job (FILE *ps_output, int pagecount, enum Page_Format format, enum Page_Layout layout) +int fltk3::PSFileDevice::start_job (FILE *ps_output, int pagecount, enum Page_Format format, enum Page_Layout layout) { output = ps_output; ps_filename_ = NULL; @@ -96,7 +96,7 @@ /** @brief The destructor. */ -Fl_PSfile_Device::~Fl_PSfile_Device() { +fltk3::PSFileDevice::~PSFileDevice() { if (ps_filename_) free(ps_filename_); } @@ -106,7 +106,7 @@ #include "print_panel.cxx" #endif -const Fl_PSfile_Device::page_format Fl_PSfile_Device::page_formats[NO_PAGE_FORMATS] = { // order of enum Page_Format +const fltk3::PSFileDevice::page_format fltk3::PSFileDevice::page_formats[NO_PAGE_FORMATS] = { // order of enum Page_Format // comes from appendix B of 5003.PPD_Spec_v4.3.pdf // A* // index(Ai) = i @@ -458,7 +458,7 @@ // end prolog -int Fl_PSfile_Device::start_postscript (int pagecount, enum Page_Format format, enum Page_Layout layout) +int fltk3::PSFileDevice::start_postscript (int pagecount, enum Page_Format format, enum Page_Layout layout) //returns 0 iff OK { int w, h, x; @@ -516,13 +516,13 @@ return 0; } -void Fl_PSfile_Device::recover(){ +void fltk3::PSFileDevice::recover(){ color(cr_,cg_,cb_); line_style(linestyle_,linewidth_,linedash_); font(font_,size_); } -void Fl_PSfile_Device::reset(){ +void fltk3::PSFileDevice::reset(){ gap_=1; clip_=0; cr_=cg_=cb_=0; @@ -541,7 +541,7 @@ } -void Fl_PSfile_Device::page_policy(int p){ +void fltk3::PSFileDevice::page_policy(int p){ page_policy_ = p; if(lang_level_>=2) fprintf(output,"<< /Policies << /Pagesize %i >> >> setpagedevice\n", p); @@ -551,7 +551,7 @@ -void Fl_PSfile_Device::page(double pw, double ph, int media) { +void fltk3::PSFileDevice::page(double pw, double ph, int media) { if (nPages){ fprintf(output, "CR\nGR\nGR\nGR\nSP\nrestore\n"); @@ -600,20 +600,20 @@ fprintf(output, "GS\nCS\n"); }; -void Fl_PSfile_Device::page(int format){ +void fltk3::PSFileDevice::page(int format){ if(format & LANDSCAPE){ - ph_=Fl_PSfile_Device::page_formats[format & 0xFF].width; - pw_=Fl_PSfile_Device::page_formats[format & 0xFF].height; + ph_=fltk3::PSFileDevice::page_formats[format & 0xFF].width; + pw_=fltk3::PSFileDevice::page_formats[format & 0xFF].height; }else{ - pw_=Fl_PSfile_Device::page_formats[format & 0xFF].width; - ph_=Fl_PSfile_Device::page_formats[format & 0xFF].height; + pw_=fltk3::PSFileDevice::page_formats[format & 0xFF].width; + ph_=fltk3::PSFileDevice::page_formats[format & 0xFF].height; } page(pw_,ph_,format & 0xFF00);//,orientation only; }; -void Fl_PSfile_Device::rect(int x, int y, int w, int h) { +void fltk3::PSFileDevice::rect(int x, int y, int w, int h) { // Commented code does not work, i can't find the bug ;-( // fprintf(output, "GS\n"); // fprintf(output, "%i, %i, %i, %i R\n", x , y , w, h); @@ -628,17 +628,17 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::rectf(int x, int y, int w, int h) { +void fltk3::PSFileDevice::rectf(int x, int y, int w, int h) { fprintf(output, "%g %g %i %i FR\n", x-0.5, y-0.5, w, h); } -void Fl_PSfile_Device::line(int x1, int y1, int x2, int y2) { +void fltk3::PSFileDevice::line(int x1, int y1, int x2, int y2) { fprintf(output, "GS\n"); fprintf(output, "%i %i %i %i L\n", x1 , y1, x2 ,y2); fprintf(output, "GR\n"); } -void Fl_PSfile_Device::line(int x0, int y0, int x1, int y1, int x2, int y2) { +void fltk3::PSFileDevice::line(int x0, int y0, int x1, int y1, int x2, int y2) { fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x0 , y0); @@ -648,7 +648,7 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::xyline(int x, int y, int x1, int y2, int x3){ +void fltk3::PSFileDevice::xyline(int x, int y, int x1, int y2, int x3){ fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x , y ); @@ -660,7 +660,7 @@ }; -void Fl_PSfile_Device::xyline(int x, int y, int x1, int y2){ +void fltk3::PSFileDevice::xyline(int x, int y, int x1, int y2){ fprintf(output, "GS\n"); fprintf(output,"BP\n"); @@ -671,7 +671,7 @@ fprintf(output, "GR\n"); }; -void Fl_PSfile_Device::xyline(int x, int y, int x1){ +void fltk3::PSFileDevice::xyline(int x, int y, int x1){ fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x , y); @@ -681,7 +681,7 @@ fprintf(output, "GR\n"); }; -void Fl_PSfile_Device::yxline(int x, int y, int y1, int x2, int y3){ +void fltk3::PSFileDevice::yxline(int x, int y, int y1, int x2, int y3){ fprintf(output, "GS\n"); fprintf(output,"BP\n"); @@ -693,7 +693,7 @@ fprintf(output, "GR\n"); }; -void Fl_PSfile_Device::yxline(int x, int y, int y1, int x2){ +void fltk3::PSFileDevice::yxline(int x, int y, int y1, int x2){ fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x , y); @@ -703,7 +703,7 @@ fprintf(output, "GR\n"); }; -void Fl_PSfile_Device::yxline(int x, int y, int y1){ +void fltk3::PSFileDevice::yxline(int x, int y, int y1){ fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x , y); @@ -712,7 +712,7 @@ fprintf(output, "GR\n"); }; -void Fl_PSfile_Device::loop(int x0, int y0, int x1, int y1, int x2, int y2) { +void fltk3::PSFileDevice::loop(int x0, int y0, int x1, int y1, int x2, int y2) { fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x0 , y0); @@ -722,7 +722,7 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { +void fltk3::PSFileDevice::loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x0 , y0); @@ -733,7 +733,7 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::polygon(int x0, int y0, int x1, int y1, int x2, int y2) { +void fltk3::PSFileDevice::polygon(int x0, int y0, int x1, int y1, int x2, int y2) { fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x0 , y0); @@ -743,7 +743,7 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { +void fltk3::PSFileDevice::polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x0 , y0 ); @@ -755,7 +755,7 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::point(int x, int y){ +void fltk3::PSFileDevice::point(int x, int y){ rectf(x,y,1,1); } @@ -778,7 +778,7 @@ }; -void Fl_PSfile_Device::line_style(int style, int width, char* dashes){ +void fltk3::PSFileDevice::line_style(int style, int width, char* dashes){ //line_styled_=1; linewidth_=width; @@ -856,7 +856,7 @@ "ZapfDingbats" }; -void Fl_PSfile_Device::font(int f, int s) { +void fltk3::PSFileDevice::font(int f, int s) { if (f >= fltk3::FREE_FONT) f = fltk3::COURIER; fprintf(output, "/%s SF\n" , _fontNames[f]); @@ -865,7 +865,7 @@ font_ = f; size_ = s; }; -void Fl_PSfile_Device::color(Fl_Color c) { +void fltk3::PSFileDevice::color(Fl_Color c) { //colored_=1; color_=c; fltk3::get_color(c, cr_, cg_, cb_); @@ -882,7 +882,7 @@ } } -void Fl_PSfile_Device::color(unsigned char r, unsigned char g, unsigned char b) { +void fltk3::PSFileDevice::color(unsigned char r, unsigned char g, unsigned char b) { //colored_=1; cr_=r;cg_=g;cb_=b; if (r==g && g==b) { @@ -897,14 +897,14 @@ } } -void Fl_PSfile_Device::draw(int angle, const char *str, int n, int x, int y) +void fltk3::PSFileDevice::draw(int angle, const char *str, int n, int x, int y) { fprintf(output, "GS %d %d translate %d rotate\n", x, y, - angle); this->transformed_draw(str, n, 0, 0); fprintf(output, "GR\n"); } -void Fl_PSfile_Device::transformed_draw(const char* str, int n, double x, double y){ +void fltk3::PSFileDevice::transformed_draw(const char* str, int n, double x, double y){ if (!n || !str || !*str)return; fprintf(output,"%g (", fl_width(str, n)); int i=1; @@ -929,18 +929,18 @@ struct matrix {double a, b, c, d, x, y;}; extern matrix * fl_matrix; -void Fl_PSfile_Device::concat(){ +void fltk3::PSFileDevice::concat(){ fprintf(output,"[%g %g %g %g %g %g] CT\n", fl_matrix->a , fl_matrix->b , fl_matrix->c , fl_matrix->d , fl_matrix->x , fl_matrix->y); } -void Fl_PSfile_Device::reconcat(){ +void fltk3::PSFileDevice::reconcat(){ fprintf(output, "[%g %g %g %g %g %g] RCT\n" , fl_matrix->a , fl_matrix->b , fl_matrix->c , fl_matrix->d , fl_matrix->x , fl_matrix->y); } ///////////////// transformed (double) drawings //////////////////////////////// -void Fl_PSfile_Device::begin_points(){ +void fltk3::PSFileDevice::begin_points(){ fprintf(output, "GS\n"); concat(); @@ -949,7 +949,7 @@ shape_=POINTS; }; -void Fl_PSfile_Device::begin_line(){ +void fltk3::PSFileDevice::begin_line(){ fprintf(output, "GS\n"); concat(); fprintf(output, "BP\n"); @@ -957,7 +957,7 @@ shape_=LINE; }; -void Fl_PSfile_Device::begin_loop(){ +void fltk3::PSFileDevice::begin_loop(){ fprintf(output, "GS\n"); concat(); fprintf(output, "BP\n"); @@ -965,7 +965,7 @@ shape_=LOOP; }; -void Fl_PSfile_Device::begin_polygon(){ +void fltk3::PSFileDevice::begin_polygon(){ fprintf(output, "GS\n"); concat(); fprintf(output, "BP\n"); @@ -973,7 +973,7 @@ shape_=POLYGON; }; -void Fl_PSfile_Device::vertex(double x, double y){ +void fltk3::PSFileDevice::vertex(double x, double y){ if(shape_==POINTS){ fprintf(output,"%g %g MT\n", x , y); gap_=1; @@ -986,7 +986,7 @@ fprintf(output, "%g %g LT\n", x , y); }; -void Fl_PSfile_Device::curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3){ +void fltk3::PSFileDevice::curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3){ if(shape_==NONE) return; if(gap_) fprintf(output,"%g %g MT\n", x , y); @@ -998,7 +998,7 @@ }; -void Fl_PSfile_Device::circle(double x, double y, double r){ +void fltk3::PSFileDevice::circle(double x, double y, double r){ if(shape_==NONE){ fprintf(output, "GS\n"); concat(); @@ -1013,7 +1013,7 @@ }; -void Fl_PSfile_Device::arc(double x, double y, double r, double start, double a){ +void fltk3::PSFileDevice::arc(double x, double y, double r, double start, double a){ if(shape_==NONE) return; gap_=0; if(start>a) @@ -1023,7 +1023,7 @@ }; -void Fl_PSfile_Device::arc(int x, int y, int w, int h, double a1, double a2) { +void fltk3::PSFileDevice::arc(int x, int y, int w, int h, double a1, double a2) { fprintf(output, "GS\n"); //fprintf(output, "BP\n"); begin_line(); @@ -1042,7 +1042,7 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::pie(int x, int y, int w, int h, double a1, double a2) { +void fltk3::PSFileDevice::pie(int x, int y, int w, int h, double a1, double a2) { fprintf(output, "GS\n"); fprintf(output, "%g %g TR\n", x + w/2.0 -0.5 , y + h/2.0 - 0.5); @@ -1054,7 +1054,7 @@ fprintf(output, "GR\n"); } -void Fl_PSfile_Device::end_points(){ +void fltk3::PSFileDevice::end_points(){ gap_=1; reconcat(); fprintf(output, "ELP\n"); //?? @@ -1062,14 +1062,14 @@ shape_=NONE; } -void Fl_PSfile_Device::end_line(){ +void fltk3::PSFileDevice::end_line(){ gap_=1; reconcat(); fprintf(output, "ELP\n"); fprintf(output, "GR\n"); shape_=NONE; } -void Fl_PSfile_Device::end_loop(){ +void fltk3::PSFileDevice::end_loop(){ gap_=1; reconcat(); fprintf(output, "ECP\n"); @@ -1077,7 +1077,7 @@ shape_=NONE; } -void Fl_PSfile_Device::end_polygon(){ +void fltk3::PSFileDevice::end_polygon(){ gap_=1; reconcat(); @@ -1086,7 +1086,7 @@ shape_=NONE; } -void Fl_PSfile_Device::transformed_vertex(double x, double y){ +void fltk3::PSFileDevice::transformed_vertex(double x, double y){ reconcat(); if(gap_){ fprintf(output, "%g %g MT\n", x , y); @@ -1098,7 +1098,7 @@ ///////////////////////////// Clipping ///////////////////////////////////////////// -void Fl_PSfile_Device::push_clip(int x, int y, int w, int h) { +void fltk3::PSFileDevice::push_clip(int x, int y, int w, int h) { Clip * c=new Clip(); clip_box(x,y,w,h,c->x,c->y,c->w,c->h); c->prev=clip_; @@ -1110,7 +1110,7 @@ } -void Fl_PSfile_Device::push_no_clip() { +void fltk3::PSFileDevice::push_no_clip() { Clip * c = new Clip(); c->prev=clip_; clip_=c; @@ -1120,7 +1120,7 @@ recover(); } -void Fl_PSfile_Device::pop_clip() { +void fltk3::PSFileDevice::pop_clip() { if(!clip_)return; Clip * c=clip_; clip_=clip_->prev; @@ -1133,7 +1133,7 @@ recover(); } -int Fl_PSfile_Device::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H){ +int fltk3::PSFileDevice::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H){ if(!clip_){ X=x;Y=y;W=w;H=h; return 1; @@ -1169,7 +1169,7 @@ return ret; }; -int Fl_PSfile_Device::not_clipped(int x, int y, int w, int h){ +int fltk3::PSFileDevice::not_clipped(int x, int y, int w, int h){ if(!clip_) return 1; if(clip_->w < 0) return 1; int X, Y, W, H; @@ -1179,7 +1179,7 @@ }; -void Fl_PSfile_Device::margins(int *left, int *top, int *right, int *bottom) // to implement +void fltk3::PSFileDevice::margins(int *left, int *top, int *right, int *bottom) // to implement { if(left) *left = (int)(left_margin / scale_x + .5); if(right) *right = (int)(left_margin / scale_x + .5); @@ -1187,7 +1187,7 @@ if(bottom) *bottom = (int)(top_margin / scale_y + .5); } -int Fl_PSfile_Device::printable_rect(int *w, int *h) +int fltk3::PSFileDevice::printable_rect(int *w, int *h) //returns 0 iff OK { if(w) *w = (int)((pw_ - 2 * left_margin) / scale_x + .5); @@ -1195,7 +1195,7 @@ return 0; } -void Fl_PSfile_Device::origin(int x, int y) +void fltk3::PSFileDevice::origin(int x, int y) { x_offset = x; y_offset = y; @@ -1203,7 +1203,7 @@ left_margin, top_margin, scale_x, scale_y, x, y, angle); } -void Fl_PSfile_Device::scale (float s_x, float s_y) +void fltk3::PSFileDevice::scale (float s_x, float s_y) { scale_x = s_x; scale_y = s_y; @@ -1211,24 +1211,24 @@ left_margin, top_margin, scale_x, scale_y, angle); } -void Fl_PSfile_Device::rotate (float rot_angle) +void fltk3::PSFileDevice::rotate (float rot_angle) { angle = - rot_angle; fprintf(output, "GR GR GS %d %d TR %f %f SC %d %d TR %f rotate GS\n", left_margin, top_margin, scale_x, scale_y, x_offset, y_offset, angle); } -void Fl_PSfile_Device::translate(int x, int y) +void fltk3::PSFileDevice::translate(int x, int y) { fprintf(output, "GS %d %d translate GS\n", x, y); } -void Fl_PSfile_Device::untranslate(void) +void fltk3::PSFileDevice::untranslate(void) { fprintf(output, "GR GR\n"); } -int Fl_PSfile_Device::start_page (void) +int fltk3::PSFileDevice::start_page (void) { page(page_format_); x_offset = 0; @@ -1239,12 +1239,12 @@ return 0; } -int Fl_PSfile_Device::end_page (void) +int fltk3::PSFileDevice::end_page (void) { return 0; } -void Fl_PSfile_Device::end_job (void) +void fltk3::PSFileDevice::end_job (void) // finishes PostScript & closes file { if (nPages) { // for eps nPages is 0 so it is fine .... @@ -1326,7 +1326,7 @@ if (!print_pipe) printer = "<File>"; if (!print_pipe) // fall back to file printing - return Fl_PSfile_Device::start_job (pages, format, layout); + return fltk3::PSFileDevice::start_job (pages, format, layout); // Print: pipe the output into the lp command... @@ -1341,7 +1341,7 @@ return 1; } - return Fl_PSfile_Device::start_postscript(pages, format, layout); // start printing + return fltk3::PSFileDevice::start_postscript(pages, format, layout); // start printing } #endif // ! (defined(__APPLE__) || defined(WIN32) ) Modified: branches/branch-3.0/src/Fl_cocoa.mm =================================================================== --- branches/branch-3.0/src/Fl_cocoa.mm 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_cocoa.mm 2010-04-04 20:03:55 UTC (rev 7420) @@ -131,8 +131,8 @@ 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 +static fltk3::QuartzDisplay fl_quartz_device; +FL_EXPORT fltk3::Display *fl_display_device = (fltk3::Display*)&fl_quartz_device; // does not change FL_EXPORT fltk3::Device *fl_device = (fltk3::Device*)&fl_quartz_device; // the current target device of graphics operations // public variables @@ -2972,7 +2972,7 @@ - (void)printPanel { Fl_Printer printer; - //Fl_PSfile_Device printer; + //fltk3::PSFileDevice printer; int w, h; fltk3::Window *win = fltk3::first_window(); if(!win) return; Modified: branches/branch-3.0/src/Fl_win32.cxx =================================================================== --- branches/branch-3.0/src/Fl_win32.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_win32.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -95,8 +95,8 @@ 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 +static fltk3::GDIDisplay fl_gdi_device; +FL_EXPORT fltk3::Display *fl_display_device = (fltk3::Display*)&fl_gdi_device; // does not change FL_EXPORT fltk3::Device *fl_device = (fltk3::Device*)&fl_gdi_device; // the current target device of graphics operations // dynamic wsock dll handling api: Modified: branches/branch-3.0/src/Fl_x.cxx =================================================================== --- branches/branch-3.0/src/Fl_x.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/Fl_x.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -51,8 +51,8 @@ # 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 +static fltk3::XlibDisplay fl_xlib_device; +FL_EXPORT fltk3::Display *fl_display_device = (fltk3::Display*)&fl_xlib_device; // does not change FL_EXPORT fltk3::Device *fl_device = (fltk3::Device*)&fl_xlib_device; // the current target device of graphics operations //////////////////////////////////////////////////////////////// Modified: branches/branch-3.0/src/ps_image.cxx =================================================================== --- branches/branch-3.0/src/ps_image.cxx 2010-04-04 19:37:35 UTC (rev 7419) +++ branches/branch-3.0/src/ps_image.cxx 2010-04-04 20:03:55 UTC (rev 7420) @@ -29,12 +29,12 @@ #include <math.h> #include <string.h> -#include <fltk3/Fl_PSfile_Device.H> +#include <fltk3/PSFileDevice.h> #include <fltk3/run.h> #include <fltk3/Fl_Pixmap.H> #include <fltk3/Fl_Bitmap.H> -int Fl_PSfile_Device::alpha_mask(const uchar * data, int w, int h, int D, int LD){ +int fltk3::PSFileDevice::alpha_mask(const uchar * data, int w, int h, int D, int LD){ mask = 0; if((D/2)*2 != D){ //no mask info @@ -202,7 +202,7 @@ extern uchar **fl_mask_bitmap; -void Fl_PSfile_Device::draw_scaled_image(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D, int LD) { +void fltk3::PSFileDevice::draw_scaled_image(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D, int LD) { if(D<3){ //mono @@ -269,7 +269,7 @@ }; -void Fl_PSfile_Device::draw_scaled_image(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D) { +void fltk3::PSFileDevice::draw_scaled_image(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D) { int level2_mask = 0; fprintf(output,"save\n"); @@ -357,7 +357,7 @@ delete[] rgbdata; } -void Fl_PSfile_Device::draw_scaled_image_mono(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D, int LD) { +void fltk3::PSFileDevice::draw_scaled_image_mono(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D, int LD) { fprintf(output,"save\n"); @@ -418,7 +418,7 @@ -void Fl_PSfile_Device::draw_scaled_image_mono(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D) { +void fltk3::PSFileDevice::draw_scaled_image_mono(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D) { fprintf(output,"save\n"); int i,j,k; @@ -467,7 +467,7 @@ ////////////////////////////// Image classes ////////////////////// -void Fl_PSfile_Device::draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy){ +void fltk3::PSFileDevice::draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy){ const char * const * di =pxm->data(); int w,h; if (!fl_measure_pixmap(di, w, h)) return; @@ -483,7 +483,7 @@ fl_mask_bitmap=0; }; -void Fl_PSfile_Device::draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy){ +void fltk3::PSFileDevice::draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy){ const uchar * di = rgb->array; int w = rgb->w(); int h = rgb->h(); @@ -497,7 +497,7 @@ mask=0; }; -void Fl_PSfile_Device::draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy){ +void fltk3::PSFileDevice::draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy){ const uchar * di = bitmap->array; int w,h; int LD=(bitmap->w()+7)/8; _______________________________________________ fltk-commit mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-commit
