wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
lock.c File Reference
#include "lock.h"
#include "container.h"
#include "surface.h"
#include "util.h"
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_session_lock_v1.h>
Include dependency graph for lock.c:

Classes

struct  _wlmtk_lock_t
 
struct  _wlmtk_lock_surface_t
 

Typedefs

typedef struct _wlmtk_lock_surface_t wlmtk_lock_surface_t
 

Functions

static void _wlmtk_lock_report_surface_locked (wlmtk_lock_t *lock_ptr, wlmtk_lock_surface_t *lock_surface_ptr)
 
static void _wlmtk_lock_handle_new_surface (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmtk_lock_handle_unlock (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmtk_lock_handle_destroy (struct wl_listener *listener_ptr, void *data_ptr)
 
static wlmtk_lock_surface_t_wlmtk_lock_surface_create (struct wlr_session_lock_surface_v1 *wlr_session_lock_surface_v1_ptr, wlmtk_lock_t *lock_ptr)
 
static void _wlmtk_lock_surface_destroy (wlmtk_lock_surface_t *lock_surface_ptr)
 
static void _wlmtk_lock_surface_dlnode_destroy (bs_dllist_node_t *dlnode_ptr, void *ud_ptr)
 
static bool _wlmtk_lock_surface_has_wlr_output (bs_dllist_node_t *dlnode_ptr, void *ud_ptr)
 
static void _wlmtk_lock_surface_handle_destroy (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmtk_lock_surface_handle_surface_commit (struct wl_listener *listener_ptr, void *data_ptr)
 
wlmtk_lock_twlmtk_lock_create (struct wlr_session_lock_v1 *wlr_session_lock_v1_ptr, wlmtk_root_t *root_ptr, wlmtk_env_t *env_ptr)
 
void wlmtk_lock_destroy (wlmtk_lock_t *lock_ptr)
 
wlmtk_element_twlmtk_lock_element (wlmtk_lock_t *lock_ptr)
 

Detailed Description

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 Documentation

◆ wlmtk_lock_surface_t

Forward declaration: Lock surface.

Function Documentation

◆ _wlmtk_lock_handle_destroy()

void _wlmtk_lock_handle_destroy ( struct wl_listener * listener_ptr,
void * data_ptr )
static

Handler for the destroy signal of wlr_session_lock_v1: Destroy the lock.

Parameters
listener_ptr
data_ptr

◆ _wlmtk_lock_handle_new_surface()

void _wlmtk_lock_handle_new_surface ( struct wl_listener * listener_ptr,
void * 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.

Parameters
listener_ptr
data_ptr

◆ _wlmtk_lock_handle_unlock()

void _wlmtk_lock_handle_unlock ( struct wl_listener * listener_ptr,
void * data_ptr )
static

Handler for the unlock signal of wlr_session_lock_v1: Marks the session as unlocked.

Parameters
listener_ptr
data_ptr

◆ _wlmtk_lock_report_surface_locked()

void _wlmtk_lock_report_surface_locked ( wlmtk_lock_t * lock_ptr,
wlmtk_lock_surface_t * lock_surface_ptr )
static

Registers the provided surface as 'locked'. Locks the session, if all outputs have been locked.

Parameters
lock_ptr
lock_surface_ptr

◆ _wlmtk_lock_surface_create()

wlmtk_lock_surface_t * _wlmtk_lock_surface_create ( struct wlr_session_lock_surface_v1 * wlr_session_lock_surface_v1_ptr,
wlmtk_lock_t * lock_ptr )
static

Creates a lock surface.

Parameters
wlr_session_lock_surface_v1_ptr
lock_ptr
Returns
The lock surface or NULL on error.

◆ _wlmtk_lock_surface_destroy()

void _wlmtk_lock_surface_destroy ( wlmtk_lock_surface_t * lock_surface_ptr)
static

Destroys the lock surface.

Parameters
lock_surface_ptr

◆ _wlmtk_lock_surface_dlnode_destroy()

void _wlmtk_lock_surface_dlnode_destroy ( bs_dllist_node_t * dlnode_ptr,
void * ud_ptr )
static

Callback for bs_dllist_for_each to destroy all lock surfaces.

◆ _wlmtk_lock_surface_handle_destroy()

void _wlmtk_lock_surface_handle_destroy ( struct wl_listener * listener_ptr,
void * data_ptr )
static

Handler for the destroy signal of wlr_session_lock_surface_v1: Destroy the surface.

Parameters
listener_ptr
data_ptr

◆ _wlmtk_lock_surface_handle_surface_commit()

void _wlmtk_lock_surface_handle_surface_commit ( struct wl_listener * listener_ptr,
void * 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.

Parameters
listener_ptr
data_ptr

◆ _wlmtk_lock_surface_has_wlr_output()

bool _wlmtk_lock_surface_has_wlr_output ( bs_dllist_node_t * dlnode_ptr,
void * ud_ptr )
static

Returns whether the surface at dlnode_ptr has wlr_output == ud_ptr.

◆ wlmtk_lock_create()

wlmtk_lock_t * wlmtk_lock_create ( struct wlr_session_lock_v1 * wlr_session_lock_v1_ptr,
wlmtk_root_t * root_ptr,
wlmtk_env_t * env_ptr )

Creates a session lock handle.

Parameters
wlr_session_lock_v1_ptr
root_ptr
env_ptr
Returns
The lock handle or NULL on error.

◆ wlmtk_lock_destroy()

void wlmtk_lock_destroy ( wlmtk_lock_t * lock_ptr)

Destroys the session lock handle.

Parameters
lock_ptr

◆ wlmtk_lock_element()

wlmtk_element_t * wlmtk_lock_element ( wlmtk_lock_t * lock_ptr)