summaryrefslogtreecommitdiff
path: root/efl
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2014-12-31 12:42:08 +0100
committerDave Andreoli <dave@gurumeditation.it>2014-12-31 12:42:08 +0100
commit9e2ad3382ebe6ad8671b4a1041828b5b1cf3e121 (patch)
tree604f5533f0070d101951ef8aed36d3e0514a1c94 /efl
parentb642c60b848257095b2a3fbed8133d42d73f43b3 (diff)
elm.Theme: added group_base_list_get() function
Diffstat (limited to 'efl')
-rw-r--r--efl/elementary/theme.pxd1
-rw-r--r--efl/elementary/theme.pyx34
2 files changed, 35 insertions, 0 deletions
diff --git a/efl/elementary/theme.pxd b/efl/elementary/theme.pxd
index 19df0e4..a57e08f 100644
--- a/efl/elementary/theme.pxd
+++ b/efl/elementary/theme.pxd
@@ -43,6 +43,7 @@ cdef extern from "Elementary.h":
43 Eina_List *elm_theme_name_available_list_new() 43 Eina_List *elm_theme_name_available_list_new()
44 void elm_theme_name_available_list_free(Eina_List *list) 44 void elm_theme_name_available_list_free(Eina_List *list)
45 char *elm_theme_data_get(Elm_Theme *th, const char *key) 45 char *elm_theme_data_get(Elm_Theme *th, const char *key)
46 Eina_List *elm_theme_group_base_list(Elm_Theme *th, const char *base)
46 47
47cdef class Theme(object): 48cdef class Theme(object):
48 cdef Elm_Theme *th 49 cdef Elm_Theme *th
diff --git a/efl/elementary/theme.pyx b/efl/elementary/theme.pyx
index 4a62b66..a15b5f0 100644
--- a/efl/elementary/theme.pyx
+++ b/efl/elementary/theme.pyx
@@ -90,6 +90,7 @@ from libc.stdint cimport uintptr_t
90 90
91from efl.eo cimport PY_REFCOUNT 91from efl.eo cimport PY_REFCOUNT
92from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list 92from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list
93from efl.eina cimport eina_list_free, eina_stringshare_del
93 94
94cdef class Theme(object): 95cdef class Theme(object):
95 96
@@ -402,6 +403,39 @@ cdef class Theme(object):
402 return _ctouni(elm_theme_data_get(self.th, 403 return _ctouni(elm_theme_data_get(self.th,
403 <const char *>key if key is not None else NULL)) 404 <const char *>key if key is not None else NULL))
404 405
406 def group_base_list_get(self, base not None):
407 """Get a list of groups that match the initial base string given.
408
409 This function will walk all theme files configured in the theme
410 and find all groups that BEGIN with the string ``begin`` and have
411 that string as at LEAST their start.
412
413 :param base: The base string group collection to look for
414 :type base: string
415
416 :return: The list of group names found (sorted)
417 :rtype: list of strings
418
419 .. versionadded:: 1.13
420
421 """
422 cdef:
423 const char *s
424 list ret = []
425 Eina_List *lst, *itr
426
427 if isinstance(base, unicode): base = PyUnicode_AsUTF8String(base)
428 lst = elm_theme_group_base_list(self.th, <const char *>base)
429 itr = lst
430 while itr:
431 s = <const char *>itr.data
432 ret.append(_ctouni(s))
433 eina_stringshare_del(s)
434 itr = itr.next
435 eina_list_free(lst)
436 return ret
437
438
405def theme_list_item_path_get(f not None, bint in_search_path): 439def theme_list_item_path_get(f not None, bint in_search_path):
406 """Return the full path for a theme element 440 """Return the full path for a theme element
407 441