ScriptTree
Created Donnerstag 12 März 2009
draft about the future of scripting bindings, object tree ...
needs renaming some funcs in c++
The listed funcs and meths are not complete, yet.
TODO:
* filter/parameter:
- where will they processed in future if we have sw-frei0r and gl-shaders effects?
- co exist?
apply a filter once to a 'static' layer e.g. make some drawings on GeoLayer then apply a frei0r blur once an keep that result
namespace
put all Objects into global space or put them into a Freej Object like this:
freej = new Freej() movie = new freej.MovieLayer('lol') // or = new MovieLayer(...) ?! freej.layers.push(movie) move.active(true) movie.start()
getter/setter
getter/setter:
in spidermonkey no real differences between props and meths, props can be c++ funcs, too.
currval = movie.active // we can define a watcher // in js and/or c (!) currval = movie.active() oldval = movie.active(new_val)
reason for making funcs instead of props, it's easier to script a "toggle", e.g. toggle active:
state = movie.active(!state)
rule of thumb: we use props for r/o values only
the tree
Legend: * obj + meth > callback - prop (r/o, usually?!) note: this wiki parser makes it difficult to keep a correct indent ... every script object is a 'baseObj', every Layer/Controller/Filter is an Entry
- baseObj [to discuss]
+ label() [for display, short e.g. LAY, MOV, CAM1, WII2] - name/id [device name/id] - filename [url, set via open()]
- Freej (stage size, bpp) [Context]
- layers [linklist] - controllers [linklist] - output [linklist, encoders, viewports, audio[alsa,jack...], to another freej/layer?] - ... + reset(new file) / run_js(file) => or a js-script object, see below + resize(w,h) - width, heigth
+ add=push, pop, shift, unshift, remove(n, obj), insert(pos) [e.g. arrange Layer stack] - n, length [no of entries] > pre_add [can deny add to list e.g. type check] > post_add [e.g. autostart movie]
- Entry
+ move: up, down, top, bottom + remove - first, last, next, prev [Entry] - list [it's [[LinkList]] or NULL] + active() + open, close > eof [end of movie, device disconnect]
+ x,y,zoom,resize,blit, **crop**, ... - width, heigth - filter [linklist, frei0r] +- audio (?!) + set Limits(mem and/or size) * CamLayer [add camctrl ?!] * Flash * Geo [sdl gfx, how about other like cairo? gl?] * Image * MovieLayer add eof callback to Entry ? * Particle * Text * xgrap [make desktop movie, vnc]
- Script [js script object]
new context for live scripting or running content from web in a different context (->security !) yes, u can spawn a seperate script context which _may_ share Objects reload a modified script at runtime! (perl never reparses a module twice, python?) + open, parse, run + init_std_classes, init_freej_classes <<< remember the .exec() !!!
missing:
* JSThread + start, stop, set_fps, get_fps