function widget_base (instance, widget) { "use strict"; widget.Base = instance.Widget.extend({ size: { width: 0, height: 0 }, position: { x: 0, y: 0 }, init: function (parent, size, position) { this._super(parent); this.size = size || this.size; this.position = position || this.position; }, start: function () { console.log('Widget started'); }, getSize: function () { return this.size; }, getWidth: function () { return this.getSize().width; }, getHeight: function () { return this.getSize().height; }, getPosition: function () { return this.position; }, getPositionX: function () { return this.getPosition().x; }, getPositionY: function () { return this.getPosition().y; }, setSize: function (width, height) { this.size.width = width; this.size.height = height; }, setWidth: function (width) { this.size.width = width; }, setHeight: function (height) { this.size.height = height; }, setPosition: function (x, y) { this.position.x = x; this.position.y = y; }, setPositionX: function (x) { this.position.x = x; }, setPositionY: function (y) { this.position.y = y; } }); }