diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2010-12-07 00:59:05 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2010-12-10 22:36:41 +0100 |
commit | 3419680f2523414d4ac7349232eb92b627dd993a (patch) | |
tree | 12732dbe05f81d3a2a866446913b5bc5b15de25a /src/ld-canvas.h | |
parent | 37d898fb1a29f074747dbd9c81d6e2ad97d2e23e (diff) | |
download | logdiag-3419680f2523414d4ac7349232eb92b627dd993a.tar.gz logdiag-3419680f2523414d4ac7349232eb92b627dd993a.tar.xz logdiag-3419680f2523414d4ac7349232eb92b627dd993a.zip |
Implement more of LdCanvas.
1. Add methods for coordinate translation between cairo/GtkWidget
coordinates and LdDocument coordinates.
2. Draw the grid correctly (also make it significantly faster).
3. Place the canvas into a GtkScrolledWindow and register
the set_scroll_adjustments signal in the GtkWidget base class.
4. Allow scrolling inside of an area of 200 x 200 units (for now).
In the future, it should be possible to go to infinity.
Diffstat (limited to 'src/ld-canvas.h')
-rw-r--r-- | src/ld-canvas.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ld-canvas.h b/src/ld-canvas.h index a31b2b7..037e727 100644 --- a/src/ld-canvas.h +++ b/src/ld-canvas.h @@ -48,22 +48,33 @@ struct _LdCanvasClass /*< private >*/ GtkDrawingAreaClass parent_class; -/* - void (*set_scroll_adjustments) (GtkAdjustment *x, GtkAdjustment *y); -*/ + void (*set_scroll_adjustments) (LdCanvas *self, + GtkAdjustment *horizontal, GtkAdjustment *vertical); }; +/** + * LD_CANVAS_BASE_UNIT: + * + * The length of the base unit in milimetres. + */ +#define LD_CANVAS_BASE_UNIT_LENGTH 2.5 + + GType ld_canvas_get_type (void) G_GNUC_CONST; LdCanvas *ld_canvas_new (void); void ld_canvas_set_document (LdCanvas *self, LdDocument *document); LdDocument *ld_canvas_get_document (LdCanvas *self); - void ld_canvas_set_library (LdCanvas *self, LdLibrary *library); LdLibrary *ld_canvas_get_library (LdCanvas *self); +void ld_canvas_translate_canvas_coordinates (LdCanvas *self, + gdouble *x, gdouble *y); +void ld_canvas_translate_document_coordinates (LdCanvas *self, + gdouble *x, gdouble *y); + /* TODO: The rest of the interface. */ |