Also commented some unimplemented message handler to not break the reply mechanism.

The ServerWindow did not even have such a mechanism anyway... (it now has).
Minor cleanup, replaced some "delete" with "delete[]" where appropriate.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13382 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-07-01 08:50:45 +00:00
parent 1e1b96cdc1
commit 37fa302a92

View File

@ -1137,6 +1137,7 @@ myRootLayer->Unlock();
Hide();
break;
}
#if 0
case AS_SEND_BEHIND:
{
// TODO: Implement AS_SEND_BEHIND
@ -1167,6 +1168,7 @@ myRootLayer->Unlock();
STRACE(("ServerWindow %s: Message Set_Title unimplemented\n", Title()));
break;
}
#endif
case AS_ADD_TO_SUBSET:
{
STRACE(("ServerWindow %s: Message AS_ADD_TO_SUBSET\n", Title()));
@ -1220,6 +1222,7 @@ myRootLayer->Unlock();
}
break;
}
#if 0
case AS_SET_LOOK:
{
// TODO: Implement AS_SET_LOOK
@ -1252,6 +1255,7 @@ myRootLayer->Unlock();
STRACE(("ServerWindow %s: Message Get_Alignment unimplemented\n", Title()));
break;
}
#endif
case AS_GET_WORKSPACES:
{
STRACE(("ServerWindow %s: Message Get_Workspaces unimplemented\n", Title()));
@ -1796,15 +1800,14 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
BPoint pts[3];
BRect rect;
for (int i=0; i<3; i++)
for (int i = 0; i < 3; i++)
link.Read<BPoint>(&(pts[i]));
link.Read<BRect>(&rect);
if (fCurrentLayer && fCurrentLayer->fLayerData)
{
for(int i=0;i<3;i++)
pts[i]=fCurrentLayer->ConvertToTop(pts[i]);
if (fCurrentLayer && fCurrentLayer->fLayerData) {
for (int i = 0;i < 3; i++)
pts[i] = fCurrentLayer->ConvertToTop(pts[i]);
gDesktop->GetDisplayDriver()->StrokeTriangle(pts, fCurrentLayer->ConvertToTop(rect), fCurrentLayer->fLayerData);
}
@ -1817,15 +1820,14 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
BPoint pts[3];
BRect rect;
for (int i=0; i<3; i++)
for (int i = 0; i < 3; i++)
link.Read<BPoint>(&(pts[i]));
link.Read<BRect>(&rect);
if (fCurrentLayer && fCurrentLayer->fLayerData)
{
for(int i=0;i<3;i++)
pts[i]=fCurrentLayer->ConvertToTop(pts[i]);
if (fCurrentLayer && fCurrentLayer->fLayerData) {
for (int i = 0; i < 3; i++)
pts[i] = fCurrentLayer->ConvertToTop(pts[i]);
gDesktop->GetDisplayDriver()->FillTriangle(pts, fCurrentLayer->ConvertToTop(rect), fCurrentLayer->fLayerData);
}
@ -1845,12 +1847,12 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<bool>(&isclosed);
link.Read<int32>(&pointcount);
pointlist=new BPoint[pointcount];
pointlist = new BPoint[pointcount];
link.Read(pointlist, sizeof(BPoint)*pointcount);
for(int32 i=0; i<pointcount; i++)
pointlist[i]=fCurrentLayer->ConvertToTop(pointlist[i]);
for (int32 i = 0; i < pointcount; i++)
pointlist[i] = fCurrentLayer->ConvertToTop(pointlist[i]);
gDesktop->GetDisplayDriver()->StrokePolygon(pointlist,pointcount,polyframe,
fCurrentLayer->fLayerData,isclosed);
@ -1869,17 +1871,16 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<BRect>(&polyframe);
link.Read<int32>(&pointcount);
pointlist=new BPoint[pointcount];
pointlist = new BPoint[pointcount];
link.Read(pointlist, sizeof(BPoint)*pointcount);
link.Read(pointlist, sizeof(BPoint) * pointcount);
for(int32 i=0; i<pointcount; i++)
pointlist[i]=fCurrentLayer->ConvertToTop(pointlist[i]);
for (int32 i = 0; i < pointcount; i++)
pointlist[i] = fCurrentLayer->ConvertToTop(pointlist[i]);
gDesktop->GetDisplayDriver()->FillPolygon(pointlist,pointcount,polyframe, fCurrentLayer->fLayerData);
delete [] pointlist;
break;
}
case AS_STROKE_SHAPE:
@ -1896,19 +1897,18 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<int32>(&opcount);
link.Read<int32>(&ptcount);
oplist=new int32[opcount];
ptlist=new BPoint[ptcount];
oplist = new int32[opcount];
ptlist = new BPoint[ptcount];
link.Read(oplist,sizeof(int32)*opcount);
link.Read(ptlist,sizeof(BPoint)*ptcount);
link.Read(oplist, sizeof(int32) * opcount);
link.Read(ptlist, sizeof(BPoint) * ptcount);
for(int32 i=0; i<ptcount; i++)
ptlist[i]=fCurrentLayer->ConvertToTop(ptlist[i]);
for (int32 i = 0; i < ptcount; i++)
ptlist[i] = fCurrentLayer->ConvertToTop(ptlist[i]);
gDesktop->GetDisplayDriver()->StrokeShape(shaperect, opcount, oplist, ptcount, ptlist, fCurrentLayer->fLayerData);
delete oplist;
delete ptlist;
delete[] oplist;
delete[] ptlist;
break;
}
case AS_FILL_SHAPE:
@ -1925,20 +1925,19 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<int32>(&opcount);
link.Read<int32>(&ptcount);
oplist=new int32[opcount];
ptlist=new BPoint[ptcount];
oplist = new int32[opcount];
ptlist = new BPoint[ptcount];
link.Read(oplist,sizeof(int32)*opcount);
link.Read(ptlist,sizeof(BPoint)*ptcount);
link.Read(oplist, sizeof(int32) * opcount);
link.Read(ptlist, sizeof(BPoint) * ptcount);
for(int32 i=0; i<ptcount; i++)
ptlist[i]=fCurrentLayer->ConvertToTop(ptlist[i]);
for (int32 i = 0; i < ptcount; i++)
ptlist[i] = fCurrentLayer->ConvertToTop(ptlist[i]);
gDesktop->GetDisplayDriver()->FillShape(shaperect, opcount, oplist, ptcount, ptlist, fCurrentLayer->fLayerData);
delete oplist;
delete ptlist;
delete[] oplist;
delete[] ptlist;
break;
}
case AS_FILL_REGION:
@ -1979,13 +1978,11 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
int32 linecount;
link.Read<int32>(&linecount);
if(linecount>0)
{
if (linecount > 0) {
LineArrayData linedata[linecount], *index;
for(int32 i=0; i<linecount; i++)
{
index=&linedata[i];
for (int32 i = 0; i < linecount; i++) {
index = &linedata[i];
link.Read<float>(&(index->pt1.x));
link.Read<float>(&(index->pt1.y));
@ -1993,8 +1990,8 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<float>(&(index->pt2.y));
link.Read<rgb_color>(&(index->color));
index->pt1=fCurrentLayer->ConvertToTop(index->pt1);
index->pt2=fCurrentLayer->ConvertToTop(index->pt2);
index->pt1 = fCurrentLayer->ConvertToTop(index->pt1);
index->pt2 = fCurrentLayer->ConvertToTop(index->pt2);
}
gDesktop->GetDisplayDriver()->StrokeLineArray(linecount,linedata,fCurrentLayer->fLayerData);
}
@ -2021,11 +2018,17 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
free(string);
break;
}
default:
{
printf("ServerWindow %s received unexpected code - message offset %ld\n", Title(), code - SERVER_TRUE);
printf("ServerWindow %s received unexpected code - message offset %ld\n",
Title(), code - SERVER_TRUE);
if (link.NeedsReply()) {
// the client is now blocking and waiting for a reply!
fLink.StartMessage(SERVER_FALSE);
fLink.Flush();
}
break;
}
}
gDesktop->GetDisplayDriver()->ConstrainClippingRegion(NULL);