wlmaker
Loading...
Searching...
No Matches
server.h File Reference
#include <libbase/libbase.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/render/allocator.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_subcompositor.h>
#include "cursor.h"
#include "output.h"
#include "keyboard.h"
#include "layer_shell.h"
#include "view.h"
#include "subprocess_monitor.h"
#include "icon_manager.h"
#include "xdg_decoration.h"
#include "xdg_shell.h"
#include "xwl.h"
#include "workspace.h"
#include "toolkit/toolkit.h"
Include dependency graph for server.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _wlmaker_server_t
 

Typedefs

typedef struct _wlmaker_server_t wlmaker_server_t
 
typedef void(* wlmaker_server_bind_key_callback_t) (wlmaker_server_t *server_ptr, void *callback_arg_ptr)
 
typedef struct _wlmaker_server_key_binding_t wlmaker_server_key_binding_t
 

Functions

wlmaker_server_twlmaker_server_create (void)
 
void wlmaker_server_destroy (wlmaker_server_t *server_ptr)
 
void wlmaker_server_output_add (wlmaker_server_t *server_ptr, wlmaker_output_t *output_ptr)
 
void wlmaker_server_output_remove (wlmaker_server_t *server_ptr, wlmaker_output_t *output_ptr)
 
wlmaker_server_key_binding_twlmaker_server_bind_key (wlmaker_server_t *server_ptr, xkb_keysym_t key_sym, uint32_t modifiers, wlmaker_server_bind_key_callback_t callback, void *callback_arg_ptr)
 
void wlmaker_server_unbind_key (wlmaker_server_t *server_ptr, wlmaker_server_key_binding_t *key_binding_ptr)
 
bool wlmaker_server_process_key (wlmaker_server_t *server_ptr, xkb_keysym_t key_sym, uint32_t modifiers)
 
wlmaker_workspace_twlmaker_server_get_current_workspace (wlmaker_server_t *server_ptr)
 
void wlmaker_server_switch_to_next_workspace (wlmaker_server_t *server_ptr)
 
void wlmaker_server_switch_to_previous_workspace (wlmaker_server_t *server_ptr)
 
struct wlr_output * wlmaker_server_get_output_at_cursor (wlmaker_server_t *server_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

◆ wlmaker_server_bind_key_callback_t

typedef void(* wlmaker_server_bind_key_callback_t) (wlmaker_server_t *server_ptr, void *callback_arg_ptr)

Callback for key binding.

◆ wlmaker_server_key_binding_t

State of a key binding.

◆ wlmaker_server_t

A handle for a wlmaker server.

Function Documentation

◆ wlmaker_server_bind_key()

wlmaker_server_key_binding_t * wlmaker_server_bind_key ( wlmaker_server_t * server_ptr,
xkb_keysym_t key_sym,
uint32_t modifiers,
wlmaker_server_bind_key_callback_t callback,
void * callback_arg_ptr )

Binds the callback to the specified key and modifiers.

Parameters
server_ptr
key_symThe key to bind. Both upper- and lower-case will be bound!
modifiersModifiers of the bound key.
callbackCallback for when key is pressed.
callback_arg_ptrArgument to pass to |callback|.

◆ wlmaker_server_create()

wlmaker_server_t * wlmaker_server_create ( void )

Creates the server and initializes all needed sub-modules.

Returns
The server handle or NULL on failure. The handle must be freed by calling wlmaker_server_destroy().

◆ wlmaker_server_destroy()

void wlmaker_server_destroy ( wlmaker_server_t * server_ptr)

Destroys the server handle, as created by wlmaker_server_create().

Parameters
server_ptr

◆ wlmaker_server_get_current_workspace()

wlmaker_workspace_t * wlmaker_server_get_current_workspace ( wlmaker_server_t * server_ptr)

Returns the currently active workspace.

Parameters
server_ptr
Returns
Pointer to the wlmaker_workspace_t currently active.

◆ wlmaker_server_get_output_at_cursor()

struct wlr_output * wlmaker_server_get_output_at_cursor ( wlmaker_server_t * server_ptr)

Looks up which output serves the current cursor coordinates and returns that.

Parameters
server_ptr
Returns
Pointer to the output at the seat's cursor position.

◆ wlmaker_server_output_add()

void wlmaker_server_output_add ( wlmaker_server_t * server_ptr,
wlmaker_output_t * output_ptr )

Adds the output.

Parameters
server_ptr
output_ptr

◆ wlmaker_server_output_remove()

void wlmaker_server_output_remove ( wlmaker_server_t * server_ptr,
wlmaker_output_t * output_ptr )

Removes the output.

Parameters
server_ptr
output_ptr

◆ wlmaker_server_process_key()

bool wlmaker_server_process_key ( wlmaker_server_t * server_ptr,
xkb_keysym_t key_sym,
uint32_t modifiers )

Processes a key press: Looks for matching bindings and runs the callback.

Parameters
server_ptr
key_sym
modifiers
Returns
true, if there was a matching binding; false if not.

◆ wlmaker_server_switch_to_next_workspace()

void wlmaker_server_switch_to_next_workspace ( wlmaker_server_t * server_ptr)

Switches to the next workspace.

Parameters
server_ptr

◆ wlmaker_server_switch_to_previous_workspace()

void wlmaker_server_switch_to_previous_workspace ( wlmaker_server_t * server_ptr)

Switches to the previous workspace.

Parameters
server_ptr

◆ wlmaker_server_unbind_key()

void wlmaker_server_unbind_key ( wlmaker_server_t * server_ptr,
wlmaker_server_key_binding_t * key_binding_ptr )

Releases a previously-bound key binding.

Parameters
server_ptr
key_binding_ptr