Janitorial work and minor ServerWindow tweaks

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7907 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2004-06-11 14:47:36 +00:00
parent 768ec791c9
commit 70e337a0b4
4 changed files with 702 additions and 809 deletions
+49 -40
View File
@@ -53,12 +53,13 @@
//#define DISPLAYDRIVER_TEST_HACK
//---------------------------------------------------------------------------
RootLayer::RootLayer(const char *name, int32 workspaceCount,
Desktop *desktop, DisplayDriver *driver)
: Layer(BRect(0,0,0,0), name, 0, B_FOLLOW_ALL, B_WILL_DRAW, driver)
{
fDesktop = desktop;
//NOTE: be careful about this one.
fRootLayer = this;
fActiveWorkspace = NULL;
@@ -75,12 +76,12 @@ RootLayer::RootLayer(const char *name, int32 workspaceCount,
SetWorkspaceCount(workspaceCount);
}
//---------------------------------------------------------------------------
RootLayer::~RootLayer()
{
// RootLayer object just uses Screen objects, it is not allowed to delete them.
}
//---------------------------------------------------------------------------
void RootLayer::Draw(const BRect &r)
{
// REMOVEME: This method is here because of DisplayDriver testing ONLY.
@@ -154,39 +155,40 @@ void RootLayer::Draw(const BRect &r)
_driver->FillRoundRect(BRect(800,1000,1200,1090),30,40,_layerdata,pattern2);
_driver->FillPolygon(polygon,6,polygonRect,_layerdata,pattern);
// _driver->FillTriangle(triangle,triangleRect,_layerdata,pattern);
#endif
#endif // end DISPLAYDRIVER_TEST_HACK
}
//---------------------------------------------------------------------------
void RootLayer::MoveBy(float x, float y)
{
}
//---------------------------------------------------------------------------
void RootLayer::ResizeBy(float x, float y)
{
// TODO: implement
}
//---------------------------------------------------------------------------
Layer* RootLayer::VirtualTopChild() const
{
return fActiveWorkspace->GoToTopItem();
}
//---------------------------------------------------------------------------
Layer* RootLayer::VirtualLowerSibling() const
{
return fActiveWorkspace->GoToLowerItem();
}
//---------------------------------------------------------------------------
Layer* RootLayer::VirtualUpperSibling() const
{
return fActiveWorkspace->GoToUpperItem();
}
//---------------------------------------------------------------------------
Layer* RootLayer::VirtualBottomChild() const
{
return fActiveWorkspace->GoToBottomItem();
}
//---------------------------------------------------------------------------
void RootLayer::AddWinBorderToWorkspaces(WinBorder* winBorder, uint32 wks)
{
if (!(fMainLock.IsLocked()))
@@ -204,7 +206,7 @@ void RootLayer::AddWinBorderToWorkspaces(WinBorder* winBorder, uint32 wks)
WorkspaceAt(i+1)->AddLayerPtr(winBorder);
}
}
//---------------------------------------------------------------------------
void RootLayer::AddWinBorder(WinBorder* winBorder)
{
// The main job of this function, besides adding winBorder as a child, is to determine
@@ -235,7 +237,6 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
// will be called.
break;
}
case B_MODAL_APP_WINDOW_FEEL:
{
// add to app's list of Floating/Modal windows (as opposed to the system's)
@@ -317,7 +318,6 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
AddWinBorderToWorkspaces(winBorder, winBorder->Window()->Workspaces());
break;
}
case B_SYSTEM_LAST:
case B_SYSTEM_FIRST:
{
@@ -338,14 +338,12 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
STRACE(("#RootLayer::AddWinBorder(%s)\n", winBorder->GetName()));
}
//---------------------------------------------------------------------------
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.
// 3) Removes this window from RootLayer's list of children.
desktop->fGeneralLock.Lock();
fMainLock.Lock();
@@ -355,11 +353,13 @@ void RootLayer::RemoveWinBorder(WinBorder* winBorder)
{
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
else
if(feel == B_MODAL_ALL_WINDOW_FEEL || feel == B_FLOATING_ALL_WINDOW_FEEL
|| feel == B_SYSTEM_FIRST || feel == B_SYSTEM_LAST)
{
if(feel == B_MODAL_ALL_WINDOW_FEEL || feel == B_FLOATING_ALL_WINDOW_FEEL)
@@ -374,16 +374,18 @@ void RootLayer::RemoveWinBorder(WinBorder* winBorder)
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);
}
}
RemoveChild(winBorder);
fMainLock.Unlock();
desktop->fGeneralLock.Unlock();
}
//---------------------------------------------------------------------------
void RootLayer::ChangeWorkspacesFor(WinBorder* winBorder, uint32 newWorkspaces)
{
// only normal windows are affected by this change
@@ -397,17 +399,19 @@ void RootLayer::ChangeWorkspacesFor(WinBorder* winBorder, uint32 newWorkspaces)
{
// 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)
{
if(!winBorder)
@@ -436,11 +440,13 @@ bool RootLayer::SetFrontWinBorder(WinBorder* winBorder)
{
int32 i;
for( i = 0; i < 32 && i < count; i++)
{
if( workspaces & (0x00000001UL << i))
{
newWorkspace = i+1;
break;
}
}
if (i == count || i == 32)
newWorkspace = ActiveWorkspaceIndex();
@@ -451,7 +457,8 @@ bool RootLayer::SetFrontWinBorder(WinBorder* winBorder)
WorkspaceAt(newWorkspace)->SetFrontLayer(winBorder);
SetActiveWorkspaceByIndex(newWorkspace);
}
else{
else
{
ActiveWorkspace()->SetFrontLayer(winBorder);
}
@@ -460,7 +467,7 @@ bool RootLayer::SetFrontWinBorder(WinBorder* winBorder)
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
@@ -469,11 +476,13 @@ void RootLayer::SetScreens(Screen *screen[], int32 rows, int32 columns)
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;
}
}
newFrame.bottom += screen[i*rows]->Resolution().y;
}
@@ -486,14 +495,15 @@ void RootLayer::SetScreens(Screen *screen[], int32 rows, int32 columns)
fScreenXResolution = (int32)(screen[0]->Resolution().x);
fScreenYResolution = (int32)(screen[0]->Resolution().y);
// NOTE: a RebuildFullRegion() followed by FullInvalidate() are required after calling this method!
// NOTE: a RebuildFullRegion() followed by FullInvalidate() are required after calling
// this method!
}
//---------------------------------------------------------------------------
Screen **RootLayer::Screens()
{
return (Screen**)fScreenPtrList.Items();
}
//---------------------------------------------------------------------------
bool RootLayer::SetScreenResolution(int32 width, int32 height, uint32 colorspace)
{
if (fScreenXResolution == width && fScreenYResolution == height &&
@@ -529,7 +539,7 @@ bool RootLayer::SetScreenResolution(int32 width, int32 height, uint32 colorspace
return false;
}
//---------------------------------------------------------------------------
void RootLayer::SetWorkspaceCount(const int32 count)
{
STRACE(("*RootLayer::SetWorkspaceCount(%ld)\n", count));
@@ -586,12 +596,12 @@ void RootLayer::SetWorkspaceCount(const int32 count)
STRACE(("#RootLayer::SetWorkspaceCount(%ld)\n", count));
}
//---------------------------------------------------------------------------
int32 RootLayer::WorkspaceCount() const
{
return fWSPtrList.CountItems();
}
//---------------------------------------------------------------------------
Workspace* RootLayer::WorkspaceAt(const int32 index) const
{
Workspace *ws = NULL;
@@ -599,7 +609,7 @@ Workspace* RootLayer::WorkspaceAt(const int32 index) const
return ws;
}
//---------------------------------------------------------------------------
void RootLayer::SetActiveWorkspaceByIndex(const int32 index)
{
Workspace *ws = NULL;
@@ -607,7 +617,7 @@ void RootLayer::SetActiveWorkspaceByIndex(const int32 index)
if (ws)
SetActiveWorkspace(ws);
}
//---------------------------------------------------------------------------
void RootLayer::SetActiveWorkspace(Workspace *ws)
{
if (fActiveWorkspace == ws || !ws)
@@ -618,19 +628,19 @@ void RootLayer::SetActiveWorkspace(Workspace *ws)
// RebuildRegions(Frame());
// Invalidate(Frame());
}
//---------------------------------------------------------------------------
int32 RootLayer::ActiveWorkspaceIndex() const{
if (fActiveWorkspace)
return fActiveWorkspace->ID();
else
return -1;
}
//---------------------------------------------------------------------------
Workspace* RootLayer::ActiveWorkspace() const
{
return fActiveWorkspace;
}
//---------------------------------------------------------------------------
void RootLayer::SetBGColor(const RGBColor &col)
{
ActiveWorkspace()->SetBGColor(col);
@@ -639,12 +649,12 @@ void RootLayer::SetBGColor(const RGBColor &col)
// Invalidate(Frame());
}
//---------------------------------------------------------------------------
RGBColor RootLayer::BGColor(void) const
{
return _layerdata->viewcolor;
}
//---------------------------------------------------------------------------
void RootLayer::RemoveAppWindow(WinBorder *wb)
{
wb->Window()->App()->fAppFMWList.RemoveItem(wb);
@@ -653,7 +663,7 @@ void RootLayer::RemoveAppWindow(WinBorder *wb)
for(int32 i=0; i < count; i++)
WorkspaceAt(i+1)->RemoveLayerPtr(wb);
}
//---------------------------------------------------------------------------
void RootLayer::PrintToStream()
{
printf("\nRootLayer '%s' internals:\n", GetName());
@@ -671,5 +681,4 @@ void RootLayer::PrintToStream()
printf("~~~~~~~~\n");
}
printf("Active Workspace: %ld\n", fActiveWorkspace? fActiveWorkspace->ID(): -1);
}
+15 -14
View File
@@ -52,18 +52,19 @@ class DisplayDriver;
class RootLayer : public Layer
{
public:
RootLayer(const char *name,
int32 workspaceCount, Desktop *desktop, DisplayDriver *driver);
virtual ~RootLayer();
RootLayer(const char *name, int32 workspaceCount, Desktop *desktop,
DisplayDriver *driver);
virtual ~RootLayer(void);
virtual void Draw(const BRect &r);
virtual void MoveBy(float x, float y);
virtual void ResizeBy(float x, float y);
virtual Layer* VirtualTopChild() const; //
virtual Layer* VirtualLowerSibling() const; // ... for the active workspace
virtual Layer* VirtualUpperSibling() const; //
virtual Layer* VirtualBottomChild() const; //
// For the active workspaces
virtual Layer *VirtualTopChild(void) const;
virtual Layer *VirtualLowerSibling(void) const;
virtual Layer *VirtualUpperSibling(void) const;
virtual Layer *VirtualBottomChild(void) const;
void AddWinBorder(WinBorder *winBorder);
void RemoveWinBorder(WinBorder *winBorder);
@@ -71,10 +72,10 @@ public:
bool SetFrontWinBorder(WinBorder *winBorder);
void SetScreens(Screen *screen[], int32 rows, int32 columns);
Screen** Screens();
Screen **Screens(void);
bool SetScreenResolution(int32 width, int32 height, uint32 colorspace);
int32 ScreenRows() const { return fRows; }
int32 ScreenColumns() const { return fColumns; }
int32 ScreenRows(void) const { return fRows; }
int32 ScreenColumns(void) const { return fColumns; }
void SetWorkspaceCount(const int32 count);
int32 WorkspaceCount(void) const;
@@ -87,16 +88,16 @@ public:
void SetBGColor(const RGBColor &col);
RGBColor BGColor(void) const;
void AddWinBorderToWorkspaces(WinBorder* winBorder,
uint32 wks);
void AddWinBorderToWorkspaces(WinBorder *winBorder, uint32 wks);
void PrintToStream(void);
// ------- debugging methods -------
void PrintToStream();
// "Private" to app_server :-) - they should not be used
void RemoveAppWindow(WinBorder *wb);
FMWList fMainFMWList;
BLocker fMainLock;
private:
Desktop *fDesktop;
+186 -283
View File
@@ -128,19 +128,24 @@ ServerWindow::ServerWindow(BRect rect, const char *string, uint32 wlook,
if(string)
fTitle.SetTo(string);
fFrame = rect;
fFlags = wflags;
fLook = wlook;
fFeel = wfeel;
fHandlerToken = handlerID;
fClientLooperPort = looperPort;
fWorkspaces = index;
fClientTeamID = winapp->ClientTeamID();
fWorkspaces = index;
fWorkspace = NULL;
fWinBorder = NULL;
fTopLayer = NULL;
// fClientWinPort is the port to which the app awaits messages from the server
fClientWinPort = winport;
// fMessagePort is the port to which the app sends messages for the server
fMessagePort = create_port(30,fTitle.String());
@@ -153,9 +158,8 @@ ServerWindow::ServerWindow(BRect rect, const char *string, uint32 wlook,
winLink.Attach<port_id>(fMessagePort);
winLink.Flush();
int32 vCode;
// check the next 2 messages to make sure we receive top_view's attributes.
int32 vCode;
fSession->ReadInt32(&vCode);
if(vCode != AS_LAYER_CREATE_ROOT)
debugger("SERVER ERROR: ServerWindow(xxx): NO top_view data received! - 1\n");
@@ -164,15 +168,13 @@ ServerWindow::ServerWindow(BRect rect, const char *string, uint32 wlook,
if(vCode != AS_LAYER_CREATE)
debugger("SERVER ERROR: ServerWindow(xxx): NO top_view data received! - 2\n");
// start receiving top_view data. pass NULL as the parent view.
// Start receiving top_view data -- pass NULL as the parent view.
// This should be the *only* place where this happens.
fTopLayer = CreateLayerTree(NULL);
fTopLayer->SetAsTopLayer(true);
cl = fTopLayer;
// Create a WindoBorder object for our ServerWindow.
fWinBorder = new WinBorder( fFrame, fTitle.String(),
wlook, wfeel, wflags,
fWinBorder = new WinBorder( fFrame, fTitle.String(),wlook, wfeel, wflags,
this, desktop->GetDisplayDriver());
STRACE(("ServerWindow %s:\n",fTitle.String()));
@@ -181,14 +183,16 @@ ServerWindow::ServerWindow(BRect rect, const char *string, uint32 wlook,
STRACE(("\tWorkspace: %ld\n",index));
}
void ServerWindow::Init(){
void ServerWindow::Init(void)
{
fWinBorder->AddChild(fTopLayer);
// NOTE: this MUST be before the monitor thread is spawned!
desktop->AddWinBorder(fWinBorder);
// Spawn our message-monitoring fMonitorThreadID
// Spawn our message-monitoring thread
fMonitorThreadID = spawn_thread(MonitorWin, fTitle.String(), B_NORMAL_PRIORITY, this);
if(fMonitorThreadID != B_NO_MORE_THREADS && fMonitorThreadID != B_NO_MEMORY)
resume_thread(fMonitorThreadID);
}
@@ -201,16 +205,22 @@ STRACE(("*ServerWindow (%s):~ServerWindow()\n",fTitle.String()));
desktop->fGeneralLock.Lock();
desktop->RemoveWinBorder(fWinBorder);
STRACE(("SW(%s) Successfuly removed from the desktop\n", fTitle.String()));
if(fSession){
STRACE(("SW(%s) Successfully removed from the desktop\n", fTitle.String()));
if(fSession)
{
delete fSession;
fSession = NULL;
}
if (fWinBorder){
if (fWinBorder)
{
delete fWinBorder;
fWinBorder = NULL;
}
cl = NULL;
if (fTopLayer)
delete fTopLayer;
@@ -262,7 +272,6 @@ STRACE(("ServerWindow %s: Quit\n",fTitle.String()));
//! Shows the window's WinBorder
void ServerWindow::Show(void)
{
// whaaat?
if(!fWinBorder->IsHidden())
return;
@@ -278,31 +287,33 @@ void ServerWindow::Show(void)
rl->fMainLock.Lock();
STRACE(("ServerWindow(%s)::Show() - Main lock acquired\n", fWinBorder->GetName()));
// manualy set fWinBorder->_hidden to false because Layer's version also calls FullInvalidate.
// manually set fWinBorder->_hidden to false because Layer's version also calls FullInvalidate.
fWinBorder->_hidden=false;
if ( (fFeel == B_FLOATING_SUBSET_WINDOW_FEEL || fFeel == B_MODAL_SUBSET_WINDOW_FEEL)
&& fWinBorder->MainWinBorder() == NULL)
{
// This window hasn't been added to a normal window subset,
// so don't call placement or redrawing methods!
goto goOut;
// so don't call placement or redrawing methods
}
else
{
wksCount = rl->WorkspaceCount();
for(int32 i = 0; i < wksCount; i++){
if (fWorkspaces & (0x00000001UL << i)){
for(int32 i = 0; i < wksCount; i++)
{
if (fWorkspaces & (0x00000001UL << i))
{
Workspace *ws = rl->WorkspaceAt(i+1);
ws->BringToFrontANormalWindow(fWinBorder);
ws->SearchAndSetNewFront(fWinBorder);
ws->SetFocusLayer(fWinBorder);
}
}
goOut:
}
rl->fMainLock.Unlock();
STRACE(("ServerWindow(%s)::Show() - Main lock released\n", fWinBorder->GetName()));
desktop->fGeneralLock.Unlock();
STRACE(("ServerWindow(%s)::Show() - General lock released\n", fWinBorder->GetName()));
}
@@ -315,7 +326,8 @@ void ServerWindow::Hide(void)
return;
STRACE(("ServerWindow %s: Hide\n",fTitle.String()));
if(fWinBorder){
if(fWinBorder)
{
RootLayer *rl = fWinBorder->GetRootLayer();
Workspace *ws = NULL;
@@ -328,21 +340,23 @@ void ServerWindow::Hide(void)
fWinBorder->Hide();
int32 wksCount= rl->WorkspaceCount();
for(int32 i = 0; i < wksCount; i++){
for(int32 i = 0; i < wksCount; i++)
{
ws = rl->WorkspaceAt(i+1);
if (ws->FrontLayer() == fWinBorder){
if (ws->FrontLayer() == fWinBorder)
{
ws->HideSubsetWindows(fWinBorder);
ws->SetFocusLayer(ws->FrontLayer());
}
else{
if (ws->FocusLayer() == fWinBorder){
else
{
if (ws->FocusLayer() == fWinBorder)
ws->SetFocusLayer(fWinBorder);
}
else{
else
ws->Invalidate();
}
}
}
rl->fMainLock.Unlock();
STRACE(("ServerWindow(%s)::Hide() - Main lock released\n", fWinBorder->GetName()));
@@ -359,26 +373,33 @@ bool ServerWindow::IsHidden(void)
{
if(fWinBorder)
return fWinBorder->IsHidden();
return true;
}
void ServerWindow::Minimize(bool status){
void ServerWindow::Minimize(bool status)
{
bool sendMessages = false;
if (status){
if (!IsHidden()){
if (status)
{
if (!IsHidden())
{
Hide();
sendMessages = true;
}
}
else{
if (IsHidden()){
else
{
if (IsHidden())
{
Show();
sendMessages = true;
}
}
if (sendMessages){
if (sendMessages)
{
BMessage msg;
msg.what = B_MINIMIZE;
msg.AddInt64("when", real_time_clock_usecs());
@@ -386,11 +407,13 @@ void ServerWindow::Minimize(bool status){
SendMessageToClient(&msg);
// TODO: notify tracker! how???
// TODO: Do we need to notify Tracker? The Deskbar? If so, how?
}
}
void ServerWindow::Zoom(){
// Sends a message to the client to perform a Zoom
void ServerWindow::Zoom(void)
{
BMessage msg;
msg.what=B_ZOOM;
SendMessageToClient(&msg);
@@ -430,9 +453,10 @@ bool ServerWindow::HasFocus(void)
*/
void ServerWindow::WorkspaceActivated(int32 workspace, bool active)
{
STRACE(("ServerWindow %s: WorkspaceActivated(%ld,%s)\n",fTitle.String(),workspace,(active)?"active":"inactive"));
BMessage msg;
STRACE(("ServerWindow %s: WorkspaceActivated(%ld,%s)\n",fTitle.String(),
workspace,(active)?"active":"inactive"));
BMessage msg;
msg.what = B_WORKSPACE_ACTIVATED;
msg.AddInt32("workspace", workspace);
msg.AddBool("active", active);
@@ -448,8 +472,8 @@ STRACE(("ServerWindow %s: WorkspaceActivated(%ld,%s)\n",fTitle.String(),workspac
void ServerWindow::WorkspacesChanged(int32 oldone,int32 newone)
{
STRACE(("ServerWindow %s: WorkspacesChanged(%ld,%ld)\n",fTitle.String(),oldone,newone));
BMessage msg;
BMessage msg;
msg.what = B_WORKSPACES_CHANGED;
msg.AddInt32("old", oldone);
msg.AddInt32("new", newone);
@@ -464,8 +488,8 @@ STRACE(("ServerWindow %s: WorkspacesChanged(%ld,%ld)\n",fTitle.String(),oldone,n
void ServerWindow::WindowActivated(bool active)
{
STRACE(("ServerWindow %s: WindowActivated(%s)\n",fTitle.String(),(active)?"active":"inactive"));
BMessage msg;
BMessage msg;
msg.what = B_WINDOW_ACTIVATED;
msg.AddBool("active", active);
@@ -516,6 +540,7 @@ BRect ServerWindow::Frame(void)
status_t ServerWindow::Lock(void)
{
STRACE(("ServerWindow %s: Lock\n",fTitle.String()));
return (fLocker.Lock())?B_OK:B_ERROR;
}
@@ -523,6 +548,7 @@ STRACE(("ServerWindow %s: Lock\n",fTitle.String()));
void ServerWindow::Unlock(void)
{
STRACE(("ServerWindow %s: Unlock\n",fTitle.String()));
fLocker.Unlock();
}
@@ -535,67 +561,81 @@ bool ServerWindow::IsLocked(void)
return fLocker.IsLocked();
}
void ServerWindow::SetLayerFontState(Layer *layer){
/*!
\brief Sets the font state for a layer
\param layer The layer to set the font
*/
void ServerWindow::SetLayerFontState(Layer *layer)
{
uint16 mask;
fSession->ReadUInt16(&mask);
if (mask & B_FONT_FAMILY_AND_STYLE){
if (mask & B_FONT_FAMILY_AND_STYLE)
{
uint32 fontID;
fSession->ReadInt32((int32*)&fontID);
// TODO: implement later. Currently there is no SetFamAndStyle(uint32)
// in ServerFont class. DW, could you add one?
//layer->_layerdata->font->
}
if (mask & B_FONT_SIZE){
if (mask & B_FONT_SIZE)
{
float size;
fSession->ReadFloat(&size);
layer->_layerdata->font.SetSize(size);
}
if (mask & B_FONT_SHEAR){
if (mask & B_FONT_SHEAR)
{
float shear;
fSession->ReadFloat(&shear);
layer->_layerdata->font.SetShear(shear);
}
if (mask & B_FONT_ROTATION){
if (mask & B_FONT_ROTATION)
{
float rotation;
fSession->ReadFloat(&rotation);
layer->_layerdata->font.SetRotation(rotation);
}
if (mask & B_FONT_SPACING){
if (mask & B_FONT_SPACING)
{
uint8 spacing;
fSession->ReadUInt8(&spacing); // uint8
fSession->ReadUInt8(&spacing);
layer->_layerdata->font.SetSpacing(spacing);
}
if (mask & B_FONT_ENCODING){
if (mask & B_FONT_ENCODING)
{
uint8 encoding;
fSession->ReadUInt8((uint8*)&encoding); // uint8
fSession->ReadUInt8((uint8*)&encoding);
layer->_layerdata->font.SetEncoding(encoding);
}
if (mask & B_FONT_FACE){
if (mask & B_FONT_FACE)
{
uint16 face;
fSession->ReadUInt16(&face); // uint16
fSession->ReadUInt16(&face);
layer->_layerdata->font.SetFace(face);
}
if (mask & B_FONT_FLAGS){
if (mask & B_FONT_FLAGS)
{
uint32 flags;
fSession->ReadUInt32(&flags); // uint32
fSession->ReadUInt32(&flags);
layer->_layerdata->font.SetFlags(flags);
}
STRACE(("DONE: ServerWindow %s: Message AS_LAYER_SET_FONT_STATE: Layer: %s\n",fTitle.String(), layer->_name->String()));
STRACE(("DONE: ServerWindow %s: Message AS_LAYER_SET_FONT_STATE: Layer: %s\n",
fTitle.String(), layer->_name->String()));
}
void ServerWindow::SetLayerState(Layer *layer){
rgb_color highColor,
lowColor,
viewColor;
void ServerWindow::SetLayerState(Layer *layer)
{
rgb_color highColor, lowColor, viewColor;
pattern patt;
int32 clipRegRects;
@@ -621,7 +661,8 @@ void ServerWindow::SetLayerState(Layer *layer){
layer->_layerdata->lowcolor.SetColor(lowColor);
layer->_layerdata->viewcolor.SetColor(viewColor);
if(clipRegRects != 0){
if(clipRegRects != 0)
{
if(layer->_layerdata->clipReg == NULL)
layer->_layerdata->clipReg = new BRegion();
else
@@ -629,21 +670,26 @@ void ServerWindow::SetLayerState(Layer *layer){
BRect rect;
for(int32 i = 0; i < clipRegRects; i++){
for(int32 i = 0; i < clipRegRects; i++)
{
fSession->ReadRect(&rect);
layer->_layerdata->clipReg->Include(rect);
}
}
else{
if (layer->_layerdata->clipReg){
else
{
if (layer->_layerdata->clipReg)
{
delete layer->_layerdata->clipReg;
layer->_layerdata->clipReg = NULL;
}
}
STRACE(("DONE: ServerWindow %s: Message AS_LAYER_SET_STATE: Layer: %s\n",fTitle.String(), layer->_name->String()));
STRACE(("DONE: ServerWindow %s: Message AS_LAYER_SET_STATE: Layer: %s\n",fTitle.String(),
layer->_name->String()));
}
Layer* ServerWindow::CreateLayerTree(Layer *localRoot){
Layer * ServerWindow::CreateLayerTree(Layer *localRoot)
{
STRACE(("ServerWindow(%s)::CreateLayerTree()\n", fTitle.String()));
int32 token;
@@ -663,10 +709,11 @@ STRACE(("ServerWindow(%s)::CreateLayerTree()\n", fTitle.String()));
fSession->ReadInt32(&childCount);
Layer *newLayer;
newLayer = new Layer(frame.OffsetToCopy(0.0, 0.0), name, token, resizeMask, flags, desktop->GetDisplayDriver());
newLayer = new Layer(frame.OffsetToCopy(0.0, 0.0), name, token, resizeMask,
flags, desktop->GetDisplayDriver());
delete name;
// there is no way of setting this, other than manual. :-)
// there is no way of setting this, other than manually :-)
newLayer->_hidden = hidden;
int32 dummyMsg;
@@ -698,7 +745,9 @@ STRACE(("ServerWindow(%s)::CreateLayerTree()\n", fTitle.String()));
else
debugger("ServerWindow(%s) - AS_LAYER_CREATE Expected!\n");
}
STRACE(("DONE: ServerWindow %s: Message AS_CREATE_LAYER: Parent: %s, Child: %s\n", fTitle.String(), newLayer->_name->String(), name));
STRACE(("DONE: ServerWindow %s: Message AS_CREATE_LAYER: Parent: %s, Child: %s\n", fTitle.String(),
newLayer->_name->String(), name));
return newLayer;
}
@@ -728,6 +777,8 @@ void ServerWindow::DispatchMessage(int32 code)
cl->fDriver->DrawBitmap(&region, sbmp, src, dst, cl->_layerdata);
}
// TODO: Adi -- shouldn't this sync with the client?
break;
}
case AS_LAYER_DRAW_BITMAP_ASYNC_AT_POINT:
@@ -765,8 +816,16 @@ void ServerWindow::DispatchMessage(int32 code)
ServerBitmap *sbmp = fServerApp->FindBitmap(bitmapToken);
if(sbmp)
{
//cl->fDriver->DrawBitmap(&region, sbmp, srcRect, dstRect, cl->_layerdata);
BRegion region;
BRect dst;
region = cl->_parent->ConvertFromParent(&(cl->_full));
dst = cl->_parent->ConvertFromParent(cl->_full.Frame());
dstRect.OffsetBy(dst.left, dst.top);
cl->fDriver->DrawBitmap(&region, sbmp, srcRect, dstRect, cl->_layerdata);
}
// TODO: Adi -- shouldn't this sync with the client?
break;
}
case AS_LAYER_DRAW_BITMAP_ASYNC_IN_RECT:
@@ -788,9 +847,6 @@ void ServerWindow::DispatchMessage(int32 code)
dstRect.OffsetBy(dst.left, dst.top);
cl->fDriver->DrawBitmap(&region, sbmp, srcRect, dstRect, cl->_layerdata);
//printf("%d %d %d %d %d %d %d %d %d %d\n", (int)cl->_boundsLeftTop.x, (int)cl->_boundsLeftTop.y,
// (int)cl->_frame.left, (int)cl->_frame.top, (int)cl->_frame.right, (int)cl->_frame.bottom,
// (int)cl->_parent->_frame.left, (int)cl->_parent->_frame.top, (int)cl->_parent->_frame.right, (int)cl->_parent->_frame.bottom);
}
break;
}
@@ -801,6 +857,7 @@ void ServerWindow::DispatchMessage(int32 code)
fSession->ReadInt32(&token);
Layer *current = FindLayer(fTopLayer, token);
if (current)
cl=current;
else // hope this NEVER happens! :-)
@@ -820,7 +877,8 @@ void ServerWindow::DispatchMessage(int32 code)
// the less taxing operation - we call PruneTree() on the removed
// layer, detach the layer itself, delete it, and invalidate the
// area assuming that the view was visible when removed
STRACE(("SW %s: AS_LAYER_DELETE(self)...\n", fTitle.String()));
STRACE(("ServerWindow %s: AS_LAYER_DELETE(self)...\n", fTitle.String()));
Layer *parent;
parent = cl->_parent;
@@ -828,7 +886,7 @@ void ServerWindow::DispatchMessage(int32 code)
cl->RemoveSelf();
// TODO: invalidate the region occupied by this view.
// Should be done in Layer::RemoveChild() though!
// Should be done in Layer::RemoveChild() though
cl->PruneTree();
parent->PrintTree();
@@ -865,8 +923,9 @@ void ServerWindow::DispatchMessage(int32 code)
vc = ld->viewcolor.GetColor32();
patt = ld->patt.GetInt64();
// TODO: DW implement such a method in ServerFont class!
fSession->WriteUInt32(0UL /*uint32 ld->font.GetFamAndStyle()*/);
// TODO: DW implement such a method in ServerFont class
// fSession->WriteUInt32(ld->font.GetFamAndStyle());
fSession->WriteUInt32(0UL);
fSession->WriteFloat(ld->font.Size());
fSession->WriteFloat(ld->font.Shear());
fSession->WriteFloat(ld->font.Rotation());
@@ -897,9 +956,8 @@ void ServerWindow::DispatchMessage(int32 code)
fSession->WriteInt32(noOfRects);
for(int i = 0; i < noOfRects; i++){
for(int i = 0; i < noOfRects; i++)
fSession->WriteRect(ld->clipReg->RectAt(i));
}
fSession->WriteFloat(cl->_frame.left);
fSession->WriteFloat(cl->_frame.top);
@@ -1007,9 +1065,9 @@ void ServerWindow::DispatchMessage(int32 code)
{
int8 lineCap, lineJoin;
// TODO: speak with DW! Shouldn't we lock before modifying certain memebers?
// Because redraw code might use an updated value instead of one for witch
// it was called. e.g.: different lineCap or lineJoin. Strange result
// TODO: DW: Shouldn't we lock before modifying certain memebers?
// Redraw code might use an updated value instead of one for which
// it was called. e.g.: different lineCap or lineJoin. Strange results
// would appear.
fSession->ReadInt8(&lineCap);
@@ -1045,7 +1103,8 @@ void ServerWindow::DispatchMessage(int32 code)
}
case AS_LAYER_POP_STATE:
{
if (!(cl->_layerdata->prevState)) {
if (!(cl->_layerdata->prevState))
{
STRACE(("WARNING: SW(%s): User called BView(%s)::PopState(), but there is NO state on stack!\n", fTitle.String(), cl->_name->String()));
break;
}
@@ -1229,7 +1288,8 @@ void ServerWindow::DispatchMessage(int32 code)
// if we had a picture to clip to, include the FULL visible region(if any) in the area to be redrawn
// in other words: invalidate what ever is visible for this layer and his children.
if (cl->clipToPicture && cl->_fullVisible.CountRects() > 0){
if (cl->clipToPicture && cl->_fullVisible.CountRects() > 0)
{
reg.Include(&cl->_fullVisible);
redraw = true;
}
@@ -1243,42 +1303,46 @@ void ServerWindow::DispatchMessage(int32 code)
if (!sp)
break;
if(sp->GetToken() == pictureToken){
if(sp->GetToken() == pictureToken)
{
//cl->clipToPicture = sp;
// TODO: increase that picture's reference count.(~ allocate a picture)
break;
}
}
// avoid compiler warning
i = 0;
// we have a new picture to clip to, so rebuild our full region
if(cl->clipToPicture) {
if(cl->clipToPicture)
{
cl->clipToPictureInverse = false;
cl->RebuildFullRegion();
}
// we need to rebuild the visible region, we may have a valid one.
if (cl->_parent && !(cl->_hidden)){
if (cl->_parent && !(cl->_hidden))
{
//cl->_parent->RebuildChildRegions(cl->_full.Frame(), cl);
}
else{
else
{
// will this happen? Maybe...
//cl->RebuildRegions(cl->_full.Frame());
}
// include our full visible region in the region to be redrawn
if (!(cl->_hidden) && (cl->_fullVisible.CountRects() > 0)){
if (!(cl->_hidden) && (cl->_fullVisible.CountRects() > 0))
{
reg.Include(&(cl->_fullVisible));
redraw = true;
}
// redraw if: we had OR if we NOW have a picture to clip to.
if (redraw){
// redraw if we previously had or if we have acquired a picture to clip to.
if (redraw)
cl->Invalidate(reg);
}
STRACE(("ServerWindow %s: Message AS_LAYER_CLIP_TO_PICTURE: Layer: %s\n",fTitle.String(), cl->_name->String()));
break;
@@ -1301,8 +1365,10 @@ void ServerWindow::DispatchMessage(int32 code)
if (!sp)
break;
if(sp->GetToken() == pictureToken){
if(sp->GetToken() == pictureToken)
{
//cl->clipToPicture = sp;
// TODO: increase that picture's reference count.(~ allocate a picture)
break;
}
@@ -1311,16 +1377,15 @@ void ServerWindow::DispatchMessage(int32 code)
i = 0;
// if a picture has been found...
if(cl->clipToPicture) {
if(cl->clipToPicture)
{
cl->clipToPictureInverse = true;
cl->RebuildFullRegion();
//cl->RequestDraw(cl->clipToPicture->Frame());
}
STRACE(("ServerWindow %s: Message AS_LAYER_CLIP_TO_INVERSE_PICTURE: Layer: %s\n",fTitle.String(), cl->_name->String()));
STRACE(("ServerWindow %s: Message AS_LAYER_CLIP_TO_INVERSE_PICTURE: Layer: %s\n",fTitle.String(),
cl->_name->String()));
break;
}
case AS_LAYER_GET_CLIP_REGION:
@@ -1337,15 +1402,16 @@ void ServerWindow::DispatchMessage(int32 code)
reg.IntersectWith(ld->clipReg);
while((ld = ld->prevState))
{
if(ld->clipReg)
reg.IntersectWith(ld->clipReg);
}
noOfRects = reg.CountRects();
fSession->WriteInt32(noOfRects);
for(int i = 0; i < noOfRects; i++){
for(int i = 0; i < noOfRects; i++)
fSession->WriteRect(reg.RectAt(i));
}
fSession->Sync();
@@ -1365,19 +1431,18 @@ void ServerWindow::DispatchMessage(int32 code)
fSession->ReadInt32(&noOfRects);
for(int i = 0; i < noOfRects; i++){
for(int i = 0; i < noOfRects; i++)
{
fSession->ReadRect(&r);
cl->_layerdata->clipReg->Include(r);
}
cl->RebuildFullRegion();
// cl->RequestDraw(cl->clipToPicture->Frame());
STRACE(("ServerWindow %s: Message AS_LAYER_SET_CLIP_REGION: Layer: %s\n",fTitle.String(), cl->_name->String()));
break;
}
case AS_LAYER_INVAL_RECT:
{
// TODO: watch out for the coordinate system
@@ -1386,7 +1451,6 @@ void ServerWindow::DispatchMessage(int32 code)
fSession->ReadRect(&invalRect);
cl->Invalidate(invalRect);
//cl->RequestDraw(invalRect);
STRACE(("ServerWindow %s: Message AS_LAYER_INVAL_RECT: Layer: %s\n",fTitle.String(), cl->_name->String()));
@@ -1401,30 +1465,28 @@ void ServerWindow::DispatchMessage(int32 code)
fSession->ReadInt32(&noOfRects);
for(int i = 0; i < noOfRects; i++){
for(int i = 0; i < noOfRects; i++)
{
fSession->ReadRect(&rect);
invalReg.Include(rect);
}
cl->Invalidate(invalReg);
// cl->RequestDraw(invalReg.Frame());
STRACE(("ServerWindow %s: Message AS_LAYER_INVAL_RECT: Layer: %s\n",fTitle.String(), cl->_name->String()));
break;
}
// ********** END: BView Messages ***********
/********** END: BView Messages ***********/
/********** BWindow Messages ***********/
// ********* BWindow Messages ***********
case AS_LAYER_DELETE_ROOT:
{
// Received when a window deletes its internal top view
// TODO: Implement
STRACE(("ServerWindow %s: Message Delete_Layer_Root unimplemented\n",fTitle.String()));
break;
}
case AS_SHOW_WINDOW:
@@ -1479,13 +1541,15 @@ void ServerWindow::DispatchMessage(int32 code)
fSession->ReadData(&teamID, sizeof(team_id));
wb = desktop->FindWinBorderByServerWindowTokenAndTeamID(mainToken, teamID);
if(wb){
if(wb)
{
fSession->WriteInt32(SERVER_TRUE);
fSession->Sync();
fWinBorder->AddToSubsetOf(wb);
}
else{
else
{
fSession->WriteInt32(SERVER_FALSE);
fSession->Sync();
}
@@ -1501,13 +1565,15 @@ void ServerWindow::DispatchMessage(int32 code)
fSession->ReadData(&teamID, sizeof(team_id));
wb = desktop->FindWinBorderByServerWindowTokenAndTeamID(mainToken, teamID);
if(wb){
if(wb)
{
fSession->WriteInt32(SERVER_TRUE);
fSession->Sync();
fWinBorder->RemoveFromSubsetOf(wb);
}
else{
else
{
fSession->WriteInt32(SERVER_FALSE);
fSession->Sync();
}
@@ -1628,8 +1694,7 @@ void ServerWindow::DispatchGraphicsMessage(int32 msgsize, int8 *msgbuffer)
return;
// TODO: fix!
/*
WindowClipRegion.Set(fWinBorder->Frame());
/* WindowClipRegion.Set(fWinBorder->Frame());
sibling = fWinBorder->UpperSibling();
while (sibling)
{
@@ -1647,8 +1712,10 @@ void ServerWindow::DispatchGraphicsMessage(int32 msgsize, int8 *msgbuffer)
{
code = read_from_buffer<int32>(&msgbuffer);
view_token = read_from_buffer<int32>(&msgbuffer);
//TODO: fix!
layer = NULL;//fWorkspace->GetRoot()->FindLayer(view_token);
if (layer)
{
// TODO: fix!
@@ -1662,6 +1729,7 @@ void ServerWindow::DispatchGraphicsMessage(int32 msgsize, int8 *msgbuffer)
layerdata = NULL;
STRACE(("ServerWindow %s received invalid view token %lx",fTitle.String(),view_token));
}
switch (code)
{
case AS_SET_HIGH_COLOR:
@@ -2046,7 +2114,7 @@ void ServerWindow::DispatchGraphicsMessage(int32 msgsize, int8 *msgbuffer)
}
case AS_FILL_ROUNDRECT:
{
// TODO:: Add clipping
// TODO: Add clipping
if (sizeRemaining >= AS_FILL_ROUNDRECT_MSG_SIZE)
{
float left, top, right, bottom, xrad, yrad;
@@ -2189,7 +2257,6 @@ int32 ServerWindow::MonitorWin(void *data)
}
default:
{
//STRACE(("ServerWindow %s: got a message to dispatch\n",win->Title()));
win->DispatchMessage(code);
break;
}
@@ -2198,170 +2265,6 @@ int32 ServerWindow::MonitorWin(void *data)
return 0;
}
/*!
\brief PasfSession mouse event messages to the appropriate window
\param code Message code of the mouse message
\param buffer Attachment buffer for the mouse message
*/
//void ServerWindow::HandleMouseEvent(int32 code, int8 *buffer)
void ServerWindow::HandleMouseEvent(PortMessage *msg)
{
/* ServerWindow *mousewin=NULL;
// int8 *index=buffer;
// Find the window which will receive our mouse event.
//TODO: resolve
Layer *root=NULL;//GetRootLayer(CurrentWorkspace(),ActiveScreen());
WinBorder *fWinBorder;
// activeborder is used to remember windows when resizing/moving windows
// or sliding a tab
if(!root)
{
printf("ERROR: HandleMouseEvent has NULL root layer!!!\n");
return;
}
// Dispatch the mouse event to the proper window
// switch(code)
switch(msg->Code())
{
case B_MOUSE_DOWN:
{
// Attached data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - modifier keys down
// 5) int32 - buttons down
// 6) int32 - clicks
// index+=sizeof(int64);
// float x=*((float*)index); index+=sizeof(float);
// float y=*((float*)index); index+=sizeof(float);
// BPoint pt(x,y);
float x;
float y;
int64 dummy;
msg->Read<int64>(&dummy);
msg->Read<float>(&x);
msg->Read<float>(&y);
//TODO: resolve
// BPoint pt(x,y);
// If we have clicked on a window,
active_winborder = fWinBorder = NULL;
if(fWinBorder)
{
mousewin=fWinBorder->Window();
fWinBorder->MouseDown((int8*)msg->Buffer());
}
break;
}
case B_MOUSE_UP:
{
// Attached data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - modifier keys down
// index+=sizeof(int64);
// float x=*((float*)index); index+=sizeof(float);
// float y=*((float*)index); index+=sizeof(float);
// BPoint pt(x,y);
float x;
float y;
int64 dummy;
msg->Read(&dummy);
msg->Read(&x);
msg->Read(&y);
//TODO: resolve
// BPoint pt(x,y);
// set_is_sliding_tab(false);
// set_is_moving_window(false);
// set_is_resizing_window(false);
//TODO: resolve
fWinBorder = NULL;//WindowContainsPoint(pt);
active_winborder=NULL;
if(fWinBorder)
{
mousewin=fWinBorder->Window();
// Eventually, we will build in MouseUp messages with buttons specified
// For now, we just "assume" no mouse specification with a 0.
fWinBorder->MouseUp((int8*)msg->Buffer());
}
break;
}
case B_MOUSE_MOVED:
{
// Attached data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - buttons down
// index+=sizeof(int64);
// float x=*((float*)index); index+=sizeof(float);
// float y=*((float*)index); index+=sizeof(float);
// BPoint pt(x,y);
float x;
float y;
int64 dummy;
msg->Read(&dummy);
msg->Read(&x);
msg->Read(&y);
// BPoint pt(x,y);
//
// if(is_moving_window() || is_resizing_window() || is_sliding_tab())
// {
// active_winborder->MouseMoved((int8*)msg->Buffer());
// }
// else
// {
// fWinBorder = WindowContainsPoint(pt);
// if(fWinBorder)
// {
// mousewin=fWinBorder->Window();
// fWinBorder->MouseMoved((int8*)msg->Buffer());
// }
// }
break;
}
default:
{
break;
}
}
*/
}
/*!
\brief PasfSession key event messages to the appropriate window
\param code Message code of the key message
\param buffer Attachment buffer for the key message
*/
void ServerWindow::HandleKeyEvent(int32 code, int8 *buffer)
{
/*
STRACE_KEY(("ServerWindow::HandleKeyEvent unimplemented\n"));
ServerWindow *keywin=NULL;
// Dispatch the key event to the active window
keywin=GetActiveWindow();
if(keywin)
{
keywin->Lock();
keywin->fWinLink->SetOpCode(code);
keywin->fWinLink
keywin->Unlock();
}
*/
}
/*!
\brief Send a message to the ServerWindow
\param code ID code of the message to post
+23 -43
View File
@@ -65,17 +65,9 @@ class Layer;
class ServerWindow
{
public:
ServerWindow( BRect rect,
const char *string,
uint32 wlook,
uint32 wfeel,
uint32 wflags,
ServerApp *winapp,
port_id winport,
port_id looperPort,
port_id replyport,
uint32 index,
int32 handlerID);
ServerWindow(BRect rect, const char *string, uint32 wlook, uint32 wfeel, uint32 wflags,
ServerApp *winapp, port_id winport, port_id looperPort, port_id replyport,
uint32 index,int32 handlerID);
virtual ~ServerWindow(void);
void Init();
@@ -103,25 +95,20 @@ public:
status_t Lock(void);
void Unlock(void);
bool IsLocked(void);
thread_id ThreadID(void) const
{ return fMonitorThreadID;}
thread_id ThreadID(void) const { return fMonitorThreadID;}
void DispatchMessage(int32 code);
void DispatchGraphicsMessage(int32 msgsize, int8 *msgbuffer);
static int32 MonitorWin(void *data);
static void HandleMouseEvent(PortMessage *msg);
static void HandleKeyEvent(int32 code, int8 *buffer);
void PostMessage(int32 code, size_t size=0, int8 *buffer=NULL);
//! Returns the index of the workspaces to which it belongs
int32 GetWorkspaceIndex(void)
{ return fWorkspaces; }
int32 GetWorkspaceIndex(void) { return fWorkspaces; }
Workspace *GetWorkspace(void);
void SetWorkspace(Workspace *wkspc);
//! Returns the window's title
const char* Title(void)
{ return fTitle.String(); }
const char *Title(void) { return fTitle.String(); }
Layer *CreateLayerTree(Layer *localRoot);
void SetLayerState(Layer *layer);
@@ -130,30 +117,21 @@ public:
Layer *FindLayer(const Layer *start, int32 token) const;
void SendMessageToClient( const BMessage *msg ) const;
int32 Look(void) const
{ return fLook; }
int32 Feel(void) const
{ return fFeel; }
uint32 Flags(void) const
{ return fFlags; }
team_id ClientTeamID(void) const
{ return fClientTeamID; }
ServerApp* App(void) const
{ return fServerApp; }
uint32 Workspaces(void) const
{ return fWorkspaces; }
WinBorder* GetWinBorder(void) const
{ return fWinBorder; }
int32 Look(void) const { return fLook; }
int32 Feel(void) const { return fFeel; }
uint32 Flags(void) const { return fFlags; }
team_id ClientTeamID(void) const { return fClientTeamID; }
ServerApp *App(void) const { return fServerApp; }
uint32 Workspaces(void) const { return fWorkspaces; }
WinBorder *GetWinBorder(void) const { return fWinBorder; }
// server "private" - try not to use
void QuietlySetWorkspaces(uint32 wks)
{ fWorkspaces = wks; }
void QuietlySetFeel(int32 feel)
{ fFeel = feel; }
int32 ClientToken(void) const
{ return fHandlerToken; }
void QuietlySetWorkspaces(uint32 wks) { fWorkspaces = wks; }
void QuietlySetFeel(int32 feel) { fFeel = feel; }
int32 ClientToken(void) const { return fHandlerToken; }
FMWList fWinFMWList;
protected:
friend class ServerApp;
friend class WinBorder;
@@ -161,9 +139,9 @@ protected:
friend class Layer;
BString fTitle;
int32 fLook,
fFeel,
fFlags;
int32 fLook;
int32 fFeel;
int32 fFlags;
uint32 fWorkspaces;
Workspace *fWorkspace;
bool fIsActive;
@@ -185,7 +163,9 @@ protected:
BSession *fSession;
Layer *fTopLayer;
Layer* cl; // short for currentLayer. We'll use it a lot, that's why it's short :-)
// cl is short for currentLayer. We'll use it a lot, that's why it's short :-)
Layer *cl;
};
#endif