summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-05-28 02:13:47 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-05-28 02:13:47 +0300
commit3f5a1a7d79785c95c874937948b422aeba3c61ea (patch)
tree8dfa7648ead01b2791883f39898ad35e2850527b
parent71456d0d62171858c1bf086b25eecc121ab7f5b2 (diff)
Elementary.gengrid: Add missing API
-rw-r--r--efl/elementary/enums.pxd5
-rw-r--r--efl/elementary/gengrid.pxd11
-rw-r--r--efl/elementary/gengrid.pyx28
-rw-r--r--efl/elementary/gengrid_widget.pxi74
4 files changed, 117 insertions, 1 deletions
diff --git a/efl/elementary/enums.pxd b/efl/elementary/enums.pxd
index 410e55b..343767c 100644
--- a/efl/elementary/enums.pxd
+++ b/efl/elementary/enums.pxd
@@ -353,6 +353,11 @@ cdef extern from "Elementary.h":
353 ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY 353 ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
354 ELM_OBJECT_SELECT_MODE_MAX 354 ELM_OBJECT_SELECT_MODE_MAX
355 355
356 ctypedef enum Elm_Object_Multi_Select_Mode:
357 ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT # default multiple select mode
358 ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL # disallow mutiple selection when clicked without control key pressed
359 ELM_OBJECT_MULTI_SELECT_MODE_MAX
360
356 ctypedef enum Elm_Panel_Orient: 361 ctypedef enum Elm_Panel_Orient:
357 ELM_PANEL_ORIENT_TOP 362 ELM_PANEL_ORIENT_TOP
358 ELM_PANEL_ORIENT_BOTTOM 363 ELM_PANEL_ORIENT_BOTTOM
diff --git a/efl/elementary/gengrid.pxd b/efl/elementary/gengrid.pxd
index 4706945..cc705c6 100644
--- a/efl/elementary/gengrid.pxd
+++ b/efl/elementary/gengrid.pxd
@@ -1,8 +1,10 @@
1from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb, \ 1from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb, \
2 Evas_Coord, Eina_Compare_Cb 2 Evas_Coord, Eina_Compare_Cb
3from efl.c_eo cimport Eo
3from object_item cimport Elm_Object_Item 4from object_item cimport Elm_Object_Item
4from general cimport Elm_Tooltip_Item_Content_Cb 5from general cimport Elm_Tooltip_Item_Content_Cb
5from enums cimport Elm_Genlist_Item_Scrollto_Type, Elm_Object_Select_Mode 6from enums cimport Elm_Genlist_Item_Scrollto_Type, Elm_Object_Select_Mode, \
7 Elm_Object_Multi_Select_Mode
6from efl.ecore.enums cimport Ecore_Pos_Map 8from efl.ecore.enums cimport Ecore_Pos_Map
7 9
8cdef extern from "Elementary.h": 10cdef extern from "Elementary.h":
@@ -25,8 +27,11 @@ cdef extern from "Elementary.h":
25 void elm_gengrid_clear(Evas_Object *obj) 27 void elm_gengrid_clear(Evas_Object *obj)
26 void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi) 28 void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi)
27 Eina_Bool elm_gengrid_multi_select_get(const Evas_Object *obj) 29 Eina_Bool elm_gengrid_multi_select_get(const Evas_Object *obj)
30 void elm_gengrid_multi_select_mode_set(Eo *obj, Elm_Object_Multi_Select_Mode mode)
31 Elm_Object_Multi_Select_Mode elm_gengrid_multi_select_mode_get(const Eo *obj)
28 void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting) 32 void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting)
29 Eina_Bool elm_gengrid_horizontal_get(const Evas_Object *obj) 33 Eina_Bool elm_gengrid_horizontal_get(const Evas_Object *obj)
34 void elm_gengrid_page_size_set(Eo *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
30 Elm_Object_Item * elm_gengrid_item_append(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data) 35 Elm_Object_Item * elm_gengrid_item_append(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data)
31 Elm_Object_Item * elm_gengrid_item_prepend(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data) 36 Elm_Object_Item * elm_gengrid_item_prepend(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data)
32 Elm_Object_Item * elm_gengrid_item_insert_before(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Elm_Object_Item *before, Evas_Smart_Cb func, const void *func_data) 37 Elm_Object_Item * elm_gengrid_item_insert_before(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, const void *data, Elm_Object_Item *before, Evas_Smart_Cb func, const void *func_data)
@@ -38,6 +43,8 @@ cdef extern from "Elementary.h":
38 void elm_gengrid_realized_items_update(Evas_Object *obj) 43 void elm_gengrid_realized_items_update(Evas_Object *obj)
39 Elm_Object_Item * elm_gengrid_first_item_get(const Evas_Object *obj) 44 Elm_Object_Item * elm_gengrid_first_item_get(const Evas_Object *obj)
40 Elm_Object_Item * elm_gengrid_last_item_get(const Evas_Object *obj) 45 Elm_Object_Item * elm_gengrid_last_item_get(const Evas_Object *obj)
46 void elm_gengrid_wheel_disabled_set(Eo *obj, Eina_Bool disabled)
47 Eina_Bool elm_gengrid_wheel_disabled_get(const Eo *obj)
41 unsigned int elm_gengrid_items_count(Evas_Object *obj) 48 unsigned int elm_gengrid_items_count(Evas_Object *obj)
42 void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) 49 void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
43 void elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) 50 void elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
@@ -52,6 +59,8 @@ cdef extern from "Elementary.h":
52 void elm_gengrid_page_show(Evas_Object *obj, int h_pagenum, int v_pagenum) 59 void elm_gengrid_page_show(Evas_Object *obj, int h_pagenum, int v_pagenum)
53 void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill) 60 void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill)
54 Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj) 61 Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj)
62 void elm_gengrid_page_relative_set(Eo *obj, double h_pagerel, double v_pagerel)
63 void elm_gengrid_page_relative_get(const Eo *obj, double *h_pagerel, double *v_pagerel)
55 void elm_gengrid_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode) 64 void elm_gengrid_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode)
56 Elm_Object_Select_Mode elm_gengrid_select_mode_get(const Evas_Object *obj) 65 Elm_Object_Select_Mode elm_gengrid_select_mode_get(const Evas_Object *obj)
57 void elm_gengrid_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight) 66 void elm_gengrid_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight)
diff --git a/efl/elementary/gengrid.pyx b/efl/elementary/gengrid.pyx
index 70284cc..42c36e6 100644
--- a/efl/elementary/gengrid.pyx
+++ b/efl/elementary/gengrid.pyx
@@ -280,6 +280,30 @@ Items' scroll to types
280 280
281 Scroll to the middle of viewport 281 Scroll to the middle of viewport
282 282
283
284.. _Elm_Gengrid_Object_Multi_Select_Mode:
285
286Multi-select mode
287=================
288
289.. data:: ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT
290
291 Default multiple select mode
292
293 .. versionadded:: 1.10
294
295.. data:: ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL
296
297 Disallow mutiple selection when clicked without control key pressed
298
299 .. versionadded:: 1.10
300
301.. data:: ELM_OBJECT_MULTI_SELECT_MODE_MAX
302
303 Value unknown
304
305 .. versionadded:: 1.10
306
283""" 307"""
284 308
285include "tooltips.pxi" 309include "tooltips.pxi"
@@ -309,6 +333,10 @@ ELM_GENLIST_ITEM_SCROLLTO_IN = enums.ELM_GENLIST_ITEM_SCROLLTO_IN
309ELM_GENLIST_ITEM_SCROLLTO_TOP = enums.ELM_GENLIST_ITEM_SCROLLTO_TOP 333ELM_GENLIST_ITEM_SCROLLTO_TOP = enums.ELM_GENLIST_ITEM_SCROLLTO_TOP
310ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = enums.ELM_GENLIST_ITEM_SCROLLTO_MIDDLE 334ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = enums.ELM_GENLIST_ITEM_SCROLLTO_MIDDLE
311 335
336ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT = enums.ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT
337ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL = enums.ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL
338ELM_OBJECT_MULTI_SELECT_MODE_MAX = enums.ELM_OBJECT_MULTI_SELECT_MODE_MAX
339
312def _cb_object_item_conv(uintptr_t addr): 340def _cb_object_item_conv(uintptr_t addr):
313 cdef Elm_Object_Item *it = <Elm_Object_Item *>addr 341 cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
314 return _object_item_to_python(it) 342 return _object_item_to_python(it)
diff --git a/efl/elementary/gengrid_widget.pxi b/efl/elementary/gengrid_widget.pxi
index 9c7c6a2..b0a8900 100644
--- a/efl/elementary/gengrid_widget.pxi
+++ b/efl/elementary/gengrid_widget.pxi
@@ -36,6 +36,31 @@ cdef class Gengrid(Object):
36 def multi_select_get(self): 36 def multi_select_get(self):
37 return bool(elm_gengrid_multi_select_get(self.obj)) 37 return bool(elm_gengrid_multi_select_get(self.obj))
38 38
39
40 property multi_select_mode:
41 """Gengrid multi select mode.
42
43 - ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever each
44 item is clicked.
45 - ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only one item will be selected
46 although multi-selection is enabled, if clicked without pressing control
47 key. This mode is only available with multi-selection.
48
49 (If getting mode is failed, it returns ELM_OBJECT_MULTI_SELECT_MODE_MAX)
50
51 :see: :py:attr:`multi_select`
52
53 :type: :ref:`Elm_Gengrid_Object_Multi_Select_Mode`
54
55 .. versionadded:: 1.10
56
57 """
58 def __set__(self, Elm_Object_Multi_Select_Mode mode):
59 elm_gengrid_multi_select_mode_set(self.obj, mode)
60
61 def __get__(self):
62 return elm_gengrid_multi_select_mode_get(self.obj)
63
39 property horizontal: 64 property horizontal:
40 """When in "horizontal mode" (``True),`` items will be placed 65 """When in "horizontal mode" (``True),`` items will be placed
41 in **columns**, from top to bottom and, when the space for a 66 in **columns**, from top to bottom and, when the space for a
@@ -59,6 +84,19 @@ cdef class Gengrid(Object):
59 def horizontal_get(self): 84 def horizontal_get(self):
60 return bool(elm_gengrid_horizontal_get(self.obj)) 85 return bool(elm_gengrid_horizontal_get(self.obj))
61 86
87 property page_size:
88 """Set a given gengrid widget's scrolling page size
89
90 :type: (int h_pagesize, int v_pagesize)
91
92 .. versionadded:: 1.10
93
94 """
95 def __set__(self, value):
96 cdef Evas_Coord h_pagesize, v_pagesize
97 h_pagesize, v_pagesize = value
98 elm_gengrid_page_size_set(self.obj, h_pagesize, v_pagesize)
99
62 def item_append(self, GengridItemClass item_class not None, 100 def item_append(self, GengridItemClass item_class not None,
63 item_data, func=None): 101 item_data, func=None):
64 """Append a new item (add as last item) to this gengrid. 102 """Append a new item (add as last item) to this gengrid.
@@ -244,6 +282,24 @@ cdef class Gengrid(Object):
244 def last_item_get(self): 282 def last_item_get(self):
245 return _object_item_to_python(elm_gengrid_last_item_get(self.obj)) 283 return _object_item_to_python(elm_gengrid_last_item_get(self.obj))
246 284
285 property wheel_disabled:
286 """Enable or disable mouse wheel to be used to scroll the gengrid.
287
288 Mouse wheel can be used for the user to scroll up and down the gengrid.
289
290 It's enabled by default.
291
292 :type: bool
293
294 .. versionadded:: 1.10
295
296 """
297 def __set__(self, bint disabled):
298 elm_gengrid_wheel_disabled_set(self.obj, disabled)
299
300 def __get__(self):
301 return bool(elm_gengrid_wheel_disabled_get(self.obj))
302
247 property items_count: 303 property items_count:
248 """Return how many items are currently in a list. 304 """Return how many items are currently in a list.
249 305
@@ -395,6 +451,24 @@ cdef class Gengrid(Object):
395 def filled_get(self, fill): 451 def filled_get(self, fill):
396 return bool(elm_gengrid_filled_get(self.obj)) 452 return bool(elm_gengrid_filled_get(self.obj))
397 453
454 property page_relative:
455 """Gengrid widget's scrolling page size, relative to its viewport size.
456
457 :type: (float h_pagerel, float v_pagerel)
458
459 .. versionadded:: 1.10
460
461 """
462 def __set__(self, value):
463 cdef double h_pagerel, v_pagerel
464 h_pagerel, v_pagerel = value
465 elm_gengrid_page_relative_set(self.obj, h_pagerel, v_pagerel)
466
467 def __get__(self):
468 cdef double h_pagerel, v_pagerel
469 elm_gengrid_page_relative_get(self.obj, &h_pagerel, &v_pagerel)
470 return h_pagerel, v_pagerel
471
398 property select_mode: 472 property select_mode:
399 """Item select mode in the gengrid widget. Possible values are: 473 """Item select mode in the gengrid widget. Possible values are:
400 474