[haiku-commits] haiku: hrev53982 - in src/apps/cortex: support TipManager

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 15 Mar 2020 18:00:55 -0400 (EDT)

hrev53982 adds 1 changeset to branch 'master'
old head: 01a7f81291ffbefb19eea5d88da4729ed596f5bf
new head: d3571a6f55195ced06c2f48905d7c86b5408c13e
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=d3571a6f5519+%5E01a7f81291ff

----------------------------------------------------------------------------

d3571a6f5519: Cortex: Remove missed includes of debug_tools.h.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53982
Commit:      d3571a6f55195ced06c2f48905d7c86b5408c13e
URL:         https://git.haiku-os.org/haiku/commit/?id=d3571a6f5519
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Sun Mar 15 22:00:25 2020 UTC

----------------------------------------------------------------------------

3 files changed, 50 insertions(+), 55 deletions(-)
src/apps/cortex/RouteApp/RouteWindow.cpp         |  1 -
src/apps/cortex/TipManager/TipManager.cpp        | 72 ++++++++++----------
src/apps/cortex/support/MouseTrackingHelpers.cpp | 32 ++++-----

----------------------------------------------------------------------------

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


Other related posts:

  • » [haiku-commits] haiku: hrev53982 - in src/apps/cortex: support TipManager - waddlesplash