summaryrefslogtreecommitdiff
path: root/efl/elementary/efl.elementary_configuration.pxi
blob: b1dfa56474268aa4256b4da6fb825afa869805ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
#
# This file is part of Python-EFL.
#
# Python-EFL is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# Python-EFL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.


cdef class Configuration(object):

    def save(self):
        return bool(elm_config_save())

    def reload(self):
        elm_config_reload()

    def all_flush(self):
        elm_config_all_flush()

    property profile:
        def __get__(self):
            return _ctouni(elm_config_profile_get())
        def __set__(self, profile):
            elm_config_profile_set(_cfruni(profile))

    def profile_dir_get(self, profile, is_user):
        return _ctouni(elm_config_profile_dir_get(_cfruni(profile), is_user))

    property profile_list:
        def __get__(self):
            cdef Eina_List *lst = elm_config_profile_list_get()
            return tuple(_strings_to_python(lst))

    property scroll_bounce_enabled:
        def __get__(self):
            return bool(elm_config_scroll_bounce_enabled_get())
        def __set__(self, enabled):
            elm_config_scroll_bounce_enabled_set(enabled)

    property scroll_bounce_friction:
        def __get__(self):
            return elm_config_scroll_bounce_friction_get()
        def __set__(self, friction):
            elm_config_scroll_bounce_friction_set(friction)

    property scroll_page_scroll_friction:
        def __get__(self):
            return elm_config_scroll_page_scroll_friction_get()
        def __set__(self, friction):
            elm_config_scroll_page_scroll_friction_set(friction)

    property scroll_bring_in_scroll_friction:
        def __get__(self):
            return elm_config_scroll_bring_in_scroll_friction_get()
        def __set__(self, friction):
            elm_config_scroll_bring_in_scroll_friction_set(friction)

    property scroll_zoom_friction:
        def __get__(self):
            return elm_config_scroll_zoom_friction_get()
        def __set__(self, friction):
            elm_config_scroll_zoom_friction_set(friction)

    property scroll_thumbscroll_enabled:
        def __get__(self):
            return bool(elm_config_scroll_thumbscroll_enabled_get())
        def __set__(self, enabled):
            elm_config_scroll_thumbscroll_enabled_set(enabled)

    property scroll_thumbscroll_threshold:
        def __get__(self):
            return elm_config_scroll_thumbscroll_threshold_get()
        def __set__(self, threshold):
            elm_config_scroll_thumbscroll_threshold_set(threshold)

    property scroll_thumbscroll_momentum_threshold:
        def __get__(self):
            return elm_config_scroll_thumbscroll_momentum_threshold_get()
        def __set__(self, threshold):
            elm_config_scroll_thumbscroll_momentum_threshold_set(threshold)

    property scroll_thumbscroll_friction:
        def __get__(self):
            return elm_config_scroll_thumbscroll_friction_get()
        def __set__(self, friction):
            elm_config_scroll_thumbscroll_friction_set(friction)

    property scroll_thumbscroll_border_friction:
        def __get__(self):
            return elm_config_scroll_thumbscroll_border_friction_get()
        def __set__(self, friction):
            elm_config_scroll_thumbscroll_border_friction_set(friction)

    property scroll_thumbscroll_sensitivity_friction:
        def __get__(self):
            return elm_config_scroll_thumbscroll_sensitivity_friction_get()
        def __set__(self, friction):
            elm_config_scroll_thumbscroll_sensitivity_friction_set(friction)


    property longpress_timeout:
        def __get__(self):
            return elm_config_longpress_timeout_get()
        def __set__(self, longpress_timeout):
            elm_config_longpress_timeout_set(longpress_timeout)

    property tooltip_delay:
        def __get__(self):
            return elm_config_tooltip_delay_get()
        def __set__(self, delay):
            elm_config_tooltip_delay_set(delay)

    property cursor_engine_only:
        def __get__(self):
            return elm_config_cursor_engine_only_get()
        def __set__(self, engine_only):
            elm_config_cursor_engine_only_set(engine_only)

    property scale:
        def __get__(self):
            return elm_config_scale_get()
        def __set__(self, scale):
            elm_config_scale_set(scale)

    property password_show_last:
        def __get__(self):
            return elm_config_password_show_last_get()
        def __set__(self, password_show_last):
            elm_config_password_show_last_set(password_show_last)

    property password_show_last_timeout:
        def __get__(self):
            return elm_config_password_show_last_timeout_get()
        def __set__(self, password_show_last_timeout):
            elm_config_password_show_last_timeout_set(password_show_last_timeout)

    property engine:
        def __get__(self):
            return _ctouni(elm_config_engine_get())
        def __set__(self, engine):
            elm_config_engine_set(_cfruni(engine))

    property preferred_engine:
        def __get__(self):
            return _ctouni(elm_config_preferred_engine_get())
        def __set__(self, engine):
            elm_config_preferred_engine_set(_cfruni(engine))

    property text_classes_list:
        def __get__(self):
            cdef Eina_List *lst
            cdef Elm_Text_Class *data
            cdef const_char_ptr name, desc
            ret = []
            lst = elm_config_text_classes_list_get()
            while lst:
                data = <Elm_Text_Class *>lst.data
                if data != NULL:
                    name = data.name
                    desc = data.desc
                    ret.append((_ctouni(name), _ctouni(desc)))
                lst = lst.next
            return ret

    property font_overlay_list:
        def __get__(self):
            cdef const_Eina_List *lst
            cdef Elm_Font_Overlay *data
            cdef const_char_ptr text_class, font
            cdef Evas_Font_Size size
            ret = []
            lst = elm_config_font_overlay_list_get()
            while lst:
                data = <Elm_Font_Overlay *>lst.data
                if data != NULL:
                    text_class = data.text_class
                    font = data.font
                    size = data.size
                    ret.append((_ctouni(text_class), _ctouni(font), size))
                lst = lst.next
            return ret

    def font_overlay_set(self, text_class, font, size):
        elm_config_font_overlay_set(_cfruni(text_class), _cfruni(font), size)

    def font_overlay_unset(self, text_class):
        elm_config_font_overlay_unset(_cfruni(text_class))

    def font_overlay_apply(self):
        elm_config_font_overlay_apply()

    property finger_size:
        def __get__(self):
            return elm_config_finger_size_get()
        def __set__(self, size):
            elm_config_finger_size_set(size)

    property cache_flush_interval:
        def __get__(self):
            return elm_config_cache_flush_interval_get()
        def __set__(self, size):
            elm_config_cache_flush_interval_set(size)

    property cache_flush_enabled:
        def __get__(self):
            return bool(elm_config_cache_flush_enabled_get())
        def __set__(self, enabled):
            elm_config_cache_flush_enabled_set(enabled)

    property cache_font_cache_size:
        def __get__(self):
            return elm_config_cache_font_cache_size_get()
        def __set__(self, size):
            elm_config_cache_font_cache_size_set(size)

    property cache_image_cache_size:
        def __get__(self):
            return elm_config_cache_image_cache_size_get()
        def __set__(self, size):
            elm_config_cache_image_cache_size_set(size)


    property cache_edje_file_cache_size:
        def __get__(self):
            return elm_config_cache_edje_file_cache_size_get()
        def __set__(self, size):
            elm_config_cache_edje_file_cache_size_set(size)

    property cache_edje_collection_cache_size:
        def __get__(self):
            return elm_config_cache_edje_collection_cache_size_get()
        def __set__(self, size):
            elm_config_cache_edje_collection_cache_size_set(size)

    property focus_highlight_enabled:
        def __get__(self):
            return bool(elm_config_focus_highlight_enabled_get())
        def __set__(self, enable):
            elm_config_focus_highlight_enabled_set(enable)

    property focus_highlight_animate:
        def __get__(self):
            return bool(elm_config_focus_highlight_animate_get())
        def __set__(self, animate):
            elm_config_focus_highlight_animate_set(animate)

    property mirrored:
        def __get__(self):
            return bool(elm_config_mirrored_get())
        def __set__(self, mirrored):
            elm_config_mirrored_set(mirrored)


def config_finger_size_get():
    return elm_config_finger_size_get()

def config_finger_size_set(size):
    elm_config_finger_size_set(size)

def config_tooltip_delay_get():
    return elm_config_tooltip_delay_get()

def config_tooltip_delay_set(delay):
    elm_config_tooltip_delay_set(delay)

def focus_highlight_enabled_get():
    return elm_config_focus_highlight_enabled_get()

def focus_highlight_enabled_set(enabled):
    elm_config_focus_highlight_enabled_set(enabled)

def focus_highlight_animate_get():
    return elm_config_focus_highlight_animate_get()

def focus_highlight_animate_set(animate):
    elm_config_focus_highlight_animate_set(animate)

def preferred_engine_get():
    return _ctouni(elm_config_preferred_engine_get())

def preferred_engine_set(engine):
    elm_config_preferred_engine_set(engine)

def engine_get():
    return _ctouni(elm_config_engine_get())

def engine_set(engine):
    elm_config_engine_set(_cfruni(engine))

def scale_get():
    return elm_config_scale_get()

def scale_set(scale):
    elm_config_scale_set(scale)

def cursor_engine_only_get():
    return elm_config_cursor_engine_only_get()

def cursor_engine_only_set(engine_only):
    elm_config_cursor_engine_only_set(engine_only)