a17cef55c66f35ef613738305bb4609a4ae3b846
* Copyright -C- 1982 Barry S. Roitblat
* This file contains routines for implementing the database
* manipulations for the gremlin picture editor.
/* imports from undodb.c */
extern UNRembAdd(), UNRembMod();
extern ELT
*DBCreateElt();
/* imports from point.c */
extern POINT
*PTMakePoint(), *PTInit();
ELT
*DBCopy(element
,transform
,db
)
* This routine creates a copy of the the element transformed by
* the transformation matrix and adds the new copy to the database.
(void) PTMakePoint(( ( (pt
->x
) * transform
[0][0])
+ ( (pt
->y
) * transform
[1][0])
( ( (pt
->x
) * transform
[0][1])
+ ( (pt
->y
) * transform
[1][1])
+ transform
[2][1]), &newlist
);
newtext
= malloc((unsigned) strlen(element
->textpt
) + 1);
(void) strcpy(newtext
, element
->textpt
);
return( DBCreateElt(element
->type
, newlist
, element
->brushf
,
element
->size
, newtext
, db
) );
DBXform(element
, transform
, db
)
* This routine transforms the element by multiplying the
* coordinates of each of the points in the element by the
px
= ( (pt
->x
) * transform
[0][0] )
+ ( (pt
->y
) * transform
[1][0] )
py
= ( (pt
->x
) * transform
[0][1] )
+ ( (pt
->y
) * transform
[1][1] )
DBChangeBrush(element
, brush
, db
)
* This routine changes the brush attribute of the element
DBChangeFont(element
, font
, size
, db
)
* This routine changes the font and size attributes of the given