2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
4 * Copyright (C) 2003-2007, Evan Battaglia <gtoevan@gmx.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef _VIKING_UIBUILDER_H
22 #define _VIKING_UIBUILDER_H
26 /* Parameters (for I/O and Properties) */
45 gpointer extra_widget_data;
49 VIK_LAYER_NOT_IN_PROPERTIES=-2,
50 VIK_LAYER_GROUP_NONE=-1
54 VIK_LAYER_WIDGET_CHECKBUTTON=0,
55 VIK_LAYER_WIDGET_RADIOGROUP,
56 VIK_LAYER_WIDGET_RADIOGROUP_STATIC,
57 VIK_LAYER_WIDGET_SPINBUTTON,
58 VIK_LAYER_WIDGET_ENTRY,
59 VIK_LAYER_WIDGET_PASSWORD,
60 VIK_LAYER_WIDGET_FILEENTRY,
61 VIK_LAYER_WIDGET_HSCALE,
62 VIK_LAYER_WIDGET_COLOR,
63 VIK_LAYER_WIDGET_COMBOBOX,
64 VIK_LAYER_WIDGET_FILELIST,
76 VIK_LAYER_PARAM_DOUBLE=1,
80 /* in my_layer_set_param, if you want to use the string, you should dup it
81 * in my_layer_get_param, the string returned will NOT be free'd, you are responsible for managing it (I think) */
82 VIK_LAYER_PARAM_STRING,
83 VIK_LAYER_PARAM_BOOLEAN,
84 VIK_LAYER_PARAM_COLOR,
86 /* NOTE: string list works uniquely: data.sl should NOT be free'd when
87 * the internals call get_param -- i.e. it should be managed w/in the layer.
88 * The value passed by the internals into set_param should also be managed
89 * by the layer -- i.e. free'd by the layer.
92 VIK_LAYER_PARAM_STRING_LIST,
95 GtkWidget *a_uibuilder_new_widget ( VikLayerParam *param, VikLayerParamData data );
96 VikLayerParamData a_uibuilder_widget_get_value ( GtkWidget *widget, VikLayerParam *param );
97 gint a_uibuilder_properties_factory ( GtkWindow *parent, VikLayerParam *params,
98 guint16 params_count, gchar **groups, guint8 groups_count,
99 gboolean (*setparam) (gpointer,guint16,VikLayerParamData,gpointer),
100 gpointer pass_along1, gpointer pass_along2,
101 VikLayerParamData (*getparam) (gpointer,guint16),
102 gpointer pass_along_getparam );
103 /* pass_along1 and pass_along2 are for set_param first and last params */
106 VikLayerParamData *a_uibuilder_run_dialog ( GtkWindow *parent, VikLayerParam *params,
107 guint16 params_count, gchar **groups, guint8 groups_count,
108 VikLayerParamData *params_defaults );
110 /* frees data from last (if ness) */
111 void a_uibuilder_free_paramdatas ( VikLayerParamData *paramdatas, VikLayerParam *params, guint16 params_count );