index 432bf5501e407f576a26c9d10833ae0e77b11604..c8fd29ddf3dc15fc97e0c19b877eb5a93f30cfad 100644 (file)
--- a/src/knot-holder-entity.h
+++ b/src/knot-holder-entity.h
#ifndef SEEN_KNOT_HOLDER_ENTITY_H
#define SEEN_KNOT_HOLDER_ENTITY_H
-/** \file
- * KnotHolderEntity definition.
- *
+/** \file
+ * KnotHolderEntity definition.
+ *
* Authors:
* Mitsuru Oka <oka326@parkcity.ne.jp>
* Maximilian Albert <maximilian.albert@gmail.com>
#include <glib/gtypes.h>
#include "knot.h"
-#include <libnr/nr-forward.h>
+#include <2geom/forward.h>
+#include "snapper.h"
struct SPItem;
struct SPKnot;
class SPDesktop;
class KnotHolder;
-typedef void (* SPKnotHolderSetFunc) (SPItem *item, NR::Point const &p, NR::Point const &origin, guint state);
-typedef NR::Point (* SPKnotHolderGetFunc) (SPItem *item);
+typedef void (* SPKnotHolderSetFunc) (SPItem *item, Geom::Point const &p, Geom::Point const &origin, guint state);
+typedef Geom::Point (* SPKnotHolderGetFunc) (SPItem *item);
/* fixme: Think how to make callbacks most sensitive (Lauris) */
typedef void (* SPKnotHolderReleasedFunc) (SPItem *item);
public:
KnotHolderEntity() {}
virtual ~KnotHolderEntity();
- virtual void create(SPDesktop *desktop, SPItem *item, KnotHolder *parent, const gchar *tip = "",
+ virtual void create(SPDesktop *desktop, SPItem *item, KnotHolder *parent, const gchar *tip = "",
SPKnotShapeType shape = SP_KNOT_SHAPE_DIAMOND,
SPKnotModeType mode = SP_KNOT_MODE_XOR,
guint32 color = 0xffffff00);
/* the get/set/click handlers are virtual functions; each handler class for a knot
should be derived from KnotHolderEntity and override these functions */
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state) = 0;
- virtual NR::Point knot_get() = 0;
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state) = 0;
+ virtual Geom::Point knot_get() = 0;
virtual void knot_click(guint /*state*/) {}
void update_knot();
//private:
- NR::Point snap_knot_position(NR::Point const &p);
+ Geom::Point snap_knot_position(Geom::Point const &p);
+ Geom::Point snap_knot_position_constrained(Geom::Point const &p, Inkscape::Snapper::ConstraintLine const &constraint);
SPKnot *knot;
SPItem *item;
class PatternKnotHolderEntityXY : public KnotHolderEntity {
public:
- virtual NR::Point knot_get();
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
};
class PatternKnotHolderEntityAngle : public KnotHolderEntity {
public:
- virtual NR::Point knot_get();
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
};
class PatternKnotHolderEntityScale : public KnotHolderEntity {
public:
- virtual NR::Point knot_get();
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
};
#endif /* !SEEN_KNOT_HOLDER_ENTITY_H */