mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-06 13:29:53 -05:00
feat: add ipc dispatch
This commit is contained in:
parent
c64dd51b69
commit
cb4907510d
2 changed files with 24 additions and 0 deletions
17
src/maomao.c
17
src/maomao.c
|
|
@ -494,6 +494,8 @@ static void dwl_ipc_output_set_tags(struct wl_client *client,
|
|||
uint32_t tagmask, uint32_t toggle_tagset);
|
||||
static void dwl_ipc_output_quit(struct wl_client *client,
|
||||
struct wl_resource *resource);
|
||||
static void dwl_ipc_output_dispatch(struct wl_client *client,
|
||||
struct wl_resource *resource,const char *dispatch,const char* arg1,const char* arg2);
|
||||
static void dwl_ipc_output_release(struct wl_client *client,
|
||||
struct wl_resource *resource);
|
||||
static void focusclient(Client *c, int lift);
|
||||
|
|
@ -703,6 +705,7 @@ static struct zdwl_ipc_output_v2_interface dwl_output_implementation = {
|
|||
.release = dwl_ipc_output_release,
|
||||
.set_tags = dwl_ipc_output_set_tags,
|
||||
.quit = dwl_ipc_output_quit,
|
||||
.dispatch = dwl_ipc_output_dispatch,
|
||||
.set_layout = dwl_ipc_output_set_layout,
|
||||
.set_client_tags = dwl_ipc_output_set_client_tags};
|
||||
|
||||
|
|
@ -3493,6 +3496,20 @@ void dwl_ipc_output_quit(struct wl_client *client,
|
|||
quit(&(Arg){0});
|
||||
}
|
||||
|
||||
void dwl_ipc_output_dispatch(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
const char *dispatch, const char *arg1,
|
||||
const char *arg2) {
|
||||
|
||||
void (*func)(const Arg *);
|
||||
Arg arg;
|
||||
func = parse_func_name((char*)dispatch, &arg, (char*)arg1, (char*)arg2);
|
||||
if(func) {
|
||||
func(&arg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void dwl_ipc_output_release(struct wl_client *client,
|
||||
struct wl_resource *resource) {
|
||||
wl_resource_destroy(resource);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue