void AnimviewView::updateState() { MadsView::update(); if (!_script || _scriptDone) return; if (!_activeAnimation) { readNextCommand(); assert(_activeAnimation); } // Update the current animation _activeAnimation->update(); if (_activeAnimation->freeFlag()) { delete _activeAnimation; _activeAnimation = NULL; // Clear up current background and sprites _backgroundSurface.reset(); clearLists(); // Reset flags _startFrame = -1; readNextCommand(); // Check if script is finished if (_scriptDone) { scriptDone(); return; } } refresh(); }
BluetoothImpl::BluetoothImpl( const QString& confFile ) : state( Initialize ), configIface( 0 ), ifaceStatus( Unknown ), netSpace( 0 ), trigger( 0 ), dialupDev( 0 ), session(0), tidStateUpdate( 0 ) { qLog(Network) << "Creating BluetoothImpl instance"; configIface = new BluetoothConfig( confFile ); //update state of this interface after each script execution connect( &thread, SIGNAL(scriptDone()), this, SLOT(updateState())); }
bool AnimviewView::onEvent(M4EventType eventType, int32 param, int x, int y, bool &captureEvents) { // Wait for the Escape key or a mouse press if (((eventType == KEVENT_KEY) && (param == Common::KEYCODE_ESCAPE)) || (eventType == MEVENT_LEFT_RELEASE) || (eventType == MEVENT_RIGHT_RELEASE)) { scriptDone(); captureEvents = false; return true; } return false; }
DialupImpl::DialupImpl( const QString& confFile) : state( Initialize ), configIface(0), ifaceStatus(Unknown), tidStateUpdate(0) #ifdef QTOPIA_CELL , regState(QTelephony::RegistrationUnknown), callManager( 0 ), netReg( 0 ), pppdProcessBlocked( false ) #endif , netSpace( 0 ), delayedGatewayInstall( false ) { qLog(Network) << "Creating DialupImpl instance"; configIface = new DialupConfig( confFile ); //update state of this interface after each script execution connect( &thread, SIGNAL(scriptDone()), this, SLOT(updateState())); }
LanImpl::LanImpl( const QString& confFile) : configIface(0), ifaceStatus(Unknown) #ifndef NO_WIRELESS_LAN , roaming( 0 ), wlanRegProvider( 0 ) #endif , netSpace( 0 ), delayedGatewayInstall( false ) { if ( !devToConfig ) { devToConfig = new QMap<QString,QString>(); qAddPostRoutine(map_cleanup); } qLog(Network) << "Creating LanImpl instance"; configIface = new LANConfig( confFile ); //update state of this interface after each script execution connect( &thread, SIGNAL(scriptDone()), this, SLOT(updateState())); }
void TextviewView::updateState() { if (!_animating) return; // Only update state if wait period has expired uint32 currTime = g_system->getMillis(); // If a screen transition is in progress and it's time for another column, handle it if (_spareScreen) { byte *srcP = _spareScreen->getBasePtr(_translationX, 0); byte *destP = _bgSurface.getBasePtr(_translationX, 0); for (int y = 0; y < _bgSurface.height(); ++y, srcP += _spareScreen->width(), destP += _bgSurface.width()) { *destP = *srcP; } if (++_translationX >= _bgSurface.width()) { // Surface transition is complete delete _spareScreen; _spareScreen = NULL; _vm->_palette->deleteRange(_bgCurrent); delete _bgCurrent; _bgCurrent = _bgSpare; _bgSpare = NULL; } } // Make sure it's time for an update if (currTime < _scrollTimeout) return; _scrollTimeout = g_system->getMillis() + TEXT_ANIMATION_DELAY; // If any panning values are set, pan the background surface if ((_panX != 0) || (_panY != 0)) { if (_panCountdown > 0) { --_panCountdown; return; } // Handle horizontal panning if (_panX != 0) { byte *lineTemp = new byte[_panX]; for (int y = 0; y < _bgSurface.height(); ++y) { byte *pixelsP = _bgSurface.getBasePtr(0, y); // Copy the first X pixels into temp buffer, move the rest of the line // to the start of the line, and then move temp buffer pixels to end of line Common::copy(pixelsP, pixelsP + _panX, lineTemp); Common::copy(pixelsP + _panX, pixelsP + _bgSurface.width(), pixelsP); Common::copy(lineTemp, lineTemp + _panX, pixelsP + _bgSurface.width() - _panX); } delete[] lineTemp; } // Handle vertical panning if (_panY != 0) { // Store the bottom Y lines into a temp buffer, move the rest of the lines down, // and then copy the stored lines back to the top of the screen byte *linesTemp = new byte[_panY * _bgSurface.width()]; byte *pixelsP = _bgSurface.getBasePtr(0, _bgSurface.height() - _panY); Common::copy(pixelsP, pixelsP + _bgSurface.width() * _panY, linesTemp); for (int y = _bgSurface.height() - 1; y >= _panY; --y) { byte *destP = _bgSurface.getBasePtr(0, y); byte *srcP = _bgSurface.getBasePtr(0, y - _panY); Common::copy(srcP, srcP + _bgSurface.width(), destP); } Common::copy(linesTemp, linesTemp + _panY * _bgSurface.width(), _bgSurface.getBasePtr(0, 0)); delete[] linesTemp; } } // Scroll the text surface up by one row byte *pixelsP = _textSurface.getBasePtr(0, 0); Common::copy(pixelsP + width(), pixelsP + _textSurface.width() * _textSurface.height(), pixelsP); pixelsP = _textSurface.getBasePtr(0, _textSurface.height() - 1); Common::set_to(pixelsP, pixelsP + _textSurface.width(), _vm->_palette->BLACK); if (_scrollCount > 0) { // Handling final scrolling of text off of screen if (--_scrollCount == 0) { scriptDone(); return; } } else { // Handling a text row if (++_lineY == (_vm->_font->current()->getHeight() + TEXTVIEW_LINE_SPACING)) processLines(); } // Refresh the view int yp = (height() - _bgSurface.height()) / 2; _bgSurface.copyTo(this, 0, yp); _textSurface.copyTo(this, Common::Rect(0, 0, _textSurface.width(), _bgSurface.height()), 0, yp, _vm->_palette->BLACK); }
/** * Emit a signal when the "done" button is pressed. */ void TabPanelScript::btnScriptDoneClicked() { emit scriptDone(); }