javascript API for setting up interface defaults

Aaron J. Seigo aseigo at kde.org
Wed Aug 31 16:19:46 UTC 2011


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.

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)

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.

much of the code will be a simple copy from the Desktop Scripting, though it 
will be simplified in areas and customized as describe above, much as i did 
for the Plasma KPart.

any thoughts?

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/active/attachments/20110831/88049406/attachment.sig>


More information about the Active mailing list