コード例 #1
0
ファイル: qdeclarativemousearea.cpp プロジェクト: Afreeca/qt
void QDeclarativeMouseArea::setHovered(bool h)
{
    Q_D(QDeclarativeMouseArea);
    if (d->hovered != h) {
        d->hovered = h;
        emit hoveredChanged();
        d->hovered ? emit entered() : emit exited();
    }
}
コード例 #2
0
void QDeclarativeGeoMapMouseArea::exitEvent()
{
    if (!enabled_ || !hoverEnabled())
        return;

    setHovered(false);

    emit exited();
}
コード例 #3
0
ファイル: kjavaprocess.cpp プロジェクト: vasi/kdelibs
void KJavaProcess::slotExited()
{
    int status = -1;
    if ( exitStatus() == NormalExit ) {
     status = exitCode();
    }
    kDebug(6100) << "jvm exited with status " << status; 
    emit exited(status);
}
コード例 #4
0
ファイル: Track.cpp プロジェクト: jonathanhook/Waves
	void Track::spline_Exited(void)
	{
		assert(parameter != NULL);

		parameter->setValue(parameter->getDefaultValue());
		if(exited != NULL) 
		{
			exited(this);
		}
	}
コード例 #5
0
ファイル: emuthread.cpp プロジェクト: p0wer0n/firebird
void EmuThread::run()
{
    setTerminationEnabled();

    path_boot1 = boot1.c_str();
    path_flash = flash.c_str();

    int ret = emulate(port_gdb, port_rdbg);

    emit exited(ret);
}
コード例 #6
0
ファイル: main.cpp プロジェクト: chaserhkj/PKUDeanChecker
int main(int argc, char *argv[])
{
    qInstallMsgHandler(MessageHandler);
    QApplication app(argc,argv);
    app.setQuitOnLastWindowClosed(false);
    PKUDeanChecker checker;
    QObject::connect(&checker, SIGNAL(exited()),
                     &app, SLOT(quit()));
    checker.exec();
    return app.exec();
}
コード例 #7
0
void QQuickMouseArea::setHovered(bool h)
{
    Q_D(QQuickMouseArea);
    if (d->hovered != h) {
        d->hovered = h;
        emit hoveredChanged();
        d->hovered ? emit entered() : emit exited();
        if (d->pressed)
            emit containsPressChanged();
    }
}
コード例 #8
0
ファイル: actor.cpp プロジェクト: Zhouxiaoqing/libcppa
bool actor::unlink_from_impl(const actor_ptr& other) {
    guard_type guard{m_mtx};
    // remove_backlink returns true if this actor is linked to other
    if (other && !exited() && other->remove_backlink(this)) {
        auto i = std::find(m_links.begin(), m_links.end(), other);
        CPPA_REQUIRE(i != m_links.end());
        m_links.erase(i);
        return true;
    }
    return false;
}
コード例 #9
0
ファイル: stackless_coroutine.hpp プロジェクト: eile/hpx
        void rebind(Functor && f, naming::id_type && target,
            thread_id_repr_type id = 0)
        {
            HPX_ASSERT(exited());

            f_ = std::forward<Functor>(f);
            id_ = id;
#if HPX_THREAD_MAINTAIN_PHASE_INFORMATION
            phase_ = 0;
#endif
            target_ = std::move(target);
        }
コード例 #10
0
ファイル: status.hpp プロジェクト: iamnilay3/openlierox
inline
int
status::exit_status(void)
    const
{
    BOOST_ASSERT(exited());
#if defined(BOOST_PROCESS_POSIX_API)
    return WEXITSTATUS(m_flags);
#elif defined(BOOST_PROCESS_WIN32_API)
    return m_flags;
#endif
}
コード例 #11
0
/*!
 Constructor
 \param parent Parent state.
 \retval void
 */
HsPreviewHSWidgetState::HsPreviewHSWidgetState(QState *parent) :
    QState(parent),
    mEntryId(0),
    mToken(),
    mUri()
{
    setObjectName("/HsPreviewHSWidgetState");
    if (this->parent()) {
        setObjectName(this->parent()->objectName() + objectName());
    }
    connect(this, SIGNAL(exited()), SLOT(cleanUp()));
}
コード例 #12
0
ファイル: abstract_actor.cpp プロジェクト: zoujiaqing/libcppa
bool abstract_actor::unlink_from_impl(const actor_addr& other) {
    if (!other) return false;
    guard_type guard{m_mtx};
    // remove_backlink returns true if this actor is linked to other
    auto ptr = detail::raw_access::get(other);
    if (!exited() && ptr->remove_backlink(address())) {
        auto i = std::find(m_links.begin(), m_links.end(), ptr);
        CPPA_REQUIRE(i != m_links.end());
        m_links.erase(i);
        return true;
    }
    return false;
}
コード例 #13
0
ファイル: PlatformEvent.cpp プロジェクト: C4rt/edb-debugger
//------------------------------------------------------------------------------
// Name:
//------------------------------------------------------------------------------
IDebugEvent::REASON PlatformEvent:: reason() const {
	// this basically converts our value into a 'switchable' value for convenience

	if(stopped()) {
		return EVENT_STOPPED;
	} else if(terminated()) {
		return EVENT_TERMINATED;
	} else if(exited()) {
		return EVENT_EXITED;
	} else {
		return EVENT_UNKNOWN;
	}
}
コード例 #14
0
void QDeclarativeGeoMapMouseArea::setHovered(bool hovered)
{
    if (hovered_ == hovered)
        return;

    hovered_ = hovered;

    emit hoveredChanged(hovered_);

    if (hovered_)
        emit entered();
    else
        emit exited();
}
コード例 #15
0
ファイル: context_base.hpp プロジェクト: K-ballo/hpx
        // Nothrow.
        ~context_base() noexcept
        {
            HPX_ASSERT(!running());
            HPX_ASSERT(exited());
            m_thread_id.reset();
#if defined(HPX_HAVE_THREAD_LOCAL_STORAGE)
            delete_tss_storage(m_thread_data);
#else
            m_thread_data = 0;
#endif
#if defined(HPX_HAVE_APEX)
            m_apex_data = nullptr;
#endif
        }
コード例 #16
0
//------------------------------------------------------------------------------
// Name: reason() const
// Desc: what was the reason for this event
//------------------------------------------------------------------------------
DebugEvent::REASON DebugEvent::reason() const {

	// this basically converts our value into a 'switchable' value for convenience

	if(stopped()) {
		return EVENT_STOPPED;
	} else if(signaled()) {
		return EVENT_SIGNALED;
	} else if(exited()) {
		return EVENT_EXITED;
	} else {
		return EVENT_UNKNOWN;
	}
}
コード例 #17
0
//----------------------------------------------------------------------------
ctkExampleDicomHost::ctkExampleDicomHost(ctkHostedAppPlaceholderWidget* placeholderWidget, int hostPort, int appPort) :
    ctkDicomAbstractHost(hostPort, appPort),
    PlaceholderWidget(placeholderWidget),
    exitingApplication(false)
{
  connect(this,SIGNAL(appReady()),SLOT(onAppReady()));
  connect(this,SIGNAL(startProgress()),this,SLOT(onStartProgress()));
  connect(this,SIGNAL(releaseAvailableResources()),this,SLOT(onReleaseAvailableResources()));
  connect(this,SIGNAL(resumed()),this,SLOT(onResumed()));
  connect(this,SIGNAL(completed()),this,SLOT(onCompleted()));
  connect(this,SIGNAL(suspended()),this,SLOT(onSuspended()));
  connect(this,SIGNAL(canceled()),this,SLOT(onCanceled()));
  connect(this,SIGNAL(exited()),this,SLOT(onExited()));
}
コード例 #18
0
//------------------------------------------------------------------------------
// Name:
// Desc:
//------------------------------------------------------------------------------
int PlatformEvent::code() const {
	if(stopped()) {
		return event.u.Exception.ExceptionRecord.ExceptionCode;
	}

	if(terminated()) {
		return event.u.Exception.ExceptionRecord.ExceptionCode;
	}

	if(exited()) {
		return event.u.ExitProcess.dwExitCode;
	}

	return 0;
}
コード例 #19
0
ファイル: PlatformEvent.cpp プロジェクト: C4rt/edb-debugger
//------------------------------------------------------------------------------
// Name:
//------------------------------------------------------------------------------
int PlatformEvent::code() const {
	if(stopped()) {
		return WSTOPSIG(status);
	}

	if(terminated()) {
		return WTERMSIG(status);
	}

	if(exited()) {
		return WEXITSTATUS(status);
	}

	return 0;
}
コード例 #20
0
ファイル: actor.cpp プロジェクト: Zhouxiaoqing/libcppa
bool actor::link_to_impl(const actor_ptr& other) {
    if (other && other != this) {
        guard_type guard{m_mtx};
        // send exit message if already exited
        if (exited()) {
            send_as(this, other, atom("EXIT"), exit_reason());
        }
        // add link if not already linked to other
        // (checked by establish_backlink)
        else if (other->establish_backlink(this)) {
            m_links.push_back(other);
            return true;
        }
    }
    return false;
}
コード例 #21
0
ファイル: tst_status.c プロジェクト: kraj/ltp
const char *tst_strstatus(int status)
{
	if (WIFEXITED(status))
		return exited(status);

	if (WIFSIGNALED(status))
		return signaled(status);

	if (WIFSTOPPED(status))
		return "is stopped";

	if (WIFCONTINUED(status))
		return "is resumed";

	return invalid(status);
}
コード例 #22
0
/* FIXME: Qt manuals is saying this is the wrong way to create thread since version 4.x
   we better use QThreadPool or similar but for now...
 */
void SlimIncomingHandler::run()
{
    QString received;
    QTcpSocket tcpSocket;
    if (!tcpSocket.setSocketDescriptor(client))
    {
        qDebug() << "tcpSocket rip?";
        emit error();
        return ;
    }

    bExit = false;
    tcpSocket.write("Slim -- V0.3\r\n");
    while (!bExit) // todo mutex to make possible for server to force exit
    {
        if (tcpSocket.waitForReadyRead(FITNESSE_TIMEOUT))
        {
            received.append(QString(tcpSocket.readAll()));
            qDebug() << received;
            if (received.size() > 6)
            {
                SlimDeserializer dser(received);
                dser.getLength();

                CommandExecuter exe(dser.deserialize());
                QString result = exe.executeAll();
                qDebug() << "resultsend" << result.toUtf8();
                tcpSocket.write(result.toUtf8());
                // fixme failcheck
                received ="";
            }
            // FIXME... parser
            if (received.endsWith("bye")) // the later variant(\r\n) used when debugging since telnet adds \r\n
                break;
        }
        else // timeout waitForDataTimeout
        {
            // tell client to die since there were no data from fitnesse server to process
            qDebug() << "socket timeout";
            bExit = true;
        }
    }
    qDebug() << "die";
    tcpSocket.close();
    emit exited(this);
}
コード例 #23
0
int main(int argv, char **args)
{
    QApplication app(argv, args);

    QLabel *label = new QLabel;

//![0]
    QStateMachine machine;
    QState *s1 = new QState();
    QState *s2 = new QState();
    QState *s3 = new QState();
//![0]

//![4]
    s1->assignProperty(label, "text", "In state s1");
    s2->assignProperty(label, "text", "In state s2");
    s3->assignProperty(label, "text", "In state s3");
//![4]

//![5]
    QObject::connect(s3, SIGNAL(entered()), button, SLOT(showMaximized()));
    QObject::connect(s3, SIGNAL(exited()), button, SLOT(showMinimized()));
//![5]

//![1]
    s1->addTransition(button, SIGNAL(clicked()), s2);
    s2->addTransition(button, SIGNAL(clicked()), s3);
    s3->addTransition(button, SIGNAL(clicked()), s1);
//![1]

//![2]
    machine.addState(s1);
    machine.addState(s2);
    machine.addState(s3);
    machine.setInitialState(s1);
//![2]

//![3]
    machine.start();
//![3]

    label->show();

    return app.exec();
}
コード例 #24
0
bool abstract_actor::link_to_impl(const actor_addr& other) {
  if (other && other != this) {
    guard_type guard{m_mtx};
    auto ptr = actor_cast<abstract_actor_ptr>(other);
    // send exit message if already exited
    if (exited()) {
      ptr->enqueue(address(), message_id::invalid,
                   make_message(exit_msg{address(), exit_reason()}), m_host);
    }
    // add link if not already linked to other
    // (checked by establish_backlink)
    else if (ptr->establish_backlink(address())) {
      m_links.push_back(ptr);
      return true;
    }
  }
  return false;
}
コード例 #25
0
bool abstract_actor::establish_link_impl(const actor_addr& other) {
  CAF_LOG_TRACE(CAF_TSARG(other));
  if (other && other != this) {
    guard_type guard{mtx_};
    auto ptr = actor_cast<abstract_actor_ptr>(other);
    // send exit message if already exited
    if (exited()) {
      ptr->enqueue(address(), invalid_message_id,
                   make_message(exit_msg{address(), exit_reason()}), host_);
    } else if (ptr->establish_backlink(address())) {
      // add link if not already linked to other
      // (checked by establish_backlink)
      auto tmp = default_attachable::make_link(other);
      attach_impl(tmp);
      return true;
    }
  }
  return false;
}
コード例 #26
0
ファイル: abstract_actor.cpp プロジェクト: zoujiaqing/libcppa
bool abstract_actor::link_to_impl(const actor_addr& other) {
    if (other && other != this) {
        guard_type guard{m_mtx};
        auto ptr = detail::raw_access::get(other);
        // send exit message if already exited
        if (exited()) {
            ptr->enqueue({address(), ptr},
                         make_any_tuple(exit_msg{address(), exit_reason()}),
                         m_host);
        }
        // add link if not already linked to other
        // (checked by establish_backlink)
        else if (ptr->establish_backlink(address())) {
            m_links.push_back(ptr);
            return true;
        }
    }
    return false;
}
コード例 #27
0
MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::MainWindow)
{
  ui->setupUi(this);

  QString n = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])";
  ipValidator = new QRegExpValidator(QRegExp("^" + n + "\\." + n + "\\." + n + "\\." + n + "$"));
  intValidator = new QRegExpValidator(QRegExp("[0-9]+"));
  hexValidator = new QRegExpValidator(QRegExp("[0-9a-fA-F]+"));
  base64Validator = new QRegExpValidator(QRegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"));

  setIpValidator();

  machine = new QStateMachine(this);

  QState *ipToInt = new QState();
  QState *intToHex = new QState();
  QState *hexToBase64 = new QState();
  QState *base64ToHex = new QState();
  QState *hexToInt = new QState();
  QState *intToIp = new QState();

  ipToInt->addTransition(ui->pushButton, SIGNAL(clicked()), intToHex);
  intToHex->addTransition(ui->pushButton, SIGNAL(clicked()), hexToBase64);
  hexToBase64->addTransition(ui->pushButton, SIGNAL(clicked()), base64ToHex);
  base64ToHex->addTransition(ui->pushButton, SIGNAL(clicked()), hexToInt);
  hexToInt->addTransition(ui->pushButton, SIGNAL(clicked()), intToIp);
  intToIp->addTransition(ui->pushButton, SIGNAL(clicked()), ipToInt);

  QObject::connect(ipToInt, SIGNAL(exited()), this, SLOT(convertIpToInt()));
  QObject::connect(intToHex, SIGNAL(exited()), this, SLOT(convertIntToHex()));
  QObject::connect(hexToBase64, SIGNAL(exited()), this, SLOT(convertHexToBase64()));
  QObject::connect(base64ToHex, SIGNAL(exited()), this, SLOT(convertBase64ToHex()));
  QObject::connect(hexToInt, SIGNAL(exited()), this, SLOT(convertHexToInt()));
  QObject::connect(intToIp, SIGNAL(exited()), this, SLOT(convertIntToIp()));

  machine->addState(ipToInt);
  machine->addState(intToHex);
  machine->addState(hexToBase64);
  machine->addState(base64ToHex);
  machine->addState(hexToInt);
  machine->addState(intToIp);

  machine->setInitialState(ipToInt);

  machine->start();
}
コード例 #28
0
ファイル: context_base.hpp プロジェクト: K-ballo/hpx
        void rebind_base(thread_id_type id)
        {
            HPX_ASSERT(exited());

            m_thread_id = id;
            m_state = ctx_ready;
            m_exit_state = ctx_exit_not_requested;
            m_exit_status = ctx_not_exited;
#if defined(HPX_HAVE_THREAD_PHASE_INFORMATION)
            HPX_ASSERT(m_phase == 0);
#endif
#if defined(HPX_HAVE_THREAD_LOCAL_STORAGE)
            HPX_ASSERT(m_thread_data == nullptr);
#else
            HPX_ASSERT(m_thread_data == 0);
#endif
#if defined(HPX_HAVE_APEX)
            m_apex_data = rebind_base_apex(id);
#endif
            m_type_info = std::exception_ptr();
        }
コード例 #29
0
ファイル: tsh.c プロジェクト: Hkau/kth
// myhandler is responsible for cleaning up zombie processes
// will report background processes as terminated if they were
void myhandler(int signal)
{
	if(signal == SIGCHLD)
	{
		int signal;
		while(true)
		{
			pid_t pid = waitpid(-1, &signal, WNOHANG);
			if(pid <= 0)
			{
				// no zombie left to wait for
				break;
			}
			if(pid == fg_pid)
				continue;
			if(WIFEXITED(signal) || WIFSIGNALED(signal))
				exited(pid);
			// stop timer for pid;
		}
		return;
	}
}
コード例 #30
0
int dispatcher::execute( void )
{
	xcb_flush( _connection );
	_exit_code = 0;

	bool done = false;
	while ( !done )
	{
		auto event = core::wrap_cptr( xcb_wait_for_event( _connection ) );
		if ( !event )
			break;
		switch ( event->response_type & ~0x80 )
		{
			case XCB_EXPOSE:
			{
				auto *ev = reinterpret_cast<xcb_expose_event_t*>( event.get() );
				if ( ev->count == 0 )
					_windows[ev->window]->exposed();
				xcb_flush( _connection );
				break;
			}

			case XCB_CONFIGURE_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_configure_notify_event_t*>( event.get() );
				auto w = _windows[ev->window];
				if ( w->check_last_position( ev->x, ev->y ) )
					w->moved( ev->x, ev->y );
				if ( w->check_last_size( ev->width, ev->height ) )
					w->resize_canvas( ev->width, ev->height );
				break;
			}

			case XCB_DESTROY_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_destroy_notify_event_t*>( event.get() );
				auto w = _windows[ev->window];
				w->closed();
				break;
			}

			case XCB_MAP_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_map_notify_event_t*>( event.get() );
				auto w = _windows[ev->window];
				w->shown();
				w->restored();
				break;
			}

			case XCB_UNMAP_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_unmap_notify_event_t*>( event.get() );
				auto w = _windows[ev->window];
				w->hidden();
				w->minimized();
				break;
			}

			case XCB_ENTER_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_enter_notify_event_t*>( event.get() );
				auto w = _windows[ev->event];
				w->entered();
				break;
			}

			case XCB_LEAVE_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_leave_notify_event_t*>( event.get() );
				auto w = _windows[ev->event];
				w->exited();
				break;
			}

			case XCB_KEY_PRESS:
			{
				auto *ev = reinterpret_cast<xcb_key_press_event_t*>( event.get() );
				auto w = _windows[ev->event];
				platform::scancode sc = _keyboard->get_scancode( ev->detail );
				w->key_pressed( _keyboard, sc );
				break;
			}

			case XCB_KEY_RELEASE:
			{
				auto *ev = reinterpret_cast<xcb_key_press_event_t*>( event.get() );
				auto w = _windows[ev->event];
				platform::scancode sc = _keyboard->get_scancode( ev->detail );
				w->key_released( _keyboard, sc );
				break;
			}

			case XCB_MAPPING_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_mapping_notify_event_t*>( event.get() );
				if ( ev->request == XCB_MAPPING_MODIFIER || ev->request == XCB_MAPPING_KEYBOARD )
					_keyboard->update_mapping();
				break;
			}

			case XCB_BUTTON_PRESS:
			{
				auto *ev = reinterpret_cast<xcb_button_press_event_t*>( event.get() );
				auto w = _windows[ev->event];
				switch ( ev->detail )
				{
					case 1:
					case 2:
					case 3:
						w->mouse_pressed( _mouse, { double(ev->event_x), double(ev->event_y) }, ev->detail );
						break;

					case 4: // Mouse wheel up
					case 5: // Mouse wheel down
						break;
				}
				break;
			}

			case XCB_BUTTON_RELEASE:
			{
				auto *ev = reinterpret_cast<xcb_button_press_event_t*>( event.get() );
				auto w = _windows[ev->event];
				switch ( ev->detail )
				{
					case 1:
					case 2:
					case 3:
						w->mouse_released( _mouse, { double(ev->event_x), double(ev->event_y) }, ev->detail );
						break;

					case 4: // Mouse wheel up
					case 5: // Mouse wheel down
						break;
				}
				break;
			}

			case XCB_MOTION_NOTIFY:
			{
				auto *ev = reinterpret_cast<xcb_motion_notify_event_t*>( event.get() );
				auto w = _windows[ev->event];
				w->mouse_moved( _mouse, { double(ev->event_x), double(ev->event_y) } );
				break;
			}

			case XCB_VISIBILITY_NOTIFY:
			case XCB_REPARENT_NOTIFY:
				break;

			case XCB_CLIENT_MESSAGE:
			{
				auto *ev = reinterpret_cast<xcb_client_message_event_t*>( event.get() );
				if ( ev->data.data32[0] == _atom_delete_window )
				{
					auto w = _windows[ev->window];
					w->hide();
					_windows.erase( w->id() );
					done = _windows.empty();
				}
				break;
			}

			default:
				std::cout << "Unknown event: " << uint32_t( event->response_type & ~0x80 ) << ' ' << uint32_t( event->response_type ) << std::endl;
		}
	}

	return _exit_code;
}