aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <>2009-02-08 17:25:48 +0000
committerroot <>2009-02-08 17:25:48 +0000
commita25164b25fb68bd329c1ba9689ba894cb1c5e9b8 (patch)
tree4d9fdabec0c83d248f7f0cdbedc20c3f60b6b2ca
parent43a13e2e02f2b92d912541ae3477b78f7ebd305c (diff)
downloadlibjwg-a25164b25fb68bd329c1ba9689ba894cb1c5e9b8.tar.gz
libjwg-a25164b25fb68bd329c1ba9689ba894cb1c5e9b8.tar.bz2
libjwg-a25164b25fb68bd329c1ba9689ba894cb1c5e9b8.zip
*** empty log message ***
-rw-r--r--src/cgm.c36
-rw-r--r--src/ctext.c18
-rw-r--r--src/jwg-head.h.in87
-rw-r--r--src/project.h2
4 files changed, 111 insertions, 32 deletions
diff --git a/src/cgm.c b/src/cgm.c
index 18bd762..c0bcac4 100644
--- a/src/cgm.c
+++ b/src/cgm.c
@@ -1,19 +1,29 @@
#include "project.h"
+
#include "cd/cd.h"
-BEGIN_OBJECT(CGMc)
- int r,g,b,n;
-END_OBJECT(CGMc)
-CREATOR(CGMc)=Obj_DefaultCreator;
-DESTRUCTOR(CGMc)=Obj_DefaultDestructor;
+OBJECT(CGMc,
+ int r;
+ int g;
+ int b;
+ int n;
+);
+
+CONSTRUCTOR(CGMc)=GObj_DefaultConstructor;
+DESTRUCTOR(CGMc)=GObj_DefaultDestructor;
-BEGIN_OBJECT(Private)
+OBJECT(Private,
CGMc_list cgmcs;
int maxcol;
cdImagePtr im;
FILE *file;
-END_OBJECT(Private)
+);
+static void private_constructor(Private);
+static void private_destructor(Private);
+
+CONSTRUCTOR(Private)=private_constructor;
+DESTRUCTOR(Private)=private_destructor;
int cgm_sortout_color(Private p,int r,int g,int b)
{
@@ -28,13 +38,13 @@ c=c->next;
}
-c=CREATE_OBJ(CGMc);
+c=NEW(CGMc);
c->r=r;
c->g=g;
c->b=b;
c->n=cdImageColorAllocate(p->im,r,g,b);
-Obj_Insert(p->cgmcs,c,ObjInsertHead);
+GObj_InsertHead(p->cgmcs,c);
return(c->n);
@@ -44,7 +54,7 @@ static void private_constructor(Private p)
{
char name[1024];
-p->cgmcs=CREATE_LIST(CGMc);
+p->cgmcs=NEW_LIST(CGMc);
/* We need a square image otherwise nasty things happen to
lines!*/
p->im=cdImageCreate(7100,7100);
@@ -57,7 +67,7 @@ int i;
printf("JWG: Writing cgm file \n");
-Obj_Delete(p->cgmcs);
+GObj_Delete(p->cgmcs);
cdImageCgm(p->im,p->file);
cdImageDestroy(p->im);
@@ -66,15 +76,13 @@ free(p);
}
-CREATOR(Private)=private_constructor;
-DESTRUCTOR(Private)=private_destructor;
void cgm_init_private(Handle h)
{
Private p;
-p=CREATE_OBJ(Private);
+p=NEW(Private);
p->file=h->file;
h->private=(void *) p;
diff --git a/src/ctext.c b/src/ctext.c
deleted file mode 100644
index 4f82832..0000000
--- a/src/ctext.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "project.h"
-
-Textrequest_list textrequests;
-
-void jwg_priv_init_textlist()
-{
-
-
-
-
-
-
-
-
-
-}
-
-
diff --git a/src/jwg-head.h.in b/src/jwg-head.h.in
index 117526d..65d5213 100644
--- a/src/jwg-head.h.in
+++ b/src/jwg-head.h.in
@@ -12,6 +12,9 @@
/*
* $Log$
+ * Revision 1.2 2009/02/08 17:25:48 root
+ * *** empty log message ***
+ *
* Revision 1.1 2009/02/08 16:25:32 root
* *** empty log message ***
*
@@ -48,3 +51,87 @@ extern "C" {
/*get struct tm defined*/
#include <@I2_TM_H@>
+
+
+#include <string.h>
+#include <gobj.h>
+
+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;
+
+OBJECT(Data,
+ int w;
+ int h;
+ int l;
+ float *data;
+);
+
+extern void Data_Destructor(Data);
+
+CONSTRUCTOR(Data)=GObj_DefaultConstructor;
+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
+
+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;
+);
+extern void Handle_Destructor(Handle);
+
+CONSTRUCTOR(Handle)=GObj_DefaultConstructor;
+DESTRUCTOR(Handle)=Handle_Destructor;
+
diff --git a/src/project.h b/src/project.h
index 4179632..7f4ce23 100644
--- a/src/project.h
+++ b/src/project.h
@@ -8,6 +8,8 @@
#include <gobj.h>
+#include <stdlib.h>
+
#include "fortran.h"
#include "jwg.h"