void EditorScreen::deleteString()
{
  if (_lines.count())
  {
    TextLine &textLine = _lines[_cursorLineIndex];
    if (textLine.cursorCanMoveRight(_cursorOffset))
    {
      textLine.removeAt(textLine.entityAt(_cursorOffset));
      feedScreen();
      emit screenChanged();
    } else if (_cursorLineIndex < _lines.count() - 1)
    {
      if (textLine.isBreakerEndedLine())
        textLine.removeLast();

      // Stick the next line to the previous one
      const TextLine &nextLine = _lines[_cursorLineIndex + 1];
      textLine << nextLine;

      _lines.removeAt(_cursorLineIndex + 1);
      feedScreen();
      emit screenChanged();
    }
  }
  restartBlink();
}
void EditorScreen::moveCursor(int newLineIndex, int newOffset, bool *scrolled)
{
  int line = 0;
  int col = 0;

  bool done = false;
  while (newLineIndex < _topLineIndex || (newLineIndex == _topLineIndex && newOffset / 16 < _topLineSubIndex))
    if (scrollUp())
      done = true;
    else
      break;

  if (done)
  {
    feedScreen();
    emit screenChanged();
    if (scrolled)
      *scrolled = true;
  }

  for (int index = _topLineIndex; index < newLineIndex; ++index)
  {
    const TextLine &textLine = _lines[index];
    line += textLine.rowCount();
    if (index == _topLineIndex)
      line -= _topLineSubIndex;
  }

  line += newOffset / 16;

  if (newLineIndex == _topLineIndex)
    line -= _topLineSubIndex;

  col = newOffset % 16;

  // Must scroll down?
  done = false;
  for (int i = 0; i < line - 7; i++)
    if (scrollDown())
      done = true;
    else
      break;

  if (done)
  {
    line = 7;
    if (scrolled)
      *scrolled = true;
    feedScreen();
    emit screenChanged();
  }

  TextScreen::moveCursor(col, line);

  _cursorLineIndex = newLineIndex;
  _cursorOffset = newOffset;
}
Exemple #3
0
void Toplevel::checkScreen()
{
    if (screens()->count() == 1) {
        if (m_screen != 0) {
            m_screen = 0;
            emit screenChanged();
        }
        return;
    }
    const int s = screens()->number(geometry().center());
    if (s != m_screen) {
        m_screen = s;
        emit screenChanged();
    }
}
void DashClient::slotScreenChanged(int screen)
{
    if (screen != m_screen) {
        m_screen = screen;
        Q_EMIT screenChanged(screen);
    }
}
Exemple #5
0
void QMLOutput::setScreen(QMLScreen *screen)
{
    Q_ASSERT(m_screen == 0);

    m_screen = screen;
    Q_EMIT screenChanged();
}
void EditorScreen::writeEntity(int entity)
{
  bool breaker = entity == (int) LCDChar_RBTriangle;
  int newCursorLineIndex = breaker ? _cursorLineIndex + 1 : _cursorLineIndex;
  int newCursorOffset = breaker ? 0 : _cursorOffset + entityToChars((LCDOperator) entity).count();
  if (!_lines.count())
  {
    _lines << TextLine(entity);
    if (breaker)
      _lines << TextLine();
  } else
  {
    TextLine &textLine = _lines[_cursorLineIndex];

    if (_cursorOffset >= textLine.charLength())
    {
      textLine << entity;

      // Append the next line if new char is not a breaker and we aren't in insert mode
      if (!breaker && !_insertMode && _cursorLineIndex < _lines.count() - 1)
      {
        textLine << _lines[_cursorLineIndex + 1];
        _lines.removeAt(_cursorLineIndex + 1);
      } else if (breaker)
        _lines << TextLine();
    }
    else
    {
      // Get LCDString under the cursor
      int index = textLine.entityAt(_cursorOffset);
      if (index >= 0)
      {
        if (_insertMode)
          textLine.insert(index, entity);
        else
          textLine[index] = entity;
      }
      if (breaker && _cursorOffset < textLine.charLength() - 1)
      {
        // Insert a new line
        TextLine newLine;
        for (int i = index + 1; i < textLine.count(); ++i)
          newLine << textLine[i];
        _lines.insert(_cursorLineIndex + 1, newLine);
        // Remove the last entities in <textLine>
        int newCount = textLine.count() - index - 1;
        for (int i = 0; i < newCount; ++i)
          textLine.removeLast();
      }
    }
  }

  feedScreen();

  emit screenChanged();
  moveCursor(newCursorLineIndex, newCursorOffset);
  restartBlink();
}
void EditorScreen::initTopLineIndex()
{
  _editZoneTopLineIndex = 0;
  _topLineIndex = 0;
  _topLineSubIndex = 0;

  feedScreen();
  emit screenChanged();
}
Exemple #8
0
void UnitsAttached::windowChanged(QQuickWindow *window)
{
    if (m_window)
        disconnect(m_window, &QQuickWindow::screenChanged, this, &UnitsAttached::screenChanged);

    m_window = window;
    screenChanged(window ? window->screen() : nullptr);

    if (window)
        connect(window, &QQuickWindow::screenChanged, this, &UnitsAttached::screenChanged);
}
void
ScreenInfo::setScreen(int screen)
{
    if (m_screen != screen) {
        m_screen = screen;
        Q_EMIT screenChanged(m_screen);
        Q_EMIT geometryChanged(geometry());
        Q_EMIT availableGeometryChanged(availableGeometry());
        Q_EMIT panelsFreeGeometryChanged(panelsFreeGeometry());
    }
}
Exemple #10
0
int CrFbDisplayWindow::FramebufferChanged(struct CR_FRAMEBUFFER *pFb)
{
    int rc = CrFbDisplayBase::FramebufferChanged(pFb);
    if (!RT_SUCCESS(rc))
    {
        WARN(("err"));
        return rc;
    }

    return screenChanged();
}
// Set new screen
void Window::setScreen(QWidget* widget)
{
    // Make sure the pointer is valid first
    if(!widget) return;

    // Make sure screen exists in stack first, if not then add it
    if(ui->screenStack->indexOf(widget) == -1) ui->screenStack->addWidget(widget);

    // Add this screen as the previous screen
    switchBackScreen = getScreen();

    // Now switch and notify of switch
    ui->screenStack->setCurrentWidget(widget);
    emit screenChanged(widget);
}
void AsemanWindowDetails::setWindow(QWindow *window)
{
    if(p->window == window)
        return;

    if(p->window)
        disconnect(p->window, &QWindow::screenChanged, this, &AsemanWindowDetails::screenChanged);

    p->window = window;
    if(p->window)
        connect(p->window, &QWindow::screenChanged, this, &AsemanWindowDetails::screenChanged);

    Q_EMIT windowChanged();
    Q_EMIT screenChanged();
}
Exemple #13
0
void EditorScreen::carriageReturn()
{
  bool insertion = false;
  if (_insertMode)
  {
    insertion = true;
    if (!_lines.count())
      _lines << TextLine();
    else
    {
      TextLine &textLine = _lines[_cursorLineIndex];
      if (_cursorOffset < textLine.charLength())
      {
        TextLine newTextLine;
        int toRemove = 0;
        int strIndex = textLine.entityAt(_cursorOffset);
        for (int i = strIndex; i < textLine.count(); ++i)
        {
          newTextLine << textLine[i];
          toRemove++;
        }
        _lines.insert(_cursorLineIndex + 1, newTextLine);

        while (toRemove)
        {
          textLine.removeLast();
          toRemove--;
        }
      } else if (_cursorLineIndex < _lines.count() - 1)
        _lines.insert(_cursorLineIndex + 1, TextLine());
      else
        _lines << TextLine();
    }
  } else if (_cursorLineIndex >= _lines.count() - 1)
  {
    _lines << TextLine();
    insertion = true;
  }

  if (insertion)
    feedScreen();

  bool scrolled;
  moveCursor(_cursorLineIndex + 1, 0, &scrolled); // Go to the next line
  if (scrolled || insertion)
    emit screenChanged();
  restartBlink();
}
Exemple #14
0
UnitsAttached::UnitsAttached(QObject *attachee)
        : QObject(attachee), m_screen(nullptr), m_window(nullptr), m_dpi(0), m_multiplier(1)
{
    m_attachee = qobject_cast<QQuickItem *>(attachee);

    if (m_attachee) {
        if (m_attachee->window()) // It might not be assigned to a window yet
            windowChanged(m_attachee->window());
    } else {
        QQuickWindow *window = qobject_cast<QQuickWindow *>(attachee);
        if (window)
            windowChanged(window);
    }

    if (!m_screen)
        screenChanged(QGuiApplication::primaryScreen());
}
void VirtualKeyboardGUI::mainLoop() {
	Common::EventManager *eventMan = _system->getEventManager();

	while (_displaying) {
		if (_kbd->_keyQueue.hasStringChanged())
			updateDisplay();
		animateCaret();
		animateCursor();
		redraw();
		_system->updateScreen();
		Common::Event event;
		while (eventMan->pollEvent(event)) {
			switch (event.type) {
			case Common::EVENT_LBUTTONDOWN:
				if (_kbdBound.contains(event.mouse)) {
					_kbd->handleMouseDown(event.mouse.x - _kbdBound.left,
										  event.mouse.y - _kbdBound.top);
				}
				break;
			case Common::EVENT_LBUTTONUP:
				if (_kbdBound.contains(event.mouse)) {
					_kbd->handleMouseUp(event.mouse.x - _kbdBound.left,
										event.mouse.y - _kbdBound.top);
				}
				break;
			case Common::EVENT_MOUSEMOVE:
				if (_drag)
					move(event.mouse.x - _dragPoint.x,
						event.mouse.y - _dragPoint.y);
				break;
			case Common::EVENT_SCREEN_CHANGED:
				screenChanged();
				break;
			case Common::EVENT_QUIT:
				_system->quit();
				return;
			default:
				break;
			}
		}
		// Delay for a moment
		_system->delayMillis(10);
	}
}
Exemple #16
0
void IniReader::setScreen(const QString &s){settings.insert("screen",s);emit screenChanged();}
Exemple #17
0
void IniReader::finished()
{
    settings=watcher->result();
    emit readConfigChanged();
    emit writeConfigChanged();
    emit romPathChanged();
    emit hashPathChanged();
    emit samplePathChanged();
    emit artPathChanged();
    emit ctrlrPathChanged();
    emit iniPathChanged();
    emit fontPathChanged();
    emit cheatPathChanged();
    emit crosshairPathChanged();
    emit cfgDirChanged();
    emit nvramDirChanged();
    emit inputDirChanged();
    emit stateDirChanged();
    emit snapshotDirChanged();
    emit diffDirChanged();
    emit commentDirChanged();
    emit stateChanged();
    emit autoSaveChanged();
    emit playbackChanged();
    emit recordChanged();
    emit mngWriteChanged();
    emit aviWriteChanged();
    emit wavWriteChanged();
    emit snapNameChanged();
    emit snapSizeChanged();
    emit snapViewChanged();
    emit snapBilinearChanged();
    emit stateNameChanged();
    emit burninChanged();
    emit autoFrameSkipChanged();
    emit frameSkipChanged();
    emit secondsToRunChanged();
    emit throttleChanged();
    emit sleepChanged();
    emit speedChanged();
    emit refreshSpeedChanged();
    emit rotateChanged();
    emit rorChanged();
    emit rolChanged();
    emit autoRorChanged();
    emit autoRolChanged();
    emit flipXChanged();
    emit flipYChanged();
    emit artworkCropChanged();
    emit useBackdropsChanged();
    emit useOverlaysChanged();
    emit useBezelsChanged();
    emit useCPanelsChanged();
    emit useMarqueesChanged();
    emit brightnessChanged();
    emit contrastChanged();
    emit gammaChanged();
    emit effectChanged();
    emit beamChanged();
    emit flickerChanged();
    emit sampleRateChanged();
    emit samplesChanged();
    emit volumeChanged();
    emit coinLockoutChanged();
    emit ctrlrChanged();
    emit mouseChanged();
    emit joystickChanged();
    emit lightgunChanged();
    emit multiKeyboardChanged();
    emit multiMouseChanged();
    emit steadyKeyChanged();
    emit uiActiveChanged();
    emit offScreenReloadChanged();
    emit joystickMapChanged();
    emit joystickDeadzoneChanged();
    emit joystickSaturationChanged();
    emit naturalChanged();
    emit joystickContradictoryChanged();
    emit coinImpulseChanged();
    emit paddleDeviceChanged();
    emit adstickDeviceChanged();
    emit pedalDeviceChanged();
    emit dialDeviceChanged();
    emit trackballDeviceChanged();
    emit lightgunDeviceChanged();
    emit positionalDeviceChanged();
    emit mouseDeviceChanged();
    emit verboseChanged();
    emit logChanged();
    emit osLogChanged();
    emit debugChanged();
    emit updateInPauseChanged();
    emit debugScriptChanged();
    emit sdlVideoFPSChanged();
    emit commLocalHostChanged();
    emit commLocalPortChanged();
    emit commRemoteHostChanged();
    emit commRemotePortChanged();
    emit antiAliasChanged();
    emit drcChanged();
    emit drcUseCChanged();
    emit drcLogUMLChanged();
    emit drcLogNativeChanged();
    emit biosChanged();
    emit cheatChanged();
    emit skipGameInfoChanged();
    emit uiFontChanged();
    emit ramSizeChanged();
    emit confirmQuitChanged();
    emit uiMouseChanged();
    emit autoBootCommandChanged();
    emit autoBootDelayChanged();
    emit autoBootScriptChanged();
    emit httpChanged();
    emit httpPortChanged();
    emit httpPathChanged();
    emit consoleChanged();
    emit multiThreadingChanged();
    emit numProcessorsChanged();
    emit videoChanged();
    emit numScreensChanged();
    emit windowChanged();
    emit maximizeChanged();
    emit keepAspectChanged();
    emit unevenStretchChanged();
    emit waitVSyncChanged();
    emit syncRefreshChanged();
    emit screenChanged();
    emit aspectChanged();
    emit resolutionChanged();
    emit viewChanged();
    emit switchResChanged();
    emit filterChanged();
    emit prescaleChanged();
    emit glForcePow2TextureChanged();
    emit glNoTextureRectChanged();
    emit glVboChanged();
    emit glPboChanged();
    emit glGlslChanged();
    emit glGlslFilterChanged();
    emit soundChanged();
    emit audioLatencyChanged();
    emit centerHChanged();
    emit centerVChanged();
    emit scaleModeChanged();
    emit useAllHeadsChanged();
    emit keymapChanged();
    emit keymapFileChanged();
    emit sixAxisChanged();
    emit videoDriverChanged();
    emit renderDriverChanged();
    emit audioDriverChanged();
    emit glLibChanged();
}
void VirtualKeyboardGUI::checkScreenChanged() {
	if (_lastScreenChanged != _system->getScreenChangeID())
		screenChanged();
}