Author: czeidler Date: 2010-08-03 06:46:21 +0200 (Tue, 03 Aug 2010) New Revision: 37859 Changeset: http://dev.haiku-os.org/changeset/37859 Modified: haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.h Log: Adapt MacDecorator to the new addon interface. Modified: haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp =================================================================== --- haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp 2010-08-03 04:38:38 UTC (rev 37858) +++ haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp 2010-08-03 04:46:21 UTC (rev 37859) @@ -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 @@ // #pragma mark - -extern "C" float -get_decorator_version(void) +extern "C" DecorAddOn* +instantiate_decor_addon(image_id id, const char* name) { - return 1.00; + return new (std::nothrow)MacDecorAddOn(id, name); } - - -extern "C" Decorator* -instantiate_decorator(DesktopSettings& desktopSetting, BRect rect, - window_look look, uint32 flag) -{ - return new MacDecorator(desktopSetting, rect, look, flag); -} Modified: haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.h =================================================================== --- haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.h 2010-08-03 04:38:38 UTC (rev 37858) +++ haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.h 2010-08-03 04:46:21 UTC (rev 37859) @@ -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,