Adapt MacDecorator to the new addon interface.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37859 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2010-08-03 04:46:21 +00:00
parent 1649544d81
commit b9857cc356
2 changed files with 40 additions and 12 deletions

View File

@ -9,6 +9,7 @@
#include "MacDecorator.h"
#include <new>
#include <stdio.h>
#include <GradientLinear.h>
@ -29,6 +30,29 @@
#endif
MacDecorAddOn::MacDecorAddOn(image_id id, const char* name)
:
DecorAddOn(id, name)
{
}
float
MacDecorAddOn::Version()
{
return 1.00;
}
Decorator*
MacDecorAddOn::_AllocateDecorator(DesktopSettings& settings, BRect rect,
window_look look, uint32 flags)
{
return new (std::nothrow)MacDecorator(settings, rect, look, flags);
}
MacDecorator::MacDecorator(DesktopSettings& settings, BRect rect,
window_look look, uint32 flags)
:
@ -810,16 +834,8 @@ MacDecorator::_DrawBlendedRect(DrawingEngine* engine, BRect rect,
// #pragma mark -
extern "C" float
get_decorator_version(void)
extern "C" DecorAddOn*
instantiate_decor_addon(image_id id, const char* name)
{
return 1.00;
}
extern "C" Decorator*
instantiate_decorator(DesktopSettings& desktopSetting, BRect rect,
window_look look, uint32 flag)
{
return new MacDecorator(desktopSetting, rect, look, flag);
return new (std::nothrow)MacDecorAddOn(id, name);
}

View File

@ -8,10 +8,22 @@
#define _MAC_DECORATOR_H_
#include "Decorator.h"
#include "DecorManager.h"
#include "RGBColor.h"
class MacDecorAddOn : public DecorAddOn
{
public:
MacDecorAddOn(image_id id, const char* name);
float Version();
protected:
virtual Decorator* _AllocateDecorator(DesktopSettings& settings,
BRect rect, window_look look, uint32 flags);
};
class MacDecorator: public Decorator {
public:
MacDecorator(DesktopSettings& settings,