Rework listener interface as suggested by Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38072 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+20
-24
@@ -251,21 +251,21 @@ MouseFilter::Filter(BMessage* message, EventTarget** _target, int32* _viewToken,
|
|||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case B_MOUSE_DOWN:
|
case B_MOUSE_DOWN:
|
||||||
window->MouseDown(message, where, &viewToken);
|
window->MouseDown(message, where, &viewToken);
|
||||||
fDesktop->InvokeMouseDown(window, message, where);
|
fDesktop->MouseDown(window, message, where);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_MOUSE_UP:
|
case B_MOUSE_UP:
|
||||||
window->MouseUp(message, where, &viewToken);
|
window->MouseUp(message, where, &viewToken);
|
||||||
if (buttons == 0)
|
if (buttons == 0)
|
||||||
fDesktop->SetMouseEventWindow(NULL);
|
fDesktop->SetMouseEventWindow(NULL);
|
||||||
fDesktop->InvokeMouseUp(window, message, where);
|
fDesktop->MouseUp(window, message, where);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_MOUSE_MOVED:
|
case B_MOUSE_MOVED:
|
||||||
window->MouseMoved(message, where, &viewToken,
|
window->MouseMoved(message, where, &viewToken,
|
||||||
latestMouseMoved == NULL || latestMouseMoved == message,
|
latestMouseMoved == NULL || latestMouseMoved == message,
|
||||||
false);
|
false);
|
||||||
fDesktop->InvokeMouseMoved(window, message, where);
|
fDesktop->MouseMoved(window, message, where);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ MouseFilter::Filter(BMessage* message, EventTarget** _target, int32* _viewToken,
|
|||||||
|
|
||||||
fDesktop->SetLastMouseState(where, buttons, window);
|
fDesktop->SetLastMouseState(where, buttons, window);
|
||||||
|
|
||||||
fDesktop->InvokeMouseEvent(message);
|
fDesktop->MouseEvent(message);
|
||||||
|
|
||||||
fDesktop->UnlockAllWindows();
|
fDesktop->UnlockAllWindows();
|
||||||
|
|
||||||
@@ -492,7 +492,7 @@ Desktop::BroadcastToAllWindows(int32 code)
|
|||||||
void
|
void
|
||||||
Desktop::KeyEvent(uint32 what, int32 key, int32 modifiers)
|
Desktop::KeyEvent(uint32 what, int32 key, int32 modifiers)
|
||||||
{
|
{
|
||||||
InvokeKeyEvent(what, key, modifiers);
|
KeyPressed(what, key, modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -921,7 +921,7 @@ Desktop::ActivateWindow(Window* window)
|
|||||||
|
|
||||||
AutoWriteLocker _(fWindowLock);
|
AutoWriteLocker _(fWindowLock);
|
||||||
|
|
||||||
InvokeActivateWindow(window);
|
WindowActitvated(window);
|
||||||
|
|
||||||
bool windowOnOtherWorkspace = !window->InWorkspace(fCurrentWorkspace);
|
bool windowOnOtherWorkspace = !window->InWorkspace(fCurrentWorkspace);
|
||||||
if (windowOnOtherWorkspace
|
if (windowOnOtherWorkspace
|
||||||
@@ -1076,7 +1076,7 @@ Desktop::SendWindowBehind(Window* window, Window* behindOf)
|
|||||||
|
|
||||||
_WindowChanged(window);
|
_WindowChanged(window);
|
||||||
|
|
||||||
InvokeSendWindowBehind(window, behindOf);
|
WindowSentBehind(window, behindOf);
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
|
|
||||||
@@ -1121,8 +1121,6 @@ Desktop::ShowWindow(Window* window)
|
|||||||
// it knows the mouse is over it.
|
// it knows the mouse is over it.
|
||||||
|
|
||||||
_SendFakeMouseMoved(window);
|
_SendFakeMouseMoved(window);
|
||||||
|
|
||||||
InvokeShowWindow(window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1176,8 +1174,6 @@ Desktop::HideWindow(Window* window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InvokeHideWindow(window);
|
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
|
|
||||||
if (window == fWindowUnderMouse)
|
if (window == fWindowUnderMouse)
|
||||||
@@ -1194,11 +1190,11 @@ Desktop::MinimizeWindow(Window* window, bool minimize)
|
|||||||
if (minimize && !window->IsHidden()) {
|
if (minimize && !window->IsHidden()) {
|
||||||
HideWindow(window);
|
HideWindow(window);
|
||||||
window->SetMinimized(minimize);
|
window->SetMinimized(minimize);
|
||||||
InvokeMinimizeWindow(window, minimize);
|
WindowMinimized(window, minimize);
|
||||||
} else if (!minimize && window->IsHidden()) {
|
} else if (!minimize && window->IsHidden()) {
|
||||||
ActivateWindow(window);
|
ActivateWindow(window);
|
||||||
// this will unminimize the window for us
|
// this will unminimize the window for us
|
||||||
InvokeMinimizeWindow(window, minimize);
|
WindowMinimized(window, minimize);
|
||||||
}
|
}
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
@@ -1229,7 +1225,7 @@ Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
|
|||||||
} else
|
} else
|
||||||
window->MoveBy((int32)x, (int32)y);
|
window->MoveBy((int32)x, (int32)y);
|
||||||
|
|
||||||
InvokeMoveWindow(window);
|
WindowMoved(window);
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1284,7 +1280,7 @@ Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
|
|||||||
B_DIRECT_START | B_BUFFER_MOVED | B_CLIPPING_MODIFIED);
|
B_DIRECT_START | B_BUFFER_MOVED | B_CLIPPING_MODIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
InvokeMoveWindow(window);
|
WindowMoved(window);
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
}
|
}
|
||||||
@@ -1301,7 +1297,7 @@ Desktop::ResizeWindowBy(Window* window, float x, float y)
|
|||||||
|
|
||||||
if (!window->IsVisible()) {
|
if (!window->IsVisible()) {
|
||||||
window->ResizeBy((int32)x, (int32)y, NULL);
|
window->ResizeBy((int32)x, (int32)y, NULL);
|
||||||
InvokeResizeWindow(window);
|
WindowResized(window);
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1344,7 +1340,7 @@ Desktop::ResizeWindowBy(Window* window, float x, float y)
|
|||||||
B_DIRECT_START | B_BUFFER_RESIZED | B_CLIPPING_MODIFIED);
|
B_DIRECT_START | B_BUFFER_RESIZED | B_CLIPPING_MODIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
InvokeResizeWindow(window);
|
WindowResized(window);
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
}
|
}
|
||||||
@@ -1360,7 +1356,7 @@ Desktop::SetWindowTabLocation(Window* window, float location)
|
|||||||
if (changed)
|
if (changed)
|
||||||
RebuildAndRedrawAfterWindowChange(window, dirty);
|
RebuildAndRedrawAfterWindowChange(window, dirty);
|
||||||
|
|
||||||
InvokeSetWindowTabLocation(window, location);
|
WindowTabLocationChanged(window, location);
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
@@ -1373,7 +1369,7 @@ Desktop::SetWindowDecoratorSettings(Window* window, const BMessage& settings)
|
|||||||
|
|
||||||
BRegion dirty;
|
BRegion dirty;
|
||||||
bool changed = window->SetDecoratorSettings(settings, dirty);
|
bool changed = window->SetDecoratorSettings(settings, dirty);
|
||||||
bool listenerChanged = InvokeSetDecoratorSettings(window, settings);
|
bool listenerChanged = SetDecoratorSettings(window, settings);
|
||||||
if (changed || listenerChanged)
|
if (changed || listenerChanged)
|
||||||
RebuildAndRedrawAfterWindowChange(window, dirty);
|
RebuildAndRedrawAfterWindowChange(window, dirty);
|
||||||
|
|
||||||
@@ -1421,7 +1417,7 @@ Desktop::AddWindow(Window *window)
|
|||||||
|
|
||||||
_ChangeWindowWorkspaces(window, 0, window->Workspaces());
|
_ChangeWindowWorkspaces(window, 0, window->Workspaces());
|
||||||
|
|
||||||
InvokeAddWindow(window);
|
WindowAdded(window);
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
}
|
}
|
||||||
@@ -1441,7 +1437,7 @@ Desktop::RemoveWindow(Window *window)
|
|||||||
|
|
||||||
_ChangeWindowWorkspaces(window, window->Workspaces(), 0);
|
_ChangeWindowWorkspaces(window, window->Workspaces(), 0);
|
||||||
|
|
||||||
InvokeRemoveWindow(window);
|
WindowRemoved(window);
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
|
|
||||||
@@ -2083,7 +2079,7 @@ Desktop::WriteWindowInfo(int32 serverToken, BPrivate::LinkSender& sender)
|
|||||||
::Window* tmp = window->Window();
|
::Window* tmp = window->Window();
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
BMessage message;
|
BMessage message;
|
||||||
InvokeGetDecoratorSettings(tmp, message);
|
GetDecoratorSettings(tmp, message);
|
||||||
if (tmp->GetDecoratorSettings(&message)) {
|
if (tmp->GetDecoratorSettings(&message)) {
|
||||||
BRect tabFrame;
|
BRect tabFrame;
|
||||||
message.FindRect("tab frame", &tabFrame);
|
message.FindRect("tab frame", &tabFrame);
|
||||||
@@ -2824,7 +2820,7 @@ Desktop::_ChangeWindowWorkspaces(Window* window, uint32 oldWorkspaces,
|
|||||||
// take care about modals and floating windows
|
// take care about modals and floating windows
|
||||||
_UpdateSubsetWorkspaces(window);
|
_UpdateSubsetWorkspaces(window);
|
||||||
|
|
||||||
InvokeSetWindowWorkspaces(window, newWorkspaces);
|
WindowWorkspacesChanged(window, newWorkspaces);
|
||||||
|
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
}
|
}
|
||||||
@@ -3229,7 +3225,7 @@ Desktop::_SetWorkspace(int32 index, bool moveFocusWindow)
|
|||||||
// send B_WORKSPACES_CHANGED message
|
// send B_WORKSPACES_CHANGED message
|
||||||
movedWindow->WorkspacesChanged(oldWorkspaces,
|
movedWindow->WorkspacesChanged(oldWorkspaces,
|
||||||
movedWindow->Workspaces());
|
movedWindow->Workspaces());
|
||||||
InvokeSetWindowWorkspaces(movedWindow, movedWindow->Workspaces());
|
WindowWorkspacesChanged(movedWindow, movedWindow->Workspaces());
|
||||||
} else {
|
} else {
|
||||||
// make sure it's frontmost
|
// make sure it's frontmost
|
||||||
_Windows(index).RemoveWindow(movedWindow);
|
_Windows(index).RemoveWindow(movedWindow);
|
||||||
|
|||||||
@@ -53,154 +53,192 @@ DesktopObservable::GetDesktopListenerList()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeAddWindow(Window* window)
|
DesktopObservable::WindowAdded(Window* window)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->AddWindow(window);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowAdded(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeRemoveWindow(Window* window)
|
DesktopObservable::WindowRemoved(Window* window)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->RemoveWindow(window);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowRemoved(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeKeyEvent(uint32 what, int32 key, int32 modifiers)
|
DesktopObservable::KeyPressed(uint32 what, int32 key, int32 modifiers)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->KeyEvent(what, key, modifiers);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->KeyPressed(what, key, modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeMouseEvent(BMessage* message)
|
DesktopObservable::MouseEvent(BMessage* message)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
listener->MouseEvent(message);
|
listener->MouseEvent(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeMouseDown(Window* window, BMessage* message,
|
DesktopObservable::MouseDown(Window* window, BMessage* message,
|
||||||
const BPoint& where)
|
const BPoint& where)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
listener->MouseDown(window, message, where);
|
listener->MouseDown(window, message, where);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeMouseUp(Window* window, BMessage* message,
|
DesktopObservable::MouseUp(Window* window, BMessage* message,
|
||||||
const BPoint& where)
|
const BPoint& where)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
listener->MouseUp(window, message, where);
|
listener->MouseUp(window, message, where);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeMouseMoved(Window* window, BMessage* message,
|
DesktopObservable::MouseMoved(Window* window, BMessage* message,
|
||||||
const BPoint& where)
|
const BPoint& where)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
listener->MouseMoved(window, message, where);
|
listener->MouseMoved(window, message, where);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeMoveWindow(Window* window)
|
DesktopObservable::WindowMoved(Window* window)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->MoveWindow(window);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowMoved(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeResizeWindow(Window* window)
|
DesktopObservable::WindowResized(Window* window)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->ResizeWindow(window);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowResized(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeActivateWindow(Window* window)
|
DesktopObservable::WindowActitvated(Window* window)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->ActivateWindow(window);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowActitvated(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeSendWindowBehind(Window* window, Window* behindOf)
|
DesktopObservable::WindowSentBehind(Window* window, Window* behindOf)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->SendWindowBehind(window, behindOf);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowSentBehind(window, behindOf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeSetWindowTabLocation(Window* window, float location)
|
DesktopObservable::WindowWorkspacesChanged(Window* window, uint32 workspaces)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
listener->SetWindowTabLocation(window, location);
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowWorkspacesChanged(window, workspaces);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DesktopObservable::WindowMinimized(Window* window, bool minimize)
|
||||||
|
{
|
||||||
|
if (fWeAreInvoking)
|
||||||
|
return;
|
||||||
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowMinimized(window, minimize);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DesktopObservable::WindowTabLocationChanged(Window* window, float location)
|
||||||
|
{
|
||||||
|
if (fWeAreInvoking)
|
||||||
|
return;
|
||||||
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
|
listener->WindowTabLocationChanged(window, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DesktopObservable::InvokeSetDecoratorSettings(Window* window,
|
DesktopObservable::SetDecoratorSettings(Window* window,
|
||||||
const BMessage& settings)
|
const BMessage& settings)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
@@ -208,7 +246,8 @@ DesktopObservable::InvokeSetDecoratorSettings(Window* window,
|
|||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
changed = changed | listener->SetDecoratorSettings(window, settings);
|
changed = changed | listener->SetDecoratorSettings(window, settings);
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
@@ -216,65 +255,18 @@ DesktopObservable::InvokeSetDecoratorSettings(Window* window,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopObservable::InvokeGetDecoratorSettings(Window* window, BMessage& settings)
|
DesktopObservable::GetDecoratorSettings(Window* window, BMessage& settings)
|
||||||
{
|
{
|
||||||
if (fWeAreInvoking)
|
if (fWeAreInvoking)
|
||||||
return;
|
return;
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
InvokeGuard invokeGuard(fWeAreInvoking);
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
for (DesktopListener* listener = fDesktopListenerList.First();
|
||||||
|
listener != NULL; listener = fDesktopListenerList.GetNext(listener))
|
||||||
listener->GetDecoratorSettings(window, settings);
|
listener->GetDecoratorSettings(window, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
DesktopObservable::InvokeSetWindowWorkspaces(Window* window, uint32 workspaces)
|
|
||||||
{
|
|
||||||
if (fWeAreInvoking)
|
|
||||||
return;
|
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
|
||||||
listener->SetWindowWorkspaces(window, workspaces);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
DesktopObservable::InvokeShowWindow(Window* window)
|
|
||||||
{
|
|
||||||
if (fWeAreInvoking)
|
|
||||||
return;
|
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
|
||||||
listener->ShowWindow(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
DesktopObservable::InvokeHideWindow(Window* window)
|
|
||||||
{
|
|
||||||
if (fWeAreInvoking)
|
|
||||||
return;
|
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
|
||||||
listener->HideWindow(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
DesktopObservable::InvokeMinimizeWindow(Window* window, bool minimize)
|
|
||||||
{
|
|
||||||
if (fWeAreInvoking)
|
|
||||||
return;
|
|
||||||
InvokeGuard invokeGuard(fWeAreInvoking);
|
|
||||||
|
|
||||||
FOR_ALL_DESKTOP_LISTENER
|
|
||||||
listener->MinimizeWindow(window, minimize);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DesktopObservable::InvokeGuard::InvokeGuard(bool& invoking)
|
DesktopObservable::InvokeGuard::InvokeGuard(bool& invoking)
|
||||||
:
|
:
|
||||||
fInvoking(invoking)
|
fInvoking(invoking)
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ public:
|
|||||||
virtual void ListenerRegistered(Desktop* desktop) = 0;
|
virtual void ListenerRegistered(Desktop* desktop) = 0;
|
||||||
virtual void ListenerUnregistered() = 0;
|
virtual void ListenerUnregistered() = 0;
|
||||||
|
|
||||||
virtual void AddWindow(Window* window) = 0;
|
virtual void WindowAdded(Window* window) = 0;
|
||||||
virtual void RemoveWindow(Window* window) = 0;
|
virtual void WindowRemoved(Window* window) = 0;
|
||||||
|
|
||||||
virtual void KeyEvent(uint32 what, int32 key,
|
virtual void KeyPressed(uint32 what, int32 key,
|
||||||
int32 modifiers) = 0;
|
int32 modifiers) = 0;
|
||||||
virtual void MouseEvent(BMessage* message) = 0;
|
virtual void MouseEvent(BMessage* message) = 0;
|
||||||
virtual void MouseDown(Window* window, BMessage* message,
|
virtual void MouseDown(Window* window, BMessage* message,
|
||||||
@@ -39,19 +39,17 @@ public:
|
|||||||
virtual void MouseMoved(Window* window, BMessage* message,
|
virtual void MouseMoved(Window* window, BMessage* message,
|
||||||
const BPoint& where) = 0;
|
const BPoint& where) = 0;
|
||||||
|
|
||||||
virtual void MoveWindow(Window* window) = 0;
|
virtual void WindowMoved(Window* window) = 0;
|
||||||
virtual void ResizeWindow(Window* window) = 0;
|
virtual void WindowResized(Window* window) = 0;
|
||||||
virtual void ActivateWindow(Window* window) = 0;
|
virtual void WindowActitvated(Window* window) = 0;
|
||||||
virtual void SendWindowBehind(Window* window,
|
virtual void WindowSentBehind(Window* window,
|
||||||
Window* behindOf) = 0;
|
Window* behindOf) = 0;
|
||||||
virtual void SetWindowWorkspaces(Window* window,
|
virtual void WindowWorkspacesChanged(Window* window,
|
||||||
uint32 workspaces) = 0;
|
uint32 workspaces) = 0;
|
||||||
virtual void ShowWindow(Window* window) = 0;
|
virtual void WindowMinimized(Window* window,
|
||||||
virtual void HideWindow(Window* window) = 0;
|
|
||||||
virtual void MinimizeWindow(Window* window,
|
|
||||||
bool minimize) = 0;
|
bool minimize) = 0;
|
||||||
|
|
||||||
virtual void SetWindowTabLocation(Window* window,
|
virtual void WindowTabLocationChanged(Window* window,
|
||||||
float location) = 0;
|
float location) = 0;
|
||||||
|
|
||||||
virtual bool SetDecoratorSettings(Window* window,
|
virtual bool SetDecoratorSettings(Window* window,
|
||||||
@@ -73,36 +71,33 @@ public:
|
|||||||
void UnregisterListener(DesktopListener* listener);
|
void UnregisterListener(DesktopListener* listener);
|
||||||
const DesktopListenerDLList& GetDesktopListenerList();
|
const DesktopListenerDLList& GetDesktopListenerList();
|
||||||
|
|
||||||
void InvokeAddWindow(Window* window);
|
void WindowAdded(Window* window);
|
||||||
void InvokeRemoveWindow(Window* window);
|
void WindowRemoved(Window* window);
|
||||||
|
|
||||||
void InvokeKeyEvent(uint32 what, int32 key,
|
void KeyPressed(uint32 what, int32 key,
|
||||||
int32 modifiers);
|
int32 modifiers);
|
||||||
void InvokeMouseEvent(BMessage* message);
|
void MouseEvent(BMessage* message);
|
||||||
void InvokeMouseDown(Window* window, BMessage* message,
|
void MouseDown(Window* window, BMessage* message,
|
||||||
const BPoint& where);
|
const BPoint& where);
|
||||||
void InvokeMouseUp(Window* window, BMessage* message,
|
void MouseUp(Window* window, BMessage* message,
|
||||||
const BPoint& where);
|
const BPoint& where);
|
||||||
void InvokeMouseMoved(Window* window, BMessage* message,
|
void MouseMoved(Window* window, BMessage* message,
|
||||||
const BPoint& where);
|
const BPoint& where);
|
||||||
|
|
||||||
void InvokeMoveWindow(Window* window);
|
void WindowMoved(Window* window);
|
||||||
void InvokeResizeWindow(Window* window);
|
void WindowResized(Window* window);
|
||||||
void InvokeActivateWindow(Window* window);
|
void WindowActitvated(Window* window);
|
||||||
void InvokeSendWindowBehind(Window* window,
|
void WindowSentBehind(Window* window, Window* behindOf);
|
||||||
Window* behindOf);
|
void WindowWorkspacesChanged(Window* window,
|
||||||
void InvokeSetWindowWorkspaces(Window* window,
|
|
||||||
uint32 workspaces);
|
uint32 workspaces);
|
||||||
void InvokeShowWindow(Window* window);
|
void WindowMinimized(Window* window, bool minimize);
|
||||||
void InvokeHideWindow(Window* window);
|
|
||||||
void InvokeMinimizeWindow(Window* window, bool minimize);
|
|
||||||
|
|
||||||
void InvokeSetWindowTabLocation(Window* window,
|
void WindowTabLocationChanged(Window* window,
|
||||||
float location);
|
float location);
|
||||||
|
|
||||||
bool InvokeSetDecoratorSettings(Window* window,
|
bool SetDecoratorSettings(Window* window,
|
||||||
const BMessage& settings);
|
const BMessage& settings);
|
||||||
void InvokeGetDecoratorSettings(Window* window,
|
void GetDecoratorSettings(Window* window,
|
||||||
BMessage& settings);
|
BMessage& settings);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user