From c329950ca70fbc8c9e130ab512db13f33e80c266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 21 May 2011 18:12:25 +0000 Subject: [PATCH] * Put the decor stuff in the BPrivate namespace, as it should have been from the beginning. * Added header for the get_decorator() functions and friends. * Minor coding style cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41638 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/interface/DecorInfo.h | 33 +++++++++++++------- headers/private/interface/DecoratorPrivate.h | 27 ++++++++++++++++ src/kits/interface/DecorInfo.cpp | 18 +++++------ 3 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 headers/private/interface/DecoratorPrivate.h diff --git a/headers/private/interface/DecorInfo.h b/headers/private/interface/DecorInfo.h index d66eb74735..0df1835f9a 100644 --- a/headers/private/interface/DecorInfo.h +++ b/headers/private/interface/DecorInfo.h @@ -4,17 +4,20 @@ * Author: * Joseph "looncraz" Groover */ - - #ifndef DECOR_INFO_H #define DECOR_INFO_H #include -#include -#include #include #include +#include + + +class BWindow; + + +namespace BPrivate { // NOTE: DecorInfo itself is not thread-safe @@ -78,7 +81,7 @@ private: }; -class DecorInfoUtility{ +class DecorInfoUtility { public: DecorInfoUtility(bool scanNow = true); // NOTE: When scanNow is passed false, @@ -108,9 +111,9 @@ public: DecorInfo* CurrentDecorator(); DecorInfo* DefaultDecorator(); - bool IsCurrentDecorator(DecorInfo*); + bool IsCurrentDecorator(DecorInfo* decor); - status_t SetDecorator(DecorInfo*); + status_t SetDecorator(DecorInfo* decor); status_t SetDecorator(int32); status_t Preview(DecorInfo* decor, BWindow* window); @@ -119,11 +122,17 @@ private: DecorInfo* _FindDecor(const BString& path); private: - BObjectList fList; - BLocker fLock; - bool fHasScanned; - + BObjectList fList; + BLocker fLock; + bool fHasScanned; }; -#endif +} // namespace BPrivate + + +using BPrivate::DecorInfo; +using BPrivate::DecorInfoUtility; + + +#endif // DECOR_INFO_H diff --git a/headers/private/interface/DecoratorPrivate.h b/headers/private/interface/DecoratorPrivate.h new file mode 100644 index 0000000000..61eda60b69 --- /dev/null +++ b/headers/private/interface/DecoratorPrivate.h @@ -0,0 +1,27 @@ +/* + * Copyright 2011, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ +#ifndef DECORATOR_PRIVATE_H +#define DECORATOR_PRIVATE_H + + +#include + + +class BString; +class BWindow; + + +namespace BPrivate { + + +bool get_decorator(BString& name); +status_t set_decorator(const BString& name); +status_t preview_decorator(const BString& name, BWindow* window); + + +} // namespace BPrivate + + +#endif // DECORATOR_PRIVATE_H diff --git a/src/kits/interface/DecorInfo.cpp b/src/kits/interface/DecorInfo.cpp index 2ef504f487..28eaa6753d 100644 --- a/src/kits/interface/DecorInfo.cpp +++ b/src/kits/interface/DecorInfo.cpp @@ -17,6 +17,11 @@ #include #include +#include + + +namespace BPrivate { + DecorInfo::DecorInfo() : @@ -338,16 +343,6 @@ DecorInfo::_Init(bool isUpdate) // #pragma mark - DecorInfoUtility -namespace BPrivate { - // kits/interface/InterfaceDefs.cpp - bool get_decorator(BString&); - status_t set_decorator(const BString&); - status_t preview_decorator(const BString&, BWindow*); -}; - -using namespace BPrivate; - - DecorInfoUtility::DecorInfoUtility(bool scanNow) : fHasScanned(false) @@ -589,3 +584,6 @@ DecorInfoUtility::_FindDecor(const BString& pathString) return NULL; } + + +} // namespace BPrivate