From f84fef04158318bb7ad244ac49294156fa419d7c Mon Sep 17 00:00:00 2001 From: Kai Huuhko Date: Thu, 2 Oct 2014 23:56:12 +0300 Subject: [PATCH] Eolian: WIP --- efl/efl/__init__.py | 0 efl/efl/__init__.pyx | 11 + efl/elm/__init__.py | 0 efl/emotion/efl.emotion.pyx | 2019 ++++++++++++++++++----------------- efl/eo/efl.eo.pyx | 44 +- efl/eolian/__init__.pxd | 2 + efl/eolian/__init__.pyx | 25 + efl/evas/efl.evas.pyx | 47 +- include/efl.c_eo.pxd | 7 +- include/efl.eina.pxd | 6 + include/efl.emotion.pxd | 2 +- include/efl.eo.pxd | 14 +- include/efl.evas.pxd | 246 ++--- scripts/converters.py | 54 +- scripts/eolian_generate.py | 216 ++-- setup.py | 220 ++-- 16 files changed, 1533 insertions(+), 1380 deletions(-) create mode 100644 efl/efl/__init__.py create mode 100644 efl/efl/__init__.pyx create mode 100644 efl/elm/__init__.py diff --git a/efl/efl/__init__.py b/efl/efl/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/efl/efl/__init__.pyx b/efl/efl/__init__.pyx new file mode 100644 index 0000000..5ff1527 --- /dev/null +++ b/efl/efl/__init__.pyx @@ -0,0 +1,11 @@ +from cpython cimport PyUnicode_AsUTF8String + +from efl.c_eo cimport eo_add_ref, Eo_Class, _eo_do_start, _eo_do_end, \ + CFILE, CFUNC, CLINE, Eo_Event_Description +from efl.eo cimport object_from_instance, _object_mapping_register, \ + Eo, _Eo +from efl.utils.conversions cimport _ctouni + +from efl.eina cimport eina_hash_add, eina_hash_del, EINA_FALSE, Eina_Bool + +include "generated_classes.pxi" diff --git a/efl/elm/__init__.py b/efl/elm/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/efl/emotion/efl.emotion.pyx b/efl/emotion/efl.emotion.pyx index 619cd30..b4eef57 100644 --- a/efl/emotion/efl.emotion.pyx +++ b/efl/emotion/efl.emotion.pyx @@ -18,12 +18,16 @@ from cpython cimport PyUnicode_AsUTF8String from libc.stdint cimport uintptr_t +from efl.c_eo cimport eo_add_ref, Eo, Eo_Class, _eo_do_start, _eo_do_end, \ + CFILE, CFUNC, CLINE, Eo_Event_Description from efl.eo cimport object_from_instance, _object_mapping_register, \ - _register_decorated_callbacks + _register_decorated_callbacks, _Eo from efl.utils.conversions cimport _ctouni -from efl.evas cimport Canvas, evas_object_smart_callback_add, \ +from efl.evas cimport _Canvas, evas_object_smart_callback_add, \ evas_object_smart_callback_del +from efl.eina cimport eina_hash_add, eina_hash_del, EINA_FALSE + # Emotion_Event: EMOTION_EVENT_MENU1 = 0 @@ -175,1165 +179,1166 @@ def extension_may_play_get(filename): filename if filename is not None else NULL)) -cdef class Emotion(evasObject): - """ - - The Emotion object - - :see: :py:mod:`The documentation page` - - :param evas: The canvas where the object will be added to. - :type evas: efl.evas.Canvas - :param module_name: name of the engine to use (gstreamer, xine, vlc or generic) - :param module_params: Extra parameters, module specific - :param size: (w, h) - :param pos: (x, y) - :param geometry: (x, y, w, h) - :param color: (r, g, b, a) - :return: The emotion object instance just created. - - .. versionchanged:: 1.8 - Keyword argument module_filename was renamed to module_name. - - """ - def __cinit__(self, *a, **ka): - self._emotion_callbacks = {} - - def __init__(self, Canvas canvas not None, module_name="gstreamer", - module_params=None, **kwargs): - - self._set_obj(emotion_object_add(canvas.obj)) - _register_decorated_callbacks(self) - - if isinstance(module_name, unicode): - module_name = PyUnicode_AsUTF8String(module_name) - if emotion_object_init(self.obj, - module_name if module_name is not None else NULL) == 0: - raise EmotionModuleInitError("failed to initialize module '%s'" % - module_name) - - if isinstance(module_params, (tuple, list)): - module_params = dict(module_params) - if isinstance(module_params, dict): - for opt, val in module_params.iteritems(): - emotion_object_module_option_set(self.obj, opt, val) - - self._set_properties_from_keyword_args(kwargs) - - def __repr__(self): - x, y, w, h = self.geometry_get() - r, g, b, a = self.color_get() - return ("<%s(%#x, name=%r, file=%r, geometry=(%d, %d, %d, %d), " - "color=(%d, %d, %d, %d), layer=%s, clip=%r, visible=%s) %s>") % \ - (self.__class__.__name__, self, - self.name_get(), self.file_get(), - x, y, w, h, r, g, b, a, - self.layer_get(), self.clip_get(), self.visible_get(), - evasObject.__repr__(self)) - - property file: - """ The filename of the file associated with the emotion object. - - The file to be used with this emotion object. If the - object already has another file set, this file will be unset and unloaded, - and the new file will be loaded to this emotion object. The seek position - will be set to 0, and the emotion object will be paused, instead of playing. - - If there was already a filename set, and it's the same as the one being set - now, setting the property does nothing - - Set to *None* if you want to unload the current file but don't - want to load anything else. - - :type: str - """ - def __get__(self): - return _ctouni(emotion_object_file_get(self.obj)) - - def __set__(self, value): - if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) - emotion_object_file_set(self.obj, - value if value is not None else NULL) - - def file_get(self): - return _ctouni(emotion_object_file_get(self.obj)) - def file_set(self, file_name): - if isinstance(file_name, unicode): file_name = PyUnicode_AsUTF8String(file_name) - emotion_object_file_set(self.obj, - file_name if file_name is not None else NULL) - - property play: - """ The play/pause state of the emotion object. - - :type: bool - """ - def __get__(self): - return bool(emotion_object_play_get(self.obj)) - - def __set__(self, int value): - emotion_object_play_set(self.obj, value) - - def play_get(self): - return bool(emotion_object_play_get(self.obj)) - def play_set(self, int value): - emotion_object_play_set(self.obj, value) - - property position: - """ The position in the media file. - - The current position of the media file to *sec*, this - only works on seekable streams. Setting the position doesn't change the - playing state of the media file. - - :type: float - """ - def __get__(self): - return emotion_object_position_get(self.obj) - - def __set__(self, double value): - emotion_object_position_set(self.obj, value) - - def position_get(self): - return emotion_object_position_get(self.obj) - def position_set(self, double value): - emotion_object_position_set(self.obj, value) - - property border: - """ The borders for the emotion object. - - This represent the borders for the emotion video object (just when a video is - present). The value is a tuple of 4 int: (left, right, top, bottom). - - When positive values are given to one of the parameters, a border - will be added to the respective position of the object, representing that - size on the original video size. However, if the video is scaled up or down - (i.e. the emotion object size is different from the video size), the borders - will be scaled respectively too. - - If a negative value is given to one of the parameters, instead of a border, - that respective side of the video will be cropped. - - .. note:: It's possible to set a color for the added borders (default is - transparent) with the :py:attr:`bg_color` attribute. By - default, an Emotion object doesn't have any border. - - :type: tuple of int (l, r, t, b) - - .. versionadded:: 1.8 - - """ - def __get__(self): - cdef int l, r, t, b - emotion_object_border_get(self.obj, &l, &r, &t, &b) - return (l, r, t, b) - - def __set__(self, value): - cdef int l, r, t, b - l, r, t, b = value - emotion_object_border_set(self.obj, l, r, t, b) - - def border_get(self): - cdef int l, r, t, b - emotion_object_border_get(self.obj, &l, &r, &t, &b) - return (l, r, t, b) - def border_set(self, int l, int r, int t, int b): - emotion_object_border_set(self.obj, l, r, t, b) - - property bg_color: - """ The color for the background of this emotion object. - - This is useful when a border is added to any side of the Emotion object. - The area between the edge of the video and the edge of the object - will be filled with the specified color. - - The default color is (0, 0, 0, 0) - - :type: tuple of int (r, g, b, a) - - .. versionadded:: 1.8 - - """ - def __get__(self): - cdef int r, g, b, a - emotion_object_bg_color_get(self.obj, &r, &g, &b, &a) - return (r, g, b, a) - - def __set__(self, value): - cdef int r, g, b, a - r, g, b, a = value - emotion_object_bg_color_set(self.obj, r, g, b, a) - - def bg_color_get(self): - cdef int r, g, b, a - emotion_object_bg_color_get(self.obj, &r, &g, &b, &a) - return (r, g, b, a) - def bg_color_set(self, int r, int g, int b, int a): - emotion_object_bg_color_set(self.obj, r, g, b, a) +include "generated_classes.pxi" +#cdef class Emotion(evasObject): +# """ + +# The Emotion object + +# :see: :py:mod:`The documentation page` + +# :param evas: The canvas where the object will be added to. +# :type evas: efl.evas.Canvas +# :param module_name: name of the engine to use (gstreamer, xine, vlc or generic) +# :param module_params: Extra parameters, module specific +# :param size: (w, h) +# :param pos: (x, y) +# :param geometry: (x, y, w, h) +# :param color: (r, g, b, a) +# :return: The emotion object instance just created. + +# .. versionchanged:: 1.8 +# Keyword argument module_filename was renamed to module_name. + +# """ +# def __cinit__(self, *a, **ka): +# self._emotion_callbacks = {} + +# def __init__(self, Canvas canvas not None, module_name="gstreamer", +# module_params=None, **kwargs): + +# self._set_obj(emotion_object_add(canvas.obj)) +# _register_decorated_callbacks(self) + +# if isinstance(module_name, unicode): +# module_name = PyUnicode_AsUTF8String(module_name) +# if emotion_object_init(self.obj, +# module_name if module_name is not None else NULL) == 0: +# raise EmotionModuleInitError("failed to initialize module '%s'" % +# module_name) + +# if isinstance(module_params, (tuple, list)): +# module_params = dict(module_params) +# if isinstance(module_params, dict): +# for opt, val in module_params.iteritems(): +# emotion_object_module_option_set(self.obj, opt, val) + +# self._set_properties_from_keyword_args(kwargs) + +# def __repr__(self): +# x, y, w, h = self.geometry_get() +# r, g, b, a = self.color_get() +# return ("<%s(%#x, name=%r, file=%r, geometry=(%d, %d, %d, %d), " +# "color=(%d, %d, %d, %d), layer=%s, clip=%r, visible=%s) %s>") % \ +# (self.__class__.__name__, self, +# self.name_get(), self.file_get(), +# x, y, w, h, r, g, b, a, +# self.layer_get(), self.clip_get(), self.visible_get(), +# evasObject.__repr__(self)) + +# property file: +# """ The filename of the file associated with the emotion object. + +# The file to be used with this emotion object. If the +# object already has another file set, this file will be unset and unloaded, +# and the new file will be loaded to this emotion object. The seek position +# will be set to 0, and the emotion object will be paused, instead of playing. + +# If there was already a filename set, and it's the same as the one being set +# now, setting the property does nothing + +# Set to *None* if you want to unload the current file but don't +# want to load anything else. + +# :type: str +# """ +# def __get__(self): +# return _ctouni(emotion_object_file_get(self.obj)) + +# def __set__(self, value): +# if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) +# emotion_object_file_set(self.obj, +# value if value is not None else NULL) + +# def file_get(self): +# return _ctouni(emotion_object_file_get(self.obj)) +# def file_set(self, file_name): +# if isinstance(file_name, unicode): file_name = PyUnicode_AsUTF8String(file_name) +# emotion_object_file_set(self.obj, +# file_name if file_name is not None else NULL) + +# property play: +# """ The play/pause state of the emotion object. + +# :type: bool +# """ +# def __get__(self): +# return bool(emotion_object_play_get(self.obj)) + +# def __set__(self, int value): +# emotion_object_play_set(self.obj, value) + +# def play_get(self): +# return bool(emotion_object_play_get(self.obj)) +# def play_set(self, int value): +# emotion_object_play_set(self.obj, value) + +# property position: +# """ The position in the media file. + +# The current position of the media file to *sec*, this +# only works on seekable streams. Setting the position doesn't change the +# playing state of the media file. + +# :type: float +# """ +# def __get__(self): +# return emotion_object_position_get(self.obj) + +# def __set__(self, double value): +# emotion_object_position_set(self.obj, value) + +# def position_get(self): +# return emotion_object_position_get(self.obj) +# def position_set(self, double value): +# emotion_object_position_set(self.obj, value) + +# property border: +# """ The borders for the emotion object. + +# This represent the borders for the emotion video object (just when a video is +# present). The value is a tuple of 4 int: (left, right, top, bottom). + +# When positive values are given to one of the parameters, a border +# will be added to the respective position of the object, representing that +# size on the original video size. However, if the video is scaled up or down +# (i.e. the emotion object size is different from the video size), the borders +# will be scaled respectively too. + +# If a negative value is given to one of the parameters, instead of a border, +# that respective side of the video will be cropped. + +# .. note:: It's possible to set a color for the added borders (default is +# transparent) with the :py:attr:`bg_color` attribute. By +# default, an Emotion object doesn't have any border. + +# :type: tuple of int (l, r, t, b) + +# .. versionadded:: 1.8 + +# """ +# def __get__(self): +# cdef int l, r, t, b +# emotion_object_border_get(self.obj, &l, &r, &t, &b) +# return (l, r, t, b) + +# def __set__(self, value): +# cdef int l, r, t, b +# l, r, t, b = value +# emotion_object_border_set(self.obj, l, r, t, b) + +# def border_get(self): +# cdef int l, r, t, b +# emotion_object_border_get(self.obj, &l, &r, &t, &b) +# return (l, r, t, b) +# def border_set(self, int l, int r, int t, int b): +# emotion_object_border_set(self.obj, l, r, t, b) + +# property bg_color: +# """ The color for the background of this emotion object. + +# This is useful when a border is added to any side of the Emotion object. +# The area between the edge of the video and the edge of the object +# will be filled with the specified color. + +# The default color is (0, 0, 0, 0) + +# :type: tuple of int (r, g, b, a) + +# .. versionadded:: 1.8 + +# """ +# def __get__(self): +# cdef int r, g, b, a +# emotion_object_bg_color_get(self.obj, &r, &g, &b, &a) +# return (r, g, b, a) + +# def __set__(self, value): +# cdef int r, g, b, a +# r, g, b, a = value +# emotion_object_bg_color_set(self.obj, r, g, b, a) + +# def bg_color_get(self): +# cdef int r, g, b, a +# emotion_object_bg_color_get(self.obj, &r, &g, &b, &a) +# return (r, g, b, a) +# def bg_color_set(self, int r, int g, int b, int a): +# emotion_object_bg_color_set(self.obj, r, g, b, a) - property keep_aspect: - """ Whether emotion should keep the aspect ratio of the video. +# property keep_aspect: +# """ Whether emotion should keep the aspect ratio of the video. - Instead of manually calculating the required border to set with - emotion_object_border_set(), and using this to fix the aspect ratio of the - video when the emotion object has a different aspect, it's possible to just - set the policy to be used. +# Instead of manually calculating the required border to set with +# emotion_object_border_set(), and using this to fix the aspect ratio of the +# video when the emotion object has a different aspect, it's possible to just +# set the policy to be used. - The options are: +# The options are: - - ``EMOTION_ASPECT_KEEP_NONE`` ignore the video aspect ratio, and reset any - border set to 0, stretching the video inside the emotion object area. This - option is similar to EVAS_ASPECT_CONTROL_NONE size hint. - - ``EMOTION_ASPECT_KEEP_WIDTH`` respect the video aspect ratio, fitting the - video width inside the object width. This option is similar to - EVAS_ASPECT_CONTROL_HORIZONTAL size hint. - - ``EMOTION_ASPECT_KEEP_HEIGHT`` respect the video aspect ratio, fitting - the video height inside the object height. This option is similar to - EVAS_ASPECT_CONTROL_VERTICAL size hint. - - ``EMOTION_ASPECT_KEEP_BOTH`` respect the video aspect ratio, fitting both - its width and height inside the object area. This option is similar to - EVAS_ASPECT_CONTROL_BOTH size hint. It's the effect called letterboxing. - - ``EMOTION_ASPECT_CROP`` respect the video aspect ratio, fitting the width - or height inside the object area, and cropping the exceding areas of the - video in height or width. It's the effect called pan-and-scan. - - ``EMOTION_ASPECT_CUSTOM`` ignore the video aspect ratio, and use the - current set from emotion_object_border_set(). +# - ``EMOTION_ASPECT_KEEP_NONE`` ignore the video aspect ratio, and reset any +# border set to 0, stretching the video inside the emotion object area. This +# option is similar to EVAS_ASPECT_CONTROL_NONE size hint. +# - ``EMOTION_ASPECT_KEEP_WIDTH`` respect the video aspect ratio, fitting the +# video width inside the object width. This option is similar to +# EVAS_ASPECT_CONTROL_HORIZONTAL size hint. +# - ``EMOTION_ASPECT_KEEP_HEIGHT`` respect the video aspect ratio, fitting +# the video height inside the object height. This option is similar to +# EVAS_ASPECT_CONTROL_VERTICAL size hint. +# - ``EMOTION_ASPECT_KEEP_BOTH`` respect the video aspect ratio, fitting both +# its width and height inside the object area. This option is similar to +# EVAS_ASPECT_CONTROL_BOTH size hint. It's the effect called letterboxing. +# - ``EMOTION_ASPECT_CROP`` respect the video aspect ratio, fitting the width +# or height inside the object area, and cropping the exceding areas of the +# video in height or width. It's the effect called pan-and-scan. +# - ``EMOTION_ASPECT_CUSTOM`` ignore the video aspect ratio, and use the +# current set from emotion_object_border_set(). - .. note:: Calling this function with any value except - EMOTION_ASPECT_CUSTOM will invalidate the borders set with - the :py:attr:`border` attribute - - .. note:: Using the :py:attr:`border` attribute will automatically - set the aspect policy to #EMOTION_ASPECT_CUSTOM. - - :type: Emotion_Aspect - - .. versionadded:: 1.8 +# .. note:: Calling this function with any value except +# EMOTION_ASPECT_CUSTOM will invalidate the borders set with +# the :py:attr:`border` attribute + +# .. note:: Using the :py:attr:`border` attribute will automatically +# set the aspect policy to #EMOTION_ASPECT_CUSTOM. + +# :type: Emotion_Aspect + +# .. versionadded:: 1.8 - """ - def __get__(self): - return emotion_object_keep_aspect_get(self.obj) - def __set__(self, value): - emotion_object_keep_aspect_set(self.obj, value) - - def keep_aspect_get(self): - return emotion_object_keep_aspect_get(self.obj) - def keep_aspect_set(self, Emotion_Aspect a): - emotion_object_keep_aspect_set(self.obj, a) - - property video_subtitle_file: - """ The video's subtitle file path (i.e an .srt file) - - For supported subtitle formats consult the backend's documentation. - - :type: str - - .. versionadded:: 1.8 - - """ - def __get__(self): - return _ctouni(emotion_object_video_subtitle_file_get(self.obj)) - - def __set__(self, value): - if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) - emotion_object_video_subtitle_file_set(self.obj, - value if value is not None else NULL) +# """ +# def __get__(self): +# return emotion_object_keep_aspect_get(self.obj) +# def __set__(self, value): +# emotion_object_keep_aspect_set(self.obj, value) + +# def keep_aspect_get(self): +# return emotion_object_keep_aspect_get(self.obj) +# def keep_aspect_set(self, Emotion_Aspect a): +# emotion_object_keep_aspect_set(self.obj, a) + +# property video_subtitle_file: +# """ The video's subtitle file path (i.e an .srt file) + +# For supported subtitle formats consult the backend's documentation. + +# :type: str + +# .. versionadded:: 1.8 + +# """ +# def __get__(self): +# return _ctouni(emotion_object_video_subtitle_file_get(self.obj)) + +# def __set__(self, value): +# if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) +# emotion_object_video_subtitle_file_set(self.obj, +# value if value is not None else NULL) - def video_subtitle_file_get(self): - return _ctouni(emotion_object_video_subtitle_file_get(self.obj)) - def video_subtitle_file_set(self, file_name): - if isinstance(file_name, unicode): file_name = PyUnicode_AsUTF8String(file_name) - emotion_object_video_subtitle_file_set(self.obj, - file_name if file_name is not None else NULL) +# def video_subtitle_file_get(self): +# return _ctouni(emotion_object_video_subtitle_file_get(self.obj)) +# def video_subtitle_file_set(self, file_name): +# if isinstance(file_name, unicode): file_name = PyUnicode_AsUTF8String(file_name) +# emotion_object_video_subtitle_file_set(self.obj, +# file_name if file_name is not None else NULL) - property priority: - """ Raise the priority of an object so it will have a privileged - access to hardware resource. - - Hardware have a few dedicated hardware pipeline that process the video - at no cost for the CPU. Especially on SoC, you mostly have one (on - mobile phone SoC) or two (on Set Top Box SoC) when Picture in Picture - is needed. And most application just have a few video stream that really - deserve high frame rate, high quality output. That's why this call is for. - - .. note:: If Emotion can't acquire a privileged hardware resource, - it will fallback to the no-priority path. This work on the - first asking first get basis system. - - *True* means high priority. - - :type: bool +# property priority: +# """ Raise the priority of an object so it will have a privileged +# access to hardware resource. + +# Hardware have a few dedicated hardware pipeline that process the video +# at no cost for the CPU. Especially on SoC, you mostly have one (on +# mobile phone SoC) or two (on Set Top Box SoC) when Picture in Picture +# is needed. And most application just have a few video stream that really +# deserve high frame rate, high quality output. That's why this call is for. + +# .. note:: If Emotion can't acquire a privileged hardware resource, +# it will fallback to the no-priority path. This work on the +# first asking first get basis system. + +# *True* means high priority. + +# :type: bool - .. versionadded:: 1.8 +# .. versionadded:: 1.8 - """ - def __get__(self): - return bool(emotion_object_priority_get(self.obj)) +# """ +# def __get__(self): +# return bool(emotion_object_priority_get(self.obj)) - def __set__(self, value): - emotion_object_priority_set(self.obj, bool(value)) +# def __set__(self, value): +# emotion_object_priority_set(self.obj, bool(value)) - def priority_get(self): - return bool(emotion_object_priority_get(self.obj)) - def priority_set(self, value): - emotion_object_priority_set(self.obj, bool(value)) +# def priority_get(self): +# return bool(emotion_object_priority_get(self.obj)) +# def priority_set(self, value): +# emotion_object_priority_set(self.obj, bool(value)) - property suspend: - """ The state of an object pipeline. +# property suspend: +# """ The state of an object pipeline. - Changing the state of a pipeline should help preserve the battery of - an embedded device. But it will only work sanely if the pipeline - is not playing at the time you change its state. Depending on the - engine all state may be not implemented. +# Changing the state of a pipeline should help preserve the battery of +# an embedded device. But it will only work sanely if the pipeline +# is not playing at the time you change its state. Depending on the +# engine all state may be not implemented. - The options are: +# The options are: - - ``EMOTION_WAKEUP`` pipeline is up and running - - ``EMOTION_SLEEP`` turn off hardware resource usage like overlay - - ``EMOTION_DEEP_SLEEP`` destroy the pipeline, but keep full resolution - pixels output around - - ``EMOTION_HIBERNATE`` destroy the pipeline, and keep half resolution - or object resolution if lower +# - ``EMOTION_WAKEUP`` pipeline is up and running +# - ``EMOTION_SLEEP`` turn off hardware resource usage like overlay +# - ``EMOTION_DEEP_SLEEP`` destroy the pipeline, but keep full resolution +# pixels output around +# - ``EMOTION_HIBERNATE`` destroy the pipeline, and keep half resolution +# or object resolution if lower - :type: Emotion_Suspend +# :type: Emotion_Suspend - .. versionadded:: 1.8 +# .. versionadded:: 1.8 - """ - def __get__(self): - return emotion_object_suspend_get(self.obj) - def __set__(self, value): - emotion_object_suspend_set(self.obj, value) +# """ +# def __get__(self): +# return emotion_object_suspend_get(self.obj) +# def __set__(self, value): +# emotion_object_suspend_set(self.obj, value) - def suspend_get(self): - return emotion_object_suspend_get(self.obj) - def suspend_set(self, Emotion_Suspend a): - emotion_object_suspend_set(self.obj, a) +# def suspend_get(self): +# return emotion_object_suspend_get(self.obj) +# def suspend_set(self, Emotion_Suspend a): +# emotion_object_suspend_set(self.obj, a) - property buffer_size: - """ The percentual size of the buffering cache. +# property buffer_size: +# """ The percentual size of the buffering cache. - The buffer size is given as a number between 0.0 and 1.0, 0.0 means - the buffer if empty, 1.0 means full. - If no buffering is in progress 1.0 is returned. In all other cases (maybe - the backend don't support buffering) 1.0 is returned, thus you can always - check for buffer_size < 1.0 to know if buffering is in progress. +# The buffer size is given as a number between 0.0 and 1.0, 0.0 means +# the buffer if empty, 1.0 means full. +# If no buffering is in progress 1.0 is returned. In all other cases (maybe +# the backend don't support buffering) 1.0 is returned, thus you can always +# check for buffer_size < 1.0 to know if buffering is in progress. - :type: float - """ - def __get__(self): - return emotion_object_buffer_size_get(self.obj) +# :type: float +# """ +# def __get__(self): +# return emotion_object_buffer_size_get(self.obj) - def buffer_size_get(self): - return emotion_object_buffer_size_get(self.obj) +# def buffer_size_get(self): +# return emotion_object_buffer_size_get(self.obj) - property video_handled: - """ True if the loaded stream contain at least one video track +# property video_handled: +# """ True if the loaded stream contain at least one video track - :type: bool - """ - def __get__(self): - return bool(emotion_object_video_handled_get(self.obj)) +# :type: bool +# """ +# def __get__(self): +# return bool(emotion_object_video_handled_get(self.obj)) - def video_handled_get(self): - return bool(emotion_object_video_handled_get(self.obj)) +# def video_handled_get(self): +# return bool(emotion_object_video_handled_get(self.obj)) - property audio_handled: - """ True if the loaded stream contain at least one audio track +# property audio_handled: +# """ True if the loaded stream contain at least one audio track - :type: bool - """ - def __get__(self): - return bool(emotion_object_audio_handled_get(self.obj)) +# :type: bool +# """ +# def __get__(self): +# return bool(emotion_object_audio_handled_get(self.obj)) - def audio_handled_get(self): - return bool(emotion_object_audio_handled_get(self.obj)) +# def audio_handled_get(self): +# return bool(emotion_object_audio_handled_get(self.obj)) - property seekable: - """ Whether the media file is seekable. +# property seekable: +# """ Whether the media file is seekable. - :rtype: bool - """ - def __get__(self): - return bool(emotion_object_seekable_get(self.obj)) +# :rtype: bool +# """ +# def __get__(self): +# return bool(emotion_object_seekable_get(self.obj)) - def seekable_get(self): - return bool(emotion_object_seekable_get(self.obj)) +# def seekable_get(self): +# return bool(emotion_object_seekable_get(self.obj)) - property play_length: - """ The length of play for the media file. +# property play_length: +# """ The length of play for the media file. - The total length of the media file in seconds. +# The total length of the media file in seconds. - :type: float - """ - def __get__(self): - return emotion_object_play_length_get(self.obj) +# :type: float +# """ +# def __get__(self): +# return emotion_object_play_length_get(self.obj) - def play_length_get(self): - return emotion_object_play_length_get(self.obj) +# def play_length_get(self): +# return emotion_object_play_length_get(self.obj) - property play_speed: - """ The play speed of the media file. - - This sets the speed with which the media file will be played. 1.0 - represents the normal speed, 2 double speed, 0.5 half speed and so on. - - :type: float - - .. versionadded:: 1.8 - - """ - def __get__(self): - return emotion_object_play_speed_get(self.obj) - - def __set__(self, double value): - emotion_object_play_speed_set(self.obj, value) - - def play_speed_get(self): - return emotion_object_play_speed_get(self.obj) - def play_speed_set(self, double value): - emotion_object_play_speed_set(self.obj, value) - - property image_size: - """ The video size of the loaded file. - - This is the reported size of the loaded video file. If a file - that doesn't contain a video channel is loaded, then this size can be - ignored. - The value reported by this function should be consistent with the aspect - ratio returned by :py:attr:`ratio`, but sometimes the information - stored in the file is wrong. So use the ratio size reported by - py:func:`ratio_get()`, since it is more likely going to be accurate. - - :type: tuple of int (w, h) - """ - def __get__(self): - return self.image_size_get() - - def image_size_get(self): - cdef int w, h - emotion_object_size_get(self.obj, &w, &h) - return (w, h) - - property smooth_scale: - """ Whether to use of high-quality image scaling algorithm - of the given video object. - - When enabled, a higher quality video scaling algorithm is used when - scaling videos to sizes other than the source video. This gives - better results but is more computationally expensive. +# property play_speed: +# """ The play speed of the media file. + +# This sets the speed with which the media file will be played. 1.0 +# represents the normal speed, 2 double speed, 0.5 half speed and so on. + +# :type: float + +# .. versionadded:: 1.8 + +# """ +# def __get__(self): +# return emotion_object_play_speed_get(self.obj) + +# def __set__(self, double value): +# emotion_object_play_speed_set(self.obj, value) + +# def play_speed_get(self): +# return emotion_object_play_speed_get(self.obj) +# def play_speed_set(self, double value): +# emotion_object_play_speed_set(self.obj, value) + +# property image_size: +# """ The video size of the loaded file. + +# This is the reported size of the loaded video file. If a file +# that doesn't contain a video channel is loaded, then this size can be +# ignored. +# The value reported by this function should be consistent with the aspect +# ratio returned by :py:attr:`ratio`, but sometimes the information +# stored in the file is wrong. So use the ratio size reported by +# py:func:`ratio_get()`, since it is more likely going to be accurate. + +# :type: tuple of int (w, h) +# """ +# def __get__(self): +# return self.image_size_get() + +# def image_size_get(self): +# cdef int w, h +# emotion_object_size_get(self.obj, &w, &h) +# return (w, h) + +# property smooth_scale: +# """ Whether to use of high-quality image scaling algorithm +# of the given video object. + +# When enabled, a higher quality video scaling algorithm is used when +# scaling videos to sizes other than the source video. This gives +# better results but is more computationally expensive. - :type: bool - """ - def __get__(self): - return self.smooth_scale_get() +# :type: bool +# """ +# def __get__(self): +# return self.smooth_scale_get() - def __set__(self, int value): - self.smooth_scale_set(value) - - def smooth_scale_get(self): - return bool(emotion_object_smooth_scale_get(self.obj)) - def smooth_scale_set(self, int value): - emotion_object_smooth_scale_set(self.obj, value) +# def __set__(self, int value): +# self.smooth_scale_set(value) + +# def smooth_scale_get(self): +# return bool(emotion_object_smooth_scale_get(self.obj)) +# def smooth_scale_set(self, int value): +# emotion_object_smooth_scale_set(self.obj, value) - property ratio: - """ The video aspect ratio of the media file loaded. - - This function returns the video aspect ratio (width / height) of the file - loaded. It can be used to adapt the size of the emotion object in the canvas, - so the aspect won't be changed (by wrongly resizing the object). Or to crop - the video correctly, if necessary. +# property ratio: +# """ The video aspect ratio of the media file loaded. + +# This function returns the video aspect ratio (width / height) of the file +# loaded. It can be used to adapt the size of the emotion object in the canvas, +# so the aspect won't be changed (by wrongly resizing the object). Or to crop +# the video correctly, if necessary. - The described behavior can be applied like following. Consider a given - emotion object that we want to position inside an area, which we will - represent by *w* and *h*. Since we want to position this object either - stretching, or filling the entire area but overflowing the video, or just - adjust the video to fit inside the area without keeping the aspect ratio, we - must compare the video aspect ratio with the area aspect ratio:: - - w = 200; h = 300; # an arbitrary value which represents the area where - # the video would be placed - obj = Emotion(...) - r = w / h - vr = obj.ratio - - Now, if we want to make the video fit inside the area, the following code - would do it:: - - if vr > r: # the video is wider than the area - vw = w - vh = w / vr - else: # the video is taller than the area - vh = h - vw = h * vr - obj.size = (vw, vh) - - And for keeping the aspect ratio but making the video fill the entire area, - overflowing the content which can't fit inside it, we would do:: - - if vr > r: # the video is wider than the area - vh = h - vw = h * vr - else: # the video is taller than the area - vw = w - vh = w / vr - obj.size = (vw, vh) - - Finally, by just resizing the video to the video area, we would have the - video stretched:: - - vw = w - vh = h - obj.size = (vw, vh) - - .. note:: This function returns the aspect ratio that the video *should* be, but - sometimes the reported size from emotion_object_size_get() represents a - different aspect ratio. You can safely resize the video to respect the aspect - ratio returned by *this* function. - - :type: float - """ - def __get__(self): - return emotion_object_ratio_get(self.obj) - - def ratio_get(self): - return emotion_object_ratio_get(self.obj) - - property audio_volume: - """ The audio volume. - - The current value for the audio volume level. Range is from 0.0 to 1.0. - - Sets the audio volume of the stream being played. This has nothing to do with - the system volume. This volume will be multiplied by the system volume. e.g.: - if the current volume level is 0.5, and the system volume is 50%, it will be - * 0.5 * 0.5 = 0.25. - - .. note:: The default value depends on the module used. This value - doesn't get changed when another file is loaded. - - :type: float - """ - def __get__(self): - return emotion_object_audio_volume_get(self.obj) - - def __set__(self, double value): - emotion_object_audio_volume_set(self.obj, value) - - def audio_volume_get(self): - return emotion_object_audio_volume_get(self.obj) - def audio_volume_set(self, double value): - emotion_object_audio_volume_set(self.obj, value) - - property audio_mute: - """ The mute audio option for this object. - - :type: bool - """ - def __get__(self): - return bool(emotion_object_audio_mute_get(self.obj)) - - def __set__(self, int value): - emotion_object_audio_mute_set(self.obj, bool(value)) - - def audio_mute_get(self): - return emotion_object_audio_mute_get(self.obj) - def audio_mute_set(self, int value): - emotion_object_audio_mute_set(self.obj, value) - - property video_mute: - """ The mute video option for this object. - - :type: bool - """ - def __get__(self): - return emotion_object_video_mute_get(self.obj) - - def __set__(self, int value): - emotion_object_video_mute_set(self.obj, value) - - def video_mute_get(self): - return emotion_object_video_mute_get(self.obj) - def video_mute_set(self, int value): - emotion_object_video_mute_set(self.obj, value) +# The described behavior can be applied like following. Consider a given +# emotion object that we want to position inside an area, which we will +# represent by *w* and *h*. Since we want to position this object either +# stretching, or filling the entire area but overflowing the video, or just +# adjust the video to fit inside the area without keeping the aspect ratio, we +# must compare the video aspect ratio with the area aspect ratio:: + +# w = 200; h = 300; # an arbitrary value which represents the area where +# # the video would be placed +# obj = Emotion(...) +# r = w / h +# vr = obj.ratio + +# Now, if we want to make the video fit inside the area, the following code +# would do it:: + +# if vr > r: # the video is wider than the area +# vw = w +# vh = w / vr +# else: # the video is taller than the area +# vh = h +# vw = h * vr +# obj.size = (vw, vh) + +# And for keeping the aspect ratio but making the video fill the entire area, +# overflowing the content which can't fit inside it, we would do:: + +# if vr > r: # the video is wider than the area +# vh = h +# vw = h * vr +# else: # the video is taller than the area +# vw = w +# vh = w / vr +# obj.size = (vw, vh) + +# Finally, by just resizing the video to the video area, we would have the +# video stretched:: + +# vw = w +# vh = h +# obj.size = (vw, vh) + +# .. note:: This function returns the aspect ratio that the video *should* be, but +# sometimes the reported size from emotion_object_size_get() represents a +# different aspect ratio. You can safely resize the video to respect the aspect +# ratio returned by *this* function. + +# :type: float +# """ +# def __get__(self): +# return emotion_object_ratio_get(self.obj) + +# def ratio_get(self): +# return emotion_object_ratio_get(self.obj) + +# property audio_volume: +# """ The audio volume. + +# The current value for the audio volume level. Range is from 0.0 to 1.0. + +# Sets the audio volume of the stream being played. This has nothing to do with +# the system volume. This volume will be multiplied by the system volume. e.g.: +# if the current volume level is 0.5, and the system volume is 50%, it will be +# * 0.5 * 0.5 = 0.25. + +# .. note:: The default value depends on the module used. This value +# doesn't get changed when another file is loaded. + +# :type: float +# """ +# def __get__(self): +# return emotion_object_audio_volume_get(self.obj) + +# def __set__(self, double value): +# emotion_object_audio_volume_set(self.obj, value) + +# def audio_volume_get(self): +# return emotion_object_audio_volume_get(self.obj) +# def audio_volume_set(self, double value): +# emotion_object_audio_volume_set(self.obj, value) + +# property audio_mute: +# """ The mute audio option for this object. + +# :type: bool +# """ +# def __get__(self): +# return bool(emotion_object_audio_mute_get(self.obj)) + +# def __set__(self, int value): +# emotion_object_audio_mute_set(self.obj, bool(value)) + +# def audio_mute_get(self): +# return emotion_object_audio_mute_get(self.obj) +# def audio_mute_set(self, int value): +# emotion_object_audio_mute_set(self.obj, value) + +# property video_mute: +# """ The mute video option for this object. + +# :type: bool +# """ +# def __get__(self): +# return emotion_object_video_mute_get(self.obj) + +# def __set__(self, int value): +# emotion_object_video_mute_set(self.obj, value) + +# def video_mute_get(self): +# return emotion_object_video_mute_get(self.obj) +# def video_mute_set(self, int value): +# emotion_object_video_mute_set(self.obj, value) - property spu_mute: - """ The SPU muted state. - - :type: bool - """ - def __get__(self): - return bool(emotion_object_spu_mute_get(self.obj)) +# property spu_mute: +# """ The SPU muted state. + +# :type: bool +# """ +# def __get__(self): +# return bool(emotion_object_spu_mute_get(self.obj)) - def __set__(self, int value): - emotion_object_spu_mute_set(self.obj, bool(value)) +# def __set__(self, int value): +# emotion_object_spu_mute_set(self.obj, bool(value)) - def spu_mute_get(self): - return bool(emotion_object_spu_mute_get(self.obj)) - def spu_mute_set(self, int value): - emotion_object_spu_mute_set(self.obj, bool(value)) +# def spu_mute_get(self): +# return bool(emotion_object_spu_mute_get(self.obj)) +# def spu_mute_set(self, int value): +# emotion_object_spu_mute_set(self.obj, bool(value)) - def audio_channel_count(self): - """ Get the number of audio channels available in the loaded media. +# def audio_channel_count(self): +# """ Get the number of audio channels available in the loaded media. - :return: the number of channels - :rtype: int - """ - return emotion_object_audio_channel_count(self.obj) +# :return: the number of channels +# :rtype: int +# """ +# return emotion_object_audio_channel_count(self.obj) - def audio_channel_name_get(self, int channel): - """ Get the name of the given channel. +# def audio_channel_name_get(self, int channel): +# """ Get the name of the given channel. - :return: the name - :rtype: str - """ - return _ctouni(emotion_object_audio_channel_name_get(self.obj, channel)) +# :return: the name +# :rtype: str +# """ +# return _ctouni(emotion_object_audio_channel_name_get(self.obj, channel)) - property audio_channel: - """ The currently selected audio channel. +# property audio_channel: +# """ The currently selected audio channel. - :type: int - """ - def __get__(self): - return emotion_object_audio_channel_get(self.obj) +# :type: int +# """ +# def __get__(self): +# return emotion_object_audio_channel_get(self.obj) - def __set__(self, int value): - emotion_object_audio_channel_set(self.obj, value) +# def __set__(self, int value): +# emotion_object_audio_channel_set(self.obj, value) - def audio_channel_get(self): - return emotion_object_audio_channel_get(self.obj) - def audio_channel_set(self, int channel): - emotion_object_audio_channel_set(self.obj, channel) +# def audio_channel_get(self): +# return emotion_object_audio_channel_get(self.obj) +# def audio_channel_set(self, int channel): +# emotion_object_audio_channel_set(self.obj, channel) - def video_channel_count(self): - """ Get the number of video channels available in the loaded media. +# def video_channel_count(self): +# """ Get the number of video channels available in the loaded media. - :return: the number of channels - :rtype: int - """ - return emotion_object_video_channel_count(self.obj) +# :return: the number of channels +# :rtype: int +# """ +# return emotion_object_video_channel_count(self.obj) - def video_channel_name_get(self, int channel): - """ Get the name of the given channel. +# def video_channel_name_get(self, int channel): +# """ Get the name of the given channel. - :return: the name - :rtype: str - """ - return _ctouni(emotion_object_video_channel_name_get(self.obj, channel)) +# :return: the name +# :rtype: str +# """ +# return _ctouni(emotion_object_video_channel_name_get(self.obj, channel)) - property video_channel: - """ The currently selected video channel. +# property video_channel: +# """ The currently selected video channel. - :type: int - """ - def __get__(self): - return emotion_object_video_channel_get(self.obj) +# :type: int +# """ +# def __get__(self): +# return emotion_object_video_channel_get(self.obj) - def __set__(self, int value): - emotion_object_video_channel_set(self.obj, value) +# def __set__(self, int value): +# emotion_object_video_channel_set(self.obj, value) - def video_channel_get(self): - return emotion_object_video_channel_get(self.obj) - def video_channel_set(self, int value): - emotion_object_video_channel_set(self.obj, value) +# def video_channel_get(self): +# return emotion_object_video_channel_get(self.obj) +# def video_channel_set(self, int value): +# emotion_object_video_channel_set(self.obj, value) - def spu_channel_count(self): - """ Get the number of SPU channels available in the loaded media. +# def spu_channel_count(self): +# """ Get the number of SPU channels available in the loaded media. - :return: the number of channels - :rtype: int - """ - return emotion_object_spu_channel_count(self.obj) +# :return: the number of channels +# :rtype: int +# """ +# return emotion_object_spu_channel_count(self.obj) - def spu_channel_name_get(self, int channel): - """ Get the name of the given channel. +# def spu_channel_name_get(self, int channel): +# """ Get the name of the given channel. - :return: the name - :rtype: str - """ - return _ctouni(emotion_object_spu_channel_name_get(self.obj, channel)) +# :return: the name +# :rtype: str +# """ +# return _ctouni(emotion_object_spu_channel_name_get(self.obj, channel)) - property spu_channel: - """ The currently selected SPU channel. +# property spu_channel: +# """ The currently selected SPU channel. - :type: int - """ - def __get__(self): - return emotion_object_spu_channel_get(self.obj) +# :type: int +# """ +# def __get__(self): +# return emotion_object_spu_channel_get(self.obj) - def __set__(self, int value): - emotion_object_spu_channel_set(self.obj, value) +# def __set__(self, int value): +# emotion_object_spu_channel_set(self.obj, value) - def spu_channel_get(self): - return emotion_object_spu_channel_get(self.obj) - def spu_channel_set(self, int value): - emotion_object_spu_channel_set(self.obj, value) +# def spu_channel_get(self): +# return emotion_object_spu_channel_get(self.obj) +# def spu_channel_set(self, int value): +# emotion_object_spu_channel_set(self.obj, value) - property spu_button_count: - """ SPU button count +# property spu_button_count: +# """ SPU button count - :type: int - """ - def __get__(self): - return self.spu_button_count_get() +# :type: int +# """ +# def __get__(self): +# return self.spu_button_count_get() - def spu_button_count_get(self): - return emotion_object_spu_button_count_get(self.obj) +# def spu_button_count_get(self): +# return emotion_object_spu_button_count_get(self.obj) - property spu_button: - """ SPU button +# property spu_button: +# """ SPU button - :type: int - """ - def __get__(self): - return self.spu_button_get() +# :type: int +# """ +# def __get__(self): +# return self.spu_button_get() - def spu_button_get(self): - return emotion_object_spu_button_get(self.obj) +# def spu_button_get(self): +# return emotion_object_spu_button_get(self.obj) - def chapter_count(self): - """ Return the number of chapters in the stream. +# def chapter_count(self): +# """ Return the number of chapters in the stream. - :rtype: int - """ - return emotion_object_chapter_count(self.obj) +# :rtype: int +# """ +# return emotion_object_chapter_count(self.obj) - def chapter_name_get(self, int chapter): - """ Get the name of the given chapter. +# def chapter_name_get(self, int chapter): +# """ Get the name of the given chapter. - :param chapter: the chapter number - :type chapter: int - :return: the name of the chapter - :rtype: str - """ - return _ctouni(emotion_object_chapter_name_get(self.obj, chapter)) +# :param chapter: the chapter number +# :type chapter: int +# :return: the name of the chapter +# :rtype: str +# """ +# return _ctouni(emotion_object_chapter_name_get(self.obj, chapter)) - property chapter: - """ The currently selected chapter. +# property chapter: +# """ The currently selected chapter. - :type: int - """ - def __get__(self): - return emotion_object_chapter_get(self.obj) +# :type: int +# """ +# def __get__(self): +# return emotion_object_chapter_get(self.obj) - def __set__(self, int value): - emotion_object_chapter_set(self.obj, value) +# def __set__(self, int value): +# emotion_object_chapter_set(self.obj, value) - def chapter_get(self): - return emotion_object_chapter_get(self.obj) - def chapter_set(self, int value): - emotion_object_chapter_set(self.obj, value) +# def chapter_get(self): +# return emotion_object_chapter_get(self.obj) +# def chapter_set(self, int value): +# emotion_object_chapter_set(self.obj, value) - def eject(self): - """ Eject the media """ - emotion_object_eject(self.obj) +# def eject(self): +# """ Eject the media """ +# emotion_object_eject(self.obj) - property title: - """ The dvd title from this emotion object. +# property title: +# """ The dvd title from this emotion object. - .. note:: This function is only useful when playing a DVD. - - :type: str - """ - def __get__(self): - return _ctouni(emotion_object_title_get(self.obj)) +# .. note:: This function is only useful when playing a DVD. + +# :type: str +# """ +# def __get__(self): +# return _ctouni(emotion_object_title_get(self.obj)) - def title_get(self): - return _ctouni(emotion_object_title_get(self.obj)) - - property progress_info: - """ How much of the file has been played. +# def title_get(self): +# return _ctouni(emotion_object_title_get(self.obj)) + +# property progress_info: +# """ How much of the file has been played. - .. warning:: gstreamer xine backends don't implement this(will return None). +# .. warning:: gstreamer xine backends don't implement this(will return None). - :type: str - """ - def __get__(self): - return _ctouni(emotion_object_progress_info_get(self.obj)) +# :type: str +# """ +# def __get__(self): +# return _ctouni(emotion_object_progress_info_get(self.obj)) - def progress_info_get(self): - return _ctouni(emotion_object_progress_info_get(self.obj)) +# def progress_info_get(self): +# return _ctouni(emotion_object_progress_info_get(self.obj)) - property progress_status: - """ How much of the file has been played. +# property progress_status: +# """ How much of the file has been played. - The progress in playing the file, the value is in the [0, 1] range. +# The progress in playing the file, the value is in the [0, 1] range. - .. warning:: gstreamer xine backends don't implement this(will return 0). +# .. warning:: gstreamer xine backends don't implement this(will return 0). - :type: float - """ - def __get__(self): - return emotion_object_progress_status_get(self.obj) +# :type: float +# """ +# def __get__(self): +# return emotion_object_progress_status_get(self.obj) - def progress_status_get(self): - return emotion_object_progress_status_get(self.obj) +# def progress_status_get(self): +# return emotion_object_progress_status_get(self.obj) - property ref_file: - """ ref file +# property ref_file: +# """ ref file - :type: str - """ - def __get__(self): - return _ctouni(emotion_object_ref_file_get(self.obj)) +# :type: str +# """ +# def __get__(self): +# return _ctouni(emotion_object_ref_file_get(self.obj)) - def ref_file_get(self): - return _ctouni(emotion_object_ref_file_get(self.obj)) +# def ref_file_get(self): +# return _ctouni(emotion_object_ref_file_get(self.obj)) - property ref_num: - """ ref number +# property ref_num: +# """ ref number - :type: int - """ - def __get__(self): - return emotion_object_ref_num_get(self.obj) +# :type: int +# """ +# def __get__(self): +# return emotion_object_ref_num_get(self.obj) - def ref_num_get(self): - return emotion_object_ref_num_get(self.obj) +# def ref_num_get(self): +# return emotion_object_ref_num_get(self.obj) - def meta_info_get(self, int meta_id): - """ Retrieve meta information from this file being played. +# def meta_info_get(self, int meta_id): +# """ Retrieve meta information from this file being played. - This function retrieves information about the file loaded. It can retrieve - the track title, artist name, album name, etc. +# This function retrieves information about the file loaded. It can retrieve +# the track title, artist name, album name, etc. - :param meta_id: The type of meta information that will be extracted. - :type meta_id: int - :return: The info or None - :rtype: str +# :param meta_id: The type of meta information that will be extracted. +# :type meta_id: int +# :return: The info or None +# :rtype: str - :see also: meta_info_dict_get(). - :see also: Emotion_Meta_Info for all the possibilities. - """ - return _ctouni(emotion_object_meta_info_get(self.obj, meta_id)) +# :see also: meta_info_dict_get(). +# :see also: Emotion_Meta_Info for all the possibilities. +# """ +# return _ctouni(emotion_object_meta_info_get(self.obj, meta_id)) - def meta_info_dict_get(self): - """ Get a python dictionary with all the know info. +# def meta_info_dict_get(self): +# """ Get a python dictionary with all the know info. - :return: all the know meta info for the media file - :rtype: dict - """ - cdef const char *info - ret = dict() - lst = (("title", EMOTION_META_INFO_TRACK_TITLE), - ("artist", EMOTION_META_INFO_TRACK_ARTIST), - ("album", EMOTION_META_INFO_TRACK_ALBUM), - ("year", EMOTION_META_INFO_TRACK_YEAR), - ("genre", EMOTION_META_INFO_TRACK_GENRE), - ("comment", EMOTION_META_INFO_TRACK_COMMENT), - ("disc_id", EMOTION_META_INFO_TRACK_DISC_ID), - ("track_count", EMOTION_META_INFO_TRACK_COUNT)) - for n, i in lst: - info = emotion_object_meta_info_get(self.obj, i) - if info != NULL: - ret[n] = info - ret[i] = info - return ret +# :return: all the know meta info for the media file +# :rtype: dict +# """ +# cdef const char *info +# ret = dict() +# lst = (("title", EMOTION_META_INFO_TRACK_TITLE), +# ("artist", EMOTION_META_INFO_TRACK_ARTIST), +# ("album", EMOTION_META_INFO_TRACK_ALBUM), +# ("year", EMOTION_META_INFO_TRACK_YEAR), +# ("genre", EMOTION_META_INFO_TRACK_GENRE), +# ("comment", EMOTION_META_INFO_TRACK_COMMENT), +# ("disc_id", EMOTION_META_INFO_TRACK_DISC_ID), +# ("track_count", EMOTION_META_INFO_TRACK_COUNT)) +# for n, i in lst: +# info = emotion_object_meta_info_get(self.obj, i) +# if info != NULL: +# ret[n] = info +# ret[i] = info +# return ret - property meta_info_dict: - def __get__(self): - return self.meta_info_dict_get() +# property meta_info_dict: +# def __get__(self): +# return self.meta_info_dict_get() - def last_position_load(self): - """ Load the last known position if available +# def last_position_load(self): +# """ Load the last known position if available - By using Xattr, Emotion is able, if the system permits it, to store - and retrieve the latest position. It should trigger some smart - callback to let the application know when it succeed or fail. - Every operation is fully asynchronous and not linked to the actual - engine used to play the video. +# By using Xattr, Emotion is able, if the system permits it, to store +# and retrieve the latest position. It should trigger some smart +# callback to let the application know when it succeed or fail. +# Every operation is fully asynchronous and not linked to the actual +# engine used to play the video. - .. versionadded:: 1.8 - - """ - emotion_object_last_position_load(self.obj) - - def last_position_save(self): - """ Save the last position if possible - - :see: :py:meth:`last_position_load` - - .. versionadded:: 1.8 - - """ - emotion_object_last_position_save(self.obj) - - def image_get(self): - """ Get the actual image object (:py:class:`efl.evas.Object`) of the - emotion object. - - This function is useful when you want to get a direct access to the pixels. - - .. versionadded:: 1.8 - - """ - return object_from_instance(emotion_object_image_get(self.obj)) - - property vis: - # TODO: document this - def __get__(self): - return emotion_object_vis_get(self.obj) - - def __set__(self, Emotion_Vis vis): - emotion_object_vis_set(self.obj, vis) - - def vis_get(self): - return emotion_object_vis_get(self.obj) - def vis_set(self, Emotion_Vis vis): - emotion_object_vis_set(self.obj, vis) - def vis_supported(self, Emotion_Vis vis): - return emotion_object_vis_supported(self.obj, vis) - - def event_simple_send(self, int event_id): - """ Send a named signal to the object. - - :param event_id: the signal to emit, one of EMOTION_EVENT_MENU1, - EMOTION_EVENT_MENU2, EMOTION_EVENT_UP, EMOTION_EVENT_1, - or any other EMOTION_EVENT_* definition - :type event_id: Emotion_Event - """ - emotion_object_event_simple_send(self.obj, event_id) - - def callback_add(self, event, func, *args, **kargs): - """ Add a new function (**func**) to be called on the specific **event**. - - The expected signature for **func** is:: - - func(object, *args, **kwargs) - - .. note:: Any extra params given to the function (both positional - and keyword arguments) will be passed back in the - callback function. - - :see also: All the on_*_add() shortcut functions - - :param event: the name of the event - :type event: str - :param func: the function to call - :type func: callable - - """ - e = intern(event) - lst = self._emotion_callbacks.setdefault(e, []) - if not lst: - if isinstance(event, unicode): event = PyUnicode_AsUTF8String(event) - evas_object_smart_callback_add(self.obj, - event if event is not None else NULL, - _emotion_callback, e) - lst.append((func, args, kargs)) - - def callback_del(self, event, func): - """ Stop the given function **func** to be called on **event** - - :see also: all the on_*_add() shortcut functions - - :param event: the name of the event - :type event: str - :param func: the function that was previously attached - :type func: callable - - """ - try: - lst = self._emotion_callbacks[event] - except KeyError: - raise ValueError("function %s not associated with event %r" % - (func, event)) - - i = -1 - for i, (f, a, k) in enumerate(lst): - if func == f: - break - else: - raise ValueError("function %s not associated with event %r" % - (func, event)) - lst.pop(i) - if lst: - return - self._emotion_callbacks.pop(event) - if isinstance(event, unicode): event = PyUnicode_AsUTF8String(event) - evas_object_smart_callback_del(self.obj, - event if event is not None else NULL, - _emotion_callback) - - def on_frame_decode_add(self, func, *args, **kargs): - """Same as calling: callback_add('frame_decode', func, ...)""" - self.callback_add("frame_decode", func, *args, **kargs) - - def on_frame_decode_del(self, func): - """Same as calling: callback_del('frame_decode', func)""" - self.callback_del("frame_decode", func) - - def on_frame_resize_add(self, func, *args, **kargs): - """Same as calling: callback_add('frame_resize', func, ...)""" - self.callback_add("frame_resize", func, *args, **kargs) - - def on_frame_resize_del(self, func): - """Same as calling: callback_del('frame_resize', func)""" - self.callback_del("frame_resize", func) - - def on_length_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('length_change', func, ...)""" - self.callback_add("length_change", func, *args, **kargs) - - def on_length_change_del(self, func): - """Same as calling: callback_del('length_change', func)""" - self.callback_del("length_change", func) - - def on_decode_stop_add(self, func, *args, **kargs): - """Same as calling: callback_add('decode_stop', func, ...)""" - self.callback_add("decode_stop", func, *args, **kargs) - - def on_decode_stop_del(self, func): - """Same as calling: callback_del('decode_stop', func)""" - self.callback_del("decode_stop", func) +# .. versionadded:: 1.8 + +# """ +# emotion_object_last_position_load(self.obj) + +# def last_position_save(self): +# """ Save the last position if possible + +# :see: :py:meth:`last_position_load` + +# .. versionadded:: 1.8 + +# """ +# emotion_object_last_position_save(self.obj) + +# def image_get(self): +# """ Get the actual image object (:py:class:`efl.evas.Object`) of the +# emotion object. + +# This function is useful when you want to get a direct access to the pixels. + +# .. versionadded:: 1.8 + +# """ +# return object_from_instance(emotion_object_image_get(self.obj)) + +# property vis: +# # TODO: document this +# def __get__(self): +# return emotion_object_vis_get(self.obj) + +# def __set__(self, Emotion_Vis vis): +# emotion_object_vis_set(self.obj, vis) + +# def vis_get(self): +# return emotion_object_vis_get(self.obj) +# def vis_set(self, Emotion_Vis vis): +# emotion_object_vis_set(self.obj, vis) +# def vis_supported(self, Emotion_Vis vis): +# return emotion_object_vis_supported(self.obj, vis) + +# def event_simple_send(self, int event_id): +# """ Send a named signal to the object. + +# :param event_id: the signal to emit, one of EMOTION_EVENT_MENU1, +# EMOTION_EVENT_MENU2, EMOTION_EVENT_UP, EMOTION_EVENT_1, +# or any other EMOTION_EVENT_* definition +# :type event_id: Emotion_Event +# """ +# emotion_object_event_simple_send(self.obj, event_id) + +# def callback_add(self, event, func, *args, **kargs): +# """ Add a new function (**func**) to be called on the specific **event**. + +# The expected signature for **func** is:: + +# func(object, *args, **kwargs) + +# .. note:: Any extra params given to the function (both positional +# and keyword arguments) will be passed back in the +# callback function. + +# :see also: All the on_*_add() shortcut functions + +# :param event: the name of the event +# :type event: str +# :param func: the function to call +# :type func: callable + +# """ +# e = intern(event) +# lst = self._emotion_callbacks.setdefault(e, []) +# if not lst: +# if isinstance(event, unicode): event = PyUnicode_AsUTF8String(event) +# evas_object_smart_callback_add(self.obj, +# event if event is not None else NULL, +# _emotion_callback, e) +# lst.append((func, args, kargs)) + +# def callback_del(self, event, func): +# """ Stop the given function **func** to be called on **event** + +# :see also: all the on_*_add() shortcut functions + +# :param event: the name of the event +# :type event: str +# :param func: the function that was previously attached +# :type func: callable + +# """ +# try: +# lst = self._emotion_callbacks[event] +# except KeyError: +# raise ValueError("function %s not associated with event %r" % +# (func, event)) + +# i = -1 +# for i, (f, a, k) in enumerate(lst): +# if func == f: +# break +# else: +# raise ValueError("function %s not associated with event %r" % +# (func, event)) +# lst.pop(i) +# if lst: +# return +# self._emotion_callbacks.pop(event) +# if isinstance(event, unicode): event = PyUnicode_AsUTF8String(event) +# evas_object_smart_callback_del(self.obj, +# event if event is not None else NULL, +# _emotion_callback) + +# def on_frame_decode_add(self, func, *args, **kargs): +# """Same as calling: callback_add('frame_decode', func, ...)""" +# self.callback_add("frame_decode", func, *args, **kargs) + +# def on_frame_decode_del(self, func): +# """Same as calling: callback_del('frame_decode', func)""" +# self.callback_del("frame_decode", func) + +# def on_frame_resize_add(self, func, *args, **kargs): +# """Same as calling: callback_add('frame_resize', func, ...)""" +# self.callback_add("frame_resize", func, *args, **kargs) + +# def on_frame_resize_del(self, func): +# """Same as calling: callback_del('frame_resize', func)""" +# self.callback_del("frame_resize", func) + +# def on_length_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('length_change', func, ...)""" +# self.callback_add("length_change", func, *args, **kargs) + +# def on_length_change_del(self, func): +# """Same as calling: callback_del('length_change', func)""" +# self.callback_del("length_change", func) + +# def on_decode_stop_add(self, func, *args, **kargs): +# """Same as calling: callback_add('decode_stop', func, ...)""" +# self.callback_add("decode_stop", func, *args, **kargs) + +# def on_decode_stop_del(self, func): +# """Same as calling: callback_del('decode_stop', func)""" +# self.callback_del("decode_stop", func) - def on_channels_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('channels_change', func, ...)""" - self.callback_add("channels_change", func, *args, **kargs) +# def on_channels_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('channels_change', func, ...)""" +# self.callback_add("channels_change", func, *args, **kargs) - def on_channels_change_del(self, func): - """Same as calling: callback_del('channels_change', func)""" - self.callback_del("channels_change", func) +# def on_channels_change_del(self, func): +# """Same as calling: callback_del('channels_change', func)""" +# self.callback_del("channels_change", func) - def on_title_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('title_change', func, ...)""" - self.callback_add("title_change", func, *args, **kargs) +# def on_title_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('title_change', func, ...)""" +# self.callback_add("title_change", func, *args, **kargs) - def on_title_change_del(self, func): - """Same as calling: callback_del('title_change', func)""" - self.callback_del("title_change", func) +# def on_title_change_del(self, func): +# """Same as calling: callback_del('title_change', func)""" +# self.callback_del("title_change", func) - def on_progress_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('progress_change', func, ...)""" - self.callback_add("progress_change", func, *args, **kargs) +# def on_progress_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('progress_change', func, ...)""" +# self.callback_add("progress_change", func, *args, **kargs) - def on_progress_change_del(self, func): - """Same as calling: callback_del('progress_change', func)""" - self.callback_del("progress_change", func) +# def on_progress_change_del(self, func): +# """Same as calling: callback_del('progress_change', func)""" +# self.callback_del("progress_change", func) - def on_ref_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('ref_change', func, ...)""" - self.callback_add("ref_change", func, *args, **kargs) +# def on_ref_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('ref_change', func, ...)""" +# self.callback_add("ref_change", func, *args, **kargs) - def on_ref_change_del(self, func): - """Same as calling: callback_del('ref_change', func)""" - self.callback_del("ref_change", func) +# def on_ref_change_del(self, func): +# """Same as calling: callback_del('ref_change', func)""" +# self.callback_del("ref_change", func) - def on_button_num_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('button_num_change', func, ...)""" - self.callback_add("button_num_change", func, *args, **kargs) +# def on_button_num_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('button_num_change', func, ...)""" +# self.callback_add("button_num_change", func, *args, **kargs) - def on_button_num_change_del(self, func): - """Same as calling: callback_del('button_num_change', func)""" - self.callback_del("button_num_change", func) +# def on_button_num_change_del(self, func): +# """Same as calling: callback_del('button_num_change', func)""" +# self.callback_del("button_num_change", func) - def on_button_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('button_change', func, ...)""" - self.callback_add("button_change", func, *args, **kargs) +# def on_button_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('button_change', func, ...)""" +# self.callback_add("button_change", func, *args, **kargs) - def on_button_change_del(self, func): - """Same as calling: callback_del('button_change', func)""" - self.callback_del("button_change", func) +# def on_button_change_del(self, func): +# """Same as calling: callback_del('button_change', func)""" +# self.callback_del("button_change", func) - def on_playback_finished_add(self, func, *args, **kargs): - """Same as calling: callback_add('playback_finished', func, ...)""" - self.callback_add("playback_finished", func, *args, **kargs) +# def on_playback_finished_add(self, func, *args, **kargs): +# """Same as calling: callback_add('playback_finished', func, ...)""" +# self.callback_add("playback_finished", func, *args, **kargs) - def on_playback_finished_del(self, func): - """Same as calling: callback_del('playback_finished', func)""" - self.callback_del("playback_finished", func) +# def on_playback_finished_del(self, func): +# """Same as calling: callback_del('playback_finished', func)""" +# self.callback_del("playback_finished", func) - def on_audio_level_change_add(self, func, *args, **kargs): - """Same as calling: callback_add('audio_level_change', func, ...)""" - self.callback_add("audio_level_change", func, *args, **kargs) +# def on_audio_level_change_add(self, func, *args, **kargs): +# """Same as calling: callback_add('audio_level_change', func, ...)""" +# self.callback_add("audio_level_change", func, *args, **kargs) - def on_audio_level_change_del(self, func): - """Same as calling: callback_del('audio_level_change', func)""" - self.callback_del("audio_level_change", func) +# def on_audio_level_change_del(self, func): +# """Same as calling: callback_del('audio_level_change', func)""" +# self.callback_del("audio_level_change", func) - def on_position_update_add(self, func, *args, **kargs): - """Same as calling: callback_add('position_update', func, ...) +# def on_position_update_add(self, func, *args, **kargs): +# """Same as calling: callback_add('position_update', func, ...) - .. versionadded:: 1.11 """ - self.callback_add("position_update", func, *args, **kargs) +# .. versionadded:: 1.11 """ +# self.callback_add("position_update", func, *args, **kargs) - def on_position_update_del(self, func): - """Same as calling: callback_del('position_update', func) +# def on_position_update_del(self, func): +# """Same as calling: callback_del('position_update', func) - .. versionadded:: 1.11 """ - self.callback_del("position_update", func) +# .. versionadded:: 1.11 """ +# self.callback_del("position_update", func) - def on_playback_started_add(self, func, *args, **kargs): - """Same as calling: callback_add('playback_started', func, ...) +# def on_playback_started_add(self, func, *args, **kargs): +# """Same as calling: callback_add('playback_started', func, ...) - .. versionadded:: 1.11 """ - self.callback_add("playback_started", func, *args, **kargs) +# .. versionadded:: 1.11 """ +# self.callback_add("playback_started", func, *args, **kargs) - def on_playback_started_del(self, func): - """Same as calling: callback_del('playback_started', func) +# def on_playback_started_del(self, func): +# """Same as calling: callback_del('playback_started', func) - .. versionadded:: 1.11 """ - self.callback_del("playback_started", func) +# .. versionadded:: 1.11 """ +# self.callback_del("playback_started", func) - def on_open_done_add(self, func, *args, **kargs): - """Same as calling: callback_add('open_done', func, ...) +# def on_open_done_add(self, func, *args, **kargs): +# """Same as calling: callback_add('open_done', func, ...) - .. versionadded:: 1.11 """ - self.callback_add("open_done", func, *args, **kargs) +# .. versionadded:: 1.11 """ +# self.callback_add("open_done", func, *args, **kargs) - def on_open_done_del(self, func): - """Same as calling: callback_del('open_done', func) +# def on_open_done_del(self, func): +# """Same as calling: callback_del('open_done', func) - .. versionadded:: 1.11 """ - self.callback_del("open_done", func) +# .. versionadded:: 1.11 """ +# self.callback_del("open_done", func) - def on_position_save_succeed_add(self, func, *args, **kargs): - """Same as calling: callback_add('position_save,succeed', func, ...) +# def on_position_save_succeed_add(self, func, *args, **kargs): +# """Same as calling: callback_add('position_save,succeed', func, ...) - .. versionadded:: 1.11 """ - self.callback_add("position_save,succeed", func, *args, **kargs) +# .. versionadded:: 1.11 """ +# self.callback_add("position_save,succeed", func, *args, **kargs) - def on_position_save_succeed_del(self, func): - """Same as calling: callback_del('position_save,succeed', func) +# def on_position_save_succeed_del(self, func): +# """Same as calling: callback_del('position_save,succeed', func) - .. versionadded:: 1.11 """ - self.callback_del("position_save,succeed", func) +# .. versionadded:: 1.11 """ +# self.callback_del("position_save,succeed", func) - def on_position_save_failed_add(self, func, *args, **kargs): - """Same as calling: callback_add('position_save,failed', func, ...) +# def on_position_save_failed_add(self, func, *args, **kargs): +# """Same as calling: callback_add('position_save,failed', func, ...) - .. versionadded:: 1.11 """ - self.callback_add("position_save,failed", func, *args, **kargs) +# .. versionadded:: 1.11 """ +# self.callback_add("position_save,failed", func, *args, **kargs) - def on_position_save_failed_del(self, func): - """Same as calling: callback_del('position_save,failed', func) +# def on_position_save_failed_del(self, func): +# """Same as calling: callback_del('position_save,failed', func) - .. versionadded:: 1.11 """ - self.callback_del("position_save,failed", func) +# .. versionadded:: 1.11 """ +# self.callback_del("position_save,failed", func) - def on_position_load_succeed_add(self, func, *args, **kargs): - """Same as calling: callback_add('position_load,succeed', func, ...) +# def on_position_load_succeed_add(self, func, *args, **kargs): +# """Same as calling: callback_add('position_load,succeed', func, ...) - .. versionadded:: 1.11 """ - self.callback_add("position_load,succeed", func, *args, **kargs) +# .. versionadded:: 1.11 """ +# self.callback_add("position_load,succeed", func, *args, **kargs) - def on_position_load_succeed_del(self, func): - """Same as calling: callback_del('position_load,succeed', func) +# def on_position_load_succeed_del(self, func): +# """Same as calling: callback_del('position_load,succeed', func) - .. versionadded:: 1.11 """ - self.callback_del("position_load,succeed", func) +# .. versionadded:: 1.11 """ +# self.callback_del("position_load,succeed", func) - def on_position_load_failed_add(self, func, *args, **kargs): - """Same as calling: callback_add('position_load,failed', func, ...) +# def on_position_load_failed_add(self, func, *args, **kargs): +# """Same as calling: callback_add('position_load,failed', func, ...) - .. versionadded:: 1.11 """ - self.callback_add("position_load,failed", func, *args, **kargs) +# .. versionadded:: 1.11 """ +# self.callback_add("position_load,failed", func, *args, **kargs) - def on_position_load_failed_del(self, func): - """Same as calling: callback_del('position_load,failed', func) +# def on_position_load_failed_del(self, func): +# """Same as calling: callback_del('position_load,failed', func) - .. versionadded:: 1.11 """ - self.callback_del("position_load,failed", func) +# .. versionadded:: 1.11 """ +# self.callback_del("position_load,failed", func) # decorator @@ -1346,7 +1351,7 @@ def on_event(event_name): return decorator -_object_mapping_register("Emotion_Object", Emotion) +#_object_mapping_register("Emotion_Object", Emotion) init() diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx index 8fc41bf..089d665 100644 --- a/efl/eo/efl.eo.pyx +++ b/efl/eo/efl.eo.pyx @@ -22,14 +22,14 @@ from efl.eina cimport Eina_Bool, \ Eina_Hash, eina_hash_string_superfast_new, eina_hash_add, eina_hash_del, \ eina_hash_find, EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \ eina_hash_pointer_new -from efl.c_eo cimport Eo as cEo, eo_init, eo_shutdown, eo_del, eo_do, \ +from efl.c_eo cimport Eo as Eo, eo_init, eo_shutdown, eo_del, eo_do, \ eo_class_name_get, eo_class_get, eo_base_class_get,\ eo_key_data_set, eo_key_data_get, eo_key_data_del, \ eo_event_callback_add, eo_event_callback_del, EO_EV_DEL, \ eo_parent_get, eo_parent_set, Eo_Event_Description, \ eo_event_freeze, eo_event_thaw, eo_event_freeze_count_get, \ eo_event_global_freeze, eo_event_global_thaw, \ - eo_event_global_freeze_count_get + eo_event_global_freeze_count_get, eo_add_ref cimport efl.eo.enums as enums @@ -57,16 +57,16 @@ init() def event_global_freeze_count_get(): cdef int fcount - fcount = eo_do(eo_base_class_get(), + fcount = eo_do(eo_base_class_get(), eo_event_global_freeze_count_get()) return fcount def event_global_freeze(): - eo_do(eo_base_class_get(), + eo_do(eo_base_class_get(), eo_event_global_freeze()) def event_global_thaw(): - eo_do(eo_base_class_get(), + eo_do(eo_base_class_get(), eo_event_global_thaw()) ###################################################################### @@ -98,11 +98,11 @@ cdef void _object_mapping_unregister(char *name): eina_hash_del(object_mapping, name, NULL) -cdef api object object_from_instance(cEo *obj): +cdef api object object_from_instance(Eo *obj): """ Create a python object from a C Eo object pointer. """ cdef: void *data - Eo o + _Eo o const char *cls_name = eo_class_name_get(eo_class_get(obj)) type cls void *cls_ret @@ -114,7 +114,7 @@ cdef api object object_from_instance(cEo *obj): if data != NULL: EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, "Returning a Python object instance for Eo of type %s.", cls_name) - return data + return <_Eo>data if cls_name == NULL: raise ValueError( @@ -143,12 +143,12 @@ cdef api object object_from_instance(cEo *obj): o._set_obj(obj) return o -cdef api cEo *instance_from_object(object obj): - cdef Eo o = obj +cdef api Eo *instance_from_object(object obj): + cdef _Eo o = obj return o.obj -cdef void _register_decorated_callbacks(Eo obj): +cdef void _register_decorated_callbacks(_Eo obj): """ Search every attrib of the pyobj for a __decorated_callbacks__ object, @@ -179,11 +179,11 @@ EO_CALLBACK_CONTINUE = enums.EO_CALLBACK_CONTINUE ###################################################################### -cdef Eina_Bool _eo_event_del_cb(void *data, cEo *obj, +cdef Eina_Bool _eo_event_del_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info) with gil: cdef: - Eo self = data + _Eo self = <_Eo>data const char *cls_name = eo_class_name_get(eo_class_get(obj)) EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, "Deleting Eo: %s", cls_name) @@ -197,7 +197,7 @@ cdef Eina_Bool _eo_event_del_cb(void *data, cEo *obj, return enums.EO_CALLBACK_STOP cdef Eina_Bool _py_efl_eo_event_cb( - void *data, cEo *obj, + void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info ) with gil: @@ -206,7 +206,7 @@ cdef Eina_Bool _py_efl_eo_event_cb( void *tmp1 void *tmp2 bint ret - Eo o + _Eo o EventDesc py_ev_desc #EventInfo py_ev_info_obj @@ -267,7 +267,7 @@ cdef class EventDesc(object): # self.event_info = self.conv_to_c(val) -cdef class Eo(object): +cdef class _Eo(object): """ Base class used by all the object in the EFL. @@ -282,13 +282,13 @@ cdef class Eo(object): self.data = dict() def __init__(self, *args, **kwargs): - if type(self) is Eo: + if type(self) is _Eo: raise TypeError("Must not instantiate Eo, but subclasses") def __repr__(self): - cdef cEo *parent = NULL + cdef Eo *parent = NULL if self.obj != NULL: - parent = eo_do(self.obj, eo_parent_get()) + parent = eo_do(self.obj, eo_parent_get()) return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") % ( type(self).__name__, self, @@ -299,7 +299,7 @@ cdef class Eo(object): def __nonzero__(self): return 1 if self.obj != NULL else 0 - cdef int _set_obj(self, cEo *obj) except 0: + cdef int _set_obj(self, Eo *obj) except 0: assert self.obj == NULL, "Object must be clean" assert obj != NULL, "Cannot set a NULL object" @@ -339,7 +339,7 @@ cdef class Eo(object): """ return bool(self.obj == NULL) - def parent_set(self, Eo parent): + def parent_set(self, _Eo parent): """Set the parent object. :param parent: The object to set as parent. @@ -355,7 +355,7 @@ cdef class Eo(object): :rtype: :class:`Eo` """ - cdef cEo *parent = eo_do(self.obj, eo_parent_get()) + cdef Eo *parent = eo_do(self.obj, eo_parent_get()) return object_from_instance(parent) def event_freeze(self): diff --git a/efl/eolian/__init__.pxd b/efl/eolian/__init__.pxd index 5b5fa8a..f919dfe 100644 --- a/efl/eolian/__init__.pxd +++ b/efl/eolian/__init__.pxd @@ -224,6 +224,7 @@ cdef extern from "Eolian.h": Eina_Bool eolian_function_is_empty(const Eolian_Function *function_id, Eolian_Function_Type f_type) Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype) Eina_Bool eolian_function_is_class(const Eolian_Function *function_id) + Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass) const Eolian_Function_Parameter *eolian_function_parameter_get_by_name(const Eolian_Function *function_id, const char *param_name) Eina_Iterator *eolian_function_parameters_get(const Eolian_Function *function_id) Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id) @@ -261,6 +262,7 @@ cdef extern from "Eolian.h": Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event) Eina_Bool eolian_class_ctor_enable_get(const Eolian_Class *klass) Eina_Bool eolian_class_dtor_enable_get(const Eolian_Class *klass) + Eina_Stringshare *eolian_class_c_get_function_name_get(const Eolian_Class *klass) const Eolian_Type *eolian_type_alias_get_by_name(const char *name) const Eolian_Type *eolian_type_struct_get_by_name(const char *name) const Eolian_Type *eolian_type_enum_get_by_name(const char *name) diff --git a/efl/eolian/__init__.pyx b/efl/eolian/__init__.pyx index a128ddb..6db5a3b 100644 --- a/efl/eolian/__init__.pyx +++ b/efl/eolian/__init__.pyx @@ -895,6 +895,21 @@ cdef class Class(object): def __get__(self): return bool(eolian_class_dtor_enable_get(self.klass)) + property c_get_function_name: + """Returns the name of the C function used to get the Eo_Class pointer. + + :return: a stringshare containing the func name or NULL on error. + + You have to delete the stringshare manually. + + """ + def __get__(self): + cdef Eina_Stringshare *ret1 + ret1 = eolian_class_c_get_function_name_get(self.klass) + ret2 = _ctouni(ret1) + eina_stringshare_del(ret1) + return ret2 + def function_get_by_name(self, func_name, Eolian_Function_Type f_type): """Find a function in a class by its name and type @@ -1049,6 +1064,16 @@ cdef class Function(object): def __get__(self): return bool(eolian_function_is_class(self.function_id)) + def is_constructor(self, Class klass): + """Indicates if a function is a constructing function of a given class. + + @param[in] klass the class + @param[in] function_id Id of the function + @return EINA_TRUE and EINA_FALSE respectively + + """ + return bool(eolian_function_is_constructor(self.function_id, klass.klass)) + def parameter_get_by_name(self, param_name): """Returns a parameter of a function pointed by its id. diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx index fc96dd0..3db56fe 100644 --- a/efl/evas/efl.evas.pyx +++ b/efl/evas/efl.evas.pyx @@ -20,6 +20,16 @@ from efl.utils.conversions cimport eina_list_strings_to_python_list from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN from efl.utils.logger cimport add_logger +from cpython cimport PyUnicode_AsUTF8String + +from efl.c_eo cimport eo_add_ref, Eo, Eo_Class, _eo_do_start, _eo_do_end, \ + CFILE, CFUNC, CLINE, Eo_Event_Description +from efl.eo cimport object_from_instance, _object_mapping_register, \ + _register_decorated_callbacks, _Eo +from efl.utils.conversions cimport _ctouni + +from efl.eina cimport eina_hash_add, eina_hash_del, EINA_FALSE + cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain EVAS_LAYER_MIN = enums.EVAS_LAYER_MIN @@ -343,24 +353,25 @@ class EvasLoadError(Exception): Exception.__init__(self, "%s (file=%s, key=%s)" % (msg, filename, key)) -include "efl.evas_rect.pxi" -include "efl.evas_map.pxi" -include "efl.evas_canvas_callbacks.pxi" -include "efl.evas_canvas.pxi" -include "efl.evas_object_events.pxi" -include "efl.evas_object_callbacks.pxi" -include "efl.evas_object.pxi" -include "efl.evas_object_smart.pxi" -include "efl.evas_object_image.pxi" -include "efl.evas_object_line.pxi" -include "efl.evas_object_rectangle.pxi" -include "efl.evas_object_polygon.pxi" -include "efl.evas_object_text.pxi" -include "efl.evas_object_textblock.pxi" -include "efl.evas_object_box.pxi" -include "efl.evas_object_textgrid.pxi" -include "efl.evas_object_table.pxi" -include "efl.evas_object_grid.pxi" +include "generated_classes.pxi" +#include "efl.evas_rect.pxi" +#include "efl.evas_map.pxi" +#include "efl.evas_canvas_callbacks.pxi" +#include "efl.evas_canvas.pxi" +#include "efl.evas_object_events.pxi" +#include "efl.evas_object_callbacks.pxi" +#include "efl.evas_object.pxi" +#include "efl.evas_object_smart.pxi" +#include "efl.evas_object_image.pxi" +#include "efl.evas_object_line.pxi" +#include "efl.evas_object_rectangle.pxi" +#include "efl.evas_object_polygon.pxi" +#include "efl.evas_object_text.pxi" +#include "efl.evas_object_textblock.pxi" +#include "efl.evas_object_box.pxi" +#include "efl.evas_object_textgrid.pxi" +#include "efl.evas_object_table.pxi" +#include "efl.evas_object_grid.pxi" init() diff --git a/include/efl.c_eo.pxd b/include/efl.c_eo.pxd index f62a029..6e61ef6 100644 --- a/include/efl.c_eo.pxd +++ b/include/efl.c_eo.pxd @@ -18,9 +18,9 @@ from efl.eina cimport Eina_Bool cdef extern from *: - struct CFILE "__FILE__" - struct CLINE "__LINE__" - struct CFUNC "__FUNCTION__" + char *CFILE "__FILE__" + int CLINE "__LINE__" + char *CFUNC "__FUNCTION__" cdef extern from "Eo.h": #################################################################### @@ -57,6 +57,7 @@ cdef extern from "Eo.h": int eo_shutdown() Eo *eo_add(const Eo_Class *klass, Eo *parent, ...) + Eo *eo_add_ref(const Eo_Class *klass, Eo *parent, ...) Eo *eo_ref(const Eo *obj) void eo_unref(const Eo *obj) int eo_ref_get(const Eo *obj) diff --git a/include/efl.eina.pxd b/include/efl.eina.pxd index 8aceb65..a6445a7 100644 --- a/include/efl.eina.pxd +++ b/include/efl.eina.pxd @@ -50,6 +50,10 @@ cdef extern from "Eina.h": EINA_LOG_STATE_START EINA_LOG_STATE_STOP + enum: + EINA_FALSE + EINA_TRUE + #################################################################### # Basic Types # @@ -96,6 +100,8 @@ cdef extern from "Eina.h": ctypedef struct _Eina_Inlist ctypedef _Eina_Inlist Eina_Inlist + ctypedef struct Eina_Accessor + #################################################################### # Other typedefs # diff --git a/include/efl.emotion.pxd b/include/efl.emotion.pxd index 23fb619..a0adc63 100644 --- a/include/efl.emotion.pxd +++ b/include/efl.emotion.pxd @@ -17,7 +17,7 @@ from efl.eina cimport Eina_Bool, Eina_List from efl.evas cimport Evas, Evas_Object -from efl.evas cimport Object as evasObject +from efl.evas cimport _Object as evasObject cdef extern from "Emotion.h": diff --git a/include/efl.eo.pxd b/include/efl.eo.pxd index f0de416..1c7779c 100644 --- a/include/efl.eo.pxd +++ b/include/efl.eo.pxd @@ -15,18 +15,18 @@ # You should have received a copy of the GNU Lesser General Public License # along with this Python-EFL. If not, see . -from efl.c_eo cimport Eo as cEo +from efl.c_eo cimport Eo from efl.eina cimport Eina_Hash cdef: - class Eo(object): + class _Eo(object): cdef: - cEo *obj + Eo *obj Eina_Hash *event_desc_mapping Eina_Hash *event_conv_mapping readonly dict data - int _set_obj(self, cEo *obj) except 0 + int _set_obj(self, Eo *obj) except 0 int _set_properties_from_keyword_args(self, dict kwargs) except 0 #_add_obj(self, Eo_Class *klass, cEo *parent) @@ -36,8 +36,8 @@ cdef: void _object_mapping_register(char *name, object cls) except * void _object_mapping_unregister(char *name) - void _register_decorated_callbacks(Eo obj) + void _register_decorated_callbacks(_Eo obj) cdef api: - object object_from_instance(cEo *obj) - cEo *instance_from_object(object o) + object object_from_instance(Eo *obj) + Eo *instance_from_object(object o) diff --git a/include/efl.evas.pxd b/include/efl.evas.pxd index f71db5b..01e46c1 100644 --- a/include/efl.evas.pxd +++ b/include/efl.evas.pxd @@ -16,8 +16,8 @@ # along with this Python-EFL. If not, see . from efl.eina cimport * -from efl.eo cimport Eo -from efl.c_eo cimport Eo as cEo, Eo_Class +from efl.eo cimport _Eo +from efl.c_eo cimport Eo, Eo_Class from efl.evas.enums cimport Evas_Event_Flags, Evas_Button_Flags, \ Evas_Font_Hinting_Flags, Evas_Aspect_Control, Evas_Render_Op, \ Evas_Callback_Type, Evas_Object_Pointer_Mode, Evas_Colorspace, \ @@ -25,7 +25,7 @@ from efl.evas.enums cimport Evas_Event_Flags, Evas_Button_Flags, \ Evas_Textgrid_Palette, Evas_Textgrid_Font_Style, \ Evas_Fill_Spread, Evas_Image_Scale_Hint, Evas_Image_Content_Hint, \ Evas_Image_Animated_Loop_Hint, Evas_Object_Table_Homogeneous_Mode, \ - Evas_Display_Mode + Evas_Display_Mode, Evas_BiDi_Direction, Evas_Touch_Point_State cdef extern from "Evas.h": #################################################################### @@ -35,6 +35,7 @@ cdef extern from "Evas.h": ctypedef int Evas_Angle ctypedef int Evas_Font_Size ctypedef unsigned long long Evas_Modifier_Mask + ctypedef double Evas_Real #################################################################### # Structures @@ -63,9 +64,11 @@ cdef extern from "Evas.h": ctypedef struct Evas_Hash - ctypedef cEo Evas + ctypedef Eo Evas - ctypedef cEo Evas_Object + ctypedef Eo Evas_Object + ctypedef Eo Evas_3D_Node + ctypedef Eo Evas_3D_Mesh ctypedef struct Evas_Modifier ctypedef struct Evas_Lock @@ -257,6 +260,9 @@ cdef extern from "Evas.h": ctypedef struct Evas_Map + ctypedef struct Evas_Object_Textblock_Node_Format + + ctypedef struct Evas_Engine_Info #################################################################### # Other typedefs @@ -863,51 +869,51 @@ cdef extern from "Evas.h": #################################################################### # Python classes # -cdef class Rect: +cdef class _Rect: cdef int x0, y0, x1, y1, cx, cy, _w, _h -cdef class Canvas(Eo): +cdef class _Canvas(_Eo): cdef list _event_callbacks -cdef class Map(object): +cdef class _Map(object): cdef Evas_Map *map -cdef class Object(Eo): +cdef class _Object(_Eo): cdef list _event_callbacks cdef int _set_properties_from_keyword_args(self, dict) except 0 -cdef class Rectangle(Object): +cdef class _Rectangle(_Object): pass -cdef class Line(Object): - pass +#cdef class _Line(_Object): +# pass -cdef class Image(Object): - pass +#cdef class _Image(_Object): +# pass -cdef class FilledImage(Image): - pass +#cdef class _FilledImage(_Image): +# pass -cdef class Polygon(Object): - pass +#cdef class _Polygon(_Object): +# pass -cdef class Text(Object): - pass +#cdef class _Text(_Object): +# pass -cdef class Textblock(Object): - pass +#cdef class _Textblock(_Object): +# pass -cdef class SmartObject(Object): +cdef class _SmartObject(_Object): cdef object _smart_callbacks cdef object _m_delete cdef object _m_move @@ -920,151 +926,151 @@ cdef class SmartObject(Object): cdef object _m_calculate -cdef class ClippedSmartObject(SmartObject): - cdef readonly Rectangle clipper +cdef class _ClippedSmartObject(_SmartObject): + cdef readonly _Rectangle clipper -cdef class EventPoint: - cdef Evas_Point *obj +#cdef class EventPoint: +# cdef Evas_Point *obj - cdef void _set_obj(self, Evas_Point *obj) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, Evas_Point *obj) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventCoordPoint: - cdef Evas_Coord_Point *obj +#cdef class EventCoordPoint: +# cdef Evas_Coord_Point *obj - cdef void _set_obj(self, Evas_Coord_Point *obj) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, Evas_Coord_Point *obj) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventPrecisionPoint: - cdef Evas_Coord_Precision_Point *obj +#cdef class EventPrecisionPoint: +# cdef Evas_Coord_Precision_Point *obj - cdef void _set_obj(self, Evas_Coord_Precision_Point *obj) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, Evas_Coord_Precision_Point *obj) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventPosition: - cdef readonly EventPoint output - cdef readonly EventCoordPoint canvas +#cdef class EventPosition: +# cdef readonly EventPoint output +# cdef readonly EventCoordPoint canvas - cdef void _set_objs(self, Evas_Point *output, Evas_Coord_Point *canvas) - cdef void _unset_objs(self) +# cdef void _set_objs(self, Evas_Point *output, Evas_Coord_Point *canvas) +# cdef void _unset_objs(self) -cdef class EventPrecisionPosition: - cdef readonly EventPoint output - cdef readonly EventPrecisionPoint canvas +#cdef class EventPrecisionPosition: +# cdef readonly EventPoint output +# cdef readonly EventPrecisionPoint canvas - cdef void _set_objs(self, Evas_Point *output, Evas_Coord_Precision_Point *canvas) - cdef void _unset_objs(self) +# cdef void _set_objs(self, Evas_Point *output, Evas_Coord_Precision_Point *canvas) +# cdef void _unset_objs(self) -cdef class EventMouseIn: - cdef Evas_Event_Mouse_In *obj - cdef readonly EventPosition position +#cdef class EventMouseIn: +# cdef Evas_Event_Mouse_In *obj +# cdef readonly EventPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMouseOut: - cdef Evas_Event_Mouse_Out *obj - cdef readonly EventPosition position +#cdef class EventMouseOut: +# cdef Evas_Event_Mouse_Out *obj +# cdef readonly EventPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMouseDown: - cdef Evas_Event_Mouse_Down *obj - cdef readonly EventPosition position +#cdef class EventMouseDown: +# cdef Evas_Event_Mouse_Down *obj +# cdef readonly EventPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMouseUp: - cdef Evas_Event_Mouse_Up *obj - cdef readonly EventPosition position +#cdef class EventMouseUp: +# cdef Evas_Event_Mouse_Up *obj +# cdef readonly EventPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMouseMove: - cdef Evas_Event_Mouse_Move *obj - cdef readonly EventPosition position - cdef readonly EventPosition prev_position +#cdef class EventMouseMove: +# cdef Evas_Event_Mouse_Move *obj +# cdef readonly EventPosition position +# cdef readonly EventPosition prev_position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMultiDown: - cdef Evas_Event_Multi_Down *obj - cdef readonly EventPrecisionPosition position +#cdef class EventMultiDown: +# cdef Evas_Event_Multi_Down *obj +# cdef readonly EventPrecisionPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMultiUp: - cdef Evas_Event_Multi_Up *obj - cdef readonly EventPrecisionPosition position +#cdef class EventMultiUp: +# cdef Evas_Event_Multi_Up *obj +# cdef readonly EventPrecisionPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMultiMove: - cdef Evas_Event_Multi_Move *obj - cdef readonly EventPrecisionPosition position +#cdef class EventMultiMove: +# cdef Evas_Event_Multi_Move *obj +# cdef readonly EventPrecisionPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventMouseWheel: - cdef Evas_Event_Mouse_Wheel *obj - cdef readonly EventPosition position +#cdef class EventMouseWheel: +# cdef Evas_Event_Mouse_Wheel *obj +# cdef readonly EventPosition position - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventKeyDown: - cdef Evas_Event_Key_Down *obj +#cdef class EventKeyDown: +# cdef Evas_Event_Key_Down *obj - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventKeyUp: - cdef Evas_Event_Key_Up *obj +#cdef class EventKeyUp: +# cdef Evas_Event_Key_Up *obj - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 -cdef class EventHold: - cdef Evas_Event_Hold *obj +#cdef class EventHold: +# cdef Evas_Event_Hold *obj - cdef void _set_obj(self, void *ptr) - cdef void _unset_obj(self) - cdef int _check_validity(self) except 0 +# cdef void _set_obj(self, void *ptr) +# cdef void _unset_obj(self) +# cdef int _check_validity(self) except 0 diff --git a/scripts/converters.py b/scripts/converters.py index a73044a..1487ab1 100644 --- a/scripts/converters.py +++ b/scripts/converters.py @@ -71,12 +71,15 @@ mapping_in = { "Eo": "_Eo_Base", } -conversions_in = { +conversions_in_python = { # c_type: conversion - "bool": None, "char": "if isinstance({0}, unicode): {0} = PyUnicode_AsUTF8String({0})", - "Evas_Object": None, - "Eo": None, + } + +conversions_in_c = { + # c_type: conversion + "Evas_Object": "instance_from_object({0})", + "Eo": "instance_from_object({0})", } mapping_out = { @@ -93,7 +96,7 @@ conversions_out = { "bool": "bool({0})", "char": '{0}.decode("utf-8")', "Elm_Object_Item *": 'object_item_to_python({0})', - "Evas_Object *": 'object_from_instance({0})', + "Evas_Object": 'object_from_instance({0})', "Eo": 'object_from_instance({0})', } @@ -102,14 +105,20 @@ def conv_cls_name(cls): if cls.namespaces: lib_name = ".".join(map(unicode.lower, cls.namespaces)) name = cls.name + if name[0].isdigit(): + name = "_".join(cls.namespaces) + name else: s = cls.name.split("_") if len(s) > 1: lib_name = s[0] name = "_".join(s[1:]) + if name[0].isdigit(): + name = lib_name + name else: lib_name = s name = s + if name[0].isdigit(): + name = "A" + name return lib_name, name @@ -125,19 +134,26 @@ def convert_in_param(tp, param_name, is_nonull=None): if tp.type == eolian.TypeType.POINTER: tp = tp.base_type if tp.type == eolian.TypeType.CLASS: - return None, "Eo", "{0}.obj".format(param_name) + return None, "_Eo", "instance_from_object({0})".format(param_name) key = tp.name if tp.name else c_type if key in builtin_types: - return "", c_type, param_name + return None, c_type, param_name if not key in mapping_in: raise EolianTypeError("Unknown IN type: %s" % (key)) - conv_expr = conversions_in.get(key) - if conv_expr is not None: - conv_expr = conv_expr.format(param_name) + conv_expr_1 = conversions_in_python.get(key) + if conv_expr_1 is not None: + conv_expr_1 = conv_expr_1.format(param_name) + + if keyword.iskeyword(param_name): + param_name += "_" + + conv_expr_2 = conversions_in_c.get(key) + if conv_expr_2 is not None: + param_name = conv_expr_2.format(param_name) conv_t = mapping_in[key] #if conv_t is None: @@ -146,18 +162,14 @@ def convert_in_param(tp, param_name, is_nonull=None): if not is_nonull: key = "<{0}>{1} if {1} is not None else NULL".format(c_type, param_name) - if keyword.iskeyword(param_name): - param_name += "_" - - return conv_expr, conv_t, param_name + return conv_expr_1, conv_t, param_name def convert_out_param(tp, param_name): if tp.type == eolian.TypeType.POINTER: tp = tp.base_type if tp.type == eolian.TypeType.CLASS: - # TODO: set obj - return tp.c_type, param_name + return tp.c_type, "object_from_instance(%s)" % (param_name) key = tp.name if tp.name else tp.c_type @@ -204,25 +216,23 @@ def event_conversion_get(tp): if tp.type == eolian.TypeType.POINTER: tp = tp.base_type if tp.type == eolian.TypeType.STRUCT: - #return "EventInfo%s" % tp.name return "return <%s>" % tp.c_type elif tp.type == eolian.TypeType.REGULAR: def get_alias(tp1): - #print(tp1.name, tp1.type) alias = eolian.Type.alias_get_by_name(tp1.full_name) if not alias: - log.error("Unhandled event %s type %s" % (tp.c_type, tp.type)) + log.warn("Unhandled event %s type %s" % (tp.c_type, tp.type)) return tp2 = alias.base_type if tp2.type == eolian.TypeType.UNKNOWN: - log.error("UGH") + log.error("Event type unknown?!? %s" % (tp.c_type)) + return elif tp2.type == eolian.TypeType.STRUCT: - #print(tp2.name, tp2.c_type) ret = "tmp" return ret else: return get_alias(tp2) return get_alias(tp) else: - log.error("Unhandled event type %s" % (tp.type)) + log.warn("Unhandled event type %s" % (tp.type)) return diff --git a/scripts/eolian_generate.py b/scripts/eolian_generate.py index 50a14e8..ce57121 100755 --- a/scripts/eolian_generate.py +++ b/scripts/eolian_generate.py @@ -2,7 +2,7 @@ import os import textwrap -import keyword +from keyword import iskeyword #from traceback import format_exc from collections import Counter @@ -179,7 +179,7 @@ class PyxGenerator(Generator): self.write(")") self.dedent() - self.write("_eo_do_end(self.obj)") + self.write("_eo_do_end(&self.obj)") class Function(object): @@ -197,30 +197,43 @@ class Function(object): self.c_params = [] + ret_type = None ftypes = eolian.FunctionType if (func.type == ftypes.PROP_SET or func.type == ftypes.PROPERTY) and not isget: ret_type = func.return_type_get(eolian.FunctionType.PROP_SET) self.c_name += "_set" for p in func.parameters: - self.c_params.append((p.type.c_type, p.name)) + name = p.name + if iskeyword(name): + name += "_" + self.c_params.append((p.type.c_type, name)) if (func.type == ftypes.PROP_GET or func.type == ftypes.PROPERTY) and isget: ret_type = func.return_type_get(eolian.FunctionType.PROP_GET) self.c_name += "_get" for p in func.parameters: - self.c_params.append((p.type.c_type + "*", p.name)) - else: + name = p.name + if iskeyword(name): + name += "_" + self.c_params.append((p.type.c_type + "*", name)) + if func.type == ftypes.METHOD: ret_type = func.return_type_get(eolian.FunctionType.METHOD) for p in func.parameters: - self.c_params.append((p.type.c_type, p.name)) + name = p.name + if iskeyword(name): + name += "_" + c_type = p.type.c_type + if p.direction == eolian.ParameterDir.OUT: + c_type += "*" + self.c_params.append((c_type, name)) self.c_ret_type = ret_type.c_type if ret_type else "void" def cdef_generate(self, gen): func = self.func ftypes = eolian.FunctionType - if (func.type == ftypes.PROP_SET or func.type == ftypes.PROPERTY) and self.isget: + if func.type == ftypes.PROP_SET and self.isget: return - if (func.type == ftypes.PROP_GET or func.type == ftypes.PROPERTY) and not self.isget: + if func.type == ftypes.PROP_GET and not self.isget: return rtype = self.c_ret_type if not rtype: @@ -241,7 +254,7 @@ class Function(object): c_call_params = [] return_params = [] expand_params = [] - conv_in_exps = [] + conv_in_py_exps = [] out_cdefs = [] @@ -252,7 +265,7 @@ class Function(object): if func.type == ftypes.METHOD: py_name = func.name - if keyword.iskeyword(py_name): # Check if name is python reserved + if iskeyword(py_name): # Check if name is python reserved py_name += "_" func_params = func.parameters @@ -262,51 +275,77 @@ class Function(object): di = p.direction c_type = p.type.c_type + p_name = p.name + if iskeyword(p_name): + p_name += "_" + if di == eolian.ParameterDir.IN: - conv_expr, c_type, name = convert_in_param(p.type, p.name, p.is_nonull) - conv_in_exps.append(conv_expr) - header_params.append((c_type, p.name)) + conv_expr_py, c_type, name = convert_in_param(p.type, p_name, p.is_nonull) + conv_in_py_exps.append(conv_expr_py) + header_params.append((c_type, p_name)) c_call_params.append(name) elif di == eolian.ParameterDir.OUT: out_cdefs.append((c_type, p.name)) - c_type, name = convert_out_param(p.type, p.name) + c_type, name = convert_out_param(p.type, p_name) c_call_params.append("&" + name) return_params.append((p.type, name)) elif di == eolian.ParameterDir.INOUT: - conv_expr, c_type, name = convert_in_param(p.type, p.name, p.is_nonull) - header_params.append((c_type, p.name)) + conv_expr_py, c_type, name = convert_in_param(p.type, p_name, p.is_nonull) + header_params.append((c_type, p_name)) c_call_params.append(name) - c_type, name = convert_out_param(p.type, p.name) - return_params.append((p.type, p.name)) + c_type, name = convert_out_param(p.type, p_name) + return_params.append((p.type, p_name)) ret_type = func.return_type_get(eolian.FunctionType.METHOD) if (func.type == ftypes.PROP_SET or func.type == ftypes.PROPERTY) and not self.isget: py_name = "__set__" - c_name = "_".join((c_name, "set")) expand_params = [] for p in list(func.property_values) + list(func.property_keys): - conv_expr, c_type, name = convert_in_param(p.type, p.name, p.is_nonull) - conv_in_exps.append(conv_expr) - expand_params.append(p.name) - c_call_params.append(p.name) + p_name = p.name + if iskeyword(p_name): + p_name += "_" + + try: + conv_expr_py, c_type, name = convert_in_param(p.type, p_name, p.is_nonull) + except Exception: + gen.method_header_write(py_name, (("", "value"),)) + gen.indent() + gen.write("pass") + gen.dedent() + raise + + conv_in_py_exps.append(conv_expr_py) + expand_params.append((c_type, p_name)) + c_call_params.append(name) header_params = (("", "value"),) - ret_type = func.return_type_get(eolian.FunctionType.PROP_SET) + #ret_type = func.return_type_get(eolian.FunctionType.PROP_SET) if (func.type == ftypes.PROP_GET or func.type == ftypes.PROPERTY) and self.isget: py_name = "__get__" - c_name = "_".join((c_name, "get")) for p in list(func.property_values) + list(func.property_keys): + c_type = p.type.c_type name = p.name + if iskeyword(name): + name += "_" out_cdefs.append((c_type, name)) c_call_params.append("&%s" % (name)) - c_type, name = convert_out_param(p.type, name) + + try: + c_type, name = convert_out_param(p.type, name) + except Exception: + gen.method_header_write(py_name, header_params) + gen.indent() + gen.write("pass") + gen.dedent() + raise + return_params.append((p.type, name)) ret_type = func.return_type_get(eolian.FunctionType.PROP_GET) @@ -318,10 +357,16 @@ class Function(object): gen.indent() if expand_params: - expand_params = ", ".join(expand_params) - gen.write("%s = value" % (expand_params)) + tmp_prms = ", ".join(["tmp_prm%d" % (i) for i in range(len(expand_params))]) + gen.write("%s = value" % (tmp_prms)) + gen.write("cdef:") + gen.indent() + for i, (t, n) in enumerate(expand_params): + gen.write("%s %s = tmp_prm%d" % (t, n, i)) - for e in conv_in_exps: + gen.dedent() + + for e in conv_in_py_exps: if e: gen.write(e) @@ -337,13 +382,21 @@ class Function(object): if return_params: rparams = [] for t, n in return_params: - py_ret_type, c_ret_type = conv_type_ret(t) - rparams.append((c_ret_type, n)) + name = n + if iskeyword(name): + name += "_" + try: + py_ret_type, c_ret_type = conv_type_ret(t) + except EolianTypeError: + gen.write("# FIXME: Unknown return type %s" % t.c_type) + gen.dedent() + raise + rparams.append((c_ret_type, name)) gen.write("return %s" % (", ".join([r[1] for r in rparams]))) elif ret_type: ret = self.RET_PARAM try: - ret_type = convert_out_param(ret_type, ret) + ret_type, ret = convert_out_param(ret_type, ret) except EolianTypeError: gen.write("# FIXME: Unknown return type %s" % ret_type.c_type) gen.dedent() @@ -403,27 +456,24 @@ class Property(object): try: self.getter.generate(gen) self.setter.generate(gen) - except Exception: - gen.write("pass") - gen.write() - raise finally: gen.dedent() class Constructor(object): - def __init__(self, ctors, prefix): + def __init__(self, ctors, prefix, clsgetter): self.prefix = prefix self.ctors = ctors + self.clsgetter = clsgetter def cdef_generate(self, gen): pass def generate(self, gen): - cls_get = self.prefix + "_class_get()" + cls_get = self.clsgetter - header_params = [("_Base", "parent=None")] + header_params = [("_Eo", "parent=None")] c_ctors = [] for ctor in self.ctors: @@ -434,7 +484,7 @@ class Constructor(object): c_call_params = [] py_name = func.name - if keyword.iskeyword(py_name): # Check if name is python reserved + if iskeyword(py_name): # Check if name is python reserved py_name += "_" ftypes = eolian.FunctionType @@ -447,7 +497,7 @@ class Constructor(object): c_type = p.type.c_type - conv_expr, c_type, name = convert_in_param(p.type, p.name, p.is_nonull) + conv_expr_py, c_type, name = convert_in_param(p.type, p.name, p.is_nonull) header_params.append((c_type, p.name)) c_call_params.append(name) @@ -457,14 +507,14 @@ class Constructor(object): gen.write("def __init__(self, %s):" % (", ".join([" ".join((t, n)).strip() for t, n in header_params]))) gen.indent() - gen.write("cdef Eo *obj = eo_add_ref(") + gen.write("cdef Eo *added_obj = eo_add_ref(") gen.indent() - gen.write("%s, parent.obj if parent is not None else NULL," % (cls_get)) + gen.write("%s(), parent.obj if parent is not None else NULL," % (cls_get)) for ctor in c_ctors: gen.write("%s(%s)" % (ctor[0], ctor[1])) gen.write(")") gen.dedent() - gen.write("self._set_obj(obj)") + gen.write("self._set_obj(added_obj)") gen.dedent() gen.write() @@ -492,6 +542,7 @@ class Class(object): self.c_name = cls.name self.full_c_name = cls.full_name self.lib_name, self.name = conv_cls_name(cls) + self.cls_getter = cls.c_get_function_name header_path = cls.filename if not header_path: @@ -511,7 +562,7 @@ class Class(object): self.prefix = prefix if cls.type == eolian.ClassType.REGULAR: # or cls.type == eolian.ClassType.MIXIN: - self.ctor.append(Constructor(cls.constructors, prefix)) + self.ctor.append(Constructor(cls.constructors, prefix, cls.c_get_function_name)) props = cls.functions_get(eolian.FunctionType.PROPERTY) for prop in props: @@ -558,7 +609,9 @@ class Class(object): return self def cdefs_generate(self, gen): - if self.ctor or self.methods or self.props: + gen.write("const Eo_Class *%s()" % (self.cls_getter)) + # gen.write("ctypedef Eo %s" % (self.full_c_name.replace(".", "_"))) + if self.ctor or self.methods or self.props or self.events: for o in self.ctor + self.methods + self.props + self.events: try: o.cdef_generate(gen) @@ -574,10 +627,9 @@ class Class(object): i_cls.type == eolian.ClassType.MIXIN: continue if i_cls.full_name == "Eo.Base": - inherits.append("Eo") + inherits.append("_Eo") continue lib_name, name = conv_cls_name(i_cls) - #i = i.rpartition(".")[2] inherits.append("_" + name) else: log.warn("Inherited class %s is unknown" % (i)) @@ -591,11 +643,15 @@ class Class(object): return if not inherits: - inherits = ("object", ) + inherits = ("_Eo", ) inherits = ", ".join(inherits) gen.write("cdef class _%s(%s):" % (self.name, inherits)) gen.indent() + gen.write() + + # gen.write("cdef %s *ext_cls_obj" % self.full_c_name.replace(".", "_")) + # gen.write() if self.events: gen.write("def __cinit__(self):") @@ -649,9 +705,10 @@ class Class(object): gen.dedent() gen.write() - #def py_generate(self, gen): + # --- Py class inherits = ["_" + self.name] - imports = [(self.lib_name, "_" + self.name)] + #imports = [(self.lib_name, "_" + self.name)] + imports = [] for i in self.inherits: i_cls = eolian.Class.get_by_name(i) if i_cls: @@ -659,18 +716,17 @@ class Class(object): i_cls.type == eolian.ClassType.ABSTRACT: continue lib_name, name = conv_cls_name(i_cls) - #i = i.rpartition(".")[2] else: log.warn("Class %s is unknown" % (i)) i = i.rpartition(".") lib_name, name = i[0], i[2] - inherits.append("_" + name) + inherits.append(lib_name.replace(".", "_") + "_" + name) imports.append((lib_name, "_" + name)) for l, n in imports: - l = PY_EFL_TOP_LEVEL_PACKAGE + "." + l.lower() - gen.write("from %s import %s" % (l, n)) + l2 = PY_EFL_TOP_LEVEL_PACKAGE + "." + l.lower() + gen.write("from %s import %s as %s" % (l2, n, l.replace(".", "_") + n)) gen.write() gen.write() @@ -714,7 +770,7 @@ class File(object): for i in eolian.type_aliases_get_by_file(self.filepath): base = i.base_type if base.type == eolian.TypeType.REGULAR: - gen.write("ctypedef %s %s" % (i.name, base.name)) + gen.write("ctypedef %s %s" % (base.name, i.name)) elif base.type == eolian.TypeType.FUNCTION: ret_type = base.return_type if ret_type: @@ -750,26 +806,26 @@ class File(object): def pyx_generate(self): self.gencls.pyx_generate(self.pyxgen) - path = [args.output] + path = [] cls_name = self.cls.name.lower() - filename = cls_name + ".pxi" - namespaces = [] + filename = "generated_" + cls_name + ".pxi" for ns in self.cls.namespaces: - namespaces.append(ns.lower()) - if not namespaces: + path.append(ns.lower()) + if not path: log.warning("Class %s has no namespaces defined" % (self.cls.name)) nstmp = cls_name.partition("_") - namespace = nstmp[0] - filename = nstmp[2] + ".pxi" - else: - namespace = ".".join(namespaces) - filename = ".".join((namespace, filename)) - path.append(filename) - pxi_path = os.path.join(*path) + path.append(nstmp[0]) + filename = "generated_" + nstmp[2] + ".pxi" + # else: + # namespace = ".".join(namespaces) + # filename = ".".join((namespace, filename)) + # path.append(filename) + path = os.path.join(*path) + pxi_path = os.path.join(args.output, path, filename) self.pyxgen.printout(filepath=pxi_path) - generated_pxis.setdefault(namespace, []).append(pxi_path) + generated_pxis.setdefault(os.path.join(path), []).append((path, filename, self.cls)) # def py_generate(self): # py_path = os.path.join(args.output, "__init__" + ".py") @@ -788,7 +844,7 @@ class Event(object): def generate_name_mapping(self, gen): gen.write( - 'eina_hash_set(self.event_desc_mapping, "%s", %s)' % ( + 'eina_hash_add(self.event_desc_mapping, "%s", %s)' % ( self.event.name, self.event.c_name ) ) @@ -797,7 +853,7 @@ class Event(object): conv = event_conversion_get(self.event.type) if conv: gen.write( - 'eina_hash_set(self.event_conv_mapping, %s, self._event_conv_%s_to_python)' % ( + 'eina_hash_add(self.event_conv_mapping, %s, self._event_conv_%s_to_python)' % ( self.event.c_name, self.event.name.replace(",", "_") ) ) @@ -824,9 +880,6 @@ generated_class_counter = Counter() function_counter = Counter() generated_function_counter = Counter() -py_path = os.path.join(args.output, "__init__" + ".py") -if os.path.exists(py_path): - os.remove(py_path) for path in args.paths: for dirpath, dirnames, filenames in os.walk(path): @@ -865,13 +918,18 @@ for path in args.paths: # continue -for ns, pxis in generated_pxis.items(): - filename = os.path.join(args.output, "generated_" + ns + ".pxi") +for pxis in generated_pxis.values(): + ns, pxi_path, cls = pxis[0] + filename = os.path.join(args.output, ns, "generated_classes.pxi") if os.path.exists(filename): - log.error("File %s exists, removing" % (filename)) + log.warn("File %s exists, removing" % (filename)) + os.remove(filename) with open(filename, "a") as f: - for pxi in pxis: - line = 'include "%s"\n' % (pxi) + # for ns, pxi_path, cls in pxis: + # line = "ctypedef Eo %s\n" % (cls.full_name.replace(".", "_")) + # f.write(line) + for ns, pxi_path, cls in pxis: + line = 'include "%s"\n' % (pxi_path) f.write(line) diff --git a/setup.py b/setup.py index 561e809..915a79c 100755 --- a/setup.py +++ b/setup.py @@ -239,6 +239,20 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv): packages.append("efl.utils") packages.append("efl.utils.enum") + # === Efl (interfaces) === + eo_cflags, eo_libs = pkg_config('Efl', 'efl', EFL_MIN_VERSION) + eo_ext = Extension( + "efl.__init__", ["efl/efl/__init__" + module_suffix], + define_macros=[ + ('EFL_BETA_API_SUPPORT', 1), + ('EFL_EO_API_SUPPORT', 1), + ], + include_dirs=['include/'], + extra_compile_args=eo_cflags, + extra_link_args=eo_libs + eina_libs + ) + modules.append(eo_ext) + # === Evas === evas_cflags, evas_libs = pkg_config('Evas', 'evas', EFL_MIN_VERSION) evas_ext = Extension( @@ -249,19 +263,19 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv): ) modules.append(evas_ext) - # === Ecore === - ecore_cflags, ecore_libs = pkg_config('Ecore', 'ecore', EFL_MIN_VERSION) - ecore_file_cflags, ecore_file_libs = pkg_config( - 'EcoreFile', 'ecore-file', EFL_MIN_VERSION) - ecore_exts = [ - Extension( - "ecore.__init__", ["efl/ecore/__init__" + module_suffix], - include_dirs=['include/'], - extra_compile_args=list(set(ecore_cflags + ecore_file_cflags)), - extra_link_args=ecore_libs + ecore_file_libs + eina_libs + - evas_libs - ), - ] + # # === Ecore === + # ecore_cflags, ecore_libs = pkg_config('Ecore', 'ecore', EFL_MIN_VERSION) + # ecore_file_cflags, ecore_file_libs = pkg_config( + # 'EcoreFile', 'ecore-file', EFL_MIN_VERSION) + # ecore_exts = [ + # Extension( + # "ecore.__init__", ["efl/ecore/__init__" + module_suffix], + # include_dirs=['include/'], + # extra_compile_args=list(set(ecore_cflags + ecore_file_cflags)), + # extra_link_args=ecore_libs + ecore_file_libs + eina_libs + + # evas_libs + # ), + # ] try: ecore_input_cflags, ecore_input_libs = pkg_config( 'EcoreInput', 'ecore-input', EFL_MIN_VERSION) @@ -269,88 +283,92 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv): 'EcoreX', 'ecore-x', EFL_MIN_VERSION) except SystemExit: # FIXME: Change pkg-config to return a value pass - else: - ecore_exts.append( - Extension( - "ecore.x", ["efl/ecore/x" + module_suffix], - include_dirs=['include/'], - extra_compile_args= - list(set( - ecore_cflags + ecore_file_cflags + ecore_x_cflags + - ecore_input_cflags - )), - extra_link_args= - ecore_libs + ecore_file_libs + ecore_x_libs + - ecore_input_libs + - eina_libs + evas_libs, - ) - ) - modules += ecore_exts - packages.append("efl.ecore") + # else: + # ecore_exts.append( + # Extension( + # "ecore.x", ["efl/ecore/x" + module_suffix], + # include_dirs=['include/'], + # extra_compile_args= + # list(set( + # ecore_cflags + ecore_file_cflags + ecore_x_cflags + + # ecore_input_cflags + # )), + # extra_link_args= + # ecore_libs + ecore_file_libs + ecore_x_libs + + # ecore_input_libs + + # eina_libs + evas_libs, + # ) + # ) + # modules += ecore_exts + # packages.append("efl.ecore") - # === Ethumb === - ethumb_cflags, ethumb_libs = pkg_config( - 'Ethumb', 'ethumb', EFL_MIN_VERSION) - ethumb_ext = Extension( - "ethumb", ["efl/ethumb/efl.ethumb" + module_suffix], - include_dirs=['include/'], - extra_compile_args=ethumb_cflags, - extra_link_args=ethumb_libs + eina_libs, - ) - modules.append(ethumb_ext) + # # === Ethumb === + # ethumb_cflags, ethumb_libs = pkg_config( + # 'Ethumb', 'ethumb', EFL_MIN_VERSION) + # ethumb_ext = Extension( + # "ethumb", ["efl/ethumb/efl.ethumb" + module_suffix], + # include_dirs=['include/'], + # extra_compile_args=ethumb_cflags, + # extra_link_args=ethumb_libs + eina_libs, + # ) + # modules.append(ethumb_ext) - ethumb_client_cflags, ethumb_client_libs = pkg_config( - 'Ethumb_Client', 'ethumb_client', EFL_MIN_VERSION) - ethumb_client_ext = Extension( - "ethumb_client", ["efl/ethumb/efl.ethumb_client" + module_suffix], - include_dirs=['include/'], - extra_compile_args=ethumb_client_cflags, - extra_link_args=ethumb_client_libs + eina_libs, - ) - modules.append(ethumb_client_ext) + # ethumb_client_cflags, ethumb_client_libs = pkg_config( + # 'Ethumb_Client', 'ethumb_client', EFL_MIN_VERSION) + # ethumb_client_ext = Extension( + # "ethumb_client", ["efl/ethumb/efl.ethumb_client" + module_suffix], + # include_dirs=['include/'], + # extra_compile_args=ethumb_client_cflags, + # extra_link_args=ethumb_client_libs + eina_libs, + # ) + # modules.append(ethumb_client_ext) - # === Edje === - edje_cflags, edje_libs = pkg_config('Edje', 'edje', EFL_MIN_VERSION) - edje_ext = Extension( - "edje", ["efl/edje/efl.edje" + module_suffix], - include_dirs=['include/'], - extra_compile_args=edje_cflags, - extra_link_args=edje_libs + eina_libs + evas_libs, - ) - modules.append(edje_ext) + # # === Edje === + # edje_cflags, edje_libs = pkg_config('Edje', 'edje', EFL_MIN_VERSION) + # edje_ext = Extension( + # "edje", ["efl/edje/efl.edje" + module_suffix], + # include_dirs=['include/'], + # extra_compile_args=edje_cflags, + # extra_link_args=edje_libs + eina_libs + evas_libs, + # ) + # modules.append(edje_ext) - # --- Edje_Edit --- - edje_edit_ext = Extension( - "edje_edit", ["efl/edje/efl.edje_edit" + module_suffix], - define_macros=[('EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT', None)], - include_dirs=['include/'], - extra_compile_args=edje_cflags, - extra_link_args=edje_libs + eina_libs + evas_libs, - ) - modules.append(edje_edit_ext) + # # --- Edje_Edit --- + # edje_edit_ext = Extension( + # "edje_edit", ["efl/edje/efl.edje_edit" + module_suffix], + # define_macros=[('EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT', None)], + # include_dirs=['include/'], + # extra_compile_args=edje_cflags, + # extra_link_args=edje_libs + eina_libs + evas_libs, + # ) + # modules.append(edje_edit_ext) - # === Emotion === - emotion_cflags, emotion_libs = pkg_config( - 'Emotion', 'emotion', EFL_MIN_VERSION) - emotion_ext = Extension( - "emotion", ["efl/emotion/efl.emotion" + module_suffix], - include_dirs=['include/'], - extra_compile_args=emotion_cflags, - extra_link_args=emotion_libs + - eina_libs + evas_libs, - ) - modules.append(emotion_ext) + # # === Emotion === + # emotion_cflags, emotion_libs = pkg_config( + # 'Emotion', 'emotion', EFL_MIN_VERSION) + # emotion_ext = Extension( + # "emotion", ["efl/emotion/efl.emotion" + module_suffix], + # define_macros=[ + # ('EFL_BETA_API_SUPPORT', 1), + # ('EFL_EO_API_SUPPORT', 1), + # ], + # include_dirs=['include/'], + # extra_compile_args=emotion_cflags, + # extra_link_args=emotion_libs + + # eina_libs + evas_libs, + # ) + # modules.append(emotion_ext) - # === dbus mainloop integration === - dbus_cflags, dbus_libs = pkg_config('DBus', 'dbus-python', "0.83.0") - dbus_ml_ext = Extension( - "dbus_mainloop", - ["efl/dbus_mainloop/dbus_mainloop" + module_suffix, - "efl/dbus_mainloop/e_dbus.c"], - extra_compile_args=list(set(dbus_cflags + ecore_cflags)), - extra_link_args=dbus_libs + ecore_libs, - ) - modules.append(dbus_ml_ext) + # # === dbus mainloop integration === + # dbus_cflags, dbus_libs = pkg_config('DBus', 'dbus-python', "0.83.0") + # dbus_ml_ext = Extension( + # "dbus_mainloop", + # ["efl/dbus_mainloop/dbus_mainloop" + module_suffix, + # "efl/dbus_mainloop/e_dbus.c"], + # extra_compile_args=list(set(dbus_cflags + ecore_cflags)), + # extra_link_args=dbus_libs + ecore_libs, + # ) + # modules.append(dbus_ml_ext) # === Elementary === elm_mods = ( @@ -427,19 +445,19 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv): "window", ) - elm_cflags, elm_libs = pkg_config( - 'Elementary', 'elementary', ELM_MIN_VERSION) - for m in elm_mods: - e = Extension( - "elementary." + m, - ["efl/elementary/" + m + module_suffix], - include_dirs=["include/"], - extra_compile_args=elm_cflags + ecore_x_cflags, - extra_link_args=elm_libs + eina_libs + evas_libs, - ) - modules.append(e) + # elm_cflags, elm_libs = pkg_config( + # 'Elementary', 'elementary', ELM_MIN_VERSION) + # for m in elm_mods: + # e = Extension( + # "elementary." + m, + # ["efl/elementary/" + m + module_suffix], + # include_dirs=["include/"], + # extra_compile_args=elm_cflags + ecore_x_cflags, + # extra_link_args=elm_libs + eina_libs + evas_libs, + # ) + # modules.append(e) - packages.append("efl.elementary") + # packages.append("efl.elementary") setup(