mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	The new-style window switcher can be enabled with <windowSwitcher style="thumbnail">. New theme entries: osd.window-switcher.style-thumbnail.width.max: 80% osd.window-switcher.style-thumbnail.padding: 4 osd.window-switcher.style-thumbnail.item.width: 300 osd.window-switcher.style-thumbnail.item.height: 250 osd.window-switcher.style-thumbnail.item.padding: 10 osd.window-switcher.style-thumbnail.item.active.border.width: 2 osd.window-switcher.style-thumbnail.item.active.border.color: #589bda osd.window-switcher.style-thumbnail.item.active.bg.color: #c7e2fc osd.window-switcher.style-thumbnail.item.icon.size: 60
		
			
				
	
	
		
			88 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			88 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/* SPDX-License-Identifier: GPL-2.0-only */
 | 
						|
#ifndef LABWC_OSD_H
 | 
						|
#define LABWC_OSD_H
 | 
						|
 | 
						|
#include <stdbool.h>
 | 
						|
#include <wayland-server-core.h>
 | 
						|
 | 
						|
struct output;
 | 
						|
 | 
						|
enum lab_cycle_dir {
 | 
						|
	LAB_CYCLE_DIR_NONE,
 | 
						|
	LAB_CYCLE_DIR_FORWARD,
 | 
						|
	LAB_CYCLE_DIR_BACKWARD,
 | 
						|
};
 | 
						|
 | 
						|
/* TODO: add field with keyboard layout? */
 | 
						|
enum window_switcher_field_content {
 | 
						|
	LAB_FIELD_NONE = 0,
 | 
						|
	LAB_FIELD_TYPE,
 | 
						|
	LAB_FIELD_TYPE_SHORT,
 | 
						|
	LAB_FIELD_IDENTIFIER,
 | 
						|
	LAB_FIELD_TRIMMED_IDENTIFIER,
 | 
						|
	LAB_FIELD_ICON,
 | 
						|
	LAB_FIELD_DESKTOP_ENTRY_NAME,
 | 
						|
	LAB_FIELD_TITLE,
 | 
						|
	LAB_FIELD_TITLE_SHORT,
 | 
						|
	LAB_FIELD_WORKSPACE,
 | 
						|
	LAB_FIELD_WORKSPACE_SHORT,
 | 
						|
	LAB_FIELD_WIN_STATE,
 | 
						|
	LAB_FIELD_WIN_STATE_ALL,
 | 
						|
	LAB_FIELD_OUTPUT,
 | 
						|
	LAB_FIELD_OUTPUT_SHORT,
 | 
						|
	LAB_FIELD_CUSTOM,
 | 
						|
 | 
						|
	LAB_FIELD_COUNT
 | 
						|
};
 | 
						|
 | 
						|
struct window_switcher_field {
 | 
						|
	enum window_switcher_field_content content;
 | 
						|
	int width;
 | 
						|
	char *format;
 | 
						|
	struct wl_list link; /* struct rcxml.window_switcher.fields */
 | 
						|
};
 | 
						|
 | 
						|
struct buf;
 | 
						|
struct view;
 | 
						|
struct server;
 | 
						|
 | 
						|
/* Begin window switcher */
 | 
						|
void osd_begin(struct server *server, enum lab_cycle_dir direction);
 | 
						|
 | 
						|
/* Cycle the selected view in the window switcher */
 | 
						|
void osd_cycle(struct server *server, enum lab_cycle_dir direction);
 | 
						|
 | 
						|
/* Closes the OSD */
 | 
						|
void osd_finish(struct server *server);
 | 
						|
 | 
						|
/* Notify OSD about a destroying view */
 | 
						|
void osd_on_view_destroy(struct view *view);
 | 
						|
 | 
						|
/* Used by osd.c internally to render window switcher fields */
 | 
						|
void osd_field_get_content(struct window_switcher_field *field,
 | 
						|
	struct buf *buf, struct view *view);
 | 
						|
 | 
						|
/* Used by rcxml.c when parsing the config */
 | 
						|
void osd_field_arg_from_xml_node(struct window_switcher_field *field,
 | 
						|
	const char *nodename, const char *content);
 | 
						|
bool osd_field_is_valid(struct window_switcher_field *field);
 | 
						|
void osd_field_free(struct window_switcher_field *field);
 | 
						|
 | 
						|
/* Internal API */
 | 
						|
struct osd_impl {
 | 
						|
	/*
 | 
						|
	 * Create a scene-tree of OSD for an output.
 | 
						|
	 * This sets output->osd_scene.{items,tree}.
 | 
						|
	 */
 | 
						|
	void (*create)(struct output *output, struct wl_array *views);
 | 
						|
	/*
 | 
						|
	 * Update output->osd_scene.tree to highlight
 | 
						|
	 * server->osd_state.cycle_view.
 | 
						|
	 */
 | 
						|
	void (*update)(struct output *output);
 | 
						|
};
 | 
						|
 | 
						|
extern struct osd_impl osd_classic_impl;
 | 
						|
extern struct osd_impl osd_thumbnail_impl;
 | 
						|
 | 
						|
#endif // LABWC_OSD_H
 |