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:
parent
e56432f3cd
commit
1d09f6d5d8
@ -108,6 +108,7 @@ DecView::DecView(BRect frame, const char *name, int32 resize, int32 flags)
|
||||
LoadSettings();
|
||||
|
||||
BString path(ConvertIndexToPath(0L));
|
||||
|
||||
if(LoadDecorator(path.String()))
|
||||
{
|
||||
driver->FillRect(preview_bounds,&ldata);
|
||||
@ -150,7 +151,7 @@ void DecView::MessageReceived(BMessage *msg)
|
||||
}
|
||||
case DECORATOR_CHOSEN:
|
||||
{
|
||||
|
||||
|
||||
STRACE(("MSG: Decorator Chosen - #%ld\n",declist->CurrentSelection()));
|
||||
bool success=false;
|
||||
|
||||
|
@ -58,6 +58,8 @@
|
||||
#include "PreviewDriver.h"
|
||||
#include "LayerData.h"
|
||||
#include "ColorSet.h"
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
BRect preview_bounds(0,0,150,150);;
|
||||
|
||||
@ -212,3 +214,32 @@ void PreviewDriver::StrokeSolidRect(const BRect &rect, RGBColor &color)
|
||||
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);
|
||||
|
||||
BView *View(void) { return (BView*)view; };
|
||||
virtual bool Lock(bigtime_t timeout=B_INFINITE_TIMEOUT);
|
||||
virtual void Unlock(void);
|
||||
|
||||
protected:
|
||||
virtual void FillSolidRect(const BRect &rect, RGBColor &color);
|
||||
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 StrokeSolidRect(const BRect &rect, RGBColor &color);
|
||||
|
||||
virtual bool AcquireBuffer(FBBitmap *bmp);
|
||||
virtual void ReleaseBuffer(void);
|
||||
|
||||
BBitmap *framebuffer;
|
||||
BView *drawview;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user