Menu.prototype._resolveMenu = function(clear, pushing) { var sections = this._getSections(this); if (this === WindowStack.top()) { simply.impl.menu(this.state, clear, pushing); return true; } };
Wakeup.cancel = function(id) { if (id === 'all') { this.state.wakeups = {}; } else { delete this.state.wakeups[id]; } simply.impl.wakeupCancel(id); };
StageElement.prototype._prop = function(elementDef) { if (!this.state.position) { this.state.position = new Vector2(); } if (!this.state.size) { this.state.size = new Vector2(); } if (this.parent === WindowStack.top()) { simply.impl.stageElement(this._id(), this._type(), elementDef); } };
imagelib.load(image, function() { simply.impl.image(image.id, image.gbitmap); if (callback) { var e = { type: 'image', image: image.id, url: image.url, }; callback(e); } });
Menu.prototype.selection = function(callback_or_sectionIndex, itemIndex) { if (typeof callback_or_sectionIndex === 'function') { this._selections.push(callback); simply.impl.menuSelection(); } else { this._selection = { sectionIndex: callback_or_sectionIndex, itemIndex: itemIndex }; this._select(); } };
Wakeup.schedule = function(opt, callback) { if (typeof opt !== 'object' || opt instanceof Date) { opt = { time: opt }; } var cookie = opt.cookie || 0; this._setRequests.push({ params: opt, data: opt.data, callback: callback, }); simply.impl.wakeupSet(opt.time, cookie, opt.notifyIfMissed); };
Accel.config = function(opt, auto) { if (arguments.length === 0) { return { rate: state.rate, samples: state.samples, subscribe: state.subscribe, }; } else if (typeof opt === 'boolean') { opt = { subscribe: opt }; } for (var k in opt) { if (k === 'subscribe') { state.subscribeMode = opt[k] && !auto ? 'manual' : 'auto'; } state[k] = opt[k]; } return simply.impl.accelConfig(Accel.config()); };
Window.prototype._buttonConfig = function(buttonConf, auto) { if (buttonConf === undefined) { var config = {}; for (var i = 0, ii = buttons.length; i < ii; ++i) { var name = buttons[i]; config[name] = this._button.config[name]; } return config; } for (var k in buttonConf) { if (buttons.indexOf(k) !== -1) { if (k === 'back') { this._button.configMode = buttonConf.back && !auto ? 'manual' : 'auto'; } this._button.config[k] = buttonConf[k]; } } if (simply.impl.windowButtonConfig) { return simply.impl.windowButtonConfig(this._button.config); } };
Window.prototype._hide = function(broadcast) { if (broadcast === false) { return; } simply.impl.windowHide(this._id()); };
Window.prototype._action = function(actionDef) { if (this === WindowStack.top()) { simply.impl.windowActionBar(actionDef); } };
Menu.prototype.selection = function(callback) { this._selections.push(callback); simply.impl.menuSelection(); };
Menu.prototype._show = function() { this._resolveMenu(); Window.prototype._show.apply(this, arguments); var select = this._selection; simply.impl.menuSelection(select.sectionIndex, select.itemIndex); };
Window.prototype._status = function(statusDef) { if (this === WindowStack.top()) { simply.impl.windowStatusBar(statusDef); } };
Light.auto = function() { simply.impl.light('auto'); };
this.launch(function() { simply.impl.wakeupSet(opt.time, cookie, opt.notifyIfMissed); });
Light.on = function() { simply.impl.light('on'); };
StageElement.prototype._prop = function(elementDef) { if (this.parent === WindowStack.top()) { simply.impl.stageElement(this._id(), this._type(), this.state); } };
Vibe.vibrate = function(type) { simply.impl.vibe(type); };
StageElement.prototype._animate = function(animateDef, duration) { if (this.parent === WindowStack.top()) { simply.impl.stageAnimate(this._id(), this.state, animateDef, duration || 400, animateDef.easing || 'easeInOut'); } };
Menu.prototype._select = function() { if (this === WindowStack.top()) { var select = this._selection; simply.impl.menuSelection(select.sectionIndex, select.itemIndex); } };
Light.trigger = function() { simply.impl.light('trigger'); };