Author: axeld Date: 2011-05-21 20:12:25 +0200 (Sat, 21 May 2011) New Revision: 41638 Changeset: https://dev.haiku-os.org/changeset/41638 Added: haiku/trunk/headers/private/interface/DecoratorPrivate.h Modified: haiku/trunk/headers/private/interface/DecorInfo.h haiku/trunk/src/kits/interface/DecorInfo.cpp Log: * 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. Modified: haiku/trunk/headers/private/interface/DecorInfo.h =================================================================== --- haiku/trunk/headers/private/interface/DecorInfo.h 2011-05-21 18:10:44 UTC (rev 41637) +++ haiku/trunk/headers/private/interface/DecorInfo.h 2011-05-21 18:12:25 UTC (rev 41638) @@ -4,19 +4,22 @@ * Author: * Joseph "looncraz" Groover <looncraz@xxxxxxxxxxx> */ - - #ifndef DECOR_INFO_H #define DECOR_INFO_H #include <Entry.h> -#include <Bitmap.h> -#include <String.h> #include <Locker.h> #include <ObjectList.h> +#include <String.h> +class BWindow; + + +namespace BPrivate { + + // NOTE: DecorInfo itself is not thread-safe class DecorInfo { public: @@ -78,7 +81,7 @@ }; -class DecorInfoUtility{ +class DecorInfoUtility { public: DecorInfoUtility(bool scanNow = true); // NOTE: When scanNow is passed false, @@ -108,9 +111,9 @@ 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 @@ DecorInfo* _FindDecor(const BString& path); private: - BObjectList<DecorInfo> fList; - BLocker fLock; - bool fHasScanned; - + BObjectList<DecorInfo> fList; + BLocker fLock; + bool fHasScanned; }; -#endif +} // namespace BPrivate + + +using BPrivate::DecorInfo; +using BPrivate::DecorInfoUtility; + + +#endif // DECOR_INFO_H Added: haiku/trunk/headers/private/interface/DecoratorPrivate.h =================================================================== --- haiku/trunk/headers/private/interface/DecoratorPrivate.h (rev 0) +++ haiku/trunk/headers/private/interface/DecoratorPrivate.h 2011-05-21 18:12:25 UTC (rev 41638) @@ -0,0 +1,27 @@ +/* + * Copyright 2011, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx + * Distributed under the terms of the MIT License. + */ +#ifndef DECORATOR_PRIVATE_H +#define DECORATOR_PRIVATE_H + + +#include <SupportDefs.h> + + +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 Modified: haiku/trunk/src/kits/interface/DecorInfo.cpp =================================================================== --- haiku/trunk/src/kits/interface/DecorInfo.cpp 2011-05-21 18:10:44 UTC (rev 41637) +++ haiku/trunk/src/kits/interface/DecorInfo.cpp 2011-05-21 18:12:25 UTC (rev 41638) @@ -17,7 +17,12 @@ #include <Path.h> #include <Resources.h> +#include <DecoratorPrivate.h> + +namespace BPrivate { + + DecorInfo::DecorInfo() : fVersion(0), @@ -338,16 +343,6 @@ // #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 @@ return NULL; } + + +} // namespace BPrivate