Stepan Salenikovich | 36c025c | 2015-03-03 19:06:44 -0500 | [diff] [blame] | 1 | /* |
Guillaume Roguez | 2a6150d | 2017-07-19 18:24:47 -0400 | [diff] [blame] | 2 | * Copyright (C) 2015-2017 Savoir-faire Linux Inc. |
Stepan Salenikovich | 36c025c | 2015-03-03 19:06:44 -0500 | [diff] [blame] | 3 | * 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 Salenikovich | 36c025c | 2015-03-03 19:06:44 -0500 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef __VIDEO_WIDGET_H__ |
| 21 | #define __VIDEO_WIDGET_H__ |
| 22 | |
| 23 | #include <gtk/gtk.h> |
| 24 | #include <video/renderer.h> |
| 25 | |
Julien Grossholtz | a0d4f10 | 2015-10-22 14:24:17 -0400 | [diff] [blame] | 26 | class Call; |
| 27 | |
Stepan Salenikovich | 36c025c | 2015-03-03 19:06:44 -0500 | [diff] [blame] | 28 | G_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 | |
| 36 | typedef struct _VideoWidgetClass VideoWidgetClass; |
| 37 | typedef struct _VideoWidget VideoWidget; |
Stepan Salenikovich | c5f0815 | 2015-03-19 00:53:23 -0400 | [diff] [blame] | 38 | |
| 39 | typedef enum { |
| 40 | VIDEO_RENDERER_REMOTE, |
| 41 | VIDEO_RENDERER_LOCAL, |
| 42 | VIDEO_RENDERER_COUNT |
| 43 | } VideoRendererType; |
| 44 | |
Stepan Salenikovich | 36c025c | 2015-03-03 19:06:44 -0500 | [diff] [blame] | 45 | /* Public interface */ |
Stepan Salenikovich | 0f69323 | 2015-04-22 10:45:08 -0400 | [diff] [blame] | 46 | GType video_widget_get_type (void) G_GNUC_CONST; |
| 47 | GtkWidget* video_widget_new (void); |
| 48 | void video_widget_push_new_renderer (VideoWidget *, Video::Renderer *, VideoRendererType); |
Stepan Salenikovich | b94873c | 2015-06-02 16:53:18 -0400 | [diff] [blame] | 49 | void video_widget_pause_rendering (VideoWidget *self, gboolean pause); |
Julien Grossholtz | a0d4f10 | 2015-10-22 14:24:17 -0400 | [diff] [blame] | 50 | void 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 Salenikovich | 39df737 | 2016-10-11 16:07:40 -0400 | [diff] [blame] | 58 | gboolean video_widget_on_button_press_in_screen_event (VideoWidget *self, |
Julien Grossholtz | a0d4f10 | 2015-10-22 14:24:17 -0400 | [diff] [blame] | 59 | GdkEventButton *event, |
| 60 | Call* call); |
Nicolas Jager | 4bb2954 | 2016-05-12 10:21:47 -0400 | [diff] [blame] | 61 | void video_widget_take_snapshot (VideoWidget *self); |
| 62 | GdkPixbuf* video_widget_get_snapshot (VideoWidget *self); |
Stepan Salenikovich | 3bcb0b2 | 2015-04-21 18:44:55 -0400 | [diff] [blame] | 63 | |
Stepan Salenikovich | 36c025c | 2015-03-03 19:06:44 -0500 | [diff] [blame] | 64 | G_END_DECLS |
| 65 | |
| 66 | #endif /* __VIDEO_WIDGET_H__ */ |