wlmaker
Loading...
Searching...
No Matches
Classes | Functions | Variables
launcher.c File Reference
#include "launcher.h"
#include <limits.h>
#include <libbase/libbase.h>
#include "toolkit/toolkit.h"
#include "conf/decode.h"
#include "conf/plist.h"
Include dependency graph for launcher.c:

Classes

struct  _wlmaker_launcher_t
 

Functions

static void _wlmaker_launcher_update_overlay (wlmaker_launcher_t *launcher_ptr)
 
static struct wlr_buffer * _wlmaker_launcher_create_overlay_buffer (wlmaker_launcher_t *launcher_ptr)
 
static void _wlmaker_launcher_element_destroy (wlmtk_element_t *element_ptr)
 
static bool _wlmaker_launcher_pointer_button (wlmtk_element_t *element_ptr, const wlmtk_button_event_t *button_event_ptr)
 
static void _wlmaker_launcher_start (wlmaker_launcher_t *launcher_ptr)
 
static void _wlmaker_launcher_handle_terminated (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, int state, int code)
 
static void _wlmaker_launcher_handle_window_created (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
static void _wlmaker_launcher_handle_window_mapped (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
static void _wlmaker_launcher_handle_window_unmapped (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
static void _wlmaker_launcher_handle_window_destroyed (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
wlmaker_launcher_twlmaker_launcher_create_from_plist (const wlmtk_tile_style_t *style_ptr, wlmcfg_dict_t *dict_ptr, wlmaker_subprocess_monitor_t *monitor_ptr, wlmtk_env_t *env_ptr)
 
void wlmaker_launcher_destroy (wlmaker_launcher_t *launcher_ptr)
 
wlmtk_tile_twlmaker_launcher_tile (wlmaker_launcher_t *launcher_ptr)
 
static void test_create_from_plist (bs_test_t *test_ptr)
 

Variables

static const wlmcfg_desc_t _wlmaker_launcher_plist_desc []
 
static const char * lookup_paths []
 
static const wlmtk_element_vmt_t _wlmaker_launcher_element_vmt
 
const bs_test_case_t wlmaker_launcher_test_cases []
 

Detailed Description

Copyright (c) 2024 by Philipp Kaeser kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h

Function Documentation

◆ _wlmaker_launcher_create_overlay_buffer()

struct wlr_buffer * _wlmaker_launcher_create_overlay_buffer ( wlmaker_launcher_t * launcher_ptr)
static

Creates an overlay wlr_buffer.

◆ _wlmaker_launcher_element_destroy()

void _wlmaker_launcher_element_destroy ( wlmtk_element_t * element_ptr)
static

Implements wlmtk_element_vmt_t::destroy. Calls wlmaker_launcher_destroy.

Parameters
element_ptr

◆ _wlmaker_launcher_handle_terminated()

void _wlmaker_launcher_handle_terminated ( void * userdata_ptr,
wlmaker_subprocess_handle_t * subprocess_handle_ptr,
int exit_status,
int signal_number )
static

Callback handler for when the registered subprocess terminates.

Parameters
userdata_ptrPoints to wlmaker_launcher_t.
subprocess_handle_ptr
exit_status
signal_number

◆ _wlmaker_launcher_handle_window_created()

void _wlmaker_launcher_handle_window_created ( void * userdata_ptr,
wlmaker_subprocess_handle_t * subprocess_handle_ptr,
wlmtk_window_t * window_ptr )
static

Callback for then a window from the launched subprocess is created.

Registers the windows as "created", and will then redraw the launcher tile to reflect potential status changes.

Parameters
userdata_ptrPoints to the wlmaker_launcher_t.
subprocess_handle_ptr
window_ptr

◆ _wlmaker_launcher_handle_window_destroyed()

void _wlmaker_launcher_handle_window_destroyed ( void * userdata_ptr,
wlmaker_subprocess_handle_t * subprocess_handle_ptr,
wlmtk_window_t * window_ptr )
static

Callback for then a window from the launched subprocess is destroyed.

Removes the window from the set of "created" windows, and will then redraw the launcher tile to reflect potential status changes.

Parameters
userdata_ptrPoints to the wlmaker_launcher_t.
subprocess_handle_ptr
window_ptr

◆ _wlmaker_launcher_handle_window_mapped()

void _wlmaker_launcher_handle_window_mapped ( void * userdata_ptr,
wlmaker_subprocess_handle_t * subprocess_handle_ptr,
wlmtk_window_t * window_ptr )
static

Callback for then a window from the launched subprocess is mapped.

Registers the window as "mapped", and will then redraw the launcher tile to reflect potential status changes.

Parameters
userdata_ptrPoints to the wlmaker_launcher_t.
subprocess_handle_ptr
window_ptr

◆ _wlmaker_launcher_handle_window_unmapped()

void _wlmaker_launcher_handle_window_unmapped ( void * userdata_ptr,
wlmaker_subprocess_handle_t * subprocess_handle_ptr,
wlmtk_window_t * window_ptr )
static

Callback for then a window from the launched subprocess is unmapped.

Removes the window from the set of "mapped" windows, and will then redraw the launcher tile to reflect potential status changes.

Parameters
userdata_ptrPoints to the wlmaker_launcher_t.
subprocess_handle_ptr
window_ptr

◆ _wlmaker_launcher_pointer_button()

bool _wlmaker_launcher_pointer_button ( wlmtk_element_t * element_ptr,
const wlmtk_button_event_t * button_event_ptr )
static

Implements wlmtk_element_vmt_t::pointer_button.

Parameters
element_ptr
button_event_ptr
Returns
true always.

◆ _wlmaker_launcher_start()

void _wlmaker_launcher_start ( wlmaker_launcher_t * launcher_ptr)
static

Starts the application, called when the launcher is clicked.

Parameters
launcher_ptr

◆ _wlmaker_launcher_update_overlay()

void _wlmaker_launcher_update_overlay ( wlmaker_launcher_t * launcher_ptr)
static

Redraws the overlay element.

◆ test_create_from_plist()

void test_create_from_plist ( bs_test_t * test_ptr)
static

Exercises plist parser.

◆ wlmaker_launcher_create_from_plist()

wlmaker_launcher_t * wlmaker_launcher_create_from_plist ( const wlmtk_tile_style_t * style_ptr,
wlmcfg_dict_t * dict_ptr,
wlmaker_subprocess_monitor_t * monitor_ptr,
wlmtk_env_t * env_ptr )

Creates an application launcher, configured from a plist dict.

Parameters
style_ptr
dict_ptr
monitor_ptr
env_ptr
Returns
Pointer to the launcher handle or NULL on error.

◆ wlmaker_launcher_destroy()

void wlmaker_launcher_destroy ( wlmaker_launcher_t * launcher_ptr)

Destroys the application launcher.

Parameters
launcher_ptr

◆ wlmaker_launcher_tile()

wlmtk_tile_t * wlmaker_launcher_tile ( wlmaker_launcher_t * launcher_ptr)
Returns
A pointer to the wlmtk_tile_t superclass of launcher_ptr.

Variable Documentation

◆ _wlmaker_launcher_element_vmt

const wlmtk_element_vmt_t _wlmaker_launcher_element_vmt
static
Initial value:
= {
}
static bool _wlmaker_launcher_pointer_button(wlmtk_element_t *element_ptr, const wlmtk_button_event_t *button_event_ptr)
Definition launcher.c:335
static void _wlmaker_launcher_element_destroy(wlmtk_element_t *element_ptr)
Definition launcher.c:317

The launcher's extension to wlmtk_element_t virtual method table.

◆ _wlmaker_launcher_plist_desc

const wlmcfg_desc_t _wlmaker_launcher_plist_desc[]
static
Initial value:
= {
"CommandLine", true, wlmaker_launcher_t, cmdline_ptr, ""),
"Icon", true, wlmaker_launcher_t, icon_path_ptr, ""),
}
#define WLMCFG_DESC_STRING(_key, _required, _base, _field, _default)
Definition decode.h:215
#define WLMCFG_DESC_SENTINEL()
Definition decode.h:156
Definition launcher.c:19

Plist descroptor for a launcher.

◆ lookup_paths

const char* lookup_paths[]
static
Initial value:
= {
"/usr/share/icons/wlmaker",
"/usr/local/share/icons/wlmaker",
NULL
}

Lookup paths for icons.

◆ wlmaker_launcher_test_cases

const bs_test_case_t wlmaker_launcher_test_cases[]
Initial value:
= {
{ 1, "create_from_plist", test_create_from_plist },
{ 0, NULL, NULL }
}
static void test_create_from_plist(bs_test_t *test_ptr)
Definition launcher.c:545

Unit tests.