javascript API for setting up interface defaults

Marco Martin notmart at gmail.com
Thu Sep 1 12:07:29 UTC 2011


On Wednesday 31 August 2011, Aaron J. Seigo wrote:
> hi ...
> 
> so now that we have a nice way to define which interface (e.g.
> org.kde.active.contour-tablet-homescreen), i'd like to remove the last bit
> if ugly from this and get rid of the rc-file based setup.
> 
> i'd like to do a Javascript based API for it, but .. a little different
> from the one in the desktop.

+1
for 1.0 tough?

> first, Activity will create an actual, real activity ... and hold the
> configuration for the containment as well.
> 
> the Widget object will remain as is, though creating them will be a bit
> different.
> 
> we have the One True Panel in the plasma-device shell; so that will just be
> a global variable in the runtime. i want to make it possible to add
> widgets to its left, center and right sides. something like:
> 
> 	var configuration = new Array()
> 	configuration["ShowCalendarPopup"] = false
> 	panel.addWidget("digital-clock", panel.Center, configuration)

would remove the hardcoded hack that there is at the moment, so +1...
but,  is not said that there is one true panel, that depends from the 
homescreen qml (and btw atm there are 2 top panel containments, the 
windowstrip still is a c++ containment since didn't find any better way to)

but i would really like ther was an only true panel per *location* tough (that 
could become true one is found how to modify the window strip to not be a 
containment anymore)

after that is solved, needs a way to tell the systray contanment add *at 
center*: that containment is qml only, so must be found a way here too how to 
export additional api from it (also, i wouldn't particularly like the script 
language in the shell assumes a particular thing about one of the 
containments)

> as you can see, configuration can be pre-defined (saving a bit of
> processing at startup by allowing us to pre-write it to the config file
> with a bit of handwaving) and the location is defined. they will be placed
> in each section in the order they are defined.
> 
> Activities will similarly accept configuration both for themselves on
> startup (e.g. for wallpaper) and for widgets (something i wish to extend
> to the Desktop Scripting as well) .. what i'm not sure about here is how
> to define the coordinates. they could be done in pixel size, but that
> seems a bit crap; so i'd like to instead use the normal grid patterns:
> row, col, rowspan, colspan. i haven't looked at the contour containment
> yet to see if it supports this means of setting a widget, and if not it
> will need to be added .. unless someone has a better idea.

the contour containment atm saves positions in pixels, like:
Application:0,0,178,158;Resource:178,316,534,158;

but it could be easily converted in number of cells, so:
Application:0,0,1,1;Resource:1,3,4,1;


-- 
Marco Martin


More information about the Active mailing list