]>
Commit | Line | Data |
---|---|---|
50a14534 EB |
1 | static struct trwlayer_interface = { |
2 | ..., | |
3 | trwlayer_tools, | |
4 | sizeof ( trwlayer_tools ) / sizeof ( LayerTool ), /* gshort */ | |
5 | }; | |
6 | ||
7 | static struct trwlayer_tools = { | |
8 | { "Add Waypoint", trwlayer_add_wp }, | |
9 | { "Add Track", trwlayer_add_track }, | |
10 | }; | |
11 | ||
12 | ---- | |
13 | ||
14 | Tools Adding: | |
15 | ItemFactory args: | |
16 | 1) VikWindow | |
17 | 2) 4-byte variable containing ID and ID of tool. | |
18 | ||
19 | struct VikLayerToolId { | |
20 | gshort layer_id; | |
21 | gshort tool_id; | |
22 | }; | |
23 | ||
24 | Then we just need to assert (or #warning, etc.) that | |
25 | sizeof(VikLayerToolId) <= sizeof(gpointer) | |
26 | OR, I could use guint8 to be on the safe size, for a maximum of 256 | |
27 | layer types. But I think guint16 will be file. |