labwc/include/menu/menu.h
Johan Malm 5ecf0e1e7e Make font_texture_create() more generic
Move font_texture_create() to font.c so it can be used for purposes other
than rendering the menu, for example server side decoration.

Refactor menu.c and menu.h to use this more generic font_texture_create()
2021-08-07 08:35:46 +01:00

44 lines
1 KiB
C

#ifndef __LABWC_MENU_H
#define __LABWC_MENU_H
#include <wayland-server.h>
#include <wlr/render/wlr_renderer.h>
struct menuitem {
char *action;
char *command;
struct wlr_box box;
struct {
struct wlr_texture *active;
struct wlr_texture *inactive;
int offset_x;
int offset_y;
} texture;
bool selected;
struct wl_list link;
};
struct menu {
struct server *server;
int x;
int y;
struct wl_list menuitems;
};
/* menu_create - create menu */
void menu_init_rootmenu(struct server *server, struct menu *menu);
void menu_finish(struct menu *menu);
/* menu_move - move to position (x, y) */
void menu_move(struct menu *menu, int x, int y);
/* menu_set_selected - select item at (x, y) */
void menu_set_selected(struct menu *menu, int x, int y);
/* menu_action_selected - select item at (x, y) */
void menu_action_selected(struct server *server, struct menu *menu);
/* menu_reconfigure - reload theme and content */
void menu_reconfigure(struct server *server, struct menu *menu);
#endif /* __LABWC_MENU_H */