2015-07-14, 15:49
As a extension of the discussion started on PR7453, I'd like to use this thread to document and discuss the plans, whishes and ideas for the skinning engine / UI. I actually wanted to talk about this at devcon, but it seems the demand for discussion is already right now. So here we go:
To me it seems that skins are drifting away from the old hirarchical menu structure approach and would like to go new ways in terms of navigational concepts and getting feature rich home screens etc (see fTV skin, leanback, ...). To achieve this in better ways than currently possible, I have some ideas I'd like to share and discuss:
1) Separation of core and UI
To free our skins we IMO have to remove the hardcoded bindings of some core functionality and the UI, which basically means separating core from the UI. IMHO this could be achieved by an interface that's hooked up to thread messages, which means that core components only fire thread messages (or alike), passing along required arguments, a unique action ID and a hardcoded log message (if required). The interface/communication layer is catching it and forwarding to registered observers via JSON, BSON (which is faster than JSON) or alike. The connected UI component is then processing the message and performing the required actions (ask skin for special handling of that action, if not ask addons, if not perform a default action like triggering a dialog). In case of an interactive action (dialog/input result) GUI is sending a response back (response action/callback would be part of the arguments of the initial request/message). Required label IDs would be mapped and fetched by the UI component, so that the entire core would be free of strings (besides of debug messages) and any UI logic (windows, dialogs, ...).
Doing this will have the following benefits:
- no more UI and label bikeshedding in PRs of core components
- UI guys can go crazy without annoying core devs
- thin clients
- any kind of UI (feature-full HTML5 UI/Webinterface for headless, desktop app like UI ...)
2) MVC in skinning engine
Instead of having hardcoded window structures with actions we could leave it up entirely to the skins which windows and which content to show. Core/UI component would only provide "data-providers" that skins can use to grab arbitrary data (list items, infolabels, settings, ...). These data-providers could be add-ons, so that new/custom ones could be added easily. In order for skins to be able to trigger actions, buttons etc whould have to be extended to allow some sort of "controller" and "action" attributes which will be processed by UI component and forwarded to core (<button label="123" controller="videolibrary" action="scan" />).
3) context based keymaps
Because keymaps are currently bound to window IDs, they won't work anymore when skins are free to do what ever they want. To compensate for that keymaps would be bound by contexts instead, which a skin would define for each window/dialog. End result would be simmiilar to what we have now, but more flexible.
4) skin specific keymaps
because of all the flexibility, one global core keymap won't really work anymore, so core would only provide basic keymaps and skins would have their own defaults.
-------------
Please see this only as some basic ideas and a starting ground for further discussion and ideas. I know that these are quite drastical changes and a lot of work if we would like to go that way. What do our core skinners think about it?
I post this in the readonly section for now, but we could also open it up for "public" discussion so that all skinners could share their ideas.
To me it seems that skins are drifting away from the old hirarchical menu structure approach and would like to go new ways in terms of navigational concepts and getting feature rich home screens etc (see fTV skin, leanback, ...). To achieve this in better ways than currently possible, I have some ideas I'd like to share and discuss:
1) Separation of core and UI
To free our skins we IMO have to remove the hardcoded bindings of some core functionality and the UI, which basically means separating core from the UI. IMHO this could be achieved by an interface that's hooked up to thread messages, which means that core components only fire thread messages (or alike), passing along required arguments, a unique action ID and a hardcoded log message (if required). The interface/communication layer is catching it and forwarding to registered observers via JSON, BSON (which is faster than JSON) or alike. The connected UI component is then processing the message and performing the required actions (ask skin for special handling of that action, if not ask addons, if not perform a default action like triggering a dialog). In case of an interactive action (dialog/input result) GUI is sending a response back (response action/callback would be part of the arguments of the initial request/message). Required label IDs would be mapped and fetched by the UI component, so that the entire core would be free of strings (besides of debug messages) and any UI logic (windows, dialogs, ...).
Doing this will have the following benefits:
- no more UI and label bikeshedding in PRs of core components
- UI guys can go crazy without annoying core devs
- thin clients
- any kind of UI (feature-full HTML5 UI/Webinterface for headless, desktop app like UI ...)
2) MVC in skinning engine
Instead of having hardcoded window structures with actions we could leave it up entirely to the skins which windows and which content to show. Core/UI component would only provide "data-providers" that skins can use to grab arbitrary data (list items, infolabels, settings, ...). These data-providers could be add-ons, so that new/custom ones could be added easily. In order for skins to be able to trigger actions, buttons etc whould have to be extended to allow some sort of "controller" and "action" attributes which will be processed by UI component and forwarded to core (<button label="123" controller="videolibrary" action="scan" />).
3) context based keymaps
Because keymaps are currently bound to window IDs, they won't work anymore when skins are free to do what ever they want. To compensate for that keymaps would be bound by contexts instead, which a skin would define for each window/dialog. End result would be simmiilar to what we have now, but more flexible.
4) skin specific keymaps
because of all the flexibility, one global core keymap won't really work anymore, so core would only provide basic keymaps and skins would have their own defaults.
-------------
Please see this only as some basic ideas and a starting ground for further discussion and ideas. I know that these are quite drastical changes and a lot of work if we would like to go that way. What do our core skinners think about it?
I post this in the readonly section for now, but we could also open it up for "public" discussion so that all skinners could share their ideas.