* 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
This commit is contained in:
@@ -4,17 +4,20 @@
|
|||||||
* Author:
|
* Author:
|
||||||
* Joseph "looncraz" Groover <[email protected]>
|
* Joseph "looncraz" Groover <[email protected]>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef DECOR_INFO_H
|
#ifndef DECOR_INFO_H
|
||||||
#define DECOR_INFO_H
|
#define DECOR_INFO_H
|
||||||
|
|
||||||
|
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <Bitmap.h>
|
|
||||||
#include <String.h>
|
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
|
|
||||||
|
class BWindow;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BPrivate {
|
||||||
|
|
||||||
|
|
||||||
// NOTE: DecorInfo itself is not thread-safe
|
// NOTE: DecorInfo itself is not thread-safe
|
||||||
@@ -78,7 +81,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class DecorInfoUtility{
|
class DecorInfoUtility {
|
||||||
public:
|
public:
|
||||||
DecorInfoUtility(bool scanNow = true);
|
DecorInfoUtility(bool scanNow = true);
|
||||||
// NOTE: When scanNow is passed false,
|
// NOTE: When scanNow is passed false,
|
||||||
@@ -108,9 +111,9 @@ public:
|
|||||||
DecorInfo* CurrentDecorator();
|
DecorInfo* CurrentDecorator();
|
||||||
DecorInfo* DefaultDecorator();
|
DecorInfo* DefaultDecorator();
|
||||||
|
|
||||||
bool IsCurrentDecorator(DecorInfo*);
|
bool IsCurrentDecorator(DecorInfo* decor);
|
||||||
|
|
||||||
status_t SetDecorator(DecorInfo*);
|
status_t SetDecorator(DecorInfo* decor);
|
||||||
status_t SetDecorator(int32);
|
status_t SetDecorator(int32);
|
||||||
|
|
||||||
status_t Preview(DecorInfo* decor, BWindow* window);
|
status_t Preview(DecorInfo* decor, BWindow* window);
|
||||||
@@ -119,11 +122,17 @@ private:
|
|||||||
DecorInfo* _FindDecor(const BString& path);
|
DecorInfo* _FindDecor(const BString& path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BObjectList<DecorInfo> fList;
|
BObjectList<DecorInfo> fList;
|
||||||
BLocker fLock;
|
BLocker fLock;
|
||||||
bool fHasScanned;
|
bool fHasScanned;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
|
||||||
|
using BPrivate::DecorInfo;
|
||||||
|
using BPrivate::DecorInfoUtility;
|
||||||
|
|
||||||
|
|
||||||
|
#endif // DECOR_INFO_H
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011, Axel Dörfler, [email protected].
|
||||||
|
* 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
|
||||||
@@ -17,6 +17,11 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Resources.h>
|
#include <Resources.h>
|
||||||
|
|
||||||
|
#include <DecoratorPrivate.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace BPrivate {
|
||||||
|
|
||||||
|
|
||||||
DecorInfo::DecorInfo()
|
DecorInfo::DecorInfo()
|
||||||
:
|
:
|
||||||
@@ -338,16 +343,6 @@ DecorInfo::_Init(bool isUpdate)
|
|||||||
// #pragma mark - DecorInfoUtility
|
// #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)
|
DecorInfoUtility::DecorInfoUtility(bool scanNow)
|
||||||
:
|
:
|
||||||
fHasScanned(false)
|
fHasScanned(false)
|
||||||
@@ -589,3 +584,6 @@ DecorInfoUtility::_FindDecor(const BString& pathString)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace BPrivate
|
||||||
|
|||||||
Reference in New Issue
Block a user