From 8646c6b2ddaf32ac7342cc8b61e559d46885af4f Mon Sep 17 00:00:00 2001 From: root <> Date: Sun, 8 Feb 2009 16:49:14 +0000 Subject: *** empty log message *** --- src/fish.h | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/fish.h (limited to 'src/fish.h') diff --git a/src/fish.h b/src/fish.h new file mode 100644 index 0000000..1a7a874 --- /dev/null +++ b/src/fish.h @@ -0,0 +1,102 @@ +#include + +typedef struct { + float x,y; +} Jwgpos; + +typedef struct { + Jwgpos *data; + int npts; +} Jwgline; + + + +typedef struct { + float xc,yc; + float a,b,c,d; + float det; +} Transform; + +BEGIN_OBJECT(Data) + int w,h; + int l; + float *data; +END_OBJECT(Data); + +extern void Data_Destructor(Data); + +CREATOR(Data)=Obj_DefaultCreator; +DESTRUCTOR(Data)=Data_Destructor; + +typedef struct { + float r,g,b; +} Color; + +typedef struct { + float width; + Color color; +} Pen; + +typedef struct { + float density; + Color color; +} Brush; + +typedef struct { + int font; + Color color; + float height; +} Ink; + + +#define JWG_FM_XFIG 0 +#define JWG_FM_CGM 1 + +#define JWG_DEFAULT_LINE_SIZE 4096 + +BEGIN_OBJECT(Handle) + int serial; + + struct Handle_struct *stack; + + Data data; + Transform transform; + + Brush brush; + Pen pen; + Ink ink; + + int format; + FILE *file; + + Jwgline current_line; + int current_line_size; + + void *private; +END_OBJECT(Handle) + +extern void Handle_Destructor(Handle); + +CREATOR(Handle)=Obj_DefaultCreator; +DESTRUCTOR(Handle)=Handle_Destructor; + +extern void jwg_xform(Handle,Jwgpos *); +extern void jwg_write_line(Handle,Jwgline *); +extern void jwg_write_polygon(Handle,Jwgline *); + +extern float jwg_decompose_matrix(Transform,int); + + +extern int jwg_create_handle(int *,char *,int); +extern void jwg_pass_data(int *,float *,int *,int *,int *); +extern void jwg_destory_data(int *); +extern void jwg_set_xform(int *,float *,float *,float *,float *, float *, float *); +extern void jwg_set_brush(int *, float *,float *,float *,float *); +extern void jwg_set_pen(int *, float *,float *,float *,float *); +extern void jwg_set_textcolor(int *,float *,float *,float *); +extern void jwg_set_textheight(int *,float *); +extern void jwg_draw_text(int *,float *,float *,char *,int); +extern void jwg_contour(int *, float *,int *,int *); +extern void jwg_draw_line(int *,float *,float *,int *); +extern void jwg_draw_polygon(int *,float *,float *,int *); +extern void jwg_destroy_handle(int *); -- cgit v1.2.3