Finished Desktop functions and associated documentation

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2783 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2003-02-20 18:05:35 +00:00
parent 0258e5900f
commit e9318266f9
3 changed files with 40 additions and 2 deletions

View File

@ -302,22 +302,54 @@ DisplayDriver *GetGfxDriver(screen_id screen=B_MAIN_SCREEN_ID)
\param index The workspace to change
\param res Resolution constant from GraphicsDefs.h
\param stick If false, resolution will revert to its old value on next boot
\param screen ID of the screen to change
\param screen ID of the screen to change. Currently unused.
\return B_OK if successful, B_ERROR if not.
Because of the lack of outside multimonitor support, the screen ID is ignored for now.
*/
status_t SetSpace(int32 index, int32 res, bool stick=true, screen_id screen=B_MAIN_SCREEN_ID)
{
return B_ERROR;
desktop_private::workspacelock.Lock();
status_t stat=desktop_private::activescreen->SetSpace(index,res,stick);
desktop_private::workspacelock.Unlock();
return stat;
}
/*!
\brief Adds a window to the desktop so that it will be displayed
\param win Window to add
\param workspace index of the workspace to add the window to
\param screen Optional screen specifier. Currently unused.
*/
void AddWindowToDesktop(ServerWindow *win, int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)
{
// Workspace() will be non-NULL if it has already been added to the desktop
if(!win || win->GetWorkspace())
return;
desktop_private::workspacelock.Lock();
desktop_private::layerlock.Lock();
Workspace *w=desktop_private::activescreen->GetActiveWorkspace();
win->SetWorkspace(w);
desktop_private::layerlock.Unlock();
desktop_private::workspacelock.Unlock();
}
/*!
\brief Removes a window from the desktop
\param win Window to remove
*/
void RemoveWindowFromDesktop(ServerWindow *win)
{
desktop_private::workspacelock.Lock();
desktop_private::layerlock.Lock();
win->SetWorkspace(NULL);
desktop_private::layerlock.Unlock();
desktop_private::workspacelock.Unlock();
}
/*!

View File

@ -91,6 +91,7 @@ ServerWindow::ServerWindow(BRect rect, const char *string, uint32 wlook,
resume_thread(_monitorthread);
_workspace_index=index;
_workspace=NULL;
AddWindowToDesktop(this,index);
}
@ -448,6 +449,10 @@ void ServerWindow::HandleKeyEvent(int32 code, int8 *buffer)
{
}
void ServerWindow::SetWorkspace(Workspace *wkspc)
{
}
void ActivateWindow(ServerWindow *oldwin,ServerWindow *newwin)
{
/* if(active_serverwindow==win)

View File

@ -80,6 +80,7 @@ public:
int32 GetWorkspaceIndex(void) { return _workspace_index; }
Workspace *GetWorkspace(void) { return _workspace; }
void SetWorkspace(Workspace *wkspc);
protected:
friend ServerApp;