diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Device.H | 12 | ||||
| -rw-r--r-- | FL/Fl_PostScript.H | 58 | ||||
| -rw-r--r-- | FL/fl_draw.H | 24 |
3 files changed, 60 insertions, 34 deletions
diff --git a/FL/Fl_Device.H b/FL/Fl_Device.H index c973f73db..bec275983 100644 --- a/FL/Fl_Device.H +++ b/FL/Fl_Device.H @@ -195,6 +195,10 @@ protected: friend void fl_push_matrix(); friend void fl_pop_matrix(); friend void fl_mult_matrix(double a, double b, double c, double d, double x, double y); + friend void fl_scale(double x, double y); + friend void fl_scale(double x); + friend void fl_translate(double x, double y); + friend void fl_rotate(double d); friend double fl_transform_x(double x, double y); friend double fl_transform_y(double x, double y); friend double fl_transform_dx(double x, double y); @@ -311,6 +315,14 @@ protected: void pop_matrix(); /** \brief see fl_mult_matrix(double a, double b, double c, double d, double x, double y). */ void mult_matrix(double a, double b, double c, double d, double x, double y); + /** \brief see fl_scale(double x, double y). */ + inline void scale(double x, double y) { mult_matrix(x,0,0,y,0,0); } + /** \brief see fl_scale(double x). */ + inline void scale(double x) { mult_matrix(x,0,0,x,0,0); } + /** \brief see fl_translate(double x, double y). */ + inline void translate(double x,double y) { mult_matrix(1,0,0,1,x,y); } + /** \brief see fl_rotate(double d). */ + void rotate(double d); /** \brief see fl_transform_x(double x, double y). */ double transform_x(double x, double y); /** \brief see fl_transform_y(double x, double y). */ diff --git a/FL/Fl_PostScript.H b/FL/Fl_PostScript.H index b03b67c06..61f7faecc 100644 --- a/FL/Fl_PostScript.H +++ b/FL/Fl_PostScript.H @@ -64,8 +64,8 @@ class Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver { public: static const char *class_id; + Fl_PostScript_Graphics_Driver(); #ifndef FL_DOXYGEN -public: enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS}; class Clip { @@ -115,12 +115,6 @@ class Clip { int start_postscript (int pagecount, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::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); }; -#ifdef __APPLE__ - void draw(const char* s, int n, float x, float y) {transformed_draw(s,n,x,y); }; -#endif - void draw(int angle, const char *str, int n, int x, int y); - void rtl_draw(const char* s, 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); @@ -131,6 +125,21 @@ class Clip { enum Fl_Paged_Device::Page_Format page_format_; char *ps_filename_; + + 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); + //Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor + //Fl_PostScript_Graphics_Driver(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); +#endif // FL_DOXYGEN + // implementation of drawing methods void color(Fl_Color c); void color(uchar r, uchar g, uchar b); @@ -181,34 +190,23 @@ class Clip { void gap(){gap_=1;}; void end_complex_polygon(){end_polygon();}; void transformed_vertex(double x, double y); - - void font(int face, int size); - double width(const char *, int); - void text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h); - int height(); - int descent(); - + 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);}; -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); - //Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor - //Fl_PostScript_Graphics_Driver(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); - -#endif // FL_DOXYGEN - Fl_PostScript_Graphics_Driver(); + void draw(const char* s, int n, int x, int y) {transformed_draw(s,n,x,y); }; +#ifdef __APPLE__ + void draw(const char* s, int n, float x, float y) {transformed_draw(s,n,x,y); }; +#endif + void draw(int angle, const char *str, int n, int x, int y); + void rtl_draw(const char* s, int n, int x, int y); + void font(int face, int size); + double width(const char *, int); + void text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h); + int height(); + int descent(); void draw(Fl_Pixmap * pxm,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); void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy); diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 1211c44a7..b3e4a31ed 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -333,10 +333,26 @@ inline void fl_push_matrix() { fl_graphics_driver->push_matrix(); }; Restores the current transformation matrix from the stack. */ inline void fl_pop_matrix() { fl_graphics_driver->pop_matrix(); }; -FL_EXPORT void fl_scale(double x, double y); -FL_EXPORT void fl_scale(double x); -FL_EXPORT void fl_translate(double x, double y); -FL_EXPORT void fl_rotate(double d); +/** + Concatenates scaling transformation onto the current one. + \param[in] x,y scale factors in x-direction and y-direction + */ +inline void fl_scale(double x, double y) { fl_graphics_driver->scale(x, y); }; +/** + Concatenates scaling transformation onto the current one. + \param[in] x scale factor in both x-direction and y-direction + */ +inline void fl_scale(double x) { fl_graphics_driver->scale(x, x); }; +/** + Concatenates translation transformation onto the current one. + \param[in] x,y translation factor in x-direction and y-direction + */ +inline void fl_translate(double x, double y) { fl_graphics_driver->translate(x, y); }; +/** + Concatenates rotation transformation onto the current one. + \param[in] d - rotation angle, counter-clockwise in degrees (not radians) + */ +inline void fl_rotate(double d) { fl_graphics_driver->rotate(d); }; /** Concatenates another transformation onto the current one. |
