summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_gfx_base.eo
blob: 4c351d647e97399a7bba8066ced1bf6cf648e8e7 (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
enum Efl.Gfx.Colorspace {
  argb8888 = 0, [[ARGB 32 bits per pixel, high-byte is Alpha, accessed one 32-bit word at a time]]
  gry8 = 4,     [[8-bit gray image, or alpha only]]
}

enum Efl.Gfx.Render_Op {
  blend = 0, [[Alpha blending onto destination (default); d = d*(1-sa) + s]]
  copy  = 1, [[Copy source to destination; d = s]]
  last
}

enum Efl.Gfx.Color_Type {
  bits8,     [[Color is encoded in the top 8 bits of the unsigned short as a unsigned char.]]
  bits16,    [[Color is encoded in the 16 bits as an unsigned char.]]
  last
}

struct Efl.Gfx.Color {
  [[Define an RGBA color.]]
  r: ushort; [[The red component.]]
  g: ushort; [[The green component.]]
  b: ushort; [[The blue component.]]
  a: ushort; [[The alpha component.]]

  type: Efl.Gfx.Color_Type;
}

interface Efl.Gfx.Base {
   legacy_prefix: null;
   eo_prefix: efl_gfx;
   methods {
      @property position {
         set {
            [[Move the given Evas object to the given location inside its
              canvas' viewport.
            ]]
         }
         get {
            [[Retrieves the position of the given Evas object.]]
         }
         values {
            x: int;
            y: int;
         }
      }
      @property size {
         set {
            [[Changes the size of the given Evas object.]]
         }
         get {
            [[Retrieves the (rectangular) size of the given Evas object.]]
         }
         values {
            w: int;
            h: int;
         }
      }
      @property color {
         set {
            [[Sets the general/main color of the given Evas object to the given
              one.

              See also @.color.get (for an example)

              These color values are expected to be premultiplied by alpha.
            ]]
         }
         get {
            [[Retrieves the general/main color of the given Evas object.

              Retrieves the main color's RGB component (and alpha channel)
              values, which range from 0 to 255. For the alpha channel,
              which defines the object's transparency level, 0 means totally
              transparent, while 255 means opaque. These color values are
              premultiplied by the alpha value.

              Usually youll use this attribute for text and rectangle objects,
              where the main color is their unique one. If set for objects
              which themselves have colors, like the images one, those colors
              get modulated by this one.

              All newly created Evas rectangles get the default color
              values of 255 255 255 255 (opaque white).

              Use null pointers on the components you're not interested
              in: they'll be ignored by the function.

              See the full \@ref Example_Evas_Object_Manipulation "example".
            ]]
         }
         values {
            r: int; [[The red component of the given color.]]
            g: int; [[The green component of the given color.]]
            b: int; [[The blue component of the given color.]]
            a: int; [[The alpha component of the given color.]]
         }
      }
      @property color_part {
         set {
            [[Sets a specifc color of the given Efl.Gfx.Base object to the
              given one.

              See also @.color.get (for an example)

              These color values are expected to be premultiplied by alpha.
            ]]
            return: bool;
         }
         get {
            [[Retrieves a specific color of the given Evas object.

              Retrieves a specific color's RGB component (and alpha channel)
              values, which range from 0 to 255. For the alpha channel,
              which defines the object's transparency level, 0 means totally
              transparent, while 255 means opaque. These color values are
              premultiplied by the alpha value.

              The main color being mapped to null.

              Usually youll use this attribute for text and rectangle objects,
              where the main color is their unique one. If set for objects
              which themselves have colors, like the images one, those colors
              get modulated by this one.

              Use null pointers on the components you're not interested
              in: they'll be ignored by the function.
            ]]
            return: bool;
         }
         keys {
            part: const (char)*; [[The part you are interested in.]]
         }
         values {
            r: int; [[The red component of the given color.]]
            g: int; [[The green component of the given color.]]
            b: int; [[The blue component of the given color.]]
            a: int; [[The alpha component of the given color.]]
         }
      }
      @property visible {
         set {
            [[Makes the given Evas object visible or invisible.]]
         }
         get {
            [[Retrieves whether or not the given Evas object is visible.]]
         }
         values {
            v: bool; [[true if to make the object visible, false otherwise]]
         }
      }
   }
}