Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11436

Modified Files:
        plugin.py item.py 
Log Message:
support for eventhandler in ItemPlugins

Index: plugin.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugin.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** plugin.py   30 Aug 2003 07:58:57 -0000      1.31
--- plugin.py   30 Aug 2003 17:03:02 -0000      1.32
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.32  2003/08/30 17:03:02  dischi
+ # support for eventhandler in ItemPlugins
+ #
  # Revision 1.31  2003/08/30 07:58:57  dischi
  # Fix item plugin handling
***************
*** 90,93 ****
--- 93,104 ----
      """
      Plugin class to add something to the item action list
+ 
+     The plugin can also have an eventhandler. All events passed to the item
+     will also be passed to this plugin. This works only for VideoItems right
+     now (each item type must support it directly). If the function returns
+     TRUE, the event won't be passed to other eventhandlers and also not to
+     the item itself.
+     
+     def eventhandler(self, item, event, menuw):
      """
      def __init__(self):

Index: item.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/item.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** item.py     30 Aug 2003 15:18:09 -0000      1.25
--- item.py     30 Aug 2003 17:03:02 -0000      1.26
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.26  2003/08/30 17:03:02  dischi
+ # support for eventhandler in ItemPlugins
+ #
  # Revision 1.25  2003/08/30 15:18:09  dischi
  # also react on STOP
***************
*** 44,47 ****
--- 47,51 ----
  
  import event as em
+ import plugin
  
  TRUE  = 1
***************
*** 158,161 ****
--- 162,176 ----
          return FALSE
  
+     def plugin_eventhandler(self, event, menuw=None):
+         if not hasattr(self, '__plugin_eventhandler__'):
+             self.__plugin_eventhandler__ = []
+             for p in plugin.get('item') + plugin.get('item_%s' % self.type):
+                 if hasattr(p, 'eventhandler'):
+                     self.__plugin_eventhandler__.append(p.eventhandler)
+         for e in self.__plugin_eventhandler__:
+             if e(self, event, menuw):
+                 return TRUE
+         return FALSE
+     
          
      def getattr(self, attr):




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to