* when moving/resizing windows on another workspace, the Workspaces window

has to be udpated anyway.
* some work towards being able to set a window's look/feel/flags on-the-fly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15265 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-12-01 13:59:04 +00:00
parent 5c01706db6
commit 57be286609
7 changed files with 130 additions and 35 deletions
+11 -4
View File
@@ -757,16 +757,23 @@ Desktop::RemoveWindow(WindowLayer *window)
void
Desktop::SetWindowFeel(WindowLayer *window, uint32 feel)
Desktop::SetWindowLook(WindowLayer *window, window_look look)
{
// TODO: implement
fRootLayer->SetWindowLook(window, look);
}
void
Desktop::SetWindowLook(WindowLayer *window, uint32 look)
Desktop::SetWindowFeel(WindowLayer *window, window_feel feel)
{
// TODO: implement
fRootLayer->SetWindowFeel(window, feel);
}
void
Desktop::SetWindowFlags(WindowLayer *window, uint32 flags)
{
fRootLayer->SetWindowFlags(window, flags);
}
+7 -4
View File
@@ -27,6 +27,7 @@
#include <Menu.h>
#include <Autolock.h>
#include <ObjectList.h>
#include <Window.h>
class BMessage;
@@ -99,10 +100,12 @@ class Desktop : public MessageLooper, public ScreenOwner {
void SetWindowWorkspaces(WindowLayer* window,
uint32 workspaces);
void AddWindow(WindowLayer *window);
void RemoveWindow(WindowLayer *window);
void SetWindowFeel(WindowLayer *window, uint32 feel);
void SetWindowLook(WindowLayer *window, uint32 look);
void AddWindow(WindowLayer* window);
void RemoveWindow(WindowLayer* window);
void SetWindowLook(WindowLayer* window, window_look look);
void SetWindowFeel(WindowLayer* window, window_feel feel);
void SetWindowFlags(WindowLayer* window, uint32 flags);
WindowLayer* FindWindowLayerByClientToken(int32 token, team_id teamID);
//WindowLayer* FindWindowLayerByServerToken(int32 token);
+31 -8
View File
@@ -531,8 +531,6 @@ RootLayer::MoveWindowBy(WindowLayer* window, float x, float y)
// TODO: the MoveBy() should just return a dirty region
window->MoveBy(x, y);
if (window->Parent() == NULL)
return;
BRegion changed;
_WindowsChanged(changed);
@@ -551,8 +549,6 @@ RootLayer::ResizeWindowBy(WindowLayer* window, float x, float y)
// TODO: the MoveBy() should just return a dirty region
window->ResizeBy(x, y);
if (window->Parent() == NULL)
return;
BRegion changed;
_WindowsChanged(changed);
@@ -565,20 +561,47 @@ RootLayer::ResizeWindowBy(WindowLayer* window, float x, float y)
void
RootLayer::SetWindowLayerFeel(WindowLayer *windowLayer, int32 newFeel)
RootLayer::SetWindowLook(WindowLayer *window, window_look newLook)
{
BAutolock _(fAllRegionsLock);
// TODO
BRegion changed;
window->SetLook(newLook, window->Parent() ? &changed : NULL);
_WindowsChanged(changed);
if (changed.CountRects() > 0) {
MarkForRedraw(changed);
TriggerRedraw();
}
}
void
RootLayer::SetWindowLayerLook(WindowLayer *windowLayer, int32 newLook)
RootLayer::SetWindowFeel(WindowLayer *window, window_feel newFeel)
{
BAutolock _(fAllRegionsLock);
// TODO
window->SetFeel(newFeel);
// TODO: implement window feels!
}
void
RootLayer::SetWindowFlags(WindowLayer *window, uint32 newFlags)
{
BAutolock _(fAllRegionsLock);
BRegion changed;
window->SetWindowFlags(newFlags, window->Parent() ? &changed : NULL);
_WindowsChanged(changed);
if (changed.CountRects() > 0) {
MarkForRedraw(changed);
TriggerRedraw();
}
}
+3 -2
View File
@@ -87,8 +87,9 @@ class RootLayer : public Layer {
void ActivateWindow(WindowLayer* window);
void SendBehindWindow(WindowLayer* window, WindowLayer* front);
void SetWindowLayerFeel(WindowLayer *windowLayer, int32 newFeel);
void SetWindowLayerLook(WindowLayer *windowLayer, int32 newLook);
void SetWindowLook(WindowLayer *window, window_look newLook);
void SetWindowFeel(WindowLayer *window, window_feel newFeel);
void SetWindowFlags(WindowLayer *window, uint32 newFlags);
void UpdateWorkspaces();
+60 -14
View File
@@ -1318,28 +1318,74 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
}
break;
}
#if 0
case AS_SET_LOOK:
{
// TODO: Implement AS_SET_LOOK
STRACE(("ServerWindow %s: Message Set_Look unimplemented\n", Title()));
break;
}
case AS_SET_FLAGS:
{
// TODO: Implement AS_SET_FLAGS
STRACE(("ServerWindow %s: Message Set_Flags unimplemented\n", Title()));
STRACE(("ServerWindow %s: Message AS_SET_LOOK\n", Title()));
int32 look;
if (link.Read<int32>(&look) != B_OK) {
fLink.StartMessage(B_ERROR);
fLink.Flush();
break;
}
// TODO: filter out invalid looks
if (!fWindowLayer->IsOffscreenWindow())
fDesktop->SetWindowLook(fWindowLayer, (window_look)look);
fLink.StartMessage(B_OK);
fLink.Flush();
break;
}
case AS_SET_FEEL:
{
STRACE(("ServerWindow %s: Message AS_SET_FEEL\n", Title()));
int32 newFeel;
link.Read<int32>(&newFeel);
STRACE(("ServerWindow %s: Message AS_SET_LOOK\n", Title()));
fWindowLayer->GetRootLayer()->ChangeWindowLayerFeel(winLayer, newFeel);
break;
status_t status = B_ERROR;
int32 feel;
if (link.Read<int32>(&feel) == B_OK) {
// test if "feel" is valid
status = (feel == B_NORMAL_WINDOW_FEEL
|| feel == B_MODAL_SUBSET_WINDOW_FEEL
|| feel == B_MODAL_APP_WINDOW_FEEL
|| feel == B_MODAL_ALL_WINDOW_FEEL
|| feel == B_FLOATING_SUBSET_WINDOW_FEEL
|| feel == B_FLOATING_APP_WINDOW_FEEL
|| feel == B_FLOATING_ALL_WINDOW_FEEL
|| feel == kDesktopWindowFeel
|| feel == kMenuWindowFeel
|| feel == kWindowScreenFeel)
? B_BAD_VALUE : B_OK;
}
if (status == B_OK && !fWindowLayer->IsOffscreenWindow())
fDesktop->SetWindowFeel(fWindowLayer, (window_feel)feel);
fLink.StartMessage(status);
fLink.Flush();
}
case AS_SET_FLAGS:
{
STRACE(("ServerWindow %s: Message AS_SET_LOOK\n", Title()));
uint32 flags;
if (link.Read<uint32>(&flags) != B_OK) {
fLink.StartMessage(B_ERROR);
fLink.Flush();
break;
}
// TODO: filter out invalid flags
if (!fWindowLayer->IsOffscreenWindow())
fDesktop->SetWindowFlags(fWindowLayer, flags);
fLink.StartMessage(B_OK);
fLink.Flush();
}
#if 0
case AS_SET_ALIGNMENT:
{
// TODO: Implement AS_SET_ALIGNMENT
+14
View File
@@ -666,6 +666,13 @@ WindowLayer::SupportsFront()
}
void
WindowLayer::SetLook(window_look look, BRegion* updateRegion)
{
// TODO: implement settings window look
}
void
WindowLayer::SetFeel(window_feel feel)
{
@@ -694,6 +701,13 @@ WindowLayer::SetFeel(window_feel feel)
}
void
WindowLayer::SetWindowFlags(uint32 flags, BRegion* updateRegion)
{
// TODO: implement settings window flags
}
click_type
WindowLayer::_ActionFor(const BMessage *msg) const
{
+4 -3
View File
@@ -93,6 +93,10 @@ class WindowLayer : public Layer {
window_feel Feel() const { return fFeel; }
uint32 WindowFlags() const { return fWindowFlags; }
void SetLook(window_look look, BRegion* updateRegion);
void SetFeel(window_feel feel);
void SetWindowFlags(uint32 flags, BRegion* updateRegion);
uint32 Workspaces() const { return fWorkspaces; }
void SetWorkspaces(uint32 workspaces)
{ fWorkspaces = workspaces; }
@@ -107,9 +111,6 @@ class WindowLayer : public Layer {
void HighlightDecorator(bool active);
void SetFeel(window_feel feel);
void SetLook(window_look look);
SubWindowList fSubWindowList;
void RequestClientRedraw(const BRegion& invalid);