wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
corner.c File Reference
#include "corner.h"
#include <libbase/libbase.h>
#include <libbase/plist.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/util/edges.h>
#include "action.h"
#include "server.h"
#include "toolkit/toolkit.h"
Include dependency graph for corner.c:

Classes

struct  _wlmaker_corner_t
 

Functions

static void _wlmaker_corner_clear (wlmaker_corner_t *corner_ptr)
 
static void _wlmaker_corner_occupy (wlmaker_corner_t *corner_ptr, unsigned position)
 
static void _wlmaker_corner_update_layout (wlmaker_corner_t *corner_ptr, struct wlr_box *extents_ptr)
 
static void _wlmaker_corner_evaluate (wlmaker_corner_t *corner_ptr)
 
static int _wlmaker_corner_handle_timer (void *data_ptr)
 
static void _wlmaker_corner_handle_output_layout_changed (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_corner_handle_position_updated (struct wl_listener *listener_ptr, void *data_ptr)
 
wlmaker_corner_twlmaker_corner_create (bspl_dict_t *hot_corner_config_dict_ptr, struct wl_event_loop *wl_event_loop_ptr, struct wlr_output_layout *wlr_output_layout_ptr, wlmaker_cursor_t *cursor_ptr, wlmaker_server_t *server_ptr)
 
void wlmaker_corner_destroy (wlmaker_corner_t *corner_ptr)
 
static void _wlmaker_corner_test (bs_test_t *test_ptr)
 

Variables

static const bspl_desc_t _wlmaker_corner_config_desc []
 
const bs_test_case_t wlmaker_corner_test_cases []
 

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.

Function Documentation

◆ _wlmaker_corner_clear()

void _wlmaker_corner_clear ( wlmaker_corner_t corner_ptr)
static

Clears the hot-corner tracking and activation.

◆ _wlmaker_corner_evaluate()

void _wlmaker_corner_evaluate ( wlmaker_corner_t corner_ptr)
static

(Re)evaluates hot corner state from layout extents and pointer position.

◆ _wlmaker_corner_handle_output_layout_changed()

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

Handles change events of struct wlr_output_layout.

Will recompute the output's layout settings and re-evaluate the current cursor position.

Parameters
listener_ptr
data_ptrPoints to a struct wlr_output_layout.

◆ _wlmaker_corner_handle_position_updated()

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

Handles wlmaker_cursor_t::position_updated signal callbacks.

Stores the pointer's position in wlmaker_corner_t. If the position is different than before, triggers a re-evaluation of whether a corner is occupied.

Parameters
listener_ptr
data_ptrPoints to a struct wlr_cursor.

◆ _wlmaker_corner_handle_timer()

int _wlmaker_corner_handle_timer ( void *  data_ptr)
static

Handles timer callbacks: Sends 'enter' event and registers triggering.

◆ _wlmaker_corner_occupy()

void _wlmaker_corner_occupy ( wlmaker_corner_t corner_ptr,
unsigned  position 
)
static

Starts occupation of a corner.

Parameters
corner_ptr
position

◆ _wlmaker_corner_test()

void _wlmaker_corner_test ( bs_test_t *  test_ptr)
static

Exercises the hot corner module.

◆ _wlmaker_corner_update_layout()

void _wlmaker_corner_update_layout ( wlmaker_corner_t corner_ptr,
struct wlr_box *  extents_ptr 
)
static

Updates the output extents. Triggers a re-evaluation.

◆ wlmaker_corner_create()

wlmaker_corner_t * wlmaker_corner_create ( bspl_dict_t *  hot_corner_config_dict_ptr,
struct wl_event_loop *  wl_event_loop_ptr,
struct wlr_output_layout *  wlr_output_layout_ptr,
wlmaker_cursor_t cursor_ptr,
wlmaker_server_t server_ptr 
)

Creates the hot-corner handler.

Parameters
hot_corner_config_dict_ptr
wl_event_loop_ptr
wlr_output_layout_ptr
cursor_ptr
server_ptr
Returns
Pointer to the hot-corner monitor.

◆ wlmaker_corner_destroy()

void wlmaker_corner_destroy ( wlmaker_corner_t corner_ptr)

Destroys the hot-corner handler.

Parameters
corner_ptr

Variable Documentation

◆ _wlmaker_corner_config_desc

const bspl_desc_t _wlmaker_corner_config_desc[]
static

Descriptor for the 'HotConfig' config dictionary.

◆ wlmaker_corner_test_cases

const bs_test_case_t wlmaker_corner_test_cases[]
Initial value:
= {
{ 1, "test", _wlmaker_corner_test },
{ 0, NULL, NULL }
}
static void _wlmaker_corner_test(bs_test_t *test_ptr)
Definition corner.c:436

Unit test cases.