Implemented some more functions, added some fixes.
Works perfectly for most purposes. :)` git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6479 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -108,6 +108,7 @@ DecView::DecView(BRect frame, const char *name, int32 resize, int32 flags)
|
|||||||
LoadSettings();
|
LoadSettings();
|
||||||
|
|
||||||
BString path(ConvertIndexToPath(0L));
|
BString path(ConvertIndexToPath(0L));
|
||||||
|
|
||||||
if(LoadDecorator(path.String()))
|
if(LoadDecorator(path.String()))
|
||||||
{
|
{
|
||||||
driver->FillRect(preview_bounds,&ldata);
|
driver->FillRect(preview_bounds,&ldata);
|
||||||
@@ -150,7 +151,7 @@ void DecView::MessageReceived(BMessage *msg)
|
|||||||
}
|
}
|
||||||
case DECORATOR_CHOSEN:
|
case DECORATOR_CHOSEN:
|
||||||
{
|
{
|
||||||
|
|
||||||
STRACE(("MSG: Decorator Chosen - #%ld\n",declist->CurrentSelection()));
|
STRACE(("MSG: Decorator Chosen - #%ld\n",declist->CurrentSelection()));
|
||||||
bool success=false;
|
bool success=false;
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,8 @@
|
|||||||
#include "PreviewDriver.h"
|
#include "PreviewDriver.h"
|
||||||
#include "LayerData.h"
|
#include "LayerData.h"
|
||||||
#include "ColorSet.h"
|
#include "ColorSet.h"
|
||||||
|
#include <ft2build.h>
|
||||||
|
#include FT_FREETYPE_H
|
||||||
|
|
||||||
BRect preview_bounds(0,0,150,150);;
|
BRect preview_bounds(0,0,150,150);;
|
||||||
|
|
||||||
@@ -212,3 +214,32 @@ void PreviewDriver::StrokeSolidRect(const BRect &rect, RGBColor &color)
|
|||||||
view->viewbmp->Unlock();
|
view->viewbmp->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PreviewDriver::AcquireBuffer(FBBitmap *bmp)
|
||||||
|
{
|
||||||
|
if(!bmp)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
view->viewbmp->Lock();
|
||||||
|
bmp->SetBuffer(view->viewbmp->Bits());
|
||||||
|
bmp->SetSpace(view->viewbmp->ColorSpace());
|
||||||
|
bmp->SetBytesPerRow(view->viewbmp->BytesPerRow());
|
||||||
|
bmp->SetSize(view->viewbmp->Bounds().IntegerWidth(),
|
||||||
|
view->viewbmp->Bounds().IntegerHeight());
|
||||||
|
bmp->SetBitsPerPixel(view->viewbmp->ColorSpace(),view->viewbmp->BytesPerRow());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreviewDriver::ReleaseBuffer(void)
|
||||||
|
{
|
||||||
|
view->viewbmp->Unlock();
|
||||||
|
}
|
||||||
|
bool PreviewDriver::Lock(bigtime_t timeout=B_INFINITE_TIMEOUT)
|
||||||
|
{
|
||||||
|
return view->viewbmp->Lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreviewDriver::Unlock(void)
|
||||||
|
{
|
||||||
|
view->viewbmp->Unlock();
|
||||||
|
}
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public:
|
|||||||
void SetMode(const display_mode &mode);
|
void SetMode(const display_mode &mode);
|
||||||
|
|
||||||
BView *View(void) { return (BView*)view; };
|
BView *View(void) { return (BView*)view; };
|
||||||
|
virtual bool Lock(bigtime_t timeout=B_INFINITE_TIMEOUT);
|
||||||
|
virtual void Unlock(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void FillSolidRect(const BRect &rect, RGBColor &color);
|
virtual void FillSolidRect(const BRect &rect, RGBColor &color);
|
||||||
virtual void FillPatternRect(const BRect &rect, const DrawData *d);
|
virtual void FillPatternRect(const BRect &rect, const DrawData *d);
|
||||||
@@ -82,6 +85,9 @@ protected:
|
|||||||
virtual void StrokePatternLine(const BPoint &start, const BPoint &end, const DrawData *d);
|
virtual void StrokePatternLine(const BPoint &start, const BPoint &end, const DrawData *d);
|
||||||
virtual void StrokeSolidRect(const BRect &rect, RGBColor &color);
|
virtual void StrokeSolidRect(const BRect &rect, RGBColor &color);
|
||||||
|
|
||||||
|
virtual bool AcquireBuffer(FBBitmap *bmp);
|
||||||
|
virtual void ReleaseBuffer(void);
|
||||||
|
|
||||||
BBitmap *framebuffer;
|
BBitmap *framebuffer;
|
||||||
BView *drawview;
|
BView *drawview;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user