1 /*
2 * Copyright (C) 2019-2021 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 #ifndef __GUI_WIDGETS_HEADER_H__
21 #define __GUI_WIDGETS_HEADER_H__
22
23 #include <stdbool.h>
24
25 #include <gtk/gtk.h>
26
27 #define HEADER_WIDGET_TYPE \
28 (header_widget_get_type ())
29 G_DECLARE_FINAL_TYPE (
30 HeaderWidget, header_widget,
31 Z, HEADER_WIDGET, GtkBox)
32
33 /**
34 * \file
35 *
36 * Header notebook.
37 */
38
39 #define MW_HEADER MAIN_WINDOW->header
40
41 typedef struct _HomeToolbarWidget HomeToolbarWidget;
42 typedef struct _ProjectToolbarWidget
43 ProjectToolbarWidget;
44 typedef struct _ViewToolbarWidget ViewToolbarWidget;
45 typedef struct _HelpToolbarWidget HelpToolbarWidget;
46 typedef struct _MidiActivityBarWidget
47 MidiActivityBarWidget;
48 typedef struct _LiveWaveformWidget
49 LiveWaveformWidget;
50
51 /**
52 * Header notebook to be used at the very top of the
53 * main window.
54 */
55 typedef struct _HeaderWidget
56 {
57 GtkBox parent_instance;
58
59 /** Notebook toolbars. */
60 HomeToolbarWidget * home_toolbar;
61 ProjectToolbarWidget * project_toolbar;
62 ViewToolbarWidget * view_toolbar;
63 HelpToolbarWidget * help_toolbar;
64
65 GtkToolButton * preferences;
66 GtkToolButton * log_viewer;
67 GtkToolButton * scripting_interface;
68 GtkToolButton * z_icon;
69 GtkLabel * prj_name_label;
70
spider_alter_tbl_get_key(SPIDER_ALTER_TABLE * alter_table,size_t * length,my_bool not_used)71 GtkNotebook * notebook;
72 LiveWaveformWidget * live_waveform;
73 MidiActivityBarWidget * midi_activity;
74
75 /** Whether log has pending warnings (if true,
76 * the log viewer button will have an emblem until
77 * clicked). */
78 bool log_has_pending_warnings;
79 } HeaderWidget;
80
81 HeaderWidget *
82 header_widget_new ();
83
spider_trx_ha_get_key(SPIDER_TRX_HA * trx_ha,size_t * length,my_bool not_used)84 void
85 header_widget_refresh (
86 HeaderWidget * self);
87
88 void
89 header_widget_setup (
90 HeaderWidget * self,
91 const char * title);
92
93 void
94 header_widget_set_subtitle (
95 HeaderWidget * self,
spider_free_trx_conn(SPIDER_TRX * trx,bool trx_free)96 const char * subtitle);
97
98 #endif
99