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 * Timeline panel. 24 */ 25 26 #ifndef __GUI_WIDGETS_TIMELINE_PANEL_H__ 27 #define __GUI_WIDGETS_TIMELINE_PANEL_H__ 28 29 #include "gui/widgets/timeline_selection_info.h" 30 31 #include <gtk/gtk.h> 32 33 #define TIMELINE_PANEL_WIDGET_TYPE \ 34 (timeline_panel_widget_get_type ()) 35 G_DECLARE_FINAL_TYPE ( 36 TimelinePanelWidget, 37 timeline_panel_widget, 38 Z, TIMELINE_PANEL_WIDGET, 39 GtkBox) 40 41 typedef struct _RulerWidget RulerWidget; 42 typedef struct _TracklistWidget TracklistWidget; 43 typedef struct _TimelinePanelBotBoxWidget 44 TimelinePanelBotBoxWidget; 45 typedef struct _TracklistHeaderWidget 46 TracklistHeaderWidget; 47 typedef struct _TimelineToolbarWidget 48 TimelineToolbarWidget; 49 typedef struct _TimelineBotBoxWidget 50 TimelineBotBoxWidget; 51 52 /** 53 * @addtogroup widgets 54 * 55 * @{ 56 */ 57 58 #define MW_TIMELINE_PANEL \ 59 (MW_MAIN_NOTEBOOK->timeline_panel) 60 61 #define MW_TRACKLIST_SCROLL \ 62 (MW_TIMELINE_PANEL->tracklist_scroll) 63 64 typedef struct _TimelinePanelWidget 65 { 66 GtkBox parent_instance; 67 68 GtkPaned * tracklist_timeline; 69 GtkBox * tracklist_top; 70 TracklistHeaderWidget * tracklist_header; 71 TracklistWidget * tracklist; 72 73 /** Box for the timelines and the ruler. */ 74 GtkBox * timelines_plus_ruler; 75 76 /** Scroll for ruler holding the viewport. */ 77 GtkScrolledWindow * ruler_scroll; 78 79 /** Viewport for ruler holding the ruler. */ 80 GtkViewport * ruler_viewport; 81 82 /** Ruler. */ 83 RulerWidget * ruler; 84 85 /** The paned dividing the pinned and unpinned 86 * timelines. */ 87 GtkBox * timeline_divider_box; 88 89 GtkScrolledWindow * timeline_scroll; 90 GtkViewport * timeline_viewport; 91 92 /** The main timeline. */ 93 ArrangerWidget * timeline; 94 95 TimelineToolbarWidget * timeline_toolbar; 96 97 GtkScrolledWindow * pinned_timeline_scroll; 98 GtkViewport * pinned_timeline_viewport; 99 100 /** The pinned timeline above the main one. */ 101 ArrangerWidget * pinned_timeline; 102 103 TimelineBotBoxWidget * bot_box; 104 105 /** Size group for keeping the whole ruler and 106 * each timeline the same width. */ 107 GtkSizeGroup * timeline_ruler_h_size_group; 108 } TimelinePanelWidget; 109 110 void 111 timeline_panel_widget_setup ( 112 TimelinePanelWidget * self); 113 114 /** 115 * Prepare for finalization. 116 */ 117 void 118 timeline_panel_widget_tear_down ( 119 TimelinePanelWidget * self); 120 121 /** 122 * @} 123 */ 124 125 #endif 126