當前位置: 首頁>>代碼示例>>C++>>正文


C++ EventType函數代碼示例

本文整理匯總了C++中EventType函數的典型用法代碼示例。如果您正苦於以下問題:C++ EventType函數的具體用法?C++ EventType怎麽用?C++ EventType使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了EventType函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: HideText

void CDisplayText::HideText(bool bHide)
{
    Ui::CWindow*    pw;
    Ui::CGroup*     pg;
    Ui::CLabel*     pl;
    Ui::CButton*    pb;
    int         i;

    m_bHide = bHide;

    pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
    if ( pw == 0 )  return;

    for ( i=0 ; i<MAXDTLINE ; i++ )
    {
        pg = static_cast<Ui::CGroup*>(pw->SearchControl(EventType(EVENT_DT_GROUP0+i)));
        if ( pg != 0 )
        {
            pg->SetState(STATE_VISIBLE, !bHide);
        }

        pl = static_cast<Ui::CLabel*>(pw->SearchControl(EventType(EVENT_DT_LABEL0+i)));
        if ( pl != 0 )
        {
            pl->SetState(STATE_VISIBLE, !bHide);
        }

        pb = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i)));
        if ( pb != 0 )
        {
            pb->SetState(STATE_VISIBLE, !bHide);
        }
    }
}
開發者ID:Insolita,項目名稱:colobot,代碼行數:34,代碼來源:displaytext.cpp

示例2: RestoreRegisterEvent

void RestoreRegisterEvent(int event_type, const char *name, TimedCallback callback)
{
	if (event_type >= (int) event_types.size())
		event_types.resize(event_type + 1, EventType(AntiCrashCallback, "INVALID EVENT"));

	event_types[event_type] = EventType(callback, name);
}
開發者ID:ChrisAldama,項目名稱:ppsspp,代碼行數:7,代碼來源:CoreTiming.cpp

示例3: EventType

// ----------------------------------------------------------------------
void EventInputQueue::push_KeyboardSpecialEventCallback(OSObject* target,
                                                        unsigned int eventType,
                                                        unsigned int flags,
                                                        unsigned int key,
                                                        unsigned int flavor,
                                                        UInt64 guid,
                                                        bool repeat,
                                                        AbsoluteTime ts,
                                                        OSObject* sender,
                                                        void* refcon) {
  GlobalLock::ScopedLock lk;
  if (!lk) return;

  Params_KeyboardSpecialEventCallback::log(true, EventType(eventType), Flags(flags), ConsumerKeyCode(key), flavor, guid, repeat);

  // ------------------------------------------------------------
  Params_KeyboardSpecialEventCallback params(EventType(eventType),
                                             Flags(flags),
                                             ConsumerKeyCode(key),
                                             flavor, guid, repeat);

  // ------------------------------------------------------------
  IOHIKeyboard* device = OSDynamicCast(IOHIKeyboard, sender);
  if (!device) return;

  ListHookedConsumer::Item* item = static_cast<ListHookedConsumer::Item*>(ListHookedConsumer::instance().get(device));
  if (!item) return;

  // ------------------------------------------------------------
  // Device Hacks

  // Drop events if "Disable an internal keyboard while external keyboards are connected" is enabled.
  if (Config::get_essential_config(BRIDGE_ESSENTIAL_CONFIG_INDEX_general_disable_internal_keyboard_if_external_keyboard_exsits)) {
    if (item->isInternalDevice() &&
        ListHookedKeyboard::instance().isExternalDevicesConnected()) {
      return;
    }
  }

  // ------------------------------------------------------------
  CommonData::setcurrent_ts(ts);

  // ------------------------------------------------------------
  // Because we handle the key repeat ourself, drop the key repeat by hardware.
  if (repeat) return;

  // ------------------------------------------------------------
  bool retainFlagStatusTemporaryCount = false;
  enqueue_(params, retainFlagStatusTemporaryCount, item->getDeviceIdentifier());

  setTimer();
}
開發者ID:piaowenjie,項目名稱:Karabiner,代碼行數:53,代碼來源:EventInputQueue.cpp

示例4: ClearText

void CDisplayText::ClearText()
{
    Ui::CWindow* pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));

    for (int i = 0; i < MAXDTLINE; i++)
    {
        if (pw != nullptr)
        {
            pw->DeleteControl(EventType(EVENT_DT_GROUP0+i));
            pw->DeleteControl(EventType(EVENT_DT_LABEL0+i));
            pw->DeleteControl(EventType(EVENT_DT_VISIT0+i));
        }

        m_textLines[i] = TextLine();
    }
}
開發者ID:colobot,項目名稱:colobot,代碼行數:16,代碼來源:displaytext.cpp

示例5: wxCHECK_RET

void CDownloadQueue::AddDownload(CPartFile* file, bool paused, uint8 category)
{
	wxCHECK_RET(!IsFileExisting(file->GetFileHash()), wxT("Adding duplicate part-file"));

	if (file->GetStatus(true) == PS_ALLOCATING) {
		file->PauseFile();
	} else if (paused && GetFileCount()) {
		file->StopFile();
	}

	{
		wxMutexLocker lock(m_mutex);
		m_filelist.push_back( file );
		DoSortByPriority();
	}

	NotifyObservers( EventType( EventType::INSERTED, file ) );
	if (category < theApp->glob_prefs->GetCatCount()) {
		file->SetCategory(category);
	} else {
		AddDebugLogLineN( logDownloadQueue, wxT("Tried to add download into invalid category.") );
	}
	Notify_DownloadCtrlAddFile( file );
	theApp->searchlist->UpdateSearchFileByHash(file->GetFileHash()); 	// Update file in the search dialog if it's still open
	AddLogLineC(CFormat(_("Downloading %s")) % file->GetFileName() );
}
開發者ID:windreamer,項目名稱:amule-dlp,代碼行數:26,代碼來源:DownloadQueue.cpp

示例6: _

void CServerList::RemoveServer(CServer* in_server)
{
	if (in_server == theApp->serverconnect->GetCurrentServer()) {
		theApp->ShowAlert(_("You are connected to the server you are trying to delete. please disconnect first."), _("Info"), wxOK);	
	} else {
		CInternalList::iterator it = std::find(m_servers.begin(), m_servers.end(), in_server);
		if ( it != m_servers.end() ) {
			if (theApp->downloadqueue->GetUDPServer() == in_server) {
				theApp->downloadqueue->SetUDPServer( 0 );
			}	
			
			NotifyObservers( EventType( EventType::REMOVED, in_server ) );
		
			if (m_serverpos == it) {
				++m_serverpos;
			}
			if (m_statserverpos == it) {
				++m_statserverpos;
			}
			m_servers.erase(it);
			theStats::DeleteServer();
			
			Notify_ServerRemove(in_server);
			delete in_server;
		}
	}
}
開發者ID:donkey4u,項目名稱:donkeyseed,代碼行數:27,代碼來源:ServerList.cpp

示例7: applyConfiguration

void RuleWidget::applyConfiguration(void)
{
	try
	{
		Rule *rule=nullptr;
		unsigned count, i;

		startConfiguration<Rule>();

		rule=dynamic_cast<Rule *>(this->object);
		rule->setEventType(EventType(event_cmb->currentText()));
		rule->setExecutionType(ExecutionType(exec_type_cmb->currentText()));
		rule->setConditionalExpression(cond_expr_txt->toPlainText().toUtf8());
		rule->removeCommands();

		count=commands_tab->getRowCount();

		for(i=0; i < count; i++)
			rule->addCommand(commands_tab->getCellText(i,0).toUtf8());

		BaseObjectWidget::applyConfiguration();
		finishConfiguration();
	}
	catch(Exception &e)
	{
		cancelConfiguration();
		throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e);
	}
}
開發者ID:inghumberto,項目名稱:pgmodeler,代碼行數:29,代碼來源:rulewidget.cpp

示例8: DoState

void DoState(PointerWrap &p)
{
	std::lock_guard<std::recursive_mutex> lk(externalEventSection);

	auto s = p.Section("CoreTiming", 1, 2);
	if (!s)
		return;

	int n = (int) event_types.size();
	p.Do(n);
	// These (should) be filled in later by the modules.
	event_types.resize(n, EventType(AntiCrashCallback, "INVALID EVENT"));

	p.DoLinkedList<BaseEvent, GetNewEvent, FreeEvent, Event_DoState>(first, (Event **) NULL);
	p.DoLinkedList<BaseEvent, GetNewTsEvent, FreeTsEvent, Event_DoState>(tsFirst, &tsLast);

	p.Do(CPU_HZ);
	p.Do(slicelength);
	p.Do(globalTimer);
	p.Do(idledCycles);

	if (s >= 2) {
		p.Do(lastGlobalTimeTicks);
		p.Do(lastGlobalTimeUs);
	} else {
		lastGlobalTimeTicks = 0;
		lastGlobalTimeUs = 0;
	}
}
開發者ID:18859966862,項目名稱:ppsspp,代碼行數:29,代碼來源:CoreTiming.cpp

示例9: GetTracepointEventTypes

static const std::vector<EventType> GetTracepointEventTypes() {
  std::vector<EventType> result;
  const std::string tracepoint_dirname = "/sys/kernel/debug/tracing/events";
  std::vector<std::string> system_dirs;
  GetEntriesInDir(tracepoint_dirname, nullptr, &system_dirs);
  for (auto& system_name : system_dirs) {
    std::string system_path = tracepoint_dirname + "/" + system_name;
    std::vector<std::string> event_dirs;
    GetEntriesInDir(system_path, nullptr, &event_dirs);
    for (auto& event_name : event_dirs) {
      std::string id_path = system_path + "/" + event_name + "/id";
      std::string id_content;
      if (!android::base::ReadFileToString(id_path, &id_content)) {
        continue;
      }
      char* endptr;
      uint64_t id = strtoull(id_content.c_str(), &endptr, 10);
      if (endptr == id_content.c_str()) {
        LOG(DEBUG) << "unexpected id '" << id_content << "' in " << id_path;
        continue;
      }
      result.push_back(EventType(system_name + ":" + event_name, PERF_TYPE_TRACEPOINT, id));
    }
  }
  std::sort(result.begin(), result.end(),
            [](const EventType& type1, const EventType& type2) { return type1.name < type2.name; });
  return result;
}
開發者ID:AOSP-JF-MM,項目名稱:platform_system_extras,代碼行數:28,代碼來源:event_type.cpp

示例10: setType

void MidiEventBase::read(Xml& xml)
{
	setType(Note);
	a = 0;
	b = 0;
	c = 0;

	int dataLen = 0;
	for (;;)
	{
		Xml::Token token = xml.parse();
		const QString& tag = xml.s1();
		switch (token)
		{
			case Xml::Error:
			case Xml::End:
				return;
			case Xml::TagStart:
				xml.unknown("Event");
				break;
			case Xml::Text:
			{
				QByteArray ba = tag.toLatin1();
				const char*s = ba.constData();
				edata.data = new unsigned char[dataLen];
				edata.dataLen = dataLen;
				unsigned char* d = edata.data;
				for (int i = 0; i < dataLen; ++i)
				{
					char* endp;
					*d++ = strtol(s, &endp, 16);
					s = endp;
				}
			}
				break;
			case Xml::Attribut:
				if (tag == "tick")
					setTick(xml.s2().toInt());
				else if (tag == "type")
					setType(EventType(xml.s2().toInt()));
				else if (tag == "len")
					setLenTick(xml.s2().toInt());
				else if (tag == "a")
					a = xml.s2().toInt();
				else if (tag == "b")
					b = xml.s2().toInt();
				else if (tag == "c")
					c = xml.s2().toInt();
				else if (tag == "datalen")
					dataLen = xml.s2().toInt();
				break;
			case Xml::TagEnd:
				if (tag == "event")
					return;
			default:
				break;
		}
	}
}
開發者ID:87maxi,項目名稱:oom,代碼行數:59,代碼來源:midievent.cpp

示例11: RemoveLocalServerRequest

void CDownloadQueue::RemoveFile(CPartFile* file)
{
	RemoveLocalServerRequest( file );

	NotifyObservers( EventType( EventType::REMOVED, file ) );

	wxMutexLocker lock( m_mutex );

	EraseValue( m_filelist, file );
}
開發者ID:dreamerc,項目名稱:amule,代碼行數:10,代碼來源:DownloadQueue.cpp

示例12: NotifyObservers

void CServerList::ObserverAdded( ObserverType* o )
{
	CObservableQueue<CServer*>::ObserverAdded( o );

	EventType::ValueList ilist;
	ilist.reserve( m_servers.size() );
	ilist.assign( m_servers.begin(), m_servers.end() );

	NotifyObservers( EventType( EventType::INITIAL, &ilist ), o );
}
開發者ID:donkey4u,項目名稱:donkeyseed,代碼行數:10,代碼來源:ServerList.cpp

示例13: compute

   /** Method that computes the result for the smoothing. */
	void compute( Measurement::Timestamp t )
	{
		if( !m_init ){
			m_mean = *( m_inPort.get() );
			m_init = true;
		}
		else
			m_mean = (  m_alpha * ( *( m_inPort.get() ) )  ) + ( ( 1. - m_alpha ) * m_mean );
			
		LOG4CPP_TRACE( logger, "exponential smoothing: " << m_mean );
		m_outPort.send( EventType( t, m_mean ) );
	}
開發者ID:Killerregenwurm,項目名稱:utcomponents,代碼行數:13,代碼來源:ExponentialSmoothing.cpp

示例14: ClearText

void CDisplayText::ClearText()
{
    Ui::CWindow*    pw;
    int         i;

    pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));

    for ( i=0 ; i<MAXDTLINE ; i++ )
    {
        if ( pw != 0 )
        {
            pw->DeleteControl(EventType(EVENT_DT_GROUP0+i));
            pw->DeleteControl(EventType(EVENT_DT_LABEL0+i));
            pw->DeleteControl(EventType(EVENT_DT_VISIT0+i));
        }
        m_bExist[i] = false;
        m_visitGoal[i] = Math::Vector(0.0f, 0.0f, 0.0f);
        m_visitDist[i] = 0.0f;
        m_visitHeight[i] = 0.0f;
        m_time[i] = 0.0f;
    }
}
開發者ID:Insolita,項目名稱:colobot,代碼行數:22,代碼來源:displaytext.cpp

示例15: lock

void CDownloadQueue::ObserverAdded( ObserverType* o )
{
	CObservableQueue<CPartFile*>::ObserverAdded( o );
	
	EventType::ValueList list;

	{
		wxMutexLocker lock(m_mutex);
		list.reserve( m_filelist.size() );
		list.insert( list.begin(), m_filelist.begin(), m_filelist.end() );
	}

	NotifyObservers( EventType( EventType::INITIAL, &list ), o );
}
開發者ID:windreamer,項目名稱:amule-dlp,代碼行數:14,代碼來源:DownloadQueue.cpp


注:本文中的EventType函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。