Started to properly implement support for BView's events mask
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14106 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1757,6 +1757,42 @@ RootLayer::SetEventMaskLayer(Layer *lay, uint32 mask, uint32 options)
|
|||||||
|
|
||||||
Lock();
|
Lock();
|
||||||
|
|
||||||
|
if (mask & B_POINTER_EVENTS) {
|
||||||
|
if (fMouseEventsLayerList.HasItem(lay))
|
||||||
|
fMouseEventsLayerList.AddItem(lay);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (options == 0)
|
||||||
|
fMouseEventsLayerList.RemoveItem(lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mask & B_KEYBOARD_EVENTS) {
|
||||||
|
if (fKeyboardEventsLayerList.HasItem(lay))
|
||||||
|
fKeyboardEventsLayerList.AddItem(lay);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (options == 0)
|
||||||
|
fKeyboardEventsLayerList.RemoveItem(lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: set options!!!
|
||||||
|
// B_NO_POINTER_HISTORY only! How? By telling to the input_server?
|
||||||
|
|
||||||
|
Unlock();
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
RootLayer::SetMouseEventMaskLayer(Layer *lay, uint32 mask, uint32 options)
|
||||||
|
{
|
||||||
|
if (!lay)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool returnValue = true;
|
||||||
|
|
||||||
|
Lock();
|
||||||
|
|
||||||
if (fEventMaskLayer && fEventMaskLayer != lay) {
|
if (fEventMaskLayer && fEventMaskLayer != lay) {
|
||||||
fprintf(stderr, "WARNING: fEventMaskLayer already set and different than the required one!\n");
|
fprintf(stderr, "WARNING: fEventMaskLayer already set and different than the required one!\n");
|
||||||
returnValue = false;
|
returnValue = false;
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ public:
|
|||||||
BMessage* DragMessage(void) const;
|
BMessage* DragMessage(void) const;
|
||||||
|
|
||||||
bool SetEventMaskLayer(Layer *lay, uint32 mask, uint32 options);
|
bool SetEventMaskLayer(Layer *lay, uint32 mask, uint32 options);
|
||||||
|
bool SetMouseEventMaskLayer(Layer *lay, uint32 mask, uint32 options);
|
||||||
|
|
||||||
void LayerRemoved(Layer* layer);
|
void LayerRemoved(Layer* layer);
|
||||||
|
|
||||||
@@ -176,6 +177,8 @@ friend class Desktop;
|
|||||||
WinBorder* fMouseTargetWinBorder;
|
WinBorder* fMouseTargetWinBorder;
|
||||||
int32 fViewAction;
|
int32 fViewAction;
|
||||||
Layer* fEventMaskLayer;
|
Layer* fEventMaskLayer;
|
||||||
|
BList fMouseEventsLayerList;
|
||||||
|
BList fKeyboardEventsLayerList;
|
||||||
|
|
||||||
BLocker fAllRegionsLock;
|
BLocker fAllRegionsLock;
|
||||||
|
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_LAYER_SET_MOUSE_EVENT_MASK:
|
case AS_LAYER_SET_EVENT_MASK:
|
||||||
{
|
{
|
||||||
STRACE(("ServerWindow %s: Message AS_LAYER_SET_MOUSE_EVENT_MASK: Layer name: %s\n", fTitle, fCurrentLayer->Name()));
|
STRACE(("ServerWindow %s: Message AS_LAYER_SET_MOUSE_EVENT_MASK: Layer name: %s\n", fTitle, fCurrentLayer->Name()));
|
||||||
|
|
||||||
@@ -680,6 +680,19 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
|
|
||||||
if (myRootLayer)
|
if (myRootLayer)
|
||||||
myRootLayer->SetEventMaskLayer(fCurrentLayer, mask, options);
|
myRootLayer->SetEventMaskLayer(fCurrentLayer, mask, options);
|
||||||
|
}
|
||||||
|
case AS_LAYER_SET_MOUSE_EVENT_MASK:
|
||||||
|
{
|
||||||
|
STRACE(("ServerWindow %s: Message AS_LAYER_SET_MOUSE_EVENT_MASK: Layer name: %s\n", fTitle, fCurrentLayer->Name()));
|
||||||
|
|
||||||
|
uint32 mask;
|
||||||
|
uint32 options;
|
||||||
|
|
||||||
|
link.Read<uint32>(&mask);
|
||||||
|
link.Read<uint32>(&options);
|
||||||
|
|
||||||
|
if (myRootLayer)
|
||||||
|
myRootLayer->SetMouseEventMaskLayer(fCurrentLayer, mask, options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_LAYER_MOVE_TO:
|
case AS_LAYER_MOVE_TO:
|
||||||
|
|||||||
Reference in New Issue
Block a user