index a9bfc809bf96c1432dba5dd678a2b8aaceda80e7..9654d04a14bff628d3716d3cc1cb6a219ba9cdab 100644 (file)
--- a/src/display/guideline.h
+++ b/src/display/guideline.h
-#ifndef __SP_GUIDELINE_H__
-#define __SP_GUIDELINE_H__
+#ifndef SEEN_SP_GUIDELINE_H
+#define SEEN_SP_GUIDELINE_H
/*
* The visual representation of SPGuide.
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include "sp-canvas.h"
#include <2geom/point.h>
+#include "sp-canvas-item.h"
#define SP_TYPE_GUIDELINE (sp_guideline_get_type())
#define SP_GUIDELINE(o) (GTK_CHECK_CAST((o), SP_TYPE_GUIDELINE, SPGuideLine))
#define SP_IS_GUIDELINE(o) (GTK_CHECK_TYPE((o), SP_TYPE_GUIDELINE))
+class SPCtrlPoint;
+
struct SPGuideLine {
SPCanvasItem item;
+ SPCtrlPoint *origin; // unlike 'item', this is only held locally
guint32 rgba;
- int position;
- Geom::Point normal;
+ Geom::Point normal_to_line;
+ Geom::Point point_on_line;
+ double angle;
unsigned int sensitive : 1;
+
+ inline bool is_horizontal() const { return (normal_to_line[Geom::X] == 0.); };
+ inline bool is_vertical() const { return (normal_to_line[Geom::Y] == 0.); };
};
struct SPGuideLineClass {
GType sp_guideline_get_type();
-SPCanvasItem *sp_guideline_new(SPCanvasGroup *parent, double position, Geom::Point normal);
+SPCanvasItem *sp_guideline_new(SPCanvasGroup *parent, Geom::Point point_on_line, Geom::Point normal);
-void sp_guideline_set_position(SPGuideLine *gl, double position);
+void sp_guideline_set_position(SPGuideLine *gl, Geom::Point point_on_line);
+void sp_guideline_set_normal(SPGuideLine *gl, Geom::Point normal_to_line);
void sp_guideline_set_color(SPGuideLine *gl, unsigned int rgba);
void sp_guideline_set_sensitive(SPGuideLine *gl, int sensitive);
+void sp_guideline_delete(SPGuideLine *gl);
-#endif
+#endif // SEEN_SP_GUIDELINE_H
/*
Local Variables: