Jon A. Cruz wrote:
FYI, this aspect has been looked into, and the consensus was to switch from C constants to strings. We can leverage the GQuark where appropriate.
What we use for unique IDs isn't that important. I was talking about something more fundamental. Currently everything has to be explicitly called from main() or its descendant function at some point. This means that even if you define verbs in different files you still have to have headers for them to be able to call their init functions or construct them. This means we have some files that just list everything that has to be initialized (e.g. extension/init.cpp).
My solution involves creating a class for each verb/action (derived from Gtk::Action) and adding a statically initialized "entry object" that, upon construction, will put the action's static constructor (e.g. a static function that returns a new action) on the list of actions to initialize. This would automagically build lists of global actions and per-document actions to create.
A similar approach could be used for tools, path effects, toolbars, internal extensions, dialogs, etc., effectively turning Inkscape into a collection of statically linked plugins. I posted about this a while ago but there was no reply.
What do you think about this general idea (let's call it "Static Plugin Pattern")?
Regards, Krzysztof Kosiński