kuuko pushed a commit to branch master.
commit c14ab47b09ac90a733509174bb15175614414549
Author: Kai Huuhko <[email protected]>
Date: Sun Apr 28 15:22:06 2013 +0000
Elementary: Add a few simple methods that were added to C API recently.
---
efl/elementary/configuration.pxd | 6 +++
efl/elementary/configuration.pyx | 112 ++++++++++++++++++++++++++-------------
efl/elementary/enums.pxd | 6 +++
efl/elementary/mapbuf.pxd | 2 +
efl/elementary/mapbuf.pyx | 26 +++++++++
efl/elementary/scroller.pxd | 6 ++-
efl/elementary/scroller.pyx | 56 +++++++++++++++++---
7 files changed, 171 insertions(+), 43 deletions(-)
diff --git a/efl/elementary/configuration.pxd b/efl/elementary/configuration.pxd
index 4f0f668..0c280d8 100644
--- a/efl/elementary/configuration.pxd
+++ b/efl/elementary/configuration.pxd
@@ -47,6 +47,12 @@ cdef extern from "Elementary.h":
void
elm_config_scroll_thumbscroll_border_friction_set(double friction)
double
elm_config_scroll_thumbscroll_sensitivity_friction_get()
void
elm_config_scroll_thumbscroll_sensitivity_friction_set(double friction)
+ double
elm_config_scroll_thumbscroll_acceleration_threshold_get()
+ void
elm_config_scroll_thumbscroll_acceleration_threshold_set(double threshold)
+ double
elm_config_scroll_thumbscroll_acceleration_time_limit_get()
+ void
elm_config_scroll_thumbscroll_acceleration_time_limit_set(double time_limit)
+ double
elm_config_scroll_thumbscroll_acceleration_weight_get()
+ void
elm_config_scroll_thumbscroll_acceleration_weight_set(double weight)
double elm_config_longpress_timeout_get()
void elm_config_longpress_timeout_set(double
longpress_timeout)
diff --git a/efl/elementary/configuration.pyx b/efl/elementary/configuration.pyx
index 5fc10a4..7e07ab4 100644
--- a/efl/elementary/configuration.pyx
+++ b/efl/elementary/configuration.pyx
@@ -170,7 +170,7 @@ cdef class Configuration(object):
if isinstance(profile, unicode): profile =
PyUnicode_AsUTF8String(profile)
elm_config_profile_set(<const_char *>profile if profile is not
None else NULL)
- def profile_dir_get(self, profile, is_user):
+ def profile_dir_get(self, profile, bint is_user):
"""profile_dir_get(unicode profile, bool is_user)
Get an Elementary's profile directory path in the filesystem. One
@@ -212,7 +212,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_scroll_bounce_enabled_get())
- def __set__(self, enabled):
+ def __set__(self, bint enabled):
elm_config_scroll_bounce_enabled_set(enabled)
property scroll_bounce_friction:
@@ -223,7 +223,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_bounce_friction_get()
- def __set__(self, friction):
+ def __set__(self, double friction):
elm_config_scroll_bounce_friction_set(friction)
property scroll_page_scroll_friction:
@@ -235,7 +235,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_page_scroll_friction_get()
- def __set__(self, friction):
+ def __set__(self, double friction):
elm_config_scroll_page_scroll_friction_set(friction)
property scroll_bring_in_scroll_friction:
@@ -247,7 +247,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_bring_in_scroll_friction_get()
- def __set__(self, friction):
+ def __set__(self, double friction):
elm_config_scroll_bring_in_scroll_friction_set(friction)
property scroll_zoom_friction:
@@ -259,7 +259,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_zoom_friction_get()
- def __set__(self, friction):
+ def __set__(self, double friction):
elm_config_scroll_zoom_friction_set(friction)
property scroll_thumbscroll_enabled:
@@ -274,7 +274,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_scroll_thumbscroll_enabled_get())
- def __set__(self, enabled):
+ def __set__(self, bint enabled):
elm_config_scroll_thumbscroll_enabled_set(enabled)
property scroll_thumbscroll_threshold:
@@ -289,7 +289,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_thumbscroll_threshold_get()
- def __set__(self, threshold):
+ def __set__(self, int threshold):
elm_config_scroll_thumbscroll_threshold_set(threshold)
@@ -302,7 +302,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_thumbscroll_hold_threshold_get()
- def __set__(self, threshold):
+ def __set__(self, int threshold):
elm_config_scroll_thumbscroll_hold_threshold_set(threshold)
property scroll_thumbscroll_momentum_threshold:
@@ -314,7 +314,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_thumbscroll_momentum_threshold_get()
- def __set__(self, threshold):
+ def __set__(self, double threshold):
elm_config_scroll_thumbscroll_momentum_threshold_set(threshold)
property scroll_thumbscroll_friction:
@@ -326,7 +326,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_thumbscroll_friction_get()
- def __set__(self, friction):
+ def __set__(self, double friction):
elm_config_scroll_thumbscroll_friction_set(friction)
property scroll_thumbscroll_border_friction:
@@ -341,7 +341,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_thumbscroll_border_friction_get()
- def __set__(self, friction):
+ def __set__(self, double friction):
elm_config_scroll_thumbscroll_border_friction_set(friction)
property scroll_thumbscroll_sensitivity_friction:
@@ -356,9 +356,47 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scroll_thumbscroll_sensitivity_friction_get()
- def __set__(self, friction):
+ def __set__(self, double friction):
elm_config_scroll_thumbscroll_sensitivity_friction_set(friction)
+
+ property scroll_thumbscroll_acceleration_threshold:
+ """The minimum speed of mouse cursor movement which will accelerate
+ scrolling velocity after a mouse up event (pixels/second).
+
+ :type: float
+
+ """
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_acceleration_threshold_get()
+
+ def __set__(self, double threshold):
+ elm_config_scroll_thumbscroll_acceleration_threshold_set(threshold)
+
+ property scroll_thumbscroll_acceleration_time_limit:
+ """The time limit for accelerating velocity.
+
+ :type: float
+
+ """
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_acceleration_time_limit_get()
+
+ def __set__(self, double time_limit):
+
elm_config_scroll_thumbscroll_acceleration_time_limit_set(time_limit)
+
+ property scroll_thumbscroll_acceleration_weight:
+ """The weight for the acceleration.
+
+ :type: float
+
+ """
+ def __get__(self):
+ return elm_config_scroll_thumbscroll_acceleration_weight_get()
+
+ def __set__(self, double weight):
+ elm_config_scroll_thumbscroll_acceleration_weight_set(weight)
+
property longpress_timeout:
"""The duration for occurring long press event.
@@ -367,7 +405,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_longpress_timeout_get()
- def __set__(self, longpress_timeout):
+ def __set__(self, double longpress_timeout):
elm_config_longpress_timeout_set(longpress_timeout)
property softcursor_mode:
@@ -381,7 +419,7 @@ cdef class Configuration(object):
:type: :ref:`Elm_Softcursor_Mode`
"""
- def __set__(self, mode):
+ def __set__(self, Elm_Softcursor_Mode mode):
elm_config_softcursor_mode_set(mode)
def __get__(self):
@@ -396,7 +434,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_tooltip_delay_get()
- def __set__(self, delay):
+ def __set__(self, double delay):
elm_config_tooltip_delay_set(delay)
property cursor_engine_only:
@@ -410,7 +448,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_cursor_engine_only_get()
- def __set__(self, engine_only):
+ def __set__(self, bint engine_only):
elm_config_cursor_engine_only_set(engine_only)
property scale:
@@ -424,7 +462,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_scale_get()
- def __set__(self, scale):
+ def __set__(self, double scale):
elm_config_scale_set(scale)
property password_show_last:
@@ -435,7 +473,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_password_show_last_get()
- def __set__(self, password_show_last):
+ def __set__(self, bint password_show_last):
elm_config_password_show_last_set(password_show_last)
property password_show_last_timeout:
@@ -447,7 +485,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_password_show_last_timeout_get()
- def __set__(self, password_show_last_timeout):
+ def __set__(self, double password_show_last_timeout):
elm_config_password_show_last_timeout_set(password_show_last_timeout)
property engine:
@@ -492,7 +530,7 @@ cdef class Configuration(object):
property text_classes_list:
"""Get Elementary's list of supported text classes.
- :type: :ref:`Elm_Text_Class`
+ :type: list of :ref:`Elm_Text_Class`
"""
def __get__(self):
@@ -509,6 +547,7 @@ cdef class Configuration(object):
ret.append((_ctouni(name), _ctouni(desc)))
lst = lst.next
return ret
+ # TODO: Free the list?
property font_overlay_list:
"""Get Elementary's list of font overlays, set with
@@ -518,7 +557,7 @@ cdef class Configuration(object):
the default font properties for that class coming from the theme in
use. There is no need to free this list.
- :type: Elm_Font_Overlay
+ :type: list of :ref:`Elm_Font_Overlay`
"""
def __get__(self):
@@ -537,6 +576,7 @@ cdef class Configuration(object):
ret.append((_ctouni(text_class), _ctouni(font), size))
lst = lst.next
return ret
+ # TODO: Free the list?
def font_overlay_set(self, text_class, font, size):
"""font_overlay_set(unicode text_class, unicode font, int size)
@@ -556,7 +596,7 @@ cdef class Configuration(object):
:param font: Font name and style string
:type font: string
:param size: Font size
- :type size: Evas_Font_Size
+ :type size: :ref:`Evas_Font_Size`
"""
a1 = text_class
@@ -583,7 +623,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_access_get())
- def __set__(self, is_access):
+ def __set__(self, bint is_access):
elm_config_access_set(is_access)
property selection_unfocused_clear:
@@ -594,7 +634,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_selection_unfocused_clear_get())
- def __set__(self, enabled):
+ def __set__(self, bint enabled):
elm_config_selection_unfocused_clear_set(enabled)
def font_overlay_unset(self, text_class):
@@ -630,12 +670,12 @@ cdef class Configuration(object):
This gets the globally configured finger size, **in pixels**
- :type: Evas_Coord (int)
+ :type: int
"""
def __get__(self):
return elm_config_finger_size_get()
- def __set__(self, size):
+ def __set__(self, int size):
elm_config_finger_size_set(size)
property cache_flush_interval:
@@ -651,7 +691,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_cache_flush_interval_get()
- def __set__(self, size):
+ def __set__(self, int size):
elm_config_cache_flush_interval_set(size)
property cache_flush_enabled:
@@ -673,7 +713,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_cache_flush_enabled_get())
- def __set__(self, enabled):
+ def __set__(self, bint enabled):
elm_config_cache_flush_enabled_set(enabled)
property cache_font_cache_size:
@@ -684,7 +724,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_cache_font_cache_size_get()
- def __set__(self, size):
+ def __set__(self, int size):
elm_config_cache_font_cache_size_set(size)
property cache_image_cache_size:
@@ -695,7 +735,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_cache_image_cache_size_get()
- def __set__(self, size):
+ def __set__(self, int size):
elm_config_cache_image_cache_size_set(size)
@@ -707,7 +747,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_cache_edje_file_cache_size_get()
- def __set__(self, size):
+ def __set__(self, int size):
elm_config_cache_edje_file_cache_size_set(size)
property cache_edje_collection_cache_size:
@@ -719,7 +759,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return elm_config_cache_edje_collection_cache_size_get()
- def __set__(self, size):
+ def __set__(self, int size):
elm_config_cache_edje_collection_cache_size_set(size)
property focus_highlight_enabled:
@@ -733,7 +773,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_focus_highlight_enabled_get())
- def __set__(self, enable):
+ def __set__(self, bint enable):
elm_config_focus_highlight_enabled_set(enable)
property focus_highlight_animate:
@@ -750,7 +790,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_focus_highlight_animate_get())
- def __set__(self, animate):
+ def __set__(self, bint animate):
elm_config_focus_highlight_animate_set(animate)
property mirrored:
@@ -762,7 +802,7 @@ cdef class Configuration(object):
"""
def __get__(self):
return bool(elm_config_mirrored_get())
- def __set__(self, mirrored):
+ def __set__(self, bint mirrored):
elm_config_mirrored_set(mirrored)
def indicator_service_get(self, int rotation):
diff --git a/efl/elementary/enums.pxd b/efl/elementary/enums.pxd
index 8f648a8..2e4cd91 100644
--- a/efl/elementary/enums.pxd
+++ b/efl/elementary/enums.pxd
@@ -349,6 +349,12 @@ cdef extern from "Elementary.h":
ELM_SCROLLER_POLICY_ON
ELM_SCROLLER_POLICY_OFF
+ ctypedef enum Elm_Scroller_Single_Direction:
+ ELM_SCROLLER_SINGLE_DIRECTION_NONE
+ ELM_SCROLLER_SINGLE_DIRECTION_SOFT
+ ELM_SCROLLER_SINGLE_DIRECTION_HARD
+ ELM_SCROLLER_SINGLE_DIRECTION_LAST
+
ctypedef enum Elm_Sel_Format:
ELM_SEL_FORMAT_TARGETS
ELM_SEL_FORMAT_NONE
diff --git a/efl/elementary/mapbuf.pxd b/efl/elementary/mapbuf.pxd
index 61aa2cc..558e4ff 100644
--- a/efl/elementary/mapbuf.pxd
+++ b/efl/elementary/mapbuf.pxd
@@ -8,3 +8,5 @@ cdef extern from "Elementary.h":
Eina_Bool elm_mapbuf_smooth_get(const_Evas_Object *obj)
void elm_mapbuf_alpha_set(Evas_Object *obj, Eina_Bool
alpha)
Eina_Bool elm_mapbuf_alpha_get(const_Evas_Object *obj)
+ void elm_mapbuf_auto_set(Evas_Object *obj, Eina_Bool
on)
+ Eina_Bool elm_mapbuf_auto_get(const_Evas_Object *obj)
diff --git a/efl/elementary/mapbuf.pyx b/efl/elementary/mapbuf.pyx
index 8e37554..00753bd 100644
--- a/efl/elementary/mapbuf.pyx
+++ b/efl/elementary/mapbuf.pyx
@@ -100,5 +100,31 @@ cdef class Mapbuf(Object):
def alpha_get(self):
return bool(elm_mapbuf_alpha_get(self.obj))
+ property auto:
+ """When a mapbuf object has "auto mode" enabled, then it will enable
and
+ disable map mode based on current visibility. Mapbuf will track if you
show
+ or hide it AND if the object is inside the canvas viewport or not when
it
+ is moved or resized. Note that if you turn automode off, then map mode
+ will be in a disabled state at this point. When you turn it on for the
+ first time, the current state will be evaluated base on current
properties
+ of the mapbuf object.
+
+ Auto mode is disabled by default.
+
+ :type: bool
+
+ """
+ def __set__(self, value):
+ self.auto_set(value)
+
+ def __get__(self):
+ return self.auto_get()
+
+ cpdef auto_set(self, bint on):
+ elm_mapbuf_auto_set(self.obj, on)
+
+ cpdef bint auto_get(self):
+ return elm_mapbuf_auto_get(self.obj)
+
_object_mapping_register("elm_mapbuf", Mapbuf)
diff --git a/efl/elementary/scroller.pxd b/efl/elementary/scroller.pxd
index 9c0f5b1..28bb224 100644
--- a/efl/elementary/scroller.pxd
+++ b/efl/elementary/scroller.pxd
@@ -1,5 +1,5 @@
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord, const_Evas_Object
-from enums cimport Elm_Scroller_Policy
+from enums cimport Elm_Scroller_Policy, Elm_Scroller_Single_Direction
from libc.string cimport const_char
from object cimport Object
@@ -10,6 +10,8 @@ cdef extern from "Elementary.h":
void elm_scroller_region_show(Evas_Object *obj,
Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
void elm_scroller_policy_set(Evas_Object *obj,
Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
void elm_scroller_policy_get(Evas_Object *obj,
Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
+ void elm_scroller_single_direction_set(Evas_Object
*obj, Elm_Scroller_Single_Direction single_dir)
+ Elm_Scroller_Single_Direction
elm_scroller_single_direction_get(const_Evas_Object *obj)
void elm_scroller_region_get(Evas_Object *obj,
Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
void elm_scroller_child_size_get(Evas_Object *obj,
Evas_Coord *w, Evas_Coord *h)
void elm_scroller_bounce_set(Evas_Object *obj,
Eina_Bool h_bounce, Eina_Bool v_bounce)
@@ -31,6 +33,8 @@ cdef extern from "Elementary.h":
void elm_scroller_gravity_get(Evas_Object *obj, double
*x, double *y)
cdef class ScrollableInterface(Object):
+ cpdef single_direction_set(self, Elm_Scroller_Single_Direction single_dir)
+ cpdef single_direction_get(self)
cpdef page_size_set(self, h_pagesize, v_pagesize)
cpdef page_size_get(self)
cpdef page_scroll_limit_set(self, int page_limit_h, int page_limit_v)
diff --git a/efl/elementary/scroller.pyx b/efl/elementary/scroller.pyx
index dd51954..4efa482 100644
--- a/efl/elementary/scroller.pyx
+++ b/efl/elementary/scroller.pyx
@@ -92,6 +92,26 @@ Scrollbar visibility
Never show scrollbars
+
+.. _Elm_Scroller_Single_Direction:
+
+Single direction
+================
+
+Type that controls how the content is scrolled.
+
+.. data:: ELM_SCROLLER_SINGLE_DIRECTION_NONE
+
+ Scroll every direction
+
+.. data:: ELM_SCROLLER_SINGLE_DIRECTION_SOFT
+
+ Scroll single direction if the direction is certain
+
+.. data:: ELM_SCROLLER_SINGLE_DIRECTION_HARD
+
+ Scroll only single direction
+
"""
include "widget_header.pxi"
@@ -106,6 +126,10 @@ ELM_SCROLLER_POLICY_AUTO = enums.ELM_SCROLLER_POLICY_AUTO
ELM_SCROLLER_POLICY_ON = enums.ELM_SCROLLER_POLICY_ON
ELM_SCROLLER_POLICY_OFF = enums.ELM_SCROLLER_POLICY_OFF
+ELM_SCROLLER_SINGLE_DIRECTION_NONE = enums.ELM_SCROLLER_SINGLE_DIRECTION_NONE
+ELM_SCROLLER_SINGLE_DIRECTION_SOFT = enums.ELM_SCROLLER_SINGLE_DIRECTION_SOFT
+ELM_SCROLLER_SINGLE_DIRECTION_HARD = enums.ELM_SCROLLER_SINGLE_DIRECTION_HARD
+
cdef class ScrollableInterface(Object):
"""
@@ -207,6 +231,26 @@ cdef class ScrollableInterface(Object):
elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
return (policy_h, policy_v)
+ property single_direction:
+ """The type of single direction scroll
+
+ :type: :ref:`Elm_Scroller_Single_Direction`
+
+ :since: 1.8
+
+ """
+ def __set__(self, value):
+ self.single_direction_set(value)
+
+ def __get__(self):
+ return self.single_direction_get()
+
+ cpdef single_direction_set(self, Elm_Scroller_Single_Direction single_dir):
+ elm_scroller_single_direction_set(self.obj, single_dir)
+
+ cpdef single_direction_get(self):
+ return elm_scroller_single_direction_get(self.obj)
+
property region:
"""Get the currently visible content region
@@ -236,7 +280,7 @@ cdef class ScrollableInterface(Object):
This gets the size of the content object of the scroller.
- :type: tuple of Evas_Coord (int)
+ :type: (int **w**, int **h**)
"""
def __get__(self):
@@ -258,7 +302,7 @@ cdef class ScrollableInterface(Object):
will set if it is enabled for the given axis with the boolean
parameters for each axis.
- :type: (bool, bool)
+ :type: (bool **h**, bool **v**)
"""
def __get__(self):
@@ -292,7 +336,7 @@ cdef class ScrollableInterface(Object):
are normally between 0.0 and 1.0 including 1.0. If you only want a
single axis to be page "limited", use 0.0 for the other axis.
- :type: tuple of floats
+ :type: (float **h_pagerel**, float **v_pagerel**)
"""
def __set__(self, value):
@@ -373,7 +417,7 @@ cdef class ScrollableInterface(Object):
:py:func:`page_show()`
:py:func:`page_bring_in()`
- :type: tuple of ints
+ :type: (int **h_pagenumber**, int **v_pagenumber**)
"""
def __get__(self):
@@ -397,7 +441,7 @@ cdef class ScrollableInterface(Object):
:py:func:`page_show()`
:py:func:`page_bring_in()`
- :type: tuple of ints
+ :type: (int **h_pagenumber**, int **v_pagenumber**)
"""
def __get__(self):
@@ -526,7 +570,7 @@ cdef class ScrollableInterface(Object):
Default values for x and y are 0.0
- :type: tuple of floats
+ :type: (float **x**, float **y**)
"""
def __get__(self):
--
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1