summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_colorselector.eo
blob: 5aab88a998e8067c7082540f802fa42d21a3b0d7 (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
enum Elm.Colorselector.Mode
{
   [[Different modes supported by Colorselector

      See also @Elm.Colorselector.mode.set, @Elm.Colorselector.mode.get.
   ]]
   legacy: elm_colorselector;
   palette = 0, [[Only color palette is displayed.]]
   components, [[Only color selector is displayed.]]
   both, [[Both Palette and selector is displayed, default.]]
   picker, [[Only color picker is displayed.]]
   all [[All possible color selector is displayed.]]
}

class Elm.Colorselector (Elm.Layout, Elm.Interface.Atspi_Widget_Action,
                         Evas.Clickable_Interface)
{
   eo_prefix: elm_obj_colorselector;
   methods {
      @property color {
         set {
            [[Set color to colorselector.]]

         }
         get {
            [[Get current color from colorselector.]]
         }
         values {
            r: int; [[r-value of color]]
            g: int; [[g-value of color]]
            b: int; [[b-value of color]]
            a: int; [[a-value of color]]
         }
      }
      @property palette_name {
         set {
            [[Set current palette's name

              When colorpalette name is set, colors will be loaded from and saved to config
              using the set name. If no name is set then colors will be loaded from or
              saved to "default" config.
            ]]
         }
         get {
            [[Get current palette's name

              Returns the currently set palette name using which colors will be
              saved/loaded in to config.
            ]]
         }
         values {
            palette_name: const(char)*; [[Name of palette]]
         }
      }
      @property mode {
         set {
            [[Set Colorselector's mode.

              Colorselector supports three modes palette only, selector only and both.
            ]]
         }
         get {
            [[Get Colorselector's mode.]]
         }
         values {
            mode: Elm.Colorselector.Mode; [[Elm_Colorselector_Mode]]
         }
      }
      @property palette_items {
         get {
            [[Get list of palette items.

              Note That palette item list is internally managed by colorselector widget and
              it should not be freed/modified by application.

              @since 1.9
            ]]
            return: const(list<Elm.Widget.Item*>)*;[[The list of color palette items.]]
         }
      }
      @property palette_selected_item {
         get {
            [[Get the selected item in colorselector palette.

              @since 1.9]]

            return: Elm.Widget.Item *;[[The selected item, or $null if none
selected.]]
         }
      }
      palette_color_add {
         [[Add a new color item to palette.]]

         return: Elm.Widget.Item *;[[A new color palette Item.]]
         params {
            @in r: int; [[r-value of color]]
            @in g: int; [[g-value of color]]
            @in b: int; [[b-value of color]]
            @in a: int; [[a-value of color]]
         }
      }
      palette_clear {
         [[Clear the palette items.]]
      }
   }
   implements {
      class.constructor;
      Eo.Base.constructor;
      Evas.Object.Smart.add;
      Evas.Object.Smart.del;
      Elm.Widget.theme_apply;
      Elm.Widget.focus_next_manager_is;
      Elm.Widget.focus_next;
      Elm.Widget.focus_direction_manager_is;
      Elm.Widget.access;
      Elm.Widget.event;
      Elm.Layout.sizing_eval;
      Elm.Interface.Atspi_Widget_Action.elm_actions.get;
   }
   events {
      color,item,selected;
      color,item,longpressed;
      changed;
      changed,user;
   }

}