Added code to read R5 workspace config data

Added some functions to handle global mouse, menu, and FFM data
Tweaks to DesktopClasses


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3876 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-07-06 19:48:17 +00:00
parent 0491e1650c
commit ea39092263
5 changed files with 301 additions and 9 deletions
+53 -6
View File
@@ -25,10 +25,15 @@
// Description: Classes for managing workspaces and screens
//
//------------------------------------------------------------------------------
#include <File.h>
#include <Message.h>
#include <stdio.h>
#include <string.h>
#include "DesktopClasses.h"
#include "TokenHandler.h"
#include "ServerWindow.h"
#include "WinBorder.h"
#include "Desktop.h"
//#define DEBUG_WORKSPACE
//#define DEBUG_SCREEN
@@ -64,6 +69,14 @@ printf("Workspace::Workspace(%s)\n",_rootlayer->GetName());
#endif
}
/*!
\brief Constructor to accept data from reading R5's settings
*/
Workspace::Workspace(as_workspace_data *data, Screen *screen)
{
//TODO: Implement
}
/*!
\brief Deletes the heap memory used by the Workspace
*/
@@ -204,11 +217,15 @@ printf("Screen::Screen(%s,%u)\n",gfxmodule?"driver":"NULL",workspaces);
_workspacelist->AddItem(new Workspace(_gcinfo,_fbinfo,this));
}
_resolution=_driver->GetMode();
_currentworkspace=0;
_activeworkspace=(Workspace*)_workspacelist->ItemAt(0);
_workspacecount=workspaces;
_activeworkspace->GetRoot()->Show();
_activeworkspace->GetRoot()->RequestDraw();
if(workspaces>0)
{
_currentworkspace=0;
_activeworkspace=(Workspace*)_workspacelist->ItemAt(0);
_workspacecount=workspaces;
_activeworkspace->GetRoot()->Show();
_activeworkspace->GetRoot()->RequestDraw();
}
}
}
@@ -245,6 +262,22 @@ printf("Screen::AddWorkspace(%ld)\n",index+1);
_workspacelist->AddItem(workspace);
}
/*!
\brief Adds a workspace object to the screen
\param workspace The workspace to add.
\param index Optional index to insert workspace at. Defaults to adding to end of list.
This function will do nothing if workspace is NULL.
*/
void Screen::AddWorkspace(Workspace *workspace,int32 index)
{
#ifdef DEBUG_SCREEN
printf("Screen::AddWorkspace(%s)\n",(workspace && workspace->GetRoot())?workspace->GetRoot()->GetName():"NULL");
#endif
if ( (index==-1) || !_workspacelist->AddItem(workspace,index) )
_workspacelist->AddItem(workspace);
}
/*!
\brief Deletes the workspace at the specified index
\param index The position within the workspace list
@@ -430,7 +463,21 @@ ServerWindow *Screen::ActiveWindow(void)
*/
void Screen::SetActiveWindow(ServerWindow *win)
{
//TODO: Implement
if(win)
{
if(win->GetWorkspace()==NULL)
{
// has not been added to desktop
AddWindowToDesktop(win,win->GetWorkspaceIndex(),_id);
}
Workspace *wksp=win->GetWorkspace();
if(wksp->GetScreen()!=this)
return;
set_active_winborder(win->_winborder);
}
else
set_active_winborder(NULL);
_activewin=win;
}
/*!