kuuko pushed a commit to branch master.
commit e5e82619d5fb6c1197867f4b7533211949ef633c
Author: Kai Huuhko <[email protected]>
Date: Fri Apr 19 20:48:27 2013 +0000
Elementary: Add trivial methods/properties to label/mbentry/notify.
---
efl/elementary/label.pxd | 1 +
efl/elementary/label.pyx | 14 +++++++++++
efl/elementary/multibuttonentry.pxd | 4 +++-
efl/elementary/multibuttonentry.pyx | 18 +++++++++++++++
efl/elementary/notify.pxd | 4 +++-
efl/elementary/notify.pyx | 46 ++++++++++++++++++++++++++++++++++++-
6 files changed, 84 insertions(+), 3 deletions(-)
diff --git a/efl/elementary/label.pxd b/efl/elementary/label.pxd
index 0d25757..83af868 100644
--- a/efl/elementary/label.pxd
+++ b/efl/elementary/label.pxd
@@ -13,6 +13,7 @@ cdef extern from "Elementary.h":
Eina_Bool elm_label_slide_get(Evas_Object *obj)#DEP
void elm_label_slide_duration_set(Evas_Object *obj,
double duration)
double elm_label_slide_duration_get(Evas_Object *obj)
+ void elm_label_slide_area_limit_set(Evas_Object *obj,
Eina_Bool limit)
void elm_label_slide_mode_set(Evas_Object *obj,
Elm_Label_Slide_Mode mode)
Elm_Label_Slide_Mode elm_label_slide_mode_get(const_Evas_Object *obj)
void elm_label_slide_go(Evas_Object *obj)
diff --git a/efl/elementary/label.pyx b/efl/elementary/label.pyx
index 10ddd6e..e75ee39 100644
--- a/efl/elementary/label.pyx
+++ b/efl/elementary/label.pyx
@@ -232,6 +232,20 @@ cdef class Label(LayoutClass):
def slide_duration_get(self):
return elm_label_slide_duration_get(self.obj)
+ # TODO: In header but not implemented yet?
+ # property slide_area_limit:
+ # """
+ # Slide only if the
+
+ # :type: bool
+
+ # """
+ # def __set__(self, bint value):
+ # elm_label_slide_area_limit_set(self.obj, limit)
+
+ # def __get__(self):
+ # return elm_label_slide_area_limit_set(self.obj)
+
property slide_mode:
"""Change the slide mode of the label widget.
diff --git a/efl/elementary/multibuttonentry.pxd
b/efl/elementary/multibuttonentry.pxd
index 6ad2a7d..db4282a 100644
--- a/efl/elementary/multibuttonentry.pxd
+++ b/efl/elementary/multibuttonentry.pxd
@@ -25,4 +25,6 @@ cdef extern from "Elementary.h":
Elm_Object_Item
*elm_multibuttonentry_item_next_get(const_Elm_Object_Item *it)
void
elm_multibuttonentry_item_filter_append(Evas_Object *obj,
Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
void
elm_multibuttonentry_item_filter_prepend(Evas_Object *obj,
Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
- void
elm_multibuttonentry_item_filter_remove(Evas_Object *obj,
Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
+ # TODO: void
elm_multibuttonentry_item_filter_remove(Evas_Object *obj,
Elm_Multibuttonentry_Item_Filter_Cb func, void *data)
+ void elm_multibuttonentry_editable_set(Evas_Object
*obj, Eina_Bool editable)
+ Eina_Bool
elm_multibuttonentry_editable_get(const_Evas_Object *obj)
diff --git a/efl/elementary/multibuttonentry.pyx
b/efl/elementary/multibuttonentry.pyx
index ebe7eb5..5ed02bc 100644
--- a/efl/elementary/multibuttonentry.pyx
+++ b/efl/elementary/multibuttonentry.pyx
@@ -251,6 +251,24 @@ cdef class MultiButtonEntry(Object):
#TODO
pass
+ property editable:
+ """Whether the multibuttonentry is to be editable or not.
+
+ :type: bool
+
+ """
+ def __set__(self, value):
+ self.editable_set(value)
+
+ def __get__(self):
+ return self.editable_get()
+
+ cpdef editable_set(self, bint editable):
+ elm_multibuttonentry_editable_set(self.obj, editable)
+
+ cpdef bint editable_get(self):
+ return elm_multibuttonentry_editable_get(self.obj)
+
def callback_item_selected_add(self, func, *args, **kwargs):
self._callback_add("item,selected", func, *args, **kwargs)
diff --git a/efl/elementary/notify.pxd b/efl/elementary/notify.pxd
index 2321936..142578c 100644
--- a/efl/elementary/notify.pxd
+++ b/efl/elementary/notify.pxd
@@ -1,4 +1,4 @@
-from efl.evas cimport Eina_Bool, Evas_Object
+from efl.evas cimport Eina_Bool, Evas_Object, const_Evas_Object
from enums cimport Elm_Notify_Orient
cdef extern from "Elementary.h":
@@ -11,4 +11,6 @@ cdef extern from "Elementary.h":
double elm_notify_timeout_get(Evas_Object *obj)
void elm_notify_allow_events_set(Evas_Object *obj,
Eina_Bool repeat)
Eina_Bool elm_notify_allow_events_get(Evas_Object *obj)
+ void elm_notify_align_set(Evas_Object *obj, double
horizontal, double vertical)
+ void elm_notify_align_get(const_Evas_Object *obj,
double *horizontal, double *vertical)
diff --git a/efl/elementary/notify.pyx b/efl/elementary/notify.pyx
index 64b6932..ae742c3 100644
--- a/efl/elementary/notify.pyx
+++ b/efl/elementary/notify.pyx
@@ -37,6 +37,9 @@ Default content parts of the notify widget that you can use
are:
- ``"default"`` - The main content of the notify
+
+.. _Elm_Notify_Orient:
+
.. rubric:: Notify orientation types
.. data:: ELM_NOTIFY_ORIENT_TOP
@@ -75,6 +78,17 @@ Default content parts of the notify widget that you can use
are:
Bottom right orientation
+
+.. _ELM_NOTIFY_ALIGN_FILL:
+
+.. rubric:: ELM_NOTIFY_ALIGN_FILL
+
+.. data:: ELM_NOTIFY_ALIGN_FILL
+
+ Use with :py:attr:`Notify.align`
+
+ :since: 1.8
+
"""
include "widget_header.pxi"
@@ -94,6 +108,8 @@ ELM_NOTIFY_ORIENT_BOTTOM_LEFT =
enums.ELM_NOTIFY_ORIENT_BOTTOM_LEFT
ELM_NOTIFY_ORIENT_BOTTOM_RIGHT = enums.ELM_NOTIFY_ORIENT_BOTTOM_RIGHT
ELM_NOTIFY_ORIENT_LAST = enums.ELM_NOTIFY_ORIENT_LAST
+ELM_NOTIFY_ALIGN_FILL = -1.0
+
cdef class Notify(Object):
"""
@@ -128,7 +144,7 @@ cdef class Notify(Object):
property orient:
"""The position in which the notify will appear in its parent.
- :type: Elm_Notify_Orient
+ :type: :ref:`Notify orientation <Elm_Notify_Orient>`
"""
def __get__(self):
@@ -193,6 +209,34 @@ cdef class Notify(Object):
def allow_events_get(self):
return bool(elm_notify_allow_events_get(self.obj))
+
+ property align:
+ """Set the alignment of the notify object
+
+ :type: (float **horizontal**, float **vertical**)
+
+ Sets the alignment in which the notify will appear in its parent.
+
+ .. note:: To fill the notify box in the parent area, please pass
+ :ref:`ELM_NOTIFY_ALIGN_FILL <ELM_NOTIFY_ALIGN_FILL>` to
``horizontal``, ``vertical``.
+
+ :since: 1.8
+
+ """
+ def __set__(self, value):
+ self.align_set(*value)
+
+ def __get__(self):
+ return self.align_get()
+
+ cpdef align_set(self, float horizontal, float vertical):
+ elm_notify_align_set(self.obj, horizontal, vertical)
+
+ cpdef align_get(self):
+ cdef double horizontal, vertical
+ elm_notify_align_get(self.obj, &horizontal, &vertical)
+ return (horizontal, vertical)
+
def callback_timeout_add(self, func, *args, **kwargs):
"""When timeout happens on notify and it's hidden."""
self._callback_add("timeout", func, *args, **kwargs)
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter