Package evas :: Module decorators
[hide private]
[frames] | no frames]

Source Code for Module evas.decorators

  1  # Copyright (C) 2007-2008 Gustavo Sverzut Barbieri, Caio Marcelo de Oliveira Filho 
  2  # 
  3  # This file is part of Python-Evas. 
  4  # 
  5  # Python-Evas is free software; you can redistribute it and/or 
  6  # modify it under the terms of the GNU Lesser General Public 
  7  # License as published by the Free Software Foundation; either 
  8  # version 2.1 of the License, or (at your option) any later version. 
  9  # 
 10  # Python-Evas is distributed in the hope that it will be useful, 
 11  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 13  # Lesser General Public License for more details. 
 14  # 
 15  # You should have received a copy of the GNU Lesser General Public License 
 16  # along with this Python-Evas.  If not, see <http://www.gnu.org/licenses/>. 
 17   
 18  import evas 
 19   
20 -def event_callback(event_type):
21 def deco(func): 22 func.evas_event_callback = event_type 23 return staticmethod(func)
24 return deco 25
26 -def mouse_in_callback(func):
27 func.evas_event_callback = evas.EVAS_CALLBACK_MOUSE_IN 28 return staticmethod(func)
29
30 -def mouse_out_callback(func):
31 func.evas_event_callback = evas.EVAS_CALLBACK_MOUSE_OUT 32 return staticmethod(func)
33
34 -def mouse_down_callback(func):
35 func.evas_event_callback = evas.EVAS_CALLBACK_MOUSE_DOWN 36 return staticmethod(func)
37
38 -def mouse_up_callback(func):
39 func.evas_event_callback = evas.EVAS_CALLBACK_MOUSE_UP 40 return staticmethod(func)
41
42 -def mouse_move_callback(func):
43 func.evas_event_callback = evas.EVAS_CALLBACK_MOUSE_MOVE 44 return staticmethod(func)
45
46 -def mouse_wheel_callback(func):
47 func.evas_event_callback = evas.EVAS_CALLBACK_MOUSE_WHEEL 48 return staticmethod(func)
49
50 -def free_callback(func):
51 func.evas_event_callback = evas.EVAS_CALLBACK_FREE 52 return staticmethod(func)
53
54 -def key_down_callback(func):
55 func.evas_event_callback = evas.EVAS_CALLBACK_KEY_DOWN 56 return staticmethod(func)
57
58 -def key_up_callback(func):
59 func.evas_event_callback = evas.EVAS_CALLBACK_KEY_UP 60 return staticmethod(func)
61
62 -def focus_in_callback(func):
63 func.evas_event_callback = evas.EVAS_CALLBACK_FOCUS_IN 64 return staticmethod(func)
65
66 -def focus_out_callback(func):
67 func.evas_event_callback = evas.EVAS_CALLBACK_FOCUS_OUT 68 return staticmethod(func)
69
70 -def show_callback(func):
71 func.evas_event_callback = evas.EVAS_CALLBACK_SHOW 72 return staticmethod(func)
73
74 -def hide_callback(func):
75 func.evas_event_callback = evas.EVAS_CALLBACK_HIDE 76 return staticmethod(func)
77
78 -def move_callback(func):
79 func.evas_event_callback = evas.EVAS_CALLBACK_MOVE 80 return staticmethod(func)
81
82 -def resize_callback(func):
83 func.evas_event_callback = evas.EVAS_CALLBACK_RESIZE 84 return staticmethod(func)
85
86 -def restack_callback(func):
87 func.evas_event_callback = evas.EVAS_CALLBACK_RESTACK 88 return staticmethod(func)
89
90 -def del_callback(func):
91 func.evas_event_callback = evas.EVAS_CALLBACK_DEL 92 return staticmethod(func)
93
94 -def hold_callback(func):
95 func.evas_event_callback = evas.EVAS_CALLBACK_HOLD 96 return staticmethod(func)
97
98 -def changed_size_hints_callback(func):
99 func.evas_event_callback = evas.EVAS_CALLBACK_CHANGED_SIZE_HINTS 100 return staticmethod(func)
101
102 -def image_preloaded(func):
103 func.evas_event_callback = evas.EVAS_CALLBACK_IMAGE_PRELOADED 104 return staticmethod(func)
105