X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fshape-editor.h;h=f400244b326ac40b8ad73512af8181007c7caa27;hb=4a02a8d1cbfb847a89e8bb5b6a32479036044b30;hp=fe95aca8fd85ad7686c4ba9c6cf807429780205b;hpb=8b9a820756fdf348239872236be2257f854e094a;p=inkscape.git diff --git a/src/shape-editor.h b/src/shape-editor.h index fe95aca8f..f400244b3 100644 --- a/src/shape-editor.h +++ b/src/shape-editor.h @@ -13,19 +13,21 @@ */ #include -#include +#include <2geom/forward.h> namespace Inkscape { namespace NodePath { class Path; } } - -#include "libnr/nr-path-code.h" -#include "libnr/nr-point.h" -#include -#include +namespace Inkscape { namespace XML { class Node; } } class KnotHolder; class SPDesktop; class SPNodeContext; class ShapeEditorsCollective; +class LivePathEffectObject; + +#include "libnr/nr-path-code.h" +#include <2geom/point.h> +#include +#include enum SubType{ SH_NODEPATH, @@ -39,16 +41,10 @@ public: ~ShapeEditor(); void set_item (SPItem *item, SubType type, bool keep_knotholder = false); - void set_item_lpe_path_parameter(SPItem *item, SPObject *lpeobject, const char * key); - void set_knotholder(KnotHolder * knot_holder); - void reset_item (SubType type, bool keep_knotholder = true); void unset_item (SubType type, bool keep_knotholder = false); - const SPItem *get_item (SubType type); - - bool has_nodepath (); - bool has_knotholder (); - void update_knotholder (); + bool has_nodepath (); //((deprecated)) + void update_knotholder (); //((deprecated)) bool has_local_change (SubType type); void decrement_local_change (SubType type); @@ -58,104 +54,24 @@ public: void nodepath_destroyed (); - void update_statusbar (); - - bool is_over_stroke (NR::Point event_p, bool remember); - - void add_node_near_point(); // uses the shapeeditor's remembered point, if any - - void select_segment_near_point(bool toggle); // uses the shapeeditor's remembered point, if any - - void cancel_hit (); - - bool hits_curve (); - - void curve_drag (gdouble eventx, gdouble eventy); - - void finish_drag (); - - void select_rect (NR::Rect const &rect, bool add); - bool has_selection (); - void deselect (); - - Inkscape::NodePath::Path *get_nodepath() {return nodepath;} //((deprecated)) - ShapeEditorsCollective *get_container() {return container;} - - void add_node(); - - void delete_nodes(); - void delete_nodes_preserving_shape(); - void delete_segment(); - - void set_node_type(int type); - - void break_at_nodes(); - void join_nodes(); - void join_segments(); - void duplicate_nodes(); + Inkscape::NodePath::Path *get_nodepath() {return NULL;} //((deprecated)) + ShapeEditorsCollective *get_container() {return NULL;} - void set_type_of_segments(NRPathcode code); + // this one is only public because it's called from non-C++ repr changed callback + void shapeeditor_event_attr_changed(gchar const *name); - void move_nodes(gdouble dx, gdouble dy); - void move_nodes_screen(gdouble dx, gdouble dy); - - void rotate_nodes(gdouble angle, int which, bool screen); - - void scale_nodes(gdouble const grow, int const which); - void scale_nodes_screen(gdouble const grow, int const which); - - void select_all (bool invert); - void select_all_from_subpath (bool invert); - void select_next (); - void select_prev (); - - void show_handles (bool show); - void show_helperpath (bool show); - - void flip (NR::Dim2 axis, boost::optional center = boost::optional()); - - void distribute (NR::Dim2 axis); - void align (NR::Dim2 axis); - - bool nodepath_edits_repr_key(gchar const *name); + bool knot_mouseover(); private: - SPDesktop *desktop; + bool has_knotholder (); + void reset_item (SubType type, bool keep_knotholder = true); + const SPItem *get_item (SubType type); - Inkscape::NodePath::Path *nodepath; + SPDesktop *desktop; KnotHolder *knotholder; - - ShapeEditorsCollective *container; - - //Inkscape::XML::Node *lidtened_repr; - - double grab_t; - int grab_node; // number of node grabbed by sp_node_context_is_over_stroke - bool hit; - NR::Point curvepoint_event; // int coords from event - NR::Point curvepoint_doc; // same, in doc coords -}; - - -/* As the next stage, this will be a collection of multiple ShapeEditors, -with the same interface as the single ShapeEditor, passing the actions to all its -contained ShapeEditors. Thus it should be easy to switch node context from -using a single ShapeEditor to using a ShapeEditorsCollective. */ - -class ShapeEditorsCollective { -public: - - ShapeEditorsCollective(SPDesktop *desktop); - ~ShapeEditorsCollective(); - - void update_statusbar(); - -private: - std::vector editors; - - SPNodeContext *nc; // who holds us + Inkscape::XML::Node *knotholder_listener_attached_for; }; #endif