summaryrefslogtreecommitdiff
path: root/efl/elementary/efl.elementary_icon.pxi
blob: 12f95ca40a9fba2f5824a57dd6bd709c0d8bd8a8 (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
# Copyright (c) 2008-2009 Simon Busch
#
# This file is part of python-elementary.
#
# python-elementary 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 3 of the License, or
# (at your option) any later version.
#
# python-elementary 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 python-elementary.  If not, see <http://www.gnu.org/licenses/>.
#

cdef class Icon(Image):

    def __init__(self, evasObject parent):
        self._set_obj(elm_icon_add(parent.obj))

    def thumb_set(self, filename, group = None):
        if group == None:
            elm_icon_thumb_set(self.obj, _cfruni(filename), NULL)
        else:
            elm_icon_thumb_set(self.obj, _cfruni(filename), _cfruni(group))

    property thumb:
        def __set__(self, value):
            if isinstance(value, tuple):
                filename, group = value
            else:
                filename = value
                group = None
            # TODO: check return value
            elm_icon_thumb_set(self.obj, _cfruni(filename), _cfruni(group))

    def standard_set(self, name):
        return bool(elm_icon_standard_set(self.obj, _cfruni(name)))

    def standard_get(self):
        return _ctouni(elm_icon_standard_get(self.obj))

    property standard:
        def __get__(self):
            return _ctouni(elm_icon_standard_get(self.obj))
        def __set__(self, name):
            # TODO: check return value
            elm_icon_standard_set(self.obj, _cfruni(name))

    def order_lookup_set(self, order):
        elm_icon_order_lookup_set(self.obj, order)

    def order_lookup_get(self):
        return elm_icon_order_lookup_get(self.obj)

    property order_lookup:
        def __get__(self):
            return elm_icon_order_lookup_get(self.obj)
        def __set__(self, order):
            elm_icon_order_lookup_set(self.obj, order)

    def callback_thumb_done_add(self, func, *args, **kwargs):
        self._callback_add("thumb,done", func, *args, **kwargs)

    def callback_thumb_done_del(self, func):
        self._callback_del("thumb,done", func)

    def callback_thumb_error_add(self, func, *args, **kwargs):
        self._callback_add("thumb,error", func, *args, **kwargs)

    def callback_thumb_error_del(self, func):
        self._callback_del("thumb,error", func)


_object_mapping_register("elm_icon", Icon)