- From: Fred P. <fprog26@hotmail.com>
- Date: Mon, 06 Oct 2003 23:38:06 -0400
- To: george_cao@hotmail.com, saschwarz@hotmail.com
- Cc: www-svg@w3.org, svg-developers@yahoogroups.com
> > > > > The main problem with XUL is that it doesn't define any other "custom > > objects". > > >Of course XUL supports custom objects. This is done through XBL. XBL is >essentially XUL's (or Gecko's) version of "render any xml." You can >defined >you own pizza or book object. You just have to implement it using >javascript. Whether you want to render your pizza or book in XUL, XHTML, >SVG, or any combination of them is in your hands (actually in your XBL >implementation). Michael wrote: Have you looked at XBL? Its an XML binding language used in Mozilla too, which allows custom properties and methods to be added to widgets. "XBL is a markup language for describing bindings that can be attached to elements in other documents. Bindings can be attached to elements using either cascading stylesheets [CSS] or the document object model [DOM]. The element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding." http://www.w3.org/TR/xbl/ Some good introductions: http://www.xulplanet.com/tutorials/xultu/introxbl.html http://www.oreillynet.com/pub/a/network/2000/08/18/magazine/infinite_xbl.html ------------------------------------------------------ hmmm, interesting, however, I think a subset of XBL would be more appropriate with a "lighter" and less verbose syntax. That's okay: <property name="size" onget="return this.getAttribute('size');" onset="return this.setAttribute('size',val);" /> Lack of separation: <property name="number"> <getter> return this.getAttribute('number'); </getter> <setter> var v=parseInt(val); if (!isNaN(v)) return this.setAttribute('number',''+v); else return this.getAttribute('number');" </setter> </property> In both case, where is "this" defined? You might argue it's the current element...which is defined where? - onget, onset, readonly (no problem with that) Finally, Property doesn't have explicit: - "bounds" declared - "defaults" value declared - strict variable typing, everything is scalar or variant ?? Also you need SVG specific group <g> transform: - translate - resize - rotate - draw For instance, let say you have a bicycle chain object and two wheels if you move the wheels, you must "twist the chain", see? Or if you have a pizza, and you rotate it, all the pepers drop on the floor... =P So, if you take my example changing <param> for <property> <template xmlns='http://xmlns.fred.com/' name='user'> <method name='draw' oncall='drawUser(x,y,w,h,id,drag,child)' /> <method name='resize' oncall='resizeUser(w,h)' /> <method name='translate' oncall='moveUser(x,y)' /> <method name='rotate' oncall='rotateUser(angle)' /> <!-- maybe ondraw, onresize, onrotation, onmove ? events --> <property name='x' type='Integer' min='0' max='100' default='0' onget='getX()' onset='setX(x)'/> <property name='y' type='Integer' min='0' max='100' default='0' onget='getY()' onset='setY(y)'/> <property name='width' type='Integer' min='0' max='20' default='10' onget='getW()' onset='setW(width)'/> <property name='height' type='Integer' min='0' max='20' default='10' onget='getH()' onset='setH(height)'/> <property name='id' type='String' min='0' max='80' default='fred' onget='getI()' onset='setI(id)'/> <property name='visibility' type='Boolean' default='false' onget='getV()' onset='setV(visibility)'/> </template> How you would write such in XBL ? Don't forget that a very simple XML parser must be able to know the interface of an object without parsing any JavaScript. It should not be verbose. It should be simple to learn, use and implement for a non-geek graphical designer. Sincerely, Fred. _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
Received on Monday, 6 October 2003 23:38:11 UTC