summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-12 16:55:12 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-19 14:54:59 +0000
commit05eccaef907c9fca4f874b8ffa608d4815fbeebd (patch)
tree940b846007d1f5d1e683d9e9cc6c9e23939dd7b7 /vcl/unx/generic
parent4b0390a9cb45f56a7c6d04eff795de8b63b13b2e (diff)
gtk3+wayland: implement video playback under gtk3 + wayland
split the gtk2 and gtk3 gtkobjects (cherry picked from commit 31fa4545985acc1594107e087cedc2d99b3d0f0b) Change-Id: I32084232c44a12e9641010b51e75710abc827695 rename X11WindowProvider to a NativeWindowHandle provider sort of thing and genericize it (cherry picked from commit e35e762d564da18b0b508112f3e4d78fd26ba99c) Change-Id: I27e1e47f2b371e5269db079cfc1262d056105f80 implement wayland handle passing for gstreamer Change-Id: I3b0effe35ad7b37ff7ab3de2a3b78b6312779139 (cherry picked from commit c0d4f3ad3307c7a0d0fddd8c413ef0cc91d382ae) gtk3+wayland: play video via gtksink gstreamer element (cherry picked from commit 8543fbc72fafc0d71a8760752ca2ef5b7119cb5c) Change-Id: Ib371fa06eda73962cbe94739e69a68b46c26e4bf Reviewed-on: https://gerrit.libreoffice.org/22462 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/app/saldata.cxx56
-rw-r--r--vcl/unx/generic/gdi/nativewindowhandleprovider.cxx17
-rw-r--r--vcl/unx/generic/gdi/salgdi.cxx2
-rw-r--r--vcl/unx/generic/gdi/x11windowprovider.cxx72
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
5 files changed, 74 insertions, 75 deletions
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index 3f9d184a5566..92f4679ae793 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -48,7 +48,9 @@
#include "unx/sm.hxx"
#include "unx/i18n_im.hxx"
#include "unx/i18n_xkb.hxx"
-#include "unx/x11/x11display.hxx"
+#include <prex.h>
+#include <X11/Xproto.h>
+#include <postx.h>
#include "salinst.hxx"
#include <osl/signal.h>
@@ -374,6 +376,58 @@ SalXLib::~SalXLib()
close (m_pTimeoutFDS[1]);
}
+static Display *OpenX11Display(OString& rDisplay)
+{
+ /*
+ * open connection to X11 Display
+ * try in this order:
+ * o -display command line parameter,
+ * o $DISPLAY environment variable
+ * o default display
+ */
+
+ Display *pDisp = nullptr;
+
+ // is there a -display command line parameter?
+
+ sal_uInt32 nParams = osl_getCommandArgCount();
+ OUString aParam;
+ for (sal_uInt32 i=0; i<nParams; i++)
+ {
+ osl_getCommandArg(i, &aParam.pData);
+ if ( aParam == "-display" )
+ {
+ osl_getCommandArg(i+1, &aParam.pData);
+ rDisplay = OUStringToOString(
+ aParam, osl_getThreadTextEncoding());
+
+ if ((pDisp = XOpenDisplay(rDisplay.getStr()))!=nullptr)
+ {
+ /*
+ * if a -display switch was used, we need
+ * to set the environment accordingly since
+ * the clipboard build another connection
+ * to the xserver using $DISPLAY
+ */
+ OUString envVar("DISPLAY");
+ osl_setEnvironment(envVar.pData, aParam.pData);
+ }
+ break;
+ }
+ }
+
+ if (!pDisp && rDisplay.isEmpty())
+ {
+ // Open $DISPLAY or default...
+ char *pDisplay = getenv("DISPLAY");
+ if (pDisplay != nullptr)
+ rDisplay = OString(pDisplay);
+ pDisp = XOpenDisplay(pDisplay);
+ }
+
+ return pDisp;
+}
+
void SalXLib::Init()
{
SalI18N_InputMethod* pInputMethod = new SalI18N_InputMethod;
diff --git a/vcl/unx/generic/gdi/nativewindowhandleprovider.cxx b/vcl/unx/generic/gdi/nativewindowhandleprovider.cxx
new file mode 100644
index 000000000000..3afd26e31498
--- /dev/null
+++ b/vcl/unx/generic/gdi/nativewindowhandleprovider.cxx
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "unx/nativewindowhandleprovider.hxx"
+
+NativeWindowHandleProvider::~NativeWindowHandleProvider()
+{
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 738d59bf769c..f5ffead4beeb 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -53,7 +53,7 @@
#include <unx/x11/xlimits.hxx>
#include "salgdiimpl.hxx"
-#include "unx/x11windowprovider.hxx"
+#include "unx/nativewindowhandleprovider.hxx"
#include "textrender.hxx"
#include "gdiimpl.hxx"
#include "opengl/x11/gdiimpl.hxx"
diff --git a/vcl/unx/generic/gdi/x11windowprovider.cxx b/vcl/unx/generic/gdi/x11windowprovider.cxx
deleted file mode 100644
index 5f7d289196ec..000000000000
--- a/vcl/unx/generic/gdi/x11windowprovider.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <vcl/svapp.hxx>
-
-#include "unx/x11windowprovider.hxx"
-#include "unx/x11/x11display.hxx"
-
-X11WindowProvider::~X11WindowProvider()
-{
-}
-
-Display *OpenX11Display(OString& rDisplay)
-{
- /*
- * open connection to X11 Display
- * try in this order:
- * o -display command line parameter,
- * o $DISPLAY environment variable
- * o default display
- */
-
- Display *pDisp = nullptr;
-
- // is there a -display command line parameter?
-
- sal_uInt32 nParams = osl_getCommandArgCount();
- OUString aParam;
- for (sal_uInt32 i=0; i<nParams; i++)
- {
- osl_getCommandArg(i, &aParam.pData);
- if ( aParam == "-display" )
- {
- osl_getCommandArg(i+1, &aParam.pData);
- rDisplay = OUStringToOString(
- aParam, osl_getThreadTextEncoding());
-
- if ((pDisp = XOpenDisplay(rDisplay.getStr()))!=nullptr)
- {
- /*
- * if a -display switch was used, we need
- * to set the environment accoringly since
- * the clipboard build another connection
- * to the xserver using $DISPLAY
- */
- OUString envVar("DISPLAY");
- osl_setEnvironment(envVar.pData, aParam.pData);
- }
- break;
- }
- }
-
- if (!pDisp && rDisplay.isEmpty())
- {
- // Open $DISPLAY or default...
- char *pDisplay = getenv("DISPLAY");
- if (pDisplay != nullptr)
- rDisplay = OString(pDisplay);
- pDisp = XOpenDisplay(pDisplay);
- }
-
- return pDisp;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index c0e3e75e36ec..63f7c9d68cd2 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -4133,7 +4133,7 @@ void X11SalFrame::EndSetClipRegion()
}
-Window X11SalFrame::GetX11Window()
+sal_uIntPtr X11SalFrame::GetNativeWindowHandle()
{
return mhWindow;
}