Chromium aura shell
- external
zaura_shell
暴露 aura shell 能力的全局接口,用于为 wl_surface 对象实例化接口扩展。该扩展接口随后允许客户端使用 aura shell 特定的功能。
get_aura_surface(id: new_id<zaura_surface>, surface: object<wl_surface>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<zaura_surface> | the new aura surface interface id |
| surface | object<wl_surface> | the surface |
为给定的 wl_surface 实例化接口扩展,以提供 aura shell 功能。如果给定的 wl_surface 未关联 shell surface,则会引发 shell_surface_missing 协议错误。
get_aura_output(id: new_id<zaura_output>, output: object<wl_output>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<zaura_output> | the new aura output interface id |
| output | object<wl_output> | the output |
为给定的 wl_output 实例化接口扩展,以提供 aura shell 功能。
surface_submission_in_pixel_coordinates()
[已弃用] 通知服务器在提交 surface 时,此客户端不会使用 wl_surface_set_buffer_scale 来报告缩放比例,也不会通过 vp_viewporter 应用缩放。相反,服务器应应用适当的缩放变换以使提交的 buffer 正确合成。
get_aura_toplevel_for_xdg_toplevel(id: new_id<zaura_toplevel>, toplevel: object<xdg_toplevel>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<zaura_toplevel> | the new aura toplevel interface id |
| toplevel | object<xdg_toplevel> |
为给定的 xdg toplevel 接口检索 aura toplevel 接口
get_aura_popup_for_xdg_popup(id: new_id<zaura_popup>, popup: object<xdg_popup>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<zaura_popup> | the aura popup interface id |
| popup | object<xdg_popup> |
为给定的 xdg popup 接口检索 aura popup 接口
release()
客户端使用此请求可以告诉服务器它将不再使用 zaura_shell 对象。这不会影响任何其他对象。
此处命名为 "release" 是因为 "destroy" 是用于释放 wl_proxy 对象的特殊命名函数。将其命名为 "destroy" 会在低版本主机上运行时导致编组错误。如果我们迁移到 aura-shell v2,此处所有的 "release" 请求应重命名为 "destroy"。
layout_mode(layout_mode: uint)
参数 | 类型 | 描述 |
|---|---|---|
| layout_mode | uint | layout_mode enum |
发送服务器使用的 layout_mode。
bug_fix(id: uint)
参数 | 类型 | 描述 |
|---|---|---|
| id | uint | ID of a single bug fix |
发送在 exo 服务器上修复的 bug 的 monorail ID,客户端可用于控制功能。
desks_changed(desk_names: array)
参数 | 类型 | 描述 |
|---|---|---|
| desk_names | array | an array of existing desks' names |
当全局桌面状态发生变化时发出通知。此事件在桌面名称更改、桌面添加/删除或桌面重新排序时发出。"desk_names" 参数包含以 null 结尾的字符串集合作为桌面名称。
desk_activation_changed(active_desk_index: int)
参数 | 类型 | 描述 |
|---|---|---|
| active_desk_index | int | index of the active desk |
当活动桌面发生变化时发出通知。
activated(gained_active: object<wl_surface>, lost_active: object<wl_surface>)
参数 | 类型 | 描述 |
|---|---|---|
| gained_active | object<wl_surface>允许为空 | |
| lost_active | object<wl_surface>允许为空 |
通知客户端活动 surface 已更改。
compositor_version(version_label: string)
参数 | 类型 | 描述 |
|---|---|---|
| version_label | string | version string label |
发送 Exo compositor 版本信息。
all_bug_fixes_sent()
通知客户端已在 exo 服务器上修复的所有 bug ID 已发送完毕。Bug 修复 ID 通过 `bug_fix` 事件逐个发送,而非数组。此事件用于确认所有 ID 已发送完毕。
window_corners_radii(upper_left_radius: uint, upper_right_radius: uint, lower_right_radius: uint, lower_left_radius: uint)
参数 | 类型 | 描述 |
|---|---|---|
| upper_left_radius | uint | |
| upper_right_radius | uint | |
| lower_right_radius | uint | |
| lower_left_radius | uint |
以 dips 为单位向客户端发送窗口每个圆角的半径。
error { aura_surface_exists, aura_output_exists }
参数 | 值 | 描述 |
|---|---|---|
| aura_surface_exists | 0 | 该 surface 已关联 aura surface 对象 |
| aura_output_exists | 1 | 该 output 已关联 aura output 对象 |
指定服务器的窗口布局模式。
zaura_surface
对 wl_surface 对象的附加接口,允许客户端访问 aura shell 的 surface 特定功能。
set_frame(type: uint)
参数 | 类型 | 描述 |
|---|---|---|
| type | uint | the new frame type |
[已弃用] 建议 surface 使用特定帧。自 M105 起弃用。请参阅 zaura_toplevel 和 zaura_popup 上的 set_decoration 方法。
set_parent(parent: object<zaura_surface>, x: int, y: int)
参数 | 类型 | 描述 |
|---|---|---|
| parent | object<zaura_surface>允许为空 | |
| x | int | |
| y | int |
设置此 surface 的 "父级"。"x" 和 "y" 参数指定 surface 相对于父级的初始位置。
set_frame_colors(active_color: uint, inactive_color: uint)
参数 | 类型 | 描述 |
|---|---|---|
| active_color | uint | 32 bit ARGB color value, not premultiplied |
| inactive_color | uint | 32 bit ARGB color value, not premultiplied |
设置帧颜色。必须在初始 commit 之前设置,否则后续请求可能不会被执行。
set_application_id(application_id: string)
参数 | 类型 | 描述 |
|---|---|---|
| application_id | string允许为空 |
设置应用程序 ID。
set_client_surface_id(client_surface_id: int)
参数 | 类型 | 描述 |
|---|---|---|
| client_surface_id | int |
已弃用。请使用 set_client_surface_str_id 代替。 设置由客户端分配的 surface 标识符。
set_occlusion_tracking()
在此 surface 上设置遮挡跟踪。当此 surface 的遮挡量发生变化时,客户端将收到新的遮挡比例更新。
activate()
[已弃用] 使此窗口成为活动窗口。这通常意味着将此 surface 重新堆叠到前台。如果 compositor 认为客户端行为不当,可以忽略此请求。通常此请求仅在响应某些用户驱动事件时才会被执行,例如执行应用程序或在已存在的窗口中打开文件。
draw_attention()
在不改变用户焦点的情况下吸引对此 surface 的注意。这通常意味着动画化窗口装饰或任务栏图标。如果 compositor 认为合适,仍可忽略此请求,但与 draw_focus 不同的是,这些请求预计来自后台任务,更可能被执行。
set_fullscreen_mode(mode: uint<zaura_surface.fullscreen_mode>)
参数 | 类型 | 描述 |
|---|---|---|
| mode | uint<zaura_surface.fullscreen_mode> |
[已弃用] 使用 toplevel 接口中的 set_fullscreen_mode。 建议窗口系统在此 surface 进入全屏时的行为方式。不会使 surface 进入全屏。
通常默认模式为 "沉浸式"。
set_client_surface_str_id(client_surface_id: string)
参数 | 类型 | 描述 |
|---|---|---|
| client_surface_id | string |
设置由客户端分配的 surface 标识符。
set_server_start_resize()
建议 surface 使用客户端装饰,但由服务器决定何时何地开始调整大小。服务器还可以应用视觉效果来指示调整大小操作正在进行中。
intent_to_snap(direction: uint<zaura_surface.snap_direction>)
参数 | 类型 | 描述 |
|---|---|---|
| direction | uint<zaura_surface.snap_direction> |
[已弃用] 使用 zaura_toplevel 上的 intent_to_snap。 通知(或告知)服务器客户端有吸附窗口的意图。要告知不再愿意吸附,请发送 'none'。
set_snap_left()
[已弃用] 使用 zaura_toplevel 上的 set_snap_primary。 请求将 surface 吸附到左侧。
set_snap_right()
[已弃用] 使用 zaura_toplevel 上的 set_snap_secondary。 请求将 surface 吸附到右侧。
unset_snap()
[已弃用] 使用 zaura_toplevel 上的 unset_snap。 请求重置 surface 的吸附状态。
set_can_go_back()
设置 surface 可以根据其导航列表返回。这允许服务器通过在系统范围的返回手势时最小化窗口来做出反应。
unset_can_go_back()
取消设置 surface 可以根据其导航列表返回。参见上文。
设置 surface 的宽高比。
move_to_desk(index: int)
参数 | 类型 | 描述 |
|---|---|---|
| index | int |
如果 |index| 等于 -1,请求服务器切换客户端是否在所有工作区可见。 如果 |index| 不是 -1,请求服务器将客户端移动到 |index| 处的桌面。
set_initial_workspace(initial_workspace: string)
参数 | 类型 | 描述 |
|---|---|---|
| initial_workspace | string | intial workspace for restoring or '-1' for visible on all workspaces |
如果 |initial_workspace| 等于 '-1',窗口将被恢复并在所有工作区可见;否则,设置初始工作区以将窗口恢复到相应的工作区。这不是双缓冲的,必须在附加 buffer 之前设置。
set_pin(trusted: int)
参数 | 类型 | 描述 |
|---|---|---|
| trusted | int | 0 for non trusted |
请求固定窗口,这意味着系统不允许用户离开该窗口,直到满足退出条件。
这是一个请求将窗口固定,使用户无法访问任何其他窗口/应用程序。有两种模式: A. trusted 为 0 - 限制较少,允许用户通过预定义的身份验证方式退出窗口。 B. trusted 不为 0,此时受信任的应用程序正在锁定系统并需要解锁。这用于例如学校考试。
unset_pin()
请求允许用户离开先前固定的窗口。
这是一个请求取消固定先前固定的窗口。无论窗口是以受信任状态锁定还是不受信任状态锁定,都无关紧要。
release()
销毁 zaura_surface 对象。当角色从 wl_surface 取消映射时,客户端应销毁此对象。
有关析构函数命名,请参阅 zaura_shell.release。
show_tooltip(text: string, x: int, y: int, tooltip_trigger: uint, show_delay: uint, hide_delay: uint)
参数 | 类型 | 描述 |
|---|---|---|
| text | string | |
| x | int | |
| y | int | |
| tooltip_trigger | uint | tooltip_trigger enum |
| show_delay | uint | delay to show tooltip in millisecond |
| hide_delay | uint | delay to hide tooltip in millisecond |
在服务器端显示工具提示。 `x` 和 `y` 指定工具提示在 surface 局部坐标中的位置。 `hide_delay` 和 `show_delay` 指定显示/隐藏工具提示前的等待时间,单位为毫秒。
hide_tooltip()
隐藏由同一客户端在服务器端创建的工具提示。即使没有工具提示窗口可隐藏,也可以调用此方法。
set_accessibility_id(id: int)
参数 | 类型 | 描述 |
|---|---|---|
| id | int | Accessibility ID. Negative number removes existing accessibility ID from the surface. |
为 surface 设置无障碍窗口 ID。负数将从 surface 中移除现有的无障碍 ID。
occlusion_changed(occlusion_fraction: fixed, occlusion_reason: uint)
参数 | 类型 | 描述 |
|---|---|---|
| occlusion_fraction | fixed | |
| occlusion_reason | uint |
当此 surface 的遮挡量发生变化时发出通知。遮挡更新以 0 到 1 的定点数发送,表示遮挡比例。
lock_frame_normal()
通知客户端将窗口锁定在正常或还原状态。当窗口被锁定时,窗口框架应看起来处于还原状态,但实际上并非如此。锁定发生在拖动最大化窗口时。
unlock_frame_normal()
通知客户端解锁窗口(如果先前已锁定)。解锁发生在拖动最大化窗口时。
occlusion_state_changed(mode: uint<zaura_surface.occlusion_state>)
参数 | 类型 | 描述 |
|---|---|---|
| mode | uint<zaura_surface.occlusion_state> |
通知客户端窗口的遮挡状态已更改。客户端只有在先前通过 set_occlusion_tracking 为特定 surface 请求遮挡跟踪时才会收到这些消息。
desk_changed(state: int)
参数 | 类型 | 描述 |
|---|---|---|
| state | int | index of desk or -1 for a window assigned to all desks |
当窗口的桌面状态发生变化时发出通知。当窗口被移动到另一个桌面或其分配到所有桌面的状态发生变化时,会发出此事件。
通知客户端工具提示已显示并带有状态。 `x` 和 `y` 指定工具提示在 surface 局部坐标中的位置。
tooltip_hidden()
通知客户端工具提示已隐藏。
可用于装饰 surface 的帧类型。
occlusion_change_reason { user_action }
参数 | 值 | 描述 |
|---|---|---|
| user_action | 1 | 由用户操作引起的遮挡变化 |
描述遮挡变化原因的枚举。由用户操作引起的遮挡变化可能包括用户移动窗口、改变遮挡、或打开/关闭窗口改变遮挡等情况。
[已弃用] 此 surface 进入全屏时可能的窗口系统行为。
Surface 吸附方向。
描述 surface 的遮挡状态。
描述触发工具提示的方式。
zaura_output
对 wl_output 对象的附加接口,允许客户端访问 aura shell 的 output 特定功能。
release()
销毁此 zaura_shell 对象。
当由此 zaura_shell 对象实例创建的 zaura_surface 仍然存在时,销毁已绑定的 zaura_shell 对象是非法的,并将导致协议错误。
有关析构函数命名,请参阅 zaura_shell.release。
scale(flags: uint<zaura_output.scale_property>, scale: uint<zaura_output.scale_factor>)
参数 | 类型 | 描述 |
|---|---|---|
| flags | uint<zaura_output.scale_property> | bitfield of scale flags |
| scale | uint<zaura_output.scale_factor> | output scale |
scale 事件描述输出的可用缩放比例。
绑定到 output 对象时发送该事件,始终会有一个缩放比例,即当前缩放比例。如果输出更改缩放比例,将再次发送该事件,表示当前的缩放比例。换句话说,当前缩放比例始终是最后收到的带有 current 标志的缩放比例。
connection(connection: uint<zaura_output.connection_type>)
参数 | 类型 | 描述 |
|---|---|---|
| connection | uint<zaura_output.connection_type> | output connection |
connection 事件描述输出的连接方式。
绑定到 output 对象时发送该事件。
device_scale_factor(scale: uint<zaura_output.scale_factor>)
参数 | 类型 | 描述 |
|---|---|---|
| scale | uint<zaura_output.scale_factor> | output device scale factor |
此事件描述输出的设备特定缩放因子。
设备特定缩放因子在输出的生命周期内不会改变。它不像 wl_output 接口提供的缩放因子那样仅限于整数值。通过将此设备缩放因子与当前输出缩放相结合,可以确定 compositor 使用的精确内容缩放。
绑定到 output 对象时发送该事件。
此事件以逻辑屏幕坐标描述输出的内边距,据此可以计算工作区域。
此事件在 wl_output.done 之前发送,客户端将在之后应用更改。
logical_transform(transform: int<wl_output.transform>)
参数 | 类型 | 描述 |
|---|---|---|
| transform | int<wl_output.transform> |
此事件描述输出的逻辑变换。wl_output.geometry 的变换对应于显示器面板的旋转,而逻辑变换对应于显示器的逻辑旋转。
此事件在 wl_output.done 之前发送,客户端将在之后应用更改。
display_id(display_id_hi: uint, display_id_lo: uint)
参数 | 类型 | 描述 |
|---|---|---|
| display_id_hi | uint | |
| display_id_lo | uint |
此事件描述 ChromeOS 分配给每个显示器的 64 位显示 ID。该值是不透明的,不应进行解释。
这些标志描述输出缩放的属性。用于 scale 事件的标志位域中。
zaura_toplevel
对 toplevel shell 的接口,允许客户端访问 shell 特定功能。
set_orientation_lock(orientation_lock: uint<zaura_toplevel.orientation_lock>)
参数 | 类型 | 描述 |
|---|---|---|
| orientation_lock | uint<zaura_toplevel.orientation_lock> |
当此 surface 处于全屏状态时请求特定的方向行为。
surface_submission_in_pixel_coordinates()
通知服务器在提交此 surface 时,此客户端不会使用 wl_surface_set_buffer_scale 来报告缩放比例,也不会通过 vp_viewporter 应用缩放。相反,服务器应应用适当的缩放变换以使提交的 buffer 正确合成。
set_supports_screen_coordinates()
请求此操作将启用与 aura_toplevel 关联的 surface 中的屏幕坐标,包括子 surface 和将此 toplevel 作为父级添加的弹出窗口。应在首次 commit 之前设置。
以 DP 屏幕坐标请求 surface 的新位置和边界。大小将应用于 set_geometry 中使用的可见边界。输出是 compositor 用于确定窗口应移动到哪个输出的提示。如果输出为 null,compositor 应仅根据给定边界做出决定。这些参数只是一个请求,compositor 可能会忽略、根据窗口管理器施加的规则调整大小和位置,或为将来的操作保留它。例如,compositor 不允许位置超出输出范围,或者如果 toplevel surface 处于最大化状态,compositor 可能只存储它,并在取消最大化时使用它。
set_restore_info(restore_session_id: int, restore_window_id: int)
参数 | 类型 | 描述 |
|---|---|---|
| restore_session_id | int | unique browser session id |
| restore_window_id | int | restore browser window id |
请求新创建的浏览器窗口的会话 ID 和恢复 ID。设置 compositor 用于在创建时恢复 toplevel surface 状态(如窗口位置、窗口状态)的信息。这不是双缓冲的,必须在发送首次 commit 之前设置。
set_system_modal()
请求 toplevel surface 成为系统模态。compositor 将阻止其他窗口接收事件。如果有多个系统模态 surface,compositor 将决定哪个接收事件。
unset_system_modal()
请求取消 toplevel surface 的系统模态状态。compositor 将允许其他窗口接收事件。
set_restore_info_with_window_id_source(restore_session_id: int, restore_window_id_source: string)
参数 | 类型 | 描述 |
|---|---|---|
| restore_session_id | int | unique browser session id |
| restore_window_id_source | string | restore window id source |
请求窗口的会话 ID 和恢复 ID。设置 compositor 用于在创建时恢复 toplevel surface 状态(如窗口位置、窗口状态)的信息。这不是双缓冲的,必须在发送首次 commit 之前设置。这与 set_restore_info 不同,用于创建多个与 restore_id_source 关联的窗口的客户端。
set_decoration(type: uint)
参数 | 类型 | 描述 |
|---|---|---|
| type | uint | the new frame type |
允许客户端为 zaura_toplevel 请求特定装饰。服务器不必遵守此请求。有关可用选项,请参阅 decoration_type。必须在首次 commit 之前设置,否则后续请求可能不会被执行。自 M105 起可用。
release()
销毁此 zaura_toplevel 对象。当角色从 wl_surface 取消映射时,客户端应调用销毁。
有关析构函数命名,请参阅 zaura_shell.release。
set_float()
[已弃用] 使用 set_float_to_location。 这是一个将 surface 置于其他 surface 之上的请求。
set_z_order(z_order: uint)
参数 | 类型 | 描述 |
|---|---|---|
| z_order | uint | z order value for the window |
设置 toplevel surface 的 z 序。有关可用选项,请参阅 z_order_level。
以设备无关像素(DP)请求 surface 的新位置,相对于给定输出的左上角。
空输出表示当前包含 surface 的任何输出。
这些参数只是一个请求,compositor 可能会忽略它们,由于窗口管理器施加的规则而调整它们,或为将来的操作保留它们。例如,compositor 不允许位置超出输出范围;或者如果 toplevel surface 处于最大化状态,compositor 可能只存储它,并在取消最大化时使用它。
deactivate()
停用此窗口。这相当于请求该窗口不成为前台窗口。确切行为由 compositor 定义。如果 compositor 认为客户端行为不当,可以忽略此请求。
set_fullscreen_mode(mode: uint<zaura_toplevel.fullscreen_mode>)
参数 | 类型 | 描述 |
|---|---|---|
| mode | uint<zaura_toplevel.fullscreen_mode> |
建议窗口管理器在此 surface 进入全屏时的行为方式。不会使 surface 进入全屏。
确切地说,如果 surface 尚未处于全屏状态,切换模式从客户端角度来看不会立即产生影响,但会改变下次请求使 surface 进入全屏时的行为。 如果 surface 已经处于全屏状态,则此请求会立即生效,在普通和沉浸式全屏模式之间切换。
set_scale_factor(scale_factor_as_uint: uint)
参数 | 类型 | 描述 |
|---|---|---|
| scale_factor_as_uint | uint |
客户端有一个与每个 zaura toplevel 关联的 32 位浮点缩放因子。此缩放因子必须精确传播到 exo。为此,我们 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。为避免冗余消息,此请求仅需在 zaura toplevel 缩放因子更改时调用一次。这是双缓冲状态,将在下一次 commit 中应用。
set_snap_primary(snap_ratio_as_uint: uint)
参数 | 类型 | 描述 |
|---|---|---|
| snap_ratio_as_uint | uint |
请求将 surface 吸附到左侧或顶部(如果是主布局),否则吸附到右侧或底部。
set_snap_secondary(snap_ratio_as_uint: uint)
参数 | 类型 | 描述 |
|---|---|---|
| snap_ratio_as_uint | uint |
请求将 surface 吸附到右侧或底部(如果是主布局),否则吸附到左侧或顶部。
intent_to_snap(direction: uint<zaura_toplevel.snap_direction>)
参数 | 类型 | 描述 |
|---|---|---|
| direction | uint<zaura_toplevel.snap_direction> |
通知(或告知)服务器客户端有吸附窗口的意图。要告知不再愿意吸附,请发送 'none'。
set_persistable(persistable: uint<zaura_toplevel.persistable>)
参数 | 类型 | 描述 |
|---|---|---|
| persistable | uint<zaura_toplevel.persistable> | is the argument persistable |
请求窗口的可持久化状态。在窗口属性中设置窗口的可持久化状态。应在首次 commit 之前调用。
以 DP 为单位设置 toplevel 窗口的形状。传入 NULL 将重置窗口的形状。
此方法仅应用于支持现有的(已弃用的)Chrome Apps SetShape API,不应用于任何其他目的。
set_top_inset(height: int)
参数 | 类型 | 描述 |
|---|---|---|
| height | int | Top inset of client window. Should be non negative. |
为 surface 设置顶部内边距。这表示标题栏高度,应为非负值。
ack_rotate_focus(serial: uint, handled: uint<zaura_toplevel.rotate_handled_state>)
参数 | 类型 | 描述 |
|---|---|---|
| serial | uint | serial for the original; rotation event |
| handled | uint<zaura_toplevel.rotate_handled_state> | whether or not the rotation was successful |
如果焦点已成功在 surface 内部的 UI 元素之间旋转,客户端回复 'handled'。如果焦点未旋转,客户端回复 'not_handled'。服务器可使用此信息将焦点移动到下一个可聚焦的 surface。
请注意,客户端处理中的延迟可能导致服务器收到过时的确认。
set_can_maximize()
向窗口管理器提示 toplevel surface 可以最大化。
unset_can_maximize()
向窗口管理器提示 toplevel surface 不应被最大化。请注意,窗口管理器仍可能请求客户端最大化。在这种情况下,客户端应尊重窗口管理器的请求并最大化。之后可以取消最大化状态。
set_can_fullscreen()
向窗口管理器提示 toplevel surface 可以进入全屏。
unset_can_fullscreen()
向窗口管理器提示 toplevel surface 不应进入全屏。请注意,窗口管理器仍可能请求客户端进入全屏。在这种情况下,客户端应尊重窗口管理器的请求并进入全屏。之后可以退出全屏。
set_float_to_location(mode: uint<zaura_toplevel.float_start_location>)
参数 | 类型 | 描述 |
|---|---|---|
| mode | uint<zaura_toplevel.float_start_location> |
这是一个将 surface 置于其他 surface 之上的请求。
set_window_corner_radii(upper_left_radius: uint, upper_right_radius: uint, lower_right_radius: uint, lower_left_radius: uint)
参数 | 类型 | 描述 |
|---|---|---|
| upper_left_radius | uint | |
| upper_right_radius | uint | |
| lower_right_radius | uint | |
| lower_left_radius | uint |
客户端以 DP(设备无关像素)为单位指定要应用于窗口的每个圆角的半径。
窗口圆角半径是双缓冲的,将在调用相应 wl_surface 的 wl_surface.commit 时应用。
注意:圆角半径会影响 wl_surface 树,包括子 surface。一旦调用此协议,surface 将无法设置自己的圆角边界,因为圆角窗口边界将应用于整个 surface 树。
set_shadow_corner_radii(upper_left_radius: uint, upper_right_radius: uint, lower_right_radius: uint, lower_left_radius: uint)
参数 | 类型 | 描述 |
|---|---|---|
| upper_left_radius | uint | |
| upper_right_radius | uint | |
| lower_right_radius | uint | |
| lower_left_radius | uint |
客户端以设备无关像素(DP)为单位指定要应用于与 aura toplevel surface 关联的阴影的每个圆角半径。
阴影圆角半径是双缓冲的,将在调用相应 wl_surface 的 wl_surface.commit 时应用。
配置更改,还包括以屏幕坐标表示的窗口原点。
当窗口原点发生变化时发送的通知。与 configure 不同,这不意味着客户端需要调整大小。值以屏幕坐标表示。
configure_raster_scale(scale: uint)
参数 | 类型 | 描述 |
|---|---|---|
| scale | uint | Raster scale, in float format |
设置此窗口的光栅缩放比例。应在 configure 事件序列期间调用。为此,我们 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。
rotate_focus(serial: uint, direction: uint<zaura_toplevel.rotate_direction>, restart: uint<zaura_toplevel.rotate_restart_state>)
参数 | 类型 | 描述 |
|---|---|---|
| serial | uint | serial for the rotation event |
| direction | uint<zaura_toplevel.rotate_direction> | the direction for linear traversal |
| restart | uint<zaura_toplevel.rotate_restart_state> | whether or not to restart traversal |
在 toplevel 窗口内旋转焦点。窗口必须将其可聚焦视图排序为稳定且线性可遍历的顺序。在旋转焦点之前,surface 应已被激活并拥有键盘焦点。如果 surface 未被激活或没有键盘焦点,服务器应首先激活并为窗口输入键盘焦点。事件顺序示例可能是:
1. 激活 surface 2. 输入键盘焦点 3. 旋转焦点
如果窗口未被激活或没有键盘焦点,客户端应回复 "not handled" 且不执行任何操作。
要开始新的旋转序列,服务器将 "restart" 参数设置为 true。如果 "restart" 参数为 true,窗口应将焦点设置在给定方向的第一个 UI 元素上,不执行任何旋转。
客户端应通过 "ack_rotate_focus" 请求中的 "handled" 字段回复旋转是否成功。客户端应在确认消息中传递事件序列号和方向。
overview_change(in_overview: uint<zaura_toplevel.in_overview>)
参数 | 类型 | 描述 |
|---|---|---|
| in_overview | uint<zaura_toplevel.in_overview> | in overview or not |
窗口正在概览模式中显示。请注意,这与 shell 概览状态不同,因为并非所有窗口都是概览网格的一部分。
configure_occlusion_state(mode: uint<zaura_toplevel.occlusion_state>)
参数 | 类型 | 描述 |
|---|---|---|
| mode | uint<zaura_toplevel.occlusion_state> |
设置此窗口的遮挡状态。应在 configure 事件序列期间调用。当遮挡状态需要作为同步操作设置时使用此事件,与非同步的 occlusion_state_changed 不同。例如,可用于将窗口标记为隐藏以便释放资源。当再次使其可见时,可能需要一些时间来重新创建 buffer,这就是为什么此操作需要同步。
orientation_lock { none, portrait, landscape, current, portrait_primary, landscape_primary, portrait_secondary, landscape_secondary }
参数 | 值 | 描述 |
|---|---|---|
| none | 1 | 无方向锁定 |
| portrait | 2 | 主或次纵向 |
| landscape | 3 | 主或次横向 |
| current | 4 | 保持当前方向 |
| portrait_primary | 5 | 主纵向 |
| landscape_primary | 6 | 主横向 |
| portrait_secondary | 7 | 次纵向 |
| landscape_secondary | 8 | 次横向 |
定义 surface 处于全屏状态时的方向请求。
state { immersive, minimized, snapped_primary, snapped_secondary, floated, pip, pinned, trusted_pinned }
参数 | 值 | 描述 |
|---|---|---|
| immersive起始版本 36 | 100 | 隐藏标题栏和任务栏的沉浸模式 用户可以通过指向或滑过屏幕边缘来访问系统 UI(如任务栏和窗口框架)。 |
| minimized起始版本 36 | 101 | surface 已最小化 窗口已被最小化。 |
| snapped_primary起始版本 38 | 102 | 窗口吸附在主位置 如果显示器处于横向模式,窗口吸附到左侧;如果处于纵向模式,窗口吸附到顶部。 |
| snapped_secondary起始版本 38 | 103 | 窗口吸附在次位置 如果显示器处于横向模式,窗口吸附到右侧;如果处于纵向模式,窗口吸附到底部。 |
| floated起始版本 38 | 104 | 窗口浮动在顶部 窗口浮动在其他窗口之上。每个桌面允许一个浮动窗口。当同一桌面上已有浮动窗口时浮动新窗口,将取消原有浮动窗口的浮动状态。 |
| pip起始版本 54 | 105 | 窗口处于画中画 窗口处于画中画模式。 |
| pinned起始版本 64 | 106 | 窗口已被固定 窗口已被固定。 |
| trusted_pinned起始版本 64 | 107 | 窗口已被受信任固定 窗口已被受信任固定。 |
此处包含的状态是对 XDG shell 和特定 aura 窗口中定义的状态的补充。
装饰类型用于修改 surface(例如投影阴影)。
z_order_level { normal, floating_window, floating_ui_element, security_surface }
参数 | 值 | 描述 |
|---|---|---|
| normal | 0 | 窗口的默认级别 |
| floating_window | 1 | 浮动窗口 z 序高于其他普通窗口 |
| floating_ui_element | 2 | 用于显示在浮动窗口之上的非窗口样式 UI |
| security_surface | 3 | 不能被干扰或覆盖 |
用于设置 toplevel surface 的不同 z 序级别。
此 surface 进入全屏时可能的窗口系统行为。
窗口吸附方向。
persistable { not_persistable, persistable }
参数 | 值 | 描述 |
|---|---|---|
| not_persistable | 0 | 值不可持久化 |
| persistable | 1 | 值可持久化 |
二进制枚举映射为布尔值,描述值是否可持久化。
rotate_restart_state { no_restart, restart }
参数 | 值 | 描述 |
|---|---|---|
| no_restart | 0 | |
| restart | 1 |
rotate_handled_state { not_handled, handled }
参数 | 值 | 描述 |
|---|---|---|
| not_handled | 0 | |
| handled | 1 |
float_start_location { bottom_right, bottom_left }
参数 | 值 | 描述 |
|---|---|---|
| bottom_right | 0 | 浮动时,surface 移动到工作区域的右下角。这是默认值。 |
| bottom_left | 1 | 浮动时,surface 移动到工作区域的左下角。 |
surface 被浮动时可能的起始位置。
in_overview { not_in_overview, in_overview }
参数 | 值 | 描述 |
|---|---|---|
| not_in_overview | 0 | 值不在概览中 |
| in_overview | 1 | 值在概览中 |
二进制枚举映射为布尔值,描述值是否在概览中。
zaura_popup
对 popup shell 的接口,允许客户端访问 shell 特定功能。
surface_submission_in_pixel_coordinates()
通知服务器在提交此 surface 时,此客户端不会使用 wl_surface_set_buffer_scale 来报告缩放比例,也不会通过 vp_viewporter 应用缩放。相反,服务器应应用适当的缩放变换以使提交的 buffer 正确合成。
set_decoration(type: uint)
参数 | 类型 | 描述 |
|---|---|---|
| type | uint | the new frame type |
允许客户端为 zaura_toplevel 请求特定装饰。服务器不必遵守此请求。有关可用选项,请参阅 decoration_type。自 M105 起可用。
release()
此请求销毁 zaura_popup。当角色从 wl_surface 取消映射时,客户端应调用销毁。
有关析构函数命名,请参阅 zaura_shell.release。
set_scale_factor(scale_factor_as_uint: uint)
参数 | 类型 | 描述 |
|---|---|---|
| scale_factor_as_uint | uint |
客户端有一个与每个 zaura popup 关联的 32 位浮点缩放因子。此缩放因子必须精确传播到 exo。为此,我们 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。为避免冗余消息,此请求仅需在 zaura popup 的缩放因子更改时调用一次。
[已弃用] 自 M122 起弃用。请参阅 zaura_output_manager_v2 接口。
负责确保客户端在绑定 wl_output 后立即以及随后需要时拥有给定输出的完整状态视图的全局接口。
客户端可以预期给定 wl_output 的所有管理器事件在关联的 wl_output.done 事件之前到达。客户端必须在任何输出全局接口之前绑定到管理器全局接口。
此事件在给定 wl_output 的所有 zaura_output_manager 相关属性发送完毕后发送。
display_id(output: object<wl_output>, display_id_hi: uint, display_id_lo: uint)
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| display_id_hi | uint | |
| display_id_lo | uint |
此事件描述 ChromeOS 分配给每个显示器的 64 位显示 ID。该值是不透明的,不应进行解释。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| x | int | x position within the global compositor space |
| y | int | y position within the global compositor space |
position 事件描述 wl_output 在全局 compositor 空间中的位置。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| width | int | width in global compositor space |
| height | int | height in global compositor space |
logical_size 事件描述输出在全局 compositor 空间中的逻辑大小。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| width | int | width in global compositor space |
| height | int | height in global compositor space |
显示器的物理分辨率(以像素为单位)。该值不应包含任何过扫描内边距或显示旋转(面板方向调整除外)。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
此事件以逻辑屏幕坐标描述输出的内边距,据此可以计算工作区域。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
device_scale_factor(output: object<wl_output>, device_scale_factor: uint)
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| device_scale_factor | uint | display scale factor, in float format |
输出设备的缩放因子。我们将浮点缩放因子 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
logical_transform(output: object<wl_output>, transform: int<wl_output.transform>)
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| transform | int<wl_output.transform> | transform that maps framebuffer to output |
此事件描述输出的逻辑变换。面板变换对应于显示器面板的旋转,而逻辑变换对应于显示器的逻辑旋转。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
panel_transform(output: object<wl_output>, transform: int<wl_output.transform>)
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| transform | int<wl_output.transform> | transform that maps framebuffer to output |
此事件描述输出的面板变换,即关联显示器的面板旋转。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
name 是一个 UTF-8 字符串,其内容没有定义的约定。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
description(output: object<wl_output>, description: string)
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| description | string | output description |
description 是一个 UTF-8 字符串,其内容没有定义的约定。
绑定到 output 对象时发送该事件,随后在输出状态更改时发送。
通知此输出现在是活动输出。通常在没有特定边界的情况下创建新窗口时用作目标显示器。
合成器支持
Copyright
Copyright 2017 The Chromium Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.