23 #ifndef _LAX_PATHINTERFACE_H
24 #define _LAX_PATHINTERFACE_H
27 #include <lax/interfaces/viewportwindow.h>
28 #include <lax/interfaces/coordinate.h>
29 #include <lax/interfaces/somedata.h>
30 #include <lax/interfaces/linestyle.h>
31 #include <lax/interfaces/fillstyle.h>
32 #include <lax/screencolor.h>
37 namespace LaxInterfaces {
43 #define BEZ_MASK (255<<16)
44 #define BEZ_STIFF_EQUAL (1<<16)
45 #define BEZ_STIFF_NEQUAL (1<<17)
46 #define BEZ_NSTIFF_EQUAL (1<<18)
47 #define BEZ_NSTIFF_NEQUAL (1<<19)
73 virtual Path *duplicate();
78 virtual void append(
double x,
double y,
unsigned long flags=POINT_VERTEX,
SegmentControls *ctl=NULL);
93 virtual double Length(
double tstart,
double tend);
115 PathsData(
unsigned long ns=FILL_NONZERO);
117 virtual const char *whattype() {
return "PathsData"; }
126 virtual void appendCoord(
Coordinate *coord,
int whichpath=-1);
127 virtual void append(
double x,
double y,
unsigned long flags=POINT_VERTEX,
SegmentControls *ctl=NULL,
int whichpath=-1);
132 virtual void lineTo(
flatpoint p,
int whichpath=-1);
134 virtual void close(
int whichpath=-1);
137 virtual void InstallLineStyle(
LineStyle *newlinestyle);
138 virtual void fixpath(
int index);
141 virtual void clear(
int which=-1);
143 virtual void MatchTransform(Affine &affine);
144 virtual void MatchTransform(
const double *mm);
151 virtual double Length(
int pathi,
double tstart,
double tend);
161 PathsData *
SvgToPathsData(PathsData *existingpath,
const char *d,
char **end_ptr);
207 enum PathInterfaceSettings {
208 PATHI_One_Path_Only =(1<<0),
209 PATHI_Two_Point_Minimum=(1<<1),
210 PATHI_Path_Is_Screen =(1<<2),
211 PATHI_Path_Is_M_Screen =(1<<3),
212 PATHI_Path_Is_Real =(1<<4),
213 PATHI_Path_Is_M_Real =(1<<5),
214 PATHI_Esc_Off_Sub =(1<<6),
215 PATHI_Plain_Click_Add =(1<<7)
218 enum PathInterfaceActions {
219 PATHIA_CurpointOnHandle,
220 PATHIA_CurpointOnHandleR,
222 PATHIA_ToggleFillRule,
225 PATHIA_ColorFillOrStroke,
228 PATHIA_ToggleAddAfter,
229 PATHIA_TogglePointType,
235 PATHIA_StartNewSubpath,
297 virtual int PerformAction(
int action);
312 virtual int scaleSelected(
flatpoint center,
double f,
int constrain);
320 unsigned long controlcolor;
321 unsigned long creationstyle;
322 unsigned long pathi_style;
338 virtual const char *IconId() {
return "Path"; }
339 virtual const char *Name();
340 virtual const char *whattype() {
return "PathInterface"; }
341 virtual const char *whatdatatype() {
return "PathsData"; }
346 virtual ObjectContext *Context() {
return poc; }
348 virtual int UseThisObject(ObjectContext *oc);
352 virtual void Clear(SomeData *d=NULL);
356 virtual int WheelUp(
int x,
int y,
unsigned int state,
int count,
const Laxkit::LaxMouse *d);
357 virtual int WheelDown(
int x,
int y,
unsigned int state,
int count,
const Laxkit::LaxMouse *d);
358 virtual int CharInput(
unsigned int ch,
const char *buffer,
int len,
unsigned int state,
const Laxkit::LaxKeyboard *d);
368 virtual Coordinate *
scan(
int x,
int y,
int pmask=0,
int *pathindex=NULL);
369 virtual Coordinate *
scanEndpoints(
int x,
int y,
int *pathindex,Coordinate *exclude);
370 virtual int scanHover(
int x,
int y,
unsigned int state);
378 virtual void MakeRect();