Replaced _view_attr_ struct with a comparable ViewAttr class - removes a crash

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5618 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-12-07 22:08:45 +00:00
parent 2d923d67f0
commit 21c49a5cf3
+41 -2
View File
@@ -57,6 +57,7 @@
#include <TokenSpace.h>
#include <MessageUtils.h>
#include <Session.h>
#include <ColorUtils.h>
#include <ServerProtocol.h>
// Local Includes --------------------------------------------------------------
@@ -3447,7 +3448,7 @@ void BView::InitData(BRect frame, const char *name, uint32 resizingMode, uint32
f_is_printing = false;
fPermanentState = NULL;
fState = new _view_attr_;
fState = new ViewAttr;
fBounds = frame.OffsetToCopy(0.0, 0.0);
fShelf = NULL;
@@ -3844,7 +3845,7 @@ void BView::initCachedState(){
fState->viewColor.green = 255;
fState->viewColor.alpha = 255;
memcpy( &(fState->patt), &B_SOLID_HIGH, sizeof(pattern) );
fState->patt=B_SOLID_HIGH;
fState->drawingMode = B_OP_COPY;
@@ -4278,6 +4279,44 @@ void BView::PrintTree(){
}
}
ViewAttr::ViewAttr(void)
{
font=*be_plain_font;
fontFlags=font.Flags();
penPosition.Set(0,0);
penSize=1.0;
// This probably needs to be set to bounds by the owning BView
clippingRegion.MakeEmpty();
SetRGBColor(&highColor,0,0,0);
SetRGBColor(&lowColor,255,255,255);
SetRGBColor(&viewColor,255,255,255);
patt=B_SOLID_HIGH;
drawingMode=B_OP_COPY;
coordSysOrigin.Set(0,0);
lineJoin=B_BUTT_JOIN;
lineCap=B_BUTT_CAP;
miterLimit=B_DEFAULT_MITER_LIMIT;
alphaSrcMode=B_CONSTANT_ALPHA;
alphaFncMode=B_ALPHA_OVERLAY;
scale=1.0;
fontAliasing=false;
// flags used for synchronization with app_server
// TODO: set this to the default value, whatever that is
flags=B_VIEW_CLIP_REGION_BIT;
// TODO: find out what value this should have.
archivingFlags=B_VIEW_COORD_BIT;
}
//---------------------------------------------------------------------------
/* TODOs