NekoWM
A gfxprim proxy backend tiling window manager
Loading...
Searching...
No Matches
neko_menu.h
Go to the documentation of this file.
1//SPDX-License-Identifier: GPL-2.0-or-later
2/*
3
4 Copyright (c) 2019-2024 Cyril Hrubis <metan@ucw.cz>
5
6 */
7
13#ifndef NEKO_MENU_H
14#define NEKO_MENU_H
15
19struct neko_menu {
32 void (*draw_entry)(size_t index, gp_pixmap *pixmap, gp_pixel fg, gp_pixel bg,
33 gp_coord x, gp_coord y, gp_size w, gp_size h);
37 size_t items_cnt;
48 size_t item_sel;
54 unsigned int focused:1;
58 gp_size entry_h;
62 char *heading;
63};
64
73void neko_menu_repaint(struct neko_menu *menu, gp_pixmap *pixmap);
74
75#endif /* NEKO_MENU_H */
void neko_menu_repaint(struct neko_menu *menu, gp_pixmap *pixmap)
Repaints the menu.
A neko menu description.
Definition neko_menu.h:19
size_t item_sel
Currently selected item.
Definition neko_menu.h:48
unsigned int focused
I set the menu is focused.
Definition neko_menu.h:54
size_t items_cnt
Number of items in the menu.
Definition neko_menu.h:37
void(* draw_entry)(size_t index, gp_pixmap *pixmap, gp_pixel fg, gp_pixel bg, gp_coord x, gp_coord y, gp_size w, gp_size h)
Callback to draw a menu entry.
Definition neko_menu.h:32
size_t items_offset
Number of items to skip.
Definition neko_menu.h:44
char * heading
Menu heading.
Definition neko_menu.h:62
gp_size entry_h
The height for the menu entry redered by the draw entry callback.
Definition neko_menu.h:58