1 /*
2  * Copyright (C) 2019-2020 Alexandros Theodotou <alex at zrythm dot org>
3  *
4  * This file is part of Zrythm
5  *
6  * Zrythm is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Affero General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Zrythm is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Affero General Public License for more details.
15  *
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __GUI_WIDGETS_SNAP_GRID_H__
21 #define __GUI_WIDGETS_SNAP_GRID_H__
22 
23 #include <gtk/gtk.h>
24 
25 #define SNAP_GRID_WIDGET_TYPE \
26   (snap_grid_widget_get_type ())
27 G_DECLARE_FINAL_TYPE (
28   SnapGridWidget, snap_grid_widget,
29   Z, SNAP_GRID_WIDGET,
30   GtkMenuButton)
31 
32 typedef struct _SnapGridPopoverWidget
33   SnapGridPopoverWidget;
34 typedef struct SnapGrid SnapGrid;
35 
36 typedef struct _SnapGridWidget
37 {
38   GtkMenuButton      parent_instance;
39 
40   /** The box. */
41   GtkBox *           box;
42 
43   /** Image to show next to the label. */
44   GtkImage *         img;
45 
46   /** Label to show. */
47   GtkLabel *         label;
48 
49   /** Popover. */
50   SnapGridPopoverWidget * popover;
51 
52   /** Popover content holder. */
53   GtkBox *           content;
54 
55   /** Associated snap grid options. */
56   SnapGrid *         snap_grid;
57 } SnapGridWidget;
58 
59 void
60 snap_grid_widget_setup (
61   SnapGridWidget * self,
62   SnapGrid * snap_grid);
63 
64 void
65 snap_grid_widget_refresh (
66   SnapGridWidget * self);
67 
68 #endif
69