Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: xfa/fwl/core/fwl_noteimp.cpp

Issue 1901183002: Remove CFWL_Note. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/core/fwl_noteimp.h" 7 #include "xfa/fwl/core/fwl_noteimp.h"
8 8
9 #include "core/fxcrt/include/fx_ext.h" 9 #include "core/fxcrt/include/fx_ext.h"
10 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" 10 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h"
(...skipping 16 matching lines...) Expand all
27 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) 27 #if (_FX_OS_ == _FX_WIN32_DESKTOP_)
28 if (count <= 0) { 28 if (count <= 0) {
29 #endif 29 #endif
30 CFWL_EvtIdle ev; 30 CFWL_EvtIdle ev;
31 IFWL_App* pApp = FWL_GetApp(); 31 IFWL_App* pApp = FWL_GetApp();
32 if (!pApp) 32 if (!pApp)
33 return FWL_ERR_Indefinite; 33 return FWL_ERR_Indefinite;
34 IFWL_NoteDriver* pDriver = pApp->GetNoteDriver(); 34 IFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
35 if (!pDriver) 35 if (!pDriver)
36 return FWL_ERR_Indefinite; 36 return FWL_ERR_Indefinite;
37 pDriver->SendNote(&ev); 37 pDriver->SendEvent(&ev);
38 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) 38 #if (_FX_OS_ == _FX_WIN32_DESKTOP_)
39 } 39 }
40 #endif 40 #endif
41 return FWL_ERR_Indefinite; 41 return FWL_ERR_Indefinite;
42 } 42 }
43 CFWL_WidgetImp* CFWL_NoteLoop::GetForm() { 43 CFWL_WidgetImp* CFWL_NoteLoop::GetForm() {
44 return m_pForm; 44 return m_pForm;
45 } 45 }
46 FX_BOOL CFWL_NoteLoop::ContinueModal() { 46 FX_BOOL CFWL_NoteLoop::ContinueModal() {
47 return m_bContinueModal; 47 return m_bContinueModal;
(...skipping 14 matching lines...) Expand all
62 } 62 }
63 void CFWL_NoteLoop::GenerateCommondEvent(uint32_t dwCommand) { 63 void CFWL_NoteLoop::GenerateCommondEvent(uint32_t dwCommand) {
64 CFWL_EvtMenuCommand ev; 64 CFWL_EvtMenuCommand ev;
65 ev.m_iCommand = dwCommand; 65 ev.m_iCommand = dwCommand;
66 IFWL_Thread* pThread = m_pForm->GetOwnerThread(); 66 IFWL_Thread* pThread = m_pForm->GetOwnerThread();
67 if (!pThread) 67 if (!pThread)
68 return; 68 return;
69 IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); 69 IFWL_NoteDriver* pDriver = pThread->GetNoteDriver();
70 if (!pDriver) 70 if (!pDriver)
71 return; 71 return;
72 pDriver->SendNote(&ev); 72 pDriver->SendEvent(&ev);
73 } 73 }
74 CFWL_NoteDriver::CFWL_NoteDriver() 74 CFWL_NoteDriver::CFWL_NoteDriver()
75 : m_sendEventCalled(0), 75 : m_sendEventCalled(0),
76 m_pHover(nullptr), 76 m_pHover(nullptr),
77 m_pFocus(nullptr), 77 m_pFocus(nullptr),
78 m_pGrab(nullptr) { 78 m_pGrab(nullptr) {
79 m_pNoteLoop = new CFWL_NoteLoop; 79 m_pNoteLoop = new CFWL_NoteLoop;
80 PushNoteLoop(m_pNoteLoop); 80 PushNoteLoop(m_pNoteLoop);
81 } 81 }
82 CFWL_NoteDriver::~CFWL_NoteDriver() { 82 CFWL_NoteDriver::~CFWL_NoteDriver() {
83 delete m_pNoteLoop; 83 delete m_pNoteLoop;
84 ClearInvalidEventTargets(TRUE); 84 ClearInvalidEventTargets(TRUE);
85 } 85 }
86 FX_BOOL CFWL_NoteDriver::SendNote(CFWL_Note* pNote) { 86
87 if (pNote->IsEvent()) { 87 FX_BOOL CFWL_NoteDriver::SendEvent(CFWL_Event* pNote) {
88 int32_t iCount = m_eventTargets.GetCount(); 88 int32_t iCount = m_eventTargets.GetCount();
89 if (iCount < 1) { 89 if (iCount < 1)
90 return TRUE; 90 return TRUE;
91 } 91 if (CFWL_EventType::Mouse == pNote->GetClassID()) {
92 if (FWL_EVTHASH_Mouse == static_cast<CFWL_Event*>(pNote)->GetClassID()) { 92 CFWL_EvtMouse* pMouse = static_cast<CFWL_EvtMouse*>(pNote);
93 CFWL_EvtMouse* pMouse = static_cast<CFWL_EvtMouse*>(pNote); 93 if (FWL_MSGMOUSECMD_MouseHover == pMouse->m_dwCmd) {
94 if (FWL_MSGMOUSECMD_MouseHover == pMouse->m_dwCmd) { 94 if (m_pNoteLoop->GetForm() &&
95 if (m_pNoteLoop->GetForm() && 95 CFWL_ToolTipContainer::getInstance()->ProcessEnter(
96 CFWL_ToolTipContainer::getInstance()->ProcessEnter( 96 pMouse, m_pNoteLoop->GetForm()->GetInterface())) {
97 pMouse, m_pNoteLoop->GetForm()->GetInterface())) {
98 }
99 } else if (FWL_MSGMOUSECMD_MouseLeave == pMouse->m_dwCmd) {
100 if (CFWL_ToolTipContainer::getInstance()->ProcessLeave(pMouse)) {
101 }
102 } else if ((FWL_MSGMOUSECMD_LButtonDown <= pMouse->m_dwCmd) &&
103 (FWL_MSGMOUSECMD_MButtonDblClk >= pMouse->m_dwCmd)) {
104 if (CFWL_ToolTipContainer::getInstance()->ProcessLeave(pMouse)) {
105 }
106 } 97 }
107 } 98 } else if (FWL_MSGMOUSECMD_MouseLeave == pMouse->m_dwCmd) {
108 m_sendEventCalled++; 99 CFWL_ToolTipContainer::getInstance()->ProcessLeave(pMouse);
109 FX_POSITION pos = m_eventTargets.GetStartPosition(); 100 } else if ((FWL_MSGMOUSECMD_LButtonDown <= pMouse->m_dwCmd) &&
110 while (pos) { 101 (FWL_MSGMOUSECMD_MButtonDblClk >= pMouse->m_dwCmd)) {
111 void* key = NULL; 102 CFWL_ToolTipContainer::getInstance()->ProcessLeave(pMouse);
112 CFWL_EventTarget* pEventTarget;
113 m_eventTargets.GetNextAssoc(pos, key, (void*&)pEventTarget);
114 if (pEventTarget && !pEventTarget->IsInvalid()) {
115 pEventTarget->ProcessEvent(static_cast<CFWL_Event*>(pNote));
116 }
117 }
118 m_sendEventCalled--;
119 } else {
120 if (!pNote->m_pDstTarget)
121 return FALSE;
122 IFWL_WidgetDelegate* pDelegate = pNote->m_pDstTarget->SetDelegate(NULL);
123 if (pDelegate) {
124 pDelegate->OnProcessMessage(static_cast<CFWL_Message*>(pNote));
125 } 103 }
126 } 104 }
105 m_sendEventCalled++;
106 FX_POSITION pos = m_eventTargets.GetStartPosition();
107 while (pos) {
108 void* key = NULL;
Tom Sepez 2016/04/21 19:22:33 nit: nullptr;
dsinclair 2016/04/21 19:35:49 Done.
109 CFWL_EventTarget* pEventTarget;
Tom Sepez 2016/04/21 19:22:33 nit: would prefer void* value = nullptr;
dsinclair 2016/04/21 19:35:49 Done.
110 m_eventTargets.GetNextAssoc(pos, key, (void*&)pEventTarget);
Tom Sepez 2016/04/21 19:22:33 Then m_eventTargets.GetNextAssoc(pos, key, value);
dsinclair 2016/04/21 19:35:49 Done.
111 if (pEventTarget && !pEventTarget->IsInvalid()) {
112 pEventTarget->ProcessEvent(pNote);
Tom Sepez 2016/04/21 19:22:33 then CFWL_EventTarget* pEventTarget = static_cast<
dsinclair 2016/04/21 19:35:49 Done.
113 }
114 }
115 m_sendEventCalled--;
127 return TRUE; 116 return TRUE;
128 } 117 }
129 118
130 #define FWL_NoteDriver_EventKey 1100 119 #define FWL_NoteDriver_EventKey 1100
131 FWL_ERR CFWL_NoteDriver::RegisterEventTarget(IFWL_Widget* pListener, 120 FWL_ERR CFWL_NoteDriver::RegisterEventTarget(IFWL_Widget* pListener,
132 IFWL_Widget* pEventSource, 121 IFWL_Widget* pEventSource,
133 uint32_t dwFilter) { 122 uint32_t dwFilter) {
134 uint32_t dwkey = (uint32_t)(uintptr_t)pListener->GetPrivateData( 123 uint32_t dwkey = (uint32_t)(uintptr_t)pListener->GetPrivateData(
135 (void*)(uintptr_t)FWL_NoteDriver_EventKey); 124 (void*)(uintptr_t)FWL_NoteDriver_EventKey);
136 if (dwkey == 0) { 125 if (dwkey == 0) {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 372 }
384 373
385 FX_BOOL CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) { 374 FX_BOOL CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) {
386 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 375 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
387 IFWL_Widget* pMessageForm = pWidgetMgr->IsFormDisabled() 376 IFWL_Widget* pMessageForm = pWidgetMgr->IsFormDisabled()
388 ? pMessage->m_pDstTarget 377 ? pMessage->m_pDstTarget
389 : GetMessageForm(pMessage->m_pDstTarget); 378 : GetMessageForm(pMessage->m_pDstTarget);
390 if (!pMessageForm) 379 if (!pMessageForm)
391 return FALSE; 380 return FALSE;
392 if (DispatchMessage(pMessage, pMessageForm)) { 381 if (DispatchMessage(pMessage, pMessageForm)) {
393 if (pMessage->GetClassID() == FWL_MSGHASH_Mouse) { 382 if (pMessage->GetClassID() == CFWL_MessageType::Mouse)
394 MouseSecondary(static_cast<CFWL_MsgMouse*>(pMessage)); 383 MouseSecondary(static_cast<CFWL_MsgMouse*>(pMessage));
395 }
396 return TRUE; 384 return TRUE;
397 } 385 }
398 return FALSE; 386 return FALSE;
399 } 387 }
388
400 FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage, 389 FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
401 IFWL_Widget* pMessageForm) { 390 IFWL_Widget* pMessageForm) {
402 FX_BOOL bRet = FALSE; 391 FX_BOOL bRet = FALSE;
403 switch (pMessage->GetClassID()) { 392 switch (pMessage->GetClassID()) {
404 case FWL_MSGHASH_Activate: { 393 case CFWL_MessageType::Activate: {
405 bRet = DoActivate(static_cast<CFWL_MsgActivate*>(pMessage), pMessageForm); 394 bRet = DoActivate(static_cast<CFWL_MsgActivate*>(pMessage), pMessageForm);
406 break; 395 break;
407 } 396 }
408 case FWL_MSGHASH_Deactivate: { 397 case CFWL_MessageType::Deactivate: {
409 bRet = DoDeactivate(static_cast<CFWL_MsgDeactivate*>(pMessage), 398 bRet = DoDeactivate(static_cast<CFWL_MsgDeactivate*>(pMessage),
410 pMessageForm); 399 pMessageForm);
411 break; 400 break;
412 } 401 }
413 case FWL_MSGHASH_SetFocus: { 402 case CFWL_MessageType::SetFocus: {
414 bRet = DoSetFocus(static_cast<CFWL_MsgSetFocus*>(pMessage), pMessageForm); 403 bRet = DoSetFocus(static_cast<CFWL_MsgSetFocus*>(pMessage), pMessageForm);
415 break; 404 break;
416 } 405 }
417 case FWL_MSGHASH_KillFocus: { 406 case CFWL_MessageType::KillFocus: {
418 bRet = 407 bRet =
419 DoKillFocus(static_cast<CFWL_MsgKillFocus*>(pMessage), pMessageForm); 408 DoKillFocus(static_cast<CFWL_MsgKillFocus*>(pMessage), pMessageForm);
420 break; 409 break;
421 } 410 }
422 case FWL_MSGHASH_Key: { 411 case CFWL_MessageType::Key: {
423 bRet = DoKey(static_cast<CFWL_MsgKey*>(pMessage), pMessageForm); 412 bRet = DoKey(static_cast<CFWL_MsgKey*>(pMessage), pMessageForm);
424 break; 413 break;
425 } 414 }
426 case FWL_MSGHASH_Mouse: { 415 case CFWL_MessageType::Mouse: {
427 bRet = DoMouse(static_cast<CFWL_MsgMouse*>(pMessage), pMessageForm); 416 bRet = DoMouse(static_cast<CFWL_MsgMouse*>(pMessage), pMessageForm);
428 break; 417 break;
429 } 418 }
430 case FWL_MSGHASH_MouseWheel: { 419 case CFWL_MessageType::MouseWheel: {
431 bRet = DoWheel(static_cast<CFWL_MsgMouseWheel*>(pMessage), pMessageForm); 420 bRet = DoWheel(static_cast<CFWL_MsgMouseWheel*>(pMessage), pMessageForm);
432 break; 421 break;
433 } 422 }
434 case FWL_MSGHASH_Size: { 423 case CFWL_MessageType::Size: {
435 bRet = DoSize(static_cast<CFWL_MsgSize*>(pMessage)); 424 bRet = DoSize(static_cast<CFWL_MsgSize*>(pMessage));
436 break; 425 break;
437 } 426 }
438 case FWL_MSGHASH_Cursor: { 427 case CFWL_MessageType::Cursor: {
439 bRet = TRUE; 428 bRet = TRUE;
440 break; 429 break;
441 } 430 }
442 case FWL_MSGHASH_WindowMove: { 431 case CFWL_MessageType::WindowMove: {
443 bRet = DoWindowMove(static_cast<CFWL_MsgWindowMove*>(pMessage), 432 bRet = DoWindowMove(static_cast<CFWL_MsgWindowMove*>(pMessage),
444 pMessageForm); 433 pMessageForm);
445 break; 434 break;
446 } 435 }
447 case FWL_MSGHASH_DropFiles: { 436 case CFWL_MessageType::DropFiles: {
448 bRet = 437 bRet =
449 DoDragFiles(static_cast<CFWL_MsgDropFiles*>(pMessage), pMessageForm); 438 DoDragFiles(static_cast<CFWL_MsgDropFiles*>(pMessage), pMessageForm);
450 break; 439 break;
451 } 440 }
452 default: { 441 default: {
453 bRet = TRUE; 442 bRet = TRUE;
454 break; 443 break;
455 } 444 }
456 } 445 }
457 if (bRet) { 446 if (bRet) {
458 IFWL_WidgetDelegate* pDelegate = pMessage->m_pDstTarget->SetDelegate(NULL); 447 IFWL_WidgetDelegate* pDelegate = pMessage->m_pDstTarget->SetDelegate(NULL);
459 if (pDelegate) { 448 if (pDelegate)
460 pDelegate->OnProcessMessage(pMessage); 449 pDelegate->OnProcessMessage(pMessage);
461 }
462 } 450 }
463 return bRet; 451 return bRet;
464 } 452 }
453
465 FX_BOOL CFWL_NoteDriver::DoActivate(CFWL_MsgActivate* pMsg, 454 FX_BOOL CFWL_NoteDriver::DoActivate(CFWL_MsgActivate* pMsg,
466 IFWL_Widget* pMessageForm) { 455 IFWL_Widget* pMessageForm) {
467 pMsg->m_pDstTarget = pMessageForm; 456 pMsg->m_pDstTarget = pMessageForm;
468 return (pMsg->m_pDstTarget)->GetStates() & FWL_WGTSTATE_Deactivated; 457 return (pMsg->m_pDstTarget)->GetStates() & FWL_WGTSTATE_Deactivated;
469 } 458 }
470 FX_BOOL CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate* pMsg, 459 FX_BOOL CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate* pMsg,
471 IFWL_Widget* pMessageForm) { 460 IFWL_Widget* pMessageForm) {
472 int32_t iTrackLoop = m_noteLoopQueue.GetSize(); 461 int32_t iTrackLoop = m_noteLoopQueue.GetSize();
473 if (iTrackLoop <= 0) 462 if (iTrackLoop <= 0)
474 return FALSE; 463 return FALSE;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 m_pHover = pTarget; 668 m_pHover = pTarget;
680 CFWL_MsgMouse msHover; 669 CFWL_MsgMouse msHover;
681 msHover.m_pDstTarget = pTarget; 670 msHover.m_pDstTarget = pTarget;
682 msHover.m_fx = pMsg->m_fx; 671 msHover.m_fx = pMsg->m_fx;
683 msHover.m_fy = pMsg->m_fy; 672 msHover.m_fy = pMsg->m_fy;
684 msHover.m_dwFlags = 0; 673 msHover.m_dwFlags = 0;
685 msHover.m_dwCmd = FWL_MSGMOUSECMD_MouseHover; 674 msHover.m_dwCmd = FWL_MSGMOUSECMD_MouseHover;
686 DispatchMessage(&msHover, NULL); 675 DispatchMessage(&msHover, NULL);
687 } 676 }
688 FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) { 677 FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) {
689 if (pMessage->GetClassID() == FWL_MSGHASH_Post) { 678 if (pMessage->GetClassID() == CFWL_MessageType::Post)
690 return TRUE; 679 return TRUE;
691 } 680
692 int32_t iCount = m_noteLoopQueue.GetSize(); 681 int32_t iCount = m_noteLoopQueue.GetSize();
693 for (int32_t i = 0; i < iCount; i++) { 682 for (int32_t i = 0; i < iCount; i++) {
694 CFWL_NoteLoop* pNoteLoop = static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[i]); 683 CFWL_NoteLoop* pNoteLoop = static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[i]);
695 CFWL_WidgetImp* pForm = pNoteLoop->GetForm(); 684 CFWL_WidgetImp* pForm = pNoteLoop->GetForm();
696 if (pForm && (pForm->GetInterface() == pMessage->m_pDstTarget)) { 685 if (pForm && (pForm->GetInterface() == pMessage->m_pDstTarget))
697 return TRUE; 686 return TRUE;
698 }
699 } 687 }
700 iCount = m_forms.GetSize(); 688 iCount = m_forms.GetSize();
701 for (int32_t j = 0; j < iCount; j++) { 689 for (int32_t j = 0; j < iCount; j++) {
702 CFWL_FormImp* pForm = static_cast<CFWL_FormImp*>(m_forms[j]); 690 CFWL_FormImp* pForm = static_cast<CFWL_FormImp*>(m_forms[j]);
703 if (pForm->GetInterface() == pMessage->m_pDstTarget) { 691 if (pForm->GetInterface() == pMessage->m_pDstTarget)
704 return TRUE; 692 return TRUE;
705 }
706 } 693 }
707 return FALSE; 694 return FALSE;
708 } 695 }
696
709 IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget* pDstTarget) { 697 IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget* pDstTarget) {
710 int32_t iTrackLoop = m_noteLoopQueue.GetSize(); 698 int32_t iTrackLoop = m_noteLoopQueue.GetSize();
711 if (iTrackLoop <= 0) 699 if (iTrackLoop <= 0)
712 return NULL; 700 return NULL;
713 IFWL_Widget* pMessageForm = NULL; 701 IFWL_Widget* pMessageForm = NULL;
714 if (iTrackLoop > 1) { 702 if (iTrackLoop > 1) {
715 CFWL_NoteLoop* pNootLoop = 703 CFWL_NoteLoop* pNootLoop =
716 static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[iTrackLoop - 1]); 704 static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[iTrackLoop - 1]);
717 pMessageForm = pNootLoop->GetForm()->GetInterface(); 705 pMessageForm = pNootLoop->GetForm()->GetInterface();
718 } else { 706 } else {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 m_eventSources.RemoveAll(); 772 m_eventSources.RemoveAll();
785 } 773 }
786 int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource, 774 int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource,
787 uint32_t dwFilter) { 775 uint32_t dwFilter) {
788 if (pSource) { 776 if (pSource) {
789 m_eventSources.SetAt(pSource, dwFilter); 777 m_eventSources.SetAt(pSource, dwFilter);
790 return m_eventSources.GetCount(); 778 return m_eventSources.GetCount();
791 } 779 }
792 return 1; 780 return 1;
793 } 781 }
782
794 FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) { 783 FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) {
795 IFWL_WidgetDelegate* pDelegate = m_pListener->SetDelegate(NULL); 784 IFWL_WidgetDelegate* pDelegate = m_pListener->SetDelegate(NULL);
796 if (!pDelegate) 785 if (!pDelegate)
797 return FALSE; 786 return FALSE;
798 if (m_eventSources.GetCount() == 0) { 787 if (m_eventSources.GetCount() == 0) {
799 pDelegate->OnProcessEvent(pEvent); 788 pDelegate->OnProcessEvent(pEvent);
800 return TRUE; 789 return TRUE;
801 } 790 }
802 FX_POSITION pos = m_eventSources.GetStartPosition(); 791 FX_POSITION pos = m_eventSources.GetStartPosition();
803 while (pos) { 792 while (pos) {
804 IFWL_Widget* pSource = NULL; 793 IFWL_Widget* pSource = NULL;
805 uint32_t dwFilter = 0; 794 uint32_t dwFilter = 0;
806 m_eventSources.GetNextAssoc(pos, (void*&)pSource, dwFilter); 795 m_eventSources.GetNextAssoc(pos, (void*&)pSource, dwFilter);
807 if (pSource == pEvent->m_pSrcTarget || 796 if (pSource == pEvent->m_pSrcTarget ||
808 pEvent->GetClassID() == FWL_EVTHASH_Idle) { 797 pEvent->GetClassID() == CFWL_EventType::Idle) {
809 if (IsFilterEvent(pEvent, dwFilter)) { 798 if (IsFilterEvent(pEvent, dwFilter)) {
810 pDelegate->OnProcessEvent(pEvent); 799 pDelegate->OnProcessEvent(pEvent);
811 return TRUE; 800 return TRUE;
812 } 801 }
813 } 802 }
814 } 803 }
815 return FALSE; 804 return FALSE;
816 } 805 }
806
817 FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) { 807 FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) {
818 if (dwFilter == FWL_EVENT_ALL_MASK) { 808 if (dwFilter == FWL_EVENT_ALL_MASK)
819 return TRUE; 809 return TRUE;
820 } 810
821 FX_BOOL bRet = FALSE; 811 FX_BOOL bRet = FALSE;
822 switch (pEvent->GetClassID()) { 812 switch (pEvent->GetClassID()) {
823 case FWL_EVTHASH_Mouse: { 813 case CFWL_EventType::Mouse: {
824 bRet = dwFilter & FWL_EVENT_MOUSE_MASK; 814 bRet = dwFilter & FWL_EVENT_MOUSE_MASK;
825 break; 815 break;
826 } 816 }
827 case FWL_EVTHASH_MouseWheel: { 817 case CFWL_EventType::MouseWheel: {
828 bRet = dwFilter & FWL_EVENT_MOUSEWHEEL_MASK; 818 bRet = dwFilter & FWL_EVENT_MOUSEWHEEL_MASK;
829 break; 819 break;
830 } 820 }
831 case FWL_EVTHASH_Key: { 821 case CFWL_EventType::Key: {
832 bRet = dwFilter & FWL_EVENT_KEY_MASK; 822 bRet = dwFilter & FWL_EVENT_KEY_MASK;
833 break; 823 break;
834 } 824 }
835 case FWL_EVTHASH_SetFocus: 825 case CFWL_EventType::SetFocus:
836 case FWL_EVTHASH_KillFocus: { 826 case CFWL_EventType::KillFocus: {
837 bRet = dwFilter & FWL_EVENT_FOCUSCHANGED_MASK; 827 bRet = dwFilter & FWL_EVENT_FOCUSCHANGED_MASK;
838 break; 828 break;
839 } 829 }
840 case FWL_EVTHASH_Draw: { 830 case CFWL_EventType::Draw: {
841 bRet = dwFilter & FWL_EVENT_DRAW_MASK; 831 bRet = dwFilter & FWL_EVENT_DRAW_MASK;
842 break; 832 break;
843 } 833 }
844 case FWL_EVTHASH_Close: { 834 case CFWL_EventType::Close: {
845 bRet = dwFilter & FWL_EVENT_CLOSE_MASK; 835 bRet = dwFilter & FWL_EVENT_CLOSE_MASK;
846 break; 836 break;
847 } 837 }
848 case FWL_EVTHASH_SizeChanged: { 838 case CFWL_EventType::SizeChanged: {
849 bRet = dwFilter & FWL_EVENT_SIZECHANGED_MASK; 839 bRet = dwFilter & FWL_EVENT_SIZECHANGED_MASK;
850 break; 840 break;
851 } 841 }
852 case FWL_EVTHASH_Idle: { 842 case CFWL_EventType::Idle: {
853 bRet = dwFilter & FWL_EVENT_IDLE_MASK; 843 bRet = dwFilter & FWL_EVENT_IDLE_MASK;
854 break; 844 break;
855 } 845 }
856 default: { 846 default: {
857 bRet = dwFilter & FWL_EVENT_CONTROL_MASK; 847 bRet = dwFilter & FWL_EVENT_CONTROL_MASK;
858 break; 848 break;
859 } 849 }
860 } 850 }
861 return bRet; 851 return bRet;
862 } 852 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) { 966 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) {
977 m_pToolTipImp->Hide(); 967 m_pToolTipImp->Hide();
978 pCurTarget = NULL; 968 pCurTarget = NULL;
979 return TRUE; 969 return TRUE;
980 } 970 }
981 return FALSE; 971 return FALSE;
982 } 972 }
983 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() { 973 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() {
984 return pCurTarget; 974 return pCurTarget;
985 } 975 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698