Made app_server a static, renamed desktop to gDesktop as it's a global, RootLayer now uses its own fDesktop internal member instead of the global one. Fixed a typo in some commented code (thanks Axel)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12864 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -70,14 +70,12 @@
|
||||
#endif
|
||||
|
||||
// Globals
|
||||
|
||||
Desktop *desktop;
|
||||
Desktop *gDesktop;
|
||||
|
||||
port_id gAppServerPort;
|
||||
|
||||
// TODO: Global ? Is it really needed ?
|
||||
//! Used to access the app_server from new_decorator
|
||||
AppServer *app_server=NULL;
|
||||
static AppServer *sAppServer = NULL;
|
||||
|
||||
//! Default background color for workspaces
|
||||
//RGBColor workspace_default_color(51,102,160);
|
||||
@@ -117,7 +115,7 @@ AppServer::AppServer(void) :
|
||||
make_decorator = NULL;
|
||||
|
||||
// We need this in order for new_decorator to be able to instantiate new decorators
|
||||
app_server = this;
|
||||
sAppServer = this;
|
||||
|
||||
// Create the font server and scan the proper directories.
|
||||
fontserver = new FontServer;
|
||||
@@ -181,8 +179,8 @@ AppServer::AppServer(void) :
|
||||
InitDecorators();
|
||||
|
||||
// Set up the Desktop
|
||||
desktop = new Desktop();
|
||||
desktop->Init();
|
||||
gDesktop = new Desktop();
|
||||
gDesktop->Init();
|
||||
|
||||
// Create the bitmap allocator. Object declared in BitmapManager.cpp
|
||||
bitmapmanager = new BitmapManager();
|
||||
@@ -232,7 +230,7 @@ AppServer::~AppServer(void)
|
||||
|
||||
delete bitmapmanager;
|
||||
|
||||
delete desktop;
|
||||
delete gDesktop;
|
||||
|
||||
// If these threads are still running, kill them - after this, if exit_poller
|
||||
// is deleted, who knows what will happen... These things will just return an
|
||||
@@ -367,7 +365,7 @@ AppServer::CursorThread(void* data)
|
||||
p.y = *app->fCursorAddr & 0x7fff;
|
||||
p.x = *app->fCursorAddr >> 15 & 0x7fff;
|
||||
|
||||
desktop->GetDisplayDriver()->MoveCursorTo(p.x, p.y);
|
||||
gDesktop->GetDisplayDriver()->MoveCursorTo(p.x, p.y);
|
||||
STRACE(("CursorThread : %f, %f\n", p.x, p.y));
|
||||
}
|
||||
|
||||
@@ -799,7 +797,7 @@ AppServer::DispatchMessage(int32 code, BPortLink &msg)
|
||||
|
||||
release_sem(fAppListLock);
|
||||
|
||||
delete desktop;
|
||||
delete gDesktop;
|
||||
delete fAppList;
|
||||
delete bitmapmanager;
|
||||
delete fontserver;
|
||||
@@ -816,7 +814,7 @@ AppServer::DispatchMessage(int32 code, BPortLink &msg)
|
||||
// although this isn't pretty, ATM we only have RootLayer.
|
||||
// this messages should be handled somewhere into a RootLayer
|
||||
// specific area - this set is intended for a RootLayer.
|
||||
desktop->ActiveRootLayer()->GetCursorManager().SetDefaults();
|
||||
gDesktop->ActiveRootLayer()->GetCursorManager().SetDefaults();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -902,10 +900,10 @@ new_decorator(BRect rect, const char *title, int32 wlook, int32 wfeel,
|
||||
{
|
||||
Decorator *dec=NULL;
|
||||
|
||||
if(!app_server->make_decorator)
|
||||
dec=new DefaultDecorator(rect,wlook,wfeel,wflags);
|
||||
if (!sAppServer->make_decorator)
|
||||
dec = new DefaultDecorator(rect, wlook, wfeel, wflags);
|
||||
else
|
||||
dec=app_server->make_decorator(rect,wlook,wfeel,wflags);
|
||||
dec = sAppServer->make_decorator(rect, wlook, wfeel, wflags);
|
||||
|
||||
gui_colorset.Lock();
|
||||
dec->SetDriver(ddriver);
|
||||
|
||||
@@ -119,6 +119,6 @@ private:
|
||||
bool fFFMouseMode;
|
||||
};
|
||||
|
||||
extern Desktop *desktop;
|
||||
extern Desktop *gDesktop;
|
||||
|
||||
#endif // _DESKTOP_H_
|
||||
|
||||
@@ -269,7 +269,7 @@ int32 RootLayer::WorkingThread(void *data)
|
||||
WinBorder *toWinBorder = NULL;
|
||||
messageQueue.Read<WinBorder*>(&winBorder);
|
||||
messageQueue.Read<WinBorder*>(&toWinBorder);
|
||||
desktop->AddWinBorderToSubset(winBorder, toWinBorder);
|
||||
oneRootLayer->fDesktop->AddWinBorderToSubset(winBorder, toWinBorder);
|
||||
break;
|
||||
}
|
||||
case AS_ROOTLAYER_REMOVE_FROM_SUBSET:
|
||||
@@ -278,7 +278,7 @@ int32 RootLayer::WorkingThread(void *data)
|
||||
WinBorder *fromWinBorder = NULL;
|
||||
messageQueue.Read<WinBorder*>(&winBorder);
|
||||
messageQueue.Read<WinBorder*>(&fromWinBorder);
|
||||
desktop->RemoveWinBorderFromSubset(winBorder, fromWinBorder);
|
||||
oneRootLayer->fDesktop->RemoveWinBorderFromSubset(winBorder, fromWinBorder);
|
||||
break;
|
||||
}
|
||||
case AS_ROOTLAYER_WINBORDER_SET_WORKSPACES:
|
||||
@@ -558,9 +558,9 @@ bool RootLayer::SetActiveWorkspace(int32 index)
|
||||
fWorkspace[index] = new Workspace(index, 0xFF00FF00, kDefaultWorkspaceColor);
|
||||
|
||||
// we need to lock the window list here so no other window can be created
|
||||
desktop->Lock();
|
||||
fDesktop->Lock();
|
||||
|
||||
const BList& windowList = desktop->WindowList();
|
||||
const BList& windowList = fDesktop->WindowList();
|
||||
|
||||
int32 ptrCount = windowList.CountItems();
|
||||
WinBorder **ptrWin = (WinBorder**)windowList.Items();
|
||||
@@ -575,7 +575,7 @@ bool RootLayer::SetActiveWorkspace(int32 index)
|
||||
}
|
||||
}
|
||||
|
||||
desktop->Unlock();
|
||||
fDesktop->Unlock();
|
||||
}
|
||||
rgb_color bg = fWorkspace[index]->BGColor().GetColor32();
|
||||
if ((bg.red + bg.green + bg.blue) / 3 > 128)
|
||||
@@ -1891,7 +1891,7 @@ void RootLayer::change_winBorder_feel(WinBorder *winBorder, int32 newFeel)
|
||||
winBorder->Hide(false);
|
||||
}
|
||||
|
||||
desktop->SetWinBorderFeel(winBorder, newFeel);
|
||||
gDesktop->SetWinBorderFeel(winBorder, newFeel);
|
||||
|
||||
if (isVisible)
|
||||
{
|
||||
|
||||
@@ -114,7 +114,7 @@ ServerApp::ServerApp(port_id sendport, port_id rcvport, port_id clientLooperPort
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
ServerCursor *defaultCursor =
|
||||
desktop->ActiveRootLayer()->GetCursorManager().GetCursor(B_CURSOR_DEFAULT);
|
||||
gDesktop->ActiveRootLayer()->GetCursorManager().GetCursor(B_CURSOR_DEFAULT);
|
||||
|
||||
if (defaultCursor) {
|
||||
fAppCursor = new ServerCursor(defaultCursor);
|
||||
@@ -159,7 +159,7 @@ ServerApp::~ServerApp(void)
|
||||
// although this isn't pretty, ATM we have only one RootLayer.
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
desktop->ActiveRootLayer()->GetCursorManager().RemoveAppCursors(fClientTeamID);
|
||||
gDesktop->ActiveRootLayer()->GetCursorManager().RemoveAppCursors(fClientTeamID);
|
||||
delete_sem(fLockSem);
|
||||
|
||||
STRACE(("#ServerApp %s:~ServerApp()\n",fSignature.String()));
|
||||
@@ -275,7 +275,7 @@ ServerApp::SetAppCursor(void)
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
if (fAppCursor)
|
||||
desktop->ActiveRootLayer()->GetDisplayDriver()->SetCursor(fAppCursor);
|
||||
gDesktop->ActiveRootLayer()->GetDisplayDriver()->SetCursor(fAppCursor);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -428,7 +428,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
for(int32 i=0; i<fSWindowList->CountItems(); i++)
|
||||
{
|
||||
win=(ServerWindow*)fSWindowList->ItemAt(i);
|
||||
win->GetWinBorder->UpdateColors();
|
||||
win->GetWinBorder()->UpdateColors();
|
||||
win->SendMessageToClient(AS_UPDATE_COLORS, msg);
|
||||
}
|
||||
*/ break;
|
||||
@@ -445,7 +445,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
for(int32 i=0; i<fSWindowList->CountItems(); i++)
|
||||
{
|
||||
win=(ServerWindow*)fSWindowList->ItemAt(i);
|
||||
win->GetWinBorder->UpdateFont();
|
||||
win->GetWinBorder()->UpdateFont();
|
||||
win->SendMessageToClient(AS_UPDATE_FONTS, msg);
|
||||
}
|
||||
*/ break;
|
||||
@@ -703,7 +703,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
msg.Read<uint32>(&mode);
|
||||
msg.Read<bool>(&stick);
|
||||
|
||||
RootLayer *root=desktop->ActiveRootLayer();
|
||||
RootLayer *root=gDesktop->ActiveRootLayer();
|
||||
Workspace *workspace=root->WorkspaceAt(index);
|
||||
|
||||
if (!workspace) {
|
||||
@@ -737,7 +737,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// although this isn't pretty, ATM we have only one RootLayer.
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
desktop->ActiveRootLayer()->GetDisplayDriver()->ShowCursor();
|
||||
gDesktop->ActiveRootLayer()->GetDisplayDriver()->ShowCursor();
|
||||
fCursorHidden = false;
|
||||
break;
|
||||
}
|
||||
@@ -747,7 +747,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// although this isn't pretty, ATM we have only one RootLayer.
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
desktop->ActiveRootLayer()->GetDisplayDriver()->HideCursor();
|
||||
gDesktop->ActiveRootLayer()->GetDisplayDriver()->HideCursor();
|
||||
fCursorHidden = true;
|
||||
break;
|
||||
}
|
||||
@@ -757,7 +757,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// although this isn't pretty, ATM we have only one RootLayer.
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
desktop->ActiveRootLayer()->GetDisplayDriver()->ObscureCursor();
|
||||
gDesktop->ActiveRootLayer()->GetDisplayDriver()->ObscureCursor();
|
||||
break;
|
||||
}
|
||||
case AS_QUERY_CURSOR_HIDDEN:
|
||||
@@ -786,16 +786,16 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// otherwise be easy to crash the server by calling SetCursor a
|
||||
// sufficient number of times
|
||||
if(fAppCursor)
|
||||
desktop->ActiveRootLayer()->GetCursorManager().DeleteCursor(fAppCursor->ID());
|
||||
gDesktop->ActiveRootLayer()->GetCursorManager().DeleteCursor(fAppCursor->ID());
|
||||
|
||||
fAppCursor = new ServerCursor(cdata);
|
||||
fAppCursor->SetOwningTeam(fClientTeamID);
|
||||
fAppCursor->SetAppSignature(fSignature.String());
|
||||
desktop->ActiveRootLayer()->GetCursorManager().AddCursor(fAppCursor);
|
||||
gDesktop->ActiveRootLayer()->GetCursorManager().AddCursor(fAppCursor);
|
||||
// although this isn't pretty, ATM we have only one RootLayer.
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
desktop->ActiveRootLayer()->GetDisplayDriver()->SetCursor(fAppCursor);
|
||||
gDesktop->ActiveRootLayer()->GetDisplayDriver()->SetCursor(fAppCursor);
|
||||
break;
|
||||
}
|
||||
case AS_SET_CURSOR_BCURSOR:
|
||||
@@ -818,8 +818,8 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
ServerCursor *cursor;
|
||||
if ((cursor = desktop->ActiveRootLayer()->GetCursorManager().FindCursor(ctoken)))
|
||||
desktop->ActiveRootLayer()->GetDisplayDriver()->SetCursor(cursor);
|
||||
if ((cursor = gDesktop->ActiveRootLayer()->GetCursorManager().FindCursor(ctoken)))
|
||||
gDesktop->ActiveRootLayer()->GetDisplayDriver()->SetCursor(cursor);
|
||||
|
||||
if(sync)
|
||||
{
|
||||
@@ -850,7 +850,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// although this isn't pretty, ATM we have only one RootLayer.
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
desktop->ActiveRootLayer()->GetCursorManager().AddCursor(fAppCursor);
|
||||
gDesktop->ActiveRootLayer()->GetCursorManager().AddCursor(fAppCursor);
|
||||
|
||||
// Synchronous message - BApplication is waiting on the cursor's ID
|
||||
replylink.SetSendPort(replyport);
|
||||
@@ -873,7 +873,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// although this isn't pretty, ATM we have only one RootLayer.
|
||||
// there should be a way that this ServerApp be attached to a particular
|
||||
// RootLayer to know which RootLayer's cursor to modify.
|
||||
desktop->ActiveRootLayer()->GetCursorManager().DeleteCursor(ctoken);
|
||||
gDesktop->ActiveRootLayer()->GetCursorManager().DeleteCursor(ctoken);
|
||||
break;
|
||||
}
|
||||
case AS_GET_SCROLLBAR_INFO:
|
||||
@@ -882,7 +882,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// Attached data:
|
||||
// 1) port_id reply port - synchronous message
|
||||
|
||||
scroll_bar_info sbi=desktop->ScrollBarInfo();
|
||||
scroll_bar_info sbi=gDesktop->ScrollBarInfo();
|
||||
|
||||
port_id replyport;
|
||||
msg.Read<int32>(&replyport);
|
||||
@@ -901,7 +901,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
scroll_bar_info sbi;
|
||||
msg.Read<scroll_bar_info>(&sbi);
|
||||
|
||||
desktop->SetScrollBarInfo(sbi);
|
||||
gDesktop->SetScrollBarInfo(sbi);
|
||||
break;
|
||||
}
|
||||
case AS_FOCUS_FOLLOWS_MOUSE:
|
||||
@@ -915,7 +915,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
|
||||
replylink.SetSendPort(replyport);
|
||||
replylink.StartMessage(SERVER_TRUE);
|
||||
replylink.Attach<bool>(desktop->FFMouseInUse());
|
||||
replylink.Attach<bool>(gDesktop->FFMouseInUse());
|
||||
replylink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -927,7 +927,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
scroll_bar_info sbi;
|
||||
msg.Read<scroll_bar_info>(&sbi);
|
||||
|
||||
desktop->SetScrollBarInfo(sbi);*/
|
||||
gDesktop->SetScrollBarInfo(sbi);*/
|
||||
break;
|
||||
}
|
||||
case AS_SET_MOUSE_MODE:
|
||||
@@ -938,7 +938,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
mode_mouse mmode;
|
||||
msg.Read<mode_mouse>(&mmode);
|
||||
|
||||
desktop->SetFFMouseMode(mmode);
|
||||
gDesktop->SetFFMouseMode(mmode);
|
||||
break;
|
||||
}
|
||||
case AS_GET_MOUSE_MODE:
|
||||
@@ -947,7 +947,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// Attached data:
|
||||
// 1) port_id reply port - synchronous message
|
||||
|
||||
mode_mouse mmode=desktop->FFMouseMode();
|
||||
mode_mouse mmode=gDesktop->FFMouseMode();
|
||||
|
||||
port_id replyport = -1;
|
||||
msg.Read<int32>(&replyport);
|
||||
@@ -1209,7 +1209,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
font.SetSize(size);
|
||||
font.SetSpacing(spacing);
|
||||
|
||||
width = desktop->GetDisplayDriver()->StringWidth(string, length, font);
|
||||
width = gDesktop->GetDisplayDriver()->StringWidth(string, length, font);
|
||||
// NOTE: The line below will return the exact same thing. However,
|
||||
// the line above uses the AGG rendering backend, for which glyph caching
|
||||
// actually works. It is about 20 times faster!
|
||||
@@ -1890,7 +1890,7 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
// We have the screen_id and the workspace number, with these
|
||||
// we need to find the corresponding "driver", and call getmode on it
|
||||
display_mode mode;
|
||||
desktop->GetDisplayDriver()->GetMode(mode);
|
||||
gDesktop->GetDisplayDriver()->GetMode(mode);
|
||||
// actually this isn't still enough as different workspaces can
|
||||
// have different display_modes
|
||||
|
||||
@@ -1929,10 +1929,10 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
|
||||
// TODO: Adi doesn't like this: see if
|
||||
// messaging is better.
|
||||
desktop->ActiveRootLayer()->Lock();
|
||||
gDesktop->ActiveRootLayer()->Lock();
|
||||
// TODO: This should return something
|
||||
desktop->GetDisplayDriver()->SetMode(mode);
|
||||
desktop->ActiveRootLayer()->Unlock();
|
||||
gDesktop->GetDisplayDriver()->SetMode(mode);
|
||||
gDesktop->ActiveRootLayer()->Unlock();
|
||||
|
||||
int32 replyport;
|
||||
msg.Read<int32>(&replyport);
|
||||
|
||||
@@ -162,7 +162,7 @@ ServerWindow::Init(BRect frame, uint32 wlook,
|
||||
snprintf(name, sizeof(name), "%ld: %s", fClientTeamID, fName);
|
||||
|
||||
fWinBorder = new WinBorder(frame, name, wlook, wfeel, wflags,
|
||||
wwksindex, this, desktop->GetDisplayDriver());
|
||||
wwksindex, this, gDesktop->GetDisplayDriver());
|
||||
|
||||
// Spawn our message-monitoring thread
|
||||
fMonitorThreadID = spawn_thread(MonitorWin, fName, B_NORMAL_PRIORITY, this);
|
||||
@@ -378,7 +378,7 @@ ServerWindow::CreateLayerTree(Layer *localRoot, LinkMsgReader &link)
|
||||
STRACE(("ServerWindow(%s)::CreateLayerTree()-> layer %s, token %ld\n", fName,name,token));
|
||||
|
||||
Layer *newLayer = new Layer(frame, name, token, resizeMask,
|
||||
flags, desktop->GetDisplayDriver());
|
||||
flags, gDesktop->GetDisplayDriver());
|
||||
|
||||
free(name);
|
||||
|
||||
@@ -1179,7 +1179,7 @@ ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
||||
link.Read<int32>(&mainToken);
|
||||
link.Read(&teamID, sizeof(team_id));
|
||||
|
||||
wb = desktop->FindWinBorderByServerWindowTokenAndTeamID(mainToken, teamID);
|
||||
wb = gDesktop->FindWinBorderByServerWindowTokenAndTeamID(mainToken, teamID);
|
||||
if(wb)
|
||||
{
|
||||
fMsgSender->StartMessage(SERVER_TRUE);
|
||||
@@ -1208,7 +1208,7 @@ ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
||||
link.Read<int32>(&mainToken);
|
||||
link.Read(&teamID, sizeof(team_id));
|
||||
|
||||
wb = desktop->FindWinBorderByServerWindowTokenAndTeamID(mainToken, teamID);
|
||||
wb = gDesktop->FindWinBorderByServerWindowTokenAndTeamID(mainToken, teamID);
|
||||
if(wb)
|
||||
{
|
||||
fMsgSender->StartMessage(SERVER_TRUE);
|
||||
@@ -1488,8 +1488,8 @@ ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
||||
// 1) BPoint mouse location
|
||||
// 2) int32 button state
|
||||
|
||||
fMsgSender->Attach<BPoint>(desktop->GetDisplayDriver()->GetCursorPosition());
|
||||
fMsgSender->Attach<int32>(desktop->ActiveRootLayer()->Buttons());
|
||||
fMsgSender->Attach<BPoint>(gDesktop->GetDisplayDriver()->GetCursorPosition());
|
||||
fMsgSender->Attach<int32>(gDesktop->ActiveRootLayer()->Buttons());
|
||||
|
||||
fMsgSender->Flush();
|
||||
break;
|
||||
@@ -1510,10 +1510,10 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
if (fWinBorder->fInUpdate)
|
||||
rreg.IntersectWith(&fWinBorder->yUpdateReg);
|
||||
|
||||
desktop->GetDisplayDriver()->ConstrainClippingRegion(&rreg);
|
||||
gDesktop->GetDisplayDriver()->ConstrainClippingRegion(&rreg);
|
||||
// rgb_color rrr = fCurrentLayer->fLayerData->viewcolor.GetColor32();
|
||||
// RGBColor c(rand()%255,rand()%255,rand()%255);
|
||||
// desktop->GetDisplayDriver()->FillRect(BRect(0,0,639,479), c);
|
||||
// gDesktop->GetDisplayDriver()->FillRect(BRect(0,0,639,479), c);
|
||||
|
||||
switch (code) {
|
||||
case AS_STROKE_LINE:
|
||||
@@ -1530,7 +1530,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData) {
|
||||
BPoint p1(x1,y1);
|
||||
BPoint p2(x2,y2);
|
||||
desktop->GetDisplayDriver()->StrokeLine(fCurrentLayer->ConvertToTop(p1),
|
||||
gDesktop->GetDisplayDriver()->StrokeLine(fCurrentLayer->ConvertToTop(p1),
|
||||
fCurrentLayer->ConvertToTop(p2),
|
||||
fCurrentLayer->fLayerData);
|
||||
|
||||
@@ -1552,7 +1552,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
link.Read<BRect>(&rect);
|
||||
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->InvertRect(fCurrentLayer->ConvertToTop(rect));
|
||||
gDesktop->GetDisplayDriver()->InvertRect(fCurrentLayer->ConvertToTop(rect));
|
||||
break;
|
||||
}
|
||||
case AS_STROKE_RECT:
|
||||
@@ -1567,7 +1567,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
BRect rect(left,top,right,bottom);
|
||||
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->StrokeRect(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeRect(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_FILL_RECT:
|
||||
@@ -1577,7 +1577,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
BRect rect;
|
||||
link.Read<BRect>(&rect);
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->FillRect(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillRect(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_LAYER_DRAW_BITMAP_SYNC_AT_POINT:
|
||||
@@ -1677,7 +1677,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
link.Read<float>(&angle);
|
||||
link.Read<float>(&span);
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->StrokeArc(fCurrentLayer->ConvertToTop(r),angle,span,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeArc(fCurrentLayer->ConvertToTop(r),angle,span,fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_FILL_ARC:
|
||||
@@ -1691,7 +1691,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
link.Read<float>(&angle);
|
||||
link.Read<float>(&span);
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->FillArc(fCurrentLayer->ConvertToTop(r),angle,span,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillArc(fCurrentLayer->ConvertToTop(r),angle,span,fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_STROKE_BEZIER:
|
||||
@@ -1710,7 +1710,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for (i=0; i<4; i++)
|
||||
pts[i]=fCurrentLayer->ConvertToTop(pts[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->StrokeBezier(pts,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeBezier(pts,fCurrentLayer->fLayerData);
|
||||
}
|
||||
delete [] pts;
|
||||
break;
|
||||
@@ -1731,7 +1731,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for (i=0; i<4; i++)
|
||||
pts[i]=fCurrentLayer->ConvertToTop(pts[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->FillBezier(pts,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillBezier(pts,fCurrentLayer->fLayerData);
|
||||
}
|
||||
delete [] pts;
|
||||
break;
|
||||
@@ -1743,7 +1743,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
BRect rect;
|
||||
link.Read<BRect>(&rect);
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->StrokeEllipse(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeEllipse(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_FILL_ELLIPSE:
|
||||
@@ -1753,7 +1753,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
BRect rect;
|
||||
link.Read<BRect>(&rect);
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->FillEllipse(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillEllipse(fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_STROKE_ROUNDRECT:
|
||||
@@ -1767,7 +1767,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
link.Read<float>(&yrad);
|
||||
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->StrokeRoundRect(fCurrentLayer->ConvertToTop(rect),xrad,yrad,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeRoundRect(fCurrentLayer->ConvertToTop(rect),xrad,yrad,fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_FILL_ROUNDRECT:
|
||||
@@ -1781,7 +1781,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
link.Read<float>(&yrad);
|
||||
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->FillRoundRect(fCurrentLayer->ConvertToTop(rect),xrad,yrad,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillRoundRect(fCurrentLayer->ConvertToTop(rect),xrad,yrad,fCurrentLayer->fLayerData);
|
||||
break;
|
||||
}
|
||||
case AS_STROKE_TRIANGLE:
|
||||
@@ -1801,7 +1801,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for(int i=0;i<3;i++)
|
||||
pts[i]=fCurrentLayer->ConvertToTop(pts[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->StrokeTriangle(pts,fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeTriangle(pts,fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1822,7 +1822,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for(int i=0;i<3;i++)
|
||||
pts[i]=fCurrentLayer->ConvertToTop(pts[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->FillTriangle(pts,fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillTriangle(pts,fCurrentLayer->ConvertToTop(rect),fCurrentLayer->fLayerData);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1847,7 +1847,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for(int32 i=0; i<pointcount; i++)
|
||||
pointlist[i]=fCurrentLayer->ConvertToTop(pointlist[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->StrokePolygon(pointlist,pointcount,polyframe,
|
||||
gDesktop->GetDisplayDriver()->StrokePolygon(pointlist,pointcount,polyframe,
|
||||
fCurrentLayer->fLayerData,isclosed);
|
||||
|
||||
delete [] pointlist;
|
||||
@@ -1872,7 +1872,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for(int32 i=0; i<pointcount; i++)
|
||||
pointlist[i]=fCurrentLayer->ConvertToTop(pointlist[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->FillPolygon(pointlist,pointcount,polyframe,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillPolygon(pointlist,pointcount,polyframe,fCurrentLayer->fLayerData);
|
||||
|
||||
delete [] pointlist;
|
||||
|
||||
@@ -1901,7 +1901,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for(int32 i=0; i<ptcount; i++)
|
||||
ptlist[i]=fCurrentLayer->ConvertToTop(ptlist[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->StrokeShape(shaperect, opcount, oplist, ptcount, ptlist, fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeShape(shaperect, opcount, oplist, ptcount, ptlist, fCurrentLayer->fLayerData);
|
||||
delete oplist;
|
||||
delete ptlist;
|
||||
|
||||
@@ -1930,7 +1930,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
for(int32 i=0; i<ptcount; i++)
|
||||
ptlist[i]=fCurrentLayer->ConvertToTop(ptlist[i]);
|
||||
|
||||
desktop->GetDisplayDriver()->FillShape(shaperect, opcount, oplist, ptcount, ptlist, fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillShape(shaperect, opcount, oplist, ptcount, ptlist, fCurrentLayer->fLayerData);
|
||||
|
||||
delete oplist;
|
||||
delete ptlist;
|
||||
@@ -1954,7 +1954,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
// in repeatedly calling FillRect(), this is definitely in need of optimization. At
|
||||
// least it works for now. :)
|
||||
for(int32 i=0; i<rectcount; i++)
|
||||
desktop->GetDisplayDriver()->FillRect(fCurrentLayer->ConvertToTop(rectlist[i]),fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->FillRect(fCurrentLayer->ConvertToTop(rectlist[i]),fCurrentLayer->fLayerData);
|
||||
|
||||
delete [] rectlist;
|
||||
|
||||
@@ -1991,7 +1991,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
index->pt1=fCurrentLayer->ConvertToTop(index->pt1);
|
||||
index->pt2=fCurrentLayer->ConvertToTop(index->pt2);
|
||||
}
|
||||
desktop->GetDisplayDriver()->StrokeLineArray(linecount,linedata,fCurrentLayer->fLayerData);
|
||||
gDesktop->GetDisplayDriver()->StrokeLineArray(linecount,linedata,fCurrentLayer->fLayerData);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2009,7 +2009,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
link.ReadString(&string);
|
||||
|
||||
if (fCurrentLayer && fCurrentLayer->fLayerData)
|
||||
desktop->GetDisplayDriver()->DrawString(string, length,
|
||||
gDesktop->GetDisplayDriver()->DrawString(string, length,
|
||||
fCurrentLayer->ConvertToTop(location),
|
||||
fCurrentLayer->fLayerData);
|
||||
|
||||
@@ -2023,7 +2023,7 @@ ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||
}
|
||||
}
|
||||
|
||||
desktop->GetDisplayDriver()->ConstrainClippingRegion(NULL);
|
||||
gDesktop->GetDisplayDriver()->ConstrainClippingRegion(NULL);
|
||||
fWinBorder->GetRootLayer()->Unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ cnt = 0; // for debugging
|
||||
|
||||
RebuildFullRegion();
|
||||
|
||||
desktop->AddWinBorder(this);
|
||||
gDesktop->AddWinBorder(this);
|
||||
|
||||
STRACE(("WinBorder %s:\n",GetName()));
|
||||
STRACE(("\tFrame: (%.1f,%.1f,%.1f,%.1f)\n",r.left,r.top,r.right,r.bottom));
|
||||
@@ -129,7 +129,7 @@ WinBorder::~WinBorder(void)
|
||||
{
|
||||
STRACE(("WinBorder(%s)::~WinBorder()\n",GetName()));
|
||||
|
||||
desktop->RemoveWinBorder(this);
|
||||
gDesktop->RemoveWinBorder(this);
|
||||
|
||||
if (fTopLayer){
|
||||
delete fTopLayer;
|
||||
|
||||
Reference in New Issue
Block a user