]> git.street.me.uk Git - andy/viking.git/blobdiff - src/viklayer.h
help/Makefile.am: explicitly list figures.
[andy/viking.git] / src / viklayer.h
index d1fa70e898176f79535aca150f2ee659f381a9f7..52cefb03663407acc9bea99d549ff2f7261eb28b 100644 (file)
@@ -31,6 +31,8 @@
 #include "viktreeview.h"
 #include "vikviewport.h"
 
+G_BEGIN_DECLS
+
 #define VIK_LAYER_TYPE            (vik_layer_get_type ())
 #define VIK_LAYER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_LAYER_TYPE, VikLayer))
 #define VIK_LAYER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_LAYER_TYPE, VikLayerClass))
@@ -101,7 +103,7 @@ typedef gboolean (*VikToolKeyFunc) (VikLayer *, GdkEventKey *, gpointer);
 
 typedef struct _VikToolInterface VikToolInterface;
 struct _VikToolInterface {
-  gchar *name;
+  GtkRadioActionEntry radioActionEntry;
   VikToolConstructorFunc create;
   VikToolDestructorFunc destroy;
   VikToolActivationFunc activate;
@@ -109,7 +111,8 @@ struct _VikToolInterface {
   VikToolMouseFunc click;
   VikToolMouseMoveFunc move;
   VikToolMouseFunc release;
-  VikToolKeyFunc key_press; /* return FALSE if we don't use the key press -- should return AFLSE most of the time if we want any shortcuts / UI keybindings to work! use sparingly. */
+  VikToolKeyFunc key_press; /* return FALSE if we don't use the key press -- should return FALSE most of the time if we want any shortcuts / UI keybindings to work! use sparingly. */
+  gboolean pan_handler; // Call click & release funtions even when 'Pan Mode' is on
   GdkCursorType cursor_type;
   const GdkPixdata *cursor_data;
   const GdkCursor *cursor;
@@ -166,7 +169,7 @@ typedef gboolean      (*VikLayerFuncSetParam)              (VikLayer *, guint16,
 typedef VikLayerParamData
                       (*VikLayerFuncGetParam)              (VikLayer *, guint16, gboolean);
 
-typedef void          (*VikLayerFuncReadFileData)          (VikLayer *, FILE *);
+typedef gboolean      (*VikLayerFuncReadFileData)          (VikLayer *, FILE *); // Should report success or failure
 typedef void          (*VikLayerFuncWriteFileData)         (VikLayer *, FILE *);
 
 /* item manipulation */
@@ -183,7 +186,9 @@ typedef void          (*VikLayerFuncFreeCopiedItem)        (gint, gpointer);
  */
 typedef void         (*VikLayerFuncDragDropRequest)       (VikLayer *, VikLayer *, GtkTreeIter *, GtkTreePath *);
 
-typedef gboolean      (*VikLayerFuncSelectClick)           (VikLayer *, GdkEventButton *, VikViewport *);
+typedef gboolean      (*VikLayerFuncSelectClick)           (VikLayer *, GdkEventButton *, VikViewport *, tool_ed_t*);
+typedef gboolean      (*VikLayerFuncSelectMove)            (VikLayer *, GdkEventButton *, VikViewport *, tool_ed_t*);
+typedef gboolean      (*VikLayerFuncSelectRelease)         (VikLayer *, GdkEventButton *, VikViewport *, tool_ed_t*);
 typedef gboolean      (*VikLayerFuncSelectedViewportMenu)  (VikLayer *, GdkEventButton *, VikViewport *);
 
 typedef enum {
@@ -199,7 +204,9 @@ typedef struct _VikLayerInterface VikLayerInterface;
 
 /* See vik_layer_* for function parameter names */
 struct _VikLayerInterface {
-  const gchar *                     name;
+  const gchar *                     fixed_layer_name; // Used in .vik files - this should never change to maintain file compatibility
+  const gchar *                     name;             // Translate-able name used for display purposes
+  const gchar *                     accelerator;
   const GdkPixdata *                icon;
 
   VikToolInterface *                tools;
@@ -254,13 +261,15 @@ struct _VikLayerInterface {
   VikLayerFuncDragDropRequest       drag_drop_request;
 
   VikLayerFuncSelectClick           select_click;
+  VikLayerFuncSelectMove            select_move;
+  VikLayerFuncSelectRelease         select_release;
   VikLayerFuncSelectedViewportMenu  show_viewport_menu;
 };
 
 VikLayerInterface *vik_layer_get_interface ( gint type );
 
 
-void vik_layer_init ( VikLayer *vl, gint type );
+void vik_layer_set_type ( VikLayer *vl, gint type );
 void vik_layer_draw ( VikLayer *l, gpointer data );
 void vik_layer_change_coord_mode ( VikLayer *l, VikCoordMode mode );
 void vik_layer_rename ( VikLayer *l, const gchar *new_name );
@@ -306,4 +315,6 @@ VikLayer *vik_layer_get_and_reset_trigger();
 void vik_layer_emit_update_secondary ( VikLayer *vl ); /* to be called by aggregate layer only. doesn't set the trigger */
 void vik_layer_emit_update_although_invisible ( VikLayer *vl );
 
+G_END_DECLS
+
 #endif