adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src/input manager.cc,1.1.2.1,1.1.2.2


From: Alexandre Courbot <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src/input manager.cc,1.1.2.1,1.1.2.2 manager.h,1.1.2.2,1.1.2.3
Date: Sat, 01 Feb 2003 12:17:39 -0500

Update of /cvsroot/adonthell/adonthell/src/input
In directory subversions:/tmp/cvs-serv31139/src/input

Modified Files:
      Tag: Branch_road_to_0-4
        manager.cc manager.h 
Log Message:
Slight updates


Index: manager.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/input/Attic/manager.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** manager.cc  30 Jun 2002 19:01:00 -0000      1.1.2.1
--- manager.cc  1 Feb 2003 17:17:37 -0000       1.1.2.2
***************
*** 26,29 ****
--- 26,30 ----
  
  #include "manager.h"
+ #include <algorithm>
  
  using namespace input;
***************
*** 34,37 ****
           it != listeners.end(); it++)
          if ((*it)->is_listening_to(ev.type()))
!             (*it)->raise_event(&ev);
  }
--- 35,53 ----
           it != listeners.end(); it++)
          if ((*it)->is_listening_to(ev.type()))
!         {
!             int res = (*it)->raise_event(&ev);
!             if (res) break;
!         }
! }
! 
! bool manager::give_focus(listener * l)
! {
!     std::list<listener *>::iterator it = std::find(listeners.begin(), 
listeners.end(), l);
!     if (it != listeners.end())
!     {
!         listeners.erase(it);
!         listeners.push_front(l);
!         return true;
!     }
!     return false;
  }

Index: manager.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/input/Attic/manager.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** manager.h   1 Jul 2002 19:46:49 -0000       1.1.2.2
--- manager.h   1 Feb 2003 17:17:37 -0000       1.1.2.3
***************
*** 99,102 ****
--- 99,113 ----
          }
  
+         /**
+          * Give the focus to the listener given in argument, if applicable.
+          *
+          * Giving the focus means this listener is queried first when an event
+          * is triggered.
+          *
+          * @param l the listener to give focus to.
+          * @return \e true if the listener was found, \e false otherwise.
+          */
+         bool give_focus(listener * l);
+ 
      private:
          static std::list <listener *> listeners;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]