00001 #ifndef _WINC_POSTCRIPT
00002 #define _WINC_POSTCRIPT
00003
00004 #include <WXP/Device.h>
00005 #include <WXP/File.h>
00006 #include <WXP/GeomBox.h>
00007 #include <WXP/Image.h>
00008 #include <WXP/Listener.h>
00009 #include <WXP/Point.h>
00010 #include <WXP/Points.h>
00011 #include <WXP/Rect.h>
00012 #include <WXP/String.h>
00013
00014 namespace WXP {
00015 class Postscript : public Device, public Listener {
00016 File file;
00017 bool inverse;
00018 float width, height;
00019 float x, y;
00020 int fixed;
00021 bool icon;
00022 bool opened;
00023 char name[30];
00024 char filename[60];
00025 char title[60];
00026
00027 int append;
00028 int eps;
00029 int color;
00030 int orient;
00031 float scale;
00032
00033 int fore_color;
00034 int back_color;
00035
00036 GeomBox clip;
00037
00038 float base_width;
00039 int line_bold;
00040
00041 int line_color;
00042 int line_style;
00043 float line_width;
00044
00045 int text_color;
00046 float text_width;
00047
00048 int fill_color;
00049 int fill_style;
00050
00051 int mark_color;
00052 float mark_width;
00053
00054 public:
00055 Postscript();
00056 ~Postscript();
00057 int init();
00058 int setParam( const char *str );
00059 int open();
00060 int getDevice( String &str );
00061 int resize(float rwidth, float rheight);
00062 int manage();
00063 int unmanage();
00064 int addCallback( const char *event, Listener *list, const void *data );
00065 int doCallback( const char *ev_str, const char *ev_data );
00066 void callback( const char *ev_str, const char *ev_data, const void *data );
00067 int close();
00068 int setFocus();
00069 int unsetFocus();
00070 int update();
00071 int clear();
00072 int clearRect( Rect &rect );
00073 int setTitle(const char *str);
00074 int setIcon(bool val);
00075 int setFixed(bool val);
00076 int setInverse(bool val);
00077 bool getInverse();
00078 int setBackground(const char *str);
00079 int setSize(float rwidth, float rheight);
00080 int getSize(float &width, float &height);
00081 inline float getWidth(){ return width; };
00082 inline float getHeight(){ return height; };
00083 int setOffset(float rx, float ry);
00084 int getOffset(float &x, float &y);
00085 int getCoords( Rect &rect );
00086 Rect getCoords();
00087 int allocColor( float red, float grn, float blu );
00088 int setColor( int type, int ind );
00089 int outputColor( int color );
00090 int setLineWidth( int type, float width );
00091 int setLineStyle( int type, int style );
00092 int setFillStyle( int type, int style );
00093 int drawLine( int type, float x1, float y1, float x2, float y2 );
00094 int drawLine( int type, Points &pts );
00095 int drawFill( int type, Points &pts );
00096 int setImageAlign( int h, int v );
00097 int drawImage( Image &image, float x, float y );
00098 int drawImage( Image &image, int color, float x, float y );
00099 int getImage( Image &image );
00100 int setFont( const char *name );
00101 int setTextAlign( int h, int v );
00102 int drawText( Point &pt, const char *str );
00103 Rect getClip();
00104 int setClip( float x1, float y1, float x2, float y2 );
00105 int setClip( Rect rect );
00106 int setCursor( int type );
00107 int copyFrame( int dest, int src );
00108 int displayFrame( int ind );
00109 int clearFrame( int ind );
00110 int newFrame( int ind );
00111 int newFrame();
00112 bool isLooping();
00113 int getFrame();
00114 int setFrame( int ind );
00115 int deleteFrame( int ind );
00116 int incFrame( int step );
00117 int getNumFrames();
00118 int message( const char *str );
00119 int bell( int len );
00120 };
00121 }
00122 #endif