summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_image.eo
blob: f7d4f9f50e71168511628febf445a8c3d6c7d2fa (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
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
import evas_image;

enum Elm.Image.Scale_Type
{
   [[Enumeration that defines scale types for the object's internal image.

     @since 1.18
   ]]
   none,       [[Not scale the internal image]]
   fill,       [[Scale the internal image so that it matches the object's area exactly.
                 The image's aspect ratio might be changed.]]
   fit_inside, [[Scale the internal image
                 so that it fits inside the object's area
                 while maintaining the aspect ratio.
                 At least one of the dimensions of the image
                 should be equal to the corresponding dimension of the object.]]
   fit_outside [[Scale the internal image
                 so that it covers the entire object area
                 while maintaining the aspect ratio.
                 At least one of the dimensions of the image
                 should be equal to the corresponding dimension of the object.]]
}

struct Elm.Image.Progress
{
   [[
     Structure associated with smart callback 'download,progress'.
     @since 1.8
   ]]
   now:   double;
   total: double;
}

struct Elm.Image.Error
{
   [[
     Structure associated with smart callback 'download,progress'.
     @since 1.8
   ]]
   status:     int;
   open_error: bool;
}

class Elm.Image (Elm.Widget, Evas.Clickable_Interface, Evas.Draggable_Interface,
                 Efl.File, Efl.Image, Efl.Image.Load, Efl.Player, Efl.Gfx.View, Efl.Player,
                 Elm.Interface.Atspi_Image, Elm.Interface.Atspi_Widget_Action,
                 Edje.Object, Efl.Orientation, Efl.Flipable)
{
   eo_prefix: elm_obj_image;
   methods {
      @property scale_type {
         [[Control how the internal image is scaled.

           @since 1.18]]
         set {
         }
         get {
         }
         values {
            scale_type: Elm.Image.Scale_Type;
         }
      }
      @property scalable {
         [[Enable or disable scaling up or down the internal image.

           @since 1.18]]
         set {
         }
         get {
         }
         values {
            scale_up: bool;   [[If $true, the internal image might be scaled up
                                if necessary according to the scale type.
                                if $false, the internal image is not scaled up
                                no matter what the scale type is.]]
            scale_down: bool; [[If $true, the internal image might be scaled down
                                if necessary according to the scale type.
                                if $false, the internal image is not scaled down
                                no matter what the scale type is.]]
         }
		}
      @property icon {
         set {
            [[Set the image by icon standards names.

              For example, freedesktop.org defines standard icon names such
              as "home", "network", etc. There can be different icon sets to
              match those icon keys. The "name" given as parameter is one of
              these "keys", and will be used to look in the freedesktop.org
              paths and elementary theme.

              If name is not found in any of the expected locations and it is
              the absolute path of an image file, this image will be used.

              Note: The image set by this function can be changed by
              @Efl.File.file.set.

              Note: This function does not accept relative icon path.

              See also @.icon.get.
            ]]
            return: bool; [[true on success, false on error]]
         }
         get {
            [[Get the icon name of image set by icon standard names.

              If the image was set using elm_image_file_set() instead of
              @.icon.set, then this function will return null.
            ]]
         }
         values {
            name: const(char)*; [[The icon name]]
         }
      }
   }
   implements {
      class.constructor;
      Eo.Base.constructor;
      Efl.File.file.set;
      Efl.File.file.get;
      Efl.File.mmap.set;
      Efl.File.async.set;
      Efl.File.async.get;
      Efl.File.async_wait;
      Efl.Gfx.View.view_size.get;
      Efl.Image.Load.load_size.set;
      Efl.Image.Load.load_size.get;
      Efl.Image.smooth_scale.set;
      Efl.Image.smooth_scale.get;
      Efl.Orientation.orientation.set;
      Efl.Orientation.orientation.get;
      Efl.Flipable.flip.set;
      Efl.Flipable.flip.get;
      Efl.Player.playable.get;
      Efl.Player.play.set;
      Efl.Player.play.get;
      Edje.Object.signal_emit;
      Edje.Object.size_min.get;
      Edje.Object.size_max.get;
      Edje.Object.size_min_calc;
      Edje.Object.calc_force;
      Evas.Object.Smart.hide;
      Evas.Object.Smart.clip.set;
      Evas.Object.Smart.clip_unset;
      Evas.Object.Smart.show;
      Evas.Object.Smart.color.set;
      Evas.Object.Smart.move;
      Evas.Object.Smart.add;
      Evas.Object.Smart.del;
      Evas.Object.Smart.member_add;
      Evas.Object.Smart.resize;
      Evas.Draggable_Interface.drag_target.set;
      Evas.Draggable_Interface.drag_target.get;
      Elm.Widget.theme_apply;
      Elm.Widget.event;
      Elm.Interface.Atspi_Image.extents.get;
      Elm.Interface.Atspi_Widget_Action.elm_actions.get;
   }
   events {
      drop;
      download,start;
      download,progress;
      download,done;
      download,error;
   }

}