Cortex: Remove missed includes of debug_tools.h.
This commit is contained in:
@@ -60,7 +60,6 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "debug_tools.h"
|
|
||||||
#define D_HOOK(x) //PRINT (x)
|
#define D_HOOK(x) //PRINT (x)
|
||||||
#define D_INTERNAL(x) //PRINT (x)
|
#define D_INTERNAL(x) //PRINT (x)
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,6 @@
|
|||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
#include "debug_tools.h"
|
|
||||||
|
|
||||||
__USE_CORTEX_NAMESPACE
|
__USE_CORTEX_NAMESPACE
|
||||||
|
|
||||||
// -------------------------------------------------------- //
|
// -------------------------------------------------------- //
|
||||||
@@ -105,7 +103,7 @@ TipManager* TipManager::Instance() {
|
|||||||
BAutolock _l(s_instanceLock);
|
BAutolock _l(s_instanceLock);
|
||||||
if(!s_instance)
|
if(!s_instance)
|
||||||
s_instance = new TipManager();
|
s_instance = new TipManager();
|
||||||
|
|
||||||
return s_instance;
|
return s_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +124,7 @@ void TipManager::QuitInstance() {
|
|||||||
// -------------------------------------------------------- //
|
// -------------------------------------------------------- //
|
||||||
|
|
||||||
TipManager::TipManager() :
|
TipManager::TipManager() :
|
||||||
|
|
||||||
BWindow(
|
BWindow(
|
||||||
BRect(-100,-100,-100,-100),
|
BRect(-100,-100,-100,-100),
|
||||||
"TipManager",
|
"TipManager",
|
||||||
@@ -134,13 +132,13 @@ TipManager::TipManager() :
|
|||||||
B_FLOATING_ALL_WINDOW_FEEL,
|
B_FLOATING_ALL_WINDOW_FEEL,
|
||||||
B_ASYNCHRONOUS_CONTROLS | B_AVOID_FOCUS),
|
B_ASYNCHRONOUS_CONTROLS | B_AVOID_FOCUS),
|
||||||
m_view(0) {
|
m_view(0) {
|
||||||
|
|
||||||
AddCommonFilter(
|
AddCommonFilter(
|
||||||
new BMessageFilter(
|
new BMessageFilter(
|
||||||
B_PROGRAMMED_DELIVERY,
|
B_PROGRAMMED_DELIVERY,
|
||||||
B_ANY_SOURCE,
|
B_ANY_SOURCE,
|
||||||
&ignore_quit_key));
|
&ignore_quit_key));
|
||||||
|
|
||||||
m_view = new _TipManagerView(
|
m_view = new _TipManagerView(
|
||||||
new TipWindow(),
|
new TipWindow(),
|
||||||
this,
|
this,
|
||||||
@@ -166,16 +164,16 @@ status_t TipManager::setTip(
|
|||||||
offset_mode_t offsetMode /*=LEFT_OFFSET_FROM_RECT*/,
|
offset_mode_t offsetMode /*=LEFT_OFFSET_FROM_RECT*/,
|
||||||
BPoint offset /*=s_useDefaultOffset*/,
|
BPoint offset /*=s_useDefaultOffset*/,
|
||||||
uint32 flags /*=NONE*/) {
|
uint32 flags /*=NONE*/) {
|
||||||
|
|
||||||
ASSERT(text);
|
ASSERT(text);
|
||||||
ASSERT(m_view);
|
ASSERT(m_view);
|
||||||
|
|
||||||
BAutolock _l(this);
|
BAutolock _l(this);
|
||||||
return m_view->setTip(
|
return m_view->setTip(
|
||||||
rect, text, view, offsetMode, offset, flags);
|
rect, text, view, offsetMode, offset, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t TipManager::setTip(
|
status_t TipManager::setTip(
|
||||||
const char* text,
|
const char* text,
|
||||||
BView* view,
|
BView* view,
|
||||||
@@ -196,13 +194,13 @@ status_t TipManager::removeTip(
|
|||||||
|
|
||||||
ASSERT(view);
|
ASSERT(view);
|
||||||
ASSERT(m_view);
|
ASSERT(m_view);
|
||||||
|
|
||||||
BAutolock _l(this);
|
BAutolock _l(this);
|
||||||
return m_view->removeTip(rect, view);
|
return m_view->removeTip(rect, view);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If more than one tip is mapped to pChild, all are removed:
|
// If more than one tip is mapped to pChild, all are removed:
|
||||||
|
|
||||||
status_t TipManager::removeAll(
|
status_t TipManager::removeAll(
|
||||||
BView* view) {
|
BView* view) {
|
||||||
|
|
||||||
@@ -214,11 +212,11 @@ status_t TipManager::removeAll(
|
|||||||
|
|
||||||
// PRINT((
|
// PRINT((
|
||||||
// "### TipManager::removeAll(): %p, %p\n", this, m_view->Looper()));
|
// "### TipManager::removeAll(): %p, %p\n", this, m_view->Looper()));
|
||||||
|
|
||||||
ASSERT(window);
|
ASSERT(window);
|
||||||
ASSERT(m_view);
|
ASSERT(m_view);
|
||||||
ASSERT(m_view->Looper() == this); // +++++
|
ASSERT(m_view->Looper() == this); // +++++
|
||||||
|
|
||||||
BAutolock _l(this);
|
BAutolock _l(this);
|
||||||
return m_view->removeAll(window);
|
return m_view->removeAll(window);
|
||||||
}
|
}
|
||||||
@@ -239,10 +237,10 @@ status_t TipManager::showTip(
|
|||||||
offset_mode_t offsetMode /*=LEFT_OFFSET_FROM_RECT*/,
|
offset_mode_t offsetMode /*=LEFT_OFFSET_FROM_RECT*/,
|
||||||
BPoint offset /*=s_useDefaultOffset*/,
|
BPoint offset /*=s_useDefaultOffset*/,
|
||||||
uint32 flags /*=NONE*/) {
|
uint32 flags /*=NONE*/) {
|
||||||
|
|
||||||
ASSERT(text);
|
ASSERT(text);
|
||||||
ASSERT(m_view);
|
ASSERT(m_view);
|
||||||
|
|
||||||
BAutolock _l(this);
|
BAutolock _l(this);
|
||||||
return m_view->armTip(
|
return m_view->armTip(
|
||||||
screenRect, text, offsetMode, offset, flags);
|
screenRect, text, offsetMode, offset, flags);
|
||||||
@@ -259,9 +257,9 @@ status_t TipManager::showTip(
|
|||||||
|
|
||||||
status_t TipManager::hideTip(
|
status_t TipManager::hideTip(
|
||||||
BRect screenRect) {
|
BRect screenRect) {
|
||||||
|
|
||||||
ASSERT(m_view);
|
ASSERT(m_view);
|
||||||
|
|
||||||
BAutolock _l(this);
|
BAutolock _l(this);
|
||||||
return m_view->hideTip(screenRect);
|
return m_view->hideTip(screenRect);
|
||||||
}
|
}
|
||||||
@@ -315,20 +313,20 @@ void TipManager::MessageReceived(
|
|||||||
//
|
//
|
||||||
// lastTime = 0;
|
// lastTime = 0;
|
||||||
// curTime = 0;
|
// curTime = 0;
|
||||||
//
|
//
|
||||||
// // [e.moon 27sep99]
|
// // [e.moon 27sep99]
|
||||||
// // store whether the tip has fired at the current point
|
// // store whether the tip has fired at the current point
|
||||||
// bool fired = false;
|
// bool fired = false;
|
||||||
//
|
//
|
||||||
// ASSERT(m_tree);
|
// ASSERT(m_tree);
|
||||||
// BView* pOwningView = m_tree->target();
|
// BView* pOwningView = m_tree->target();
|
||||||
//
|
//
|
||||||
// while(!stopping()) {
|
// while(!stopping()) {
|
||||||
// snooze(s_sleepPeriod);
|
// snooze(s_sleepPeriod);
|
||||||
// if(stopping())
|
// if(stopping())
|
||||||
// break;
|
// break;
|
||||||
//
|
//
|
||||||
// // wait for the view to show up
|
// // wait for the view to show up
|
||||||
// if(!pOwningView->Parent() || !pOwningView->Window())
|
// if(!pOwningView->Parent() || !pOwningView->Window())
|
||||||
// continue;
|
// continue;
|
||||||
//
|
//
|
||||||
@@ -352,8 +350,8 @@ void TipManager::MessageReceived(
|
|||||||
// // the mouse hasn't moved; bail out now
|
// // the mouse hasn't moved; bail out now
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// curTime = system_time();
|
// curTime = system_time();
|
||||||
// bool bIdle = !bMoved && lastTime && (curTime - lastTime) > m_idleTime;
|
// bool bIdle = !bMoved && lastTime && (curTime - lastTime) > m_idleTime;
|
||||||
// lastPoint = point;
|
// lastPoint = point;
|
||||||
//
|
//
|
||||||
@@ -370,11 +368,11 @@ void TipManager::MessageReceived(
|
|||||||
//
|
//
|
||||||
// // mouse has idled at a given point long enough;
|
// // mouse has idled at a given point long enough;
|
||||||
// // look for a tip at that position and display one if found:
|
// // look for a tip at that position and display one if found:
|
||||||
//
|
//
|
||||||
// fired = true;
|
// fired = true;
|
||||||
//
|
//
|
||||||
// pOwningView->LockLooper();
|
// pOwningView->LockLooper();
|
||||||
//
|
//
|
||||||
// // make sure this part of the view is actually visible
|
// // make sure this part of the view is actually visible
|
||||||
// if(!pOwningView->Window()->Frame().Contains(screenPoint)) {
|
// if(!pOwningView->Window()->Frame().Contains(screenPoint)) {
|
||||||
// pOwningView->UnlockLooper();
|
// pOwningView->UnlockLooper();
|
||||||
@@ -385,21 +383,21 @@ void TipManager::MessageReceived(
|
|||||||
// m_tipWindow->Lock();
|
// m_tipWindow->Lock();
|
||||||
// pair<BView*, const tip_entry*> found =
|
// pair<BView*, const tip_entry*> found =
|
||||||
// m_tree->match(point, screenPoint);
|
// m_tree->match(point, screenPoint);
|
||||||
//
|
//
|
||||||
// if(!found.second) {
|
// if(!found.second) {
|
||||||
// // none found; move on
|
// // none found; move on
|
||||||
// pOwningView->UnlockLooper();
|
// pOwningView->UnlockLooper();
|
||||||
// m_tipWindow->Unlock();
|
// m_tipWindow->Unlock();
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// BView* pTipTarget = found.first;
|
// BView* pTipTarget = found.first;
|
||||||
// const tip_entry& entry = *found.second;
|
// const tip_entry& entry = *found.second;
|
||||||
//
|
//
|
||||||
// // test the screen point against the view's clipping region;
|
// // test the screen point against the view's clipping region;
|
||||||
// // if no match, the given point is likely covered by another
|
// // if no match, the given point is likely covered by another
|
||||||
// // window (so stop recursing)
|
// // window (so stop recursing)
|
||||||
//
|
//
|
||||||
// BRegion clipRegion;
|
// BRegion clipRegion;
|
||||||
// pTipTarget->GetClippingRegion(&clipRegion);
|
// pTipTarget->GetClippingRegion(&clipRegion);
|
||||||
// if(!clipRegion.Contains(
|
// if(!clipRegion.Contains(
|
||||||
@@ -412,15 +410,15 @@ void TipManager::MessageReceived(
|
|||||||
//
|
//
|
||||||
// // found one; set up the tip window:
|
// // found one; set up the tip window:
|
||||||
// BRect entryFrame = pTipTarget->ConvertToScreen(entry.rect);
|
// BRect entryFrame = pTipTarget->ConvertToScreen(entry.rect);
|
||||||
//
|
//
|
||||||
// // set text (this has the side effect of resizing the
|
// // set text (this has the side effect of resizing the
|
||||||
// // window)
|
// // window)
|
||||||
//
|
//
|
||||||
// ASSERT(m_tipWindow);
|
// ASSERT(m_tipWindow);
|
||||||
// m_tipWindow->setText(entry.text.String());
|
// m_tipWindow->setText(entry.text.String());
|
||||||
//
|
//
|
||||||
// // figure out where to display it:
|
// // figure out where to display it:
|
||||||
//
|
//
|
||||||
// BPoint offset = (entry.offset == s_useDefaultOffset) ?
|
// BPoint offset = (entry.offset == s_useDefaultOffset) ?
|
||||||
// s_defaultOffset :
|
// s_defaultOffset :
|
||||||
// entry.offset;
|
// entry.offset;
|
||||||
@@ -448,15 +446,15 @@ void TipManager::MessageReceived(
|
|||||||
// default:
|
// default:
|
||||||
// ASSERT(!"bad offset mode");
|
// ASSERT(!"bad offset mode");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // do it:
|
// // do it:
|
||||||
//
|
//
|
||||||
// m_tipWindow->MoveTo(p);
|
// m_tipWindow->MoveTo(p);
|
||||||
// m_tipWindow->Show();
|
// m_tipWindow->Show();
|
||||||
//
|
//
|
||||||
// bTipVisible = true;
|
// bTipVisible = true;
|
||||||
// tipScreenRect = entryFrame;
|
// tipScreenRect = entryFrame;
|
||||||
//
|
//
|
||||||
// m_tipWindow->Unlock();
|
// m_tipWindow->Unlock();
|
||||||
// pOwningView->UnlockLooper();
|
// pOwningView->UnlockLooper();
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -34,8 +34,6 @@
|
|||||||
|
|
||||||
#include "MouseTrackingHelpers.h"
|
#include "MouseTrackingHelpers.h"
|
||||||
|
|
||||||
#include "debug_tools.h"
|
|
||||||
|
|
||||||
__USE_CORTEX_NAMESPACE
|
__USE_CORTEX_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
@@ -60,7 +58,7 @@ MouseTrackingSourceView::~MouseTrackingSourceView()
|
|||||||
// the mouse.
|
// the mouse.
|
||||||
status_t MouseTrackingSourceView::getTrackingOrigin(
|
status_t MouseTrackingSourceView::getTrackingOrigin(
|
||||||
BPoint* poPoint) const {
|
BPoint* poPoint) const {
|
||||||
if(!m_bTracking)
|
if(!m_bTracking)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
*poPoint = m_initPoint;
|
*poPoint = m_initPoint;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -72,7 +70,7 @@ status_t MouseTrackingSourceView::setTrackingDestination(
|
|||||||
IMouseTrackingDestination* pDest) {
|
IMouseTrackingDestination* pDest) {
|
||||||
if(m_bTracking)
|
if(m_bTracking)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
m_pDest = pDest;
|
m_pDest = pDest;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -89,9 +87,9 @@ void MouseTrackingSourceView::MouseDown(BPoint point) {
|
|||||||
// get mouse state & initial point
|
// get mouse state & initial point
|
||||||
uint32 buttons;
|
uint32 buttons;
|
||||||
GetMouse(&point, &buttons);
|
GetMouse(&point, &buttons);
|
||||||
m_prevPoint = ConvertToScreen(point);
|
m_prevPoint = ConvertToScreen(point);
|
||||||
m_initPoint = m_prevPoint;
|
m_initPoint = m_prevPoint;
|
||||||
|
|
||||||
// start tracking the mouse
|
// start tracking the mouse
|
||||||
SetMouseEventMask(B_POINTER_EVENTS,
|
SetMouseEventMask(B_POINTER_EVENTS,
|
||||||
B_LOCK_WINDOW_FOCUS|B_NO_POINTER_HISTORY);
|
B_LOCK_WINDOW_FOCUS|B_NO_POINTER_HISTORY);
|
||||||
@@ -99,8 +97,8 @@ void MouseTrackingSourceView::MouseDown(BPoint point) {
|
|||||||
|
|
||||||
// notify destination
|
// notify destination
|
||||||
if(m_pDest)
|
if(m_pDest)
|
||||||
m_pDest->mouseTrackingBegin(this, buttons, point);
|
m_pDest->mouseTrackingBegin(this, buttons, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseTrackingSourceView::MouseMoved(BPoint point, uint32 transit,
|
void MouseTrackingSourceView::MouseMoved(BPoint point, uint32 transit,
|
||||||
const BMessage* pMsg) {
|
const BMessage* pMsg) {
|
||||||
@@ -112,10 +110,10 @@ void MouseTrackingSourceView::MouseMoved(BPoint point, uint32 transit,
|
|||||||
uint32 buttons;
|
uint32 buttons;
|
||||||
GetMouse(&point, &buttons, false);
|
GetMouse(&point, &buttons, false);
|
||||||
ConvertToScreen(&point);
|
ConvertToScreen(&point);
|
||||||
|
|
||||||
if(point == m_prevPoint) // no motion?
|
if(point == m_prevPoint) // no motion?
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float xDelta = m_trackingFlags & TRACK_HORIZONTAL ?
|
float xDelta = m_trackingFlags & TRACK_HORIZONTAL ?
|
||||||
point.x - m_prevPoint.x : 0.0;
|
point.x - m_prevPoint.x : 0.0;
|
||||||
float yDelta = m_trackingFlags & TRACK_VERTICAL ?
|
float yDelta = m_trackingFlags & TRACK_VERTICAL ?
|
||||||
@@ -125,7 +123,7 @@ void MouseTrackingSourceView::MouseMoved(BPoint point, uint32 transit,
|
|||||||
if(m_pDest)
|
if(m_pDest)
|
||||||
m_pDest->mouseTrackingUpdate(buttons, xDelta, yDelta, point);
|
m_pDest->mouseTrackingUpdate(buttons, xDelta, yDelta, point);
|
||||||
|
|
||||||
// store point for future delta calculations
|
// store point for future delta calculations
|
||||||
m_prevPoint = point;
|
m_prevPoint = point;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,13 +131,13 @@ void MouseTrackingSourceView::MouseMoved(BPoint point, uint32 transit,
|
|||||||
void MouseTrackingSourceView::MouseUp(BPoint point) {
|
void MouseTrackingSourceView::MouseUp(BPoint point) {
|
||||||
if(m_bTracking) {
|
if(m_bTracking) {
|
||||||
// PRINT(( "MouseTrackingSourceView::MouseUp()\n"));
|
// PRINT(( "MouseTrackingSourceView::MouseUp()\n"));
|
||||||
|
|
||||||
// +++++ handle final update
|
// +++++ handle final update
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
m_bTracking = false;
|
m_bTracking = false;
|
||||||
if(m_pDest)
|
if(m_pDest)
|
||||||
m_pDest->mouseTrackingEnd();
|
m_pDest->mouseTrackingEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,9 +145,9 @@ void MouseTrackingSourceView::MouseUp(BPoint point) {
|
|||||||
void MouseTrackingSourceView::AttachedToWindow() {
|
void MouseTrackingSourceView::AttachedToWindow() {
|
||||||
if(m_pDest) // already have a destination
|
if(m_pDest) // already have a destination
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(BView* pParent = Parent(); pParent; pParent = pParent->Parent()) {
|
for(BView* pParent = Parent(); pParent; pParent = pParent->Parent()) {
|
||||||
IMouseTrackingDestination* pFound =
|
IMouseTrackingDestination* pFound =
|
||||||
dynamic_cast<IMouseTrackingDestination*>(pParent);
|
dynamic_cast<IMouseTrackingDestination*>(pParent);
|
||||||
if(pFound) // found a valid destination
|
if(pFound) // found a valid destination
|
||||||
m_pDest = pFound;
|
m_pDest = pFound;
|
||||||
@@ -161,7 +159,7 @@ void MouseTrackingSourceView::AttachedToWindow() {
|
|||||||
void MouseTrackingSourceView::FrameResized(float width, float height) {
|
void MouseTrackingSourceView::FrameResized(float width, float height) {
|
||||||
_inherited::FrameResized(width, height);
|
_inherited::FrameResized(width, height);
|
||||||
m_prevFrame = Frame();
|
m_prevFrame = Frame();
|
||||||
|
|
||||||
// +++++ adjust if currently tracking?
|
// +++++ adjust if currently tracking?
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user