Code

Patch from codedread. Prevents rendering of title/desc/metadata elements in text...
[inkscape.git] / src / display / guideline.h
index 22f0af69add5ad1be9fc06d95abfc91ad40ed74d..451aec1da24d5ca4db4a960618b7b3e35784917a 100644 (file)
@@ -2,17 +2,20 @@
 #define __SP_GUIDELINE_H__
 
 /*
- * Infinite horizontal/vertical line; the visual representation of SPGuide.
+ * The visual representation of SPGuide.
  *
- * Author:
+ * Authors:
  *   Lauris Kaplinski <lauris@kaplinski.com>
+ *   Johan Engelen
  *
  * Copyright (C) 2000-2002 Lauris Kaplinski
+ * Copyright (C) 2007 Johan Engelen
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
 #include "sp-canvas.h"
+#include <2geom/point.h>
 
 #define SP_TYPE_GUIDELINE (sp_guideline_get_type())
 #define SP_GUIDELINE(o) (GTK_CHECK_CAST((o), SP_TYPE_GUIDELINE, SPGuideLine))
@@ -22,11 +25,15 @@ struct SPGuideLine {
     SPCanvasItem item;
 
     guint32 rgba;
-    
-    int position;
-    
-    unsigned int vertical : 1;
+
+    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 {
@@ -35,9 +42,10 @@ struct SPGuideLineClass {
 
 GType sp_guideline_get_type();
 
-SPCanvasItem *sp_guideline_new(SPCanvasGroup *parent, double position, unsigned int vertical);
+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);