2 * Copyright (C) 2010 Igalia S.L
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #include "PlatformVideoWindow.h"
22 #if ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)
26 #ifdef GDK_WINDOWING_X11
27 #include <gdk/gdkx.h> // for GDK_WINDOW_XID
30 using namespace WebCore;
32 PlatformVideoWindow::PlatformVideoWindow()
34 m_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
35 gtk_widget_set_events(m_window, GDK_POINTER_MOTION_MASK | GDK_KEY_PRESS_MASK | GDK_FOCUS_CHANGE_MASK);
37 m_videoWindow = gtk_drawing_area_new();
38 gtk_widget_set_double_buffered(m_videoWindow, FALSE);
39 gtk_container_add(GTK_CONTAINER(m_window), m_videoWindow);
41 gtk_widget_realize(m_window);
43 #ifdef GDK_WINDOWING_X11
44 m_videoWindowId = GDK_WINDOW_XID(gtk_widget_get_window(m_window));
49 PlatformVideoWindow::~PlatformVideoWindow()
51 if (m_videoWindow && m_window) {
52 gtk_container_remove(GTK_CONTAINER(m_window), m_videoWindow);
53 gtk_widget_destroy(m_videoWindow);
58 gtk_widget_destroy(m_window);
65 void PlatformVideoWindow::prepareForOverlay(GstMessage*)
68 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)