wlmaker
Loading...
Searching...
No Matches
dock_app.c File Reference
#include "dock_app.h"
#include "config.h"
#include "decorations.h"
#include "tile.h"
#include <libbase/libbase.h>
Include dependency graph for dock_app.c:

Classes

struct  _wlmaker_dock_app_t
 

Functions

static bool draw_texture (cairo_t *cairo_ptr, const char *icon_path_ptr)
 
static void tile_callback (wlmaker_interactive_t *interactive_ptr, void *data_ptr)
 
static void handle_terminated (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, int state, int code)
 
static void handle_window_created (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
static void handle_window_mapped (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
static void handle_window_unmapped (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
static void handle_window_destroyed (void *userdata_ptr, wlmaker_subprocess_handle_t *subprocess_handle_ptr, wlmtk_window_t *window_ptr)
 
wlmaker_dock_app_twlmaker_dock_app_create (wlmaker_view_t *view_ptr, struct wlr_scene_tree *wlr_scene_tree_ptr, int x, int y, wlmaker_dock_app_config_t *dock_app_config_ptr)
 
void wlmaker_dock_app_destroy (wlmaker_dock_app_t *dock_app_ptr)
 
wlmaker_dock_app_twlmaker_dock_app_from_dlnode (bs_dllist_node_t *dlnode_ptr)
 
bs_dllist_node_t * wlmaker_dlnode_from_dock_app (wlmaker_dock_app_t *dock_app_ptr)
 
void redraw_tile (wlmaker_dock_app_t *dock_app_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.

Function Documentation

◆ draw_texture()

bool draw_texture ( cairo_t * cairo_ptr,
const char * icon_path_ptr )
static

Draws the tile background and icon as texture into |cairo_ptr|.

Parameters
cairo_ptr
icon_path_ptr
Returns
true on success.

◆ handle_terminated()

void 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_dock_app_t.
subprocess_handle_ptr
exit_status
signal_number

◆ handle_window_created()

void 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_dock_app_t.
subprocess_handle_ptr
window_ptr

◆ handle_window_destroyed()

void 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_dock_app_t.
subprocess_handle_ptr
window_ptr

◆ handle_window_mapped()

void 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_dock_app_t.
subprocess_handle_ptr
window_ptr

◆ handle_window_unmapped()

void 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_dock_app_t.
subprocess_handle_ptr
window_ptr

◆ redraw_tile()

void redraw_tile ( wlmaker_dock_app_t * dock_app_ptr)

Redraws the tile and shows app status ("running", "created").

Parameters
dock_app_ptr

◆ tile_callback()

void tile_callback ( wlmaker_interactive_t * interactive_ptr,
void * data_ptr )
static

Callback for when the tile is triggered (clicked).

Not implemented yet, supposed to launch the configured application.

Parameters
interactive_ptr
data_ptr

◆ wlmaker_dlnode_from_dock_app()

bs_dllist_node_t * wlmaker_dlnode_from_dock_app ( wlmaker_dock_app_t * dock_app_ptr)

Type cast: Returns the dlnode from |dock_app_ptr|.

Parameters
dock_app_ptr
Returns
A pointer to the bs_dllist_node_t of wlmaker_dock_app_t.

◆ wlmaker_dock_app_create()

wlmaker_dock_app_t * wlmaker_dock_app_create ( wlmaker_view_t * view_ptr,
struct wlr_scene_tree * wlr_scene_tree_ptr,
int x,
int y,
wlmaker_dock_app_config_t * dock_app_config_ptr )

Creates an application attached to the dock.

Parameters
view_ptr
wlr_scene_tree_ptr
xX-Position relative to parent.
yY-Position relative to parent.
dock_app_config_ptrConfiguration of the docked application. Must outlive the dock app.
Returns
The handle for the attached application or NULL on error.

◆ wlmaker_dock_app_destroy()

void wlmaker_dock_app_destroy ( wlmaker_dock_app_t * dock_app_ptr)

Destroys the application.

Parameters
dock_app_ptr

◆ wlmaker_dock_app_from_dlnode()

wlmaker_dock_app_t * wlmaker_dock_app_from_dlnode ( bs_dllist_node_t * dlnode_ptr)

Type cast: Returns the wlmaker_dock_app_t from the dlnode.

Parameters
dlnode_ptr
Returns
A pointer to the wlmaker_dock_app_t holding bs_dllist_node_t.