| 1 |
|
|---|
| 2 |
package xinf.ony; |
|---|
| 3 |
|
|---|
| 4 |
import xinf.event.Event; |
|---|
| 5 |
import xinf.event.EventKind; |
|---|
| 6 |
import xinf.event.EventDispatcher; |
|---|
| 7 |
import xinf.geom.Types; |
|---|
| 8 |
import xinf.geom.Transform; |
|---|
| 9 |
import xinf.style.ElementStyle; |
|---|
| 10 |
import xinf.style.Stylable; |
|---|
| 11 |
import xinf.style.Selector; |
|---|
| 12 |
import xinf.xml.Serializable; |
|---|
| 13 |
|
|---|
| 14 |
interface Element implements EventDispatcher, implements Serializable, implements Stylable { |
|---|
| 15 |
|
|---|
| 16 |
/** Unique (to the runtime environment) ID of this object. Will be set automatically, in the constructor. |
|---|
| 17 |
Note that this has nothing to do with the SVG 'id' property (which is a String, while this is numeric) **/ |
|---|
| 18 |
var xid(default,null):Int; |
|---|
| 19 |
|
|---|
| 20 |
/** textual (SVG) id **/ |
|---|
| 21 |
var id(default,null):String; |
|---|
| 22 |
|
|---|
| 23 |
/** textual name (name attribute) **/ |
|---|
| 24 |
var name(default,null):String; |
|---|
| 25 |
|
|---|
| 26 |
/** Other Object that contains this Object, if any. **/ |
|---|
| 27 |
var parent(default,null):Group; |
|---|
| 28 |
|
|---|
| 29 |
/** Document that ultimately contains this Object **/ |
|---|
| 30 |
var document(default,null):Document; |
|---|
| 31 |
|
|---|
| 32 |
/** the object's transformation **/ |
|---|
| 33 |
var transform(default,set_transform):Transform; |
|---|
| 34 |
|
|---|
| 35 |
/** the element's style **/ |
|---|
| 36 |
var style(default,default):ElementStyle; |
|---|
| 37 |
|
|---|
| 38 |
function styleChanged() :Void; |
|---|
| 39 |
function getParentStyle() :xinf.style.Style; |
|---|
| 40 |
function matchSelector( s:Selector ) :Bool; |
|---|
| 41 |
|
|---|
| 42 |
/** read element data from xml */ |
|---|
| 43 |
function fromXml( xml:Xml ) :Void; |
|---|
| 44 |
|
|---|
| 45 |
/** called when the document is completely loaded **/ |
|---|
| 46 |
function onLoad() :Void; |
|---|
| 47 |
|
|---|
| 48 |
/** convert the given point from global to local coordinates **/ |
|---|
| 49 |
function globalToLocal( p:TPoint ) :TPoint; |
|---|
| 50 |
|
|---|
| 51 |
/** convert the given point from local to global coordinates **/ |
|---|
| 52 |
function localToGlobal( p:TPoint ) :TPoint; |
|---|
| 53 |
|
|---|
| 54 |
/** hook to do something when attached to a parent Group **/ |
|---|
| 55 |
function attachedTo( p:Group ) :Void; |
|---|
| 56 |
|
|---|
| 57 |
/** hook to do something when detached from a parent Group **/ |
|---|
| 58 |
function detachedFrom( p:Group ) :Void; |
|---|
| 59 |
|
|---|
| 60 |
function addEventListener<T>( type :EventKind<T>, h :T->Void ) :T->Void; |
|---|
| 61 |
function removeEventListener<T>( type :EventKind<T>, h :T->Void ) :Bool; |
|---|
| 62 |
/** dispatch the given event to registered listeners **/ |
|---|
| 63 |
function dispatchEvent<T>( e : Event<T> ) :Void; |
|---|
| 64 |
function postEvent<T>( e : Event<T>, ?pos:haxe.PosInfos ) :Void; |
|---|
| 65 |
|
|---|
| 66 |
} |
|---|