summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-13 12:16:51 -0400
committerMike Blumenkrantz <zmike@samsung.com>2020-03-13 12:17:22 -0400
commitaf96a44ef7af66f9b8e969a211bfee1e42fa03a3 (patch)
tree952be808282e800d36133be5bb5e71290028afe9
parent907a2fb640aee4508ccc99a87ccba6e7a4eb4d2d (diff)
efl/wl: add docs for base compositor object
Summary: also rename some methods Depends on D11500 Reviewers: bu5hm4n, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11501
-rw-r--r--src/bin/efl_canvas_wl/efl_canvas_wl_test.c4
-rw-r--r--src/lib/efl_canvas_wl/efl_canvas_wl.c8
-rw-r--r--src/lib/efl_canvas_wl/efl_canvas_wl.eo126
3 files changed, 99 insertions, 39 deletions
diff --git a/src/bin/efl_canvas_wl/efl_canvas_wl_test.c b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c
index 4bb7e616af..6bedb9ce47 100644
--- a/src/bin/efl_canvas_wl/efl_canvas_wl_test.c
+++ b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c
@@ -63,8 +63,8 @@ main(int argc, char *argv[])
63 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 63 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
64 64
65 o = efl_add(EFL_CANVAS_WL_CLASS, win); 65 o = efl_add(EFL_CANVAS_WL_CLASS, win);
66 efl_canvas_wl_aspect_set(o, 1); 66 efl_canvas_wl_aspect_propagate_set(o, 1);
67 efl_canvas_wl_minmax_set(o, 1); 67 efl_canvas_wl_minmax_propagate_set(o, 1);
68 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 68 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
69 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 69 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
70 evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, hints_changed, win); 70 evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, hints_changed, win);
diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c
index 997703299f..734378fcff 100644
--- a/src/lib/efl_canvas_wl/efl_canvas_wl.c
+++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c
@@ -5690,13 +5690,13 @@ _efl_canvas_wl_efl_gfx_entity_scale_set(Eo *obj EINA_UNUSED, Comp *c, double sca
5690} 5690}
5691 5691
5692EOLIAN static Eina_Bool 5692EOLIAN static Eina_Bool
5693_efl_canvas_wl_aspect_get(const Eo *obj EINA_UNUSED, Comp *c) 5693_efl_canvas_wl_aspect_propagate_get(const Eo *obj EINA_UNUSED, Comp *c)
5694{ 5694{
5695 return c->aspect; 5695 return c->aspect;
5696} 5696}
5697 5697
5698EOLIAN static void 5698EOLIAN static void
5699_efl_canvas_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) 5699_efl_canvas_wl_aspect_propagate_set(Eo *obj, Comp *c, Eina_Bool set)
5700{ 5700{
5701 if (c->aspect == (!!set)) return; 5701 if (c->aspect == (!!set)) return;
5702 c->aspect = !!set; 5702 c->aspect = !!set;
@@ -5707,13 +5707,13 @@ _efl_canvas_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set)
5707} 5707}
5708 5708
5709EOLIAN static Eina_Bool 5709EOLIAN static Eina_Bool
5710_efl_canvas_wl_minmax_get(const Eo *obj EINA_UNUSED, Comp *c) 5710_efl_canvas_wl_minmax_propagate_get(const Eo *obj EINA_UNUSED, Comp *c)
5711{ 5711{
5712 return c->minmax; 5712 return c->minmax;
5713} 5713}
5714 5714
5715EOLIAN static void 5715EOLIAN static void
5716_efl_canvas_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) 5716_efl_canvas_wl_minmax_propagate_set(Eo *obj, Comp *c, Eina_Bool set)
5717{ 5717{
5718 if (c->minmax == (!!set)) return; 5718 if (c->minmax == (!!set)) return;
5719 c->minmax = !!set; 5719 c->minmax = !!set;
diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.eo b/src/lib/efl_canvas_wl/efl_canvas_wl.eo
index 9924ce9a1f..4b0e4fa353 100644
--- a/src/lib/efl_canvas_wl/efl_canvas_wl.eo
+++ b/src/lib/efl_canvas_wl/efl_canvas_wl.eo
@@ -23,87 +23,147 @@ enum @beta Efl.Canvas.Wl.Rotation
23 23
24class @beta Efl.Canvas.Wl extends Efl.Canvas.Group 24class @beta Efl.Canvas.Wl extends Efl.Canvas.Group
25{ 25{
26 [[ 26 [[A multiseat xdg-shell compliant Wayland compositor which runs in a canvas object.
27
28 All toplevel windows will be sized to the size of the compositor object unless extracted with
29 @Efl.Canvas.Wl.Surface.extract.
30
31 Only clients executed with @Efl.Canvas.Wl.run or added with @.allowed_pid_add will
32 be permitted to connect to this compositor.
33
34 If no surface is activated at the time of the first toplevel surface's first buffer commit, this
35 first surface will automatically be activated so long as its geometry is not externally modified
36 during this time. If regularly modifying geometry is necessary, surfaces should be manually activated
37 with the @.active_surface property.
38
27 @since 1.24 39 @since 1.24
28 ]] 40 ]]
29 data: Comp; 41 data: Comp;
30 methods { 42 methods {
31 run { 43 run {
32 [[This runs a command in the compositor using the @Efl.Exe_Flags.term_with_parent flag. 44 [[
45 Run a specified command in the compositor widget.
46 If GL is available, the ELM_ACCEL environment variable will be set to "gl" while executing the command.
33 ]] 47 ]]
34 params { 48 params {
35 cmd: string; 49 cmd: string; [[The command to execute.]]
36 } 50 }
37 return: Efl.Exe; 51 return: Efl.Exe; [[The exe object for the executed process. $NULL on failure.]]
38 } 52 }
39 @property exec_flags { 53 @property exec_flags {
54 [[The flags to be used when running commands with @Efl.Canvas.Wl.run.
55 Changing this value will only affect commands run after this call.
56
57 The default is @Efl.Exe_Flags.term_with_parent.
58 ]]
40 values { 59 values {
41 flags: Efl.Exe_Flags; 60 flags: Efl.Exe_Flags; [[A bitmask of flags.]]
42 } 61 }
43 } 62 }
44 allowed_pid_add { 63 allowed_pid_add {
64 [[Add a process to the list of allowed clients for the compositor widget.
65
66 Once called, this client will be capable of connecting to the internal compositor
67 even if it was not executed by the widget.
68 ]]
45 params { 69 params {
46 pid: int; 70 pid: int; [[The pid to add.]]
47 } 71 }
48 } 72 }
49 allowed_pid_del { 73 allowed_pid_del {
74 [[Remove a process from the list of allowed clients for the compositor widget.
75
76 Once called, this client will be incapable of connecting to the internal compositor
77 even if it was executed by the widget.
78 ]]
50 params { 79 params {
51 pid: int; 80 pid: int; [[The pid to remove.]]
52 } 81 }
53 } 82 }
54 surface_next { 83 surface_next {
55 return: Efl.Canvas.Wl.Surface; 84 [[Activate and raise the bottom-most toplevel surface.]]
85 return: Efl.Canvas.Wl.Surface; [[The surface that was activated, or $NULL if no change was made.]]
56 } 86 }
57 surface_prev { 87 surface_prev {
58 return: Efl.Canvas.Wl.Surface; 88 [[Activate and raise the second top-most toplevel surface.]]
89 return: Efl.Canvas.Wl.Surface; [[The surface that was activated, or $NULL if no change was made.]]
59 } 90 }
60 @property active_surface { 91 @property active_surface {
92 [[This is the currently activated surface in the compositor widget.
93 Only one surface can be activated at a time.
94 ]]
61 get {} 95 get {}
62 set { 96 set {
63 return: bool; 97 return: bool; [[Returns $true if a change was successfully made.]]
64 } 98 }
65 values { 99 values {
66 surface: Efl.Canvas.Wl.Surface; 100 surface: Efl.Canvas.Wl.Surface; [[The activated surface.]]
67 } 101 }
68 } 102 }
69 @property aspect { 103 @property aspect_propagate {
104 [[When set to $true, the compositor will propagate the aspect ratio of the top-most
105 surface to the @Efl.Gfx.Hint.hint_aspect of the compositor widget.
106 ]]
70 values { 107 values {
71 set: bool; 108 set: bool; [[Whether to propagate the hint.]]
72 } 109 }
73 } 110 }
74 @property minmax { 111 @property minmax_propagate {
112 [[When set to $true, the compositor will propagate the min and max hints of the top-most
113 surface to the @Efl.Gfx.Hint.hint_size_min and @Efl.Gfx.Hint.hint_size_max of the compositor widget.
114 ]]
75 values { 115 values {
76 set: bool; 116 set: bool; [[Whether to propagate the hints.]]
77 } 117 }
78 } 118 }
79 @property rotation { 119 @property rotation {
120 [[Set the rotation and flip for the compositor's internal output, which is passed to clients.
121
122 Note that the rotation provided here is counter-clockwise.
123 ]]
80 values { 124 values {
81 rotation: Efl.Canvas.Wl.Rotation; 125 rotation: Efl.Canvas.Wl.Rotation; [[The rotation to apply to the internal output.]]
82 rtl: bool; 126 rtl: bool; [[The horizontal flip to apply to the internal output.]]
83 } 127 }
84 } 128 }
85 global_add { 129 global_add {
130 [[Add a new wl_global to the internal compositor.
131
132 Use this to add implementations of custom extensions for use in the compositor.
133 Globals are removed with wl_global_destroy in libwayland.
134
135 Read Wayland documentation for more info.
136 ]]
86 params { 137 params {
87 interface: const(Efl.Canvas.Wl_Wl_Interface) @by_ref; 138 interface: const(Efl.Canvas.Wl_Wl_Interface) @by_ref; [[The wl_interface of callbacks for the protocol.]]
88 version: uint; 139 version: uint; [[The version of the protocol.]]
89 data: Efl.Canvas.Wl_Wl_Interface_Data @by_ref; 140 data: Efl.Canvas.Wl_Wl_Interface_Data @by_ref; [[The data to be passed to the callback functions.]]
90 bind_cb: Efl.Canvas.Wl_Wl_Interface_Bind_Cb @by_ref; 141 bind_cb: Efl.Canvas.Wl_Wl_Interface_Bind_Cb @by_ref; [[The callback to trigger when a client has bound this global.]]
91 } 142 }
92 return: Efl.Canvas.Wl_Wl_Global @by_ref; 143 return: Efl.Canvas.Wl_Wl_Global @by_ref; [[The $wl_global or $NULL on failure.]]
93 } 144 }
94 seat_keymap_set { 145 seat_keymap_set {
146 [[Sets the keymap for the internal compositor's seat.
147
148 This is useful when nesting the compositor widget inside another compositor in order to reuse the existing keymap and state.
149 ]]
95 params { 150 params {
96 seat: Efl.Input.Device; 151 seat: Efl.Input.Device; [[The seat to set the keymap of, or $NULL for all seats.]]
97 state: Efl.Canvas.Wl_Xkb_State @by_ref; 152 state: Efl.Canvas.Wl_Xkb_State @by_ref; [[The $xkb_state to apply.]]
98 keymap_str: string; 153 keymap_str: string; [[The keymap type as a string, as reported by libxkbcommon.
99 key_array: Efl.Canvas.Wl_Wl_Array @by_ref; 154 The lifetime of the passed string must exceed the lifetime of the compositor widget.
155 ]]
156 key_array: Efl.Canvas.Wl_Wl_Array @by_ref; [[The current $wl_array of keys.]]
100 } 157 }
101 } 158 }
102 seat_key_repeat_set { 159 seat_key_repeat_set {
160 [[Modify the key repeat rate and delay of the internal compositor for a given seat.
161 This is the value sent to clients.
162 ]]
103 params { 163 params {
104 seat: Efl.Input.Device; 164 seat: Efl.Input.Device; [[The seat to set the repeat rate and delay of, or $NULL for all seats.]]
105 repeat_rate: int; 165 repeat_rate: int; [[The repeat rate to set in number of times per second keys should repeat.]]
106 repeat_delay: int; 166 repeat_delay: int; [[The delay before repeating should begin in milliseconds.]]
107 } 167 }
108 } 168 }
109 } 169 }
@@ -115,9 +175,9 @@ class @beta Efl.Canvas.Wl extends Efl.Canvas.Group
115 Efl.Gfx.Entity.scale { get; set; } 175 Efl.Gfx.Entity.scale { get; set; }
116 } 176 }
117 events { 177 events {
118 toplevel,added: Efl.Canvas.Wl.Surface; [[]] 178 toplevel,added: Efl.Canvas.Wl.Surface; [[Contains the toplevel surface which was added.]]
119 child,added: Efl.Canvas.Wl.Surface; [[]] 179 child,added: Efl.Canvas.Wl.Surface; [[Contains the toplevel child surface which was added.]]
120 popup,added: Efl.Canvas.Wl.Surface; [[]] 180 popup,added: Efl.Canvas.Wl.Surface; [[Contains the popup surface which was added.]]
121 seat,added: Efl.Input.Device; [[The seat object added.]] 181 seat,added: Efl.Input.Device; [[Contains the seat object that was added.]]
122 } 182 }
123} 183}