• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ EventType函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中EventType函数的典型用法代码示例。如果您正苦于以下问题:C++ EventType函数的具体用法?C++ EventType怎么用?C++ EventType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了EventType函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: al_create_timer

void AllegroFlasher::run()
{
    const int zero = 0;

    timer = al_create_timer(1.0 / FPS.at(zero));
    display = al_create_display(width, height);
    event_queue = al_create_event_queue();
    al_register_event_source(event_queue, al_get_display_event_source(display));
    al_register_event_source(event_queue, al_get_timer_event_source(timer));
    al_register_event_source(event_queue, al_get_keyboard_event_source());
	al_register_event_source(event_queue, al_get_mouse_event_source());
    al_start_timer(timer);		        // Start the timer

    int counter = 0;
    while(!done)                        // Main loop
    {
        EVENT Event = EventType();      // Wait for an event to occur

        if (Event == ESCAPE) {			// Quit the program
            counter = frames.at(zero); 
            break;
        }
        else if (Event == UPDATE) {     // A timer event 
            if(useBlankStart && counter < frames.at(zero)/2)
                displayBlankScreen();   // Simply display a black screen
            else
                updateDisplay();
            counter++;
        }
        else if (Event == UP) {
            moveBlock(UP);
        }
        else if (Event == DOWN) {
            moveBlock(DOWN);
        }
        else if (Event == LEFT) {
            moveBlock(LEFT);
        }
        else if (Event == RIGHT) {
            moveBlock(RIGHT);
        }

        if(counter == frames.at(zero))
            done = true;
    }
    al_destroy_timer(timer);
	al_destroy_display(display);
    al_destroy_event_queue(event_queue);
    done = false;                       // Set again for the next time
}
开发者ID:ELEN4002-Lab-Project-2012,项目名称:ELEN4002-Lab-Project,代码行数:50,代码来源:AllegroFlasher.cpp


示例17: RemoveLocalServerRequest

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

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

	wxMutexLocker lock( m_mutex );

	EraseValue( m_filelist, file );

	if (keepAsCompleted) {
		m_completedDownloads.push_back(file);
	}
}
开发者ID:windreamer,项目名称:amule-dlp,代码行数:14,代码来源:DownloadQueue.cpp


示例18: IsVisit

bool CDisplayText::IsVisit(EventType event)
{
    Ui::CWindow*    pw;
    Ui::CButton*    pb;
    int         i;

    i = event-EVENT_DT_VISIT0;
    if ( i < 0 || i >= MAXDTLINE )  return false;

    pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
    if ( pw == 0 )  return false;
    pb = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i)));
    if ( pb == 0 )  return false;
    return (pb->GetIcon() == 48);  // > ?
}
开发者ID:Insolita,项目名称:colobot,代码行数:15,代码来源:displaytext.cpp


示例19: SetVisit

void CDisplayText::SetVisit(EventType event)
{
    Ui::CWindow*    pw;
    Ui::CButton*    pb;
    int         i;

    i = event-EVENT_DT_VISIT0;
    if ( i < 0 || i >= MAXDTLINE )  return;

    pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
    if ( pw == nullptr )  return;
    pb = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i)));
    if ( pb == nullptr )  return;
    pb->SetIcon(48);  // >
}
开发者ID:colobot,项目名称:colobot,代码行数:15,代码来源:displaytext.cpp


示例20: SINGLETONINSTANCE

void Engine::StartUp()
{
	SINGLETONINSTANCE(Profiler)->StartUp();
	SINGLETONINSTANCE(Profiler)->Begin("StartUp");

	lastTime = Time::GetCurrentMS();
	m_Window = new Window();
	m_Window->StartUp();

	m_SettingsManager = new SettingsManager();
	m_SettingsManager->StartUp();

	m_EventManager = new EventManager();
	m_EventManager->StartUp("Global event manager", true);

	//Register useful event types.
	m_EventManager->AddRegisteredEventType( EventType ("keydownEvent") );	
	m_EventManager->AddRegisteredEventType( EventType ("mouseClickPositionEvent") );
	m_EventManager->AddRegisteredEventType( EventType ("mouseClickHUDEvent") );

	//IMPORTANT: Call this before m_Graphics->StartUp()
	m_Physics = SINGLETONINSTANCE(PhysicsSystem);
	m_Physics->StartUp();

	m_Graphics = new GraphicsSystem();
	m_Graphics->StartUp();

	m_FPSCalculator = new FPSCalculator();
	m_FPSCalculator->StartUp();

	m_SingleFrameAllocator = new StackAllocator(MB(100));

	m_Running = false;

	SINGLETONINSTANCE(Profiler)->End("StartUp");
}
开发者ID:gnub,项目名称:itugameengine,代码行数:36,代码来源:Engine.cpp



注:本文中的EventType函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Event_init函数代码示例发布时间:2022-05-30
下一篇:
C++ EventPlayerDroppedFlag函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap