wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
dock.c File Reference
#include "dock.h"
#include <libbase/libbase.h>
#include <libbase/plist.h>
#include <stdbool.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wayland-util.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/util/edges.h>
#include "backend/backend.h"
#include "backend/output_config.h"
#include "config.h"
#include "default_state.h"
#include "launcher.h"
#include "toolkit/toolkit.h"
Include dependency graph for dock.c:

Classes

struct  _wlmaker_dock_t
 
struct  parse_args
 

Functions

static bool _wlmaker_dock_decode_launchers (bspl_object_t *object_ptr, void *dest_ptr)
 
static void _wlmaker_dock_handle_workspace_changed (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_dock_handle_output_layout_change (struct wl_listener *listener_ptr, void *data_ptr)
 
wlmaker_dock_twlmaker_dock_create (wlmaker_server_t *server_ptr, bspl_dict_t *state_dict_ptr, const wlmaker_config_style_t *style_ptr)
 
void wlmaker_dock_destroy (wlmaker_dock_t *dock_ptr)
 
static void test_create_destroy (bs_test_t *test_ptr)
 

Variables

static const bspl_enum_desc_t _wlmaker_dock_edges []
 
const bspl_desc_t _wlmaker_dock_desc []
 
const bs_test_case_t wlmaker_dock_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_dock_decode_launchers()

bool _wlmaker_dock_decode_launchers ( bspl_object_t *  object_ptr,
void *  dest_ptr 
)
static

Decoder for the "Launchers" array. Currently just stores a reference.

◆ _wlmaker_dock_handle_output_layout_change()

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

Handles when output layout changes; Re-computes the output to attach.

◆ _wlmaker_dock_handle_workspace_changed()

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

Re-attaches the dock to the new "current" workspace.

◆ test_create_destroy()

void test_create_destroy ( bs_test_t *  test_ptr)
static

Tests ctor and dtor; to help fix leaks.

◆ wlmaker_dock_create()

wlmaker_dock_t * wlmaker_dock_create ( wlmaker_server_t server_ptr,
bspl_dict_t *  state_dict_ptr,
const wlmaker_config_style_t style_ptr 
)

Creates the Dock handle. Needs the server to be up with workspaces running.

Parameters
server_ptr
state_dict_ptr
style_ptr
Returns
Pointer to the Dock handle, or NULL on error.

◆ wlmaker_dock_destroy()

void wlmaker_dock_destroy ( wlmaker_dock_t dock_ptr)

Destroys the Dock handle.

Parameters
dock_ptr

Variable Documentation

◆ _wlmaker_dock_desc

const bspl_desc_t _wlmaker_dock_desc[]
Initial value:
= {
BSPL_DESC_ENUM("Edge", true, parse_args,
positioning.edge, positioning.edge,
WLR_EDGE_NONE, _wlmaker_dock_edges),
BSPL_DESC_ENUM("Anchor", true, parse_args,
positioning.anchor, positioning.anchor,
WLR_EDGE_NONE, _wlmaker_dock_edges),
BSPL_DESC_CUSTOM("Launchers", true, parse_args, launchers_array_ptr,
launchers_array_ptr,
NULL,
NULL),
BSPL_DESC_SENTINEL(),
}
static const bspl_enum_desc_t _wlmaker_dock_edges[]
Definition dock.c:84
static bool _wlmaker_dock_decode_launchers(bspl_object_t *object_ptr, void *dest_ptr)
Definition dock.c:237
Definition clip.c:130

Descriptor for the dock's plist.

◆ _wlmaker_dock_edges

const bspl_enum_desc_t _wlmaker_dock_edges[]
static
Initial value:
= {
BSPL_ENUM("TOP", WLR_EDGE_TOP),
BSPL_ENUM("BOTTOM", WLR_EDGE_BOTTOM),
BSPL_ENUM("LEFT", WLR_EDGE_LEFT),
BSPL_ENUM("RIGHT", WLR_EDGE_RIGHT),
BSPL_ENUM_SENTINEL(),
}

Enum descriptor for enum wlr_edges.

◆ wlmaker_dock_test_cases

const bs_test_case_t wlmaker_dock_test_cases[]
Initial value:
= {
{ 1, "create_destroy", test_create_destroy },
{ 0, NULL, NULL }
}
static void test_create_destroy(bs_test_t *test_ptr)
Definition dock.c:315

Unit test cases.