summaryrefslogtreecommitdiff
path: root/src/lib/efl_canvas_wl/efl_canvas_wl.eo
blob: 4481ef4f1232ff6cf4a1ab0a4db2ac657d315119 (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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import efl_exe;
import efl_input_device;
import efl_canvas_wl_surface;

struct @beta @extern Efl.Canvas.Wl_Wl_Surface; [[ struct wl_surface. @since 1.24 ]]
struct @beta @extern Efl.Canvas.Wl_Wl_Global; [[ struct wl_global. @since 1.24 ]]
struct @beta @extern Efl.Canvas.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]]
struct @beta @extern Efl.Canvas.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]]
struct @beta @extern Efl.Canvas.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]]
struct @beta @extern Efl.Canvas.Wl_Xkb_State; [[ struct xkb_state. @since 1.24 ]]
struct @beta @extern Efl.Canvas.Wl_Wl_Array; [[ struct wl_array. @since 1.24 ]]


enum @beta Efl.Canvas.Wl.Rotation
{
   [[Orientation of the internal compositor object in degrees. These values are COUNTER-CLOCKWISE.
   ]]
   rotate_0 = 0,
   rotate_90 = 1,
   rotate_180 = 2,
   rotate_270 = 3
}

class @beta Efl.Canvas.Wl extends Efl.Canvas.Group
{
   [[A multiseat xdg-shell compliant Wayland compositor which runs in a canvas object.

     All toplevel windows will be sized to the size of the compositor object unless extracted with
     @Efl.Canvas.Wl_Surface.extract.

     Only clients executed with @Efl.Canvas.Wl.run or added with @.allowed_pid_add will
     be permitted to connect to this compositor.

     If no surface is activated at the time of the first toplevel surface's first buffer commit, this
     first surface will automatically be activated so long as its geometry is not externally modified
     during this time. If regularly modifying geometry is necessary, surfaces should be manually activated
     with the @.active_surface property.

     @since 1.24
   ]]
   data: Comp;
   methods {
      run {
         [[
           Run a specified command in the compositor widget.
           If GL is available, the ELM_ACCEL environment variable will be set to "gl" while executing the command.
         ]]
         params {
            cmd: string; [[The command to execute.]]
         }
         return: Efl.Exe; [[The exe object for the executed process. $NULL on failure.]]
      }
      @property exec_flags {
         [[The flags to be used when running commands with @Efl.Canvas.Wl.run.
         Changing this value will only affect commands run after this call.

         The default is @Efl.Exe_Flags.term_with_parent.
         ]]
         values {
            flags: Efl.Exe_Flags; [[A bitmask of flags.]]
         }
      }
      allowed_pid_add {
         [[Add a process to the list of allowed clients for the compositor widget.

           Once called, this client will be capable of connecting to the internal compositor
           even if it was not executed by the widget.
         ]]
         params {
            pid: int; [[The pid to add.]]
         }
      }
      allowed_pid_del {
         [[Remove a process from the list of allowed clients for the compositor widget.

           Once called, this client will be incapable of connecting to the internal compositor
           even if it was executed by the widget.
         ]]
         params {
            pid: int; [[The pid to remove.]]
         }
      }
      surface_next {
         [[Activate and raise the bottom-most toplevel surface.]]
         return: Efl.Canvas.Wl_Surface; [[The surface that was activated, or $NULL if no change was made.]]
      }
      surface_prev {
         [[Activate and raise the second top-most toplevel surface.]]
         return: Efl.Canvas.Wl_Surface; [[The surface that was activated, or $NULL if no change was made.]]
      }
      @property active_surface {
         [[This is the currently activated surface in the compositor widget.
           Only one surface can be activated at a time.
         ]]
         get {}
         set {
            return: bool; [[Returns $true if a change was successfully made.]]
         }
         values {
            surface: Efl.Canvas.Wl_Surface; [[The activated surface.]]
         }
      }
      @property aspect_propagate {
         [[When set to $true, the compositor will propagate the aspect ratio of the top-most
           surface to the @Efl.Gfx.Hint.hint_aspect of the compositor widget.
         ]]
         values {
            set: bool; [[Whether to propagate the hint.]]
         }
      }
      @property minmax_propagate {
         [[When set to $true, the compositor will propagate the min and max hints of the top-most
           surface to the @Efl.Gfx.Hint.hint_size_min and @Efl.Gfx.Hint.hint_size_max of the compositor widget.
         ]]
         values {
            set: bool; [[Whether to propagate the hints.]]
         }
      }
      @property rotation {
         [[Set the rotation and flip for the compositor's internal output, which is passed to clients.

           Note that the rotation provided here is counter-clockwise.
         ]]
         values {
            rotation: Efl.Canvas.Wl.Rotation; [[The rotation to apply to the internal output.]]
            rtl: bool; [[The horizontal flip to apply to the internal output.]]
         }
      }
      global_add {
         [[Add a new wl_global to the internal compositor.

           Use this to add implementations of custom extensions for use in the compositor.
           Globals are removed with wl_global_destroy in libwayland.

           Read Wayland documentation for more info.
         ]]
         params {
            interface: const(Efl.Canvas.Wl_Wl_Interface) @by_ref; [[The wl_interface of callbacks for the protocol.]]
            version: uint; [[The version of the protocol.]]
            data: Efl.Canvas.Wl_Wl_Interface_Data @by_ref; [[The data to be passed to the callback functions.]]
            bind_cb: Efl.Canvas.Wl_Wl_Interface_Bind_Cb @by_ref; [[The callback to trigger when a client has bound this global.]]
         }
         return: Efl.Canvas.Wl_Wl_Global @by_ref; [[The $wl_global or $NULL on failure.]]
      }
      seat_keymap_set {
         [[Sets the keymap for the internal compositor's seat.

           This is useful when nesting the compositor widget inside another compositor in order to reuse the existing keymap and state.
         ]]
         params {
            seat: Efl.Input.Device; [[The seat to set the keymap of, or $NULL for all seats.]]
            state: Efl.Canvas.Wl_Xkb_State @by_ref; [[The $xkb_state to apply.]]
            keymap_str: string; [[The keymap type as a string, as reported by libxkbcommon.
                                  The lifetime of the passed string must exceed the lifetime of the compositor widget.
                                ]]
            key_array: Efl.Canvas.Wl_Wl_Array @by_ref; [[The current $wl_array of keys.]]
         }
      }
      seat_key_repeat_set {
         [[Modify the key repeat rate and delay of the internal compositor for a given seat.
           This is the value sent to clients.
         ]]
         params {
            seat: Efl.Input.Device; [[The seat to set the repeat rate and delay of, or $NULL for all seats.]]
            repeat_rate: int; [[The repeat rate to set in number of times per second keys should repeat.]]
            repeat_delay: int; [[The delay before repeating should begin in milliseconds.]]
         }
      }
   }
   implements {
      Efl.Object.constructor;
      Efl.Gfx.Entity.visible { set; }
      Efl.Gfx.Entity.size { set; }
      Efl.Gfx.Entity.position { set; }
      Efl.Gfx.Entity.scale { get; set; }
   }
   events {
      toplevel,added: Efl.Canvas.Wl_Surface; [[Contains the toplevel surface which was added.]]
      child,added: Efl.Canvas.Wl_Surface; [[Contains the toplevel child surface which was added.]]
      popup,added: Efl.Canvas.Wl_Surface; [[Contains the popup surface which was added.]]
      seat,added: Efl.Input.Device; [[Contains the seat object that was added.]]
   }
}