From 43c4c1eead4b2e5d83d76bdf0fb098d6c9057f31 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Sat, 17 Jan 2004 18:37:57 +0000 Subject: [PATCH] Added header and credits to some files made debug printfs in RootLayer to STRACE calls Minor ServerApp and AppServer tweaks comment fixes in many places git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6119 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/AppServer.cpp | 13 +- src/servers/app/server/CursorData.cpp | 4 + src/servers/app/server/DefaultDecorator.cpp | 5 +- src/servers/app/server/Desktop.cpp | 32 +- src/servers/app/server/Desktop.h | 28 +- src/servers/app/server/FMWList.cpp | 2 +- src/servers/app/server/Layer.cpp | 1 + src/servers/app/server/Layer.h | 4 +- src/servers/app/server/RootLayer.cpp | 468 ++++++++++++-------- src/servers/app/server/ServerApp.cpp | 100 +++-- src/servers/app/server/ServerPicture.cpp | 26 ++ src/servers/app/server/ServerPicture.h | 26 ++ src/servers/app/server/ServerScreen.cpp | 27 +- src/servers/app/server/ServerScreen.h | 26 ++ src/servers/app/server/Utils.cpp | 26 ++ src/servers/app/server/Utils.h | 26 ++ src/servers/app/server/WinBorder.cpp | 1 + src/servers/app/server/Workspace.cpp | 26 ++ src/servers/app/server/Workspace.h | 26 ++ 19 files changed, 652 insertions(+), 215 deletions(-) diff --git a/src/servers/app/server/AppServer.cpp b/src/servers/app/server/AppServer.cpp index 98070faf10..4138e7d350 100644 --- a/src/servers/app/server/AppServer.cpp +++ b/src/servers/app/server/AppServer.cpp @@ -702,12 +702,15 @@ void AppServer::DispatchMessage(PortMessage *msg) // When we delete the last ServerApp, we can exit the server _quitting_server = true; _exit_poller = true; - // also wait for picasso thread - wait_for_thread(_picasso_id, &rv); - // poller thread is stuck reading messages from its input port - // so, there is no cleaner way to make it quit, other than killing it! + + // also wait for picasso thread + kill_thread(_picasso_id); + + // poller thread is stuck reading messages from its input port + // so, there is no cleaner way to make it quit, other than killing it! kill_thread(_poller_id); - // we are now clear to exit + + // we are now clear to exit break; } case AS_SET_SYSCURSOR_DEFAULTS: diff --git a/src/servers/app/server/CursorData.cpp b/src/servers/app/server/CursorData.cpp index 377320f24b..7112870160 100644 --- a/src/servers/app/server/CursorData.cpp +++ b/src/servers/app/server/CursorData.cpp @@ -48,6 +48,10 @@ Then comes the pixel transparency bitmask, given left-to-right and top-to-bottom transparent. Transparency only applies to white pixels—black pixels are always opaque. */ + +// TODO: Make the default cursor lose some weight to make it easier +// to see where it's pointing + // Impressive ASCII art, eh? int8 default_cursor_data[] = { diff --git a/src/servers/app/server/DefaultDecorator.cpp b/src/servers/app/server/DefaultDecorator.cpp index 235085ba3f..14958820a3 100644 --- a/src/servers/app/server/DefaultDecorator.cpp +++ b/src/servers/app/server/DefaultDecorator.cpp @@ -468,7 +468,10 @@ void DefaultDecorator::DrawBlendedRect(BRect r, bool down) // Note that it is not part of the Decorator API - it's specific // to just the DefaultDecorator. Called by DrawZoom and DrawClose - _layerdata.highcolor = RGBColor( 175, 123, 0 ); + // TODO: Fix this function so that the close button on inactive window tabs + // is drawn correctly. Currently, a yellow "halo" appears around them. + + _layerdata.highcolor = RGBColor( 175, 123, 0 ); _driver->StrokeLine( r.LeftTop(), BPoint( r.left, r.bottom - 1 ), _layerdata.pensize,_layerdata.highcolor); diff --git a/src/servers/app/server/Desktop.cpp b/src/servers/app/server/Desktop.cpp index c25e486e54..ad1396a34a 100644 --- a/src/servers/app/server/Desktop.cpp +++ b/src/servers/app/server/Desktop.cpp @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: Desktop.cpp +// Author: Adi Oanca +// Description: Class used to encapsulate desktop management +// +//------------------------------------------------------------------------------ #include #include #include @@ -232,7 +258,7 @@ void Desktop::SetFrontWinBorder(WinBorder* winBorder){ } //--------------------------------------------------------------------------- // TODO: remove shortly? -void Desktop::SetFoooocusWinBorder(WinBorder* winBorder){ +void Desktop::SetFocusWinBorder(WinBorder* winBorder){ if (FocusWinBorder() == winBorder && (winBorder && !winBorder->IsHidden())) return; @@ -300,7 +326,7 @@ void Desktop::MouseEventHandler(PortMessage *msg){ msg->Read(&pt.x); msg->Read(&pt.y); - printf("MOUSE DOWN: at (%f, %f)\n", pt.x, pt.y); +// printf("MOUSE DOWN: at (%f, %f)\n", pt.x, pt.y); WinBorder *target; RootLayer *rl; @@ -333,7 +359,7 @@ void Desktop::MouseEventHandler(PortMessage *msg){ msg->Read(&pt.x); msg->Read(&pt.y); - printf("MOUSE UP: at (%f, %f)\n", pt.x, pt.y); +// printf("MOUSE UP: at (%f, %f)\n", pt.x, pt.y); break; } diff --git a/src/servers/app/server/Desktop.h b/src/servers/app/server/Desktop.h index e21e195e18..e63879c44c 100644 --- a/src/servers/app/server/Desktop.h +++ b/src/servers/app/server/Desktop.h @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: Desktop.cpp +// Author: Adi Oanca +// Description: Class used to encapsulate desktop management +// +//------------------------------------------------------------------------------ #ifndef _DESKTOP_H_ #define _DESKTOP_H_ @@ -41,7 +67,7 @@ public: void RemoveWinBorder(WinBorder* winBorder); bool HasWinBorder(WinBorder* winBorder); void SetFrontWinBorder(WinBorder* winBorder); - void SetFoooocusWinBorder(WinBorder* winBorder); + void SetFocusWinBorder(WinBorder* winBorder); WinBorder* FrontWinBorder(void) const; WinBorder* FocusWinBorder(void) const; diff --git a/src/servers/app/server/FMWList.cpp b/src/servers/app/server/FMWList.cpp index 055bd46103..b3f189de6e 100644 --- a/src/servers/app/server/FMWList.cpp +++ b/src/servers/app/server/FMWList.cpp @@ -21,7 +21,7 @@ // // File Name: FMWList.cpp // Author: Adi Oanca -// Description: List class for something or other (according to DW) +// Description: List class for tracking floating and modal windows // //------------------------------------------------------------------------------ #include diff --git a/src/servers/app/server/Layer.cpp b/src/servers/app/server/Layer.cpp index 451e0d867c..e346d35f5e 100644 --- a/src/servers/app/server/Layer.cpp +++ b/src/servers/app/server/Layer.cpp @@ -21,6 +21,7 @@ // // File Name: Layer.cpp // Author: DarkWyrm +// Adi Oanca // Description: Class used for rendering to the frame buffer. One layer per // view on screen and also for window decorators // diff --git a/src/servers/app/server/Layer.h b/src/servers/app/server/Layer.h index ead43f6383..e8d09ece44 100644 --- a/src/servers/app/server/Layer.h +++ b/src/servers/app/server/Layer.h @@ -21,7 +21,9 @@ // // File Name: Layer.h // Author: DarkWyrm -// Description: Shadow BView class +// Adi Oanca +// Description: Class used for rendering to the frame buffer. One layer per +// view on screen and also for window decorators // //------------------------------------------------------------------------------ #ifndef _LAYER_H_ diff --git a/src/servers/app/server/RootLayer.cpp b/src/servers/app/server/RootLayer.cpp index f8527a9d6b..68dd14b019 100644 --- a/src/servers/app/server/RootLayer.cpp +++ b/src/servers/app/server/RootLayer.cpp @@ -1,3 +1,31 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2003, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: RootLayer.cpp +// Author: Gabe Yoder +// DarkWyrm +// Adi Oanca +// Description: Class used for the top layer of each workspace's Layer tree +// +//------------------------------------------------------------------------------ #include #include @@ -15,6 +43,14 @@ #include "FMWList.h" #include "DisplayDriver.h" +//#define DEBUG_ROOTLAYER + +#ifdef DEBUG_ROOTLAYER + #define STRACE(a) printf(a) +#else + #define STRACE(a) /* nothing */ +#endif + //#define DISPLAYDRIVER_TEST_HACK //--------------------------------------------------------------------------- @@ -25,7 +61,8 @@ RootLayer::RootLayer(const char *layername, int32 workspaceCount, Desktop *deskt fActiveWorkspace = NULL; fRows = 0; fColumns = 0; -// TODO: read these 3 from a configuration file. + + // TODO: read these 3 from a configuration file. fScreenXResolution = 0; fScreenYResolution = 0; fColorSpace = B_RGB32; @@ -36,23 +73,28 @@ RootLayer::RootLayer(const char *layername, int32 workspaceCount, Desktop *deskt SetWorkspaceCount(workspaceCount); } //--------------------------------------------------------------------------- -RootLayer::~RootLayer(){ +RootLayer::~RootLayer() +{ // RootLayer object just uses Screen objects, it is not allowed to delete them. } //--------------------------------------------------------------------------- -void RootLayer::Draw(const BRect &r){ -/* THIS method is here because of DisplayDriver testing! - * It SHOULD BE REMOVED as soon as testing is done!!!! - */ -printf("*RootLayer(%s)::Draw(r)\n", GetName()); - // NOTE: (!!!) fMainLock MUST be locked when this method is called!!! - if (!fMainLock.IsLocked()) - printf("\n\n\tWARNING: fMainLock MUST be locked!!!\n\n"); - // NOTE: (!!!) desktop->fGeneralLock MUST be locked when this method is called!!! - if (!desktop->fGeneralLock.IsLocked()) - printf("\n\n\tWARNING: desktop->fGeneralLock MUST be locked!!!\n\n"); +void RootLayer::Draw(const BRect &r) +{ + // REMOVEME: This method is here because of DisplayDriver testing ONLY. + // It should be removed when testing is finished -// NOTE: in case you have problems - ActiveWorkspace()->opLock was acquired in Workspace::Invalidate()!!! + STRACE(("*RootLayer(%s)::Draw(r)\n", GetName())); + + // NOTE: fMainLock MUST be locked when this method is called + if (!fMainLock.IsLocked()) + printf("\n\n\tWARNING: fMainLock MUST be locked when calling RootLayer::Draw\n\n"); + + // NOTE: desktop->fGeneralLock MUST be locked when this method is called!!! + if (!desktop->fGeneralLock.IsLocked()) + printf("\n\n\tWARNING: desktop->fGeneralLock MUST be locked when calling RootLayer::Draw()\n\n"); + + // NOTE: in case you have problems - ActiveWorkspace()->opLock was + // acquired in Workspace::Invalidate() RGBColor c(51,102,152); @@ -60,13 +102,15 @@ printf("*RootLayer(%s)::Draw(r)\n", GetName()); Workspace *as = ActiveWorkspace(); WinBorder *wb = NULL; - for (wb = as->GoToTopItem(); wb; wb = as->GoToLowerItem()){ -printf("requesting draw? %s from %s\n", wb->IsHidden()?"NO":"YES", wb->GetName()); + for (wb = as->GoToTopItem(); wb; wb = as->GoToLowerItem()) + { + STRACE(("requesting draw? %s from %s\n", wb->IsHidden()?"NO":"YES", wb->GetName())); if (!(wb->IsHidden())) wb->Draw(wb->Bounds()); } - printf("#RootLayer(%s)::Draw(r) END\n", GetName()); -//--------REMOVE ABOVE-------------- + + STRACE(("#RootLayer(%s)::Draw(r) END\n", GetName())); + #ifdef DISPLAYDRIVER_TEST_HACK DisplayDriver *_driver = fDriver; int8 pattern[8]; @@ -132,74 +176,93 @@ printf("requesting draw? %s from %s\n", wb->IsHidden()?"NO":"YES", wb->GetName() } //--------------------------------------------------------------------------- -void RootLayer::MoveBy(float x, float y){ +void RootLayer::MoveBy(float x, float y) +{ } //--------------------------------------------------------------------------- -void RootLayer::ResizeBy(float x, float y){ +void RootLayer::ResizeBy(float x, float y) +{ } //--------------------------------------------------------------------------- -Layer* RootLayer::VirtualTopChild() const{ +Layer* RootLayer::VirtualTopChild() const +{ return fActiveWorkspace->GoToTopItem(); } //--------------------------------------------------------------------------- -Layer* RootLayer::VirtualLowerSibling() const{ +Layer* RootLayer::VirtualLowerSibling() const +{ return fActiveWorkspace->GoToLowerItem(); } //--------------------------------------------------------------------------- -Layer* RootLayer::VirtualUpperSibling() const{ +Layer* RootLayer::VirtualUpperSibling() const +{ return fActiveWorkspace->GoToUpperItem(); } //--------------------------------------------------------------------------- -Layer* RootLayer::VirtualBottomChild() const{ +Layer* RootLayer::VirtualBottomChild() const +{ return fActiveWorkspace->GoToBottomItem(); } //--------------------------------------------------------------------------- -void RootLayer::AddWinBorderToWorkspaces(WinBorder* winBorder, uint32 wks){ +void RootLayer::AddWinBorderToWorkspaces(WinBorder* winBorder, uint32 wks) +{ if (!(fMainLock.IsLocked())) debugger("RootLayer::AddWinBorderToWorkspaces - fMainLock has to be locked!\n"); - if (wks == B_CURRENT_WORKSPACE){ + if (wks == B_CURRENT_WORKSPACE) + { ActiveWorkspace()->AddLayerPtr(winBorder); return; } - for( int32 i=0; i < 32; i++){ - if( wks & (0x00000001 << i) && i < WorkspaceCount()){ + for( int32 i=0; i < 32; i++) + { + if( wks & (0x00000001 << i) && i < WorkspaceCount()) WorkspaceAt(i+1)->AddLayerPtr(winBorder); - } } } -/* The main job, beside adding winBorder as a child, is to determine - * in witch workspaces to add this window. - */ //--------------------------------------------------------------------------- -void RootLayer::AddWinBorder(WinBorder* winBorder){ -printf("*RootLayer::AddWinBorder(%s)\n", winBorder->GetName()); -desktop->fGeneralLock.Lock(); -printf("*RootLayer::AddWinBorder(%s) - General lock acquired\n", winBorder->GetName()); -fMainLock.Lock(); -printf("*RootLayer::AddWinBorder(%s) - Main lock acquired\n", winBorder->GetName()); - // add winBorder to the known list of WinBorders so we can keep track of it. +void RootLayer::AddWinBorder(WinBorder* winBorder) +{ + // The main job of this function, besides adding winBorder as a child, is to determine + // in which workspaces to add this window. + + STRACE(("*RootLayer::AddWinBorder(%s)\n", winBorder->GetName())); + desktop->fGeneralLock.Lock(); + + STRACE(("*RootLayer::AddWinBorder(%s) - General lock acquired\n", winBorder->GetName())); + fMainLock.Lock(); + + STRACE(("*RootLayer::AddWinBorder(%s) - Main lock acquired\n", winBorder->GetName())); + + // add winBorder to the known list of WinBorders so we can keep track of it. AddChild(winBorder, this); - // add winBorder to the desired workspaces - switch(winBorder->Window()->Feel()){ - case B_MODAL_SUBSET_WINDOW_FEEL:{ - /* this kind of window isn't added anywhere. It *will* be added - to main window's subset when winBorder::AddToSubsetOf(main) - will be called.*/ + + // add winBorder to the desired workspaces + switch(winBorder->Window()->Feel()) + { + case B_MODAL_SUBSET_WINDOW_FEEL: + { + // this kind of window isn't added anywhere. It will be added + // to main window's subset when winBorder::AddToSubsetOf(main) + // will be called. break; } - case B_MODAL_APP_WINDOW_FEEL:{ - // add to ***app's*** list of Floating/Modal Windows. + case B_MODAL_APP_WINDOW_FEEL: + { + // add to app's list of Floating/Modal windows (as opposed to the system's) winBorder->Window()->App()->fAppFMWList.AddItem(winBorder); - // determine in witch workspaces to add this winBorder. + // determine in witch workspaces to add this winBorder. uint32 wks = 0; -// TODO: change later when you put this code into the server - for (int32 i=0; iGoToBottomItem(); wb!=NULL; wb = ws->GoToUpperItem()){ + for (WinBorder *wb = ws->GoToBottomItem(); wb!=NULL; wb = ws->GoToUpperItem()) + { if ( !(wb->IsHidden()) && winBorder->Window()->ClientTeamID() == wb->Window()->ClientTeamID()) { @@ -208,30 +271,34 @@ printf("*RootLayer::AddWinBorder(%s) - Main lock acquired\n", winBorder->GetName } } } -// by using _bottomchild and _uppersibling. + // by using _bottomchild and _uppersibling. AddWinBorderToWorkspaces(winBorder, wks); break; } - case B_MODAL_ALL_WINDOW_FEEL:{ - // add to ***system's*** list of Floating/Modal Windows. + case B_MODAL_ALL_WINDOW_FEEL: + { + // add to system's list of Floating/Modal Windows (as opposed to the app's list) fMainFMWList.AddItem(winBorder); - // add this winBorder to all workspaces + + // add this winBorder to all workspaces AddWinBorderToWorkspaces(winBorder, 0xffffffffUL); break; } - case B_FLOATING_SUBSET_WINDOW_FEEL:{ - /* this kind of window isn't added anywhere. It *will* be added to WS's list - when its main window will become the front one. - Also, it will be added to MainWinBorder's list when - winBorder::AddToSubset(main) is called.*/ + case B_FLOATING_SUBSET_WINDOW_FEEL: + { + // this kind of window isn't added anywhere. It *will* be added to WS's list + // when its main window will become the front one. + // Also, it will be added to MainWinBorder's list when + // winBorder::AddToSubset(main) is called. break; } - case B_FLOATING_APP_WINDOW_FEEL:{ - // add to ***app's*** list of Floating/Modal Windows. + case B_FLOATING_APP_WINDOW_FEEL: + { + // add to app's list of Floating/Modal windows (as opposed to the system's) winBorder->Window()->App()->fAppFMWList.AddItem(winBorder); for (int32 i=0; iGetName break; } - case B_FLOATING_ALL_WINDOW_FEEL:{ - // add to ***system's*** list of Floating/Modal Windows. + case B_FLOATING_ALL_WINDOW_FEEL: + { + // add to system's list of Floating/Modal Windows (as opposed to the app's list) fMainFMWList.AddItem(winBorder); - // add this winBorder to all workspaces + + // add this winBorder to all workspaces AddWinBorderToWorkspaces(winBorder, 0xffffffffUL); break; } - case B_NORMAL_WINDOW_FEEL:{ - // add this winBorder to the specified workspaces + case B_NORMAL_WINDOW_FEEL: + { + // add this winBorder to the specified workspaces AddWinBorderToWorkspaces(winBorder, winBorder->Window()->Workspaces()); break; } case B_SYSTEM_LAST: - case B_SYSTEM_FIRST:{ - // add this winBorder to all workspaces + case B_SYSTEM_FIRST: + { + // add this winBorder to all workspaces AddWinBorderToWorkspaces(winBorder, 0xffffffffUL); break; } default: break; - } -fMainLock.Unlock(); -printf("*RootLayer::AddWinBorder(%s) - Main lock released\n", winBorder->GetName()); -desktop->fGeneralLock.Unlock(); -printf("*RootLayer::AddWinBorder(%s) - General lock released\n", winBorder->GetName()); -printf("#RootLayer::AddWinBorder(%s)\n", winBorder->GetName()); + } // end switch(winborder->Feel()) + + fMainLock.Unlock(); + STRACE(("*RootLayer::AddWinBorder(%s) - Main lock released\n", winBorder->GetName())); + + desktop->fGeneralLock.Unlock(); + STRACE(("*RootLayer::AddWinBorder(%s) - General lock released\n", winBorder->GetName())); + + STRACE(("#RootLayer::AddWinBorder(%s)\n", winBorder->GetName())); } -/* This method does 3 things: - * 1) Removes MODAL/SUBSET windows from system/app/window subset list. - * 2) Removes this window from any workspace it appears in. - * 3) Removes this window from RootLayer's list of chilren. - */ + //--------------------------------------------------------------------------- -void RootLayer::RemoveWinBorder(WinBorder* winBorder){ -desktop->fGeneralLock.Lock(); -fMainLock.Lock(); +void RootLayer::RemoveWinBorder(WinBorder* winBorder) +{ +// This method does 3 things: +// 1) Removes MODAL/SUBSET windows from system/app/window subset list. +// 2) Removes this window from any workspace it appears in. +// 3) Removes this window from RootLayer's list of chilren. + + + desktop->fGeneralLock.Lock(); + fMainLock.Lock(); + int32 feel = winBorder->Window()->Feel(); - if(feel == B_MODAL_SUBSET_WINDOW_FEEL || feel == B_FLOATING_SUBSET_WINDOW_FEEL){ + if(feel == B_MODAL_SUBSET_WINDOW_FEEL || feel == B_FLOATING_SUBSET_WINDOW_FEEL) + { desktop->RemoveSubsetWindow(winBorder); } - else if (feel == B_MODAL_APP_WINDOW_FEEL || feel == B_FLOATING_APP_WINDOW_FEEL){ + else if (feel == B_MODAL_APP_WINDOW_FEEL || feel == B_FLOATING_APP_WINDOW_FEEL) + { RemoveAppWindow(winBorder); } else if(feel == B_MODAL_ALL_WINDOW_FEEL || feel == B_FLOATING_ALL_WINDOW_FEEL @@ -302,60 +382,75 @@ fMainLock.Lock(); for(int32 i=0; i < count; i++) WorkspaceAt(i+1)->RemoveLayerPtr(winBorder); } - else{ // for B_NORMAL_WINDOW_FEEL + else + { // for B_NORMAL_WINDOW_FEEL uint32 workspaces = winBorder->Window()->Workspaces(); int32 count = WorkspaceCount(); for( int32 i=0; i < 32 && i < count; i++) - if( workspaces & (0x00000001UL << i)){ - WorkspaceAt(i+1)->RemoveLayerPtr(winBorder); - } + if( workspaces & (0x00000001UL << i)) + WorkspaceAt(i+1)->RemoveLayerPtr(winBorder); } RemoveChild(winBorder); -fMainLock.Unlock(); -desktop->fGeneralLock.Unlock(); + + fMainLock.Unlock(); + desktop->fGeneralLock.Unlock(); } //--------------------------------------------------------------------------- -void RootLayer::ChangeWorkspacesFor(WinBorder* winBorder, uint32 newWorkspaces){ - // only NORMAL windows are affected by this change +void RootLayer::ChangeWorkspacesFor(WinBorder* winBorder, uint32 newWorkspaces) +{ + // only normal windows are affected by this change if(!winBorder->_level != B_NORMAL_FEEL) return; uint32 oldWorkspaces = winBorder->Window()->Workspaces(); - for(int32 i=0; i < WorkspaceCount(); i++){ - if ((oldWorkspaces & (0x00000001 << i)) && (newWorkspaces & (0x00000001 << i))){ + for(int32 i=0; i < WorkspaceCount(); i++) + { + if ((oldWorkspaces & (0x00000001 << i)) && (newWorkspaces & (0x00000001 << i))) + { // do nothing. } - else if(oldWorkspaces & (0x00000001 << i)){ + else if(oldWorkspaces & (0x00000001 << i)) + { WorkspaceAt(i+1)->RemoveLayerPtr(winBorder); } - else if (newWorkspaces & (0x00000001 << i)){ + else if (newWorkspaces & (0x00000001 << i)) + { WorkspaceAt(i+1)->AddLayerPtr(winBorder); } } } //--------------------------------------------------------------------------- -bool RootLayer::SetFrontWinBorder(WinBorder* winBorder){ -// TODO: watch out for a NULL value -printf("*RootLayer::SetFrontWinBorder(%s)\n", winBorder? winBorder->GetName():"NULL"); -fMainLock.Lock(); -printf("*RootLayer::SetFrontWinBorder(%s) - main lock acquired\n", winBorder? winBorder->GetName():"NULL"); - if (!winBorder){ +bool RootLayer::SetFrontWinBorder(WinBorder* winBorder) +{ + if(!winBorder) + return false; + + STRACE(("*RootLayer::SetFrontWinBorder(%s)\n", winBorder? winBorder->GetName():"NULL")); + + fMainLock.Lock(); + STRACE(("*RootLayer::SetFrontWinBorder(%s) - main lock acquired\n", winBorder? winBorder->GetName():"NULL")); + + if (!winBorder) + { ActiveWorkspace()->SetFrontLayer(NULL); return true; } - uint32 workspaces = winBorder->Window()->Workspaces(); - int32 count = WorkspaceCount(); - int32 newWorkspace= 0; + uint32 workspaces = winBorder->Window()->Workspaces(); + int32 count = WorkspaceCount(); + int32 newWorkspace= 0; - if (workspaces & (0x00000001UL << (ActiveWorkspaceIndex()-1)) ){ + if (workspaces & (0x00000001UL << (ActiveWorkspaceIndex()-1)) ) + { newWorkspace = ActiveWorkspaceIndex(); } - else{ + else + { int32 i; for( i = 0; i < 32 && i < count; i++) - if( workspaces & (0x00000001UL << i)){ + if( workspaces & (0x00000001UL << i)) + { newWorkspace = i+1; break; } @@ -364,7 +459,8 @@ printf("*RootLayer::SetFrontWinBorder(%s) - main lock acquired\n", winBorder? wi newWorkspace = ActiveWorkspaceIndex(); } - if(newWorkspace != ActiveWorkspaceIndex()){ + if(newWorkspace != ActiveWorkspaceIndex()) + { WorkspaceAt(newWorkspace)->SetFrontLayer(winBorder); SetActiveWorkspaceByIndex(newWorkspace); } @@ -372,23 +468,25 @@ printf("*RootLayer::SetFrontWinBorder(%s) - main lock acquired\n", winBorder? wi ActiveWorkspace()->SetFrontLayer(winBorder); } -fMainLock.Unlock(); -printf("*RootLayer::SetFrontWinBorder(%s) - main lock released\n", winBorder? winBorder->GetName():"NULL"); -printf("#RootLayer::SetFrontWinBorder(%s)\n", winBorder? winBorder->GetName():"NULL"); + fMainLock.Unlock(); + STRACE(("*RootLayer::SetFrontWinBorder(%s) - main lock released\n", winBorder? winBorder->GetName():"NULL")); + STRACE(("#RootLayer::SetFrontWinBorder(%s)\n", winBorder? winBorder->GetName():"NULL")); return true; } //--------------------------------------------------------------------------- -void RootLayer::SetScreens(Screen *screen[], int32 rows, int32 columns){ -// NOTE: *All* Screens *MUST* have the same resolution. +void RootLayer::SetScreens(Screen *screen[], int32 rows, int32 columns) +{ + // NOTE: All screens *must* have the same resolution fScreenPtrList.MakeEmpty(); BRect newFrame(0, 0, 0, 0); - for (int32 i=0; i < rows; i++){ + for (int32 i=0; i < rows; i++) + { if (i==0) - for(int32 j=0; j < columns; j++){ - fScreenPtrList.AddItem(screen[i*rows + j]); - - newFrame.right += screen[i*rows + j]->Resolution().x; - } + for(int32 j=0; j < columns; j++) + { + fScreenPtrList.AddItem(screen[i*rows + j]); + newFrame.right += screen[i*rows + j]->Resolution().x; + } newFrame.bottom += screen[i*rows]->Resolution().y; } @@ -405,30 +503,34 @@ void RootLayer::SetScreens(Screen *screen[], int32 rows, int32 columns){ // Invalidate(Frame()); } //--------------------------------------------------------------------------- -Screen** RootLayer::Screens(){ +Screen** RootLayer::Screens() +{ return (Screen**)fScreenPtrList.Items(); } //--------------------------------------------------------------------------- -bool RootLayer::SetScreenResolution(int32 width, int32 height, uint32 colorspace){ - // if there is no need to change resolution... exit +bool RootLayer::SetScreenResolution(int32 width, int32 height, uint32 colorspace) +{ if (fScreenXResolution == width && fScreenYResolution == height && fColorSpace == colorspace) return false; - bool accepted = true; + bool accepted = true; - for (int i=0; i < fScreenPtrList.CountItems(); i++){ - Screen *screen; - screen = static_cast(fScreenPtrList.ItemAt(i)); + for (int i=0; i < fScreenPtrList.CountItems(); i++) + { + Screen *screen; + screen = static_cast(fScreenPtrList.ItemAt(i)); if ( !(screen->SupportsResolution(BPoint(width, height), colorspace)) ) - accepted = false; + accepted = false; } - if (accepted){ - for (int i=0; i < fScreenPtrList.CountItems(); i++){ - Screen *screen; - screen = static_cast(fScreenPtrList.ItemAt(i)); + if (accepted) + { + for (int i=0; i < fScreenPtrList.CountItems(); i++) + { + Screen *screen; + screen = static_cast(fScreenPtrList.ItemAt(i)); screen->SetResolution(BPoint(width, height), colorspace); } @@ -442,75 +544,86 @@ bool RootLayer::SetScreenResolution(int32 width, int32 height, uint32 colorspace return false; } //--------------------------------------------------------------------------- -void RootLayer::SetWorkspaceCount(const int32 count){ -printf("*RootLayer::SetWorkspaceCount(%ld)\n", count); +void RootLayer::SetWorkspaceCount(const int32 count) +{ + STRACE(("*RootLayer::SetWorkspaceCount(%ld)\n", count)); + if ((count < 1 && count > 32) || count == WorkspaceCount()) return; - int32 exActiveWorkspaceIndex = ActiveWorkspaceIndex(); + int32 exActiveWorkspaceIndex = ActiveWorkspaceIndex(); - BList newWSPtrList; - void *workspacePtr; + BList newWSPtrList; + void *workspacePtr; -fMainLock.Lock(); -printf("*RootLayer::SetWorkspaceCount(%ld) - main lock acquired\n", count); - for(int i=0; i < count; i++){ + fMainLock.Lock(); + STRACE(("*RootLayer::SetWorkspaceCount(%ld) - main lock acquired\n", count)); + + for(int i=0; i < count; i++) + { workspacePtr = fWSPtrList.ItemAt(i); - if (workspacePtr){ + if (workspacePtr) newWSPtrList.AddItem(workspacePtr); - } - else{ + else + { Workspace *ws; - ws = new Workspace(fColorSpace, i+1, BGColor(), this); + ws = new Workspace(fColorSpace, i+1, BGColor(), this); newWSPtrList.AddItem(ws); } } - // delete other Workspace objects if WS count is smaller than current one. - for (int j=count; j < fWSPtrList.CountItems(); j++){ + // delete other Workspace objects if the count is smaller than current one. + for (int j=count; j < fWSPtrList.CountItems(); j++) + { Workspace *ws = NULL; - ws = static_cast(fWSPtrList.ItemAt(j)); - if (ws){ + ws = static_cast(fWSPtrList.ItemAt(j)); + if (ws) delete ws; - } - else{ - printf("\nSERVER: PANIC: in RootLayer::SetWorkspaceCount()\n\n"); + else + { + STRACE(("\nSERVER: PANIC: in RootLayer::SetWorkspaceCount()\n\n")); return; } } - fWSPtrList = newWSPtrList; + fWSPtrList = newWSPtrList; -fMainLock.Unlock(); -printf("*RootLayer::SetWorkspaceCount(%ld) - main lock released\n", count); + fMainLock.Unlock(); + STRACE(("*RootLayer::SetWorkspaceCount(%ld) - main lock released\n", count)); + if (exActiveWorkspaceIndex > count) SetActiveWorkspaceByIndex(count); - // if true, this is the first time this method is called. + // if true, this is the first time this method is called. if (exActiveWorkspaceIndex == -1) SetActiveWorkspaceByIndex(1); -printf("#RootLayer::SetWorkspaceCount(%ld)\n", count); + + STRACE(("#RootLayer::SetWorkspaceCount(%ld)\n", count)); } //--------------------------------------------------------------------------- -int32 RootLayer::WorkspaceCount() const{ +int32 RootLayer::WorkspaceCount() const +{ return fWSPtrList.CountItems(); } //--------------------------------------------------------------------------- -Workspace* RootLayer::WorkspaceAt(const int32 index) const{ - Workspace *ws = NULL; - ws = static_cast(fWSPtrList.ItemAt(index-1)); +Workspace* RootLayer::WorkspaceAt(const int32 index) const +{ + Workspace *ws = NULL; + ws = static_cast(fWSPtrList.ItemAt(index-1)); return ws; } //--------------------------------------------------------------------------- -void RootLayer::SetActiveWorkspaceByIndex(const int32 index){ - Workspace *ws = NULL; - ws = static_cast(fWSPtrList.ItemAt(index-1)); +void RootLayer::SetActiveWorkspaceByIndex(const int32 index) +{ + Workspace *ws = NULL; + ws = static_cast(fWSPtrList.ItemAt(index-1)); if (ws) SetActiveWorkspace(ws); } //--------------------------------------------------------------------------- -void RootLayer::SetActiveWorkspace(Workspace *ws){ +void RootLayer::SetActiveWorkspace(Workspace *ws) +{ if (fActiveWorkspace == ws || !ws) return; @@ -527,11 +640,13 @@ int32 RootLayer::ActiveWorkspaceIndex() const{ return -1; } //--------------------------------------------------------------------------- -Workspace* RootLayer::ActiveWorkspace() const{ +Workspace* RootLayer::ActiveWorkspace() const +{ return fActiveWorkspace; } //--------------------------------------------------------------------------- -void RootLayer::SetBGColor(const RGBColor &col){ +void RootLayer::SetBGColor(const RGBColor &col) +{ ActiveWorkspace()->SetBGColor(col); _layerdata->viewcolor = col; @@ -539,29 +654,32 @@ void RootLayer::SetBGColor(const RGBColor &col){ // Invalidate(Frame()); } //--------------------------------------------------------------------------- -RGBColor RootLayer::BGColor(void) const{ +RGBColor RootLayer::BGColor(void) const +{ return _layerdata->viewcolor; } //--------------------------------------------------------------------------- -void RootLayer::RemoveAppWindow(WinBorder *wb){ +void RootLayer::RemoveAppWindow(WinBorder *wb) +{ wb->Window()->App()->fAppFMWList.RemoveItem(wb); int32 count = WorkspaceCount(); - for(int32 i=0; i < count; i++){ + for(int32 i=0; i < count; i++) WorkspaceAt(i+1)->RemoveLayerPtr(wb); - } } //--------------------------------------------------------------------------- -void RootLayer::PrintToStream(){ +void RootLayer::PrintToStream() +{ printf("\nRootLayer '%s' internals:\n", GetName()); printf("Screen list:\n"); - for(int32 i=0; iScreenNumber()); - } + printf("Screen rows: %ld\nScreen columns: %ld\n", fRows, fColumns); printf("Resolution for all Screens: %ldx%ldx%ld\n", fScreenXResolution, fScreenYResolution, fColorSpace); printf("Workspace list:\n"); - for(int32 i=0; iID()); ((Workspace*)fWSPtrList.ItemAt(i))->PrintToStream(); printf("~~~~~~~~\n"); diff --git a/src/servers/app/server/ServerApp.cpp b/src/servers/app/server/ServerApp.cpp index fa3a3099d7..a9712153b1 100644 --- a/src/servers/app/server/ServerApp.cpp +++ b/src/servers/app/server/ServerApp.cpp @@ -34,11 +34,14 @@ #include +#include +#include #include #include #include #include +#include "AppServer.h" #include "BitmapManager.h" #include "CursorManager.h" #include "Desktop.h" @@ -80,7 +83,7 @@ ServerApp::ServerApp(port_id sendport, port_id rcvport, port_id clientLooperPort // need to copy the _signature because the message buffer // owns the copy which we are passed as a parameter. - _signature=(signature)?signature:"application/x-vnd.unregistered-application"; + _signature=(signature)?signature:"application/x-vnd.NULL-application-signature"; // token ID of the BApplication's BHandler object. Used for BMessage target specification _handlertoken=handlerID; @@ -106,8 +109,9 @@ ServerApp::ServerApp(port_id sendport, port_id rcvport, port_id clientLooperPort _appcursor=(defaultc)?new ServerCursor(defaultc):NULL; _lock=create_sem(1,"ServerApp sem"); -//TODO: resolve -// _driver=GetGfxDriver(ActiveScreen()); + // Does this even belong here any more? --DW +// _driver=desktop->GetDisplayDriver(); + _cursorhidden=false; Run(); @@ -345,6 +349,7 @@ void ServerApp::SetAppCursor(void) case B_QUIT_REQUESTED: { + STRACE(("ServerApp %s: B_QUIT_REQUESTED\n",app->_signature.String())); // Our BApplication sent us this message when it quit. // We need to ask the app_server to delete our monitor // ADI: No! This is a bad solution. A thead should continue its @@ -393,6 +398,8 @@ void ServerApp::_DispatchMessage(PortMessage *msg) { case AS_UPDATED_CLIENT_FONTLIST: { + STRACE(("ServerApp %s: Acknowledged update of client-side font list\n",_signature.String())); + // received when the client-side global font list has been // refreshed fontserver->Lock(); @@ -402,6 +409,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_UPDATE_COLORS: { + STRACE(("ServerApp %s: Received global UI color update notification\n",_signature.String())); ServerWindow *win; BMessage msg(_COLORS_UPDATED); @@ -417,6 +425,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_UPDATE_FONTS: { + STRACE(("ServerApp %s: Received global font update notification\n",_signature.String())); ServerWindow *win; BMessage msg(_FONTS_UPDATED); @@ -432,6 +441,8 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_UPDATE_DECORATOR: { + STRACE(("ServerApp %s: Received decorator update notification\n",_signature.String())); + ServerWindow *win; for(int32 i=0; i<_winlist->CountItems(); i++) @@ -479,8 +490,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) msg->ReadString(&title); msg->Read(&replyport); - STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n", - _signature.String())); + STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n",_signature.String())); // ServerWindow constructor will reply with port_id of a newly created port new ServerWindow(frame, title, look, feel, flags, this, @@ -497,6 +507,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_CREATE_BITMAP: { + STRACE(("ServerApp %s: Received BBitmap creation request\n",_signature.String())); // Allocate a bitmap for an application // Attached Data: @@ -552,6 +563,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_DELETE_BITMAP: { + STRACE(("ServerApp %s: received BBitmap delete request\n",_signature.String())); // Delete a bitmap's allocated memory // Attached Data: @@ -610,6 +622,8 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_SET_SCREEN_MODE: { + STRACE(("ServerApp %s: Set Screen Mode\n",_signature.String())); + // Attached data // 1) int32 workspace # // 2) uint32 screen mode @@ -620,21 +634,24 @@ void ServerApp::_DispatchMessage(PortMessage *msg) msg->Read(&workspace); msg->Read(&mode); msg->Read(&stick); -//TODO: Resolve -// SetSpace(workspace,mode,ActiveScreen(),stick); + + //TODO: Resolve + //SetSpace(workspace,mode,ActiveScreen(),stick); break; } case AS_ACTIVATE_WORKSPACE: { + STRACE(("ServerApp %s: Activate Workspace\n",_signature.String())); // Attached data // 1) int32 workspace index // Error-checking is done in ActivateWorkspace, so this is a safe call int32 workspace; msg->Read(&workspace); -//TODO: Resolve -// SetWorkspace(workspace); + + //TODO: Resolve + //SetWorkspace(workspace); break; } @@ -642,23 +659,27 @@ void ServerApp::_DispatchMessage(PortMessage *msg) // call the CursorManager's version to allow for future expansion case AS_SHOW_CURSOR: { + STRACE(("ServerApp %s: Show Cursor\n",_signature.String())); cursormanager->ShowCursor(); _cursorhidden=false; break; } case AS_HIDE_CURSOR: { + STRACE(("ServerApp %s: Hide Cursor\n",_signature.String())); cursormanager->HideCursor(); _cursorhidden=true; break; } case AS_OBSCURE_CURSOR: { + STRACE(("ServerApp %s: Obscure Cursor\n",_signature.String())); cursormanager->ObscureCursor(); break; } case AS_QUERY_CURSOR_HIDDEN: { + STRACE(("ServerApp %s: Received IsCursorHidden request\n",_signature.String())); // Attached data // 1) int32 port to reply to int32 replyport; @@ -669,6 +690,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_SET_CURSOR_DATA: { + STRACE(("ServerApp %s: SetCursor via cursor data\n",_signature.String())); // Attached data: 68 bytes of _appcursor data int8 cdata[68]; @@ -689,6 +711,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_SET_CURSOR_BCURSOR: { + STRACE(("ServerApp %s: SetCursor via BCursor\n",_signature.String())); // Attached data: // 1) bool flag to send a reply // 2) int32 token ID of the cursor to set @@ -715,6 +738,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_CREATE_BCURSOR: { + STRACE(("ServerApp %s: Create BCursor\n",_signature.String())); // Attached data: // 1) 68 bytes of _appcursor data // 2) port_id reply port @@ -737,6 +761,7 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_DELETE_BCURSOR: { + STRACE(("ServerApp %s: Delete BCursor\n",_signature.String())); // Attached data: // 1) int32 token ID of the cursor to delete int32 ctoken; @@ -750,32 +775,35 @@ void ServerApp::_DispatchMessage(PortMessage *msg) } case AS_GET_SCROLLBAR_INFO: { + STRACE(("ServerApp %s: Get ScrollBar info\n",_signature.String())); // Attached data: // 1) port_id reply port - synchronous message -//TODO: resolve -// scroll_bar_info sbi=GetScrollBarInfo(); + + scroll_bar_info sbi=desktop->ScrollBarInfo(); port_id replyport; msg->Read(&replyport); PortLink link(replyport); -//TODO: resolve -// link.Attach(sbi); + + link.Attach(sbi); link.Flush(); break; } case AS_SET_SCROLLBAR_INFO: { + STRACE(("ServerApp %s: Set ScrollBar info\n",_signature.String())); // Attached Data: // 1) scroll_bar_info scroll bar info structure scroll_bar_info sbi; msg->Read(&sbi); -//TODO: resolve -// SetScrollBarInfo(sbi); + + desktop->SetScrollBarInfo(sbi); break; } case AS_FOCUS_FOLLOWS_MOUSE: { + STRACE(("ServerApp %s: query Focus Follow Mouse in use\n",_signature.String())); // Attached data: // 1) port_id reply port - synchronous message @@ -783,51 +811,69 @@ void ServerApp::_DispatchMessage(PortMessage *msg) msg->Read(&replyport); PortLink link(replyport); -//TODO: resolve -// link.Attach(GetFFMouse()); + + link.Attach(desktop->FFMouseInUse()); link.Flush(); break; } case AS_SET_FOCUS_FOLLOWS_MOUSE: { + STRACE(("ServerApp %s: Set Focus Follows Mouse in use\n",_signature.String())); // Attached Data: // 1) scroll_bar_info scroll bar info structure scroll_bar_info sbi; msg->Read(&sbi); -//TODO: resolve -// SetScrollBarInfo(sbi); + + desktop->SetScrollBarInfo(sbi); break; } case AS_SET_MOUSE_MODE: { + STRACE(("ServerApp %s: Set Focus Follows Mouse mode\n",_signature.String())); // Attached Data: // 1) enum mode_mouse FFM mouse mode mode_mouse mmode; msg->Read(&mmode); -//TODO: resolve -// SetFFMouseMode(mmode); + + desktop->SetFFMouseMode(mmode); break; } case AS_GET_MOUSE_MODE: { + STRACE(("ServerApp %s: Get Focus Follows Mouse mode\n",_signature.String())); // Attached data: // 1) port_id reply port - synchronous message -//TODO: resolve -// mode_mouse mmode=GetFFMouseMode(); + + mode_mouse mmode=desktop->FFMouseMode(); port_id replyport; msg->Read(&replyport); PortLink link(replyport); -//TODO: resolve -// link.Attach(mmode); + + link.Attach(mmode); link.Flush(); break; } case AS_GET_UI_COLOR: { - // TODO: get a partiular UI color and return it to the sender - printf("ServerApp::AS_GET_UI_COLOR unimplemented\n"); + STRACE(("ServerApp %s: Get UI color\n",_signature.String())); + + RGBColor color; + int32 whichcolor; + port_id replyport; + + msg->Read(&whichcolor); + msg->Read(&replyport); + + gui_colorset.Lock(); + color=gui_colorset.AttributeToColor(whichcolor); + gui_colorset.Unlock(); + + PortLink replylink(replyport); + replylink.SetOpCode(SERVER_TRUE); + replylink.Attach(color.GetColor32()); + replylink.Flush(); break; } default: diff --git a/src/servers/app/server/ServerPicture.cpp b/src/servers/app/server/ServerPicture.cpp index a1d3b793ad..e0bc22b3d5 100644 --- a/src/servers/app/server/ServerPicture.cpp +++ b/src/servers/app/server/ServerPicture.cpp @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: ServerPicture.cpp +// Author: DarkWyrm +// Description: Server-side counterpart to BPicture +// +//------------------------------------------------------------------------------ #include #include "TokenHandler.h" #include "ServerPicture.h" diff --git a/src/servers/app/server/ServerPicture.h b/src/servers/app/server/ServerPicture.h index 9f08bb756d..dc85f69de7 100644 --- a/src/servers/app/server/ServerPicture.h +++ b/src/servers/app/server/ServerPicture.h @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: ServerPicture.cpp +// Author: DarkWyrm +// Description: Server-side counterpart to BPicture +// +//------------------------------------------------------------------------------ #ifndef SERVER_PICTURE_H #define SERVER_PICTURE_H diff --git a/src/servers/app/server/ServerScreen.cpp b/src/servers/app/server/ServerScreen.cpp index d721d3ac6b..2251105473 100644 --- a/src/servers/app/server/ServerScreen.cpp +++ b/src/servers/app/server/ServerScreen.cpp @@ -1,4 +1,29 @@ - +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: ServerScreen.cpp +// Author: Adi Oanca +// Description: Handles individual screens +// +//------------------------------------------------------------------------------ #include #include #include diff --git a/src/servers/app/server/ServerScreen.h b/src/servers/app/server/ServerScreen.h index e57ea7ecf5..1e13270a9a 100644 --- a/src/servers/app/server/ServerScreen.h +++ b/src/servers/app/server/ServerScreen.h @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: ServerScreen.h +// Author: Adi Oanca +// Description: Handles individual screens +// +//------------------------------------------------------------------------------ #ifndef _SCREEN_H_ #define _SCREEN_H_ diff --git a/src/servers/app/server/Utils.cpp b/src/servers/app/server/Utils.cpp index e2599c2517..aa2c3db5a4 100644 --- a/src/servers/app/server/Utils.cpp +++ b/src/servers/app/server/Utils.cpp @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: Utils.cpp +// Author: DarkWyrm +// Description: Miscellaneous utility functions +// +//------------------------------------------------------------------------------ #include #include #include "Utils.h" diff --git a/src/servers/app/server/Utils.h b/src/servers/app/server/Utils.h index fa1f7dfede..ea752305df 100644 --- a/src/servers/app/server/Utils.h +++ b/src/servers/app/server/Utils.h @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: Utils.h +// Author: DarkWyrm +// Description: Miscellaneous utility functions +// +//------------------------------------------------------------------------------ #ifndef UTILS_H_ #define UTILS_H_ diff --git a/src/servers/app/server/WinBorder.cpp b/src/servers/app/server/WinBorder.cpp index fdb6a28c66..16ec79ef9a 100644 --- a/src/servers/app/server/WinBorder.cpp +++ b/src/servers/app/server/WinBorder.cpp @@ -21,6 +21,7 @@ // // File Name: WinBorder.cpp // Author: DarkWyrm +// Adi Oanca // Description: Layer subclass which handles window management // //------------------------------------------------------------------------------ diff --git a/src/servers/app/server/Workspace.cpp b/src/servers/app/server/Workspace.cpp index 760b8aebcd..0249b60bb5 100644 --- a/src/servers/app/server/Workspace.cpp +++ b/src/servers/app/server/Workspace.cpp @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: Workspace.cpp +// Author: Adi Oanca +// Description: Tracks workspaces +// +//------------------------------------------------------------------------------ #include #include diff --git a/src/servers/app/server/Workspace.h b/src/servers/app/server/Workspace.h index aa59d45c7e..712a6998dc 100644 --- a/src/servers/app/server/Workspace.h +++ b/src/servers/app/server/Workspace.h @@ -1,3 +1,29 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: Workspace.h +// Author: Adi Oanca +// Description: Tracks workspaces +// +//------------------------------------------------------------------------------ #ifndef _WORKSPACE_H_ #define _WORKSPACE_H_