haiku/headers/private/interface/ToolTipManager.h
Ingo Weinhold 4ac097c559 Made the BToolTipManager lock non-static. Create the singleton via
pthread_once().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34366 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 11:06:51 +00:00

50 lines
922 B
C++

/*
* Copyright 2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _TOOL_TIP_MANAGER_H
#define _TOOL_TIP_MANAGER_H
#include <Locker.h>
#include <Messenger.h>
#include <Point.h>
class BToolTip;
class BToolTipManager {
public:
static BToolTipManager* Manager();
void ShowTip(BToolTip* tip, BPoint point);
void HideTip();
void SetShowDelay(bigtime_t time);
bigtime_t ShowDelay() const;
void SetHideDelay(bigtime_t time);
bigtime_t HideDelay() const;
bool Lock() { return fLock.Lock(); }
void Unlock() { fLock.Unlock(); }
private:
BToolTipManager();
virtual ~BToolTipManager();
static void _InitSingleton();
private:
BLocker fLock;
BMessenger fWindow;
bigtime_t fShowDelay;
bigtime_t fHideDelay;
static BToolTipManager* sDefaultInstance;
};
#endif // _TOOL_TIP_MANAGER_H