From af96a44ef7af66f9b8e969a211bfee1e42fa03a3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 13 Mar 2020 12:16:51 -0400 Subject: [PATCH] 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 --- src/bin/efl_canvas_wl/efl_canvas_wl_test.c | 4 +- src/lib/efl_canvas_wl/efl_canvas_wl.c | 8 +- src/lib/efl_canvas_wl/efl_canvas_wl.eo | 126 +++++++++++++++------ 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[]) elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); o = efl_add(EFL_CANVAS_WL_CLASS, win); - efl_canvas_wl_aspect_set(o, 1); - efl_canvas_wl_minmax_set(o, 1); + efl_canvas_wl_aspect_propagate_set(o, 1); + efl_canvas_wl_minmax_propagate_set(o, 1); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 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 } EOLIAN static Eina_Bool -_efl_canvas_wl_aspect_get(const Eo *obj EINA_UNUSED, Comp *c) +_efl_canvas_wl_aspect_propagate_get(const Eo *obj EINA_UNUSED, Comp *c) { return c->aspect; } EOLIAN static void -_efl_canvas_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) +_efl_canvas_wl_aspect_propagate_set(Eo *obj, Comp *c, Eina_Bool set) { if (c->aspect == (!!set)) return; c->aspect = !!set; @@ -5707,13 +5707,13 @@ _efl_canvas_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) } EOLIAN static Eina_Bool -_efl_canvas_wl_minmax_get(const Eo *obj EINA_UNUSED, Comp *c) +_efl_canvas_wl_minmax_propagate_get(const Eo *obj EINA_UNUSED, Comp *c) { return c->minmax; } EOLIAN static void -_efl_canvas_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) +_efl_canvas_wl_minmax_propagate_set(Eo *obj, Comp *c, Eina_Bool set) { if (c->minmax == (!!set)) return; 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 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 { - [[This runs a command in the compositor using the @Efl.Exe_Flags.term_with_parent flag. + [[ + 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; + cmd: string; [[The command to execute.]] } - return: Efl.Exe; + 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; + 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; + 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; + pid: int; [[The pid to remove.]] } } surface_next { - return: Efl.Canvas.Wl.Surface; + [[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 { - return: Efl.Canvas.Wl.Surface; + [[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; + return: bool; [[Returns $true if a change was successfully made.]] } values { - surface: Efl.Canvas.Wl.Surface; + surface: Efl.Canvas.Wl.Surface; [[The activated surface.]] } } - @property aspect { + @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; + set: bool; [[Whether to propagate the hint.]] } } - @property minmax { + @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; + 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; - rtl: bool; + 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; - version: uint; - data: Efl.Canvas.Wl_Wl_Interface_Data @by_ref; - bind_cb: Efl.Canvas.Wl_Wl_Interface_Bind_Cb @by_ref; + 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; + 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; - state: Efl.Canvas.Wl_Xkb_State @by_ref; - keymap_str: string; - key_array: Efl.Canvas.Wl_Wl_Array @by_ref; + 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; - repeat_rate: int; - repeat_delay: int; + 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.]] } } } @@ -115,9 +175,9 @@ class @beta Efl.Canvas.Wl extends Efl.Canvas.Group Efl.Gfx.Entity.scale { get; set; } } events { - toplevel,added: Efl.Canvas.Wl.Surface; [[]] - child,added: Efl.Canvas.Wl.Surface; [[]] - popup,added: Efl.Canvas.Wl.Surface; [[]] - seat,added: Efl.Input.Device; [[The seat object added.]] + 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.]] } }