From 1649544d81946103a54c944195d8b9d5cad389cd Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Tue, 3 Aug 2010 04:38:38 +0000 Subject: [PATCH] Adapted the ClassicBe decorator to the new DecorAddOn interface. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37858 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../decorators/BeDecorator/BeDecorator.cpp | 34 +++++++++++++++---- .../decorators/BeDecorator/BeDecorator.h | 20 +++++++++-- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp index 63089f131f..ce7a53672a 100644 --- a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp +++ b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp @@ -5,6 +5,7 @@ * Authors: * DarkWyrm * Stephan Aßmus + * Clemens Zeidler */ @@ -13,6 +14,7 @@ #include "BeDecorator.h" +#include #include #include "DesktopSettings.h" @@ -83,6 +85,29 @@ make_blend_color(rgb_color colorA, rgb_color colorB, float position) // #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 @@ BeDecorator::_LayoutTabItems(const BRect& tabRect) 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); } diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.h b/src/add-ons/decorators/BeDecorator/BeDecorator.h index 82718c087d..0936287c3b 100644 --- a/src/add-ons/decorators/BeDecorator/BeDecorator.h +++ b/src/add-ons/decorators/BeDecorator/BeDecorator.h @@ -1,22 +1,36 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2010, Haiku. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm * Stephan Aßmus + * Clemens Zeidler */ #ifndef DEFAULT_DECORATOR_H #define DEFAULT_DECORATOR_H - -#include "Decorator.h" #include + +#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,