1 /*
2  *  This file is part of GNOME Twitch - 'Enjoy Twitch on your GNU/Linux desktop'
3  *  Copyright © 2017 Vincent Szolnoky <vinszent@vinszent.com>
4  *
5  *  GNOME Twitch is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  GNOME Twitch is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with GNOME Twitch. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef GT_WIN_H
20 #define GT_WIN_H
21 
22 #include <gtk/gtk.h>
23 #include "gt-app.h"
24 #include "gt-channel.h"
25 #include "gt-vod.h"
26 #include "gt-player.h"
27 
28 #define GT_WIN_TOPLEVEL(w) GT_WIN(gtk_widget_get_ancestor(GTK_WIDGET(w), GTK_TYPE_WINDOW))
29 #define GT_WIN_ACTIVE GT_WIN(gtk_application_get_active_window(GTK_APPLICATION(main_app)))
30 
31 G_BEGIN_DECLS
32 
33 #define GT_TYPE_WIN (gt_win_get_type())
34 
35 G_DECLARE_FINAL_TYPE(GtWin, gt_win, GT, WIN, GtkApplicationWindow)
36 
37 struct _GtWin
38 {
39     GtkApplicationWindow parent_instance;
40 
41     GtPlayer* player;
42     GtChannel* open_channel;
43 };
44 
45 GtWin* gt_win_new(GtApp* app);
46 void gt_win_open_channel(GtWin* self, GtChannel* chan);
47 void gt_win_play_vod(GtWin* self, GtVOD* vod);
48 gboolean gt_win_is_fullscreen(GtWin* self);
49 void gt_win_toggle_fullscreen(GtWin* self);
50 void gt_win_show_info_message(GtWin* self, const gchar* msg_fmt, ...);
51 void gt_win_show_error_message(GtWin* self, const gchar* secondary, const gchar* details_fmt, ...);
52 void gt_win_show_error_dialogue(GtWin* self, const gchar* secondary, const gchar* details_fmt, ...);
53 void gt_win_ask_question(GtWin* self, const gchar* msg, GCallback cb, gpointer udata);
54 void gt_win_inhibit_screensaver(GtWin* self);
55 void gt_win_uninhibit_screensaver(GtWin* self);
56 
57 G_END_DECLS
58 
59 #endif
60