Added initial support for BView::SetMouseEventMask(). Buttons appear to be working well.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12789 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2005-05-23 17:23:20 +00:00
parent 24a075f4e4
commit 89d4bfbf2a
3 changed files with 44 additions and 1 deletions

View File

@ -1747,7 +1747,34 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
} }
} }
void RootLayer::SetDragMessage(BMessage* msg) bool
RootLayer::SetEventMaskLayer(Layer *lay, uint32 mask, uint32 options)
{
if (!lay)
return false;
bool returnValue = true;
Lock();
if (fEventMaskLayer && fEventMaskLayer != lay)
{
fprintf(stderr, "WARNING: fEventMaskLayer already set and different than the required one!\n");
returnValue = false;
}
else
{
fEventMaskLayer = lay;
// TODO: use this mask and options!
}
Unlock();
return returnValue;
}
void
RootLayer::SetDragMessage(BMessage* msg)
{ {
if (fDragMessage) if (fDragMessage)
{ {

View File

@ -107,6 +107,8 @@ public:
void SetDragMessage(BMessage *msg); void SetDragMessage(BMessage *msg);
BMessage* DragMessage(void) const; BMessage* DragMessage(void) const;
bool SetEventMaskLayer(Layer *lay, uint32 mask, uint32 options);
static int32 WorkingThread(void *data); static int32 WorkingThread(void *data);
CursorManager& GetCursorManager() { return fCursorManager; } CursorManager& GetCursorManager() { return fCursorManager; }

View File

@ -600,6 +600,20 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
break; break;
} }
case AS_LAYER_SET_MOUSE_EVENT_MASK:
{
STRACE(("ServerWindow %s: Message AS_LAYER_SET_MOUSE_EVENT_MASK: Layer name: %s\n", fName, cl->fName->String()));
uint32 mask;
uint32 options;
link.Read<uint32>(&mask);
link.Read<uint32>(&options);
myRootLayer->SetEventMaskLayer(cl, mask, options);
break;
}
case AS_LAYER_MOVETO: case AS_LAYER_MOVETO:
{ {
STRACE(("ServerWindow %s: Message AS_LAYER_MOVETO: Layer name: %s\n", fName, cl->fName->String())); STRACE(("ServerWindow %s: Message AS_LAYER_MOVETO: Layer name: %s\n", fName, cl->fName->String()));