From: Andreas K. <and...@ac...> - 2009-02-11 19:42:22
|
The API which gelled in my mind yesterday on the way home and sleeping over it. NOTE This doesn't contain anything brought up by the continued discussion today. (Names are subject to change) icons::loaded Returns list containing the names of the icon themes in memory. icons::themes Returns list containing the names of all icon themes we can activate/load. icons::activate FOO Load package 'icons::theme::FOO' Switch all icons already in use to this theme if possible. icons::get name ?theme? Get tk image for the named icon. If a theme is specified pull the icon from that theme. Without a theme specified search through all loaded themes, last theme loaded is searched first. Notes I am equating icon themes to packages here, with a standard API between the icons framework and the theme packages. (This API presently undefined) Theme discovery (see above) becomes package discovery. Which, while not perfect (package require __bogus + (tcl::tm::lisyt+glob)) we have workable solutions for. Not necessarily clear from the above, multiple themes can be activated, and the theme activated last is the 'active' theme. Holes in that theme, i.e. icons the application needs, but are not found there, are satisfied by search through the older theme. i.e. a stack is managed and searched from the top down. Re-activating a previously loaded theme brings it to the top of the stack, and all icons in use are resolved again to ensure that they are switched to the icon in the newly activated theme, if at all possible. The responsibility for locating the icons searched for is in the theme packages. Could be a virtual filesystem, or on disk as part of the package, on disk using system search paths provided by the desktop environment, etc. Whatever strikes our fancy and/or is relevant to how an application is deployed. Example starpack: Have a desktop theme wrapped, and a theme directly containing some implementation of all the icons used by the app, as fallback for everything not found by the desktop theme. Onward, to integrate the results of today's discussion. Andreas. |