本文整理汇总了C++中TWsEvent::SetTimeNow方法的典型用法代码示例。如果您正苦于以下问题:C++ TWsEvent::SetTimeNow方法的具体用法?C++ TWsEvent::SetTimeNow怎么用?C++ TWsEvent::SetTimeNow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TWsEvent
的用法示例。
在下文中一共展示了TWsEvent::SetTimeNow方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showDebugMessage
void showDebugMessage( const char* source, const char* message )
{
if ( source && message )
{
memset(g_szSource, 0, sizeof(g_szSource) );
memset(g_szMessage, 0, sizeof(g_szMessage) );
memcpy( g_szSource, source, strlen(source) > 20 ? 20 : strlen(source) );
memcpy( g_szMessage, message, strlen(message) > 100 ? 100 : strlen(message));
// Create a window server event
RWsSession wsSession;
TWsEvent event;
if ( wsSession.Connect() == KErrNone )
{
// Set event data. eventType.data = KData;
event.SetType(EEventUser + ECmdShowDebugWindow); // set event type
event.SetTimeNow(); // set the event time
event.SetHandle(wsSession.WsHandle()); // set window server handle
// Send the created event
wsSession.SendEventToAllWindowGroups(event);
}
}
}
示例2: RunL
/**
Inform with a message ,the timer seconds remaining till its up.\n
Send event to windows group when timer time is up .\n
*/
void CTestTimer::RunL()
{
--iSecondsRemaining;
if (iSecondsRemaining>0)
{
QueueAndInfoPrint();
}
else
{
User::InfoPrint(_L("Time's up"));
iCompleted = ETrue;
CCoeEnv* env = CCoeEnv::Static();
TWsEvent theEvent;
theEvent.SetType(EEventUser + 1);
RWsSession ws;
TInt theRes = ws.Connect();
if(theRes == KErrNone)
{
RWindowGroup& winGroup = env->RootWin();
theEvent.SetType(EEventUser + 1);
theEvent.SetTimeNow();
TInt theId = winGroup.Identifier();
ws.SendEventToWindowGroup(theId, theEvent);
}
ws.Close();
}
}
示例3: SendMessageToSysAp
void CAknKeyLockControl::SendMessageToSysAp(TInt aMessage)
{
RWsSession& ws = iEikonEnv->WsSession();
TInt wgId=0;
CApaWindowGroupName::FindByAppUid(KSysApUid, ws, wgId);
if (wgId)
{
TWsEvent event;
event.SetType(aMessage);
event.SetTimeNow();
ws.SendEventToWindowGroup(wgId, event);
}
}
示例4: RedrawRequest
EXPORT_C TInt CSDL::RedrawRequest()
{
if(gEpocEnv && gEpocEnv->iDsa)
{
//const TInt err = gEpocEnv->iDsa->RedrawRequest();
TWsEvent event;
event.SetType(EEventScreenDeviceChanged),
event.SetTimeNow();
AppendWsEvent(event);/*
EpocSdlEnv::PostUpdate();
return err; */
}
return KErrNotReady;
}
示例5: SendEventToWindowGroups
/**
Handle the window events.\n
Create a window server session and connect the client\n
Set the event type and call the SendEventToWindowGroup().\n
Close the session on completion \n
*/
void CDefocusingEdwinUi::SendEventToWindowGroups(TWsEvent& aEvent)
{
RWsSession ws;
TInt theRes = ws.Connect();
TEST(theRes == KErrNone);
RWindowGroup& winGroup = iCoeEnv->RootWin();
TInt theId = winGroup.Identifier();
aEvent.SetType(EEventKeyDown);
aEvent.SetTimeNow();
ws.SendEventToWindowGroup(theId, aEvent);
aEvent.SetType(EEventKey);
aEvent.SetTimeNow();
ws.SendEventToWindowGroup(theId, aEvent);
aEvent.SetType(EEventKeyUp);
aEvent.SetTimeNow();
ws.SendEventToWindowGroup(theId, aEvent);
ws.Close();
}
示例6: Fail
/** Fetches a message
*/
TInt COomMessageFetch::Fail()
{
TWsEvent event;
TPtr8 ptr(NULL,0);
TUid uid;
event.SetType(EEventMessageReady);
event.SetHandle(CLIENT_HANDLE);
event.SetTimeNow();
SEventMessageReady& eventMessageReady=*(SEventMessageReady*)event.EventData();
eventMessageReady.iWindowGroupIdentifier=iWinGroup2.Identifier();
eventMessageReady.iMessageUid=TUid::Uid(UID_VALUE);
eventMessageReady.iMessageParametersSize=MESSAGE_LEN;
TInt ret=TheClient->iWs.FetchMessage(uid,ptr,event);
if (ret==KErrNone)
User::Free((TAny *)ptr.Ptr());
return(ret);
}
示例7: SendWindowEvent
void CSyncEngineWrap::SendWindowEvent(TInt aEvent)
{
// Create a window server event
RWsSession wsSession;
TWsEvent event;
if (wsSession.Connect() == KErrNone)
{
// Set event data. eventType.data = KData;
event.SetType(EEventUser + aEvent); // set event type
event.SetTimeNow(); // set the event time
event.SetHandle(wsSession.WsHandle()); // set window server handle
// Send the created event
wsSession.SendEventToAllWindowGroups(event);
}
}
示例8: SendMessageToApp
void CAppOomMonitorPlugin::SendMessageToApp(TInt aMessage)
{
RWsSession& ws = WsSession();
TInt wgId = 0;
do
{
CApaWindowGroupName::FindByAppUid(iAppUid, ws, wgId);
if (wgId>0)
{
TWsEvent event;
event.SetType(aMessage);
event.SetTimeNow();
ws.SendEventToWindowGroup(wgId, event);
}
}
while (wgId>0);
}
示例9: SendWindowEvent
void SendWindowEvent(TInt aEvent, const char* data)
{
// Create a window server event
RWsSession wsSession;
TWsEvent event;
if ( wsSession.Connect() == KErrNone )
{
// Set event data. eventType.data = KData;
event.SetType(EEventUser + aEvent); // set event type
event.SetTimeNow(); // set the event time
event.SetHandle(wsSession.WsHandle()); // set window server handle
if ( data )
((char**)event.EventData())[0] = strdup(data);
// Send the created event
wsSession.SendEventToAllWindowGroups(event);
}
}
示例10: ObserverEvent
TInt CSdlAppServ::ObserverEvent(TInt aEvent, TInt aParam)
{
if(iObserver != NULL)
{
if(RThread().Id() == iMainId)
{
return iObserver->SdlEvent(aEvent, aParam);
}
else if(RThread().Id() == gEpocEnv->iId && EnvUtils::IsOwnThreaded())
{
return iObserver->SdlThreadEvent(aEvent, aParam);
}
else
{
TWsEvent event;
event.SetType(ESDLWsEvent);
TInt load[] = {aEvent, aParam};
Mem::Copy(event.EventData(), load, sizeof(TInt) * 2);
event.SetTimeNow();
EpocSdlEnv::EventQueue().Append(event);
}
}
return 0;
}