]> git.street.me.uk Git - andy/viking.git/blobdiff - src/viklayer.h
Half-drawn hack
[andy/viking.git] / src / viklayer.h
index f08658aec4c8fcf86f200d9c4e6f607df514bfb9..cfb5a5ee52ff0abb2c54e61db2ae5fb2edb5b045 100644 (file)
@@ -53,7 +53,7 @@ struct _VikLayer {
   gboolean visible;
 
   gboolean realized;
-  VikTreeview *vt; /* simply a refernce */
+  VikTreeview *vt; /* simply a reference */
   GtkTreeIter iter;
 
   /* for explicit "polymorphism" (function type switching) */
@@ -69,6 +69,7 @@ enum {
   VIK_LAYER_GEOREF,
   VIK_LAYER_GPS,
   VIK_LAYER_MAPS,
+  VIK_LAYER_DEM,
   VIK_LAYER_NUM_TYPES
 };
 
@@ -107,6 +108,7 @@ typedef union {
   gboolean b;
   const gchar *s;
   GdkColor c;
+  GList *sl;
 } VikLayerParamData;
 
 typedef struct {
@@ -127,12 +129,14 @@ VIK_LAYER_GROUP_NONE=-1
 enum {
 VIK_LAYER_WIDGET_CHECKBUTTON=0,
 VIK_LAYER_WIDGET_RADIOGROUP,
+VIK_LAYER_WIDGET_RADIOGROUP_STATIC,
 VIK_LAYER_WIDGET_SPINBUTTON,
 VIK_LAYER_WIDGET_ENTRY,
 VIK_LAYER_WIDGET_FILEENTRY,
 VIK_LAYER_WIDGET_HSCALE,
 VIK_LAYER_WIDGET_COLOR,
 VIK_LAYER_WIDGET_COMBOBOX,
+VIK_LAYER_WIDGET_FILELIST,
 };
 
 typedef struct {
@@ -150,6 +154,14 @@ VIK_LAYER_PARAM_INT,
 VIK_LAYER_PARAM_STRING,
 VIK_LAYER_PARAM_BOOLEAN,
 VIK_LAYER_PARAM_COLOR,
+
+/* NOTE: string layer works auniquely: data.sl should NOT be free'd when
+ * the internals call get_param -- i.e. it should be managed w/in the layer.
+ * The value passed by the internals into set_param should also be managed
+ * by the layer -- i.e. free'd by the layer.
+ */
+
+VIK_LAYER_PARAM_STRING_LIST,
 };
 
 /* layer interface functions */
@@ -164,13 +176,13 @@ typedef void          (*VikLayerFuncRealize)               (VikLayer *,VikTreevi
 /* rarely used, this is called after a read operation or properties box is run.
  * usually used to create GC's that depend on params,
  * but GC's can also be created from create() or set_param() */
-typedef void          (*VikLayerFuncPostRead)              (VikLayer *,gpointer vp);
+typedef void          (*VikLayerFuncPostRead)              (VikLayer *,VikViewport *vp,gboolean from_file);
 
 typedef void          (*VikLayerFuncFree)                  (VikLayer *);
 
 /* do _not_ use this unless absolutely neccesary. Use the dynamic properties (see coordlayer for example)
   * returns TRUE if OK was pressed */
-typedef gboolean      (*VikLayerFuncProperties)            (VikLayer *,VikViewport *); /* gpointer is a VikViewport */
+typedef gboolean      (*VikLayerFuncProperties)            (VikLayer *,VikViewport *);
 
 typedef void          (*VikLayerFuncDraw)                  (VikLayer *,VikViewport *);
 typedef void          (*VikLayerFuncChangeCoordMode)       (VikLayer *,VikCoordMode);
@@ -184,7 +196,6 @@ typedef const gchar * (*VikLayerFuncSublayerRenameRequest) (VikLayer *,const gch
                                                             gint,VikViewport *,GtkTreeIter *); /* first gpointer is a VikLayersPanel */
 typedef gboolean      (*VikLayerFuncSublayerToggleVisible) (VikLayer *,gint,gpointer);
 
-typedef VikLayer *    (*VikLayerFuncCopy)                  (VikLayer *,VikViewport *);
 typedef void          (*VikLayerFuncMarshall)              (VikLayer *, guint8 **, gint *);
 typedef VikLayer *    (*VikLayerFuncUnmarshall)            (guint8 *, gint, VikViewport *);
 
@@ -255,7 +266,6 @@ struct _VikLayerInterface {
   VikLayerFuncSublayerRenameRequest sublayer_rename_request;
   VikLayerFuncSublayerToggleVisible sublayer_toggle_visible;
 
-  VikLayerFuncCopy                  copy;
   VikLayerFuncMarshall              marshall;
   VikLayerFuncUnmarshall            unmarshall;
 
@@ -283,6 +293,7 @@ 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 );
 void vik_layer_rename_no_copy ( VikLayer *l, gchar *new_name );
+const gchar *vik_layer_get_name ( VikLayer *l );
 
 gboolean vik_layer_set_param (VikLayer *layer, guint16 id, VikLayerParamData data, gpointer vp);
 
@@ -296,7 +307,7 @@ VikLayer *vik_layer_create ( gint type, gpointer vp, GtkWindow *w, gboolean inte
 gboolean vik_layer_properties ( VikLayer *layer, gpointer vp );
 
 void vik_layer_realize ( VikLayer *l, VikTreeview *vt, GtkTreeIter * layer_iter );
-void vik_layer_post_read ( VikLayer *layer, gpointer vp );
+void vik_layer_post_read ( VikLayer *layer, VikViewport *vp, gboolean from_file );
 
 gboolean vik_layer_sublayer_add_menu_items ( VikLayer *l, GtkMenu *menu, gpointer vlp, gint subtype, gpointer sublayer, GtkTreeIter *iter );
 
@@ -313,4 +324,8 @@ gboolean vik_layer_sublayer_toggle_visible ( VikLayer *l, gint subtype, gpointer
 /* TODO: put in layerspanel */
 GdkPixbuf *vik_layer_load_icon ( gint type );
 
+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 );
+
 #endif