本文整理汇总了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);
}
}
}
示例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);
}
示例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();
}
示例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();
}
}
示例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() );
}
示例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;
}
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
}
示例11: RemoveLocalServerRequest
void CDownloadQueue::RemoveFile(CPartFile* file)
{
RemoveLocalServerRequest( file );
NotifyObservers( EventType( EventType::REMOVED, file ) );
wxMutexLocker lock( m_mutex );
EraseValue( m_filelist, file );
}
示例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 );
}
示例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 ) );
}
示例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;
}
}
示例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 );
}