Author: czeidler Date: 2010-08-03 06:38:38 +0200 (Tue, 03 Aug 2010) New Revision: 37858 Changeset: http://dev.haiku-os.org/changeset/37858 Modified: haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.h Log: Adapted the ClassicBe decorator to the new DecorAddOn interface. Modified: haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp =================================================================== --- haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp 2010-08-03 04:36:21 UTC (rev 37857) +++ haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp 2010-08-03 04:38:38 UTC (rev 37858) @@ -5,6 +5,7 @@ * Authors: * DarkWyrm <bpmagic@xxxxxxxxxxxxxxx> * Stephan Aßmus <superstippi@xxxxxx> + * Clemens Zeidler <haiku@xxxxxxxxxxxxxxxxxx> */ @@ -13,6 +14,7 @@ #include "BeDecorator.h" +#include <new> #include <stdio.h> #include "DesktopSettings.h" @@ -83,6 +85,29 @@ // #pragma mark - +BeDecorAddOn::BeDecorAddOn(image_id id, const char* name) + : + DecorAddOn(id, name) +{ + +} + + +float +BeDecorAddOn::Version() +{ + return 1.00; +} + + +Decorator* +BeDecorAddOn::_AllocateDecorator(DesktopSettings& settings, BRect rect, + window_look look, uint32 flags) +{ + return new (std::nothrow)BeDecorator(settings, rect, look, flags); +} + + // TODO: get rid of DesktopSettings here, and introduce private accessor // methods to the Decorator base class @@ -1262,13 +1287,8 @@ fTruncatedTitleLength = fTruncatedTitle.Length(); } -extern "C" float get_decorator_version(void) -{ - return 1.00; -} -extern "C" Decorator *(instantiate_decorator)(DesktopSettings &desktopSetting, BRect rec, - window_look loo, uint32 flag) +extern "C" DecorAddOn* (instantiate_decor_addon)(image_id id, const char* name) { - return (new BeDecorator(desktopSetting, rec, loo, flag)); + return new (std::nothrow)BeDecorAddOn(id, name); } Modified: haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.h =================================================================== --- haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.h 2010-08-03 04:36:21 UTC (rev 37857) +++ haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.h 2010-08-03 04:38:38 UTC (rev 37858) @@ -1,22 +1,36 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2010, Haiku. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm <bpmagic@xxxxxxxxxxxxxxx> * Stephan Aßmus <superstippi@xxxxxx> + * Clemens Zeidler <haiku@xxxxxxxxxxxxxxxxxx> */ #ifndef DEFAULT_DECORATOR_H #define DEFAULT_DECORATOR_H +#include <Region.h> -#include "Decorator.h" -#include <Region.h> +#include "DecorManager.h" #include "RGBColor.h" + class Desktop; +class BeDecorAddOn : public DecorAddOn +{ +public: + BeDecorAddOn(image_id id, const char* name); + + float Version(); +protected: + virtual Decorator* _AllocateDecorator(DesktopSettings& settings, + BRect rect, window_look look, uint32 flags); +}; + + class BeDecorator: public Decorator { public: BeDecorator(DesktopSettings& settings,