1 /*
2  * Copyright (C) 2002 2003 2004 2005 2006 2011 2012, Magnus Hjorth
3  *
4  * This file is part of mhWaveEdit.
5  *
6  * mhWaveEdit is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * mhWaveEdit 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 General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mhWaveEdit; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 
22 #ifndef MAINWINDOW_H_INCLUDED
23 #define MAINWINDOW_H_INCLUDED
24 
25 #include <gtk/gtk.h>
26 #include "chunkview.h"
27 #include "statusbar.h"
28 #include "listobject.h"
29 
30 #define MAINWINDOW(obj) GTK_CHECK_CAST(obj,mainwindow_get_type(),Mainwindow)
31 #define MAINWINDOW_CLASS(class) GTK_CHECK_CLASS_CAST(class,mainwindow_get_type(),MainwindowClass)
32 #define IS_MAINWINDOW(obj) GTK_CHECK_TYPE(obj,mainwindow_get_type())
33 
34 #define MAINWINDOW_RECENT_MAX 20
35 #define MAINWINDOW_SCROLL_DELTA_RATIO 4
36 #define MAINWINDOW_NUDGE_DELTA_RATIO 8
37 
38 typedef struct _Mainwindow {
39      GtkWindow window;
40 
41      ChunkView *view;
42      GtkAdjustment *view_adj,*zoom_adj,*vertical_zoom_adj,*speed_adj;
43      StatusBar *statusbar;
44 
45      gboolean sensitive;
46      GtkWidget *menubar,*toolbar;
47 
48      GtkWidget *vzoom_icon,*vzoom_slider,*hzoom_icon,*hzoom_slider;
49      GtkWidget *speed_icon,*speed_slider;
50      GtkLabel *vzoom_label, *speed_label;
51      gboolean show_labels;
52      gboolean esc_pressed_flag;
53 
54      GList *need_chunk_items;
55      GList *need_selection_items;
56      GList *need_clipboard_items;
57      GList *need_undo_items, *need_redo_items;
58      GList *zoom_items;
59 
60      Document *doc;
61 
62      gboolean loopmode,bouncemode;
63      gboolean followmode;
64      GtkWidget *recent_sep; /* Separator that should be hidden if there
65 			     * aren't any recent files */
66      GList *recent; /* List of menu items with recent files */
67 } Mainwindow;
68 
69 typedef struct _MainwindowClass {
70      GtkWindowClass parent;
71 } MainwindowClass;
72 
73 extern ListObject *mainwindow_objects;
74 
75 extern gboolean autoplay_mark_flag, varispeed_reset_flag;
76 
77 GtkType mainwindow_get_type(void);
78 GtkWidget *mainwindow_new();
79 GtkWidget *mainwindow_new_with_file(char *filename, gboolean log);
80 
81 gboolean mainwindow_update_caches(void);
82 
83 void mainwindow_update_texts(void);
84 void mainwindow_repaint_views(void);
85 void mainwindow_set_sensitive(Mainwindow *mw, gboolean sensitive);
86 void mainwindow_set_all_sensitive(gboolean active);
87 void mainwindow_set_speed_sensitive(gboolean s);
88 
89 Mainwindow *mainwindow_playing_window(void);
90 
91 #endif
92