summaryrefslogtreecommitdiff
path: root/efl
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-04-06 01:50:29 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-04-06 01:50:29 +0300
commitb547ff2aa2064b98021d6f458cfc3d44a9936544 (patch)
tree4d974345bef5b05e4cfc3f94a56755d6a15b5166 /efl
parent75c8351fdf8594bffdc82fb92f6715324c15111e (diff)
Remove Python -> C string hacks
Diffstat (limited to 'efl')
-rw-r--r--efl/ecore/efl.ecore_exe.pxi6
-rw-r--r--efl/ecore/efl.ecore_file_download.pxi5
-rw-r--r--efl/ecore/efl.ecore_file_monitor.pxi4
-rw-r--r--efl/edje/efl.edje.pyx20
-rw-r--r--efl/edje/efl.edje_object.pxi135
-rw-r--r--efl/elementary/access.pyx3
-rw-r--r--efl/elementary/actionslider.pyx1
-rw-r--r--efl/elementary/background.pyx6
-rw-r--r--efl/elementary/box.pyx2
-rw-r--r--efl/elementary/bubble.pyx2
-rw-r--r--efl/elementary/calendar_elm.pyx3
-rw-r--r--efl/elementary/cnp_callbacks.pxi1
-rw-r--r--efl/elementary/colorselector.pyx6
-rw-r--r--efl/elementary/configuration.pyx11
-rw-r--r--efl/elementary/ctxpopup.pyx5
-rw-r--r--efl/elementary/datetime_elm.pyx3
-rw-r--r--efl/elementary/dayselector.pyx2
-rw-r--r--efl/elementary/diskselector.pyx5
-rw-r--r--efl/elementary/entry.pyx22
-rw-r--r--efl/elementary/fileselector.pyx9
-rw-r--r--efl/elementary/fileselector_button.pyx4
-rw-r--r--efl/elementary/fileselector_entry.pyx6
-rw-r--r--efl/elementary/flipselector.pyx7
-rw-r--r--efl/elementary/frame.pyx2
-rw-r--r--efl/elementary/general.pyx9
-rw-r--r--efl/elementary/gengrid.pyx3
-rw-r--r--efl/elementary/gengrid_item.pxi8
-rw-r--r--efl/elementary/gengrid_item_class.pxi3
-rw-r--r--efl/elementary/genlist.pyx3
-rw-r--r--efl/elementary/genlist_item.pxi9
-rw-r--r--efl/elementary/genlist_item_class.pxi7
-rw-r--r--efl/elementary/gesture_layer.pyx2
-rw-r--r--efl/elementary/hover.pyx2
-rw-r--r--efl/elementary/hoversel.pyx11
-rw-r--r--efl/elementary/icon.pyx8
-rw-r--r--efl/elementary/image.pyx5
-rw-r--r--efl/elementary/index.pyx3
-rw-r--r--efl/elementary/label.pyx2
-rw-r--r--efl/elementary/layout.pyx2
-rw-r--r--efl/elementary/layout_class.pyx46
-rw-r--r--efl/elementary/list.pyx11
-rw-r--r--efl/elementary/map.pyx9
-rw-r--r--efl/elementary/menu.pyx9
-rw-r--r--efl/elementary/multibuttonentry.pyx12
-rw-r--r--efl/elementary/naviframe.pyx5
-rw-r--r--efl/elementary/notify.pyx2
-rw-r--r--efl/elementary/object.pyx58
-rw-r--r--efl/elementary/object_item.pyx27
-rw-r--r--efl/elementary/photo.pyx8
-rw-r--r--efl/elementary/photocam.pyx5
-rw-r--r--efl/elementary/plug.pyx3
-rw-r--r--efl/elementary/popup.pyx4
-rw-r--r--efl/elementary/progressbar.pyx6
-rw-r--r--efl/elementary/scroller.pyx4
-rw-r--r--efl/elementary/segment_control.pyx4
-rw-r--r--efl/elementary/slider.pyx6
-rw-r--r--efl/elementary/slideshow.pyx4
-rw-r--r--efl/elementary/spinner.pyx5
-rw-r--r--efl/elementary/store.pyx4
-rw-r--r--efl/elementary/store_item_mapping.pxi5
-rw-r--r--efl/elementary/theme.pyx12
-rw-r--r--efl/elementary/thumb.pyx4
-rw-r--r--efl/elementary/toolbar.pyx13
-rw-r--r--efl/elementary/transit.pyx2
-rw-r--r--efl/elementary/video.pyx4
-rw-r--r--efl/elementary/web.pyx9
-rw-r--r--efl/elementary/window.pyx16
-rw-r--r--efl/emotion/efl.emotion.pyx10
-rw-r--r--efl/eo/efl.eo.pyx3
-rw-r--r--efl/evas/efl.evas.pyx3
-rw-r--r--efl/evas/efl.evas_canvas.pxi9
-rw-r--r--efl/evas/efl.evas_object.pxi4
-rw-r--r--efl/evas/efl.evas_object_box.pxi2
-rw-r--r--efl/evas/efl.evas_object_events.pxi13
-rw-r--r--efl/evas/efl.evas_object_image.pxi10
-rw-r--r--efl/evas/efl.evas_object_text.pxi3
-rw-r--r--efl/evas/efl.evas_object_textblock.pxi3
-rw-r--r--efl/evas/efl.evas_object_textgrid.pxi2
-rw-r--r--efl/evas/smart_object_metaclass.pxi2
-rw-r--r--efl/utils/conversions.pyx3
-rw-r--r--efl/utils/deprecated.pyx3
-rw-r--r--efl/utils/logger.pyx5
82 files changed, 53 insertions, 666 deletions
diff --git a/efl/ecore/efl.ecore_exe.pxi b/efl/ecore/efl.ecore_exe.pxi
index 96bbea4..125803b 100644
--- a/efl/ecore/efl.ecore_exe.pxi
+++ b/efl/ecore/efl.ecore_exe.pxi
@@ -15,8 +15,6 @@
15# You should have received a copy of the GNU Lesser General Public License 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/>. 16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17 17
18from cpython cimport PyUnicode_AsUTF8String
19
20cdef extern from "Python.h": 18cdef extern from "Python.h":
21 object PyUnicode_FromStringAndSize(char *s, Py_ssize_t len) 19 object PyUnicode_FromStringAndSize(char *s, Py_ssize_t len)
22 int PyObject_GetBuffer(obj, Py_buffer *view, int flags) 20 int PyObject_GetBuffer(obj, Py_buffer *view, int flags)
@@ -312,7 +310,6 @@ cdef class Exe(object):
312 if flags is None: 310 if flags is None:
313 flags = 0 311 flags = 0
314 312
315 if isinstance(exe_cmd, unicode): exe_cmd = PyUnicode_AsUTF8String(exe_cmd)
316 self._set_obj(exe_cmd, flags) 313 self._set_obj(exe_cmd, flags)
317 self.__data = data 314 self.__data = data
318 self.__callbacks = {} 315 self.__callbacks = {}
@@ -399,9 +396,6 @@ cdef class Exe(object):
399 Py_buffer buf_view 396 Py_buffer buf_view
400 bint ret 397 bint ret
401 398
402 if isinstance(buf, unicode):
403 buf = PyUnicode_AsUTF8String(buf)
404
405 PyObject_GetBuffer(buf, &buf_view, 0) 399 PyObject_GetBuffer(buf, &buf_view, 0)
406 400
407 if size <= 0: 401 if size <= 0:
diff --git a/efl/ecore/efl.ecore_file_download.pxi b/efl/ecore/efl.ecore_file_download.pxi
index 63592ea..125ebd5 100644
--- a/efl/ecore/efl.ecore_file_download.pxi
+++ b/efl/ecore/efl.ecore_file_download.pxi
@@ -15,8 +15,6 @@
15# You should have received a copy of the GNU Lesser General Public License 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/>. 16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17 17
18from cpython cimport PyUnicode_AsUTF8String
19
20cdef void _completion_cb(void *data, const char *file, int status) with gil: 18cdef void _completion_cb(void *data, const char *file, int status) with gil:
21 obj = <FileDownload>data 19 obj = <FileDownload>data
22 try: 20 try:
@@ -89,8 +87,6 @@ cdef class FileDownload(object):
89 self.args = args 87 self.args = args
90 self.kargs = kargs 88 self.kargs = kargs
91 89
92 if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
93 if isinstance(dst, unicode): dst = PyUnicode_AsUTF8String(dst)
94 if not ecore_file_download( 90 if not ecore_file_download(
95 <const char *>url if url is not None else NULL, 91 <const char *>url if url is not None else NULL,
96 <const char *>dst if dst is not None else NULL, 92 <const char *>dst if dst is not None else NULL,
@@ -183,6 +179,5 @@ def file_download_protocol_available(protocol):
183 :return: True if the protocol is supported 179 :return: True if the protocol is supported
184 :rtype: bool 180 :rtype: bool
185 """ 181 """
186 if isinstance(protocol, unicode): protocol = PyUnicode_AsUTF8String(protocol)
187 return bool(ecore_file_download_protocol_available( 182 return bool(ecore_file_download_protocol_available(
188 <const char *>protocol if protocol is not None else NULL)) 183 <const char *>protocol if protocol is not None else NULL))
diff --git a/efl/ecore/efl.ecore_file_monitor.pxi b/efl/ecore/efl.ecore_file_monitor.pxi
index 10df57e..8859ee6 100644
--- a/efl/ecore/efl.ecore_file_monitor.pxi
+++ b/efl/ecore/efl.ecore_file_monitor.pxi
@@ -15,9 +15,6 @@
15# You should have received a copy of the GNU Lesser General Public License 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/>. 16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17 17
18from cpython cimport PyUnicode_AsUTF8String
19
20
21cdef void _file_monitor_cb(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path) with gil: 18cdef void _file_monitor_cb(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path) with gil:
22 obj = <FileMonitor>data 19 obj = <FileMonitor>data
23 try: 20 try:
@@ -72,7 +69,6 @@ cdef class FileMonitor(object):
72 self.args = args 69 self.args = args
73 self.kargs = kargs 70 self.kargs = kargs
74 71
75 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
76 self.mon = ecore_file_monitor_add( 72 self.mon = ecore_file_monitor_add(
77 <const char *>path if path is not None else NULL, 73 <const char *>path if path is not None else NULL,
78 _file_monitor_cb, <void *>self) 74 _file_monitor_cb, <void *>self)
diff --git a/efl/edje/efl.edje.pyx b/efl/edje/efl.edje.pyx
index 1203f02..a9f3de3 100644
--- a/efl/edje/efl.edje.pyx
+++ b/efl/edje/efl.edje.pyx
@@ -18,7 +18,7 @@
18import traceback 18import traceback
19import warnings 19import warnings
20 20
21from cpython cimport PyMem_Malloc, PyMem_Free, PyUnicode_AsUTF8String 21from cpython cimport PyMem_Malloc, PyMem_Free
22cimport libc.stdlib 22cimport libc.stdlib
23from libc.stdint cimport uintptr_t 23from libc.stdint cimport uintptr_t
24 24
@@ -156,7 +156,6 @@ def thaw():
156 156
157 157
158def fontset_append_set(fonts): 158def fontset_append_set(fonts):
159 if isinstance(fonts, unicode): fonts = PyUnicode_AsUTF8String(fonts)
160 edje_fontset_append_set(<const char *>fonts if fonts is not None else NULL) 159 edje_fontset_append_set(<const char *>fonts if fonts is not None else NULL)
161 160
162 161
@@ -166,7 +165,6 @@ def fontset_append_get():
166 165
167def file_collection_list(file): 166def file_collection_list(file):
168 cdef Eina_List *lst 167 cdef Eina_List *lst
169 if isinstance(file, unicode): file = PyUnicode_AsUTF8String(file)
170 lst = edje_file_collection_list( 168 lst = edje_file_collection_list(
171 <const char *>file if file is not None else NULL) 169 <const char *>file if file is not None else NULL)
172 ret = eina_list_strings_to_python_list(lst) 170 ret = eina_list_strings_to_python_list(lst)
@@ -175,8 +173,6 @@ def file_collection_list(file):
175 173
176 174
177def file_group_exists(file, group): 175def file_group_exists(file, group):
178 if isinstance(file, unicode): file = PyUnicode_AsUTF8String(file)
179 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
180 return bool(edje_file_group_exists( 176 return bool(edje_file_group_exists(
181 <const char *>file if file is not None else NULL, 177 <const char *>file if file is not None else NULL,
182 <const char *>group if group is not None else NULL)) 178 <const char *>group if group is not None else NULL))
@@ -184,8 +180,6 @@ def file_group_exists(file, group):
184 180
185def file_data_get(file, key): 181def file_data_get(file, key):
186 cdef char *s 182 cdef char *s
187 if isinstance(file, unicode): file = PyUnicode_AsUTF8String(file)
188 if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key)
189 s = edje_file_data_get( 183 s = edje_file_data_get(
190 <const char *>file if file is not None else NULL, 184 <const char *>file if file is not None else NULL,
191 <const char *>key if key is not None else NULL) 185 <const char *>key if key is not None else NULL)
@@ -233,8 +227,6 @@ def color_class_set(color_class,
233 int r, int g, int b, int a, 227 int r, int g, int b, int a,
234 int r2, int g2, int b2, int a2, 228 int r2, int g2, int b2, int a2,
235 int r3, int g3, int b3, int a3): 229 int r3, int g3, int b3, int a3):
236 if isinstance(color_class, unicode):
237 color_class = PyUnicode_AsUTF8String(color_class)
238 edje_color_class_set( 230 edje_color_class_set(
239 <const char *>color_class if color_class is not None else NULL, 231 <const char *>color_class if color_class is not None else NULL,
240 r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3) 232 r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3)
@@ -244,8 +236,6 @@ def color_class_get(color_class):
244 cdef int r, g, b, a 236 cdef int r, g, b, a
245 cdef int r2, g2, b2, a2 237 cdef int r2, g2, b2, a2
246 cdef int r3, g3, b3, a3 238 cdef int r3, g3, b3, a3
247 if isinstance(color_class, unicode):
248 color_class = PyUnicode_AsUTF8String(color_class)
249 edje_color_class_get( 239 edje_color_class_get(
250 <const char *>color_class if color_class is not None else NULL, 240 <const char *>color_class if color_class is not None else NULL,
251 &r, &g, &b, &a, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3) 241 &r, &g, &b, &a, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3)
@@ -253,8 +243,6 @@ def color_class_get(color_class):
253 243
254 244
255def color_class_del(color_class): 245def color_class_del(color_class):
256 if isinstance(color_class, unicode):
257 color_class = PyUnicode_AsUTF8String(color_class)
258 edje_color_class_del( 246 edje_color_class_del(
259 <const char *>color_class if color_class is not None else NULL) 247 <const char *>color_class if color_class is not None else NULL)
260 248
@@ -275,10 +263,6 @@ def color_class_list():
275 263
276 264
277def text_class_set(text_class, font, int size): 265def text_class_set(text_class, font, int size):
278 if isinstance(text_class, unicode):
279 text_class = PyUnicode_AsUTF8String(text_class)
280 if isinstance(font, unicode):
281 font = PyUnicode_AsUTF8String(font)
282 edje_text_class_set( 266 edje_text_class_set(
283 <const char *>text_class if text_class is not None else NULL, 267 <const char *>text_class if text_class is not None else NULL,
284 <const char *>font if font is not None else NULL, 268 <const char *>font if font is not None else NULL,
@@ -286,7 +270,6 @@ def text_class_set(text_class, font, int size):
286 270
287 271
288def text_class_del(text_class): 272def text_class_del(text_class):
289 if isinstance(text_class, unicode): text_class = PyUnicode_AsUTF8String(text_class)
290 edje_text_class_del( 273 edje_text_class_del(
291 <const char *>text_class if text_class is not None else NULL) 274 <const char *>text_class if text_class is not None else NULL)
292 275
@@ -333,7 +316,6 @@ def available_modules_get():
333 316
334 317
335def module_load(name): 318def module_load(name):
336 if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
337 return bool(edje_module_load( 319 return bool(edje_module_load(
338 <const char *>name if name is not None else NULL)) 320 <const char *>name if name is not None else NULL))
339 321
diff --git a/efl/edje/efl.edje_object.pxi b/efl/edje/efl.edje_object.pxi
index 5b04016..a58cb01 100644
--- a/efl/edje/efl.edje_object.pxi
+++ b/efl/edje/efl.edje_object.pxi
@@ -186,7 +186,6 @@ cdef class Edje(Object):
186 :type: string 186 :type: string
187 187
188 """ 188 """
189 if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key)
190 return _ctouni(edje_object_data_get(self.obj, 189 return _ctouni(edje_object_data_get(self.obj,
191 <const char *>key if key is not None else NULL)) 190 <const char *>key if key is not None else NULL))
192 191
@@ -199,8 +198,6 @@ cdef class Edje(Object):
199 :raise EdjeLoadError: if error occurred during load. 198 :raise EdjeLoadError: if error occurred during load.
200 199
201 """ 200 """
202 if isinstance(file, unicode): file = PyUnicode_AsUTF8String(file)
203 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
204 if edje_object_file_set(self.obj, 201 if edje_object_file_set(self.obj,
205 <const char *>file if file is not None else NULL, 202 <const char *>file if file is not None else NULL,
206 <const char *>group if group is not None else NULL) == 0: 203 <const char *>group if group is not None else NULL) == 0:
@@ -310,8 +307,6 @@ cdef class Edje(Object):
310 :parm a3: 307 :parm a3:
311 308
312 """ 309 """
313 if isinstance(color_class, unicode):
314 color_class = PyUnicode_AsUTF8String(color_class)
315 edje_object_color_class_set(self.obj, 310 edje_object_color_class_set(self.obj,
316 <const char *>color_class if color_class is not None else NULL, 311 <const char *>color_class if color_class is not None else NULL,
317 r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3) 312 r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3)
@@ -327,8 +322,6 @@ cdef class Edje(Object):
327 cdef int r, g, b, a 322 cdef int r, g, b, a
328 cdef int r2, g2, b2, a2 323 cdef int r2, g2, b2, a2
329 cdef int r3, g3, b3, a3 324 cdef int r3, g3, b3, a3
330 if isinstance(color_class, unicode):
331 color_class = PyUnicode_AsUTF8String(color_class)
332 edje_object_color_class_get(self.obj, 325 edje_object_color_class_get(self.obj,
333 <const char *>color_class if color_class is not None else NULL, 326 <const char *>color_class if color_class is not None else NULL,
334 &r, &g, &b, &a, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3) 327 &r, &g, &b, &a, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3)
@@ -336,8 +329,6 @@ cdef class Edje(Object):
336 329
337 def color_class_del(self, color_class): 330 def color_class_del(self, color_class):
338 "Delete a specific color class." 331 "Delete a specific color class."
339 if isinstance(color_class, unicode):
340 color_class = PyUnicode_AsUTF8String(color_class)
341 edje_object_color_class_del(self.obj, 332 edje_object_color_class_del(self.obj,
342 <const char *>color_class if color_class is not None else NULL) 333 <const char *>color_class if color_class is not None else NULL)
343 334
@@ -348,10 +339,6 @@ cdef class Edje(Object):
348 :param font: the font name 339 :param font: the font name
349 :param size: the font size 340 :param size: the font size
350 """ 341 """
351 if isinstance(text_class, unicode):
352 text_class = PyUnicode_AsUTF8String(text_class)
353 if isinstance(font, unicode):
354 font = PyUnicode_AsUTF8String(font)
355 edje_object_text_class_set(self.obj, 342 edje_object_text_class_set(self.obj,
356 <const char *>text_class if text_class is not None else NULL, 343 <const char *>text_class if text_class is not None else NULL,
357 <const char *>font if font is not None else NULL, 344 <const char *>font if font is not None else NULL,
@@ -490,7 +477,6 @@ cdef class Edje(Object):
490 477
491 def part_exists(self, part): 478 def part_exists(self, part):
492 ":rtype: bool" 479 ":rtype: bool"
493 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
494 return bool(edje_object_part_exists(self.obj, 480 return bool(edje_object_part_exists(self.obj,
495 <const char *>part if part is not None else NULL)) 481 <const char *>part if part is not None else NULL))
496 482
@@ -506,7 +492,6 @@ cdef class Edje(Object):
506 492
507 """ 493 """
508 cdef Evas_Object *obj 494 cdef Evas_Object *obj
509 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
510 obj = <Evas_Object*>edje_object_part_object_get(self.obj, 495 obj = <Evas_Object*>edje_object_part_object_get(self.obj,
511 <const char *>part if part is not None else NULL) 496 <const char *>part if part is not None else NULL)
512 return object_from_instance(obj) 497 return object_from_instance(obj)
@@ -514,7 +499,6 @@ cdef class Edje(Object):
514 def part_geometry_get(self, part): 499 def part_geometry_get(self, part):
515 ":rtype: tuple of int" 500 ":rtype: tuple of int"
516 cdef int x, y, w, h 501 cdef int x, y, w, h
517 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
518 edje_object_part_geometry_get(self.obj, 502 edje_object_part_geometry_get(self.obj,
519 <const char *>part if part is not None else NULL, 503 <const char *>part if part is not None else NULL,
520 &x, &y, &w, &h) 504 &x, &y, &w, &h)
@@ -523,7 +507,6 @@ cdef class Edje(Object):
523 def part_size_get(self, part): 507 def part_size_get(self, part):
524 ":rtype: tuple of int" 508 ":rtype: tuple of int"
525 cdef int w, h 509 cdef int w, h
526 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
527 edje_object_part_geometry_get(self.obj, 510 edje_object_part_geometry_get(self.obj,
528 <const char *>part if part is not None else NULL, 511 <const char *>part if part is not None else NULL,
529 NULL, NULL, &w, &h) 512 NULL, NULL, &w, &h)
@@ -532,7 +515,6 @@ cdef class Edje(Object):
532 def part_pos_get(self, part): 515 def part_pos_get(self, part):
533 ":rtype: tuple of int" 516 ":rtype: tuple of int"
534 cdef int x, y 517 cdef int x, y
535 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
536 edje_object_part_geometry_get(self.obj, 518 edje_object_part_geometry_get(self.obj,
537 <const char *>part if part is not None else NULL, 519 <const char *>part if part is not None else NULL,
538 &x, &y, NULL, NULL) 520 &x, &y, NULL, NULL)
@@ -564,8 +546,6 @@ cdef class Edje(Object):
564 :param text: the new text to set 546 :param text: the new text to set
565 547
566 """ 548 """
567 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
568 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
569 edje_object_part_text_set(self.obj, 549 edje_object_part_text_set(self.obj,
570 <const char *>part if part is not None else NULL, 550 <const char *>part if part is not None else NULL,
571 <const char *>text if text is not None else NULL) 551 <const char *>text if text is not None else NULL)
@@ -578,19 +558,16 @@ cdef class Edje(Object):
578 558
579 """ 559 """
580 cdef const char *s 560 cdef const char *s
581 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
582 return _ctouni(edje_object_part_text_get(self.obj, 561 return _ctouni(edje_object_part_text_get(self.obj,
583 <const char *>part if part is not None else NULL)) 562 <const char *>part if part is not None else NULL))
584 563
585 def part_text_select_all(self, part): 564 def part_text_select_all(self, part):
586 "Select all the text of the given TEXT or TEXTBLOCK part" 565 "Select all the text of the given TEXT or TEXTBLOCK part"
587 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
588 edje_object_part_text_select_all(self.obj, 566 edje_object_part_text_select_all(self.obj,
589 <const char *>part if part is not None else NULL) 567 <const char *>part if part is not None else NULL)
590 568
591 def part_text_select_none(self, part): 569 def part_text_select_none(self, part):
592 "Deselect all the text of the given TEXT or TEXTBLOCK part" 570 "Deselect all the text of the given TEXT or TEXTBLOCK part"
593 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
594 edje_object_part_text_select_none(self.obj, 571 edje_object_part_text_select_none(self.obj,
595 <const char *>part if part is not None else NULL) 572 <const char *>part if part is not None else NULL)
596 573
@@ -604,9 +581,6 @@ cdef class Edje(Object):
604 :see: part_text_set() 581 :see: part_text_set()
605 :see: part_text_unescaped_get() 582 :see: part_text_unescaped_get()
606 """ 583 """
607 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
608 if isinstance(text_to_escape, unicode):
609 text_to_escape = PyUnicode_AsUTF8String(text_to_escape)
610 edje_object_part_text_unescaped_set(self.obj, 584 edje_object_part_text_unescaped_set(self.obj,
611 <const char *>part if part is not None else NULL, 585 <const char *>part if part is not None else NULL,
612 <const char *>text_to_escape if text_to_escape is not None else NULL) 586 <const char *>text_to_escape if text_to_escape is not None else NULL)
@@ -621,7 +595,6 @@ cdef class Edje(Object):
621 :see: part_text_unescaped_set() 595 :see: part_text_unescaped_set()
622 """ 596 """
623 cdef char *s 597 cdef char *s
624 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
625 s = edje_object_part_text_unescaped_get(self.obj, 598 s = edje_object_part_text_unescaped_get(self.obj,
626 <const char *>part if part is not None else NULL) 599 <const char *>part if part is not None else NULL)
627 if s == NULL: 600 if s == NULL:
@@ -647,7 +620,6 @@ cdef class Edje(Object):
647 :type obj: efl.evas.Object 620 :type obj: efl.evas.Object
648 621
649 """ 622 """
650 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
651 edje_object_part_swallow(self.obj, 623 edje_object_part_swallow(self.obj,
652 <const char *>part if part is not None else NULL, obj.obj) 624 <const char *>part if part is not None else NULL, obj.obj)
653 625
@@ -657,13 +629,11 @@ cdef class Edje(Object):
657 629
658 def part_swallow_get(self, part): 630 def part_swallow_get(self, part):
659 ":rtype: efl.evas.Object" 631 ":rtype: efl.evas.Object"
660 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
661 return object_from_instance(edje_object_part_swallow_get( 632 return object_from_instance(edje_object_part_swallow_get(
662 self.obj, <const char *>part if part is not None else NULL)) 633 self.obj, <const char *>part if part is not None else NULL))
663 634
664 def part_external_object_get(self, part): 635 def part_external_object_get(self, part):
665 ":rtype: efl.evas.Object" 636 ":rtype: efl.evas.Object"
666 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
667 return object_from_instance(edje_object_part_external_object_get( 637 return object_from_instance(edje_object_part_external_object_get(
668 self.obj, <const char *>part if part is not None else NULL)) 638 self.obj, <const char *>part if part is not None else NULL))
669 639
@@ -677,28 +647,8 @@ cdef class Edje(Object):
677 :rtype: bool 647 :rtype: bool
678 """ 648 """
679 cdef Edje_External_Param p 649 cdef Edje_External_Param p
680 cdef const char *c_part
681 cdef const char *c_param
682
683 if isinstance(part, unicode):
684 str1 = PyUnicode_AsUTF8String(part)
685 c_part = str1
686 elif isinstance(part, str):
687 c_part = part
688 else:
689 raise TypeError("part must be str or unicode, found %s" %
690 type(part).__name__)
691
692 if isinstance(param, unicode):
693 str2 = PyUnicode_AsUTF8String(param)
694 c_param = str2
695 elif isinstance(param, str):
696 c_param = param
697 else:
698 raise TypeError("param must be str or unicode, found %s" %
699 type(param).__name__)
700 650
701 p.name = c_param 651 p.name = <const char *>param
702 if isinstance(value, bool): # bool is int, so keep it before! 652 if isinstance(value, bool): # bool is int, so keep it before!
703 p.type = EDJE_EXTERNAL_PARAM_TYPE_BOOL 653 p.type = EDJE_EXTERNAL_PARAM_TYPE_BOOL
704 p.i = value 654 p.i = value
@@ -711,14 +661,18 @@ cdef class Edje(Object):
711 elif isinstance(value, (str, unicode)): 661 elif isinstance(value, (str, unicode)):
712 # may be STRING or CHOICE 662 # may be STRING or CHOICE
713 p.type = edje_object_part_external_param_type_get( 663 p.type = edje_object_part_external_param_type_get(
714 self.obj, c_part, c_param) 664 self.obj,
715 if isinstance(value, unicode): 665 <const char *>part,
716 value = PyUnicode_AsUTF8String(value) 666 <const char *>param
717 p.s = value 667 )
668 p.s = <const char *>value
718 else: 669 else:
719 raise TypeError("unsupported type %s" % type(value).__name__) 670 raise TypeError("unsupported type %s" % type(value).__name__)
720 671
721 return bool(edje_object_part_external_param_set(self.obj, c_part, &p)) 672 return bool(edje_object_part_external_param_set(self.obj,
673 <const char *>part,
674 &p)
675 )
722 676
723 def part_external_param_get(self, part, param): 677 def part_external_param_get(self, part, param):
724 """Get a parameter of the external part. 678 """Get a parameter of the external part.
@@ -729,33 +683,19 @@ cdef class Edje(Object):
729 :return: *None* for errors, other values depending on the parameter type. 683 :return: *None* for errors, other values depending on the parameter type.
730 """ 684 """
731 cdef Edje_External_Param p 685 cdef Edje_External_Param p
732 cdef const char *c_part
733 cdef const char *c_param
734
735 if isinstance(part, unicode):
736 str1 = PyUnicode_AsUTF8String(part)
737 c_part = str1
738 elif isinstance(part, str):
739 c_part = part
740 else:
741 raise TypeError("part must be str or unicode, found %s" %
742 type(part).__name__)
743
744 if isinstance(param, unicode):
745 str2 = PyUnicode_AsUTF8String(param)
746 c_param = str2
747 elif isinstance(param, str):
748 c_param = param
749 else:
750 raise TypeError("param must be str or unicode, found %s" %
751 type(param).__name__)
752 686
753 p.name = c_param 687 p.name = <const char *>param
754 p.type = edje_object_part_external_param_type_get(self.obj, c_part, c_param) 688 p.type = edje_object_part_external_param_type_get(self.obj,
689 <const char *>part,
690 <const char *>param
691 )
755 if p.type >= EDJE_EXTERNAL_PARAM_TYPE_MAX: 692 if p.type >= EDJE_EXTERNAL_PARAM_TYPE_MAX:
756 return None 693 return None
757 694
758 if not edje_object_part_external_param_get(self.obj, c_part, &p): 695 if not edje_object_part_external_param_get(self.obj,
696 <const char *>part,
697 &p
698 ):
759 return None 699 return None
760 if p.type == EDJE_EXTERNAL_PARAM_TYPE_BOOL: 700 if p.type == EDJE_EXTERNAL_PARAM_TYPE_BOOL:
761 return bool(p.i) 701 return bool(p.i)
@@ -778,7 +718,6 @@ cdef class Edje(Object):
778 :param obj: the efl.evas.Object to append 718 :param obj: the efl.evas.Object to append
779 :rtype: bool 719 :rtype: bool
780 """ 720 """
781 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
782 return bool(edje_object_part_box_append(self.obj, 721 return bool(edje_object_part_box_append(self.obj,
783 <const char *>part if part is not None else NULL, obj.obj)) 722 <const char *>part if part is not None else NULL, obj.obj))
784 723
@@ -793,7 +732,6 @@ cdef class Edje(Object):
793 :param obj: the efl.evas.Object to append 732 :param obj: the efl.evas.Object to append
794 :rtype: bool 733 :rtype: bool
795 """ 734 """
796 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
797 return bool(edje_object_part_box_prepend(self.obj, 735 return bool(edje_object_part_box_prepend(self.obj,
798 <const char *>part if part is not None else NULL, obj.obj)) 736 <const char *>part if part is not None else NULL, obj.obj))
799 737
@@ -806,7 +744,6 @@ cdef class Edje(Object):
806 :param pos: the position to append the object 744 :param pos: the position to append the object
807 :rtype: bool 745 :rtype: bool
808 """ 746 """
809 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
810 return bool(edje_object_part_box_insert_at(self.obj, 747 return bool(edje_object_part_box_insert_at(self.obj,
811 <const char *>part if part is not None else NULL, obj.obj, pos)) 748 <const char *>part if part is not None else NULL, obj.obj, pos))
812 749
@@ -818,7 +755,6 @@ cdef class Edje(Object):
818 :param reference: the efl.evas.Object used as reference 755 :param reference: the efl.evas.Object used as reference
819 :rtype: bool 756 :rtype: bool
820 """ 757 """
821 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
822 return bool(edje_object_part_box_insert_before(self.obj, 758 return bool(edje_object_part_box_insert_before(self.obj,
823 <const char *>part if part is not None else NULL, 759 <const char *>part if part is not None else NULL,
824 obj.obj, reference.obj)) 760 obj.obj, reference.obj))
@@ -835,7 +771,6 @@ cdef class Edje(Object):
835 :rtype: efl.evas.Object or *None* 771 :rtype: efl.evas.Object or *None*
836 772
837 """ 773 """
838 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
839 return object_from_instance(edje_object_part_box_remove(self.obj, 774 return object_from_instance(edje_object_part_box_remove(self.obj,
840 <const char *>part if part is not None else NULL, obj.obj)) 775 <const char *>part if part is not None else NULL, obj.obj))
841 776
@@ -850,7 +785,6 @@ cdef class Edje(Object):
850 :return: the removed object 785 :return: the removed object
851 :rtype: efl.evas.Object or None 786 :rtype: efl.evas.Object or None
852 """ 787 """
853 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
854 return object_from_instance(edje_object_part_box_remove_at(self.obj, 788 return object_from_instance(edje_object_part_box_remove_at(self.obj,
855 <const char *>part if part is not None else NULL, pos)) 789 <const char *>part if part is not None else NULL, pos))
856 790
@@ -864,7 +798,6 @@ cdef class Edje(Object):
864 798
865 :rtype: bool 799 :rtype: bool
866 """ 800 """
867 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
868 return bool(edje_object_part_box_remove_all(self.obj, 801 return bool(edje_object_part_box_remove_all(self.obj,
869 <const char *>part if part is not None else NULL, clear)) 802 <const char *>part if part is not None else NULL, clear))
870 803
@@ -880,7 +813,6 @@ cdef class Edje(Object):
880 813
881 :rtype: bool 814 :rtype: bool
882 """ 815 """
883 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
884 return bool(edje_object_part_table_pack(self.obj, 816 return bool(edje_object_part_table_pack(self.obj,
885 <const char *>part if part is not None else NULL, 817 <const char *>part if part is not None else NULL,
886 child.obj, col, row, colspan, rowspan)) 818 child.obj, col, row, colspan, rowspan))
@@ -893,7 +825,6 @@ cdef class Edje(Object):
893 825
894 :rtype: bool 826 :rtype: bool
895 """ 827 """
896 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
897 return bool(edje_object_part_table_unpack(self.obj, 828 return bool(edje_object_part_table_unpack(self.obj,
898 <const char *>part if part is not None else NULL, 829 <const char *>part if part is not None else NULL,
899 child.obj)) 830 child.obj))
@@ -906,7 +837,6 @@ cdef class Edje(Object):
906 :rtype: tuple of int 837 :rtype: tuple of int
907 """ 838 """
908 cdef int c, r 839 cdef int c, r
909 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
910 edje_object_part_table_col_row_size_get(self.obj, 840 edje_object_part_table_col_row_size_get(self.obj,
911 <const char *>part if part is not None else NULL, &c, &r) 841 <const char *>part if part is not None else NULL, &c, &r)
912 return (c, r) 842 return (c, r)
@@ -921,7 +851,6 @@ cdef class Edje(Object):
921 851
922 :rtype: bool 852 :rtype: bool
923 """ 853 """
924 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
925 return bool(edje_object_part_table_clear(self.obj, 854 return bool(edje_object_part_table_clear(self.obj,
926 <const char *>part if part is not None else NULL, clear)) 855 <const char *>part if part is not None else NULL, clear))
927 856
@@ -935,7 +864,6 @@ cdef class Edje(Object):
935 :return: the object ath the given position 864 :return: the object ath the given position
936 :rtype: efl.evas.Object 865 :rtype: efl.evas.Object
937 """ 866 """
938 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
939 return object_from_instance(edje_object_part_table_child_get(self.obj, 867 return object_from_instance(edje_object_part_table_child_get(self.obj,
940 <const char *>part if part is not None else NULL, row, column)) 868 <const char *>part if part is not None else NULL, row, column))
941 869
@@ -943,14 +871,12 @@ cdef class Edje(Object):
943 ":rtype: (name, value)" 871 ":rtype: (name, value)"
944 cdef double sv 872 cdef double sv
945 cdef const char *sn 873 cdef const char *sn
946 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
947 sn = edje_object_part_state_get(self.obj, 874 sn = edje_object_part_state_get(self.obj,
948 <const char *>part if part is not None else NULL, &sv) 875 <const char *>part if part is not None else NULL, &sv)
949 return (_ctouni(sn), sv) 876 return (_ctouni(sn), sv)
950 877
951 def part_drag_dir_get(self, part): 878 def part_drag_dir_get(self, part):
952 ":rtype: int" 879 ":rtype: int"
953 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
954 return edje_object_part_drag_dir_get(self.obj, 880 return edje_object_part_drag_dir_get(self.obj,
955 <const char *>part if part is not None else NULL) 881 <const char *>part if part is not None else NULL)
956 882
@@ -959,14 +885,12 @@ cdef class Edje(Object):
959 :param dx: 885 :param dx:
960 :param dy: 886 :param dy:
961 """ 887 """
962 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
963 edje_object_part_drag_value_set(self.obj, 888 edje_object_part_drag_value_set(self.obj,
964 <const char *>part if part is not None else NULL, dx, dy) 889 <const char *>part if part is not None else NULL, dx, dy)
965 890
966 def part_drag_value_get(self, part): 891 def part_drag_value_get(self, part):
967 ":rtype: tuple of float" 892 ":rtype: tuple of float"
968 cdef double dx, dy 893 cdef double dx, dy
969 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
970 edje_object_part_drag_value_get(self.obj, 894 edje_object_part_drag_value_get(self.obj,
971 <const char *>part if part is not None else NULL, &dx, &dy) 895 <const char *>part if part is not None else NULL, &dx, &dy)
972 return (dx, dy) 896 return (dx, dy)
@@ -976,14 +900,12 @@ cdef class Edje(Object):
976 :param dw: 900 :param dw:
977 :param dh: 901 :param dh:
978 """ 902 """
979 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
980 edje_object_part_drag_size_set(self.obj, 903 edje_object_part_drag_size_set(self.obj,
981 <const char *>part if part is not None else NULL, dw, dh) 904 <const char *>part if part is not None else NULL, dw, dh)
982 905
983 def part_drag_size_get(self, part): 906 def part_drag_size_get(self, part):
984 ":rtype: tuple of float" 907 ":rtype: tuple of float"
985 cdef double dw, dh 908 cdef double dw, dh
986 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
987 edje_object_part_drag_size_get(self.obj, 909 edje_object_part_drag_size_get(self.obj,
988 <const char *>part if part is not None else NULL, &dw, &dh) 910 <const char *>part if part is not None else NULL, &dw, &dh)
989 return (dw, dh) 911 return (dw, dh)
@@ -993,38 +915,32 @@ cdef class Edje(Object):
993 :param dx: 915 :param dx:
994 :param dy: 916 :param dy:
995 """ 917 """
996 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
997 edje_object_part_drag_step_set(self.obj, 918 edje_object_part_drag_step_set(self.obj,
998 <const char *>part if part is not None else NULL, dx, dy) 919 <const char *>part if part is not None else NULL, dx, dy)
999 920
1000 def part_drag_step_get(self, part): 921 def part_drag_step_get(self, part):
1001 ":rtype: tuple of float" 922 ":rtype: tuple of float"
1002 cdef double dx, dy 923 cdef double dx, dy
1003 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1004 edje_object_part_drag_step_get(self.obj, 924 edje_object_part_drag_step_get(self.obj,
1005 <const char *>part if part is not None else NULL, &dx, &dy) 925 <const char *>part if part is not None else NULL, &dx, &dy)
1006 return (dx, dy) 926 return (dx, dy)
1007 927
1008 def part_drag_step(self, part, double dx, double dy): 928 def part_drag_step(self, part, double dx, double dy):
1009 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1010 edje_object_part_drag_step(self.obj, 929 edje_object_part_drag_step(self.obj,
1011 <const char *>part if part is not None else NULL, dx, dy) 930 <const char *>part if part is not None else NULL, dx, dy)
1012 931
1013 def part_drag_page_set(self, part, double dx, double dy): 932 def part_drag_page_set(self, part, double dx, double dy):
1014 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1015 edje_object_part_drag_page_set(self.obj, 933 edje_object_part_drag_page_set(self.obj,
1016 <const char *>part if part is not None else NULL, dx, dy) 934 <const char *>part if part is not None else NULL, dx, dy)
1017 935
1018 def part_drag_page_get(self, part): 936 def part_drag_page_get(self, part):
1019 ":rtype: tuple of float" 937 ":rtype: tuple of float"
1020 cdef double dx, dy 938 cdef double dx, dy
1021 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1022 edje_object_part_drag_page_get(self.obj, 939 edje_object_part_drag_page_get(self.obj,
1023 <const char *>part if part is not None else NULL, &dx, &dy) 940 <const char *>part if part is not None else NULL, &dx, &dy)
1024 return (dx, dy) 941 return (dx, dy)
1025 942
1026 def part_drag_page(self, part, double dx, double dy): 943 def part_drag_page(self, part, double dx, double dy):
1027 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1028 edje_object_part_drag_page(self.obj, 944 edje_object_part_drag_page(self.obj,
1029 <const char *>part if part is not None else NULL, dx, dy) 945 <const char *>part if part is not None else NULL, dx, dy)
1030 946
@@ -1040,7 +956,6 @@ cdef class Edje(Object):
1040 956
1041 cdef void message_send_str(self, int id, data): 957 cdef void message_send_str(self, int id, data):
1042 cdef Edje_Message_String m 958 cdef Edje_Message_String m
1043 if isinstance(data, unicode): data = PyUnicode_AsUTF8String(data)
1044 m.str = <char *>data if data is not None else NULL 959 m.str = <char *>data if data is not None else NULL
1045 edje_object_message_send(self.obj, EDJE_MESSAGE_STRING, id, <void*>&m) 960 edje_object_message_send(self.obj, EDJE_MESSAGE_STRING, id, <void*>&m)
1046 961
@@ -1064,7 +979,6 @@ cdef class Edje(Object):
1064 979
1065 cdef void message_send_str_int(self, int id, s, int i): 980 cdef void message_send_str_int(self, int id, s, int i):
1066 cdef Edje_Message_String_Int m 981 cdef Edje_Message_String_Int m
1067 if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
1068 m.str = <char *>s if s is not None else NULL 982 m.str = <char *>s if s is not None else NULL
1069 m.val = i 983 m.val = i
1070 edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_INT, id, 984 edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_INT, id,
@@ -1072,7 +986,6 @@ cdef class Edje(Object):
1072 986
1073 cdef void message_send_str_float(self, int id, s, float f): 987 cdef void message_send_str_float(self, int id, s, float f):
1074 cdef Edje_Message_String_Float m 988 cdef Edje_Message_String_Float m
1075 if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
1076 m.str = <char *>s if s is not None else NULL 989 m.str = <char *>s if s is not None else NULL
1077 m.val = f 990 m.val = f
1078 edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_FLOAT, id, 991 edje_object_message_send(self.obj, EDJE_MESSAGE_STRING_FLOAT, id,
@@ -1086,7 +999,6 @@ cdef class Edje(Object):
1086 m = <Edje_Message_String_Int_Set*>PyMem_Malloc( 999 m = <Edje_Message_String_Int_Set*>PyMem_Malloc(
1087 sizeof(Edje_Message_String_Int_Set) + (count - 1) * sizeof(int)) 1000 sizeof(Edje_Message_String_Int_Set) + (count - 1) * sizeof(int))
1088 1001
1089 if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
1090 m.str = <char *>s if s is not None else NULL 1002 m.str = <char *>s if s is not None else NULL
1091 m.count = count 1003 m.count = count
1092 i = 0 1004 i = 0
@@ -1107,7 +1019,6 @@ cdef class Edje(Object):
1107 sizeof(Edje_Message_String_Float_Set) + 1019 sizeof(Edje_Message_String_Float_Set) +
1108 (count - 1) * sizeof(double)) 1020 (count - 1) * sizeof(double))
1109 1021
1110 if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
1111 m.str = <char *>s if s is not None else NULL 1022 m.str = <char *>s if s is not None else NULL
1112 m.count = count 1023 m.count = count
1113 i = 0 1024 i = 0
@@ -1168,6 +1079,7 @@ cdef class Edje(Object):
1168 elif isinstance(head, float): 1079 elif isinstance(head, float):
1169 self.message_send_float_set(id, data) 1080 self.message_send_float_set(id, data)
1170 elif isinstance(head, str): 1081 elif isinstance(head, str):
1082 # FIXME: Unicode?
1171 if issubclass(item_type, str): 1083 if issubclass(item_type, str):
1172 self.message_send_str_set(id, data) 1084 self.message_send_str_set(id, data)
1173 elif item_type == int or item_type == long: 1085 elif item_type == int or item_type == long:
@@ -1201,6 +1113,7 @@ cdef class Edje(Object):
1201 elif isinstance(data, float): 1113 elif isinstance(data, float):
1202 self.message_send_float(id, data) 1114 self.message_send_float(id, data)
1203 elif isinstance(data, str): 1115 elif isinstance(data, str):
1116 # FIXME: Unicode?
1204 self.message_send_str(id, data) 1117 self.message_send_str(id, data)
1205 elif isinstance(data, (tuple, list)): 1118 elif isinstance(data, (tuple, list)):
1206 if len(data) < 1: 1119 if len(data) < 1:
@@ -1267,8 +1180,6 @@ cdef class Edje(Object):
1267 d = self._signal_callbacks.setdefault(emission, {}) 1180 d = self._signal_callbacks.setdefault(emission, {})
1268 lst = d.setdefault(source, []) 1181 lst = d.setdefault(source, [])
1269 if not lst: 1182 if not lst:
1270 if isinstance(emission, unicode): emission = PyUnicode_AsUTF8String(emission)
1271 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
1272 edje_object_signal_callback_add(self.obj, 1183 edje_object_signal_callback_add(self.obj,
1273 <const char *>emission if emission is not None else NULL, 1184 <const char *>emission if emission is not None else NULL,
1274 <const char *>source if source is not None else NULL, 1185 <const char *>source if source is not None else NULL,
@@ -1300,8 +1211,6 @@ cdef class Edje(Object):
1300 d.pop(source) 1211 d.pop(source)
1301 if not d: 1212 if not d:
1302 self._signal_callbacks.pop(emission) 1213 self._signal_callbacks.pop(emission)
1303 if isinstance(emission, unicode): emission = PyUnicode_AsUTF8String(emission)
1304 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
1305 edje_object_signal_callback_del(self.obj, 1214 edje_object_signal_callback_del(self.obj,
1306 <const char *>emission if emission is not None else NULL, 1215 <const char *>emission if emission is not None else NULL,
1307 <const char *>source if source is not None else NULL, 1216 <const char *>source if source is not None else NULL,
@@ -1309,8 +1218,6 @@ cdef class Edje(Object):
1309 1218
1310 def signal_emit(self, emission, source): 1219 def signal_emit(self, emission, source):
1311 "Emit signal with ``emission`` and ``source``" 1220 "Emit signal with ``emission`` and ``source``"
1312 if isinstance(emission, unicode): emission = PyUnicode_AsUTF8String(emission)
1313 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
1314 edje_object_signal_emit(self.obj, 1221 edje_object_signal_emit(self.obj,
1315 <const char *>emission if emission is not None else NULL, 1222 <const char *>emission if emission is not None else NULL,
1316 <const char *>source if source is not None else NULL) 1223 <const char *>source if source is not None else NULL)
diff --git a/efl/elementary/access.pyx b/efl/elementary/access.pyx
index 1788360..b515ae7 100644
--- a/efl/elementary/access.pyx
+++ b/efl/elementary/access.pyx
@@ -15,8 +15,6 @@
15# You should have received a copy of the GNU Lesser General Public License 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/>. 16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17 17
18from cpython cimport PyUnicode_AsUTF8String
19
20from efl.eo cimport _object_mapping_register 18from efl.eo cimport _object_mapping_register
21from efl.utils.conversions cimport _touni 19from efl.utils.conversions cimport _touni
22from efl.evas cimport Object as evasObject 20from efl.evas cimport Object as evasObject
@@ -77,7 +75,6 @@ cdef class Accessible(Object):
77 :see: elm_access_info_cb_set 75 :see: elm_access_info_cb_set
78 76
79 """ 77 """
80 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
81 elm_access_info_set(self.obj, type, 78 elm_access_info_set(self.obj, type,
82 <const char *>text if text is not None else NULL) 79 <const char *>text if text is not None else NULL)
83 80
diff --git a/efl/elementary/actionslider.pyx b/efl/elementary/actionslider.pyx
index 8f1b491..7b680f1 100644
--- a/efl/elementary/actionslider.pyx
+++ b/efl/elementary/actionslider.pyx
@@ -86,7 +86,6 @@ Actionslider positions
86 86
87""" 87"""
88 88
89from cpython cimport PyUnicode_AsUTF8String
90from libc.stdint cimport uintptr_t 89from libc.stdint cimport uintptr_t
91 90
92from efl.eo cimport _object_mapping_register 91from efl.eo cimport _object_mapping_register
diff --git a/efl/elementary/background.pyx b/efl/elementary/background.pyx
index da48ca3..c2851b8 100644
--- a/efl/elementary/background.pyx
+++ b/efl/elementary/background.pyx
@@ -63,8 +63,6 @@ Background display modes
63 63
64""" 64"""
65 65
66from cpython cimport PyUnicode_AsUTF8String
67
68from efl.eo cimport _object_mapping_register, Eo 66from efl.eo cimport _object_mapping_register, Eo
69from efl.utils.conversions cimport _ctouni 67from efl.utils.conversions cimport _ctouni
70from efl.evas cimport Object as evasObject 68from efl.evas cimport Object as evasObject
@@ -129,16 +127,12 @@ cdef class Background(LayoutClass):
129 else: 127 else:
130 filename = value 128 filename = value
131 group = "" 129 group = ""
132 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
133 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
134 if not elm_bg_file_set(self.obj, 130 if not elm_bg_file_set(self.obj,
135 <const char *>filename if filename is not None else NULL, 131 <const char *>filename if filename is not None else NULL,
136 <const char *>group if group is not None else NULL): 132 <const char *>group if group is not None else NULL):
137 raise RuntimeError("Could not set background file.") 133 raise RuntimeError("Could not set background file.")
138 134
139 def file_set(self, filename, group = None): 135 def file_set(self, filename, group = None):
140 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
141 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
142 if not elm_bg_file_set(self.obj, 136 if not elm_bg_file_set(self.obj,
143 <const char *>filename if filename is not None else NULL, 137 <const char *>filename if filename is not None else NULL,
144 <const char *>group if group is not None else NULL): 138 <const char *>group if group is not None else NULL):
diff --git a/efl/elementary/box.pyx b/efl/elementary/box.pyx
index a53511b..7f556f1 100644
--- a/efl/elementary/box.pyx
+++ b/efl/elementary/box.pyx
@@ -125,8 +125,6 @@ Box layout modes
125 125
126""" 126"""
127 127
128from cpython cimport PyUnicode_AsUTF8String
129
130from efl.eo cimport _object_mapping_register 128from efl.eo cimport _object_mapping_register
131from efl.utils.conversions cimport _ctouni 129from efl.utils.conversions cimport _ctouni
132from efl.evas cimport Object as evasObject 130from efl.evas cimport Object as evasObject
diff --git a/efl/elementary/bubble.pyx b/efl/elementary/bubble.pyx
index bcef960..443082c 100644
--- a/efl/elementary/bubble.pyx
+++ b/efl/elementary/bubble.pyx
@@ -89,8 +89,6 @@ Bubble arrow positions
89 89
90""" 90"""
91 91
92from cpython cimport PyUnicode_AsUTF8String
93
94from efl.eo cimport _object_mapping_register 92from efl.eo cimport _object_mapping_register
95from efl.utils.conversions cimport _ctouni 93from efl.utils.conversions cimport _ctouni
96from efl.evas cimport Object as evasObject 94from efl.evas cimport Object as evasObject
diff --git a/efl/elementary/calendar_elm.pyx b/efl/elementary/calendar_elm.pyx
index ab278c7..7689bd0 100644
--- a/efl/elementary/calendar_elm.pyx
+++ b/efl/elementary/calendar_elm.pyx
@@ -167,7 +167,7 @@ Days
167 167
168""" 168"""
169 169
170from cpython cimport PyUnicode_AsUTF8String, PyMem_Malloc, PyMem_Free 170from cpython cimport PyMem_Malloc, PyMem_Free
171 171
172from efl.utils.conversions cimport _ctouni, array_of_strings_to_python_list, \ 172from efl.utils.conversions cimport _ctouni, array_of_strings_to_python_list, \
173 python_list_strings_to_array_of_strings 173 python_list_strings_to_array_of_strings
@@ -261,7 +261,6 @@ cdef class CalendarMark(object):
261 time.tm_wday = tmtup.tm_wday 261 time.tm_wday = tmtup.tm_wday
262 time.tm_yday = tmtup.tm_yday 262 time.tm_yday = tmtup.tm_yday
263 time.tm_isdst = tmtup.tm_isdst 263 time.tm_isdst = tmtup.tm_isdst
264 if isinstance(mark_type, unicode): mark_type = PyUnicode_AsUTF8String(mark_type)
265 self.obj = elm_calendar_mark_add(cal.obj, 264 self.obj = elm_calendar_mark_add(cal.obj,
266 <const char *>mark_type if mark_type is not None else NULL, 265 <const char *>mark_type if mark_type is not None else NULL,
267 &time, repeat) 266 &time, repeat)
diff --git a/efl/elementary/cnp_callbacks.pxi b/efl/elementary/cnp_callbacks.pxi
index fdd6520..4a4579d 100644
--- a/efl/elementary/cnp_callbacks.pxi
+++ b/efl/elementary/cnp_callbacks.pxi
@@ -392,7 +392,6 @@ cdef class DragUserInfo(object):
392 return _ctouni(self._data) 392 return _ctouni(self._data)
393 393
394 def __set__(self, value): 394 def __set__(self, value):
395 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
396 self._data = value 395 self._data = value
397 396
398 # Elm_Sel_Format format; 397 # Elm_Sel_Format format;
diff --git a/efl/elementary/colorselector.pyx b/efl/elementary/colorselector.pyx
index 6620a66..f2a4da8 100644
--- a/efl/elementary/colorselector.pyx
+++ b/efl/elementary/colorselector.pyx
@@ -68,7 +68,7 @@ Colorselector modes
68 68
69""" 69"""
70 70
71from cpython cimport PyUnicode_AsUTF8String, Py_DECREF 71from cpython cimport Py_DECREF
72from libc.stdint cimport uintptr_t 72from libc.stdint cimport uintptr_t
73 73
74from efl.eo cimport _object_mapping_register 74from efl.eo cimport _object_mapping_register
@@ -238,13 +238,11 @@ cdef class Colorselector(LayoutClass):
238 return _ctouni(elm_colorselector_palette_name_get(self.obj)) 238 return _ctouni(elm_colorselector_palette_name_get(self.obj))
239 def __set__(self, palette_name): 239 def __set__(self, palette_name):
240 s = palette_name 240 s = palette_name
241 if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
242 elm_colorselector_palette_name_set(self.obj, 241 elm_colorselector_palette_name_set(self.obj,
243 <const char *>s if s is not None else NULL) 242 <const char *>s if s is not None else NULL)
244 243
245 def palette_name_set(self, palette_name): 244 def palette_name_set(self, palette_name):
246 s = palette_name 245 s = palette_name
247 if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
248 elm_colorselector_palette_name_set(self.obj, 246 elm_colorselector_palette_name_set(self.obj,
249 <const char *>s if s is not None else NULL) 247 <const char *>s if s is not None else NULL)
250 def palette_name_get(self): 248 def palette_name_get(self):
@@ -259,7 +257,7 @@ cdef class Colorselector(LayoutClass):
259 :rtype: list of :py:class:`ColorselectorPaletteItem` 257 :rtype: list of :py:class:`ColorselectorPaletteItem`
260 258
261 .. versionadded:: 1.9 259 .. versionadded:: 1.9
262 260
263 """ 261 """
264 cdef: 262 cdef:
265 list ret = list() 263 list ret = list()
diff --git a/efl/elementary/configuration.pyx b/efl/elementary/configuration.pyx
index 609e15d..33b2884 100644
--- a/efl/elementary/configuration.pyx
+++ b/efl/elementary/configuration.pyx
@@ -101,8 +101,6 @@ Elm_Softcursor_Mode
101 101
102""" 102"""
103 103
104from cpython cimport PyUnicode_AsUTF8String
105
106from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list 104from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list
107 105
108cimport enums 106cimport enums
@@ -167,7 +165,6 @@ cdef class Configuration(object):
167 def __get__(self): 165 def __get__(self):
168 return _ctouni(elm_config_profile_get()) 166 return _ctouni(elm_config_profile_get())
169 def __set__(self, profile): 167 def __set__(self, profile):
170 if isinstance(profile, unicode): profile = PyUnicode_AsUTF8String(profile)
171 elm_config_profile_set(<const char *>profile if profile is not None else NULL) 168 elm_config_profile_set(<const char *>profile if profile is not None else NULL)
172 169
173 def profile_dir_get(self, profile, bint is_user): 170 def profile_dir_get(self, profile, bint is_user):
@@ -186,7 +183,6 @@ cdef class Configuration(object):
186 :rtype: string 183 :rtype: string
187 184
188 """ 185 """
189 if isinstance(profile, unicode): profile = PyUnicode_AsUTF8String(profile)
190 return _ctouni(elm_config_profile_dir_get( 186 return _ctouni(elm_config_profile_dir_get(
191 <const char *>profile if profile is not None else NULL, 187 <const char *>profile if profile is not None else NULL,
192 is_user)) 188 is_user))
@@ -559,7 +555,6 @@ cdef class Configuration(object):
559 def __get__(self): 555 def __get__(self):
560 return _ctouni(elm_config_engine_get()) 556 return _ctouni(elm_config_engine_get())
561 def __set__(self, engine): 557 def __set__(self, engine):
562 if isinstance(engine, unicode): engine = PyUnicode_AsUTF8String(engine)
563 elm_config_engine_set( 558 elm_config_engine_set(
564 <const char *>engine if engine is not None else NULL) 559 <const char *>engine if engine is not None else NULL)
565 560
@@ -579,7 +574,6 @@ cdef class Configuration(object):
579 def __get__(self): 574 def __get__(self):
580 return _ctouni(elm_config_preferred_engine_get()) 575 return _ctouni(elm_config_preferred_engine_get())
581 def __set__(self, engine): 576 def __set__(self, engine):
582 if isinstance(engine, unicode): engine = PyUnicode_AsUTF8String(engine)
583 elm_config_preferred_engine_set( 577 elm_config_preferred_engine_set(
584 <const char *>engine if engine is not None else NULL) 578 <const char *>engine if engine is not None else NULL)
585 579
@@ -664,8 +658,6 @@ cdef class Configuration(object):
664 """ 658 """
665 a1 = text_class 659 a1 = text_class
666 a2 = font 660 a2 = font
667 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
668 if isinstance(a2, unicode): a2 = PyUnicode_AsUTF8String(a2)
669 elm_config_font_overlay_set( 661 elm_config_font_overlay_set(
670 <const char *>a1 if a1 is not None else NULL, 662 <const char *>a1 if a1 is not None else NULL,
671 <const char *>a2 if a2 is not None else NULL, 663 <const char *>a2 if a2 is not None else NULL,
@@ -715,7 +707,6 @@ cdef class Configuration(object):
715 707
716 """ 708 """
717 a1 = text_class 709 a1 = text_class
718 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
719 elm_config_font_overlay_unset( 710 elm_config_font_overlay_unset(
720 <const char *>a1 if a1 is not None else NULL) 711 <const char *>a1 if a1 is not None else NULL)
721 712
@@ -953,14 +944,12 @@ def focus_highlight_animate_set(animate):
953def preferred_engine_get(): 944def preferred_engine_get():
954 return _ctouni(elm_config_preferred_engine_get()) 945 return _ctouni(elm_config_preferred_engine_get())
955def preferred_engine_set(engine): 946def preferred_engine_set(engine):
956 if isinstance(engine, unicode): engine = PyUnicode_AsUTF8String(engine)
957 elm_config_preferred_engine_set( 947 elm_config_preferred_engine_set(
958 <const char *>engine if engine is not None else NULL) 948 <const char *>engine if engine is not None else NULL)
959 949
960def engine_get(): 950def engine_get():
961 return _ctouni(elm_config_engine_get()) 951 return _ctouni(elm_config_engine_get())
962def engine_set(engine): 952def engine_set(engine):
963 if isinstance(engine, unicode): engine = PyUnicode_AsUTF8String(engine)
964 elm_config_engine_set( 953 elm_config_engine_set(
965 <const char *>engine if engine is not None else NULL) 954 <const char *>engine if engine is not None else NULL)
966 955
diff --git a/efl/elementary/ctxpopup.pyx b/efl/elementary/ctxpopup.pyx
index ab36d02..af259fb 100644
--- a/efl/elementary/ctxpopup.pyx
+++ b/efl/elementary/ctxpopup.pyx
@@ -89,7 +89,7 @@ Ctxpopup arrow directions
89 89
90""" 90"""
91 91
92from cpython cimport PyUnicode_AsUTF8String, Py_DECREF 92from cpython cimport Py_DECREF
93 93
94from efl.eo cimport _object_mapping_register, object_from_instance 94from efl.eo cimport _object_mapping_register, object_from_instance
95from efl.utils.conversions cimport _ctouni 95from efl.utils.conversions cimport _ctouni
@@ -135,7 +135,6 @@ cdef class CtxpopupItem(ObjectItem):
135 if not callable(callback): 135 if not callable(callback):
136 raise TypeError("callback is not callable") 136 raise TypeError("callback is not callable")
137 137
138 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
139 self.label = label 138 self.label = label
140 self.icon = icon 139 self.icon = icon
141 self.cb_func = callback 140 self.cb_func = callback
@@ -246,8 +245,6 @@ cdef class Ctxpopup(LayoutClass):
246 if func is not None and callable(func): 245 if func is not None and callable(func):
247 cb = _object_item_callback 246 cb = _object_item_callback
248 247
249 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
250
251 item = elm_ctxpopup_item_append(self.obj, 248 item = elm_ctxpopup_item_append(self.obj,
252 <const char *>label if label is not None else NULL, 249 <const char *>label if label is not None else NULL,
253 icon.obj if icon is not None else NULL, 250 icon.obj if icon is not None else NULL,
diff --git a/efl/elementary/datetime_elm.pyx b/efl/elementary/datetime_elm.pyx
index c05a163..b640c4f 100644
--- a/efl/elementary/datetime_elm.pyx
+++ b/efl/elementary/datetime_elm.pyx
@@ -249,8 +249,6 @@ Datetime fields
249 249
250""" 250"""
251 251
252from cpython cimport PyUnicode_AsUTF8String
253
254from efl.eo cimport _object_mapping_register 252from efl.eo cimport _object_mapping_register
255from efl.utils.conversions cimport _ctouni 253from efl.utils.conversions cimport _ctouni
256from efl.evas cimport Object as evasObject 254from efl.evas cimport Object as evasObject
@@ -375,7 +373,6 @@ cdef class Datetime(Object):
375 def __get__(self): 373 def __get__(self):
376 return _ctouni(elm_datetime_format_get(self.obj)) 374 return _ctouni(elm_datetime_format_get(self.obj))
377 def __set__(self, fmt): 375 def __set__(self, fmt):
378 if isinstance(fmt, unicode): fmt = PyUnicode_AsUTF8String(fmt)
379 elm_datetime_format_set(self.obj, 376 elm_datetime_format_set(self.obj,
380 <const char *>fmt if fmt is not None else NULL) 377 <const char *>fmt if fmt is not None else NULL)
381 378
diff --git a/efl/elementary/dayselector.pyx b/efl/elementary/dayselector.pyx
index 53b7568..ef382b4 100644
--- a/efl/elementary/dayselector.pyx
+++ b/efl/elementary/dayselector.pyx
@@ -108,8 +108,6 @@ Dayselector days
108 108
109""" 109"""
110 110
111from cpython cimport PyUnicode_AsUTF8String
112
113from efl.eo cimport _object_mapping_register 111from efl.eo cimport _object_mapping_register
114from efl.evas cimport Object as evasObject 112from efl.evas cimport Object as evasObject
115from efl.utils.conversions cimport python_list_strings_to_array_of_strings, \ 113from efl.utils.conversions cimport python_list_strings_to_array_of_strings, \
diff --git a/efl/elementary/diskselector.pyx b/efl/elementary/diskselector.pyx
index a4df951..5e7645b 100644
--- a/efl/elementary/diskselector.pyx
+++ b/efl/elementary/diskselector.pyx
@@ -71,7 +71,7 @@ using multiple inheritance, for example::
71 71
72""" 72"""
73 73
74from cpython cimport PyUnicode_AsUTF8String, Py_DECREF 74from cpython cimport Py_DECREF
75from libc.stdint cimport uintptr_t 75from libc.stdint cimport uintptr_t
76 76
77from efl.eo cimport _object_mapping_register 77from efl.eo cimport _object_mapping_register
@@ -143,7 +143,6 @@ cdef class DiskselectorItem(ObjectItem):
143 if not callable(callback): 143 if not callable(callback):
144 raise TypeError("callback is not callable") 144 raise TypeError("callback is not callable")
145 145
146 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
147 self.label = label 146 self.label = label
148 self.icon = icon 147 self.icon = icon
149 self.cb_func = callback 148 self.cb_func = callback
@@ -362,8 +361,6 @@ cdef class Diskselector(Object):
362 if callback is not None and callable(callback): 361 if callback is not None and callable(callback):
363 cb = _object_item_callback 362 cb = _object_item_callback
364 363
365 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
366
367 item = elm_diskselector_item_append(self.obj, 364 item = elm_diskselector_item_append(self.obj,
368 <const char *>label if label is not None else NULL, 365 <const char *>label if label is not None else NULL,
369 icon.obj if icon is not None else NULL, 366 icon.obj if icon is not None else NULL,
diff --git a/efl/elementary/entry.pyx b/efl/elementary/entry.pyx
index 61ac603..5c55b89 100644
--- a/efl/elementary/entry.pyx
+++ b/efl/elementary/entry.pyx
@@ -472,7 +472,7 @@ Icon types
472from libc.string cimport strdup 472from libc.string cimport strdup
473from libc.stdlib cimport free 473from libc.stdlib cimport free
474from libc.stdint cimport uintptr_t 474from libc.stdint cimport uintptr_t
475from cpython cimport PyUnicode_AsUTF8String, Py_INCREF 475from cpython cimport Py_INCREF
476 476
477from efl.eo cimport _object_mapping_register, object_from_instance 477from efl.eo cimport _object_mapping_register, object_from_instance
478from efl.utils.conversions cimport _touni, _ctouni 478from efl.utils.conversions cimport _touni, _ctouni
@@ -550,24 +550,20 @@ cdef void _entry_context_menu_callback(void *data, Evas_Object *obj, void *event
550@DEPRECATED("1.8", "Use markup_to_utf8() instead.") 550@DEPRECATED("1.8", "Use markup_to_utf8() instead.")
551def Entry_markup_to_utf8(string): 551def Entry_markup_to_utf8(string):
552 """Entry_markup_to_utf8(string)""" 552 """Entry_markup_to_utf8(string)"""
553 if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
554 return _touni(elm_entry_markup_to_utf8( 553 return _touni(elm_entry_markup_to_utf8(
555 <const char *>string if string is not None else NULL)) 554 <const char *>string if string is not None else NULL))
556 555
557@DEPRECATED("1.8", "Use utf8_to_markup() instead.") 556@DEPRECATED("1.8", "Use utf8_to_markup() instead.")
558def Entry_utf8_to_markup(string): 557def Entry_utf8_to_markup(string):
559 """Entry_utf8_to_markup(string)""" 558 """Entry_utf8_to_markup(string)"""
560 if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
561 return _touni(elm_entry_utf8_to_markup( 559 return _touni(elm_entry_utf8_to_markup(
562 <const char *>string if string is not None else NULL)) 560 <const char *>string if string is not None else NULL))
563 561
564def markup_to_utf8(string): 562def markup_to_utf8(string):
565 if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
566 return _touni(elm_entry_markup_to_utf8( 563 return _touni(elm_entry_markup_to_utf8(
567 <const char *>string if string is not None else NULL)) 564 <const char *>string if string is not None else NULL))
568 565
569def utf8_to_markup(string): 566def utf8_to_markup(string):
570 if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
571 return _touni(elm_entry_utf8_to_markup( 567 return _touni(elm_entry_utf8_to_markup(
572 <const char *>string if string is not None else NULL)) 568 <const char *>string if string is not None else NULL))
573 569
@@ -669,7 +665,6 @@ cdef class FilterAcceptSet(object):
669 665
670 """ 666 """
671 def __set__(self, value): 667 def __set__(self, value):
672 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
673 self.fltr.accepted = value 668 self.fltr.accepted = value
674 669
675 def __get__(self): 670 def __get__(self):
@@ -682,7 +677,6 @@ cdef class FilterAcceptSet(object):
682 677
683 """ 678 """
684 def __set__(self, value): 679 def __set__(self, value):
685 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
686 self.fltr.rejected = value 680 self.fltr.rejected = value
687 681
688 def __get__(self): 682 def __get__(self):
@@ -820,7 +814,6 @@ cdef class Entry(LayoutClass):
820 .. versionadded:: 1.8 814 .. versionadded:: 1.8
821 815
822 """ 816 """
823 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
824 elm_entry_text_style_user_push(self.obj, 817 elm_entry_text_style_user_push(self.obj,
825 <const char *>style if style is not None else NULL) 818 <const char *>style if style is not None else NULL)
826 819
@@ -907,12 +900,10 @@ cdef class Entry(LayoutClass):
907 return _ctouni(elm_entry_entry_get(self.obj)) 900 return _ctouni(elm_entry_entry_get(self.obj))
908 901
909 def __set__(self, entry): 902 def __set__(self, entry):
910 if isinstance(entry, unicode): entry = PyUnicode_AsUTF8String(entry)
911 elm_entry_entry_set(self.obj, 903 elm_entry_entry_set(self.obj,
912 <const char *>entry if entry is not None else NULL) 904 <const char *>entry if entry is not None else NULL)
913 905
914 def entry_set(self, entry): 906 def entry_set(self, entry):
915 if isinstance(entry, unicode): entry = PyUnicode_AsUTF8String(entry)
916 elm_entry_entry_set(self.obj, 907 elm_entry_entry_set(self.obj,
917 <const char *>entry if entry is not None else NULL) 908 <const char *>entry if entry is not None else NULL)
918 def entry_get(self): 909 def entry_get(self):
@@ -933,7 +924,6 @@ cdef class Entry(LayoutClass):
933 :param string entry: The text to be displayed 924 :param string entry: The text to be displayed
934 925
935 """ 926 """
936 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
937 elm_entry_entry_append(self.obj, 927 elm_entry_entry_append(self.obj,
938 <const char *>text if text is not None else NULL) 928 <const char *>text if text is not None else NULL)
939 929
@@ -1033,7 +1023,6 @@ cdef class Entry(LayoutClass):
1033 :type entry: string 1023 :type entry: string
1034 1024
1035 """ 1025 """
1036 if isinstance(entry, unicode): entry = PyUnicode_AsUTF8String(entry)
1037 elm_entry_entry_insert(self.obj, 1026 elm_entry_entry_insert(self.obj,
1038 <const char *>entry if entry is not None else NULL) 1027 <const char *>entry if entry is not None else NULL)
1039 1028
@@ -1354,9 +1343,6 @@ cdef class Entry(LayoutClass):
1354 cb = _entry_context_menu_callback 1343 cb = _entry_context_menu_callback
1355 data = (func, args, kwargs) 1344 data = (func, args, kwargs)
1356 1345
1357 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
1358 if isinstance(icon_file, unicode): icon_file = PyUnicode_AsUTF8String(icon_file)
1359
1360 elm_entry_context_menu_item_add(self.obj, 1346 elm_entry_context_menu_item_add(self.obj,
1361 <const char *>label if label is not None else NULL, 1347 <const char *>label if label is not None else NULL,
1362 <const char *>icon_file if icon_file is not None else NULL, 1348 <const char *>icon_file if icon_file is not None else NULL,
@@ -1493,14 +1479,12 @@ cdef class Entry(LayoutClass):
1493 @DEPRECATED("1.8", "Use the module level markup_to_utf8() method instead.") 1479 @DEPRECATED("1.8", "Use the module level markup_to_utf8() method instead.")
1494 def markup_to_utf8(self, string): 1480 def markup_to_utf8(self, string):
1495 """markup_to_utf8(string)""" 1481 """markup_to_utf8(string)"""
1496 if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
1497 return _touni(elm_entry_markup_to_utf8( 1482 return _touni(elm_entry_markup_to_utf8(
1498 <const char *>string if string is not None else NULL)) 1483 <const char *>string if string is not None else NULL))
1499 1484
1500 @DEPRECATED("1.8", "Use the module level utf8_to_markup() method instead.") 1485 @DEPRECATED("1.8", "Use the module level utf8_to_markup() method instead.")
1501 def utf8_to_markup(self, string): 1486 def utf8_to_markup(self, string):
1502 """utf8_to_markup(string)""" 1487 """utf8_to_markup(string)"""
1503 if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
1504 return _touni(elm_entry_utf8_to_markup( 1488 return _touni(elm_entry_utf8_to_markup(
1505 <const char *>string if string is not None else NULL)) 1489 <const char *>string if string is not None else NULL))
1506 1490
@@ -1532,7 +1516,6 @@ cdef class Entry(LayoutClass):
1532 file_name, file_format = value 1516 file_name, file_format = value
1533 a1 = file_name 1517 a1 = file_name
1534 a2 = file_format 1518 a2 = file_format
1535 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
1536 if not elm_entry_file_set(self.obj, 1519 if not elm_entry_file_set(self.obj,
1537 <const char *>a1 if a1 is not None else NULL, 1520 <const char *>a1 if a1 is not None else NULL,
1538 a2 if a2 is not None else enums.ELM_TEXT_FORMAT_PLAIN_UTF8): 1521 a2 if a2 is not None else enums.ELM_TEXT_FORMAT_PLAIN_UTF8):
@@ -1541,7 +1524,6 @@ cdef class Entry(LayoutClass):
1541 def file_set(self, file_name, file_format): 1524 def file_set(self, file_name, file_format):
1542 a1 = file_name 1525 a1 = file_name
1543 a2 = file_format 1526 a2 = file_format
1544 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
1545 if not elm_entry_file_set(self.obj, 1527 if not elm_entry_file_set(self.obj,
1546 <const char *>a1 if a1 is not None else NULL, 1528 <const char *>a1 if a1 is not None else NULL,
1547 a2 if a2 is not None else enums.ELM_TEXT_FORMAT_PLAIN_UTF8): 1529 a2 if a2 is not None else enums.ELM_TEXT_FORMAT_PLAIN_UTF8):
@@ -2010,12 +1992,10 @@ cdef class Entry(LayoutClass):
2010 return _ctouni(elm_entry_anchor_hover_style_get(self.obj)) 1992 return _ctouni(elm_entry_anchor_hover_style_get(self.obj))
2011 1993
2012 def __set__(self, style): 1994 def __set__(self, style):
2013 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
2014 elm_entry_anchor_hover_style_set(self.obj, 1995 elm_entry_anchor_hover_style_set(self.obj,
2015 <const char *>style if style is not None else NULL) 1996 <const char *>style if style is not None else NULL)
2016 1997
2017 def anchor_hover_style_set(self, style): 1998 def anchor_hover_style_set(self, style):
2018 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
2019 elm_entry_anchor_hover_style_set(self.obj, 1999 elm_entry_anchor_hover_style_set(self.obj,
2020 <const char *>style if style is not None else NULL) 2000 <const char *>style if style is not None else NULL)
2021 def anchor_hover_style_get(self): 2001 def anchor_hover_style_get(self):
diff --git a/efl/elementary/fileselector.pyx b/efl/elementary/fileselector.pyx
index ceb79e4..b5bfde6 100644
--- a/efl/elementary/fileselector.pyx
+++ b/efl/elementary/fileselector.pyx
@@ -138,7 +138,7 @@ Fileselector sort method
138""" 138"""
139 139
140 140
141from cpython cimport PyUnicode_AsUTF8String, Py_INCREF 141from cpython cimport Py_INCREF
142from libc.stdint cimport uintptr_t 142from libc.stdint cimport uintptr_t
143 143
144from efl.eo cimport _object_mapping_register 144from efl.eo cimport _object_mapping_register
@@ -288,12 +288,10 @@ cdef class Fileselector(LayoutClass):
288 return _ctouni(elm_fileselector_path_get(self.obj)) 288 return _ctouni(elm_fileselector_path_get(self.obj))
289 289
290 def __set__(self, path): 290 def __set__(self, path):
291 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
292 elm_fileselector_path_set(self.obj, 291 elm_fileselector_path_set(self.obj,
293 <const char *>path if path is not None else NULL) 292 <const char *>path if path is not None else NULL)
294 293
295 def path_set(self, path): 294 def path_set(self, path):
296 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
297 elm_fileselector_path_set(self.obj, 295 elm_fileselector_path_set(self.obj,
298 <const char *>path if path is not None else NULL) 296 <const char *>path if path is not None else NULL)
299 def path_get(self): 297 def path_get(self):
@@ -383,13 +381,11 @@ cdef class Fileselector(LayoutClass):
383 return _ctouni(elm_fileselector_selected_get(self.obj)) 381 return _ctouni(elm_fileselector_selected_get(self.obj))
384 382
385 def __set__(self, path): 383 def __set__(self, path):
386 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
387 if not elm_fileselector_selected_set(self.obj, 384 if not elm_fileselector_selected_set(self.obj,
388 <const char *>path if path is not None else NULL): 385 <const char *>path if path is not None else NULL):
389 raise RuntimeError("Setting the selected path failed") 386 raise RuntimeError("Setting the selected path failed")
390 387
391 def selected_set(self, path): 388 def selected_set(self, path):
392 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
393 if not elm_fileselector_selected_set(self.obj, 389 if not elm_fileselector_selected_set(self.obj,
394 <const char *>path if path is not None else NULL): 390 <const char *>path if path is not None else NULL):
395 raise RuntimeError("Setting the selected path failed") 391 raise RuntimeError("Setting the selected path failed")
@@ -443,8 +439,6 @@ cdef class Fileselector(LayoutClass):
443 439
444 """ 440 """
445 mime_types_s = ",".join(mime_types) 441 mime_types_s = ",".join(mime_types)
446 if isinstance(mime_types_s, unicode): mime_types_s = PyUnicode_AsUTF8String(mime_types_s)
447 if isinstance(filter_name, unicode): filter_name = PyUnicode_AsUTF8String(filter_name)
448 if not elm_fileselector_mime_types_filter_append(self.obj, mime_types_s, 442 if not elm_fileselector_mime_types_filter_append(self.obj, mime_types_s,
449 <const char *>filter_name if filter_name is not None else NULL): 443 <const char *>filter_name if filter_name is not None else NULL):
450 raise RuntimeWarning 444 raise RuntimeWarning
@@ -474,7 +468,6 @@ cdef class Fileselector(LayoutClass):
474 # deleted in the remove method. 468 # deleted in the remove method.
475 Py_INCREF(cb_data) 469 Py_INCREF(cb_data)
476 470
477 if isinstance(filter_name, unicode): filter_name = PyUnicode_AsUTF8String(filter_name)
478 elm_fileselector_custom_filter_append(self.obj, 471 elm_fileselector_custom_filter_append(self.obj,
479 py_elm_fileselector_custom_filter_cb, <void *>cb_data, 472 py_elm_fileselector_custom_filter_cb, <void *>cb_data,
480 <const char *>filter_name if filter_name is not None else NULL) 473 <const char *>filter_name if filter_name is not None else NULL)
diff --git a/efl/elementary/fileselector_button.pyx b/efl/elementary/fileselector_button.pyx
index 82b633a..d0715ef 100644
--- a/efl/elementary/fileselector_button.pyx
+++ b/efl/elementary/fileselector_button.pyx
@@ -74,7 +74,6 @@ using multiple inheritance, for example::
74 74
75""" 75"""
76 76
77from cpython cimport PyUnicode_AsUTF8String
78from libc.stdint cimport uintptr_t 77from libc.stdint cimport uintptr_t
79 78
80from efl.eo cimport _object_mapping_register 79from efl.eo cimport _object_mapping_register
@@ -121,12 +120,10 @@ cdef class FileselectorButton(Button):
121 return _ctouni(elm_fileselector_button_window_title_get(self.obj)) 120 return _ctouni(elm_fileselector_button_window_title_get(self.obj))
122 121
123 def __set__(self, title): 122 def __set__(self, title):
124 if isinstance(title, unicode): title = PyUnicode_AsUTF8String(title)
125 elm_fileselector_button_window_title_set(self.obj, 123 elm_fileselector_button_window_title_set(self.obj,
126 <const char *>title if title is not None else NULL) 124 <const char *>title if title is not None else NULL)
127 125
128 def window_title_set(self, title): 126 def window_title_set(self, title):
129 if isinstance(title, unicode): title = PyUnicode_AsUTF8String(title)
130 elm_fileselector_button_window_title_set(self.obj, 127 elm_fileselector_button_window_title_set(self.obj,
131 <const char *>title if title is not None else NULL) 128 <const char *>title if title is not None else NULL)
132 def window_title_get(self): 129 def window_title_get(self):
@@ -201,7 +198,6 @@ cdef class FileselectorButton(Button):
201 198
202 @DEPRECATED("1.9", "Combine with Fileselector class instead") 199 @DEPRECATED("1.9", "Combine with Fileselector class instead")
203 def path_set(self, path): 200 def path_set(self, path):
204 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
205 elm_fileselector_path_set(self.obj, 201 elm_fileselector_path_set(self.obj,
206 <const char *>path if path is not None else NULL) 202 <const char *>path if path is not None else NULL)
207 @DEPRECATED("1.9", "Combine with Fileselector class instead") 203 @DEPRECATED("1.9", "Combine with Fileselector class instead")
diff --git a/efl/elementary/fileselector_entry.pyx b/efl/elementary/fileselector_entry.pyx
index 42a9bf7..d5e8110 100644
--- a/efl/elementary/fileselector_entry.pyx
+++ b/efl/elementary/fileselector_entry.pyx
@@ -90,7 +90,6 @@ using multiple inheritance, for example::
90 90
91""" 91"""
92 92
93from cpython cimport PyUnicode_AsUTF8String
94from libc.stdint cimport uintptr_t 93from libc.stdint cimport uintptr_t
95 94
96from efl.eo cimport _object_mapping_register 95from efl.eo cimport _object_mapping_register
@@ -142,12 +141,10 @@ cdef class FileselectorEntry(LayoutClass):
142 return _ctouni(elm_fileselector_entry_window_title_get(self.obj)) 141 return _ctouni(elm_fileselector_entry_window_title_get(self.obj))
143 142
144 def __set__(self, title): 143 def __set__(self, title):
145 if isinstance(title, unicode): title = PyUnicode_AsUTF8String(title)
146 elm_fileselector_entry_window_title_set(self.obj, 144 elm_fileselector_entry_window_title_set(self.obj,
147 <const char *>title if title is not None else NULL) 145 <const char *>title if title is not None else NULL)
148 146
149 def window_title_set(self, title): 147 def window_title_set(self, title):
150 if isinstance(title, unicode): title = PyUnicode_AsUTF8String(title)
151 elm_fileselector_entry_window_title_set(self.obj, 148 elm_fileselector_entry_window_title_set(self.obj,
152 <const char *>title if title is not None else NULL) 149 <const char *>title if title is not None else NULL)
153 def window_title_get(self): 150 def window_title_get(self):
@@ -222,7 +219,6 @@ cdef class FileselectorEntry(LayoutClass):
222 219
223 @DEPRECATED("1.9", "Combine with Fileselector class instead") 220 @DEPRECATED("1.9", "Combine with Fileselector class instead")
224 def path_set(self, path): 221 def path_set(self, path):
225 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
226 elm_fileselector_path_set(self.obj, 222 elm_fileselector_path_set(self.obj,
227 <const char *>path if path is not None else NULL) 223 <const char *>path if path is not None else NULL)
228 @DEPRECATED("1.9", "Combine with Fileselector class instead") 224 @DEPRECATED("1.9", "Combine with Fileselector class instead")
@@ -308,12 +304,10 @@ cdef class FileselectorEntry(LayoutClass):
308 return _ctouni(elm_fileselector_selected_get(self.obj)) 304 return _ctouni(elm_fileselector_selected_get(self.obj))
309 305
310 def __set__(self, path): 306 def __set__(self, path):
311 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
312 elm_fileselector_selected_set(self.obj, 307 elm_fileselector_selected_set(self.obj,
313 <const char *>path if path is not None else NULL) 308 <const char *>path if path is not None else NULL)
314 309
315 def selected_set(self, path): 310 def selected_set(self, path):
316 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
317 elm_fileselector_selected_set(self.obj, 311 elm_fileselector_selected_set(self.obj,
318 <const char *>path if path is not None else NULL) 312 <const char *>path if path is not None else NULL)
319 def selected_get(self): 313 def selected_get(self):
diff --git a/efl/elementary/flipselector.pyx b/efl/elementary/flipselector.pyx
index 15fee71..70ea1fc 100644
--- a/efl/elementary/flipselector.pyx
+++ b/efl/elementary/flipselector.pyx
@@ -56,7 +56,6 @@ Default text parts of the flipselector items that you can use for are:
56 56
57""" 57"""
58 58
59from cpython cimport PyUnicode_AsUTF8String
60from libc.stdint cimport uintptr_t 59from libc.stdint cimport uintptr_t
61 60
62from efl.eo cimport _object_mapping_register 61from efl.eo cimport _object_mapping_register
@@ -112,7 +111,6 @@ cdef class FlipSelectorItem(ObjectItem):
112 if not callable(callback): 111 if not callable(callback):
113 raise TypeError("callback is not callable") 112 raise TypeError("callback is not callable")
114 113
115 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
116 self.label = label 114 self.label = label
117 self.cb_func = callback 115 self.cb_func = callback
118 self.args = args 116 self.args = args
@@ -183,7 +181,6 @@ cdef class FlipSelectorItem(ObjectItem):
183 181
184 """ 182 """
185 def __set__(self, value): 183 def __set__(self, value):
186 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
187 self.label = value 184 self.label = value
188 185
189 def __get__(self): 186 def __get__(self):
@@ -279,8 +276,6 @@ cdef class FlipSelector(Object):
279 if callback is not None and callable(callback): 276 if callback is not None and callable(callback):
280 cb = _object_item_callback 277 cb = _object_item_callback
281 278
282 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
283
284 item = elm_flipselector_item_append(self.obj, 279 item = elm_flipselector_item_append(self.obj,
285 <const char *>label if label is not None else NULL, 280 <const char *>label if label is not None else NULL,
286 cb, <void*>ret) 281 cb, <void*>ret)
@@ -310,8 +305,6 @@ cdef class FlipSelector(Object):
310 if callback is not None and callable(callback): 305 if callback is not None and callable(callback):
311 cb = _object_item_callback 306 cb = _object_item_callback
312 307
313 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
314
315 item = elm_flipselector_item_prepend(self.obj, 308 item = elm_flipselector_item_prepend(self.obj,
316 <const char *>label if label is not None else NULL, 309 <const char *>label if label is not None else NULL,
317 cb, <void*>ret) 310 cb, <void*>ret)
diff --git a/efl/elementary/frame.pyx b/efl/elementary/frame.pyx
index e40ea2b..72d28df 100644
--- a/efl/elementary/frame.pyx
+++ b/efl/elementary/frame.pyx
@@ -53,8 +53,6 @@ Default text parts of the frame widget that you can use for are:
53 53
54""" 54"""
55 55
56from cpython cimport PyUnicode_AsUTF8String
57
58from efl.eo cimport _object_mapping_register 56from efl.eo cimport _object_mapping_register
59from efl.utils.conversions cimport _ctouni 57from efl.utils.conversions cimport _ctouni
60from efl.evas cimport Object as evasObject 58from efl.evas cimport Object as evasObject
diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index b30b155..5cd35ac 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -119,7 +119,7 @@ Possible values for the #ELM_POLICY_THROTTLE policy.
119 119
120""" 120"""
121 121
122from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyUnicode_AsUTF8String, \ 122from cpython cimport PyObject, Py_INCREF, Py_DECREF, \
123 PyMem_Malloc, PyMem_Free 123 PyMem_Malloc, PyMem_Free
124from libc.stdint cimport uintptr_t 124from libc.stdint cimport uintptr_t
125 125
@@ -162,7 +162,6 @@ cdef class FontProperties(object):
162 property name: 162 property name:
163 """:type: unicode""" 163 """:type: unicode"""
164 def __set__(self, value): 164 def __set__(self, value):
165 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
166 self.efp.name = value 165 self.efp.name = value
167 166
168 def __get__(self): 167 def __get__(self):
@@ -204,7 +203,6 @@ def init():
204 argv = <char **>PyMem_Malloc(argc * sizeof(char *)) 203 argv = <char **>PyMem_Malloc(argc * sizeof(char *))
205 for i in range(argc): 204 for i in range(argc):
206 t = sys.argv[i] 205 t = sys.argv[i]
207 if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
208 arg = t 206 arg = t
209 arg_len = len(arg) 207 arg_len = len(arg)
210 argv[i] = <char *>PyMem_Malloc(arg_len + 1) 208 argv[i] = <char *>PyMem_Malloc(arg_len + 1)
@@ -361,7 +359,6 @@ def language_set(lang not None):
361 :param lang: Language to set, must be the full name of the locale 359 :param lang: Language to set, must be the full name of the locale
362 360
363 """ 361 """
364 if isinstance(lang, unicode): lang = PyUnicode_AsUTF8String(lang)
365 elm_language_set(<const char *>lang) 362 elm_language_set(<const char *>lang)
366 363
367def cache_all_flush(): 364def cache_all_flush():
@@ -393,7 +390,6 @@ def font_properties_get(font not None):
393 .. versionadded:: 1.8 390 .. versionadded:: 1.8
394 391
395 """ 392 """
396 if isinstance(font, unicode): font = PyUnicode_AsUTF8String(font)
397 cdef FontProperties ret = FontProperties.__new__() 393 cdef FontProperties ret = FontProperties.__new__()
398 394
399 ret.efp = elm_font_properties_get(<const char *>font) 395 ret.efp = elm_font_properties_get(<const char *>font)
@@ -432,8 +428,6 @@ def font_fontconfig_name_get(font_name, style = None):
432 cdef: 428 cdef:
433 unicode ret 429 unicode ret
434 char *fc_name 430 char *fc_name
435 if isinstance(font_name, unicode): font_name = PyUnicode_AsUTF8String(font_name)
436 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
437 fc_name = elm_font_fontconfig_name_get( 431 fc_name = elm_font_fontconfig_name_get(
438 <const char *>font_name, 432 <const char *>font_name,
439 <const char *>style if style is not None else NULL 433 <const char *>style if style is not None else NULL
@@ -493,5 +487,4 @@ def object_tree_dot_dump(evasObject top, path):
493 .. versionadded:: 1.8 487 .. versionadded:: 1.8
494 488
495 """ 489 """
496 if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
497 elm_object_tree_dot_dump(top.obj, <const char *>path) 490 elm_object_tree_dot_dump(top.obj, <const char *>path)
diff --git a/efl/elementary/gengrid.pyx b/efl/elementary/gengrid.pyx
index 6138a13..07bdc9e 100644
--- a/efl/elementary/gengrid.pyx
+++ b/efl/elementary/gengrid.pyx
@@ -280,7 +280,7 @@ include "tooltips.pxi"
280 280
281from libc.string cimport strdup 281from libc.string cimport strdup
282from libc.stdint cimport uintptr_t 282from libc.stdint cimport uintptr_t
283from cpython cimport Py_INCREF, Py_DECREF, PyUnicode_AsUTF8String 283from cpython cimport Py_INCREF, Py_DECREF
284from efl.eo cimport object_from_instance, _object_mapping_register, PY_REFCOUNT 284from efl.eo cimport object_from_instance, _object_mapping_register, PY_REFCOUNT
285from efl.utils.conversions cimport _ctouni, _touni 285from efl.utils.conversions cimport _ctouni, _touni
286 286
@@ -324,7 +324,6 @@ cdef char *_py_elm_gengrid_item_text_get(void *data, Evas_Object *obj, const cha
324 return NULL 324 return NULL
325 325
326 if ret is not None: 326 if ret is not None:
327 if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret)
328 return strdup(ret) 327 return strdup(ret)
329 else: 328 else:
330 return NULL 329 return NULL
diff --git a/efl/elementary/gengrid_item.pxi b/efl/elementary/gengrid_item.pxi
index d8caa5a..7eb1cc2 100644
--- a/efl/elementary/gengrid_item.pxi
+++ b/efl/elementary/gengrid_item.pxi
@@ -322,13 +322,11 @@ cdef class GengridItem(ObjectItem):
322 322
323 """ 323 """
324 def __set__(self, text): 324 def __set__(self, text):
325 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
326 elm_gengrid_item_tooltip_text_set(self.item, 325 elm_gengrid_item_tooltip_text_set(self.item,
327 <const char *>text if text is not None else NULL) 326 <const char *>text if text is not None else NULL)
328 327
329 def tooltip_text_set(self, text): 328 def tooltip_text_set(self, text):
330 # TODO: document this 329 # TODO: document this
331 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
332 elm_gengrid_item_tooltip_text_set(self.item, 330 elm_gengrid_item_tooltip_text_set(self.item,
333 <const char *>text if text is not None else NULL) 331 <const char *>text if text is not None else NULL)
334 332
@@ -391,12 +389,10 @@ cdef class GengridItem(ObjectItem):
391 return _ctouni(elm_gengrid_item_tooltip_style_get(self.item)) 389 return _ctouni(elm_gengrid_item_tooltip_style_get(self.item))
392 390
393 def __set__(self, style): 391 def __set__(self, style):
394 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
395 elm_gengrid_item_tooltip_style_set(self.item, 392 elm_gengrid_item_tooltip_style_set(self.item,
396 <const char *>style if style is not None else NULL) 393 <const char *>style if style is not None else NULL)
397 394
398 def tooltip_style_set(self, style=None): 395 def tooltip_style_set(self, style=None):
399 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
400 elm_gengrid_item_tooltip_style_set(self.item, 396 elm_gengrid_item_tooltip_style_set(self.item,
401 <const char *>style if style is not None else NULL) 397 <const char *>style if style is not None else NULL)
402 def tooltip_style_get(self): 398 def tooltip_style_get(self):
@@ -425,7 +421,6 @@ cdef class GengridItem(ObjectItem):
425 return _ctouni(elm_gengrid_item_cursor_get(self.item)) 421 return _ctouni(elm_gengrid_item_cursor_get(self.item))
426 422
427 def __set__(self, cursor): 423 def __set__(self, cursor):
428 if isinstance(cursor, unicode): cursor = PyUnicode_AsUTF8String(cursor)
429 elm_gengrid_item_cursor_set(self.item, 424 elm_gengrid_item_cursor_set(self.item,
430 <const char *>cursor if cursor is not None else NULL) 425 <const char *>cursor if cursor is not None else NULL)
431 426
@@ -433,7 +428,6 @@ cdef class GengridItem(ObjectItem):
433 elm_gengrid_item_cursor_unset(self.item) 428 elm_gengrid_item_cursor_unset(self.item)
434 429
435 def cursor_set(self, cursor): 430 def cursor_set(self, cursor):
436 if isinstance(cursor, unicode): cursor = PyUnicode_AsUTF8String(cursor)
437 elm_gengrid_item_cursor_set(self.item, 431 elm_gengrid_item_cursor_set(self.item,
438 <const char *>cursor if cursor is not None else NULL) 432 <const char *>cursor if cursor is not None else NULL)
439 def cursor_get(self): 433 def cursor_get(self):
@@ -447,12 +441,10 @@ cdef class GengridItem(ObjectItem):
447 return _ctouni(elm_gengrid_item_cursor_style_get(self.item)) 441 return _ctouni(elm_gengrid_item_cursor_style_get(self.item))
448 442
449 def __set__(self, style): 443 def __set__(self, style):
450 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
451 elm_gengrid_item_cursor_style_set(self.item, 444 elm_gengrid_item_cursor_style_set(self.item,
452 <const char *>style if style is not None else NULL) 445 <const char *>style if style is not None else NULL)
453 446
454 def cursor_style_set(self, style=None): 447 def cursor_style_set(self, style=None):
455 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
456 elm_gengrid_item_cursor_style_set(self.item, 448 elm_gengrid_item_cursor_style_set(self.item,
457 <const char *>style if style is not None else NULL) 449 <const char *>style if style is not None else NULL)
458 def cursor_style_get(self): 450 def cursor_style_get(self):
diff --git a/efl/elementary/gengrid_item_class.pxi b/efl/elementary/gengrid_item_class.pxi
index 050cbf1..3c4ffb6 100644
--- a/efl/elementary/gengrid_item_class.pxi
+++ b/efl/elementary/gengrid_item_class.pxi
@@ -108,8 +108,6 @@ cdef class GengridItemClass:
108 pass 108 pass
109 109
110 if item_style is not None: 110 if item_style is not None:
111 if isinstance(item_style, unicode):
112 item_style = PyUnicode_AsUTF8String(item_style)
113 self._item_style = item_style 111 self._item_style = item_style
114 112
115 self.cls.item_style = <char *>self._item_style 113 self.cls.item_style = <char *>self._item_style
@@ -158,7 +156,6 @@ cdef class GengridItemClass:
158 return self._item_style.decode("UTF-8") 156 return self._item_style.decode("UTF-8")
159 157
160 def __set__(self, style): 158 def __set__(self, style):
161 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
162 self._item_style = style 159 self._item_style = style
163 self.cls.item_style = <char *>style if style is not None else NULL 160 self.cls.item_style = <char *>style if style is not None else NULL
164 161
diff --git a/efl/elementary/genlist.pyx b/efl/elementary/genlist.pyx
index 998f762..f106b0c 100644
--- a/efl/elementary/genlist.pyx
+++ b/efl/elementary/genlist.pyx
@@ -506,7 +506,7 @@ Selection modes
506 506
507include "tooltips.pxi" 507include "tooltips.pxi"
508 508
509from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF 509from cpython cimport Py_DECREF, Py_INCREF
510from libc.stdint cimport uintptr_t 510from libc.stdint cimport uintptr_t
511 511
512from efl.eo cimport _object_mapping_register, PY_REFCOUNT 512from efl.eo cimport _object_mapping_register, PY_REFCOUNT
@@ -591,7 +591,6 @@ cdef char *_py_elm_genlist_item_text_get(void *data, Evas_Object *obj, const cha
591 return NULL 591 return NULL
592 592
593 if ret is not None: 593 if ret is not None:
594 if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret)
595 return strdup(ret) 594 return strdup(ret)
596 else: 595 else:
597 return NULL 596 return NULL
diff --git a/efl/elementary/genlist_item.pxi b/efl/elementary/genlist_item.pxi
index fe7b749..8c4623e 100644
--- a/efl/elementary/genlist_item.pxi
+++ b/efl/elementary/genlist_item.pxi
@@ -410,7 +410,6 @@ cdef class GenlistItem(ObjectItem):
410 Internally, this method calls :py:func:`tooltip_content_cb_set` 410 Internally, this method calls :py:func:`tooltip_content_cb_set`
411 411
412 """ 412 """
413 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
414 elm_genlist_item_tooltip_text_set(self.item, 413 elm_genlist_item_tooltip_text_set(self.item,
415 <const char *>text if text is not None else NULL) 414 <const char *>text if text is not None else NULL)
416 415
@@ -470,7 +469,6 @@ cdef class GenlistItem(ObjectItem):
470 469
471 """ 470 """
472 def __set__(self, style): 471 def __set__(self, style):
473 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
474 elm_genlist_item_tooltip_style_set(self.item, 472 elm_genlist_item_tooltip_style_set(self.item,
475 <const char *>style if style is not None else NULL) 473 <const char *>style if style is not None else NULL)
476 474
@@ -478,7 +476,6 @@ cdef class GenlistItem(ObjectItem):
478 return _ctouni(elm_genlist_item_tooltip_style_get(self.item)) 476 return _ctouni(elm_genlist_item_tooltip_style_get(self.item))
479 477
480 def tooltip_style_set(self, style=None): 478 def tooltip_style_set(self, style=None):
481 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
482 elm_genlist_item_tooltip_style_set(self.item, 479 elm_genlist_item_tooltip_style_set(self.item,
483 <const char *>style if style is not None else NULL) 480 <const char *>style if style is not None else NULL)
484 def tooltip_style_get(self): 481 def tooltip_style_get(self):
@@ -515,7 +512,6 @@ cdef class GenlistItem(ObjectItem):
515 512
516 """ 513 """
517 def __set__(self, cursor): 514 def __set__(self, cursor):
518 if isinstance(cursor, unicode): cursor = PyUnicode_AsUTF8String(cursor)
519 elm_genlist_item_cursor_set(self.item, 515 elm_genlist_item_cursor_set(self.item,
520 <const char *>cursor if cursor is not None else NULL) 516 <const char *>cursor if cursor is not None else NULL)
521 517
@@ -526,7 +522,6 @@ cdef class GenlistItem(ObjectItem):
526 elm_genlist_item_cursor_unset(self.item) 522 elm_genlist_item_cursor_unset(self.item)
527 523
528 def cursor_set(self, cursor): 524 def cursor_set(self, cursor):
529 if isinstance(cursor, unicode): cursor = PyUnicode_AsUTF8String(cursor)
530 elm_genlist_item_cursor_set(self.item, 525 elm_genlist_item_cursor_set(self.item,
531 <const char *>cursor if cursor is not None else NULL) 526 <const char *>cursor if cursor is not None else NULL)
532 def cursor_get(self): 527 def cursor_get(self):
@@ -544,7 +539,6 @@ cdef class GenlistItem(ObjectItem):
544 539
545 """ 540 """
546 def __set__(self, style): 541 def __set__(self, style):
547 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
548 elm_genlist_item_cursor_style_set(self.item, 542 elm_genlist_item_cursor_style_set(self.item,
549 <const char *>style if style is not None else NULL) 543 <const char *>style if style is not None else NULL)
550 544
@@ -552,7 +546,6 @@ cdef class GenlistItem(ObjectItem):
552 return _ctouni(elm_genlist_item_cursor_style_get(self.item)) 546 return _ctouni(elm_genlist_item_cursor_style_get(self.item))
553 547
554 def cursor_style_set(self, style=None): 548 def cursor_style_set(self, style=None):
555 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
556 elm_genlist_item_cursor_style_set(self.item, 549 elm_genlist_item_cursor_style_set(self.item,
557 <const char *>style if style is not None else NULL) 550 <const char *>style if style is not None else NULL)
558 def cursor_style_get(self): 551 def cursor_style_get(self):
@@ -724,7 +717,6 @@ cdef class GenlistItem(ObjectItem):
724 .. seealso:: :py:func:`update()` 717 .. seealso:: :py:func:`update()`
725 718
726 """ 719 """
727 if isinstance(parts, unicode): parts = PyUnicode_AsUTF8String(parts)
728 elm_genlist_item_fields_update(self.item, 720 elm_genlist_item_fields_update(self.item,
729 <const char *>parts if parts is not None else NULL, 721 <const char *>parts if parts is not None else NULL,
730 itf) 722 itf)
@@ -774,7 +766,6 @@ cdef class GenlistItem(ObjectItem):
774 766
775 def decorate_mode_set(self, decorate_it_type, decorate_it_set): 767 def decorate_mode_set(self, decorate_it_type, decorate_it_set):
776 a1 = decorate_it_type 768 a1 = decorate_it_type
777 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
778 elm_genlist_item_decorate_mode_set(self.item, 769 elm_genlist_item_decorate_mode_set(self.item,
779 <const char *>a1 if a1 is not None else NULL, 770 <const char *>a1 if a1 is not None else NULL,
780 decorate_it_set) 771 decorate_it_set)
diff --git a/efl/elementary/genlist_item_class.pxi b/efl/elementary/genlist_item_class.pxi
index 584a8ee..a55f660 100644
--- a/efl/elementary/genlist_item_class.pxi
+++ b/efl/elementary/genlist_item_class.pxi
@@ -115,10 +115,6 @@ cdef class GenlistItemClass(object):
115 a2 = decorate_item_style 115 a2 = decorate_item_style
116 a3 = decorate_all_item_style 116 a3 = decorate_all_item_style
117 117
118 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
119 if isinstance(a2, unicode): a2 = PyUnicode_AsUTF8String(a2)
120 if isinstance(a3, unicode): a3 = PyUnicode_AsUTF8String(a3)
121
122 self._item_style = a1 118 self._item_style = a1
123 self._decorate_item_style = a2 119 self._decorate_item_style = a2
124 self._decorate_all_item_style = a3 120 self._decorate_all_item_style = a3
@@ -171,7 +167,6 @@ cdef class GenlistItemClass(object):
171 return self._item_style.decode("UTF-8") 167 return self._item_style.decode("UTF-8")
172 168
173 def __set__(self, style): 169 def __set__(self, style):
174 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
175 self._item_style = style 170 self._item_style = style
176 self.cls.item_style = <char *>style if style is not None else NULL 171 self.cls.item_style = <char *>style if style is not None else NULL
177 172
@@ -181,7 +176,6 @@ cdef class GenlistItemClass(object):
181 return self._decorate_item_style.decode("UTF-8") 176 return self._decorate_item_style.decode("UTF-8")
182 177
183 def __set__(self, style): 178 def __set__(self, style):
184 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
185 self._decorate_item_style = style 179 self._decorate_item_style = style
186 self.cls.decorate_item_style = <char *>style if style is not None else NULL 180 self.cls.decorate_item_style = <char *>style if style is not None else NULL
187 181
@@ -191,7 +185,6 @@ cdef class GenlistItemClass(object):
191 return self._decorate_all_item_style.decode("UTF-8") 185 return self._decorate_all_item_style.decode("UTF-8")
192 186
193 def __set__(self, style): 187 def __set__(self, style):
194 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
195 self._decorate_all_item_style = style 188 self._decorate_all_item_style = style
196 self.cls.decorate_all_item_style = <char *>style if style is not None else NULL 189 self.cls.decorate_all_item_style = <char *>style if style is not None else NULL
197 190
diff --git a/efl/elementary/gesture_layer.pyx b/efl/elementary/gesture_layer.pyx
index 5b123f4..2c57b33 100644
--- a/efl/elementary/gesture_layer.pyx
+++ b/efl/elementary/gesture_layer.pyx
@@ -157,7 +157,7 @@ Gesture types
157 157
158""" 158"""
159 159
160from cpython cimport PyUnicode_AsUTF8String, Py_INCREF 160from cpython cimport Py_INCREF
161 161
162from efl.eo cimport _object_mapping_register 162from efl.eo cimport _object_mapping_register
163from efl.utils.conversions cimport _ctouni 163from efl.utils.conversions cimport _ctouni
diff --git a/efl/elementary/hover.pyx b/efl/elementary/hover.pyx
index b43004e..9f8f261 100644
--- a/efl/elementary/hover.pyx
+++ b/efl/elementary/hover.pyx
@@ -112,8 +112,6 @@ Hover axis
112 112
113""" 113"""
114 114
115from cpython cimport PyUnicode_AsUTF8String
116
117from efl.eo cimport _object_mapping_register, object_from_instance 115from efl.eo cimport _object_mapping_register, object_from_instance
118from efl.utils.conversions cimport _ctouni 116from efl.utils.conversions cimport _ctouni
119from efl.evas cimport Object as evasObject 117from efl.evas cimport Object as evasObject
diff --git a/efl/elementary/hoversel.pyx b/efl/elementary/hoversel.pyx
index 2c9ca98..2eb42b1 100644
--- a/efl/elementary/hoversel.pyx
+++ b/efl/elementary/hoversel.pyx
@@ -73,7 +73,7 @@ Icon types
73 73
74""" 74"""
75 75
76from cpython cimport PyUnicode_AsUTF8String, Py_DECREF 76from cpython cimport Py_DECREF
77from libc.stdint cimport uintptr_t 77from libc.stdint cimport uintptr_t
78 78
79from efl.eo cimport _object_mapping_register, object_from_instance 79from efl.eo cimport _object_mapping_register, object_from_instance
@@ -122,8 +122,6 @@ cdef class HoverselItem(ObjectItem):
122 :type callback: function 122 :type callback: function
123 123
124 """ 124 """
125 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
126 if isinstance(icon_file, unicode): icon_file = PyUnicode_AsUTF8String(icon_file)
127 self.label = label 125 self.label = label
128 self.icon_file = icon_file 126 self.icon_file = icon_file
129 self.icon_type = icon_type 127 self.icon_type = icon_type
@@ -181,8 +179,6 @@ cdef class HoverselItem(ObjectItem):
181 def __set__(self, value): 179 def __set__(self, value):
182 icon_file, icon_group, icon_type = value 180 icon_file, icon_group, icon_type = value
183 a1, a2, a3 = icon_file, icon_group, icon_type 181 a1, a2, a3 = icon_file, icon_group, icon_type
184 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
185 if isinstance(a2, unicode): a2 = PyUnicode_AsUTF8String(a2)
186 if self.item == NULL: 182 if self.item == NULL:
187 self.icon_file = a1 183 self.icon_file = a1
188 self.icon_group = a2 184 self.icon_group = a2
@@ -210,8 +206,6 @@ cdef class HoverselItem(ObjectItem):
210 206
211 def icon_set(self, icon_file, icon_group, icon_type): 207 def icon_set(self, icon_file, icon_group, icon_type):
212 a1, a2, a3 = icon_file, icon_group, icon_type 208 a1, a2, a3 = icon_file, icon_group, icon_type
213 if isinstance(a1, unicode): a1 = PyUnicode_AsUTF8String(a1)
214 if isinstance(a2, unicode): a2 = PyUnicode_AsUTF8String(a2)
215 if self.item == NULL: 209 if self.item == NULL:
216 self.icon_file = a1 210 self.icon_file = a1
217 self.icon_group = a2 211 self.icon_group = a2
@@ -353,9 +347,6 @@ cdef class Hoversel(Button):
353 if callback is not None and callable(callback): 347 if callback is not None and callable(callback):
354 cb = _object_item_callback 348 cb = _object_item_callback
355 349
356 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
357 if isinstance(icon_file, unicode): icon_file = PyUnicode_AsUTF8String(icon_file)
358
359 item = elm_hoversel_item_add(self.obj, 350 item = elm_hoversel_item_add(self.obj,
360 <const char *>label if label is not None else NULL, 351 <const char *>label if label is not None else NULL,
361 <const char *>icon_file if icon_file is not None else NULL, 352 <const char *>icon_file if icon_file is not None else NULL,
diff --git a/efl/elementary/icon.pyx b/efl/elementary/icon.pyx
index 5f888b2..be14d34 100644
--- a/efl/elementary/icon.pyx
+++ b/efl/elementary/icon.pyx
@@ -141,8 +141,6 @@ Icon type
141 141
142""" 142"""
143 143
144from cpython cimport PyUnicode_AsUTF8String
145
146from efl.eo cimport _object_mapping_register 144from efl.eo cimport _object_mapping_register
147from efl.utils.conversions cimport _ctouni 145from efl.utils.conversions cimport _ctouni
148from efl.evas cimport Object as evasObject 146from efl.evas cimport Object as evasObject
@@ -185,15 +183,11 @@ cdef class Icon(Image):
185 else: 183 else:
186 filename = value 184 filename = value
187 group = None 185 group = None
188 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
189 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
190 elm_icon_thumb_set(self.obj, 186 elm_icon_thumb_set(self.obj,
191 <const char *>filename if filename is not None else NULL, 187 <const char *>filename if filename is not None else NULL,
192 <const char *>group if group is not None else NULL) 188 <const char *>group if group is not None else NULL)
193 189
194 def thumb_set(self, filename, group = None): 190 def thumb_set(self, filename, group = None):
195 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
196 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
197 elm_icon_thumb_set(self.obj, 191 elm_icon_thumb_set(self.obj,
198 <const char *>filename if filename is not None else NULL, 192 <const char *>filename if filename is not None else NULL,
199 <const char *>group if group is not None else NULL) 193 <const char *>group if group is not None else NULL)
@@ -232,13 +226,11 @@ cdef class Icon(Image):
232 return _ctouni(elm_icon_standard_get(self.obj)) 226 return _ctouni(elm_icon_standard_get(self.obj))
233 227
234 def __set__(self, name): 228 def __set__(self, name):
235 if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
236 if not elm_icon_standard_set(self.obj, 229 if not elm_icon_standard_set(self.obj,
237 <const char *>name if name is not None else NULL): 230 <const char *>name if name is not None else NULL):
238 raise RuntimeWarning("Setting standard icon failed") 231 raise RuntimeWarning("Setting standard icon failed")
239 232
240 def standard_set(self, name): 233 def standard_set(self, name):
241 if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
242 return elm_icon_standard_set(self.obj, 234 return elm_icon_standard_set(self.obj,
243 <const char *>name if name is not None else NULL) 235 <const char *>name if name is not None else NULL)
244 def standard_get(self): 236 def standard_get(self):
diff --git a/efl/elementary/image.pyx b/efl/elementary/image.pyx
index 0183091..6fcc2bd 100644
--- a/efl/elementary/image.pyx
+++ b/efl/elementary/image.pyx
@@ -94,7 +94,6 @@ Image manipulation types
94 94
95""" 95"""
96 96
97from cpython cimport PyUnicode_AsUTF8String
98from libc.stdint cimport uintptr_t 97from libc.stdint cimport uintptr_t
99 98
100from efl.eo cimport _object_mapping_register, object_from_instance 99from efl.eo cimport _object_mapping_register, object_from_instance
@@ -198,8 +197,6 @@ cdef class Image(Object):
198 else: 197 else:
199 filename = value 198 filename = value
200 group = None 199 group = None
201 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
202 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
203 if not elm_image_file_set(self.obj, 200 if not elm_image_file_set(self.obj,
204 <const char *>filename if filename is not None else NULL, 201 <const char *>filename if filename is not None else NULL,
205 <const char *>group if group is not None else NULL): 202 <const char *>group if group is not None else NULL):
@@ -214,8 +211,6 @@ cdef class Image(Object):
214 return (_ctouni(filename), _ctouni(group)) 211 return (_ctouni(filename), _ctouni(group))
215 212
216 def file_set(self, filename, group = None): 213 def file_set(self, filename, group = None):
217 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
218 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
219 if not elm_image_file_set(self.obj, 214 if not elm_image_file_set(self.obj,
220 <const char *>filename if filename is not None else NULL, 215 <const char *>filename if filename is not None else NULL,
221 <const char *>group if group is not None else NULL): 216 <const char *>group if group is not None else NULL):
diff --git a/efl/elementary/index.pyx b/efl/elementary/index.pyx
index 1965e64..152b3c1 100644
--- a/efl/elementary/index.pyx
+++ b/efl/elementary/index.pyx
@@ -65,7 +65,7 @@ actually be reported.
65 65
66""" 66"""
67 67
68from cpython cimport PyUnicode_AsUTF8String, Py_DECREF 68from cpython cimport Py_DECREF
69from libc.stdint cimport uintptr_t 69from libc.stdint cimport uintptr_t
70 70
71from efl.eo cimport _object_mapping_register 71from efl.eo cimport _object_mapping_register
@@ -161,7 +161,6 @@ cdef class IndexItem(ObjectItem):
161 if not callable(callback): 161 if not callable(callback):
162 raise TypeError("callback is not callable") 162 raise TypeError("callback is not callable")
163 163
164 if isinstance(letter, unicode): letter = PyUnicode_AsUTF8String(letter)
165 self.letter = letter 164 self.letter = letter
166 165
167 self.cb_func = callback 166 self.cb_func = callback
diff --git a/efl/elementary/label.pyx b/efl/elementary/label.pyx
index 033d64b..994851a 100644
--- a/efl/elementary/label.pyx
+++ b/efl/elementary/label.pyx
@@ -95,8 +95,6 @@ Slide modes
95 95
96""" 96"""
97 97
98from cpython cimport PyUnicode_AsUTF8String
99
100from efl.eo cimport _object_mapping_register 98from efl.eo cimport _object_mapping_register
101from efl.utils.conversions cimport _ctouni 99from efl.utils.conversions cimport _ctouni
102from efl.evas cimport Object as evasObject 100from efl.evas cimport Object as evasObject
diff --git a/efl/elementary/layout.pyx b/efl/elementary/layout.pyx
index de6978f..54153fd 100644
--- a/efl/elementary/layout.pyx
+++ b/efl/elementary/layout.pyx
@@ -137,8 +137,6 @@ This widget emits the following signals:
137 137
138""" 138"""
139 139
140from cpython cimport PyUnicode_AsUTF8String
141
142from efl.eo cimport _object_mapping_register, object_from_instance 140from efl.eo cimport _object_mapping_register, object_from_instance
143from efl.utils.conversions cimport _ctouni 141from efl.utils.conversions cimport _ctouni
144from efl.evas cimport Object as evasObject 142from efl.evas cimport Object as evasObject
diff --git a/efl/elementary/layout_class.pyx b/efl/elementary/layout_class.pyx
index 1e7b51e..f17911e 100644
--- a/efl/elementary/layout_class.pyx
+++ b/efl/elementary/layout_class.pyx
@@ -15,9 +15,6 @@
15# You should have received a copy of the GNU Lesser General Public License 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/>. 16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17 17
18
19from cpython cimport PyUnicode_AsUTF8String
20
21from efl.eo cimport object_from_instance 18from efl.eo cimport object_from_instance
22from efl.utils.conversions cimport _ctouni 19from efl.utils.conversions cimport _ctouni
23from efl.evas cimport Object as evasObject, eina_list_free 20from efl.evas cimport Object as evasObject, eina_list_free
@@ -91,7 +88,6 @@ cdef class LayoutClass(Object):
91 if content is None: 88 if content is None:
92 content = swallow 89 content = swallow
93 swallow = None 90 swallow = None
94 if isinstance(swallow, unicode): swallow = PyUnicode_AsUTF8String(swallow)
95 if not elm_layout_content_set(self.obj, 91 if not elm_layout_content_set(self.obj,
96 <const char *>swallow if swallow is not None else NULL, 92 <const char *>swallow if swallow is not None else NULL,
97 content.obj if content is not None else NULL): 93 content.obj if content is not None else NULL):
@@ -108,7 +104,6 @@ cdef class LayoutClass(Object):
108 :return: The swallowed object or None if none or an error occurred 104 :return: The swallowed object or None if none or an error occurred
109 105
110 """ 106 """
111 if isinstance(swallow, unicode): swallow = PyUnicode_AsUTF8String(swallow)
112 return object_from_instance(elm_layout_content_get(self.obj, 107 return object_from_instance(elm_layout_content_get(self.obj,
113 <const char *>swallow if swallow is not None else NULL)) 108 <const char *>swallow if swallow is not None else NULL))
114 109
@@ -125,7 +120,6 @@ cdef class LayoutClass(Object):
125 :rtype: :py:class:`~efl.evas.Object` 120 :rtype: :py:class:`~efl.evas.Object`
126 121
127 """ 122 """
128 if isinstance(swallow, unicode): swallow = PyUnicode_AsUTF8String(swallow)
129 return object_from_instance(elm_layout_content_unset(self.obj, 123 return object_from_instance(elm_layout_content_unset(self.obj,
130 <const char *>swallow if swallow is not None else NULL)) 124 <const char *>swallow if swallow is not None else NULL))
131 125
@@ -143,8 +137,6 @@ cdef class LayoutClass(Object):
143 Raises RuntimeError if setting the text fails 137 Raises RuntimeError if setting the text fails
144 138
145 """ 139 """
146 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
147 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
148 if text is None: 140 if text is None:
149 # In this case we're guessing the user wants the only arg used 141 # In this case we're guessing the user wants the only arg used
150 # as text 142 # as text
@@ -168,7 +160,6 @@ cdef class LayoutClass(Object):
168 160
169 """ 161 """
170 # With part=None it should do the same as elm_object_text_get 162 # With part=None it should do the same as elm_object_text_get
171 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
172 return _ctouni(elm_layout_text_get(self.obj, 163 return _ctouni(elm_layout_text_get(self.obj,
173 <const char *>part if part is not None else NULL)) 164 <const char *>part if part is not None else NULL))
174 165
@@ -185,16 +176,12 @@ cdef class LayoutClass(Object):
185 """ 176 """
186 def __set__(self, value): 177 def __set__(self, value):
187 filename, group = value 178 filename, group = value
188 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
189 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
190 if not elm_layout_file_set(self.obj, 179 if not elm_layout_file_set(self.obj,
191 <const char *>filename if filename is not None else NULL, 180 <const char *>filename if filename is not None else NULL,
192 <const char *>group if group is not None else NULL): 181 <const char *>group if group is not None else NULL):
193 raise RuntimeError("Could not set file.") 182 raise RuntimeError("Could not set file.")
194 183
195 def file_set(self, filename, group = None): 184 def file_set(self, filename, group = None):
196 if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
197 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
198 if not elm_layout_file_set(self.obj, 185 if not elm_layout_file_set(self.obj,
199 <const char *>filename if filename is not None else NULL, 186 <const char *>filename if filename is not None else NULL,
200 <const char *>group if group is not None else NULL): 187 <const char *>group if group is not None else NULL):
@@ -249,9 +236,6 @@ cdef class LayoutClass(Object):
249 """ 236 """
250 def __set__(self, theme): 237 def __set__(self, theme):
251 clas, group, style = theme 238 clas, group, style = theme
252 if isinstance(clas, unicode): clas = PyUnicode_AsUTF8String(clas)
253 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
254 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
255 if not elm_layout_theme_set(self.obj, 239 if not elm_layout_theme_set(self.obj,
256 <const char *>clas if clas is not None else NULL, 240 <const char *>clas if clas is not None else NULL,
257 <const char *>group if group is not None else NULL, 241 <const char *>group if group is not None else NULL,
@@ -259,9 +243,6 @@ cdef class LayoutClass(Object):
259 raise RuntimeError("Could not set theme.") 243 raise RuntimeError("Could not set theme.")
260 244
261 def theme_set(self, clas, group, style): 245 def theme_set(self, clas, group, style):
262 if isinstance(clas, unicode): clas = PyUnicode_AsUTF8String(clas)
263 if isinstance(group, unicode): group = PyUnicode_AsUTF8String(group)
264 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
265 if not elm_layout_theme_set(self.obj, 246 if not elm_layout_theme_set(self.obj,
266 <const char *>clas if clas is not None else NULL, 247 <const char *>clas if clas is not None else NULL,
267 <const char *>group if group is not None else NULL, 248 <const char *>group if group is not None else NULL,
@@ -284,8 +265,6 @@ cdef class LayoutClass(Object):
284 :type source: string 265 :type source: string
285 266
286 """ 267 """
287 if isinstance(emission, unicode): emission = PyUnicode_AsUTF8String(emission)
288 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
289 elm_layout_signal_emit(self.obj, 268 elm_layout_signal_emit(self.obj,
290 <const char *>emission if emission is not None else NULL, 269 <const char *>emission if emission is not None else NULL,
291 <const char *>source if source is not None else NULL) 270 <const char *>source if source is not None else NULL)
@@ -314,8 +293,6 @@ cdef class LayoutClass(Object):
314 d = self._elm_layout_signal_cbs.setdefault(emission, {}) 293 d = self._elm_layout_signal_cbs.setdefault(emission, {})
315 lst = d.setdefault(source, []) 294 lst = d.setdefault(source, [])
316 if not lst: 295 if not lst:
317 if isinstance(emission, unicode): emission = PyUnicode_AsUTF8String(emission)
318 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
319 elm_layout_signal_callback_add(self.obj, 296 elm_layout_signal_callback_add(self.obj,
320 <const char *>emission if emission is not None else NULL, 297 <const char *>emission if emission is not None else NULL,
321 <const char *>source if source is not None else NULL, 298 <const char *>source if source is not None else NULL,
@@ -363,8 +340,6 @@ cdef class LayoutClass(Object):
363 d.pop(source) 340 d.pop(source)
364 if not d: 341 if not d:
365 self._elm_layout_signal_cbs.pop(emission) 342 self._elm_layout_signal_cbs.pop(emission)
366 if isinstance(emission, unicode): emission = PyUnicode_AsUTF8String(emission)
367 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
368 elm_layout_signal_callback_del(self.obj, 343 elm_layout_signal_callback_del(self.obj,
369 <const char *>emission if emission is not None else NULL, 344 <const char *>emission if emission is not None else NULL,
370 <const char *>source if source is not None else NULL, 345 <const char *>source if source is not None else NULL,
@@ -397,7 +372,6 @@ cdef class LayoutClass(Object):
397 Raises RuntimeError if adding the child fails 372 Raises RuntimeError if adding the child fails
398 373
399 """ 374 """
400 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
401 if not elm_layout_box_append(self.obj, 375 if not elm_layout_box_append(self.obj,
402 <const char *>part if part is not None else NULL, 376 <const char *>part if part is not None else NULL,
403 child.obj): 377 child.obj):
@@ -430,7 +404,6 @@ cdef class LayoutClass(Object):
430 Raises RuntimeError if adding the child fails 404 Raises RuntimeError if adding the child fails
431 405
432 """ 406 """
433 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
434 if not elm_layout_box_prepend(self.obj, 407 if not elm_layout_box_prepend(self.obj,
435 <const char *>part if part is not None else NULL, 408 <const char *>part if part is not None else NULL,
436 child.obj): 409 child.obj):
@@ -465,7 +438,6 @@ cdef class LayoutClass(Object):
465 Raises RuntimeError if adding the child fails 438 Raises RuntimeError if adding the child fails
466 439
467 """ 440 """
468 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
469 if not elm_layout_box_insert_before(self.obj, 441 if not elm_layout_box_insert_before(self.obj,
470 <const char *>part if part is not None else NULL, 442 <const char *>part if part is not None else NULL,
471 child.obj, reference.obj): 443 child.obj, reference.obj):
@@ -500,7 +472,6 @@ cdef class LayoutClass(Object):
500 Raises RuntimeError if adding the child fails 472 Raises RuntimeError if adding the child fails
501 473
502 """ 474 """
503 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
504 if not elm_layout_box_insert_at(self.obj, 475 if not elm_layout_box_insert_at(self.obj,
505 <const char *>part if part is not None else NULL, 476 <const char *>part if part is not None else NULL,
506 child.obj, pos): 477 child.obj, pos):
@@ -528,7 +499,6 @@ cdef class LayoutClass(Object):
528 :rtype: :py:class:`~efl.evas.Object` 499 :rtype: :py:class:`~efl.evas.Object`
529 500
530 """ 501 """
531 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
532 return object_from_instance(elm_layout_box_remove(self.obj, 502 return object_from_instance(elm_layout_box_remove(self.obj,
533 <const char *>part if part is not None else NULL, 503 <const char *>part if part is not None else NULL,
534 child.obj)) 504 child.obj))
@@ -559,7 +529,6 @@ cdef class LayoutClass(Object):
559 Raises RuntimeError if removing the children fails 529 Raises RuntimeError if removing the children fails
560 530
561 """ 531 """
562 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
563 if not elm_layout_box_remove_all(self.obj, 532 if not elm_layout_box_remove_all(self.obj,
564 <const char *>part if part is not None else NULL, 533 <const char *>part if part is not None else NULL,
565 clear): 534 clear):
@@ -602,7 +571,6 @@ cdef class LayoutClass(Object):
602 Raises RuntimeError if adding the child fails 571 Raises RuntimeError if adding the child fails
603 572
604 """ 573 """
605 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
606 if not elm_layout_table_pack(self.obj, 574 if not elm_layout_table_pack(self.obj,
607 <const char *>part if part is not None else NULL, 575 <const char *>part if part is not None else NULL,
608 child_obj.obj, col, row, colspan, rowspan): 576 child_obj.obj, col, row, colspan, rowspan):
@@ -630,7 +598,6 @@ cdef class LayoutClass(Object):
630 :rtype: :py:class:`~efl.evas.Object` 598 :rtype: :py:class:`~efl.evas.Object`
631 599
632 """ 600 """
633 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
634 return object_from_instance(elm_layout_table_unpack(self.obj, 601 return object_from_instance(elm_layout_table_unpack(self.obj,
635 <const char *>part if part is not None else NULL, 602 <const char *>part if part is not None else NULL,
636 child_obj.obj)) 603 child_obj.obj))
@@ -661,7 +628,6 @@ cdef class LayoutClass(Object):
661 Raises RuntimeError if clearing the table fails 628 Raises RuntimeError if clearing the table fails
662 629
663 """ 630 """
664 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
665 if not elm_layout_table_clear(self.obj, 631 if not elm_layout_table_clear(self.obj,
666 <const char *>part if part is not None else NULL, 632 <const char *>part if part is not None else NULL,
667 clear): 633 clear):
@@ -726,7 +692,6 @@ cdef class LayoutClass(Object):
726 :rtype: string 692 :rtype: string
727 693
728 """ 694 """
729 if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key)
730 return _ctouni(elm_layout_data_get(self.obj, 695 return _ctouni(elm_layout_data_get(self.obj,
731 <const char *>key if key is not None else NULL)) 696 <const char *>key if key is not None else NULL))
732 697
@@ -769,8 +734,6 @@ cdef class LayoutClass(Object):
769 Raises RuntimeError if setting the cursor fails 734 Raises RuntimeError if setting the cursor fails
770 735
771 """ 736 """
772 if isinstance(part_name, unicode): part_name = PyUnicode_AsUTF8String(part_name)
773 if isinstance(cursor, unicode): cursor = PyUnicode_AsUTF8String(cursor)
774 if not elm_layout_part_cursor_set(self.obj, 737 if not elm_layout_part_cursor_set(self.obj,
775 <const char *>part_name if part_name is not None else NULL, 738 <const char *>part_name if part_name is not None else NULL,
776 <const char *>cursor if cursor is not None else NULL): 739 <const char *>cursor if cursor is not None else NULL):
@@ -787,7 +750,6 @@ cdef class LayoutClass(Object):
787 :rtype: string 750 :rtype: string
788 751
789 """ 752 """
790 if isinstance(part_name, unicode): part_name = PyUnicode_AsUTF8String(part_name)
791 return _ctouni(elm_layout_part_cursor_get(self.obj, 753 return _ctouni(elm_layout_part_cursor_get(self.obj,
792 <const char *>part_name if part_name is not None else NULL)) 754 <const char *>part_name if part_name is not None else NULL))
793 755
@@ -806,7 +768,6 @@ cdef class LayoutClass(Object):
806 Raises RuntimeError if unsetting the cursor fails 768 Raises RuntimeError if unsetting the cursor fails
807 769
808 """ 770 """
809 if isinstance(part_name, unicode): part_name = PyUnicode_AsUTF8String(part_name)
810 if not elm_layout_part_cursor_unset(self.obj, 771 if not elm_layout_part_cursor_unset(self.obj,
811 <const char *>part_name if part_name is not None else NULL): 772 <const char *>part_name if part_name is not None else NULL):
812 raise RuntimeError("Could not unset part cursor") 773 raise RuntimeError("Could not unset part cursor")
@@ -827,8 +788,6 @@ cdef class LayoutClass(Object):
827 Raises RuntimeError if setting the cursor style fails 788 Raises RuntimeError if setting the cursor style fails
828 789
829 """ 790 """
830 if isinstance(part_name, unicode): part_name = PyUnicode_AsUTF8String(part_name)
831 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
832 if not elm_layout_part_cursor_style_set(self.obj, 791 if not elm_layout_part_cursor_style_set(self.obj,
833 <const char *>part_name if part_name is not None else NULL, 792 <const char *>part_name if part_name is not None else NULL,
834 <const char *>style if style is not None else NULL): 793 <const char *>style if style is not None else NULL):
@@ -847,7 +806,6 @@ cdef class LayoutClass(Object):
847 :rtype: string 806 :rtype: string
848 807
849 """ 808 """
850 if isinstance(part_name, unicode): part_name = PyUnicode_AsUTF8String(part_name)
851 return _ctouni(elm_layout_part_cursor_style_get(self.obj, 809 return _ctouni(elm_layout_part_cursor_style_get(self.obj,
852 <const char *>part_name if part_name is not None else NULL)) 810 <const char *>part_name if part_name is not None else NULL))
853 811
@@ -878,7 +836,6 @@ cdef class LayoutClass(Object):
878 Raises RuntimeError if setting the value fails 836 Raises RuntimeError if setting the value fails
879 837
880 """ 838 """
881 if isinstance(part_name, unicode): part_name = PyUnicode_AsUTF8String(part_name)
882 if not elm_layout_part_cursor_engine_only_set(self.obj, 839 if not elm_layout_part_cursor_engine_only_set(self.obj,
883 <const char *>part_name if part_name is not None else NULL, 840 <const char *>part_name if part_name is not None else NULL,
884 engine_only): 841 engine_only):
@@ -896,7 +853,6 @@ cdef class LayoutClass(Object):
896 :rtype: bool 853 :rtype: bool
897 854
898 """ 855 """
899 if isinstance(part_name, unicode): part_name = PyUnicode_AsUTF8String(part_name)
900 return bool(elm_layout_part_cursor_engine_only_get(self.obj, 856 return bool(elm_layout_part_cursor_engine_only_get(self.obj,
901 <const char *>part_name if part_name is not None else NULL)) 857 <const char *>part_name if part_name is not None else NULL))
902 858
@@ -934,7 +890,7 @@ cdef class LayoutClass(Object):
934 :rtype: list of objects. 890 :rtype: list of objects.
935 891
936 .. versionadded:: 1.9 892 .. versionadded:: 1.9
937 893
938 """ 894 """
939 cdef: 895 cdef:
940 Eina_List *l = elm_layout_content_swallow_list_get(self.obj) 896 Eina_List *l = elm_layout_content_swallow_list_get(self.obj)
diff --git a/efl/elementary/list.pyx b/efl/elementary/list.pyx
index d7aa85c..d779184 100644
--- a/efl/elementary/list.pyx
+++ b/efl/elementary/list.pyx
@@ -158,7 +158,7 @@ Selection modes
158 158
159""" 159"""
160 160
161from cpython cimport PyUnicode_AsUTF8String, Py_DECREF 161from cpython cimport Py_DECREF
162from libc.stdint cimport uintptr_t 162from libc.stdint cimport uintptr_t
163 163
164from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT 164from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT
@@ -217,7 +217,6 @@ cdef class ListItem(ObjectItem):
217 :param cb_data: An object associated with the callback. 217 :param cb_data: An object associated with the callback.
218 218
219 """ 219 """
220 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
221 self.label = label 220 self.label = label
222 221
223 if icon is not None: 222 if icon is not None:
@@ -718,8 +717,6 @@ cdef class List(Object):
718 717
719 cb = _object_item_callback 718 cb = _object_item_callback
720 719
721 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
722
723 item = elm_list_item_append(self.obj, 720 item = elm_list_item_append(self.obj,
724 <const char *>label if label is not None else NULL, 721 <const char *>label if label is not None else NULL,
725 icon.obj if icon is not None else NULL, 722 icon.obj if icon is not None else NULL,
@@ -748,8 +745,6 @@ cdef class List(Object):
748 745
749 cb = _object_item_callback 746 cb = _object_item_callback
750 747
751 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
752
753 item = elm_list_item_prepend(self.obj, 748 item = elm_list_item_prepend(self.obj,
754 <const char *>label if label is not None else NULL, 749 <const char *>label if label is not None else NULL,
755 icon.obj if icon is not None else NULL, 750 icon.obj if icon is not None else NULL,
@@ -779,8 +774,6 @@ cdef class List(Object):
779 774
780 cb = _object_item_callback 775 cb = _object_item_callback
781 776
782 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
783
784 item = elm_list_item_insert_before(self.obj, 777 item = elm_list_item_insert_before(self.obj,
785 before.item, 778 before.item,
786 <const char *>label if label is not None else NULL, 779 <const char *>label if label is not None else NULL,
@@ -811,8 +804,6 @@ cdef class List(Object):
811 804
812 cb = _object_item_callback 805 cb = _object_item_callback
813 806
814 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
815
816 item = elm_list_item_insert_after(self.obj, 807 item = elm_list_item_insert_after(self.obj,
817 after.item, 808 after.item,
818 <const char *>label if label is not None else NULL, 809 <const char *>label if label is not None else NULL,
diff --git a/efl/elementary/map.pyx b/efl/elementary/map.pyx
index fd18663..86b8770 100644
--- a/efl/elementary/map.pyx
+++ b/efl/elementary/map.pyx
@@ -205,7 +205,7 @@ Map zoom modes
205 205
206""" 206"""
207 207
208from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF 208from cpython cimport Py_INCREF, Py_DECREF
209 209
210from efl.eo cimport _object_mapping_register, object_from_instance 210from efl.eo cimport _object_mapping_register, object_from_instance
211from efl.utils.conversions cimport _ctouni 211from efl.utils.conversions cimport _ctouni
@@ -393,7 +393,6 @@ cdef class MapName(object):
393 raise TypeError("func must be callable") 393 raise TypeError("func must be callable")
394 394
395 data = (self, func, args, kwargs) 395 data = (self, func, args, kwargs)
396 if isinstance(address, unicode): address = PyUnicode_AsUTF8String(address)
397 self.name = elm_map_name_add(map.obj, 396 self.name = elm_map_name_add(map.obj,
398 <const char *>address if address is not None else NULL, 397 <const char *>address if address is not None else NULL,
399 lon, lat, _map_name_callback, <void *>data) 398 lon, lat, _map_name_callback, <void *>data)
@@ -1225,14 +1224,10 @@ cdef class Map(Object):
1225 return _ctouni(elm_map_user_agent_get(self.obj)) 1224 return _ctouni(elm_map_user_agent_get(self.obj))
1226 1225
1227 def __set__(self, user_agent): 1226 def __set__(self, user_agent):
1228 if isinstance(user_agent, unicode):
1229 user_agent = PyUnicode_AsUTF8String(user_agent)
1230 elm_map_user_agent_set(self.obj, 1227 elm_map_user_agent_set(self.obj,
1231 <const char *>user_agent if user_agent is not None else NULL) 1228 <const char *>user_agent if user_agent is not None else NULL)
1232 1229
1233 def user_agent_set(self, user_agent): 1230 def user_agent_set(self, user_agent):
1234 if isinstance(user_agent, unicode):
1235 user_agent = PyUnicode_AsUTF8String(user_agent)
1236 elm_map_user_agent_set(self.obj, 1231 elm_map_user_agent_set(self.obj,
1237 <const char *>user_agent if user_agent is not None else NULL) 1232 <const char *>user_agent if user_agent is not None else NULL)
1238 def user_agent_get(self): 1233 def user_agent_get(self):
@@ -1533,8 +1528,6 @@ cdef class Map(Object):
1533 .. seealso:: :py:func:`sources_get`, :py:func:`source_get` 1528 .. seealso:: :py:func:`sources_get`, :py:func:`source_get`
1534 1529
1535 """ 1530 """
1536 if isinstance(source_name, unicode):
1537 source_name = PyUnicode_AsUTF8String(source_name)
1538 elm_map_source_set(self.obj, source_type, 1531 elm_map_source_set(self.obj, source_type,
1539 <const char *>source_name if source_name is not None else NULL) 1532 <const char *>source_name if source_name is not None else NULL)
1540 1533
diff --git a/efl/elementary/menu.pyx b/efl/elementary/menu.pyx
index 24f0296..ff85388 100644
--- a/efl/elementary/menu.pyx
+++ b/efl/elementary/menu.pyx
@@ -44,7 +44,7 @@ Default text parts of the menu items that you can use for are:
44 44
45""" 45"""
46 46
47from cpython cimport PyUnicode_AsUTF8String, Py_DECREF 47from cpython cimport Py_DECREF
48 48
49from efl.eo cimport _object_mapping_register, object_from_instance 49from efl.eo cimport _object_mapping_register, object_from_instance
50from efl.utils.conversions cimport _ctouni 50from efl.utils.conversions cimport _ctouni
@@ -67,8 +67,6 @@ cdef class MenuItem(ObjectItem):
67 if not callable(callback): 67 if not callable(callback):
68 raise TypeError("callback is not callable") 68 raise TypeError("callback is not callable")
69 69
70 if isinstance(icon, unicode): icon = PyUnicode_AsUTF8String(icon)
71 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
72 self.parent = parent 70 self.parent = parent
73 self.label = label 71 self.label = label
74 self.icon = icon 72 self.icon = icon
@@ -126,12 +124,10 @@ cdef class MenuItem(ObjectItem):
126 return _ctouni(elm_menu_item_icon_name_get(self.item)) 124 return _ctouni(elm_menu_item_icon_name_get(self.item))
127 125
128 def __set__(self, icon): 126 def __set__(self, icon):
129 if isinstance(icon, unicode): icon = PyUnicode_AsUTF8String(icon)
130 elm_menu_item_icon_name_set(self.item, 127 elm_menu_item_icon_name_set(self.item,
131 <const char *>icon if icon is not None else NULL) 128 <const char *>icon if icon is not None else NULL)
132 129
133 def icon_name_set(self, icon): 130 def icon_name_set(self, icon):
134 if isinstance(icon, unicode): icon = PyUnicode_AsUTF8String(icon)
135 elm_menu_item_icon_name_set(self.item, 131 elm_menu_item_icon_name_set(self.item,
136 <const char *>icon if icon is not None else NULL) 132 <const char *>icon if icon is not None else NULL)
137 def icon_name_get(self): 133 def icon_name_get(self):
@@ -386,9 +382,6 @@ cdef class Menu(Object):
386 if callback is not None and callable(callback): 382 if callback is not None and callable(callback):
387 cb = _object_item_callback 383 cb = _object_item_callback
388 384
389 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
390 if isinstance(icon, unicode): icon = PyUnicode_AsUTF8String(icon)
391
392 item = elm_menu_item_add(self.obj, 385 item = elm_menu_item_add(self.obj,
393 parent.item if parent is not None else NULL, 386 parent.item if parent is not None else NULL,
394 <const char *>icon if icon is not None else NULL, 387 <const char *>icon if icon is not None else NULL,
diff --git a/efl/elementary/multibuttonentry.pyx b/efl/elementary/multibuttonentry.pyx
index e1537f8..a3a3ca8 100644
--- a/efl/elementary/multibuttonentry.pyx
+++ b/efl/elementary/multibuttonentry.pyx
@@ -62,7 +62,7 @@ Default text parts of the multibuttonentry items that you can use for are:
62 62
63""" 63"""
64 64
65from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF 65from cpython cimport Py_DECREF, Py_INCREF
66from libc.stdint cimport uintptr_t 66from libc.stdint cimport uintptr_t
67 67
68from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT 68from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT
@@ -97,7 +97,6 @@ cdef char * _multibuttonentry_format_cb(int count, void *data) with gil:
97 97
98 try: 98 try:
99 s = callback(count, *a, **ka) 99 s = callback(count, *a, **ka)
100 if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
101 except: 100 except:
102 traceback.print_exc() 101 traceback.print_exc()
103 return NULL 102 return NULL
@@ -120,7 +119,6 @@ cdef class MultiButtonEntryItem(ObjectItem):
120 if not callable(callback): 119 if not callable(callback):
121 raise TypeError("callback is not callable") 120 raise TypeError("callback is not callable")
122 121
123 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
124 self.label = label 122 self.label = label
125 self.cb_func = callback 123 self.cb_func = callback
126 self.cb_data = cb_data 124 self.cb_data = cb_data
@@ -286,8 +284,6 @@ cdef class MultiButtonEntry(Object):
286 if func is not None and callable(func): 284 if func is not None and callable(func):
287 cb = _object_item_callback 285 cb = _object_item_callback
288 286
289 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
290
291 item = elm_multibuttonentry_item_prepend(self.obj, 287 item = elm_multibuttonentry_item_prepend(self.obj,
292 <const char *>label if label is not None else NULL, 288 <const char *>label if label is not None else NULL,
293 cb, <void*>ret) 289 cb, <void*>ret)
@@ -310,8 +306,6 @@ cdef class MultiButtonEntry(Object):
310 if func is not None and callable(func): 306 if func is not None and callable(func):
311 cb = _object_item_callback 307 cb = _object_item_callback
312 308
313 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
314
315 item = elm_multibuttonentry_item_append(self.obj, 309 item = elm_multibuttonentry_item_append(self.obj,
316 <const char *>label if label is not None else NULL, 310 <const char *>label if label is not None else NULL,
317 cb, <void*>ret) 311 cb, <void*>ret)
@@ -334,8 +328,6 @@ cdef class MultiButtonEntry(Object):
334 if func is not None and callable(func): 328 if func is not None and callable(func):
335 cb = _object_item_callback 329 cb = _object_item_callback
336 330
337 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
338
339 item = elm_multibuttonentry_item_insert_before(self.obj, 331 item = elm_multibuttonentry_item_insert_before(self.obj,
340 before.item if before is not None else NULL, 332 before.item if before is not None else NULL,
341 <const char *>label if label is not None else NULL, 333 <const char *>label if label is not None else NULL,
@@ -359,8 +351,6 @@ cdef class MultiButtonEntry(Object):
359 if func is not None and callable(func): 351 if func is not None and callable(func):
360 cb = _object_item_callback 352 cb = _object_item_callback
361 353
362 if isinstance(label, unicode): label = PyUnicode_AsUTF8String(label)
363
364 item = elm_multibuttonentry_item_insert_after(self.obj, 354 item = elm_multibuttonentry_item_insert_after(self.obj,
365 after.item if after is not None else NULL, 355 after.item if after is not None else NULL,
366 <const char *>label if label is not None else NULL, 356 <const char *>label if label is not None else NULL,
diff --git a/efl/elementary/naviframe.pyx b/efl/elementary/naviframe.pyx
index 63b4158..a6a6298 100644
--- a/efl/elementary/naviframe.pyx
+++ b/efl/elementary/naviframe.pyx
@@ -93,8 +93,6 @@ the top one can be interacted with this way.
93 93
94""" 94"""
95 95
96from cpython cimport PyUnicode_AsUTF8String
97
98from efl.eo cimport _object_mapping_register, object_from_instance 96from efl.eo cimport _object_mapping_register, object_from_instance
99from efl.utils.conversions cimport _ctouni 97from efl.utils.conversions cimport _ctouni
100from efl.evas cimport Object as evasObject 98from efl.evas cimport Object as evasObject
@@ -147,7 +145,6 @@ cdef class NaviframeItem(ObjectItem):
147 :type item_style: string 145 :type item_style: string
148 146
149 """ 147 """
150 if isinstance(title_label, unicode): title_label = PyUnicode_AsUTF8String(title_label)
151 self.label = title_label 148 self.label = title_label
152 149
153 if prev_btn is not None: 150 if prev_btn is not None:
@@ -315,12 +312,10 @@ cdef class NaviframeItem(ObjectItem):
315 return _ctouni(elm_naviframe_item_style_get(self.item)) 312 return _ctouni(elm_naviframe_item_style_get(self.item))
316 313
317 def __set__(self, style): 314 def __set__(self, style):
318 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
319 elm_naviframe_item_style_set(self.item, 315 elm_naviframe_item_style_set(self.item,
320 <const char *>style if style is not None else NULL) 316 <const char *>style if style is not None else NULL)
321 317
322 def style_set(self, style): 318 def style_set(self, style):
323 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
324 elm_naviframe_item_style_set(self.item, 319 elm_naviframe_item_style_set(self.item,
325 <const char *>style if style is not None else NULL) 320 <const char *>style if style is not None else NULL)
326 def style_get(self): 321 def style_get(self):
diff --git a/efl/elementary/notify.pyx b/efl/elementary/notify.pyx
index cfd4af0..751365a 100644
--- a/efl/elementary/notify.pyx
+++ b/efl/elementary/notify.pyx
@@ -54,8 +54,6 @@ ELM_NOTIFY_ALIGN_FILL
54 54
55""" 55"""
56 56
57from cpython cimport PyUnicode_AsUTF8String
58
59from efl.eo cimport _object_mapping_register, object_from_instance 57from efl.eo cimport _object_mapping_register, object_from_instance
60from efl.utils.conversions cimport _ctouni 58from efl.utils.conversions cimport _ctouni
61from efl.evas cimport Object as evasObject 59from efl.evas cimport Object as evasObject
diff --git a/efl/elementary/object.pyx b/efl/elementary/object.pyx
index e99fa53..dcb60e7 100644
--- a/efl/elementary/object.pyx
+++ b/efl/elementary/object.pyx
@@ -219,8 +219,7 @@ Defines the kind of action associated with the drop data if for XDND
219""" 219"""
220 220
221from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyObject_GetAttr, \ 221from cpython cimport PyObject, Py_INCREF, Py_DECREF, PyObject_GetAttr, \
222 PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyObject_CheckBuffer, \ 222 PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyObject_CheckBuffer
223 PyUnicode_AsUTF8String
224from libc.stdint cimport uintptr_t 223from libc.stdint cimport uintptr_t
225 224
226from efl.eo cimport _object_mapping_register 225from efl.eo cimport _object_mapping_register
@@ -388,8 +387,6 @@ cdef class Object(evasObject):
388 :type text: string 387 :type text: string
389 388
390 """ 389 """
391 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
392 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
393 elm_object_part_text_set(self.obj, 390 elm_object_part_text_set(self.obj,
394 <const char *>part if part is not None else NULL, 391 <const char *>part if part is not None else NULL,
395 <const char *>text if text is not None else NULL) 392 <const char *>text if text is not None else NULL)
@@ -407,7 +404,6 @@ cdef class Object(evasObject):
407 :rtype: string 404 :rtype: string
408 405
409 """ 406 """
410 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
411 return _ctouni(elm_object_part_text_get(self.obj, 407 return _ctouni(elm_object_part_text_get(self.obj,
412 <const char *>part if part is not None else NULL)) 408 <const char *>part if part is not None else NULL))
413 409
@@ -421,12 +417,10 @@ cdef class Object(evasObject):
421 return _ctouni(elm_object_text_get(self.obj)) 417 return _ctouni(elm_object_text_get(self.obj))
422 418
423 def __set__(self, text): 419 def __set__(self, text):
424 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
425 elm_object_text_set(self.obj, 420 elm_object_text_set(self.obj,
426 <const char *>text if text is not None else NULL) 421 <const char *>text if text is not None else NULL)
427 422
428 def text_set(self, text): 423 def text_set(self, text):
429 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
430 elm_object_text_set(self.obj, 424 elm_object_text_set(self.obj,
431 <const char *>text if text is not None else NULL) 425 <const char *>text if text is not None else NULL)
432 def text_get(self): 426 def text_get(self):
@@ -449,7 +443,6 @@ cdef class Object(evasObject):
449 :type content: :py:class:`efl.evas.Object` 443 :type content: :py:class:`efl.evas.Object`
450 444
451 """ 445 """
452 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
453 elm_object_part_content_set(self.obj, 446 elm_object_part_content_set(self.obj,
454 <const char *>part if part is not None else NULL, content.obj) 447 <const char *>part if part is not None else NULL, content.obj)
455 448
@@ -466,7 +459,6 @@ cdef class Object(evasObject):
466 :rtype: :py:class:`efl.evas.Object` 459 :rtype: :py:class:`efl.evas.Object`
467 460
468 """ 461 """
469 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
470 return object_from_instance(elm_object_part_content_get(self.obj, 462 return object_from_instance(elm_object_part_content_get(self.obj,
471 <const char *>part if part is not None else NULL)) 463 <const char *>part if part is not None else NULL))
472 464
@@ -482,7 +474,6 @@ cdef class Object(evasObject):
482 :type part: string 474 :type part: string
483 475
484 """ 476 """
485 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
486 return object_from_instance(elm_object_part_content_unset(self.obj, 477 return object_from_instance(elm_object_part_content_unset(self.obj,
487 <const char *>part if part is not None else NULL)) 478 <const char *>part if part is not None else NULL))
488 479
@@ -518,7 +509,6 @@ cdef class Object(evasObject):
518 # :type txt: string 509 # :type txt: string
519 510
520 # """ 511 # """
521 # if isinstance(txt, unicode): txt = PyUnicode_AsUTF8String(txt)
522 # elm_object_access_info_set(self.obj, 512 # elm_object_access_info_set(self.obj,
523 # <const char *>txt if txt is not None else NULL) 513 # <const char *>txt if txt is not None else NULL)
524 514
@@ -546,7 +536,6 @@ cdef class Object(evasObject):
546 :rtype: :py:class:`~efl.elementary.object.Object` 536 :rtype: :py:class:`~efl.elementary.object.Object`
547 537
548 """ 538 """
549 if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
550 return object_from_instance(elm_object_name_find(self.obj, 539 return object_from_instance(elm_object_name_find(self.obj,
551 <const char *>name if name is not None else NULL, 540 <const char *>name if name is not None else NULL,
552 recurse)) 541 recurse))
@@ -561,12 +550,10 @@ cdef class Object(evasObject):
561 return _ctouni(elm_object_style_get(self.obj)) 550 return _ctouni(elm_object_style_get(self.obj))
562 551
563 def __set__(self, style): 552 def __set__(self, style):
564 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
565 elm_object_style_set(self.obj, 553 elm_object_style_set(self.obj,
566 <const char *>style if style is not None else NULL) 554 <const char *>style if style is not None else NULL)
567 555
568 def style_set(self, style): 556 def style_set(self, style):
569 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
570 elm_object_style_set(self.obj, 557 elm_object_style_set(self.obj,
571 <const char *>style if style is not None else NULL) 558 <const char *>style if style is not None else NULL)
572 def style_get(self): 559 def style_get(self):
@@ -675,9 +662,6 @@ cdef class Object(evasObject):
675 :type source: string 662 :type source: string
676 663
677 """ 664 """
678 if isinstance(emission, unicode):
679 emission = PyUnicode_AsUTF8String(emission)
680 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
681 elm_object_signal_emit(self.obj, 665 elm_object_signal_emit(self.obj,
682 <const char *>emission if emission is not None else NULL, 666 <const char *>emission if emission is not None else NULL,
683 <const char *>source if source is not None else NULL) 667 <const char *>source if source is not None else NULL)
@@ -703,10 +687,6 @@ cdef class Object(evasObject):
703 d = self._elm_signal_cbs.setdefault(emission, {}) 687 d = self._elm_signal_cbs.setdefault(emission, {})
704 lst = d.setdefault(source, []) 688 lst = d.setdefault(source, [])
705 if not lst: 689 if not lst:
706 if isinstance(emission, unicode):
707 emission = PyUnicode_AsUTF8String(emission)
708 if isinstance(source, unicode):
709 source = PyUnicode_AsUTF8String(source)
710 elm_object_signal_callback_add(self.obj, 690 elm_object_signal_callback_add(self.obj,
711 <const char *>emission if emission is not None else NULL, 691 <const char *>emission if emission is not None else NULL,
712 <const char *>source if source is not None else NULL, 692 <const char *>source if source is not None else NULL,
@@ -753,9 +733,6 @@ cdef class Object(evasObject):
753 d.pop(source) 733 d.pop(source)
754 if not d: 734 if not d:
755 self._elm_signal_cbs.pop(emission) 735 self._elm_signal_cbs.pop(emission)
756 if isinstance(emission, unicode):
757 emission = PyUnicode_AsUTF8String(emission)
758 if isinstance(source, unicode): source = PyUnicode_AsUTF8String(source)
759 elm_object_signal_callback_del(self.obj, 736 elm_object_signal_callback_del(self.obj,
760 <const char *>emission if emission is not None else NULL, 737 <const char *>emission if emission is not None else NULL,
761 <const char *>source if source is not None else NULL, 738 <const char *>source if source is not None else NULL,
@@ -896,8 +873,6 @@ cdef class Object(evasObject):
896 return _ctouni(elm_object_cursor_get(self.obj)) 873 return _ctouni(elm_object_cursor_get(self.obj))
897 874
898 def __set__(self, cursor): 875 def __set__(self, cursor):
899 if isinstance(cursor, unicode):
900 cursor = PyUnicode_AsUTF8String(cursor)
901 elm_object_cursor_set(self.obj, 876 elm_object_cursor_set(self.obj,
902 <const char *>cursor if cursor is not None else NULL) 877 <const char *>cursor if cursor is not None else NULL)
903 878
@@ -905,7 +880,6 @@ cdef class Object(evasObject):
905 elm_object_cursor_unset(self.obj) 880 elm_object_cursor_unset(self.obj)
906 881
907 def cursor_set(self, cursor): 882 def cursor_set(self, cursor):
908 if isinstance(cursor, unicode): cursor = PyUnicode_AsUTF8String(cursor)
909 elm_object_cursor_set(self.obj, 883 elm_object_cursor_set(self.obj,
910 <const char *>cursor if cursor is not None else NULL) 884 <const char *>cursor if cursor is not None else NULL)
911 def cursor_get(self): 885 def cursor_get(self):
@@ -923,12 +897,10 @@ cdef class Object(evasObject):
923 return _ctouni(elm_object_cursor_style_get(self.obj)) 897 return _ctouni(elm_object_cursor_style_get(self.obj))
924 898
925 def __set__(self, style): 899 def __set__(self, style):
926 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
927 elm_object_cursor_style_set(self.obj, 900 elm_object_cursor_style_set(self.obj,
928 <const char *>style if style is not None else NULL) 901 <const char *>style if style is not None else NULL)
929 902
930 def cursor_style_set(self, style=None): 903 def cursor_style_set(self, style=None):
931 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
932 elm_object_cursor_style_set(self.obj, 904 elm_object_cursor_style_set(self.obj,
933 <const char *>style if style is not None else NULL) 905 <const char *>style if style is not None else NULL)
934 def cursor_style_get(self): 906 def cursor_style_get(self):
@@ -1162,14 +1134,12 @@ cdef class Object(evasObject):
1162 1134
1163 """ 1135 """
1164 def __set__(self, style): 1136 def __set__(self, style):
1165 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
1166 elm_object_focus_highlight_style_set(self.obj, 1137 elm_object_focus_highlight_style_set(self.obj,
1167 <const char *>style if style is not None else NULL) 1138 <const char *>style if style is not None else NULL)
1168 def __get__(self): 1139 def __get__(self):
1169 return elm_object_focus_highlight_style_get(self.obj) 1140 return elm_object_focus_highlight_style_get(self.obj)
1170 1141
1171 def focus_highlight_style_set(self, style): 1142 def focus_highlight_style_set(self, style):
1172 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
1173 elm_object_focus_highlight_style_set(self.obj, 1143 elm_object_focus_highlight_style_set(self.obj,
1174 <const char *>style if style is not None else NULL) 1144 <const char *>style if style is not None else NULL)
1175 def focus_highlight_style_get(self): 1145 def focus_highlight_style_get(self):
@@ -1426,19 +1396,15 @@ cdef class Object(evasObject):
1426 method calls :py:func:`tooltip_content_cb_set` 1396 method calls :py:func:`tooltip_content_cb_set`
1427 1397
1428 """ 1398 """
1429 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1430 elm_object_tooltip_text_set(self.obj, 1399 elm_object_tooltip_text_set(self.obj,
1431 <const char *>text if text is not None else NULL) 1400 <const char *>text if text is not None else NULL)
1432 1401
1433 def tooltip_domain_translatable_text_set(self, domain, text): 1402 def tooltip_domain_translatable_text_set(self, domain, text):
1434 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
1435 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1436 elm_object_tooltip_domain_translatable_text_set(self.obj, 1403 elm_object_tooltip_domain_translatable_text_set(self.obj,
1437 <const char *>domain if domain is not None else NULL, 1404 <const char *>domain if domain is not None else NULL,
1438 <const char *>text if text is not None else NULL) 1405 <const char *>text if text is not None else NULL)
1439 1406
1440 def tooltip_translatable_text_set(self, text): 1407 def tooltip_translatable_text_set(self, text):
1441 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1442 elm_object_tooltip_translatable_text_set(self.obj, 1408 elm_object_tooltip_translatable_text_set(self.obj,
1443 <const char *>text if text is not None else NULL) 1409 <const char *>text if text is not None else NULL)
1444 1410
@@ -1491,12 +1457,10 @@ cdef class Object(evasObject):
1491 def __get__(self): 1457 def __get__(self):
1492 return _ctouni(elm_object_tooltip_style_get(self.obj)) 1458 return _ctouni(elm_object_tooltip_style_get(self.obj))
1493 def __set__(self, style): 1459 def __set__(self, style):
1494 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
1495 elm_object_tooltip_style_set(self.obj, 1460 elm_object_tooltip_style_set(self.obj,
1496 <const char *>style if style is not None else NULL) 1461 <const char *>style if style is not None else NULL)
1497 1462
1498 def tooltip_style_set(self, style=None): 1463 def tooltip_style_set(self, style=None):
1499 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
1500 elm_object_tooltip_style_set(self.obj, 1464 elm_object_tooltip_style_set(self.obj,
1501 <const char *>style if style is not None else NULL) 1465 <const char *>style if style is not None else NULL)
1502 def tooltip_style_get(self): 1466 def tooltip_style_get(self):
@@ -1551,9 +1515,6 @@ cdef class Object(evasObject):
1551 @DEPRECATED("1.8", "Use :py:func:`domain_translatable_part_text_set` instead.") 1515 @DEPRECATED("1.8", "Use :py:func:`domain_translatable_part_text_set` instead.")
1552 def domain_translatable_text_part_set(self, part, domain, text): 1516 def domain_translatable_text_part_set(self, part, domain, text):
1553 """domain_translatable_text_part_set(part, domain, text)""" 1517 """domain_translatable_text_part_set(part, domain, text)"""
1554 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1555 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
1556 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1557 elm_object_domain_translatable_part_text_set(self.obj, 1518 elm_object_domain_translatable_part_text_set(self.obj,
1558 <const char *>part if part is not None else NULL, 1519 <const char *>part if part is not None else NULL,
1559 <const char *>domain if domain is not None else NULL, 1520 <const char *>domain if domain is not None else NULL,
@@ -1586,9 +1547,6 @@ cdef class Object(evasObject):
1586 .. versionadded:: 1.8 1547 .. versionadded:: 1.8
1587 1548
1588 """ 1549 """
1589 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1590 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
1591 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1592 elm_object_domain_translatable_part_text_set(self.obj, 1550 elm_object_domain_translatable_part_text_set(self.obj,
1593 <const char *>part if part is not None else NULL, 1551 <const char *>part if part is not None else NULL,
1594 <const char *>domain if domain is not None else NULL, 1552 <const char *>domain if domain is not None else NULL,
@@ -1601,8 +1559,6 @@ cdef class Object(evasObject):
1601 A convenience function. 1559 A convenience function.
1602 1560
1603 """ 1561 """
1604 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
1605 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1606 elm_object_domain_translatable_text_set(self.obj, 1562 elm_object_domain_translatable_text_set(self.obj,
1607 <const char *>domain if domain is not None else NULL, 1563 <const char *>domain if domain is not None else NULL,
1608 <const char *>text if text is not None else NULL) 1564 <const char *>text if text is not None else NULL)
@@ -1613,8 +1569,6 @@ cdef class Object(evasObject):
1613 A convenience function. 1569 A convenience function.
1614 1570
1615 """ 1571 """
1616 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1617 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1618 elm_object_translatable_part_text_set(self.obj, 1572 elm_object_translatable_part_text_set(self.obj,
1619 <const char *>part if part is not None else NULL, 1573 <const char *>part if part is not None else NULL,
1620 <const char *>text if text is not None else NULL) 1574 <const char *>text if text is not None else NULL)
@@ -1622,7 +1576,6 @@ cdef class Object(evasObject):
1622 @DEPRECATED("1.8", "Use :py:func:`translatable_part_text_get` instead.") 1576 @DEPRECATED("1.8", "Use :py:func:`translatable_part_text_get` instead.")
1623 def translatable_text_part_get(self, part): 1577 def translatable_text_part_get(self, part):
1624 """translatable_text_part_get(part) -> unicode""" 1578 """translatable_text_part_get(part) -> unicode"""
1625 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1626 return _ctouni(elm_object_translatable_part_text_get(self.obj, 1579 return _ctouni(elm_object_translatable_part_text_get(self.obj,
1627 <const char *>part if part is not None else NULL)) 1580 <const char *>part if part is not None else NULL))
1628 1581
@@ -1647,7 +1600,6 @@ cdef class Object(evasObject):
1647 .. versionadded:: 1.8 1600 .. versionadded:: 1.8
1648 1601
1649 """ 1602 """
1650 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1651 return _ctouni(elm_object_translatable_part_text_get(self.obj, 1603 return _ctouni(elm_object_translatable_part_text_get(self.obj,
1652 <const char *>part if part is not None else NULL)) 1604 <const char *>part if part is not None else NULL))
1653 1605
@@ -1673,8 +1625,6 @@ cdef class Object(evasObject):
1673 .. versionadded:: 1.8 1625 .. versionadded:: 1.8
1674 1626
1675 """ 1627 """
1676 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1677 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
1678 elm_object_domain_part_text_translatable_set(self.obj, 1628 elm_object_domain_part_text_translatable_set(self.obj,
1679 <const char *>part, 1629 <const char *>part,
1680 <const char *>domain, 1630 <const char *>domain,
@@ -1686,7 +1636,6 @@ cdef class Object(evasObject):
1686 A convenience function. 1636 A convenience function.
1687 1637
1688 """ 1638 """
1689 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
1690 elm_object_part_text_translatable_set(self.obj, 1639 elm_object_part_text_translatable_set(self.obj,
1691 part, translatable) 1640 part, translatable)
1692 1641
@@ -1696,7 +1645,6 @@ cdef class Object(evasObject):
1696 A convenience function. 1645 A convenience function.
1697 1646
1698 """ 1647 """
1699 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
1700 elm_object_domain_text_translatable_set(self.obj, domain, translatable) 1648 elm_object_domain_text_translatable_set(self.obj, domain, translatable)
1701 1649
1702 property translatable_text: 1650 property translatable_text:
@@ -1707,7 +1655,6 @@ cdef class Object(evasObject):
1707 self.translatable_text_set(text) 1655 self.translatable_text_set(text)
1708 1656
1709 def translatable_text_set(self, text): 1657 def translatable_text_set(self, text):
1710 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
1711 elm_object_translatable_text_set(self.obj, 1658 elm_object_translatable_text_set(self.obj,
1712 <const char *>text if text is not None else NULL) 1659 <const char *>text if text is not None else NULL)
1713 def translatable_text_get(self): 1660 def translatable_text_get(self):
@@ -1753,7 +1700,6 @@ cdef class Object(evasObject):
1753 1700
1754 e = intern(event) 1701 e = intern(event)
1755 lst = self._elmcallbacks.setdefault(e, []) 1702 lst = self._elmcallbacks.setdefault(e, [])
1756 if isinstance(event, unicode): event = PyUnicode_AsUTF8String(event)
1757 if not lst: 1703 if not lst:
1758 evas_object_smart_callback_add(self.obj, 1704 evas_object_smart_callback_add(self.obj,
1759 <const char *>event if event is not None else NULL, 1705 <const char *>event if event is not None else NULL,
@@ -1798,7 +1744,6 @@ cdef class Object(evasObject):
1798 if lst: 1744 if lst:
1799 return 1745 return
1800 self._elmcallbacks.pop(event) 1746 self._elmcallbacks.pop(event)
1801 if isinstance(event, unicode): event = PyUnicode_AsUTF8String(event)
1802 evas_object_smart_callback_del(self.obj, 1747 evas_object_smart_callback_del(self.obj,
1803 <const char *>event if event is not None else NULL, 1748 <const char *>event if event is not None else NULL,
1804 _object_callback) 1749 _object_callback)
@@ -1869,7 +1814,6 @@ cdef class Object(evasObject):
1869 Py_buffer view 1814 Py_buffer view
1870 bint ret 1815 bint ret
1871 1816
1872 if isinstance(buf, unicode): buf = PyUnicode_AsUTF8String(buf)
1873 if not PyObject_CheckBuffer(buf): 1817 if not PyObject_CheckBuffer(buf):
1874 raise TypeError( 1818 raise TypeError(
1875 "The provided object does not support buffer interface." 1819 "The provided object does not support buffer interface."
diff --git a/efl/elementary/object_item.pyx b/efl/elementary/object_item.pyx
index b5c48b9..c3a475e 100644
--- a/efl/elementary/object_item.pyx
+++ b/efl/elementary/object_item.pyx
@@ -15,7 +15,7 @@
15# You should have received a copy of the GNU Lesser General Public License 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/>. 16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17 17
18from cpython cimport PyUnicode_AsUTF8String, Py_DECREF, Py_INCREF 18from cpython cimport Py_DECREF, Py_INCREF
19from libc.stdint cimport uintptr_t 19from libc.stdint cimport uintptr_t
20 20
21from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT 21from efl.eo cimport _object_mapping_register, object_from_instance, PY_REFCOUNT
@@ -202,7 +202,6 @@ cdef class ObjectItem(object):
202 :param content: The new content of the object item 202 :param content: The new content of the object item
203 203
204 """ 204 """
205 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
206 elm_object_item_part_content_set(self.item, 205 elm_object_item_part_content_set(self.item,
207 <const char *>part if part is not None else NULL, content.obj) 206 <const char *>part if part is not None else NULL, content.obj)
208 207
@@ -220,7 +219,6 @@ cdef class ObjectItem(object):
220 :rtype: :py:class:`~efl.evas.Object` 219 :rtype: :py:class:`~efl.evas.Object`
221 220
222 """ 221 """
223 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
224 return object_from_instance(elm_object_item_part_content_get(self.item, 222 return object_from_instance(elm_object_item_part_content_get(self.item,
225 <const char *>part if part is not None else NULL)) 223 <const char *>part if part is not None else NULL))
226 224
@@ -236,7 +234,6 @@ cdef class ObjectItem(object):
236 :type part: string 234 :type part: string
237 235
238 """ 236 """
239 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
240 return object_from_instance(elm_object_item_part_content_unset(self.item, 237 return object_from_instance(elm_object_item_part_content_unset(self.item,
241 <const char *>part if part is not None else NULL)) 238 <const char *>part if part is not None else NULL))
242 239
@@ -271,8 +268,6 @@ cdef class ObjectItem(object):
271 :type text: string 268 :type text: string
272 269
273 """ 270 """
274 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
275 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
276 elm_object_item_part_text_set(self.item, 271 elm_object_item_part_text_set(self.item,
277 <const char *>part if part is not None else NULL, 272 <const char *>part if part is not None else NULL,
278 <const char *>text if text is not None else NULL) 273 <const char *>text if text is not None else NULL)
@@ -290,7 +285,6 @@ cdef class ObjectItem(object):
290 :rtype: string 285 :rtype: string
291 286
292 """ 287 """
293 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
294 return _ctouni(elm_object_item_part_text_get(self.item, 288 return _ctouni(elm_object_item_part_text_get(self.item,
295 <const char *>part if part is not None else NULL)) 289 <const char *>part if part is not None else NULL))
296 290
@@ -318,9 +312,6 @@ cdef class ObjectItem(object):
318 .. versionadded:: 1.8 312 .. versionadded:: 1.8
319 313
320 """ 314 """
321 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
322 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
323 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
324 elm_object_item_domain_translatable_part_text_set(self.item, 315 elm_object_item_domain_translatable_part_text_set(self.item,
325 <const char *>part if part is not None else NULL, 316 <const char *>part if part is not None else NULL,
326 <const char *>domain if domain is not None else NULL, 317 <const char *>domain if domain is not None else NULL,
@@ -342,7 +333,6 @@ cdef class ObjectItem(object):
342 .. versionadded:: 1.8 333 .. versionadded:: 1.8
343 334
344 """ 335 """
345 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
346 return _ctouni(elm_object_item_translatable_part_text_get(self.item, 336 return _ctouni(elm_object_item_translatable_part_text_get(self.item,
347 <const char *>part if part is not None else NULL)) 337 <const char *>part if part is not None else NULL))
348 338
@@ -369,8 +359,6 @@ cdef class ObjectItem(object):
369 .. versionadded:: 1.8 359 .. versionadded:: 1.8
370 360
371 """ 361 """
372 if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
373 if isinstance(domain, unicode): domain = PyUnicode_AsUTF8String(domain)
374 elm_object_item_domain_part_text_translatable_set(self.item, 362 elm_object_item_domain_part_text_translatable_set(self.item,
375 <const char *>part, 363 <const char *>part,
376 <const char *>domain, 364 <const char *>domain,
@@ -386,12 +374,10 @@ cdef class ObjectItem(object):
386 return _ctouni(elm_object_item_text_get(self.item)) 374 return _ctouni(elm_object_item_text_get(self.item))
387 375
388 def __set__(self, text): 376 def __set__(self, text):
389 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
390 elm_object_item_text_set(self.item, 377 elm_object_item_text_set(self.item,
391 <const char *>text if text is not None else NULL) 378 <const char *>text if text is not None else NULL)
392 379
393 def text_set(self, text): 380 def text_set(self, text):
394 if isinstance(text, unicode): text = PyUnicode_AsUTF8String(text)
395 elm_object_item_text_set(self.item, 381 elm_object_item_text_set(self.item,
396 <const char *>text if text is not None else NULL) 382 <const char *>text if text is not None else NULL)
397 def text_get(self): 383 def text_get(self):
@@ -405,12 +391,10 @@ cdef class ObjectItem(object):
405 391
406 # """ 392 # """
407 # def __set__(self, txt): 393 # def __set__(self, txt):
408 # if isinstance(txt, unicode): txt = PyUnicode_AsUTF8String(txt)
409 # elm_object_item_access_info_set(self.item, 394 # elm_object_item_access_info_set(self.item,
410 # <const char *>txt if txt is not None else NULL) 395 # <const char *>txt if txt is not None else NULL)