Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > fff948ba35a5ae9f9dfbad3da9c22cf6 > files > 21

viking-1.1-1.fc14.x86_64.rpm

static struct trwlayer_interface = {
 ...,
 trwlayer_tools,
 sizeof ( trwlayer_tools ) / sizeof ( LayerTool ), /* gshort */
};

static struct trwlayer_tools = {
  { "Add Waypoint", trwlayer_add_wp },
  { "Add Track", trwlayer_add_track },
};

----

Tools Adding:
ItemFactory args:
1) VikWindow
2) 4-byte variable containing ID and ID of tool.

struct VikLayerToolId {
  gshort layer_id;
  gshort tool_id;
};

Then we just need to assert (or #warning, etc.) that 
sizeof(VikLayerToolId) <= sizeof(gpointer)
OR, I could use guint8 to be on the safe size, for a maximum of 256 
layer types. But I think guint16 will be file.