
assert(web.layout.element);
var dll = ..web.layout.dll;

namespace web.layout.element;

class state{
	ctor(element){
		this.element = element;
	}
	@_meta;
}
namespace state{ 
	_meta = {
		_get = function(k){
			state = bits[k];
			if(!state){
				error("´íÎóµÄ×´Ì¬Ãû",2)
			}
			return !!owner.element.getState(state)
		}
		_set = function(k,v){
			state = bits[k];
			if(!state){
				error("´íÎóµÄ×´Ì¬Ãû",2)
			}
			if(v){
				owner.element.modifyState(state)
			}
			else {
				owner.element.modifyState(,state)
			}
			
		};
	}
	
	bits = {  
		link = 0x1;
		hover = 0x2;
		active = 0x4;
		focus = 0x8;
		visited = 0x10;
		current = 0x20;
		checked = 0x40;
		disabled = 0x80;
		readonly = 0x100;
		expanded = 0x200;
		collapsed = 0x400;
		incomplete = 0x800;
		animating = 0x1000;
		focusable = 0x2000;
		anchor = 0x4000;
		synthetic = 0x8000;
		owns_popup = 0x10000;
		tabfocus = 0x20000;
		empty = 0x40000;
		busy = 0x80000;
		drag_over = 0x100000;
		drop_target = 0x200000;
		moving = 0x400000;
		copying = 0x800000;
		drag_source = 0x1000000;
		drop_marker = 0x2000000;
		pressed = 0x4000000;
		popup = 0x8000000;
		isltr = 0x10000000;
		isrtl = 0x20000000; 
	}
}

/**intellisense()
!layoutEle.state.link=link;
!layoutEle.state.hover=hover;
!layoutEle.state.active=active;
!layoutEle.state.focus=focus;
!layoutEle.state.visited=visited;
!layoutEle.state.current=current;
!layoutEle.state.checked=checked;
!layoutEle.state.disabled=disabled;
!layoutEle.state.readonly=readonly;
!layoutEle.state.expanded=expanded;
!layoutEle.state.collapsed=collapsed;
!layoutEle.state.incomplete=incomplete;
!layoutEle.state.animating=animating;
!layoutEle.state.focusable=focusable;
!layoutEle.state.anchor=anchor;
!layoutEle.state.synthetic=synthetic;
!layoutEle.state.owns_popup=owns_popup;
!layoutEle.state.tabfocus=tabfocus;
!layoutEle.state.empty=empty;
!layoutEle.state.busy=busy;
!layoutEle.state.drag_over=drag_over;
!layoutEle.state.drop_target=drop_target;
!layoutEle.state.moving=moving;
!layoutEle.state.copying=copying;
!layoutEle.state.drag_source=drag_source;
!layoutEle.state.drop_marker=rop_marker;
!layoutEle.state.pressed=pressed;
!layoutEle.state.popup=popup;
!layoutEle.state.isltr=isltr;
!layoutEle.state.isrtl=isrtl;
_ELEMENT_STATE_BITS_LINK=@1/*_ELEMENT_STATE_BITS_LINK*/
_ELEMENT_STATE_BITS_HOVER=@2/*_ELEMENT_STATE_BITS_HOVER*/
_ELEMENT_STATE_BITS_ACTIVE=@4/*_ELEMENT_STATE_BITS_ACTIVE*/
_ELEMENT_STATE_BITS_FOCUS=@8/*_ELEMENT_STATE_BITS_FOCUS*/
_ELEMENT_STATE_BITS_VISITED=@0x10/*_ELEMENT_STATE_BITS_VISITED*/
_ELEMENT_STATE_BITS_CURRENT=@0x20/*_ELEMENT_STATE_BITS_CURRENT*/
_ELEMENT_STATE_BITS_CHECKED=@0x40/*_ELEMENT_STATE_BITS_CHECKED*/
_ELEMENT_STATE_BITS_DISABLED=@0x80/*_ELEMENT_STATE_BITS_DISABLED*/
_ELEMENT_STATE_BITS_READONLY=@0x100/*_ELEMENT_STATE_BITS_READONLY*/
_ELEMENT_STATE_BITS_EXPANDED=@0x200/*_ELEMENT_STATE_BITS_EXPANDED*/
_ELEMENT_STATE_BITS_COLLAPSED=@0x400/*_ELEMENT_STATE_BITS_COLLAPSED*/
_ELEMENT_STATE_BITS_INCOMPLETE=@0x800/*_ELEMENT_STATE_BITS_INCOMPLETE*/
_ELEMENT_STATE_BITS_ANIMATING=@0x1000/*_ELEMENT_STATE_BITS_ANIMATING*/
_ELEMENT_STATE_BITS_FOCUSABLE=@0x2000/*_ELEMENT_STATE_BITS_FOCUSABLE*/
_ELEMENT_STATE_BITS_ANCHOR=@0x4000/*_ELEMENT_STATE_BITS_ANCHOR*/
_ELEMENT_STATE_BITS_SYNTHETIC=@0x8000/*_ELEMENT_STATE_BITS_SYNTHETIC*/
_ELEMENT_STATE_BITS_OWNS_POPUP=@0x10000/*_ELEMENT_STATE_BITS_OWNS_POPUP*/
_ELEMENT_STATE_BITS_TABFOCUS=@0x20000/*_ELEMENT_STATE_BITS_TABFOCUS*/
_ELEMENT_STATE_BITS_EMPTY=@0x40000/*_ELEMENT_STATE_BITS_EMPTY*/
_ELEMENT_STATE_BITS_BUSY=@0x80000/*_ELEMENT_STATE_BITS_BUSY*/
_ELEMENT_STATE_BITS_DRAG_OVER=@0x100000/*_ELEMENT_STATE_BITS_DRAG_OVER*/
_ELEMENT_STATE_BITS_DROP_TARGET=@0x200000/*_ELEMENT_STATE_BITS_DROP_TARGET*/
_ELEMENT_STATE_BITS_MOVING=@0x400000/*_ELEMENT_STATE_BITS_MOVING*/
_ELEMENT_STATE_BITS_COPYING=@0x800000/*_ELEMENT_STATE_BITS_COPYING*/
_ELEMENT_STATE_BITS_DRAG_SOURCE=@0x1000000/*_ELEMENT_STATE_BITS_DRAG_SOURCE*/
_ELEMENT_STATE_BITS_DROP_MARKER=@0x2000000/*_ELEMENT_STATE_BITS_DROP_MARKER*/
_ELEMENT_STATE_BITS_PRESSED=@0x4000000/*_ELEMENT_STATE_BITS_PRESSED*/
_ELEMENT_STATE_BITS_POPUP=@0x8000000/*_ELEMENT_STATE_BITS_POPUP*/
_ELEMENT_STATE_BITS_ISLTR=@0x10000000/*_ELEMENT_STATE_BITS_ISLTR*/
_ELEMENT_STATE_BITS_ISRTL=@0x20000000/*_ELEMENT_STATE_BITS_ISRTL*/
end intellisense**/