Merge branch 'master' into master

This commit is contained in:
yuanye100 2022-07-07 16:20:04 +08:00 committed by GitHub
commit 6003c62c1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 446 additions and 249 deletions

View file

@ -2,19 +2,23 @@
#ifndef __LABWC_ACTION_H
#define __LABWC_ACTION_H
struct server;
struct view;
struct server;
struct wl_list;
struct action {
uint32_t type;
char *arg;
struct wl_list link;
struct wl_list link; /* struct keybinding.actions,
* struct mousebinding.actions,
* struct menuitem.actions */
uint32_t type; /* enum action_type */
struct wl_list args; /* struct action_arg.link */
};
struct action *action_create(const char *action_name);
void action_list_free(struct wl_list *action_list);
void action_arg_add_str(struct action *action, char *key, const char *value);
void actions_run(struct view *activator, struct server *server,
struct wl_list *actions, uint32_t resize_edges);
void action_list_free(struct wl_list *action_list);
#endif
#endif /* __LABWC_ACTION_H */

View file

@ -11,8 +11,8 @@ struct keybind {
uint32_t modifiers;
xkb_keysym_t *keysyms;
size_t keysyms_len;
struct wl_list actions;
struct wl_list link;
struct wl_list actions; /* struct action.link */
struct wl_list link; /* struct rcxml.keybinds */
};
/**

View file

@ -26,9 +26,9 @@ struct mousebind {
/* ex: doubleclick, press, drag */
enum mouse_event mouse_event;
struct wl_list actions;
struct wl_list actions; /* struct action.link */
struct wl_list link; /* rcxml::mousebinds */
struct wl_list link; /* struct rcxml.mousebinds */
bool pressed_in_context; /* used in click events */
};

View file

@ -37,11 +37,11 @@ struct rcxml {
/* keyboard */
int repeat_rate;
int repeat_delay;
struct wl_list keybinds;
struct wl_list keybinds; /* struct keybind.link */
/* mouse */
long doubleclick_time; /* in ms */
struct wl_list mousebinds;
long doubleclick_time; /* in ms */
struct wl_list mousebinds; /* struct mousebind.link */
/* libinput */
struct wl_list libinput_categories;

View file

@ -306,13 +306,14 @@ struct view {
bool been_mapped;
bool minimized;
bool maximized;
uint32_t tiled; /* private, enum view_edge in src/view.c */
struct wlr_output *fullscreen;
/* geometry of the wlr_surface contained within the view */
int x, y, w, h;
/* geometry before maximize */
struct wlr_box unmaximized_geometry;
/* user defined geometry before maximize / tiling / fullscreen */
struct wlr_box natural_geometry;
/*
* margin refers to the space between the extremities of the
@ -364,6 +365,7 @@ struct view {
struct xwayland_unmanaged {
struct server *server;
struct wlr_xwayland_surface *xwayland_surface;
struct wlr_scene_node *node;
struct wl_list link;
int lx, ly;
@ -460,6 +462,7 @@ void foreign_toplevel_handle_create(struct view *view);
void desktop_move_to_front(struct view *view);
void desktop_move_to_back(struct view *view);
void desktop_focus_and_activate_view(struct seat *seat, struct view *view);
void desktop_arrange_all_views(struct server *server);
enum lab_cycle_dir {
LAB_CYCLE_DIR_NONE,

24
include/private/action.h Normal file
View file

@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __LABWC_PRIVATE_ACTION_H
#define __LABWC_PRIVATE_ACTION_H
/* Don't include ourself as search path starts at current directory */
#include "../action.h"
enum action_arg_type {
LAB_ACTION_ARG_STR = 0,
};
struct action_arg {
struct wl_list link; /* struct action.args */
const char *key; /* May be NULL if there is just one arg */
enum action_arg_type type;
};
struct action_arg_str {
struct action_arg base;
char *value;
};
#endif /* __LABWC_PRIVATE_ACTION_H */

View file

@ -134,8 +134,10 @@ struct ssd_hover_state {
/* Public SSD API */
void ssd_create(struct view *view);
void ssd_hide(struct view *view);
void ssd_set_active(struct view *view, bool activated);
void ssd_update_title(struct view *view);
void ssd_update_geometry(struct view *view);
void ssd_reload(struct view *view);