Tweaked API to fix a related crash

ViewDriver's Get methods return proper values


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2735 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-02-17 15:02:38 +00:00
parent 121b19e599
commit bfc47a9d3b
6 changed files with 38 additions and 20 deletions
+6 -4
View File
@@ -34,13 +34,15 @@ extern RGBColor workspace_default_color;
\brief Sets up internal variables needed by the Workspace
\param gcinfo The graphics card info
\param fbinfo The frame buffer info
\param gfxdriver DisplayDriver for the associated RootLayer
*/
Workspace::Workspace(const graphics_card_info &gcinfo, const frame_buffer_info &fbinfo)
Workspace::Workspace(const graphics_card_info &gcinfo, const frame_buffer_info &fbinfo, DisplayDriver *gfxdriver)
{
_gcinfo=gcinfo;
_fbinfo=fbinfo;
_rootlayer=new RootLayer(BRect(0,0,fbinfo.display_width-1,fbinfo.display_height-1), "Workspace Root");
_rootlayer=new RootLayer(BRect(0,0,fbinfo.display_width-1,fbinfo.display_height-1),
"Workspace Root",gfxdriver);
_rootlayer->SetColor(workspace_default_color);
}
@@ -150,7 +152,7 @@ Screen::Screen(DisplayDriver *gfxmodule, uint8 workspaces)
_workspacecount = workspaces;
for (int i=0; i<workspaces; i++)
{
_workspacelist->AddItem(new Workspace(_gcinfo,_fbinfo));
_workspacelist->AddItem(new Workspace(_gcinfo,_fbinfo,_driver));
}
_resolution=_driver->GetMode();
_currentworkspace=0;
@@ -183,7 +185,7 @@ Screen::~Screen(void)
*/
void Screen::AddWorkspace(int32 index)
{
Workspace *workspace = new Workspace(_gcinfo,_fbinfo);
Workspace *workspace = new Workspace(_gcinfo,_fbinfo,_driver);
if ( (index == -1) || !_workspacelist->AddItem(workspace,index) )
_workspacelist->AddItem(workspace);
}