DisplayDriver now has publically-accessible locking/unlocking
StrokeLineArray fixes for ViewDriver Fixes to display multiple overlapping windows properly Layer::RebuildRegions works right now. :) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4116 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e81c16a881
commit
a7e4fa4c55
@ -352,7 +352,7 @@ void AccelerantDriver::DrawString(const char *string, int32 length, BPoint pt, L
|
|||||||
if(!string || !d || !d->font)
|
if(!string || !d || !d->font)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
pt.y--; // because of Be's backward compatibility hack
|
pt.y--; // because of Be's backward compatibility hack
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ void AccelerantDriver::DrawString(const char *string, int32 length, BPoint pt, L
|
|||||||
|
|
||||||
if(!style)
|
if(!style)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ void AccelerantDriver::DrawString(const char *string, int32 length, BPoint pt, L
|
|||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
printf("Couldn't create face object\n");
|
printf("Couldn't create face object\n");
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ void AccelerantDriver::DrawString(const char *string, int32 length, BPoint pt, L
|
|||||||
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ void AccelerantDriver::DrawString(const char *string, int32 length, BPoint pt, L
|
|||||||
previous=glyph_index;
|
previous=glyph_index;
|
||||||
}
|
}
|
||||||
FT_Done_Face(face);
|
FT_Done_Face(face);
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -538,7 +538,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
oldpensize = d->pensize;
|
oldpensize = d->pensize;
|
||||||
@ -1035,7 +1035,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
d->pensize = oldpensize;
|
d->pensize = oldpensize;
|
||||||
_Unlock();
|
Unlock();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1063,7 +1063,7 @@ void AccelerantDriver::FillBezier(BPoint *pts, LayerData *d, int8 *pat)
|
|||||||
float oldpensize;
|
float oldpensize;
|
||||||
bool steep = false;
|
bool steep = false;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
if ( fabs(pts[3].y-pts[0].y) > fabs(pts[3].x-pts[0].x) )
|
if ( fabs(pts[3].y-pts[0].y) > fabs(pts[3].x-pts[0].x) )
|
||||||
steep = true;
|
steep = true;
|
||||||
|
|
||||||
@ -1117,7 +1117,7 @@ void AccelerantDriver::FillBezier(BPoint *pts, LayerData *d, int8 *pat)
|
|||||||
ddy += dddy;
|
ddy += dddy;
|
||||||
}
|
}
|
||||||
d->pensize = oldpensize;
|
d->pensize = oldpensize;
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1145,7 +1145,7 @@ void AccelerantDriver::FillEllipse(BRect r, LayerData *d, int8 *pat)
|
|||||||
int px = 0;
|
int px = 0;
|
||||||
int py = twoRx2 * y;
|
int py = twoRx2 * y;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
|
|
||||||
@ -1202,7 +1202,7 @@ void AccelerantDriver::FillEllipse(BRect r, LayerData *d, int8 *pat)
|
|||||||
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
|
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1226,10 +1226,10 @@ void AccelerantDriver::FillPolygon(BPoint *ptlist, int32 numpts, BRect rect, Lay
|
|||||||
horizontal line, second intersection is end of horizontal line. Continue for
|
horizontal line, second intersection is end of horizontal line. Continue for
|
||||||
all pairs of intersections. Watch out for horizontal line segments.
|
all pairs of intersections. Watch out for horizontal line segments.
|
||||||
*/
|
*/
|
||||||
_Lock();
|
Lock();
|
||||||
if ( !ptlist || (numpts < 3) )
|
if ( !ptlist || (numpts < 3) )
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
@ -1339,7 +1339,7 @@ void AccelerantDriver::FillPolygon(BPoint *ptlist, int32 numpts, BRect rect, Lay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete[] segmentArray;
|
delete[] segmentArray;
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1351,7 +1351,7 @@ void AccelerantDriver::FillPolygon(BPoint *ptlist, int32 numpts, BRect rect, Lay
|
|||||||
*/
|
*/
|
||||||
void AccelerantDriver::FillRect(BRect r, LayerData *d, int8 *pat)
|
void AccelerantDriver::FillRect(BRect r, LayerData *d, int8 *pat)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
#ifndef DISABLE_HARDWARE_ACCELERATION
|
#ifndef DISABLE_HARDWARE_ACCELERATION
|
||||||
if ( accFillRect && AcquireEngine && (((uint8)*pat == 0xFF) || (*pat == 0)) )
|
if ( accFillRect && AcquireEngine && (((uint8)*pat == 0xFF) || (*pat == 0)) )
|
||||||
{
|
{
|
||||||
@ -1425,7 +1425,7 @@ void AccelerantDriver::FillRect(BRect r, LayerData *d, int8 *pat)
|
|||||||
accFillRect(mEngineToken, color, &fillParams, 1);
|
accFillRect(mEngineToken, color, &fillParams, 1);
|
||||||
if ( ReleaseEngine )
|
if ( ReleaseEngine )
|
||||||
ReleaseEngine(mEngineToken,NULL);
|
ReleaseEngine(mEngineToken,NULL);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1490,7 +1490,7 @@ void AccelerantDriver::FillRect(BRect r, LayerData *d, int8 *pat)
|
|||||||
printf("Error: Unknown color space\n");
|
printf("Error: Unknown color space\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1510,7 +1510,7 @@ void AccelerantDriver::FillRoundRect(BRect r, float xrad, float yrad, LayerData
|
|||||||
float yrad2 = yrad*yrad;
|
float yrad2 = yrad*yrad;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
|
|
||||||
@ -1527,7 +1527,7 @@ void AccelerantDriver::FillRoundRect(BRect r, float xrad, float yrad, LayerData
|
|||||||
FillRect(BRect(CLIP_X(r.left),CLIP_Y(r.top+yrad),
|
FillRect(BRect(CLIP_X(r.left),CLIP_Y(r.top+yrad),
|
||||||
CLIP_X(r.right),CLIP_Y(r.bottom-yrad)), d, pat);
|
CLIP_X(r.right),CLIP_Y(r.bottom-yrad)), d, pat);
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
//void AccelerantDriver::FillShape(SShape *sh, LayerData *d, int8 *pat)
|
//void AccelerantDriver::FillShape(SShape *sh, LayerData *d, int8 *pat)
|
||||||
@ -1550,7 +1550,7 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
|
|||||||
if(!pts || !d || !pat)
|
if(!pts || !d || !pat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
BPoint first, second, third;
|
BPoint first, second, third;
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
@ -1599,7 +1599,7 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
|
|||||||
end.x=MAX(first.x,MAX(second.x,third.x));
|
end.x=MAX(first.x,MAX(second.x,third.x));
|
||||||
if ( CHECK_Y(start.y) && (CHECK_X(start.x) || CHECK_X(end.x)) )
|
if ( CHECK_Y(start.y) && (CHECK_X(start.x) || CHECK_X(end.x)) )
|
||||||
HLine(ROUND(CLIP_X(start.x)), ROUND(CLIP_X(end.x)), ROUND(start.y), &pattern);
|
HLine(ROUND(CLIP_X(start.x)), ROUND(CLIP_X(end.x)), ROUND(start.y), &pattern);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1616,7 +1616,7 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
|
|||||||
for(i=(int32)first.y+1; i<=third.y; i++)
|
for(i=(int32)first.y+1; i<=third.y; i++)
|
||||||
if ( CHECK_Y(i) && (CHECK_X(lineA.GetX(i)) || CHECK_X(lineB.GetX(i))) )
|
if ( CHECK_Y(i) && (CHECK_X(lineA.GetX(i)) || CHECK_X(lineB.GetX(i))) )
|
||||||
HLine(ROUND(CLIP_X(lineA.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
|
HLine(ROUND(CLIP_X(lineA.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1631,7 +1631,7 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
|
|||||||
for(i=(int32)first.y; i<third.y; i++)
|
for(i=(int32)first.y; i<third.y; i++)
|
||||||
if ( CHECK_Y(i) && (CHECK_X(lineA.GetX(i)) || CHECK_X(lineB.GetX(i))) )
|
if ( CHECK_Y(i) && (CHECK_X(lineA.GetX(i)) || CHECK_X(lineB.GetX(i))) )
|
||||||
HLine(ROUND(CLIP_X(lineA.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
|
HLine(ROUND(CLIP_X(lineA.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1648,7 +1648,7 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
|
|||||||
if ( CHECK_Y(i) && (CHECK_X(lineC.GetX(i)) || CHECK_X(lineB.GetX(i))) )
|
if ( CHECK_Y(i) && (CHECK_X(lineC.GetX(i)) || CHECK_X(lineB.GetX(i))) )
|
||||||
HLine(ROUND(CLIP_X(lineC.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
|
HLine(ROUND(CLIP_X(lineC.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1660,7 +1660,7 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
|
|||||||
*/
|
*/
|
||||||
void AccelerantDriver::HideCursor(void)
|
void AccelerantDriver::HideCursor(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(!IsCursorHidden())
|
if(!IsCursorHidden())
|
||||||
{
|
{
|
||||||
if ( accShowCursor )
|
if ( accShowCursor )
|
||||||
@ -1669,7 +1669,7 @@ void AccelerantDriver::HideCursor(void)
|
|||||||
BlitBitmap(under_cursor,under_cursor->Bounds(),cursorframe, B_OP_COPY);
|
BlitBitmap(under_cursor,under_cursor->Bounds(),cursorframe, B_OP_COPY);
|
||||||
}
|
}
|
||||||
DisplayDriver::HideCursor();
|
DisplayDriver::HideCursor();
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1685,7 +1685,7 @@ void AccelerantDriver::HideCursor(void)
|
|||||||
void AccelerantDriver::MoveCursorTo(float x, float y)
|
void AccelerantDriver::MoveCursorTo(float x, float y)
|
||||||
{
|
{
|
||||||
/* TODO: Add correct handling of obscured cursors */
|
/* TODO: Add correct handling of obscured cursors */
|
||||||
_Lock();
|
Lock();
|
||||||
if ( accMoveCursor )
|
if ( accMoveCursor )
|
||||||
{
|
{
|
||||||
accMoveCursor((uint16)x,(uint16)y);
|
accMoveCursor((uint16)x,(uint16)y);
|
||||||
@ -1702,7 +1702,7 @@ void AccelerantDriver::MoveCursorTo(float x, float y)
|
|||||||
BlitBitmap(cursor,cursor->Bounds(),cursorframe, B_OP_OVER);
|
BlitBitmap(cursor,cursor->Bounds(),cursorframe, B_OP_OVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1711,7 +1711,7 @@ void AccelerantDriver::MoveCursorTo(float x, float y)
|
|||||||
*/
|
*/
|
||||||
void AccelerantDriver::InvertRect(BRect r)
|
void AccelerantDriver::InvertRect(BRect r)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if ( accInvertRect && AcquireEngine && (AcquireEngine(0,0,NULL,&mEngineToken) == B_OK) )
|
if ( accInvertRect && AcquireEngine && (AcquireEngine(0,0,NULL,&mEngineToken) == B_OK) )
|
||||||
{
|
{
|
||||||
fill_rect_params fillParams;
|
fill_rect_params fillParams;
|
||||||
@ -1722,7 +1722,7 @@ void AccelerantDriver::InvertRect(BRect r)
|
|||||||
accInvertRect(mEngineToken, &fillParams, 1);
|
accInvertRect(mEngineToken, &fillParams, 1);
|
||||||
if ( ReleaseEngine )
|
if ( ReleaseEngine )
|
||||||
ReleaseEngine(mEngineToken,NULL);
|
ReleaseEngine(mEngineToken,NULL);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (mDisplayMode.space)
|
switch (mDisplayMode.space)
|
||||||
@ -1813,7 +1813,7 @@ void AccelerantDriver::InvertRect(BRect r)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1825,7 +1825,7 @@ void AccelerantDriver::InvertRect(BRect r)
|
|||||||
*/
|
*/
|
||||||
void AccelerantDriver::ShowCursor(void)
|
void AccelerantDriver::ShowCursor(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(IsCursorHidden())
|
if(IsCursorHidden())
|
||||||
{
|
{
|
||||||
if ( accShowCursor )
|
if ( accShowCursor )
|
||||||
@ -1834,7 +1834,7 @@ void AccelerantDriver::ShowCursor(void)
|
|||||||
BlitBitmap(cursor,cursor->Bounds(),cursorframe, B_OP_OVER);
|
BlitBitmap(cursor,cursor->Bounds(),cursorframe, B_OP_OVER);
|
||||||
}
|
}
|
||||||
DisplayDriver::ShowCursor();
|
DisplayDriver::ShowCursor();
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1846,7 +1846,7 @@ void AccelerantDriver::ShowCursor(void)
|
|||||||
*/
|
*/
|
||||||
void AccelerantDriver::ObscureCursor(void)
|
void AccelerantDriver::ObscureCursor(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if (!IsCursorHidden() )
|
if (!IsCursorHidden() )
|
||||||
{
|
{
|
||||||
if ( accShowCursor )
|
if ( accShowCursor )
|
||||||
@ -1855,7 +1855,7 @@ void AccelerantDriver::ObscureCursor(void)
|
|||||||
BlitBitmap(under_cursor,under_cursor->Bounds(),cursorframe, B_OP_COPY);
|
BlitBitmap(under_cursor,under_cursor->Bounds(),cursorframe, B_OP_COPY);
|
||||||
}
|
}
|
||||||
DisplayDriver::ObscureCursor();
|
DisplayDriver::ObscureCursor();
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1871,7 +1871,7 @@ void AccelerantDriver::SetCursor(ServerCursor *csr)
|
|||||||
if(!csr)
|
if(!csr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
if ( accSetCursorShape && (csr->BitsPerPixel() == 1) )
|
if ( accSetCursorShape && (csr->BitsPerPixel() == 1) )
|
||||||
{
|
{
|
||||||
/* TODO: Need to fix transparency */
|
/* TODO: Need to fix transparency */
|
||||||
@ -1914,7 +1914,7 @@ void AccelerantDriver::SetCursor(ServerCursor *csr)
|
|||||||
if(!IsCursorHidden())
|
if(!IsCursorHidden())
|
||||||
BlitBitmap(cursor,cursor->Bounds(),cursorframe, B_OP_OVER);
|
BlitBitmap(cursor,cursor->Bounds(),cursorframe, B_OP_OVER);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1955,7 +1955,7 @@ void AccelerantDriver::SetCursor(ServerCursor *csr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
|
|
||||||
@ -2082,7 +2082,7 @@ void AccelerantDriver::SetCursor(ServerCursor *csr)
|
|||||||
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
|
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
|
||||||
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
|
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2105,7 +2105,7 @@ void AccelerantDriver::StrokeBezier(BPoint *pts, LayerData *d, int8 *pat)
|
|||||||
double dt2, dt3;
|
double dt2, dt3;
|
||||||
double X, Y, dx, ddx, dddx, dy, ddy, dddy;
|
double X, Y, dx, ddx, dddx, dy, ddy, dddy;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
|
|
||||||
@ -2150,7 +2150,7 @@ void AccelerantDriver::StrokeBezier(BPoint *pts, LayerData *d, int8 *pat)
|
|||||||
dy += ddy;
|
dy += ddy;
|
||||||
ddy += dddy;
|
ddy += dddy;
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2179,7 +2179,7 @@ void AccelerantDriver::StrokeEllipse(BRect r, LayerData *d, int8 *pat)
|
|||||||
int py = twoRx2 * y;
|
int py = twoRx2 * y;
|
||||||
int thick;
|
int thick;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
thick = (int)d->pensize;
|
thick = (int)d->pensize;
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
@ -2230,7 +2230,7 @@ void AccelerantDriver::StrokeEllipse(BRect r, LayerData *d, int8 *pat)
|
|||||||
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
|
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
|
||||||
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
|
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2258,7 +2258,7 @@ void AccelerantDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *
|
|||||||
double y = y1;
|
double y = y1;
|
||||||
int thick;
|
int thick;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
thick = (int)d->pensize;
|
thick = (int)d->pensize;
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
@ -2278,7 +2278,7 @@ void AccelerantDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *
|
|||||||
y += yInc;
|
y += yInc;
|
||||||
SetThickPixel(ROUND(x),ROUND(y),thick,&pattern);
|
SetThickPixel(ROUND(x),ROUND(y),thick,&pattern);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2295,12 +2295,12 @@ void AccelerantDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *
|
|||||||
void AccelerantDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
|
void AccelerantDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
|
||||||
{
|
{
|
||||||
/* Bounds checking is handled by StrokeLine and the functions it uses */
|
/* Bounds checking is handled by StrokeLine and the functions it uses */
|
||||||
_Lock();
|
Lock();
|
||||||
for(int32 i=0; i<(numpts-1); i++)
|
for(int32 i=0; i<(numpts-1); i++)
|
||||||
StrokeLine(ptlist[i],ptlist[i+1],d,pat);
|
StrokeLine(ptlist[i],ptlist[i+1],d,pat);
|
||||||
if(is_closed)
|
if(is_closed)
|
||||||
StrokeLine(ptlist[numpts-1],ptlist[0],d,pat);
|
StrokeLine(ptlist[numpts-1],ptlist[0],d,pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2312,7 +2312,7 @@ void AccelerantDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, L
|
|||||||
*/
|
*/
|
||||||
void AccelerantDriver::StrokeRect(BRect r, LayerData *d, int8 *pat)
|
void AccelerantDriver::StrokeRect(BRect r, LayerData *d, int8 *pat)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
int thick = (int)d->pensize;
|
int thick = (int)d->pensize;
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
@ -2321,7 +2321,7 @@ void AccelerantDriver::StrokeRect(BRect r, LayerData *d, int8 *pat)
|
|||||||
StrokeLine(r.RightTop(), r.RightBottom(), d, pat);
|
StrokeLine(r.RightTop(), r.RightBottom(), d, pat);
|
||||||
HLineThick(ROUND(r.right), ROUND(r.left), ROUND(r.bottom), thick, &pattern);
|
HLineThick(ROUND(r.right), ROUND(r.left), ROUND(r.bottom), thick, &pattern);
|
||||||
StrokeLine(r.LeftTop(), r.LeftBottom(), d, pat);
|
StrokeLine(r.LeftTop(), r.LeftBottom(), d, pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2340,7 +2340,7 @@ void AccelerantDriver::StrokeRoundRect(BRect r, float xrad, float yrad, LayerDat
|
|||||||
float hLeft, hRight;
|
float hLeft, hRight;
|
||||||
float vTop, vBottom;
|
float vTop, vBottom;
|
||||||
float bLeft, bRight, bTop, bBottom;
|
float bLeft, bRight, bTop, bBottom;
|
||||||
_Lock();
|
Lock();
|
||||||
int thick = (int)d->pensize;
|
int thick = (int)d->pensize;
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
@ -2364,7 +2364,7 @@ void AccelerantDriver::StrokeRoundRect(BRect r, float xrad, float yrad, LayerDat
|
|||||||
|
|
||||||
StrokeArc(BRect(bRight,bBottom,r.right,r.bottom), 270, 90, d, pat);
|
StrokeArc(BRect(bRight,bBottom,r.right,r.bottom), 270, 90, d, pat);
|
||||||
StrokeLine(BPoint(r.right,vBottom),BPoint(r.right,vTop),d,pat);
|
StrokeLine(BPoint(r.right,vBottom),BPoint(r.right,vTop),d,pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
//void AccelerantDriver::StrokeShape(SShape *sh, LayerData *d, int8 *pat)
|
//void AccelerantDriver::StrokeShape(SShape *sh, LayerData *d, int8 *pat)
|
||||||
@ -2385,11 +2385,11 @@ void AccelerantDriver::StrokeRoundRect(BRect r, float xrad, float yrad, LayerDat
|
|||||||
void AccelerantDriver::StrokeTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
void AccelerantDriver::StrokeTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
||||||
{
|
{
|
||||||
/* Bounds checking is handled by StrokeLine and the functions it calls */
|
/* Bounds checking is handled by StrokeLine and the functions it calls */
|
||||||
_Lock();
|
Lock();
|
||||||
StrokeLine(pts[0],pts[1],d,pat);
|
StrokeLine(pts[0],pts[1],d,pat);
|
||||||
StrokeLine(pts[1],pts[2],d,pat);
|
StrokeLine(pts[1],pts[2],d,pat);
|
||||||
StrokeLine(pts[2],pts[0],d,pat);
|
StrokeLine(pts[2],pts[0],d,pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2405,9 +2405,9 @@ void AccelerantDriver::StrokeTriangle(BPoint *pts, BRect r, LayerData *d, int8 *
|
|||||||
*/
|
*/
|
||||||
void AccelerantDriver::StrokeLineArray(BPoint *pts, int32 numlines, RGBColor *colors, LayerData *d)
|
void AccelerantDriver::StrokeLineArray(BPoint *pts, int32 numlines, RGBColor *colors, LayerData *d)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2424,7 +2424,7 @@ void AccelerantDriver::SetMode(int32 mode)
|
|||||||
int proposed_width, proposed_height, proposed_depth;
|
int proposed_width, proposed_height, proposed_depth;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
if ( SetDisplayMode )
|
if ( SetDisplayMode )
|
||||||
{
|
{
|
||||||
@ -2451,7 +2451,7 @@ void AccelerantDriver::SetMode(int32 mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2480,14 +2480,14 @@ float AccelerantDriver::StringWidth(const char *string, int32 length, LayerData
|
|||||||
{
|
{
|
||||||
if(!string || !d || !d->font)
|
if(!string || !d || !d->font)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
ServerFont *font=d->font;
|
ServerFont *font=d->font;
|
||||||
FontStyle *style=font->Style();
|
FontStyle *style=font->Style();
|
||||||
|
|
||||||
if(!style)
|
if(!style)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2502,7 +2502,7 @@ float AccelerantDriver::StringWidth(const char *string, int32 length, LayerData
|
|||||||
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2513,7 +2513,7 @@ float AccelerantDriver::StringWidth(const char *string, int32 length, LayerData
|
|||||||
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2545,7 +2545,7 @@ float AccelerantDriver::StringWidth(const char *string, int32 length, LayerData
|
|||||||
FT_Done_Face(face);
|
FT_Done_Face(face);
|
||||||
|
|
||||||
returnval=pen.x>>6;
|
returnval=pen.x>>6;
|
||||||
_Unlock();
|
Unlock();
|
||||||
return returnval;
|
return returnval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2565,14 +2565,14 @@ float AccelerantDriver::StringHeight(const char *string, int32 length, LayerData
|
|||||||
{
|
{
|
||||||
if(!string || !d || !d->font)
|
if(!string || !d || !d->font)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
ServerFont *font=d->font;
|
ServerFont *font=d->font;
|
||||||
FontStyle *style=font->Style();
|
FontStyle *style=font->Style();
|
||||||
|
|
||||||
if(!style)
|
if(!style)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2585,7 +2585,7 @@ float AccelerantDriver::StringHeight(const char *string, int32 length, LayerData
|
|||||||
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2594,7 +2594,7 @@ float AccelerantDriver::StringHeight(const char *string, int32 length, LayerData
|
|||||||
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2612,12 +2612,12 @@ float AccelerantDriver::StringHeight(const char *string, int32 length, LayerData
|
|||||||
else
|
else
|
||||||
ascent=MAX(slot->bitmap.rows,ascent);
|
ascent=MAX(slot->bitmap.rows,ascent);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
|
|
||||||
FT_Done_Face(face);
|
FT_Done_Face(face);
|
||||||
|
|
||||||
returnval=ascent+descent;
|
returnval=ascent+descent;
|
||||||
_Unlock();
|
Unlock();
|
||||||
return returnval;
|
return returnval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ void BitmapDriver::Shutdown(void)
|
|||||||
|
|
||||||
void BitmapDriver::SetTarget(ServerBitmap *target)
|
void BitmapDriver::SetTarget(ServerBitmap *target)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
_target=target;
|
_target=target;
|
||||||
|
|
||||||
if(target)
|
if(target)
|
||||||
@ -160,7 +160,7 @@ void BitmapDriver::SetTarget(ServerBitmap *target)
|
|||||||
// Setting mode not necessary. Can get color space stuff via ServerBitmap->ColorSpace
|
// Setting mode not necessary. Can get color space stuff via ServerBitmap->ColorSpace
|
||||||
}
|
}
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -188,10 +188,10 @@ printf("BitmapDriver::CopyBits unimplemented\n");
|
|||||||
*/
|
*/
|
||||||
void BitmapDriver::DrawBitmap(ServerBitmap *bitmap, BRect source, BRect dest, LayerData *d)
|
void BitmapDriver::DrawBitmap(ServerBitmap *bitmap, BRect source, BRect dest, LayerData *d)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
//TODO: Implement
|
//TODO: Implement
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -328,7 +328,7 @@ void BitmapDriver::FillEllipse(BRect r, LayerData *ldata, int8 *pat)
|
|||||||
*/
|
*/
|
||||||
void BitmapDriver::FillRect(BRect r, LayerData *d, int8 *pat)
|
void BitmapDriver::FillRect(BRect r, LayerData *d, int8 *pat)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(_target)
|
if(_target)
|
||||||
{
|
{
|
||||||
// int32 width=rect.IntegerWidth();
|
// int32 width=rect.IntegerWidth();
|
||||||
@ -336,7 +336,7 @@ void BitmapDriver::FillRect(BRect r, LayerData *d, int8 *pat)
|
|||||||
// HLine(fbuffer->gcinfo,(int32)rect.left,i,width,col);
|
// HLine(fbuffer->gcinfo,(int32)rect.left,i,width,col);
|
||||||
Line(BPoint(r.left,i),BPoint(r.right,i),d,pat);
|
Line(BPoint(r.left,i),BPoint(r.right,i),d,pat);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -372,7 +372,7 @@ void BitmapDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
|||||||
if(!pts || !d || !pat)
|
if(!pts || !d || !pat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
if(_target)
|
if(_target)
|
||||||
{
|
{
|
||||||
BPoint first, second, third;
|
BPoint first, second, third;
|
||||||
@ -417,7 +417,7 @@ void BitmapDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
|||||||
start.x=MIN(first.x,MIN(second.x,third.x));
|
start.x=MIN(first.x,MIN(second.x,third.x));
|
||||||
end.x=MAX(first.x,MAX(second.x,third.x));
|
end.x=MAX(first.x,MAX(second.x,third.x));
|
||||||
Line(start,end, d, pat);
|
Line(start,end, d, pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ void BitmapDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
|||||||
Line(first, second,d,pat);
|
Line(first, second,d,pat);
|
||||||
for(i=int32(first.y+1);i<third.y;i++)
|
for(i=int32(first.y+1);i<third.y;i++)
|
||||||
Line( BPoint(lineA.GetX(i),i), BPoint(lineB.GetX(i),i),d,pat);
|
Line( BPoint(lineA.GetX(i),i), BPoint(lineB.GetX(i),i),d,pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ void BitmapDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
|||||||
Line(second, third,d,pat);
|
Line(second, third,d,pat);
|
||||||
for(i=int32(first.y+1);i<third.y;i++)
|
for(i=int32(first.y+1);i<third.y;i++)
|
||||||
Line( BPoint(lineA.GetX(i),i), BPoint(lineB.GetX(i),i),d,pat);
|
Line( BPoint(lineA.GetX(i),i), BPoint(lineB.GetX(i),i),d,pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,7 +468,7 @@ void BitmapDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
|||||||
Line( BPoint(lineC.GetX(i),i), BPoint(lineB.GetX(i),i),d,pat);
|
Line( BPoint(lineC.GetX(i),i), BPoint(lineB.GetX(i),i),d,pat);
|
||||||
|
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitmapDriver::SetThickPixel(int x, int y, int thick, RGBColor col)
|
void BitmapDriver::SetThickPixel(int x, int y, int thick, RGBColor col)
|
||||||
@ -953,7 +953,7 @@ void BitmapDriver::StrokeEllipse(BRect r, LayerData *ldata, int8 *pat)
|
|||||||
*/
|
*/
|
||||||
void BitmapDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *pat)
|
void BitmapDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *pat)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(_target)
|
if(_target)
|
||||||
{
|
{
|
||||||
// Courtesy YNOP's SecondDriver with minor changes by DW
|
// Courtesy YNOP's SecondDriver with minor changes by DW
|
||||||
@ -994,7 +994,7 @@ void BitmapDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *pat)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1010,7 +1010,7 @@ void BitmapDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *pat)
|
|||||||
*/
|
*/
|
||||||
void BitmapDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
|
void BitmapDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(_target)
|
if(_target)
|
||||||
{
|
{
|
||||||
for(int32 i=0; i<(numpts-1); i++)
|
for(int32 i=0; i<(numpts-1); i++)
|
||||||
@ -1019,7 +1019,7 @@ void BitmapDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, Layer
|
|||||||
if(is_closed)
|
if(is_closed)
|
||||||
Line(ptlist[numpts-1],ptlist[0],d,pat);
|
Line(ptlist[numpts-1],ptlist[0],d,pat);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1031,7 +1031,7 @@ void BitmapDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, Layer
|
|||||||
*/
|
*/
|
||||||
void BitmapDriver::StrokeRect(BRect r, LayerData *d, int8 *pat)
|
void BitmapDriver::StrokeRect(BRect r, LayerData *d, int8 *pat)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(_target)
|
if(_target)
|
||||||
{
|
{
|
||||||
Line(r.LeftTop(),r.RightTop(),d,pat);
|
Line(r.LeftTop(),r.RightTop(),d,pat);
|
||||||
@ -1039,7 +1039,7 @@ void BitmapDriver::StrokeRect(BRect r, LayerData *d, int8 *pat)
|
|||||||
Line(r.RightBottom(),r.LeftBottom(),d,pat);
|
Line(r.RightBottom(),r.LeftBottom(),d,pat);
|
||||||
Line(r.LeftTop(),r.LeftBottom(),d,pat);
|
Line(r.LeftTop(),r.LeftBottom(),d,pat);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1058,7 +1058,7 @@ void BitmapDriver::StrokeRoundRect(BRect r, float xrad, float yrad, LayerData *d
|
|||||||
float hLeft, hRight;
|
float hLeft, hRight;
|
||||||
float vTop, vBottom;
|
float vTop, vBottom;
|
||||||
float bLeft, bRight, bTop, bBottom;
|
float bLeft, bRight, bTop, bBottom;
|
||||||
_Lock();
|
Lock();
|
||||||
PatternHandler pattern(pat);
|
PatternHandler pattern(pat);
|
||||||
pattern.SetColors(d->highcolor, d->lowcolor);
|
pattern.SetColors(d->highcolor, d->lowcolor);
|
||||||
|
|
||||||
@ -1081,7 +1081,7 @@ void BitmapDriver::StrokeRoundRect(BRect r, float xrad, float yrad, LayerData *d
|
|||||||
|
|
||||||
StrokeArc(BRect(bRight,bBottom,r.right,r.bottom), 270, 90, d, pat);
|
StrokeArc(BRect(bRight,bBottom,r.right,r.bottom), 270, 90, d, pat);
|
||||||
StrokeLine(BPoint(r.right,vBottom),BPoint(r.right,vTop),d,pat);
|
StrokeLine(BPoint(r.right,vBottom),BPoint(r.right,vTop),d,pat);
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1097,14 +1097,14 @@ void BitmapDriver::StrokeRoundRect(BRect r, float xrad, float yrad, LayerData *d
|
|||||||
*/
|
*/
|
||||||
void BitmapDriver::StrokeTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
void BitmapDriver::StrokeTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(_target)
|
if(_target)
|
||||||
{
|
{
|
||||||
Line(pts[0],pts[1],d,pat);
|
Line(pts[0],pts[1],d,pat);
|
||||||
Line(pts[1],pts[2],d,pat);
|
Line(pts[1],pts[2],d,pat);
|
||||||
Line(pts[2],pts[0],d,pat);
|
Line(pts[2],pts[0],d,pat);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitmapDriver::SetPixelPattern(int x, int y, uint8 *pattern, uint8 patternindex)
|
void BitmapDriver::SetPixelPattern(int x, int y, uint8 *pattern, uint8 patternindex)
|
||||||
@ -1451,13 +1451,13 @@ void BitmapDriver::ExtractToBitmap(ServerBitmap *destbmp,BRect destrect, BRect s
|
|||||||
|
|
||||||
void BitmapDriver::InvertRect(BRect r)
|
void BitmapDriver::InvertRect(BRect r)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
if(_target)
|
if(_target)
|
||||||
{
|
{
|
||||||
if(r.top<0 || r.left<0 ||
|
if(r.top<0 || r.left<0 ||
|
||||||
r.right>_target->Width()-1 || r.bottom>_target->Height()-1)
|
r.right>_target->Width()-1 || r.bottom>_target->Height()-1)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1496,7 +1496,7 @@ void BitmapDriver::InvertRect(BRect r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1504,14 +1504,14 @@ float BitmapDriver::StringWidth(const char *string, int32 length, LayerData *d)
|
|||||||
{
|
{
|
||||||
if(!string || !d || !d->font)
|
if(!string || !d || !d->font)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
ServerFont *font=d->font;
|
ServerFont *font=d->font;
|
||||||
FontStyle *style=font->Style();
|
FontStyle *style=font->Style();
|
||||||
|
|
||||||
if(!style)
|
if(!style)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1526,7 +1526,7 @@ float BitmapDriver::StringWidth(const char *string, int32 length, LayerData *d)
|
|||||||
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1537,7 +1537,7 @@ float BitmapDriver::StringWidth(const char *string, int32 length, LayerData *d)
|
|||||||
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1569,7 +1569,7 @@ float BitmapDriver::StringWidth(const char *string, int32 length, LayerData *d)
|
|||||||
FT_Done_Face(face);
|
FT_Done_Face(face);
|
||||||
|
|
||||||
returnval=pen.x>>6;
|
returnval=pen.x>>6;
|
||||||
_Unlock();
|
Unlock();
|
||||||
return returnval;
|
return returnval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1577,14 +1577,14 @@ float BitmapDriver::StringHeight(const char *string, int32 length, LayerData *d)
|
|||||||
{
|
{
|
||||||
if(!string || !d || !d->font)
|
if(!string || !d || !d->font)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
ServerFont *font=d->font;
|
ServerFont *font=d->font;
|
||||||
FontStyle *style=font->Style();
|
FontStyle *style=font->Style();
|
||||||
|
|
||||||
if(!style)
|
if(!style)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1597,7 +1597,7 @@ float BitmapDriver::StringHeight(const char *string, int32 length, LayerData *d)
|
|||||||
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
error=FT_New_Face(ftlib, style->GetPath(), 0, &face);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1606,7 +1606,7 @@ float BitmapDriver::StringHeight(const char *string, int32 length, LayerData *d)
|
|||||||
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1624,12 +1624,12 @@ float BitmapDriver::StringHeight(const char *string, int32 length, LayerData *d)
|
|||||||
else
|
else
|
||||||
ascent=MAX(slot->bitmap.rows,ascent);
|
ascent=MAX(slot->bitmap.rows,ascent);
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
|
|
||||||
FT_Done_Face(face);
|
FT_Done_Face(face);
|
||||||
|
|
||||||
returnval=ascent+descent;
|
returnval=ascent+descent;
|
||||||
_Unlock();
|
Unlock();
|
||||||
return returnval;
|
return returnval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1649,7 +1649,7 @@ void BitmapDriver::DrawString(const char *string, int32 length, BPoint pt, Layer
|
|||||||
if(!string || !d || !d->font)
|
if(!string || !d || !d->font)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
pt.y--; // because of Be's backward compatibility hack
|
pt.y--; // because of Be's backward compatibility hack
|
||||||
|
|
||||||
@ -1658,7 +1658,7 @@ void BitmapDriver::DrawString(const char *string, int32 length, BPoint pt, Layer
|
|||||||
|
|
||||||
if(!style)
|
if(!style)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1691,7 +1691,7 @@ void BitmapDriver::DrawString(const char *string, int32 length, BPoint pt, Layer
|
|||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
printf("Couldn't create face object\n");
|
printf("Couldn't create face object\n");
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1702,7 +1702,7 @@ void BitmapDriver::DrawString(const char *string, int32 length, BPoint pt, Layer
|
|||||||
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
error=FT_Set_Char_Size(face, 0,int32(font->Size())*64,72,72);
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_Unlock();
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1787,7 +1787,7 @@ void BitmapDriver::DrawString(const char *string, int32 length, BPoint pt, Layer
|
|||||||
previous=glyph_index;
|
previous=glyph_index;
|
||||||
}
|
}
|
||||||
FT_Done_Face(face);
|
FT_Done_Face(face);
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitmapDriver::BlitMono2RGB32(FT_Bitmap *src, BPoint pt, LayerData *d)
|
void BitmapDriver::BlitMono2RGB32(FT_Bitmap *src, BPoint pt, LayerData *d)
|
||||||
@ -2088,6 +2088,6 @@ rgb_color BitmapDriver::GetBlitColor(rgb_color src, rgb_color dest, LayerData *d
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_Unlock();
|
Unlock();
|
||||||
return returncolor;
|
return returncolor;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "LayerData.h"
|
#include "LayerData.h"
|
||||||
#include "ColorUtils.h"
|
#include "ColorUtils.h"
|
||||||
#include "DefaultDecorator.h"
|
#include "DefaultDecorator.h"
|
||||||
|
#include "PatternHandler.h"
|
||||||
#include "RGBColor.h"
|
#include "RGBColor.h"
|
||||||
#include "RectUtils.h"
|
#include "RectUtils.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -180,18 +181,23 @@ printf("DefaultDecorator: Do Layout\n");
|
|||||||
_resizerect=_frame;
|
_resizerect=_frame;
|
||||||
_borderrect=_frame;
|
_borderrect=_frame;
|
||||||
_closerect=_frame;
|
_closerect=_frame;
|
||||||
|
|
||||||
|
|
||||||
switch(GetLook())
|
switch(GetLook())
|
||||||
{
|
{
|
||||||
|
case B_FLOATING_WINDOW_LOOK:
|
||||||
|
case B_MODAL_WINDOW_LOOK:
|
||||||
|
|
||||||
|
// We're going to make the frame 5 pixels wide, no matter what. R5's decorator frame
|
||||||
|
// requires the skills of a gaming master to click on the tiny frame if resizing is necessary,
|
||||||
|
// and there *are* apps which do this
|
||||||
|
// borderwidth=3;
|
||||||
|
// break;
|
||||||
case B_BORDERED_WINDOW_LOOK:
|
case B_BORDERED_WINDOW_LOOK:
|
||||||
case B_TITLED_WINDOW_LOOK:
|
case B_TITLED_WINDOW_LOOK:
|
||||||
case B_DOCUMENT_WINDOW_LOOK:
|
case B_DOCUMENT_WINDOW_LOOK:
|
||||||
borderwidth=5;
|
borderwidth=5;
|
||||||
break;
|
break;
|
||||||
case B_FLOATING_WINDOW_LOOK:
|
|
||||||
case B_MODAL_WINDOW_LOOK:
|
|
||||||
borderwidth=3;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
borderwidth=0;
|
borderwidth=0;
|
||||||
}
|
}
|
||||||
@ -336,6 +342,7 @@ printf("DefaultDecorator: Draw(%.1f,%.1f,%.1f,%.1f)\n",update.left,update.top,up
|
|||||||
_driver->FillRect(_borderrect & update,&_layerdata,(int8*)&solidhigh);
|
_driver->FillRect(_borderrect & update,&_layerdata,(int8*)&solidhigh);
|
||||||
|
|
||||||
_DrawFrame(update);
|
_DrawFrame(update);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultDecorator::Draw(void)
|
void DefaultDecorator::Draw(void)
|
||||||
@ -347,10 +354,10 @@ void DefaultDecorator::Draw(void)
|
|||||||
// _layerdata.highcolor=_colors->document_background;
|
// _layerdata.highcolor=_colors->document_background;
|
||||||
|
|
||||||
// _driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
// _driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
|
|
||||||
DrawFrame();
|
DrawFrame();
|
||||||
|
|
||||||
DrawTab();
|
DrawTab();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultDecorator::_DrawZoom(BRect r)
|
void DefaultDecorator::_DrawZoom(BRect r)
|
||||||
@ -455,6 +462,7 @@ void DefaultDecorator::DrawBlendedRect(BRect r, bool down)
|
|||||||
|
|
||||||
void DefaultDecorator::_DrawFrame(BRect invalid)
|
void DefaultDecorator::_DrawFrame(BRect invalid)
|
||||||
{
|
{
|
||||||
|
|
||||||
// We need to test each side to determine whether or not it needs drawn. Additionally,
|
// We need to test each side to determine whether or not it needs drawn. Additionally,
|
||||||
// we must clip the lines drawn by this function to the invalid rectangle we are given
|
// we must clip the lines drawn by this function to the invalid rectangle we are given
|
||||||
|
|
||||||
@ -494,6 +502,17 @@ void DefaultDecorator::_DrawFrame(BRect invalid)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: figure out border colors for floating window look
|
// TODO: figure out border colors for floating window look
|
||||||
|
leftindices[0]=2;
|
||||||
|
leftindices[1]=2;
|
||||||
|
leftindices[2]=1;
|
||||||
|
leftindices[3]=1;
|
||||||
|
leftindices[4]=4;
|
||||||
|
|
||||||
|
rightindices[0]=2;
|
||||||
|
rightindices[1]=2;
|
||||||
|
rightindices[2]=1;
|
||||||
|
rightindices[3]=1;
|
||||||
|
rightindices[4]=4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables used in each calculation
|
// Variables used in each calculation
|
||||||
@ -722,16 +741,42 @@ void DefaultDecorator::_DrawFrame(BRect invalid)
|
|||||||
delete rightindices;
|
delete rightindices;
|
||||||
delete leftindices;
|
delete leftindices;
|
||||||
|
|
||||||
/* // Draw the resize thumb if we're supposed to
|
// Draw the resize thumb if we're supposed to
|
||||||
if(!(_flags & B_NOT_RESIZABLE))
|
if(!(_flags & B_NOT_RESIZABLE))
|
||||||
{
|
{
|
||||||
|
pattern_union highcolor;
|
||||||
|
highcolor.type64=0xffffffffffffffffLL;
|
||||||
r=_resizerect;
|
r=_resizerect;
|
||||||
|
|
||||||
int32 w=r.IntegerWidth(), h=r.IntegerHeight();
|
// int32 w=r.IntegerWidth(), h=r.IntegerHeight();
|
||||||
|
|
||||||
// This code is strictly for B_DOCUMENT_WINDOW looks
|
// This code is strictly for B_DOCUMENT_WINDOW looks
|
||||||
if(_look==B_DOCUMENT_WINDOW_LOOK)
|
if(_look==B_DOCUMENT_WINDOW_LOOK)
|
||||||
{
|
{
|
||||||
|
r.right-=4;
|
||||||
|
r.bottom-=4;
|
||||||
|
_layerdata.highcolor=framecolors[2];
|
||||||
|
_driver->StrokeLine(r.LeftTop(),r.RightTop(),&_layerdata,highcolor.type8);
|
||||||
|
_driver->StrokeLine(r.LeftTop(),r.LeftBottom(),&_layerdata,highcolor.type8);
|
||||||
|
|
||||||
|
r.OffsetBy(1,1);
|
||||||
|
_layerdata.highcolor=framecolors[0];
|
||||||
|
_driver->StrokeLine(r.LeftTop(),r.RightTop(),&_layerdata,highcolor.type8);
|
||||||
|
_driver->StrokeLine(r.LeftTop(),r.LeftBottom(),&_layerdata,highcolor.type8);
|
||||||
|
|
||||||
|
r.OffsetBy(1,1);
|
||||||
|
_layerdata.highcolor=framecolors[1];
|
||||||
|
_driver->FillRect(r,&_layerdata,highcolor.type8);
|
||||||
|
|
||||||
|
/* r.left+=2;
|
||||||
|
r.top+=2;
|
||||||
|
r.right-=3;
|
||||||
|
r.bottom-=3;
|
||||||
|
*/
|
||||||
|
r.right-=2;
|
||||||
|
r.bottom-=2;
|
||||||
|
int32 w=r.IntegerWidth(), h=r.IntegerHeight();
|
||||||
|
|
||||||
rgb_color halfcol, startcol, endcol;
|
rgb_color halfcol, startcol, endcol;
|
||||||
float rstep,gstep,bstep,i;
|
float rstep,gstep,bstep,i;
|
||||||
|
|
||||||
@ -745,7 +790,11 @@ void DefaultDecorator::_DrawFrame(BRect invalid)
|
|||||||
rstep=(startcol.red-halfcol.red)/steps;
|
rstep=(startcol.red-halfcol.red)/steps;
|
||||||
gstep=(startcol.green-halfcol.green)/steps;
|
gstep=(startcol.green-halfcol.green)/steps;
|
||||||
bstep=(startcol.blue-halfcol.blue)/steps;
|
bstep=(startcol.blue-halfcol.blue)/steps;
|
||||||
|
|
||||||
|
// Explicitly locking the driver is normally unnecessary. However, we need to do
|
||||||
|
// this because we are rapidly drawing a series of calls which would not necessarily
|
||||||
|
// draw correctly if we didn't do so.
|
||||||
|
_driver->Lock();
|
||||||
for(i=0;i<=steps; i++)
|
for(i=0;i<=steps; i++)
|
||||||
{
|
{
|
||||||
_layerdata.highcolor.SetColor(uint8(startcol.red-(i*rstep)),
|
_layerdata.highcolor.SetColor(uint8(startcol.red-(i*rstep)),
|
||||||
@ -761,8 +810,9 @@ void DefaultDecorator::_DrawFrame(BRect invalid)
|
|||||||
_driver->StrokeLine(BPoint(r.left+steps,r.top+i),
|
_driver->StrokeLine(BPoint(r.left+steps,r.top+i),
|
||||||
BPoint(r.left+i,r.top+steps),&_layerdata,(int8*)&solidhigh);
|
BPoint(r.left+i,r.top+steps),&_layerdata,(int8*)&solidhigh);
|
||||||
}
|
}
|
||||||
_layerdata.highcolor=framecolors[4];
|
_driver->Unlock();
|
||||||
_driver->StrokeRect(r,&_layerdata,(int8*)&solidhigh);
|
// _layerdata.highcolor=framecolors[4];
|
||||||
|
// _driver->StrokeRect(r,&_layerdata,(int8*)&solidhigh);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -773,6 +823,6 @@ void DefaultDecorator::_DrawFrame(BRect invalid)
|
|||||||
&_layerdata,(int8*)&solidhigh);
|
&_layerdata,(int8*)&solidhigh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -216,12 +216,12 @@ void DisplayDriver::FillRegion(BRegion *r, LayerData *d, int8 *pat)
|
|||||||
if(!r || !d || !pat)
|
if(!r || !d || !pat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_locker->Lock();
|
Lock();
|
||||||
|
|
||||||
for(int32 i=0; i<r->CountRects();i++)
|
for(int32 i=0; i<r->CountRects();i++)
|
||||||
FillRect(r->RectAt(i),d,pat);
|
FillRect(r->RectAt(i),d,pat);
|
||||||
|
|
||||||
_locker->Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -278,11 +278,11 @@ void DisplayDriver::HideCursor(void)
|
|||||||
*/
|
*/
|
||||||
bool DisplayDriver::IsCursorHidden(void)
|
bool DisplayDriver::IsCursorHidden(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
bool value=(_is_cursor_hidden || _is_cursor_obscured);
|
bool value=(_is_cursor_hidden || _is_cursor_obscured);
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@ -344,7 +344,7 @@ void DisplayDriver::ObscureCursor(void)
|
|||||||
*/
|
*/
|
||||||
void DisplayDriver::SetCursor(ServerCursor *cursor)
|
void DisplayDriver::SetCursor(ServerCursor *cursor)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
bool hidden=_is_cursor_hidden;
|
bool hidden=_is_cursor_hidden;
|
||||||
bool obscured=_is_cursor_obscured;
|
bool obscured=_is_cursor_obscured;
|
||||||
@ -355,7 +355,7 @@ void DisplayDriver::SetCursor(ServerCursor *cursor)
|
|||||||
if(!hidden && !obscured)
|
if(!hidden && !obscured)
|
||||||
ShowCursor();
|
ShowCursor();
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -451,12 +451,12 @@ void DisplayDriver::StrokeRegion(BRegion *r, LayerData *d, int8 *pat)
|
|||||||
if(!r || !d || !pat)
|
if(!r || !d || !pat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_locker->Lock();
|
Lock();
|
||||||
|
|
||||||
for(int32 i=0; i<r->CountRects();i++)
|
for(int32 i=0; i<r->CountRects();i++)
|
||||||
StrokeRect(r->RectAt(i),d,pat);
|
StrokeRect(r->RectAt(i),d,pat);
|
||||||
|
|
||||||
_locker->Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -738,7 +738,7 @@ bool DisplayDriver::IsCursorObscured(bool state)
|
|||||||
member function should lock the driver before doing anything else. Functions
|
member function should lock the driver before doing anything else. Functions
|
||||||
internal to the driver (protected/private) need not do this.
|
internal to the driver (protected/private) need not do this.
|
||||||
*/
|
*/
|
||||||
bool DisplayDriver::_Lock(bigtime_t timeout)
|
bool DisplayDriver::Lock(bigtime_t timeout)
|
||||||
{
|
{
|
||||||
if(timeout==B_INFINITE_TIMEOUT)
|
if(timeout==B_INFINITE_TIMEOUT)
|
||||||
return _locker->Lock();
|
return _locker->Lock();
|
||||||
@ -749,7 +749,7 @@ bool DisplayDriver::_Lock(bigtime_t timeout)
|
|||||||
/*!
|
/*!
|
||||||
\brief Unlocks the driver
|
\brief Unlocks the driver
|
||||||
*/
|
*/
|
||||||
void DisplayDriver::_Unlock(void)
|
void DisplayDriver::Unlock(void)
|
||||||
{
|
{
|
||||||
_locker->Unlock();
|
_locker->Unlock();
|
||||||
}
|
}
|
||||||
|
@ -35,14 +35,6 @@
|
|||||||
#include "TokenHandler.h"
|
#include "TokenHandler.h"
|
||||||
#include "RectUtils.h"
|
#include "RectUtils.h"
|
||||||
|
|
||||||
//#define DEBUG_LAYER
|
|
||||||
//#define DEBUG_REGIONS
|
|
||||||
|
|
||||||
#ifdef DEBUG_REGIONS
|
|
||||||
#include "Desktop.h"
|
|
||||||
#include "DisplayDriver.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! TokenHandler object used to provide IDs for all Layers and, thus, BViews
|
//! TokenHandler object used to provide IDs for all Layers and, thus, BViews
|
||||||
TokenHandler view_token_handler;
|
TokenHandler view_token_handler;
|
||||||
|
|
||||||
@ -89,19 +81,11 @@ Layer::Layer(BRect frame, const char *name, int32 resize, int32 flags,ServerWind
|
|||||||
|
|
||||||
_level=0;
|
_level=0;
|
||||||
_layerdata=new LayerData;
|
_layerdata=new LayerData;
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s\n",name);
|
|
||||||
printf("\tFrame: (%.1f,%.1f,%.1f,%.1f)\n",frame.left,frame.top,frame.right,frame.bottom);
|
|
||||||
printf("\tWindow: %s\n",win?win->Title():"NULL");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Destructor frees all allocated heap space
|
//! Destructor frees all allocated heap space
|
||||||
Layer::~Layer(void)
|
Layer::~Layer(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: ~Layer()\n",_name->String());
|
|
||||||
#endif
|
|
||||||
if(_visible)
|
if(_visible)
|
||||||
{
|
{
|
||||||
delete _visible;
|
delete _visible;
|
||||||
@ -137,11 +121,8 @@ printf("Layer: %s: ~Layer()\n",_name->String());
|
|||||||
*/
|
*/
|
||||||
void Layer::AddChild(Layer *layer, Layer *before, bool rebuild)
|
void Layer::AddChild(Layer *layer, Layer *before, bool rebuild)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Add Child (%s, %s, %s) - Incomplete\n",_name->String(),layer?layer->_name->String():"NULL",
|
|
||||||
before?before->_name->String():"NULL",rebuild?"rebuild":"no rebuild");
|
|
||||||
#endif
|
|
||||||
// TODO: Add before support
|
// TODO: Add before support
|
||||||
|
printf("Layer::AddChild lacks before support\n");
|
||||||
|
|
||||||
if(layer->_parent!=NULL)
|
if(layer->_parent!=NULL)
|
||||||
{
|
{
|
||||||
@ -159,39 +140,21 @@ printf("Layer: %s: Add Child (%s, %s, %s) - Incomplete\n",_name->String(),layer?
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we need to change this to a loop for each _lowersibling of the layer
|
// we need to change this to a loop for each _lowersibling of the layer
|
||||||
if(_topchild!=NULL)
|
if(_bottomchild)
|
||||||
{
|
{
|
||||||
// we're adding to the back side of the stack??
|
// we're adding to the front side of the stack
|
||||||
layer->_lowersibling=_topchild;
|
layer->_uppersibling=_bottomchild;
|
||||||
|
|
||||||
// added layer will be at the bottom of the stack
|
// added layer will be at the bottom of the stack
|
||||||
_topchild->_uppersibling=layer;
|
_bottomchild->_lowersibling=layer;
|
||||||
for(Layer *lay=layer->_lowersibling; lay!=NULL; lay=lay->_lowersibling)
|
|
||||||
{
|
|
||||||
if(layer->_frame.Intersects(lay->_frame))
|
|
||||||
{
|
|
||||||
if(lay->_visible && lay->_hidecount==0)
|
|
||||||
{
|
|
||||||
// reg is what is _visible in the layer's _parent's coordinate system
|
|
||||||
BRegion *reg=new BRegion(ConvertToParent(layer->_visible));
|
|
||||||
// reg2 is the layer's _visible region in the sibling's coordinate system
|
|
||||||
BRegion *reg2=new BRegion(lay->ConvertFromParent(reg));
|
|
||||||
delete reg;
|
|
||||||
|
|
||||||
// layer->_lowersibling->_visible->Exclude(reg2);
|
|
||||||
// lowersiblings occupy screen space _above_ a layer, so the layer itself
|
|
||||||
// must remove from its _visible region
|
|
||||||
layer->_visible->Exclude(reg2);
|
|
||||||
delete reg2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_bottomchild=layer;
|
_topchild=layer;
|
||||||
_topchild=layer;
|
|
||||||
|
_bottomchild=layer;
|
||||||
layer->_level=_level+1;
|
layer->_level=_level+1;
|
||||||
|
|
||||||
if(rebuild)
|
if(rebuild)
|
||||||
RebuildRegions(true);
|
RebuildRegions(true);
|
||||||
}
|
}
|
||||||
@ -203,10 +166,6 @@ printf("Layer: %s: Add Child (%s, %s, %s) - Incomplete\n",_name->String(),layer?
|
|||||||
*/
|
*/
|
||||||
void Layer::RemoveChild(Layer *layer, bool rebuild)
|
void Layer::RemoveChild(Layer *layer, bool rebuild)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Remove Child (%s,%s)\n",_name->String(),layer?layer->_name->String():"NULL",
|
|
||||||
rebuild?"rebuild":"no rebuild");
|
|
||||||
#endif
|
|
||||||
if(layer->_parent==NULL)
|
if(layer->_parent==NULL)
|
||||||
{
|
{
|
||||||
printf("ERROR: RemoveChild(): Layer doesn't have a _parent\n");
|
printf("ERROR: RemoveChild(): Layer doesn't have a _parent\n");
|
||||||
@ -249,9 +208,6 @@ printf("Layer: %s: Remove Child (%s,%s)\n",_name->String(),layer?layer->_name->S
|
|||||||
*/
|
*/
|
||||||
void Layer::RemoveSelf(bool rebuild)
|
void Layer::RemoveSelf(bool rebuild)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: RemoveSelf(%s)\n",_name->String(),rebuild?"rebuild":"no rebuild");
|
|
||||||
#endif
|
|
||||||
// A Layer removes itself from the tree (duh)
|
// A Layer removes itself from the tree (duh)
|
||||||
if(_parent==NULL)
|
if(_parent==NULL)
|
||||||
{
|
{
|
||||||
@ -279,9 +235,6 @@ printf("Layer: %s: RemoveSelf(%s)\n",_name->String(),rebuild?"rebuild":"no rebui
|
|||||||
*/
|
*/
|
||||||
Layer *Layer::GetChildAt(BPoint pt, bool recursive)
|
Layer *Layer::GetChildAt(BPoint pt, bool recursive)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Get Child At (%.1f,%.1f)\n",_name->String(),pt.x,pt.y);
|
|
||||||
#endif
|
|
||||||
Layer *child;
|
Layer *child;
|
||||||
if(recursive)
|
if(recursive)
|
||||||
{
|
{
|
||||||
@ -335,9 +288,6 @@ BRect Layer::Frame(void)
|
|||||||
*/
|
*/
|
||||||
void Layer::PruneTree(void)
|
void Layer::PruneTree(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Prune Tree\n",_name->String());
|
|
||||||
#endif
|
|
||||||
Layer *lay,*nextlay;
|
Layer *lay,*nextlay;
|
||||||
|
|
||||||
lay=_topchild;
|
lay=_topchild;
|
||||||
@ -363,9 +313,6 @@ printf("Layer: %s: Prune Tree\n",_name->String());
|
|||||||
*/
|
*/
|
||||||
Layer *Layer::FindLayer(int32 token)
|
Layer *Layer::FindLayer(int32 token)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Find Layer (%ld)\n",_name->String(),token);
|
|
||||||
#endif
|
|
||||||
// recursive search for a layer based on its view token
|
// recursive search for a layer based on its view token
|
||||||
Layer *lay, *trylay;
|
Layer *lay, *trylay;
|
||||||
|
|
||||||
@ -397,10 +344,6 @@ printf("Layer: %s: Find Layer (%ld)\n",_name->String(),token);
|
|||||||
*/
|
*/
|
||||||
void Layer::Invalidate(BRegion region)
|
void Layer::Invalidate(BRegion region)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Invalidate(BRegion)\n",_name->String());
|
|
||||||
region.PrintToStream();
|
|
||||||
#endif
|
|
||||||
int32 i;
|
int32 i;
|
||||||
BRect r;
|
BRect r;
|
||||||
|
|
||||||
@ -447,10 +390,6 @@ region.PrintToStream();
|
|||||||
*/
|
*/
|
||||||
void Layer::Invalidate(BRect rect)
|
void Layer::Invalidate(BRect rect)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Invalidate(%.1f,%.1f,%.1f,%.1f)\n",_name->String(),rect.left,rect.top,rect.right,
|
|
||||||
rect.bottom);
|
|
||||||
#endif
|
|
||||||
// Make our own section dirty and pass it on to any children, if necessary....
|
// Make our own section dirty and pass it on to any children, if necessary....
|
||||||
// YES, WE ARE SHARING DIRT! Mudpies anyone? :D
|
// YES, WE ARE SHARING DIRT! Mudpies anyone? :D
|
||||||
if(TestRectIntersection(Frame(),rect))
|
if(TestRectIntersection(Frame(),rect))
|
||||||
@ -486,10 +425,9 @@ printf("Layer: %s: Invalidate(%.1f,%.1f,%.1f,%.1f)\n",_name->String(),rect.left,
|
|||||||
*/
|
*/
|
||||||
void Layer::RequestDraw(const BRect &r)
|
void Layer::RequestDraw(const BRect &r)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: RequestDraw(%.1f,%.1f,%.1f,%.1f) - unimplemented\n",
|
printf("Layer: %s: RequestDraw(%.1f,%.1f,%.1f,%.1f) - unimplemented\n",
|
||||||
_name->String(),r.left,r.top,r.right,r.bottom);
|
_name->String(),r.left,r.top,r.right,r.bottom);
|
||||||
#endif
|
|
||||||
// TODO: Implement and fix
|
// TODO: Implement and fix
|
||||||
/* if(_visible==NULL || _hidecount>0)
|
/* if(_visible==NULL || _hidecount>0)
|
||||||
return;
|
return;
|
||||||
@ -532,10 +470,6 @@ bool Layer::IsDirty(void) const
|
|||||||
*/
|
*/
|
||||||
void Layer::UpdateIfNeeded(bool force_update)
|
void Layer::UpdateIfNeeded(bool force_update)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: UpdateIfNeeded(%s)\n",_name->String(),
|
|
||||||
force_update?"force update":"don't force update");
|
|
||||||
#endif
|
|
||||||
Layer *child;
|
Layer *child;
|
||||||
|
|
||||||
if(IsHidden())
|
if(IsHidden())
|
||||||
@ -565,10 +499,6 @@ printf("Layer: %s: UpdateIfNeeded(%s)\n",_name->String(),
|
|||||||
*/
|
*/
|
||||||
void Layer::MarkModified(BRect rect)
|
void Layer::MarkModified(BRect rect)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: MarkModified(%.1f%.1f,%.1f,%.1f)\n",_name->String(),
|
|
||||||
rect.left,rect.top,rect.right,rect.bottom);
|
|
||||||
#endif
|
|
||||||
if(TestRectIntersection(Bounds(),rect))
|
if(TestRectIntersection(Bounds(),rect))
|
||||||
_regions_invalid=true;
|
_regions_invalid=true;
|
||||||
|
|
||||||
@ -583,10 +513,6 @@ printf("Layer: %s: MarkModified(%.1f%.1f,%.1f,%.1f)\n",_name->String(),
|
|||||||
*/
|
*/
|
||||||
void Layer::UpdateRegions(bool force)
|
void Layer::UpdateRegions(bool force)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: UpdateRegions(%s)\n",_name->String(),
|
|
||||||
force?"force update":"don't force update");
|
|
||||||
#endif
|
|
||||||
if(force)
|
if(force)
|
||||||
{
|
{
|
||||||
RebuildRegions(true);
|
RebuildRegions(true);
|
||||||
@ -601,9 +527,6 @@ printf("Layer: %s: UpdateRegions(%s)\n",_name->String(),
|
|||||||
//! Show the layer. Operates just like the BView call with the same name
|
//! Show the layer. Operates just like the BView call with the same name
|
||||||
void Layer::Show(void)
|
void Layer::Show(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Show\n",_name->String());
|
|
||||||
#endif
|
|
||||||
if(_hidecount==0)
|
if(_hidecount==0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -628,14 +551,16 @@ printf("Layer: %s: Show\n",_name->String());
|
|||||||
Layer *child;
|
Layer *child;
|
||||||
for(child=_topchild; child!=NULL; child=child->_lowersibling)
|
for(child=_topchild; child!=NULL; child=child->_lowersibling)
|
||||||
child->Show();
|
child->Show();
|
||||||
|
|
||||||
|
if(_parent)
|
||||||
|
_parent->RebuildRegions(true);
|
||||||
|
|
||||||
|
_parent->UpdateIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Hide the layer. Operates just like the BView call with the same name
|
//! Hide the layer. Operates just like the BView call with the same name
|
||||||
void Layer::Hide(void)
|
void Layer::Hide(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Hide\n",_name->String());
|
|
||||||
#endif
|
|
||||||
if(_hidecount==0)
|
if(_hidecount==0)
|
||||||
{
|
{
|
||||||
BRegion *reg=new BRegion(ConvertToParent(_visible));
|
BRegion *reg=new BRegion(ConvertToParent(_visible));
|
||||||
@ -683,9 +608,6 @@ uint32 Layer::CountChildren(void)
|
|||||||
*/
|
*/
|
||||||
void Layer::MoveBy(float x, float y)
|
void Layer::MoveBy(float x, float y)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Move By (%.1f,%.1f)\n",_name->String(),x,y);
|
|
||||||
#endif
|
|
||||||
BRect oldframe(_frame);
|
BRect oldframe(_frame);
|
||||||
_frame.OffsetBy(x,y);
|
_frame.OffsetBy(x,y);
|
||||||
|
|
||||||
@ -730,9 +652,6 @@ printf("Layer: %s: Move By (%.1f,%.1f)\n",_name->String(),x,y);
|
|||||||
*/
|
*/
|
||||||
void Layer::ResizeBy(float x, float y)
|
void Layer::ResizeBy(float x, float y)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
|
||||||
printf("Layer: %s: Rezize By (%.1f,%.1f) - Incomplete\n",_name->String(),x,y);
|
|
||||||
#endif
|
|
||||||
// TODO: Implement and test child resizing based on flags
|
// TODO: Implement and test child resizing based on flags
|
||||||
|
|
||||||
BRect oldframe=_frame;
|
BRect oldframe=_frame;
|
||||||
@ -751,66 +670,62 @@ printf("Layer: %s: Rezize By (%.1f,%.1f) - Incomplete\n",_name->String(),x,y);
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Rebuilds visibility regions
|
\brief Rebuilds visibility regions for child layers
|
||||||
\param include_children Flag to rebuild all children and subchildren
|
\param include_children Flag to rebuild all children and subchildren
|
||||||
*/
|
*/
|
||||||
void Layer::RebuildRegions(bool include_children)
|
void Layer::RebuildRegions(bool include_children)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LAYER
|
// Algorithm:
|
||||||
printf("Layer: %s: Rebuild Regions (%s)\n",_name->String(),include_children?"include children":
|
// 1) Reset child visibility regions to completely visible
|
||||||
"no child inclusion");
|
// 2) Clip each child to visible region of this layer
|
||||||
#endif
|
// 3) Clip each child to its siblings, going front to back
|
||||||
BRegion *reg,*reg2;
|
// 4) Remove the visible regions of the children from the current one
|
||||||
|
|
||||||
|
// Reset visible regions
|
||||||
if(_full)
|
if(_full)
|
||||||
_full->Include(Bounds());
|
_full->Include(Frame());
|
||||||
else
|
else
|
||||||
_full=new BRegion(Bounds());
|
_full=new BRegion(Frame());
|
||||||
|
|
||||||
if(_visible)
|
if(_visible)
|
||||||
_visible->Include(Bounds());
|
_visible->Include(Frame());
|
||||||
else
|
else
|
||||||
_visible=new BRegion(Bounds());
|
_visible=new BRegion(Frame());
|
||||||
|
|
||||||
// Remove child footprints from _visible region
|
// Reset children to fully visible and clip to this layer's visible region
|
||||||
for(Layer *childlay=_topchild; childlay!=NULL; childlay=childlay->_lowersibling)
|
for(Layer *childlay=_topchild; childlay!=NULL; childlay=childlay->_lowersibling)
|
||||||
{
|
{
|
||||||
|
childlay->_visible->MakeEmpty();
|
||||||
|
childlay->_visible->Include(childlay->_full);
|
||||||
|
|
||||||
if(childlay->_visible && childlay->_hidecount==0)
|
if(childlay->_visible && childlay->_hidecount==0)
|
||||||
{
|
childlay->_visible->IntersectWith(_visible);
|
||||||
#ifdef DEBUG_REGIONS
|
|
||||||
printf("old visible:");_visible->PrintToStream();
|
|
||||||
#endif
|
|
||||||
reg=new BRegion(childlay->ConvertToParent(childlay->_visible));
|
|
||||||
_visible->Exclude(reg);
|
|
||||||
#ifdef DEBUG_REGIONS
|
|
||||||
printf("child visible:");childlay->_visible->PrintToStream();
|
|
||||||
printf("converted child visible:");reg->PrintToStream();
|
|
||||||
printf("new visible:");_visible->PrintToStream();
|
|
||||||
#endif
|
|
||||||
delete reg;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove _lowersibling footprints, which are on top of the layer on screen
|
// This region is the common clipping region used when clipping children to their
|
||||||
for(Layer *siblay=_lowersibling; siblay!=NULL; siblay=siblay->_lowersibling)
|
// siblings. We will use this because of efficiency - it is gradually built by
|
||||||
|
// first clipping a child to the region if the region is not empty and then
|
||||||
|
// adding the child's resulting footprint to the clipping region. Once all the
|
||||||
|
// children have been clipped, then the resulting region will allow for one call
|
||||||
|
// to remove the footprints of all the children from the layer's visible region.
|
||||||
|
BRegion clipregion;
|
||||||
|
clipregion.MakeEmpty();
|
||||||
|
|
||||||
|
// Clip children to siblings which are closer to the front
|
||||||
|
for(Layer *siblay=_bottomchild; siblay!=NULL; siblay=siblay->_uppersibling)
|
||||||
{
|
{
|
||||||
if(_frame.Intersects(siblay->_frame))
|
if( clipregion.CountRects()>0 &&
|
||||||
|
TestRectIntersection(siblay->Frame(),clipregion.Frame()) &&
|
||||||
|
siblay->_visible &&
|
||||||
|
siblay->_hidecount==0 )
|
||||||
{
|
{
|
||||||
if(siblay->_visible && siblay->_hidecount==0)
|
siblay->_visible->Exclude(&clipregion);
|
||||||
{
|
|
||||||
// reg is what is _visible in the layer's _parent's coordinate system
|
|
||||||
reg=new BRegion(ConvertToParent(_visible));
|
|
||||||
// reg2 is the layer's _visible region in the sibling's coordinate system
|
|
||||||
reg2=new BRegion(siblay->ConvertFromParent(reg));
|
|
||||||
delete reg;
|
|
||||||
|
|
||||||
// lowersiblings occupy screen space _above_ a layer, so the layer itself
|
|
||||||
// must remove from its _visible region
|
|
||||||
_visible->Exclude(reg2);
|
|
||||||
delete reg2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
clipregion.Include(siblay->_visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Rebuild the regions for subchildren if we're supposed to
|
||||||
if(include_children)
|
if(include_children)
|
||||||
{
|
{
|
||||||
for(Layer *lay=_topchild; lay!=NULL; lay=lay->_lowersibling)
|
for(Layer *lay=_topchild; lay!=NULL; lay=lay->_lowersibling)
|
||||||
|
@ -98,7 +98,7 @@ public:
|
|||||||
BRect ConvertToTop(BRect rect);
|
BRect ConvertToTop(BRect rect);
|
||||||
BRegion ConvertFromTop(BRegion *reg);
|
BRegion ConvertFromTop(BRegion *reg);
|
||||||
BRect ConvertFromTop(BRect rect);
|
BRect ConvertFromTop(BRect rect);
|
||||||
|
|
||||||
void PrintToStream(void);
|
void PrintToStream(void);
|
||||||
void PrintNode(void);
|
void PrintNode(void);
|
||||||
void PruneTree(void);
|
void PruneTree(void);
|
||||||
|
@ -337,7 +337,7 @@ ScreenDriver::~ScreenDriver(void)
|
|||||||
|
|
||||||
bool ScreenDriver::Initialize(void)
|
bool ScreenDriver::Initialize(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
drawview=new BView(framebuffer->Bounds(),"drawview",B_FOLLOW_ALL, B_WILL_DRAW);
|
drawview=new BView(framebuffer->Bounds(),"drawview",B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
framebuffer->AddChild(drawview);
|
framebuffer->AddChild(drawview);
|
||||||
|
|
||||||
@ -349,16 +349,16 @@ bool ScreenDriver::Initialize(void)
|
|||||||
// We can afford to call the above functions without locking
|
// We can afford to call the above functions without locking
|
||||||
// because the window is locked until Show() is first called
|
// because the window is locked until Show() is first called
|
||||||
screenwin->Show();
|
screenwin->Show();
|
||||||
_Unlock();
|
Unlock();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenDriver::Shutdown(void)
|
void ScreenDriver::Shutdown(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
screenwin->Disconnect();
|
screenwin->Disconnect();
|
||||||
is_initialized=false;
|
is_initialized=false;
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenDriver::SetMode(int32 space)
|
void ScreenDriver::SetMode(int32 space)
|
||||||
@ -508,11 +508,11 @@ printf("ScreenDriver:: DrawString(\"%s\",%ld,BPoint(%f,%f))\n",string,length,pt.
|
|||||||
bool ScreenDriver::DumpToFile(const char *path)
|
bool ScreenDriver::DumpToFile(const char *path)
|
||||||
{
|
{
|
||||||
// Dump to PNG
|
// Dump to PNG
|
||||||
_Lock();
|
Lock();
|
||||||
SaveToPNG(path,framebuffer->Bounds(),framebuffer->ColorSpace(),
|
SaveToPNG(path,framebuffer->Bounds(),framebuffer->ColorSpace(),
|
||||||
framebuffer->Bits(),framebuffer->BitsLength(),framebuffer->BytesPerRow());
|
framebuffer->Bits(),framebuffer->BitsLength(),framebuffer->BytesPerRow());
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,12 +622,12 @@ void ScreenDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
|||||||
void ScreenDriver::HideCursor(void)
|
void ScreenDriver::HideCursor(void)
|
||||||
{
|
{
|
||||||
screenwin->Lock();
|
screenwin->Lock();
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
hide_cursor++;
|
hide_cursor++;
|
||||||
screenwin->PostMessage(SDWIN_HIDECURSOR);
|
screenwin->PostMessage(SDWIN_HIDECURSOR);
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
screenwin->Unlock();
|
screenwin->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -541,7 +541,7 @@ ViewDriver::~ViewDriver(void)
|
|||||||
|
|
||||||
bool ViewDriver::Initialize(void)
|
bool ViewDriver::Initialize(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
drawview=new BView(framebuffer->Bounds(),"drawview",B_FOLLOW_ALL, B_WILL_DRAW);
|
drawview=new BView(framebuffer->Bounds(),"drawview",B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
framebuffer->AddChild(drawview);
|
framebuffer->AddChild(drawview);
|
||||||
|
|
||||||
@ -553,15 +553,15 @@ bool ViewDriver::Initialize(void)
|
|||||||
// We can afford to call the above functions without locking
|
// We can afford to call the above functions without locking
|
||||||
// because the window is locked until Show() is first called
|
// because the window is locked until Show() is first called
|
||||||
screenwin->Show();
|
screenwin->Show();
|
||||||
_Unlock();
|
Unlock();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDriver::Shutdown(void)
|
void ViewDriver::Shutdown(void)
|
||||||
{
|
{
|
||||||
_Lock();
|
Lock();
|
||||||
is_initialized=false;
|
is_initialized=false;
|
||||||
_Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDriver::SetMode(int32 space)
|
void ViewDriver::SetMode(int32 space)
|
||||||
@ -655,7 +655,7 @@ void ViewDriver::CopyBits(BRect src, BRect dest)
|
|||||||
void ViewDriver::CopyRegion(BRegion *src, const BPoint &lefttop)
|
void ViewDriver::CopyRegion(BRegion *src, const BPoint &lefttop)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DRIVER_MODULE
|
#ifdef DEBUG_DRIVER_MODULE
|
||||||
printf("ViewDriver:: CopyRegion unimplemented()\n");
|
printf("ViewDriver:: CopyRegion not completely tested\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -781,11 +781,11 @@ printf("ViewDriver:: DrawString(\"%s\",%ld,BPoint(%f,%f))\n",string,length,pt.x,
|
|||||||
bool ViewDriver::DumpToFile(const char *path)
|
bool ViewDriver::DumpToFile(const char *path)
|
||||||
{
|
{
|
||||||
// Dump to PNG
|
// Dump to PNG
|
||||||
_Lock();
|
Lock();
|
||||||
SaveToPNG(path,framebuffer->Bounds(),framebuffer->ColorSpace(),
|
SaveToPNG(path,framebuffer->Bounds(),framebuffer->ColorSpace(),
|
||||||
framebuffer->Bits(),framebuffer->BitsLength(),framebuffer->BytesPerRow());
|
framebuffer->Bits(),framebuffer->BitsLength(),framebuffer->BytesPerRow());
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -895,12 +895,12 @@ void ViewDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
|
|||||||
void ViewDriver::HideCursor(void)
|
void ViewDriver::HideCursor(void)
|
||||||
{
|
{
|
||||||
screenwin->Lock();
|
screenwin->Lock();
|
||||||
_Lock();
|
Lock();
|
||||||
|
|
||||||
hide_cursor++;
|
hide_cursor++;
|
||||||
screenwin->PostMessage(VDWIN_HIDECURSOR);
|
screenwin->PostMessage(VDWIN_HIDECURSOR);
|
||||||
|
|
||||||
_Unlock();
|
Unlock();
|
||||||
screenwin->Unlock();
|
screenwin->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1330,8 +1330,10 @@ void ViewDriver::DrawString(const char *string, int32 length, BPoint pt, LayerDa
|
|||||||
int32 strlength,i;
|
int32 strlength,i;
|
||||||
Angle rotation(font->Rotation()), shear(font->Shear());
|
Angle rotation(font->Rotation()), shear(font->Shear());
|
||||||
|
|
||||||
bool antialias=( (font->Size()<18 && font->Flags()& B_DISABLE_ANTIALIASING==0)
|
// bool antialias=( (font->Size()<18 && font->Flags()& B_DISABLE_ANTIALIASING==0)
|
||||||
|| font->Flags()& B_FORCE_ANTIALIASING)?true:false;
|
// || font->Flags()& B_FORCE_ANTIALIASING)?true:false;
|
||||||
|
|
||||||
|
bool antialias=(font->Flags()& B_DISABLE_ANTIALIASING==1)?false:true;
|
||||||
|
|
||||||
// Originally, I thought to do this shear checking here, but it really should be
|
// Originally, I thought to do this shear checking here, but it really should be
|
||||||
// done in BFont::SetShear()
|
// done in BFont::SetShear()
|
||||||
|
Loading…
Reference in New Issue
Block a user