1 /*
2  * Copyright (C) 2019 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 Zrythm.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 /**
21  * \file
22  *
23  * Event viewer.
24  */
25 
26 #ifndef __GUI_WIDGETS_EVENT_VIEWER_H__
27 #define __GUI_WIDGETS_EVENT_VIEWER_H__
28 
29 #include <gtk/gtk.h>
30 
31 #define EVENT_VIEWER_WIDGET_TYPE \
32   (event_viewer_widget_get_type ())
33 G_DECLARE_FINAL_TYPE (
34   EventViewerWidget,
35   event_viewer_widget,
36   Z, EVENT_VIEWER_WIDGET,
37   GtkBox)
38 
39 typedef struct _ArrangerWidget ArrangerWidget;
40 
41 /**
42  * @addtogroup widgets
43  *
44  * @{
45  */
46 
47 #define MW_TIMELINE_EVENT_VIEWER \
48   MW_MAIN_NOTEBOOK->event_viewer
49 #define MW_EDITOR_EVENT_VIEWER \
50   MW_BOT_DOCK_EDGE->event_viewer
51 
52 typedef enum EventViewerType
53 {
54   EVENT_VIEWER_TYPE_TIMELINE,
55   EVENT_VIEWER_TYPE_EDITOR,
56 } EventViewerType;
57 
58 typedef struct _EventViewerWidget
59 {
60   GtkBox                 parent_instance;
61 
62   /** The tree view. */
63   GtkTreeModel *         model;
64   GtkTreeView *          treeview;
65 
66   /** Type. */
67   EventViewerType        type;
68 
69   /** Used by the editor EV to check if it should
70    * readd the columns. */
71   RegionType             region_type;
72 
73   /** Temporary flag. */
74   bool                   marking_selected_objs;
75 } EventViewerWidget;
76 
77 /**
78  * Called to update the models.
79  */
80 void
81 event_viewer_widget_refresh (
82   EventViewerWidget * self);
83 
84 /**
85  * Convenience function.
86  */
87 void
88 event_viewer_widget_refresh_for_selections (
89   ArrangerSelections * sel);
90 
91 /**
92  * Convenience function.
93  */
94 void
95 event_viewer_widget_refresh_for_arranger (
96   ArrangerWidget *    arranger);
97 
98 /**
99  * Sets up the event viewer.
100  */
101 void
102 event_viewer_widget_setup (
103   EventViewerWidget * self,
104   EventViewerType     type);
105 
106 /**
107  * @}
108  */
109 
110 #endif
111