Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20269

Modified Files:
        rc.py 
Log Message:
move focus handling to rc for now

Index: rc.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/rc.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** rc.py       10 Jul 2004 12:33:36 -0000      1.36
--- rc.py       24 Jul 2004 12:22:37 -0000      1.37
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.37  2004/07/24 12:22:37  dischi
+ # move focus handling to rc for now
+ #
  # Revision 1.36  2004/07/10 12:33:36  dischi
  # header cleanup
***************
*** 148,151 ****
--- 151,195 ----
  
  # --------------------------------------------------------------------------------
+ # focus handling
+ # FIXME: move somewere else
+ # --------------------------------------------------------------------------------
+ 
+ app_list = []
+ 
+ def focused_app():
+     """
+     get current app
+     """
+     global app_list
+     if len(app_list):
+         return app_list[-1]
+     else:
+         return None
+ 
+ def add_app(app):
+     """
+     set focus to app
+     """
+     global app_list
+     app_list.append(app)
+ 
+ 
+ def remove_app(app):
+     """
+     remove app from list
+     """
+     global app_list
+     _times = app_list.count(app)
+     for _time in range(_times):
+         app_list.remove(app)
+     if _times and hasattr(focused_app(), 'event_context'):
+             _debug_('app is %s' % focused_app(),2)
+             _debug_('Setting context to %s' % focused_app().get_event_context(),2)
+             import rc
+             rc.set_context(focused_app().get_event_context())
+ 
+ 
+ 
+ # --------------------------------------------------------------------------------
  
  # --------------------------------------------------------------------------------
***************
*** 272,277 ****
          init the keyboard event handler
          """
!         import osd
!         self.callback = osd.get_singleton()._cb
  
  
--- 316,321 ----
          init the keyboard event handler
          """
!         import gui
!         self.callback = gui.get_keyboard().poll
  
  
***************
*** 330,335 ****
          try:
              self.inputs.append(Keyboard())
!         except:
!             pass
  
          if use_netremote and config.ENABLE_NETWORK_REMOTE and \
--- 374,379 ----
          try:
              self.inputs.append(Keyboard())
!         except Exception, e:
!             print e
  
          if use_netremote and config.ENABLE_NETWORK_REMOTE and \



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to