GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_overlay.h
1//SPDX-License-Identifier: LGPL-2.0-or-later
2/*
3
4 Copyright (c) 2014-2020 Cyril Hrubis <metan@ucw.cz>
5
6 */
7
8#ifndef GP_WIDGET_OVERLAY_H
9#define GP_WIDGET_OVERLAY_H
10
11/*
12 * Overlay widget is a widget that allows widgets to be stack on the top of
13 * each other. The main use for this widget are all kinds of floating
14 * menus/dialogs etc.
15 */
16
17struct gp_widget_overlay_elem {
18 int hidden:1;
19 gp_widget *widget;
20};
21
22struct gp_widget_overlay {
23 int focused;
24 struct gp_widget_overlay_elem *stack;
25};
26
34gp_widget *gp_widget_overlay_new(unsigned int stack_size);
35
42void gp_widget_overlay_hide(gp_widget *self, unsigned int stack_pos);
43
50void gp_widget_overlay_show(gp_widget *self, unsigned int stack_pos);
51
58unsigned int gp_widget_overlay_stack_size(gp_widget *self);
59
68int gp_widget_overlay_stack_pos_by_child(gp_widget *self, gp_widget *child,
69 unsigned int *stack_pos);
70
81gp_widget *gp_widget_overlay_put(gp_widget *self, unsigned int stack_pos,
82 gp_widget *child);
83
84#endif /* GP_WIDGET_OVERLAY_H */