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
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
* Authors:
|
* Authors:
|
||||||
* DarkWyrm <[email protected]>
|
* DarkWyrm <[email protected]>
|
||||||
* Stephan Aßmus <[email protected]>
|
* Stephan Aßmus <[email protected]>
|
||||||
|
* Clemens Zeidler <[email protected]>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
|
|
||||||
#include "BeDecorator.h"
|
#include "BeDecorator.h"
|
||||||
|
|
||||||
|
#include <new>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "DesktopSettings.h"
|
#include "DesktopSettings.h"
|
||||||
@@ -83,6 +85,29 @@ make_blend_color(rgb_color colorA, rgb_color colorB, float position)
|
|||||||
// #pragma mark -
|
// #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
|
// TODO: get rid of DesktopSettings here, and introduce private accessor
|
||||||
// methods to the Decorator base class
|
// methods to the Decorator base class
|
||||||
|
|
||||||
@@ -1262,13 +1287,8 @@ BeDecorator::_LayoutTabItems(const BRect& tabRect)
|
|||||||
fTruncatedTitleLength = fTruncatedTitle.Length();
|
fTruncatedTitleLength = fTruncatedTitle.Length();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" float get_decorator_version(void)
|
|
||||||
{
|
|
||||||
return 1.00;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" Decorator *(instantiate_decorator)(DesktopSettings &desktopSetting, BRect rec,
|
extern "C" DecorAddOn* (instantiate_decor_addon)(image_id id, const char* name)
|
||||||
window_look loo, uint32 flag)
|
|
||||||
{
|
{
|
||||||
return (new BeDecorator(desktopSetting, rec, loo, flag));
|
return new (std::nothrow)BeDecorAddOn(id, name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,36 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2006, Haiku.
|
* Copyright 2001-2010, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* DarkWyrm <[email protected]>
|
* DarkWyrm <[email protected]>
|
||||||
* Stephan Aßmus <[email protected]>
|
* Stephan Aßmus <[email protected]>
|
||||||
|
* Clemens Zeidler <[email protected]>
|
||||||
*/
|
*/
|
||||||
#ifndef DEFAULT_DECORATOR_H
|
#ifndef DEFAULT_DECORATOR_H
|
||||||
#define DEFAULT_DECORATOR_H
|
#define DEFAULT_DECORATOR_H
|
||||||
|
|
||||||
|
|
||||||
#include "Decorator.h"
|
|
||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
|
|
||||||
|
#include "DecorManager.h"
|
||||||
#include "RGBColor.h"
|
#include "RGBColor.h"
|
||||||
|
|
||||||
|
|
||||||
class Desktop;
|
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 {
|
class BeDecorator: public Decorator {
|
||||||
public:
|
public:
|
||||||
BeDecorator(DesktopSettings& settings,
|
BeDecorator(DesktopSettings& settings,
|
||||||
|
|||||||
Reference in New Issue
Block a user