summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-01-23 15:56:05 +0100
committerDave Andreoli <dave@gurumeditation.it>2016-01-23 15:56:25 +0100
commit24318c8d3351d816827a0ad1e14fcb8c64484a2a (patch)
tree681602583e45b355ad68e7970682ee24e2a47346
parent6980ffb0e44d72c3ee4db711182de9c55828cbfd (diff)
New 1.17 API: elm.Configuration.profile_* family functions
-rw-r--r--efl/elementary/configuration.pxi99
-rw-r--r--efl/elementary/configuration_cdef.pxi5
2 files changed, 99 insertions, 5 deletions
diff --git a/efl/elementary/configuration.pxi b/efl/elementary/configuration.pxi
index aac0f56..421e148 100644
--- a/efl/elementary/configuration.pxi
+++ b/efl/elementary/configuration.pxi
@@ -92,7 +92,7 @@ cdef class Configuration(object):
92 property profile_list: 92 property profile_list:
93 """Get Elementary's list of available profiles. 93 """Get Elementary's list of available profiles.
94 94
95 :type: tuple of strings 95 :type: tuple of strings (**readonly**)
96 96
97 """ 97 """
98 def __get__(self): 98 def __get__(self):
@@ -101,6 +101,99 @@ cdef class Configuration(object):
101 elm_config_profile_list_free(lst) 101 elm_config_profile_list_free(lst)
102 return ret 102 return ret
103 103
104 property profile_list_full:
105 """Get Elementary's list of available profiles, including hidden ones.
106
107 This gets a full list of profiles even with hidden names that should
108 not be user-visible.
109
110 :type: tuple of strings (**readonly**)
111
112 .. versionadded:: 1.17
113
114 """
115 def __get__(self):
116 cdef Eina_List *lst = elm_config_profile_list_full_get()
117 ret = tuple(eina_list_strings_to_python_list(lst))
118 elm_config_profile_list_free(lst)
119 return ret
120
121 def profile_exists(self, profile):
122 """Check if a profile of the given name exists.
123
124 :param str profile: Name of the pofile to search
125 :return: ``True`` if the profile exists, or ``False`` if not
126 :rtype: bool
127
128 .. versionadded:: 1.17
129
130 """
131 if isinstance(profile, unicode): profile = PyUnicode_AsUTF8String(profile)
132 return bool(elm_config_profile_exists(
133 <const char *>profile if profile is not None else NULL))
134
135 def profile_derived_add(self, profile, derive_options):
136 """Add a new profile of the given name to be derived from the current profile
137
138 This creates a new profile of name ``profile`` that will be derived from
139 the currently used profile using the modification commands encoded in
140 the ``derive_options`` string.
141
142 At this point it is not expected that anyone would generally use this
143 API except if you are a destktop environment and so the user base of
144 this API will be enlightenment itself.
145
146 :param str profile: The new profile's name
147 :param str derive_options: Derive options detailing how to modify
148
149 .. versionadded:: 1.17
150
151 """
152 if isinstance(profile, unicode): profile = PyUnicode_AsUTF8String(profile)
153 if isinstance(derive_options, unicode): derive_options = PyUnicode_AsUTF8String(derive_options)
154
155 elm_config_profile_derived_add(
156 <const char *>profile if profile is not None else NULL,
157 <const char *>derive_options if derive_options is not None else NULL)
158
159 def profile_derived_del(self, profile):
160 """Deletes a profile that is derived from the current one
161
162 This deletes a derived profile added by :func:`profile_derived_add`.
163 This will delete the profile of the given name ``profile`` that is
164 derived from the current profile.
165
166 At this point it is not expected that anyone would generally use this
167 API except if you are a destktop environment and so the user base of
168 this API will be enlightenment itself.
169
170 :param str profile: The profile's name that is to be deleted
171
172 .. versionadded:: 1.17
173
174 """
175 if isinstance(profile, unicode): profile = PyUnicode_AsUTF8String(profile)
176
177 elm_config_profile_derived_del(
178 <const char *>profile if profile is not None else NULL)
179
180 def profile_save(self, profile):
181 """Take the current config and write it out to the named profile.
182
183 This will take the current in-memory config and write it out to the
184 named profile specified by ``profile``. This will not change profile
185 for the application or make other processes switch profile.
186
187 :param str profile: The profile's name
188
189 .. versionadded:: 1.17
190
191 """
192 if isinstance(profile, unicode): profile = PyUnicode_AsUTF8String(profile)
193
194 elm_config_profile_save(
195 <const char *>profile if profile is not None else NULL)
196
104 property scroll_bounce_enabled: 197 property scroll_bounce_enabled:
105 """Whether scrollers should bounce when they reach their 198 """Whether scrollers should bounce when they reach their
106 viewport's edge during a scroll. 199 viewport's edge during a scroll.
@@ -190,7 +283,6 @@ cdef class Configuration(object):
190 def __set__(self, int threshold): 283 def __set__(self, int threshold):
191 elm_config_scroll_thumbscroll_threshold_set(threshold) 284 elm_config_scroll_thumbscroll_threshold_set(threshold)
192 285
193
194 property scroll_thumbscroll_hold_threshold: 286 property scroll_thumbscroll_hold_threshold:
195 """The number of pixels the range which can be scrolled, 287 """The number of pixels the range which can be scrolled,
196 while the scroller is held. 288 while the scroller is held.
@@ -309,7 +401,6 @@ cdef class Configuration(object):
309 def __set__(self, double friction): 401 def __set__(self, double friction):
310 elm_config_scroll_thumbscroll_sensitivity_friction_set(friction) 402 elm_config_scroll_thumbscroll_sensitivity_friction_set(friction)
311 403
312
313 property scroll_thumbscroll_acceleration_threshold: 404 property scroll_thumbscroll_acceleration_threshold:
314 """The minimum speed of mouse cursor movement which will accelerate 405 """The minimum speed of mouse cursor movement which will accelerate
315 scrolling velocity after a mouse up event (pixels/second). 406 scrolling velocity after a mouse up event (pixels/second).
@@ -426,7 +517,6 @@ cdef class Configuration(object):
426 def __get__(self): 517 def __get__(self):
427 return elm_config_softcursor_mode_get() 518 return elm_config_softcursor_mode_get()
428 519
429
430 property transition_duration_factor: 520 property transition_duration_factor:
431 """The transitions duration factor. 521 """The transitions duration factor.
432 522
@@ -908,7 +998,6 @@ cdef class Configuration(object):
908 def __set__(self, int size): 998 def __set__(self, int size):
909 elm_config_cache_image_cache_size_set(size) 999 elm_config_cache_image_cache_size_set(size)
910 1000
911
912 property cache_edje_file_cache_size: 1001 property cache_edje_file_cache_size:
913 """The globally configured edje file cache size, in number of files. 1002 """The globally configured edje file cache size, in number of files.
914 1003
diff --git a/efl/elementary/configuration_cdef.pxi b/efl/elementary/configuration_cdef.pxi
index 40678b6..48ec70c 100644
--- a/efl/elementary/configuration_cdef.pxi
+++ b/efl/elementary/configuration_cdef.pxi
@@ -60,8 +60,13 @@ cdef extern from "Elementary.h":
60 const char * elm_config_profile_dir_get(const char *profile, Eina_Bool is_user) 60 const char * elm_config_profile_dir_get(const char *profile, Eina_Bool is_user)
61 void elm_config_profile_dir_free(const char *p_dir) 61 void elm_config_profile_dir_free(const char *p_dir)
62 Eina_List * elm_config_profile_list_get() 62 Eina_List * elm_config_profile_list_get()
63 Eina_List * elm_config_profile_list_full_get()
63 void elm_config_profile_list_free(Eina_List *l) 64 void elm_config_profile_list_free(Eina_List *l)
64 void elm_config_profile_set(const char *profile) 65 void elm_config_profile_set(const char *profile)
66 Eina_Bool elm_config_profile_exists(const char *profile)
67 void elm_config_profile_derived_add(const char *profile, const char *derive_options)
68 void elm_config_profile_derived_del(const char *profile)
69 void elm_config_profile_save(const char *profile)
65 70
66 Eina_Bool elm_config_scroll_bounce_enabled_get() 71 Eina_Bool elm_config_scroll_bounce_enabled_get()
67 void elm_config_scroll_bounce_enabled_set(Eina_Bool enabled) 72 void elm_config_scroll_bounce_enabled_set(Eina_Bool enabled)