/*
 * @require jade.js
 */
jade.Object=function(){this.connectedSlots={}};
jade.Object.className="jade.Object";jade.Object.prototype.sendSignal=function(a,b){var c,d,e,f,h,i,g;c=this.connectedSlots[a];if(c===void 0)return!0;f=Array.prototype.slice.call(arguments,0);f[0]=this;c=c.slice();h=!0;for(d=0,e=c.length;d<e;d++)i=c[d],g=i.args?f.concat(i.args):f,i.func.apply(i.context,g)===!1&&(h=!1);return h};
jade.Object.prototype.sendQuery=function(a,b,c){var d,e,f,h,i;d=this.connectedSlots[a];if(d===void 0)return b;h=arguments;h[0]=this;for(e=0,f=d.length;e<f;e++)i=d[e],h[1]=i.func.apply(i.context,h);return h[1]};
jade.Object.prototype.connect=function(a,b,c,d){var e,f;if(!b)throw Error("Invalid slot for signal "+a);this.isConnected(a,b,c)||(c===void 0&&(c=window),e=this.connectedSlots[a],e===void 0&&(e=[],this.connectedSlots[a]=e),f=arguments.length>3?Array.prototype.slice.call(arguments,3):null,e.push({func:b,context:c,args:f}))};
jade.Object.prototype.disconnect=function(a,b,c){var d,e;if(a==null)this.connectedSlots={};else if(c===void 0&&(c=window),d=this.connectedSlots[a],d!==void 0)for(e=d.length-1;e>=0;e--)(!b||jade.equals(d[e].func,b)&&d[e].context==c)&&d.splice(e,1)};
jade.Object.prototype.isConnected=function(a,b,c){var d,e="";if(!a){for(e in this.connectedSlots)if(this.connectedSlots.hasOwnProperty(e))return!0;return!1}d=this.connectedSlots[a];if(!d)return!1;if(b===void 0)return d&&!!d.length;c===void 0&&(c=window);if(d===void 0)return!1;for(e=d.length-1;e>=0;e--)if(jade.equals(d[e].func,b)&&d[e].context==c)return!0;return!1};
jade.Object.getName=function(){var a;a=this.className;if(!a)a=this.displayName;if(!a)throw Error("Unable to retrieve class name from "+this);return a};
jade.Object.prototype.getClass=function(){return this.constructor};
jade.Object.getSuperclass=function(){var a;return(a=this.parentConstructor)?a:null};
