windowing/windowserver/nga/SERVER/EVENT.CPP
changeset 110 7f25ef56562d
parent 0 5d03bc08d59c
child 152 9f1c3fea0f87
equal deleted inserted replaced
98:bf7481649c98 110:7f25ef56562d
     1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    30 #include "inifile.h"
    30 #include "inifile.h"
    31 #include "password.h"
    31 #include "password.h"
    32 #include "pointer.h"
    32 #include "pointer.h"
    33 #include "debugbar.h"
    33 #include "debugbar.h"
    34 #include "advancedpointereventhelper.h"
    34 #include "advancedpointereventhelper.h"
       
    35 #include "Graphics/wsgraphicdrawerinternal.h"
    35 
    36 
    36 GLREF_D CDebugLogBase *wsDebugLog;
    37 GLREF_D CDebugLogBase *wsDebugLog;
    37 
    38 
    38 GLREF_C void StateDump();
    39 GLREF_C void StateDump();
    39 GLREF_C void HeapDump();
    40 GLREF_C void HeapDump();
   620 	{
   621 	{
   621 	CEventQueue *queue = aWsClient->EventQueue();
   622 	CEventQueue *queue = aWsClient->EventQueue();
   622 	TWsEvent event;
   623 	TWsEvent event;
   623 	event.SetType(EEventDisplayChanged);
   624 	event.SetType(EEventDisplayChanged);
   624 	event.SetTimeNow();
   625 	event.SetTimeNow();
       
   626 	
       
   627     // fill in the handle otherwise CONE will discard the notification
       
   628     CWsObjectIx* clientObjList = aWsClient->ObjectIndex();
       
   629     const TWsObject* ptr=clientObjList->FirstObject();
       
   630     const TWsObject* end=ptr+clientObjList->Length();
       
   631     while(++ptr<end)    // first one should always have a NULL object
       
   632         {
       
   633         const CWsObject* obj=ptr->iObject;
       
   634         if (obj && obj->Type()==WS_HANDLE_GROUP_WINDOW)
       
   635             {
       
   636             event.SetHandle(ptr->iHandle);
       
   637             break;
       
   638             }
       
   639         }	
       
   640 	
   625 	TWsDisplayChangedEvent* dispEvent = event.DisplayChanged();
   641 	TWsDisplayChangedEvent* dispEvent = event.DisplayChanged();
   626 	dispEvent->iDisplayNumber = aDisplayNumber;
   642 	dispEvent->iDisplayNumber = aDisplayNumber;
   627 	dispEvent->iConfigurationChangeId = aConfigurationChangeId;
   643 	dispEvent->iConfigurationChangeId = aConfigurationChangeId;
   628 	dispEvent->iResolutionListChangeId = aResolutionListChangeId;
   644 	dispEvent->iResolutionListChangeId = aResolutionListChangeId;
   629 	queue->WalkEventQueue(&OverrideDisplayChangedEvent, &event);
   645 	queue->WalkEventQueue(&OverrideDisplayChangedEvent, &event);
  1018 #endif
  1034 #endif
  1019 			break;
  1035 			break;
  1020 		case TRawEvent::EKeyDown:
  1036 		case TRawEvent::EKeyDown:
  1021 			{
  1037 			{
  1022 			_LIT(KWSERVDebugLogKeyDownArrival,"Key down arrives %d");
  1038 			_LIT(KWSERVDebugLogKeyDownArrival,"Key down arrives %d");
  1023 			if(CDebugBar* dbg = CWsTop::Screen()->DebugBar())
  1039 			CScreen* screen = CWsTop::Screen();
       
  1040 			WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
       
  1041 			if(CDebugBar* dbg = screen->DebugBar())
  1024 				dbg->OnKeyEvent();
  1042 				dbg->OnKeyEvent();
  1025 			if (wsDebugLog)
  1043 			if (wsDebugLog)
  1026 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyDownArrival,aRawEvent.ScanCode());
  1044 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyDownArrival,aRawEvent.ScanCode());
  1027 			CKeyboardRepeat::KeyDown();
  1045 			CKeyboardRepeat::KeyDown();
  1028 			TKeyData keyData;
  1046 			TKeyData keyData;
  1034 			}
  1052 			}
  1035 			break;
  1053 			break;
  1036 		case TRawEvent::EKeyUp:
  1054 		case TRawEvent::EKeyUp:
  1037 			{
  1055 			{
  1038 			_LIT(KWSERVDebugLogKeyUpArrival,"Key up arrives %d");
  1056 			_LIT(KWSERVDebugLogKeyUpArrival,"Key up arrives %d");
  1039 			if(CDebugBar* dbg = CWsTop::Screen()->DebugBar())
  1057 			CScreen* screen = CWsTop::Screen();
       
  1058 			WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
       
  1059 			if(CDebugBar* dbg = screen->DebugBar())
  1040 				dbg->OnKeyEvent();
  1060 				dbg->OnKeyEvent();
  1041 			if (wsDebugLog)
  1061 			if (wsDebugLog)
  1042 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyUpArrival,aRawEvent.ScanCode());
  1062 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyUpArrival,aRawEvent.ScanCode());
  1043 			TKeyData keyData;
  1063 			TKeyData keyData;
  1044 			CKeyboardRepeat::KeyUp(aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE);
  1064 			CKeyboardRepeat::KeyUp(aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE);