summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2018-08-22 21:01:20 +0200
committerDave Andreoli <dave@gurumeditation.it>2018-08-22 21:01:20 +0200
commit7c555cc9da2a69c4da2f313313f348c936fcaf95 (patch)
tree313cd0970e6e0b591c5f03fa2382c45a80352f60
parent3e198f7294ab48dea2b2759da9b5cf372eade60c (diff)
Say goodbye to the Systray widget
This is a really bad break !!! ... shame on us to have used an efl beta api :(
-rw-r--r--efl/elementary/__init__.py1
-rw-r--r--efl/elementary/__init__.pyx15
-rw-r--r--efl/elementary/general.py1
-rw-r--r--efl/elementary/need.pxi23
-rw-r--r--efl/elementary/systray.pxi218
-rw-r--r--efl/elementary/systray.py13
-rw-r--r--efl/elementary/systray_cdef.pxi25
-rwxr-xr-xexamples/elementary/test.py1
-rw-r--r--examples/elementary/test_systray.py38
-rw-r--r--include/efl.elementary.enums.pxd16
10 files changed, 5 insertions, 346 deletions
diff --git a/efl/elementary/__init__.py b/efl/elementary/__init__.py
index 2ec3931..15711cd 100644
--- a/efl/elementary/__init__.py
+++ b/efl/elementary/__init__.py
@@ -78,7 +78,6 @@ __all__ = (
78 "slideshow", 78 "slideshow",
79 "spinner", 79 "spinner",
80 #"store", 80 #"store",
81 "systray",
82 "table", 81 "table",
83 "theme", 82 "theme",
84 "thumb", 83 "thumb",
diff --git a/efl/elementary/__init__.pyx b/efl/elementary/__init__.pyx
index e573812..d0278b9 100644
--- a/efl/elementary/__init__.pyx
+++ b/efl/elementary/__init__.pyx
@@ -59,8 +59,6 @@ ELM_EVENT_PROCESS_FOREGROUND = enums.ELM_EVENT_PROCESS_FOREGROUND
59ELM_ECORE_EVENT_ETHUMB_CONNECT = enums.ELM_ECORE_EVENT_ETHUMB_CONNECT 59ELM_ECORE_EVENT_ETHUMB_CONNECT = enums.ELM_ECORE_EVENT_ETHUMB_CONNECT
60ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED = enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED 60ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED = enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
61ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED = enums.ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED 61ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED = enums.ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
62ELM_EVENT_SYSTRAY_READY = enums.ELM_EVENT_SYSTRAY_READY
63
64 62
65ELM_FOCUS_PREVIOUS = enums.ELM_FOCUS_PREVIOUS 63ELM_FOCUS_PREVIOUS = enums.ELM_FOCUS_PREVIOUS
66ELM_FOCUS_NEXT = enums.ELM_FOCUS_NEXT 64ELM_FOCUS_NEXT = enums.ELM_FOCUS_NEXT
@@ -516,18 +514,6 @@ ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS = enums.ELM_SLIDER_INDICATOR_VISIBLE_MO
516ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS = enums.ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS 514ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS = enums.ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS
517ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE = enums.ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE 515ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE = enums.ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE
518 516
519ELM_EVENT_SYSTRAY_READY = enums.ELM_EVENT_SYSTRAY_READY
520
521ELM_SYSTRAY_CATEGORY_APP_STATUS = enums.ELM_SYSTRAY_CATEGORY_APP_STATUS
522ELM_SYSTRAY_CATEGORY_COMMUNICATIONS = enums.ELM_SYSTRAY_CATEGORY_COMMUNICATIONS
523ELM_SYSTRAY_CATEGORY_SYS_SERVICES = enums.ELM_SYSTRAY_CATEGORY_SYS_SERVICES
524ELM_SYSTRAY_CATEGORY_HARDWARE = enums.ELM_SYSTRAY_CATEGORY_HARDWARE
525ELM_SYSTRAY_CATEGORY_OTHER = enums.ELM_SYSTRAY_CATEGORY_OTHER
526
527ELM_SYSTRAY_STATUS_PASSIVE = enums.ELM_SYSTRAY_STATUS_PASSIVE
528ELM_SYSTRAY_STATUS_ACTIVE = enums.ELM_SYSTRAY_STATUS_ACTIVE
529ELM_SYSTRAY_STATUS_ATTENTION = enums.ELM_SYSTRAY_STATUS_ATTENTION
530
531ELM_THUMB_ANIMATION_START = enums.ELM_THUMB_ANIMATION_START 517ELM_THUMB_ANIMATION_START = enums.ELM_THUMB_ANIMATION_START
532ELM_THUMB_ANIMATION_LOOP = enums.ELM_THUMB_ANIMATION_LOOP 518ELM_THUMB_ANIMATION_LOOP = enums.ELM_THUMB_ANIMATION_LOOP
533ELM_THUMB_ANIMATION_STOP = enums.ELM_THUMB_ANIMATION_STOP 519ELM_THUMB_ANIMATION_STOP = enums.ELM_THUMB_ANIMATION_STOP
@@ -1285,7 +1271,6 @@ include "slider.pxi"
1285include "slideshow.pxi" 1271include "slideshow.pxi"
1286include "spinner.pxi" 1272include "spinner.pxi"
1287#include "store.pxi" 1273#include "store.pxi"
1288# include "systray.pxi"
1289include "table.pxi" 1274include "table.pxi"
1290include "theme.pxi" 1275include "theme.pxi"
1291include "thumb.pxi" 1276include "thumb.pxi"
diff --git a/efl/elementary/general.py b/efl/elementary/general.py
index a76111a..3fbcd4b 100644
--- a/efl/elementary/general.py
+++ b/efl/elementary/general.py
@@ -14,7 +14,6 @@ from . import ELM_EVENT_PROCESS_BACKGROUND
14from . import ELM_EVENT_PROCESS_FOREGROUND 14from . import ELM_EVENT_PROCESS_FOREGROUND
15from . import ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED 15from . import ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
16from . import ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED 16from . import ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
17from . import ELM_EVENT_SYSTRAY_READY
18 17
19from . import ELM_OBJECT_LAYER_BACKGROUND 18from . import ELM_OBJECT_LAYER_BACKGROUND
20from . import ELM_OBJECT_LAYER_DEFAULT 19from . import ELM_OBJECT_LAYER_DEFAULT
diff --git a/efl/elementary/need.pxi b/efl/elementary/need.pxi
index 285a448..2f7829a 100644
--- a/efl/elementary/need.pxi
+++ b/efl/elementary/need.pxi
@@ -89,13 +89,6 @@ cdef class EthumbConnect(Event):
89 def __repr__(self): 89 def __repr__(self):
90 return "<%s()>" % (self.__class__.__name__,) 90 return "<%s()>" % (self.__class__.__name__,)
91 91
92cdef class EventSystrayReady(Event):
93 cdef int _set_obj(self, void *o) except 0:
94 return 1
95
96 def __repr__(self):
97 return "<%s()>" % (self.__class__.__name__,)
98
99 92
100def need_efreet(): 93def need_efreet():
101 """Request that your elementary application needs Efreet 94 """Request that your elementary application needs Efreet
@@ -113,23 +106,17 @@ def need_efreet():
113def need_systray(): 106def need_systray():
114 """Request that your elementary application needs Elm_Systray 107 """Request that your elementary application needs Elm_Systray
115 108
116 This initializes the Elm_Systray when called and, if support exists, 109 WARNING: elm is no more capable of systray functionality
117 returns True, otherwise returns False. This must be called
118 before any elm_systray calls.
119 110
120 :return: True if support exists and initialization succeeded. 111 :return: always return False
121 :rtype: bool 112 :rtype: bool
122 113
123 .. versionadded:: 1.8 114 .. versionadded:: 1.8
115 .. versionremoved:: 1.21
124 116
125 """ 117 """
126 cdef bint ret = elm_need_systray() 118 print("ERROR: the Systray functionality do not exists anymore...apologies")
127 if ret: 119 return False
128 try:
129 _event_mapping_register(enums.ELM_EVENT_SYSTRAY_READY, EventSystrayReady)
130 except ValueError:
131 pass
132 return ret
133 120
134def need_sys_notify(): 121def need_sys_notify():
135 """Request that your elementary application needs Elm_Sys_Notify 122 """Request that your elementary application needs Elm_Sys_Notify
diff --git a/efl/elementary/systray.pxi b/efl/elementary/systray.pxi
deleted file mode 100644
index 267eecd..0000000
--- a/efl/elementary/systray.pxi
+++ /dev/null
@@ -1,218 +0,0 @@
1# Copyright (C) 2007-2016 various contributors (see AUTHORS)
2#
3# This file is part of Python-EFL.
4#
5# Python-EFL 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 3 of the License, or (at your option) any later version.
9#
10# Python-EFL 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-EFL. If not, see <http://www.gnu.org/licenses/>.
17
18include "systray_cdef.pxi"
19
20cdef class Systray(Eo):
21
22 """
23
24 This is the class that actually implements the widget.
25
26 """
27
28 def __init__(self, Eo parent not None, *args, **kwargs):
29 cdef cEo *obj = efl_add(elm_systray_class_get(), parent.obj)
30 self._set_obj(obj)
31 self._set_properties_from_keyword_args(kwargs)
32
33 property id:
34 """The id of the Status Notifier Item.
35
36 :type: string
37
38 """
39 def __set__(self, value):
40 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
41 elm_obj_systray_id_set(
42 self.obj, <const char *>value if value is not None else NULL
43 )
44
45 def __get__(self):
46 return _ctouni(elm_obj_systray_id_get(self.obj))
47
48 def id_set(self, value):
49 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
50 elm_obj_systray_id_set(
51 self.obj, <const char *>value if value is not None else NULL
52 )
53
54 def id_get(self):
55 return _ctouni(elm_obj_systray_id_get(self.obj))
56
57 property category:
58 """
59
60 The category of the Status Notifier Item.
61
62 :type: :ref:`Elm_Systray_Category`
63
64 """
65 def __set__(self, Elm_Systray_Category value):
66 elm_obj_systray_category_set(self.obj, value)
67
68 def __get__(self):
69 return <Elm_Systray_Category>elm_obj_systray_category_get(self.obj)
70
71 def category_set(self, Elm_Systray_Category value):
72 elm_obj_systray_category_set(self.obj, value)
73
74 def category_get(self):
75 return <Elm_Systray_Category>elm_obj_systray_category_get(self.obj)
76
77 property icon_theme_path:
78 """The path to the theme where the icons can be found.
79
80 Set this value to "" to use the default path.
81
82 :type: string
83 """
84 def __set__(self, value):
85 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
86 elm_obj_systray_icon_theme_path_set(
87 self.obj, <const char *>value if value is not None else NULL
88 )
89
90 def __get__(self):
91 return _ctouni(elm_obj_systray_icon_theme_path_get(self.obj))
92
93 def icon_theme_path_set(self, value):
94 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
95 elm_obj_systray_icon_theme_path_set(
96 self.obj, <const char *>value if value is not None else NULL
97 )
98
99 def icon_theme_path_get(self):
100 return _ctouni(elm_obj_systray_icon_theme_path_get(self.obj))
101
102 property menu:
103 """The D-Bus Menu to be shown when the Status Notifier Item is activated by the user.
104
105 :type: :class:`~efl.elementary.menu.Menu`
106 """
107 def __set__(self, Eo value):
108 elm_obj_systray_menu_set(self.obj, value.obj)
109
110 def __get__(self):
111 return object_from_instance(<cEo *>elm_obj_systray_menu_get(self.obj))
112
113 def menu_set(self, Eo value):
114 elm_obj_systray_menu_set(self.obj, value.obj)
115
116 def menu_get(self):
117 return object_from_instance(<cEo *>elm_obj_systray_menu_get(self.obj))
118
119 property att_icon_name:
120 """The name of the attention icon to be used by the Status Notifier Item.
121
122 :type: string
123 """
124 def __set__(self, value):
125 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
126 elm_obj_systray_att_icon_name_set(
127 self.obj, <const char *>value if value is not None else NULL
128 )
129
130 def __get__(self):
131 return _ctouni(elm_obj_systray_att_icon_name_get(self.obj))
132
133 def att_icon_name_set(self, value):
134 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
135 elm_obj_systray_att_icon_name_set(
136 self.obj, <const char *>value if value is not None else NULL
137 )
138
139 def att_icon_name_get(self):
140 return _ctouni(elm_obj_systray_att_icon_name_get(self.obj))
141
142 property status:
143 """The status of the Status Notifier Item.
144
145 :type: :ref:`Elm_Systray_Status`
146 """
147 def __set__(self, Elm_Systray_Status value):
148 elm_obj_systray_status_set(self.obj, value)
149
150 def __get__(self):
151 return elm_obj_systray_status_get(self.obj)
152
153 def status_set(self, Elm_Systray_Status value):
154 elm_obj_systray_status_set(self.obj, value)
155
156 def status_get(self):
157 return elm_obj_systray_status_get(self.obj)
158
159 property icon_name:
160 """The name of the icon to be used by the Status Notifier Item.
161
162 :type: string
163 """
164 def __set__(self, value):
165 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
166 elm_obj_systray_icon_name_set(
167 self.obj, <const char *>value if value is not None else NULL
168 )
169
170 def __get__(self):
171 return _ctouni(elm_obj_systray_icon_name_get(self.obj))
172
173 def icon_name_set(self, value):
174 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
175 elm_obj_systray_icon_name_set(
176 self.obj, <const char *>value if value is not None else NULL
177 )
178
179 def icon_name_get(self):
180 return _ctouni(elm_obj_systray_icon_name_get(self.obj))
181
182 property title:
183 """The title of the Status Notifier Item.
184
185 :type: string
186 """
187 def __set__(self, value):
188 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
189 elm_obj_systray_title_set(
190 self.obj, <const char *>value if value is not None else NULL
191 )
192
193 def __get__(self):
194 return _ctouni(elm_obj_systray_title_get(self.obj))
195
196 def title_set(self, value):
197 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
198 elm_obj_systray_title_set(
199 self.obj, <const char *>value if value is not None else NULL
200 )
201
202 def title_get(self):
203 return _ctouni(elm_obj_systray_title_get(self.obj))
204
205 def register(self):
206 """Register this Status Notifier Item in the System Tray Watcher.
207
208 This function should only be called after the event
209 ``ELM_EVENT_SYSTRAY_READY``, for which you can set a callback with
210 :func:`on_systray_ready`, is emitted.
211
212 """
213 return elm_obj_systray_register(self.obj)
214
215
216def on_systray_ready(func, *args, **kwargs):
217 """Use this to set a handler for the systray ready event."""
218 return EventHandler(enums.ELM_EVENT_SYSTRAY_READY, func, *args, **kwargs)
diff --git a/efl/elementary/systray.py b/efl/elementary/systray.py
deleted file mode 100644
index cb61236..0000000
--- a/efl/elementary/systray.py
+++ /dev/null
@@ -1,13 +0,0 @@
1from . import Systray, on_systray_ready
2
3from . import ELM_EVENT_SYSTRAY_READY
4
5from . import ELM_SYSTRAY_CATEGORY_APP_STATUS
6from . import ELM_SYSTRAY_CATEGORY_COMMUNICATIONS
7from . import ELM_SYSTRAY_CATEGORY_SYS_SERVICES
8from . import ELM_SYSTRAY_CATEGORY_HARDWARE
9from . import ELM_SYSTRAY_CATEGORY_OTHER
10
11from . import ELM_SYSTRAY_STATUS_PASSIVE
12from . import ELM_SYSTRAY_STATUS_ACTIVE
13from . import ELM_SYSTRAY_STATUS_ATTENTION
diff --git a/efl/elementary/systray_cdef.pxi b/efl/elementary/systray_cdef.pxi
deleted file mode 100644
index 3768c7c..0000000
--- a/efl/elementary/systray_cdef.pxi
+++ /dev/null
@@ -1,25 +0,0 @@
1from efl.elementary.enums cimport Elm_Systray_Category, Elm_Systray_Status
2
3cdef extern from "Elementary.h":
4
5 ctypedef cEo Elm_Systray
6
7 const Efl_Class *elm_systray_class_get()
8
9 void elm_obj_systray_id_set(cEo *obj, const char *id)
10 const char * elm_obj_systray_id_get(const cEo *obj)
11 void elm_obj_systray_category_set(cEo *obj, Elm_Systray_Category cat)
12 Elm_Systray_Category elm_obj_systray_category_get(const cEo *obj)
13 void elm_obj_systray_icon_theme_path_set(cEo *obj, const char *icon_theme_path)
14 const char * elm_obj_systray_icon_theme_path_get(const cEo *obj)
15 void elm_obj_systray_menu_set(cEo *obj, const cEo *menu)
16 const cEo * elm_obj_systray_menu_get(const cEo *obj)
17 void elm_obj_systray_att_icon_name_set(cEo *obj, const char *att_icon_name)
18 const char * elm_obj_systray_att_icon_name_get(const cEo *obj)
19 void elm_obj_systray_status_set(cEo *obj, Elm_Systray_Status st)
20 Elm_Systray_Status elm_obj_systray_status_get(const cEo *obj)
21 void elm_obj_systray_icon_name_set(cEo *obj, const char *icon_name)
22 const char * elm_obj_systray_icon_name_get(const cEo *obj)
23 void elm_obj_systray_title_set(cEo *obj, const char *title)
24 const char * elm_obj_systray_title_get(const cEo *obj)
25 Eina_Bool elm_obj_systray_register(const cEo *obj)
diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index 3c01007..cde28ba 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -247,7 +247,6 @@ items = [
247 ]), 247 ]),
248 ("System", [ 248 ("System", [
249 ("Notification", "test_sys_notify", "sys_notify_clicked"), 249 ("Notification", "test_sys_notify", "sys_notify_clicked"),
250 ("Systray", "test_systray", "systray_clicked"),
251 ]), 250 ]),
252 ("Text", [ 251 ("Text", [
253 ("Label", "test_label", "label_clicked"), 252 ("Label", "test_label", "label_clicked"),
diff --git a/examples/elementary/test_systray.py b/examples/elementary/test_systray.py
deleted file mode 100644
index 7c8791c..0000000
--- a/examples/elementary/test_systray.py
+++ /dev/null
@@ -1,38 +0,0 @@
1#!/usr/bin/python
2
3import efl.elementary as elm
4
5from efl.elementary.window import StandardWindow
6from efl.elementary.systray import Systray, on_systray_ready
7from efl.elementary.menu import Menu
8
9
10def systray_clicked(obj, item=None):
11 if not elm.need_systray():
12 print("systray support not available")
13 return
14
15 win = StandardWindow("test", "systray test", size=(400, 400), autodel=True)
16 if not obj:
17 win.callback_delete_request_add(lambda x: elm.exit())
18
19 menu = Menu(win)
20 menu.item_add(None, "it works!")
21
22 global tray
23 tray = Systray(win)
24 tray.icon_name = "elementary"
25 tray.att_icon_name = "elementary"
26 tray.menu = menu
27
28 on_systray_ready(lambda x: tray.register())
29
30 win.show()
31
32if __name__ == "__main__":
33 elm.init()
34
35 systray_clicked(None)
36
37 elm.run()
38 elm.shutdown()
diff --git a/include/efl.elementary.enums.pxd b/include/efl.elementary.enums.pxd
index 75b9120..9b7dd24 100644
--- a/include/efl.elementary.enums.pxd
+++ b/include/efl.elementary.enums.pxd
@@ -568,22 +568,6 @@ cdef extern from "Elementary.h":
568 ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS 568 ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS
569 ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE 569 ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE
570 570
571 # systray
572 ctypedef enum:
573 ELM_EVENT_SYSTRAY_READY
574
575 ctypedef enum Elm_Systray_Category:
576 ELM_SYSTRAY_CATEGORY_APP_STATUS
577 ELM_SYSTRAY_CATEGORY_COMMUNICATIONS
578 ELM_SYSTRAY_CATEGORY_SYS_SERVICES
579 ELM_SYSTRAY_CATEGORY_HARDWARE
580 ELM_SYSTRAY_CATEGORY_OTHER
581
582 ctypedef enum Elm_Systray_Status:
583 ELM_SYSTRAY_STATUS_PASSIVE
584 ELM_SYSTRAY_STATUS_ACTIVE
585 ELM_SYSTRAY_STATUS_ATTENTION
586
587 # thumb 571 # thumb
588 ctypedef enum Elm_Thumb_Animation_Setting: 572 ctypedef enum Elm_Thumb_Animation_Setting:
589 ELM_THUMB_ANIMATION_START 573 ELM_THUMB_ANIMATION_START