]> git.street.me.uk Git - andy/viking.git/blame_incremental - doc/dev/FF2-Implementation
Restore compilation of test program gpx2gpx.
[andy/viking.git] / doc / dev / FF2-Implementation
... / ...
CommitLineData
1
2ff2.c
3reads thru thing
4if layer, makes new layer of type
5adds to aggregate
6
7looks at line
8if starts with '[' creates layer (new interface func?)
9fgets line with 'this=this' in
10calls
11
12interface {
13...
14 params {
15 { "this", PARAM_THIS },
16 { "that", PARAM_THAT },
17 },
18 num params = 2,
19
20}
21
22set_param(VikLayer*l,gint type_id,gchar *stuff) { switch(type_id) {
23case PARAM_THIS:
24 layer_set_this(l,stuff);
25case PARAM_THAT:
26 l->that = atol(stuff)
27} }
28
29checks thru params strlen() check and strncmp()
30good -> set param
31
32*now*, what if I could use all this set_param stuff for dynamic dialog box creation?
33and default (non-interactive) new layers?
34
35param name ID explanation type widget type min/min len max/max len default val
36colorvelocity VEL lower velocity range CUSTOM CUSTOM
37line_thickness THICK Track Line Thickness INT SPINBUTTON 1 15 1
38# on read, if outside range, gives error.
39
40special stuff like color velocity range?
41
42union param_val {
43 gchar *s;
44 long l;
45 double d;
46}
47
48color velocity range:
49[ ] to [ ]
50
51so we need a special get_widget_for_param() thingy.
52then set_param_from_widget() -> gets widget data does its thing
53
54tabs?
55radio boxes? (names)
56
57----
58
59ff2.c
60
61typedef struct {
62 Stack *under;
63 gpointer data;
64} Stack;
65
66void pop(Stack **stack) {
67 Stack *tmp = (*stack)->under;
68 g_free ( *stack );
69 *stack = tmp;
70}
71
72void push(Stack **stack)
73{
74 Stack *tmp = g_malloc ( sizeof ( Stack ) );
75 tmp->under = *stack;
76 *stack = tmp;
77}
78
79/*
80read thru file
81if "[Layer Type="
82 push(&stack)
83 new default layer of type (str_to_type) (check interface->name)
84if "[EndLayer]"
85 VikLayer *vl = stack->data;
86 pop(&stack);
87 vik_aggregate_layer_add_layer(stack->data, vl);
88if "[LayerData]"
89 vik_layer_data ( VIK_LAYER_DATA(stack->data), f, vp );
90
91*/