X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdrawer.h;fp=lib%2Fdrawer.h;h=f79e6b5a9931c4c21820c2a0b1043bfffc9138db;hb=898ceddb63e8fb4bd04cc8a87e0b93b6def552e1;hp=0000000000000000000000000000000000000000;hpb=5b56c4417a0662c47d6851f11cdeaf5049e6cb34;p=swftools.git diff --git a/lib/drawer.h b/lib/drawer.h new file mode 100644 index 0000000..f79e6b5 --- /dev/null +++ b/lib/drawer.h @@ -0,0 +1,52 @@ +/* drawer.h + part of swftools + + A generic structure for providing vector drawing. + + Copyright (C) 2003 Matthias Kramm + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __drawer_h__ +#define __drawer_h__ + +typedef struct _FPOINT +{ + float x,y; +} FPOINT; + +typedef struct _drawer_t +{ + void*internal; + + FPOINT pos; //last "to" + + void (*setLineStyle)(struct _drawer_t*draw, void*linestyle); + void (*setFillStyle)(struct _drawer_t*draw, void*fillstyle); + + void (*moveTo)(struct _drawer_t*draw, FPOINT * to); + void (*lineTo)(struct _drawer_t*draw, FPOINT * to); + void (*splineTo)(struct _drawer_t*draw, FPOINT*c, FPOINT * to); + void (*finish)(struct _drawer_t*draw); + + void (*dealloc)(struct _drawer_t*draw); + +} drawer_t; + +void draw_cubicto(drawer_t*drawer, FPOINT* control1, FPOINT* control2, FPOINT* to); +void draw_conicto(drawer_t*drawer, FPOINT* control, FPOINT* to); +void draw_string(drawer_t*drawer, const char*code); + +#endif