summaryrefslogtreecommitdiff
path: root/elementary/elementary.c_elementary_mapbuf.pxi
blob: dd4c69a9824a8f7a93e3ea1a1881d4727504b294 (plain)
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
# Copyright (c)  2012 Davide Andreoli <dave@gurumeditation.it>
#
# 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 public class Mapbuf(Object) [object PyElementaryMapbuf, type PyElementaryMapbuf_Type]:

    """This holds one content object and uses an Evas Map of transformation
    points to be later used with this content. So the content will be
    moved, resized, etc as a single image. So it will improve performance
    when you have a complex interface, with a lot of elements, and will
    need to resize or move it frequently (the content object and its
    children).

    """

    def __init__(self, evasObject parent):
        Object.__init__(self, parent.evas)
        self._set_obj(elm_mapbuf_add(parent.obj))

    def enabled_set(self, enabled):
        """Enable or disable the map.

        @param enabled: A boolean to set if the map should me enabled.
        @type enabled: bool

        """
        elm_mapbuf_enabled_set(self.obj, enabled)

    def enabled_get(self):
        """Get the enabled state of the map.

        @return: A boolean to indicating if the map is enabled
        @rtype: bool

        """
        return bool(elm_mapbuf_enabled_get(self.obj))

    property enabled:
        """The enabled state of the map.

        @type: bool

        """
        def __get__(self):
            return bool(elm_mapbuf_enabled_get(self.obj))
        def __set__(self, enabled):
            elm_mapbuf_enabled_set(self.obj, enabled)

    def smooth_set(self, smooth):
        """Enable or disable smooth map rendering.

        This sets smoothing for map rendering. If the object is a type that has
        its own smoothing settings, then both the smooth settings for this object
        and the map must be turned off.

        By default smooth maps are enabled.

        @param smooth: A boolean to set if the map should me enabled.
        @type smooth: bool

        """
        elm_mapbuf_smooth_set(self.obj, smooth)

    def smooth_get(self):
        """Get the smooth state of the map.

        @return: A boolean to indicating if the map will use smooth rendering
        @rtype: bool

        """
        return bool(elm_mapbuf_smooth_get(self.obj))

    property smooth:
        """Smooth map rendering.

        This sets smoothing for map rendering. If the object is a type that has
        its own smoothing settings, then both the smooth settings for this object
        and the map must be turned off.

        By default smooth maps are enabled.

        @type: bool

        """
        def __get__(self):
            return bool(elm_mapbuf_smooth_get(self.obj))
        def __set__(self, smooth):
            elm_mapbuf_smooth_set(self.obj, smooth)

    def alpha_set(self, alpha):
        """Set or unset alpha flag for map rendering.

        @param alpha: A boolean to set if the map should use transparency
        @type alpha: bool

        """
        elm_mapbuf_alpha_set(self.obj, alpha)

    def alpha_get(self):
        """Get the alpha state of the map.

        @return: A boolean to indicating if the alpha is enabled
        @rtype: bool

        """
        return bool(elm_mapbuf_alpha_get(self.obj))

    property alpha:
        """The alpha state of the map.

        @type: bool

        """
        def __get__(self):
            return bool(elm_mapbuf_alpha_get(self.obj))
        def __set__(self, alpha):
            elm_mapbuf_alpha_set(self.obj, alpha)


_elm_widget_type_register("mapbuf", Mapbuf)

cdef extern from "Elementary.h": # hack to force type to be known
    cdef PyTypeObject PyElementaryMapbuf_Type # hack to install metaclass
_install_metaclass(&PyElementaryMapbuf_Type, ElementaryObjectMeta)