X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-guide.h;h=4fc4032db44b2b08cff27a78fededf4ffa91553b;hb=8a2e76b7021b9b960d7c30801a1a14461d9b5939;hp=91c181a7046146d9ea21d5f4894a5cb393f96993;hpb=a4030d5ca449e7e384bc699cd249ee704faaeab0;p=inkscape.git diff --git a/src/sp-guide.h b/src/sp-guide.h index 91c181a70..4fc4032db 100644 --- a/src/sp-guide.h +++ b/src/sp-guide.h @@ -1,5 +1,5 @@ -#ifndef SP_GUIDE_H -#define SP_GUIDE_H +#ifndef SEEN_SP_GUIDE_H +#define SEEN_SP_GUIDE_H /* * SPGuide @@ -8,6 +8,8 @@ * * Copyright (C) Lauris Kaplinski 2000 * Copyright (C) Johan Engelen 2007 + * Abhishek Sharma + * Jon A. Cruz * */ @@ -25,7 +27,8 @@ #define SP_IS_GUIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_GUIDE)) /* Represents the constraint on p that dot(g.direction, p) == g.position. */ -struct SPGuide : public SPObject { +class SPGuide : public SPObject { +public: Geom::Point normal_to_line; Geom::Point point_on_line; @@ -34,27 +37,27 @@ struct SPGuide : public SPObject { GSList *views; std::vector attached_items; - inline bool is_horizontal() const { return (normal_to_line[Geom::X] == 0.); }; - inline bool is_vertical() const { return (normal_to_line[Geom::Y] == 0.); }; + inline bool isHorizontal() const { return (normal_to_line[Geom::X] == 0.); }; + inline bool isVertical() const { return (normal_to_line[Geom::Y] == 0.); }; inline double angle() const { return std::atan2( - normal_to_line[Geom::X], normal_to_line[Geom::Y] ); }; + static SPGuide *createSPGuide(SPDesktop *desktop, Geom::Point const &pt1, Geom::Point const &pt2); + void showSPGuide(SPCanvasGroup *group, GCallback handler); + void hideSPGuide(SPCanvas *canvas); + void sensitize(SPCanvas *canvas, gboolean sensitive); + Geom::Point getPositionFrom(Geom::Point const &pt) const; + double getDistanceFrom(Geom::Point const &pt) const; }; -struct SPGuideClass { +class SPGuideClass { +public: SPObjectClass parent_class; }; GType sp_guide_get_type(); -SPGuide *sp_guide_create(SPDesktop *desktop, Geom::Point const &pt1, Geom::Point const &pt2); void sp_guide_pt_pairs_to_guides(SPDesktop *dt, std::list > &pts); void sp_guide_create_guides_around_page(SPDesktop *dt); -void sp_guide_show(SPGuide *guide, SPCanvasGroup *group, GCallback handler); -void sp_guide_hide(SPGuide *guide, SPCanvas *canvas); -void sp_guide_sensitize(SPGuide *guide, SPCanvas *canvas, gboolean sensitive); - -Geom::Point sp_guide_position_from_pt(SPGuide const *guide, Geom::Point const &pt); -double sp_guide_distance_from_pt(SPGuide const *guide, Geom::Point const &pt); void sp_guide_moveto(SPGuide const &guide, Geom::Point const point_on_line, bool const commit); void sp_guide_set_normal(SPGuide const &guide, Geom::Point const normal_to_line, bool const commit); void sp_guide_remove(SPGuide *guide); @@ -62,7 +65,7 @@ void sp_guide_remove(SPGuide *guide); char *sp_guide_description(SPGuide const *guide, const bool verbose = true); -#endif /* !SP_GUIDE_H */ +#endif // SEEN_SP_GUIDE_H /* Local Variables: