]> git.street.me.uk Git - andy/viking.git/commitdiff
[QA] Enumerate and use VikLayerParamType
authorRob Norris <rw_norris@hotmail.com>
Tue, 22 Jan 2013 17:02:47 +0000 (17:02 +0000)
committerRob Norris <rw_norris@hotmail.com>
Sat, 16 Feb 2013 19:23:40 +0000 (19:23 +0000)
src/uibuilder.h

index afa7e8473357e4af3b951556d3f8d8c4b0399475..04c943830fd60b6862169304fef5368bdcb9b88c 100644 (file)
@@ -37,9 +37,30 @@ typedef union {
   GList *sl;
 } VikLayerParamData;
 
+/* id is index */
+typedef enum {
+VIK_LAYER_PARAM_DOUBLE=1,
+VIK_LAYER_PARAM_UINT,
+VIK_LAYER_PARAM_INT,
+
+/* in my_layer_set_param, if you want to use the string, you should dup it
+ * in my_layer_get_param, the string returned will NOT be free'd, you are responsible for managing it (I think) */
+VIK_LAYER_PARAM_STRING,
+VIK_LAYER_PARAM_BOOLEAN,
+VIK_LAYER_PARAM_COLOR,
+
+/* NOTE: string list works uniquely: 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,
+} VikLayerParamType;
+
 typedef struct {
   const gchar *name;
-  guint8 type;
+  VikLayerParamType type;
   gint16 group;
   const gchar *title;
   guint8 widget_type;
@@ -75,38 +96,25 @@ typedef struct {
   guint8 digits;
 } VikLayerParamScale;
 
-/* id is index */
-enum {
-VIK_LAYER_PARAM_DOUBLE=1,
-VIK_LAYER_PARAM_UINT,
-VIK_LAYER_PARAM_INT,
 
-/* in my_layer_set_param, if you want to use the string, you should dup it
- * in my_layer_get_param, the string returned will NOT be free'd, you are responsible for managing it (I think) */
-VIK_LAYER_PARAM_STRING,
-VIK_LAYER_PARAM_BOOLEAN,
-VIK_LAYER_PARAM_COLOR,
 
-/* NOTE: string list works uniquely: 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,
-};
 
 GtkWidget *a_uibuilder_new_widget ( VikLayerParam *param, VikLayerParamData data );
 VikLayerParamData a_uibuilder_widget_get_value ( GtkWidget *widget, VikLayerParam *param );
-gint a_uibuilder_properties_factory ( const gchar *dialog_name, GtkWindow *parent, VikLayerParam *params,
-                                     guint16 params_count, gchar **groups, guint8 groups_count,
-                                     gboolean (*setparam) (gpointer,guint16,VikLayerParamData,gpointer,gboolean),
-                                     gpointer pass_along1, gpointer pass_along2,
-                                     VikLayerParamData (*getparam) (gpointer,guint16,gboolean),
-                                     gpointer pass_along_getparam );
+gint a_uibuilder_properties_factory ( const gchar *dialog_name,
+                                      GtkWindow *parent,
+                                      VikLayerParam *params,
+                                      guint16 params_count,
+                                      gchar **groups,
+                                      guint8 groups_count,
+                                      gboolean (*setparam) (gpointer,guint16,VikLayerParamData,gpointer,gboolean),
+                                      gpointer pass_along1,
+                                      gpointer pass_along2,
+                                      VikLayerParamData (*getparam) (gpointer,guint16,gboolean),
+                                      gpointer pass_along_getparam );
                                       /* pass_along1 and pass_along2 are for set_param first and last params */
 
-
 VikLayerParamData *a_uibuilder_run_dialog ( const gchar *dialog_name, GtkWindow *parent, VikLayerParam *params,
                         guint16 params_count, gchar **groups, guint8 groups_count,
                        VikLayerParamData *params_defaults );