]> git.street.me.uk Git - andy/viking.git/blobdiff - src/viklayer.h
finished layer marshalling support
[andy/viking.git] / src / viklayer.h
index d8113d980d7a084a37e441893dea3ee6f0e08d7a..1afec173e985638d7b5a2793baca84468735f97f 100644 (file)
@@ -166,6 +166,8 @@ typedef const gchar * (*VikLayerFuncSublayerRenameRequest) (VikLayer *,const gch
 typedef gboolean      (*VikLayerFuncSublayerToggleVisible) (VikLayer *,gint,gpointer);
 
 typedef VikLayer *    (*VikLayerFuncCopy)                  (VikLayer *,VikViewport *);
+typedef void          (*VikLayerFuncMarshall)              (VikLayer *, guint8 **, gint *);
+typedef VikLayer *    (*VikLayerFuncUnmarshall)            (guint8 *, gint, VikViewport *);
 
 /* returns TRUE if needs to redraw due to changed param */
 typedef gboolean      (*VikLayerFuncSetParam)              (VikLayer *, guint16, VikLayerParamData, VikViewport *);
@@ -180,6 +182,11 @@ typedef gpointer      (*VikLayerFuncCopyItem)              (VikLayer *, gint, gp
 typedef gboolean      (*VikLayerFuncPasteItem)             (VikLayer *, gint, gpointer);
 typedef void          (*VikLayerFuncFreeCopiedItem)        (gint, gpointer);
 
+/* treeview drag and drop method. called on the destination layer. it is given a source and destination layer, 
+ * and the source and destination iters in the treeview. 
+ */
+typedef void         (*VikLayerFuncDragDropRequest)       (VikLayer *, VikLayer *, GtkTreeIter *, GtkTreePath *);
+
 
 typedef struct _VikLayerInterface VikLayerInterface;
 
@@ -212,6 +219,8 @@ struct _VikLayerInterface {
   VikLayerFuncSublayerToggleVisible sublayer_toggle_visible;
 
   VikLayerFuncCopy                  copy;
+  VikLayerFuncMarshall              marshall;
+  VikLayerFuncUnmarshall            unmarshall;
 
   /* for I/O */
   VikLayerFuncSetParam              set_param;
@@ -224,6 +233,8 @@ struct _VikLayerInterface {
   VikLayerFuncCopyItem              copy_item;
   VikLayerFuncPasteItem             paste_item;
   VikLayerFuncFreeCopiedItem        free_copied_item;
+
+  VikLayerFuncDragDropRequest       drag_drop_request;
 };
 
 VikLayerInterface *vik_layer_get_interface ( gint type );
@@ -250,6 +261,10 @@ void vik_layer_post_read ( VikLayer *layer, gpointer vp );
 gboolean vik_layer_sublayer_add_menu_items ( VikLayer *l, GtkMenu *menu, gpointer vlp, gint subtype, gpointer sublayer, GtkTreeIter *iter );
 
 VikLayer *vik_layer_copy ( VikLayer *vl, gpointer vp );
+void      vik_layer_marshall ( VikLayer *vl, guint8 **data, gint *len );
+VikLayer *vik_layer_unmarshall ( guint8 *data, gint len, VikViewport *vvp );
+void      vik_layer_marshall_params ( VikLayer *vl, guint8 **data, gint *len );
+void      vik_layer_unmarshall_params ( VikLayer *vl, guint8 *data, gint len, VikViewport *vvp );
 
 const gchar *vik_layer_sublayer_rename_request ( VikLayer *l, const gchar *newname, gpointer vlp, gint subtype, gpointer sublayer, GtkTreeIter *iter );