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 Zrythm.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 /**
21  * @file
22  *
23  * Left dock.
24  */
25 
26 #ifndef __GUI_WIDGETS_LEFT_DOCK_EDGE_H__
27 #define __GUI_WIDGETS_LEFT_DOCK_EDGE_H__
28 
29 #include <gtk/gtk.h>
30 
31 typedef struct _InspectorWidget InspectorWidget;
32 typedef struct _VisibilityWidget VisibilityWidget;
33 typedef struct _FoldableNotebookWidget
34   FoldableNotebookWidget;
35 typedef struct _InspectorTrackWidget
36   InspectorTrackWidget;
37 typedef struct _InspectorPluginWidget
38   InspectorPluginWidget;
39 
40 /**
41  * @addtogroup widgets
42  *
43  * @{
44  */
45 
46 #define LEFT_DOCK_EDGE_WIDGET_TYPE \
47   (left_dock_edge_widget_get_type ())
48 G_DECLARE_FINAL_TYPE (
49   LeftDockEdgeWidget,
50   left_dock_edge_widget,
51   Z, LEFT_DOCK_EDGE_WIDGET,
52   GtkBox)
53 
54 #define MW_LEFT_DOCK_EDGE \
55   MW_CENTER_DOCK->left_dock_edge
56 
57 /**
58  * Left panel tabs.
59  */
60 typedef enum LeftDockEdgeTab
61 {
62   LEFT_DOCK_EDGE_TAB_TRACK,
63   LEFT_DOCK_EDGE_TAB_PLUGIN,
64   LEFT_DOCK_EDGE_TAB_VISIBILITY,
65   LEFT_DOCK_EDGE_TAB_CC_BINDINGS,
66   LEFT_DOCK_EDGE_TAB_PORT_CONNECTIONS,
67 } LeftDockEdgeTab;
68 
69 /**
70  * Left dock widget.
71  */
72 typedef struct _LeftDockEdgeWidget
73 {
74   GtkBox                  parent_instance;
75   FoldableNotebookWidget * inspector_notebook;
76 
77   /** Track visibility. */
78   GtkBox *                visibility_box;
79   VisibilityWidget *      visibility;
80 
81   /** For TracklistSelections. */
82   GtkScrolledWindow *     track_inspector_scroll;
83   InspectorTrackWidget *  track_inspector;
84 
85   /** For MixerSelections. */
86   GtkScrolledWindow *     plugin_inspector_scroll;
87   InspectorPluginWidget * plugin_inspector;
88 
89   /** Mouse button press handler. */
90   GtkGestureMultiPress *  mp;
91 } LeftDockEdgeWidget;
92 
93 void
94 left_dock_edge_widget_refresh (
95   LeftDockEdgeWidget * self);
96 
97 /**
98  * Refreshes the widget and switches to the given
99  * page.
100  */
101 void
102 left_dock_edge_widget_refresh_with_page (
103   LeftDockEdgeWidget * self,
104   LeftDockEdgeTab      page);
105 
106 void
107 left_dock_edge_widget_setup (
108   LeftDockEdgeWidget * self);
109 
110 /**
111  * Prepare for finalization.
112  */
113 void
114 left_dock_edge_widget_tear_down (
115   LeftDockEdgeWidget * self);
116 
117 /**
118  * @}
119  */
120 
121 #endif
122