blob: e5bc94528ec20dad9e67704635dfdba5fb0db6a2 [file] [log] [blame]
Stepan Salenikovich36c025c2015-03-03 19:06:44 -05001/*
Guillaume Roguez2a6150d2017-07-19 18:24:47 -04002 * Copyright (C) 2015-2017 Savoir-faire Linux Inc.
Stepan Salenikovich36c025c2015-03-03 19:06:44 -05003 * Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
4 *
5 * This program 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 * This program 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 this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Stepan Salenikovich36c025c2015-03-03 19:06:44 -050018 */
19
20#ifndef __VIDEO_WIDGET_H__
21#define __VIDEO_WIDGET_H__
22
23#include <gtk/gtk.h>
24#include <video/renderer.h>
25
Julien Grossholtza0d4f102015-10-22 14:24:17 -040026class Call;
27
Stepan Salenikovich36c025c2015-03-03 19:06:44 -050028G_BEGIN_DECLS
29
30#define VIDEO_WIDGET_TYPE (video_widget_get_type())
31#define VIDEO_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VIDEO_WIDGET_TYPE, VideoWidget))
32#define VIDEO_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), VIDEO_WIDGET_TYPE, VideoWidgetClass))
33#define IS_VIDEO_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIDEO_WIDGET_TYPE))
34#define IS_VIDEO_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), VIDEO_WIDGET_TYPE))
35
36typedef struct _VideoWidgetClass VideoWidgetClass;
37typedef struct _VideoWidget VideoWidget;
Stepan Salenikovichc5f08152015-03-19 00:53:23 -040038
39typedef enum {
40 VIDEO_RENDERER_REMOTE,
41 VIDEO_RENDERER_LOCAL,
42 VIDEO_RENDERER_COUNT
43} VideoRendererType;
44
Stepan Salenikovich36c025c2015-03-03 19:06:44 -050045/* Public interface */
Stepan Salenikovich0f693232015-04-22 10:45:08 -040046GType video_widget_get_type (void) G_GNUC_CONST;
47GtkWidget* video_widget_new (void);
48void video_widget_push_new_renderer (VideoWidget *, Video::Renderer *, VideoRendererType);
Stepan Salenikovichb94873c2015-06-02 16:53:18 -040049void video_widget_pause_rendering (VideoWidget *self, gboolean pause);
Julien Grossholtza0d4f102015-10-22 14:24:17 -040050void video_widget_on_drag_data_received (GtkWidget *self,
51 GdkDragContext *context,
52 gint x,
53 gint y,
54 GtkSelectionData *selection_data,
55 guint info,
56 guint32 time,
57 Call* call);
Stepan Salenikovich39df7372016-10-11 16:07:40 -040058gboolean video_widget_on_button_press_in_screen_event (VideoWidget *self,
Julien Grossholtza0d4f102015-10-22 14:24:17 -040059 GdkEventButton *event,
60 Call* call);
Nicolas Jager4bb29542016-05-12 10:21:47 -040061void video_widget_take_snapshot (VideoWidget *self);
62GdkPixbuf* video_widget_get_snapshot (VideoWidget *self);
Stepan Salenikovich3bcb0b22015-04-21 18:44:55 -040063
Stepan Salenikovich36c025c2015-03-03 19:06:44 -050064G_END_DECLS
65
66#endif /* __VIDEO_WIDGET_H__ */