wlmaker
|
#include "lock_mgr.h"
#include <libbase/libbase.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wayland-server-protocol.h>
#include <wayland-util.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_session_lock_v1.h>
#include <wlr/util/box.h>
#include "toolkit/toolkit.h"
Classes | |
struct | _wlmaker_lock_mgr_t |
struct | _wlmaker_lock_t |
struct | _wlmaker_lock_surface_t |
struct | wlmaker_lock_update_output_arg_t |
Typedefs | |
typedef uint32_t(* | _wlmaker_lock_surface_configure_t) (struct wlr_session_lock_surface_v1 *lock_surface, uint32_t width, uint32_t height) |
typedef void(* | _wlmaker_lock_send_locked_t) (struct wlr_session_lock_v1 *lock) |
typedef struct _wlmaker_lock_t | wlmaker_lock_t |
typedef struct _wlmaker_lock_surface_t | wlmaker_lock_surface_t |
Functions | |
static void | _wlmaker_lock_mgr_handle_new_lock (struct wl_listener *listener_ptr, void *data_ptr) |
static void | _wlmaker_lock_mgr_handle_destroy (struct wl_listener *listener_ptr, void *data_ptr) |
static wlmaker_lock_t * | _wlmaker_lock_create (struct wlr_session_lock_v1 *wlr_session_lock_v1_ptr, struct wlr_output_layout *wlr_output_layout_ptr, struct wlr_seat *wlr_seat_ptr, wlmtk_root_t *root_ptr, _wlmaker_lock_surface_configure_t injected_surface_configure, _wlmaker_lock_send_locked_t injected_send_locked) |
static void | _wlmaker_lock_destroy (wlmaker_lock_t *lock_ptr) |
static wlmtk_element_t * | _wlmaker_lock_element (wlmaker_lock_t *lock_ptr) |
static void | _wlmaker_lock_register_lock_surface (wlmaker_lock_t *lock_ptr, wlmaker_lock_surface_t *lock_surface_ptr) |
static void | _wlmaker_lock_handle_new_surface (struct wl_listener *listener_ptr, void *data_ptr) |
static void | _wlmaker_lock_handle_unlock (struct wl_listener *listener_ptr, void *data_ptr) |
static void | _wlmaker_lock_handle_destroy (struct wl_listener *listener_ptr, void *data_ptr) |
static void | _wlmaker_lock_handle_output_layout_change (struct wl_listener *listener_ptr, void *data_ptr) |
static bool | _wlmaker_lock_update_output (struct wl_list *link_ptr, void *ud_ptr) |
static wlmaker_lock_surface_t * | _wlmaker_lock_surface_create (struct wlr_session_lock_surface_v1 *wlr_session_lock_surface_v1_ptr, wlmaker_lock_t *lock_ptr) |
static void | _wlmaker_lock_surface_destroy (wlmaker_lock_surface_t *lock_surface_ptr) |
static void | _wlmaker_lock_surface_handle_destroy (struct wl_listener *listener_ptr, void *data_ptr) |
static void | _wlmaker_lock_surface_handle_surface_commit (struct wl_listener *listener_ptr, void *data_ptr) |
static int | _wlmaker_lock_surface_avlnode_cmp (const bs_avltree_node_t *node_ptr, const void *key_ptr) |
static void | _wlmaker_lock_surface_avlnode_destroy (bs_avltree_node_t *node_ptr) |
wlmaker_lock_mgr_t * | wlmaker_lock_mgr_create (wlmaker_server_t *server_ptr) |
void | wlmaker_lock_mgr_destroy (wlmaker_lock_mgr_t *lock_mgr_ptr) |
static void | test_lock_unlock (bs_test_t *test_ptr) |
static void | test_lock_crash (bs_test_t *test_ptr) |
static void | test_lock_multi_output (bs_test_t *test_ptr) |
static uint32_t | _mock_wlr_session_lock_surface_v1_configure (struct wlr_session_lock_surface_v1 *lock_surface, uint32_t width, uint32_t height) |
static void | _mock_wlr_session_lock_v1_send_locked (struct wlr_session_lock_v1 *lock) |
static void | _init_test_session_lock (struct wlr_session_lock_v1 *wlr_session_lock_v1_ptr) |
static void | _init_test_surface (struct wlr_surface *wlr_surface_ptr) |
Variables | |
const bs_test_case_t | wlmaker_lock_mgr_test_cases [] |
static uint32_t | _mock_configure_serial |
static uint32_t | _mock_configure_width |
static uint32_t | _mock_configure_height |
static struct wlr_session_lock_surface_v1 * | _mock_configure_lock_surface |
static struct wlr_session_lock_v1 * | _mock_send_locked_lock |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
typedef void(* _wlmaker_lock_send_locked_t) (struct wlr_session_lock_v1 *lock) |
Type of wlr_session_lock_v1_send_locked().
typedef uint32_t(* _wlmaker_lock_surface_configure_t) (struct wlr_session_lock_surface_v1 *lock_surface, uint32_t width, uint32_t height) |
Type of wlr_session_lock_surface_v1_configure().
typedef struct _wlmaker_lock_surface_t wlmaker_lock_surface_t |
Forward declaration: Lock surface.
typedef struct _wlmaker_lock_t wlmaker_lock_t |
Forward declaration: Lock.
|
static |
Initializes the minimum required attributes of the session lock.
|
static |
Initializes the minimum required attributes of the wlr_surface.
|
static |
Mock for configure().
|
static |
Mock for send_locked().
|
static |
Creates a session lock handle.
wlr_session_lock_v1_ptr | |
wlr_output_layout_ptr | |
wlr_seat_ptr | |
root_ptr | |
injected_surface_configure | |
injected_send_locked |
|
static |
Destroys the session lock handle.
lock_ptr |
|
static |
|
static |
Handler for the destroy
signal of wlr_session_lock_v1
: Destroy the lock.
listener_ptr | |
data_ptr |
|
static |
Handler for the new_surface
signal of wlr_session_lock_v1
: Creates the associated surface and enables it on the screenlock container.
listener_ptr | |
data_ptr |
|
static |
Handles the change
event of wlr_output_layout::events.
Walks through outputs of wlmaker_lock_t::wlr_output_layout_ptr, and updates wlmaker_lock_t::lock_surface_tree_ptr accordingly.
listener_ptr | |
data_ptr |
|
static |
Handler for the unlock
signal of wlr_session_lock_v1
: Marks the session as unlocked.
listener_ptr | |
data_ptr |
|
static |
Handler for the destroy
signal of wlr_session_lock_manager_v1
: Cleans up associated resources.
listener_ptr | |
data_ptr |
|
static |
Handler for the new_lock
signal of wlr_session_lock_manager_v1
: creates the corresponding lock.
listener_ptr | |
data_ptr |
|
static |
Registers the provided surface as a lock surface for it's output, unless it had already been registered. Locks the session, once lock surfaces for all surfaces have been registered.
lock_ptr | |
lock_surface_ptr |
|
static |
Comparator for wlmaker_lock_t::lock_surface_tree_ptr by output.
|
static |
Dtor for wlmaker_lock_t::lock_surface_tree_ptr nodes.
|
static |
Creates a lock surface.
wlr_session_lock_surface_v1_ptr | |
lock_ptr |
|
static |
Destroys the lock surface.
lock_surface_ptr |
|
static |
Handler for the destroy
signal of wlr_session_lock_surface_v1
: Destroy the surface.
listener_ptr | |
data_ptr |
|
static |
Handler for the commit
signal of wlr_session_lock_surface_v1::surface
.
Checks whether the serial is at-or-above the 'configure' serial, and reports the surface and output as locked. Once all surfaces are locked, a 'send_locked' event will be sent.
listener_ptr | |
data_ptr |
|
static |
Updates the lock surfaces for an output: If there is a surface for the output, moves it into the new surface tree, and sends a configure() event with new dimensions. Otherwise, a no-op.
link_ptr | |
ud_ptr | A wlmaker_lock_update_output_arg_t. |
|
static |
Tests locking, and then the session lock going away: Must remain locked.
|
static |
Tests locking with multiple outputs. Lock only when all outputs covered.
|
static |
Tests locking & unlocking, proper sequence, single output.
wlmaker_lock_mgr_t * wlmaker_lock_mgr_create | ( | wlmaker_server_t * | server_ptr | ) |
Creates the session lock manager.
server_ptr |
void wlmaker_lock_mgr_destroy | ( | wlmaker_lock_mgr_t * | lock_mgr_ptr | ) |
Destroys the session lock manager.
lock_mgr_ptr |
|
static |
Arg of last call to _mock_wlr_session_lock_surface_v1_configure.
|
static |
Arg of last call to _mock_wlr_session_lock_surface_v1_configure.
|
static |
Return value for _mock_wlr_session_lock_surface_v1_configure.
|
static |
Arg of last call to _mock_wlr_session_lock_surface_v1_configure.
|
static |
Arg of last call to _mock_wlr_session_lock_v1_send_locked.
const bs_test_case_t wlmaker_lock_mgr_test_cases[] |
Unit test cases for wlmaker_lock_mgr_t.