本文整理汇总了C++中EventTarget::Messenger方法的典型用法代码示例。如果您正苦于以下问题:C++ EventTarget::Messenger方法的具体用法?C++ EventTarget::Messenger怎么用?C++ EventTarget::Messenger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventTarget
的用法示例。
在下文中一共展示了EventTarget::Messenger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMessage
void
EventDispatcher::SendFakeMouseMoved(EventTarget& target, int32 viewToken)
{
if (fStream == NULL)
return;
BMessage* fakeMove = new BMessage(kFakeMouseMoved);
if (fakeMove == NULL)
return;
fakeMove->AddMessenger("target", target.Messenger());
fakeMove->AddInt32("view_token", viewToken);
fStream->InsertEvent(fakeMove);
}
示例2: _
//.........这里部分代码省略.........
if (fMouseFilter->Filter(event, &mouseTarget, &viewToken,
fNextLatestMouseMoved) == B_SKIP_MESSAGE) {
// this is a work-around if the wrong B_MOUSE_UP
// event is filtered out
if (event->what == B_MOUSE_UP
&& event->FindInt32("buttons") == 0) {
fSuspendFocus = false;
_RemoveTemporaryListeners();
}
break;
}
int32 buttons;
if (event->FindInt32("buttons", &buttons) == B_OK)
fLastButtons = buttons;
else
fLastButtons = 0;
// The "where" field will be filled in by the receiver
// (it's supposed to be expressed in local window coordinates)
event->RemoveName("where");
event->AddPoint("screen_where", fLastCursorPosition);
if (event->what == B_MOUSE_MOVED
&& fPreviousMouseTarget != NULL
&& mouseTarget != fPreviousMouseTarget) {
// Target has changed, we need to notify the previous target
// that the mouse has exited its views
addedTokens = _AddTokens(event, fPreviousMouseTarget,
B_POINTER_EVENTS);
if (addedTokens)
_SetFeedFocus(event);
_SendMessage(fPreviousMouseTarget->Messenger(), event,
kMouseTransitImportance);
previous = fPreviousMouseTarget;
}
current = fPreviousMouseTarget = mouseTarget;
if (current != NULL) {
int32 focusView = viewToken;
addedTokens |= _AddTokens(event, current, B_POINTER_EVENTS,
fNextLatestMouseMoved, &focusView);
bool noPointerHistoryFocus = focusView != viewToken;
if (viewToken != B_NULL_TOKEN)
event->AddInt32("_view_token", viewToken);
if (addedTokens && !noPointerHistoryFocus)
_SetFeedFocus(event);
else if (noPointerHistoryFocus) {
// No tokens were added or the focus shouldn't get a
// mouse moved
break;
}
_SendMessage(current->Messenger(), event,
event->what == B_MOUSE_MOVED
? kMouseMovedImportance : kStandardImportance);
}
break;
}
case B_KEY_DOWN: