24#include <bitmaps.hlst>
43#include <com/sun/star/awt/SystemPointer.hpp>
44#include <com/sun/star/lang/XComponent.hpp>
45#include <com/sun/star/media/XManager.hpp>
46#include <com/sun/star/uno/XComponentContext.hpp>
124 , DropTargetHelper(this)
125 , DragSourceHelper(this)
126 , mpMediaWindow(pMediaWindow)
155 uno::Reference< lang::XComponent > xComponent(
mxPlayer, uno::UNO_QUERY );
157 xComponent->dispose();
173 uno::Reference<media::XPlayer> xPlayer;
186 uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
188 xPlayer =
createPlayer(rURL,
"com.sun.star.comp.avmedia.Manager_Gtk", xContext);
197 const OUString& rURL,
const OUString& rManagerServName,
198 const uno::Reference< uno::XComponentContext >& xContext)
200 uno::Reference< media::XPlayer > xPlayer;
203 uno::Reference< media::XManager > xManager (
204 xContext->getServiceManager()->createInstanceWithContext(rManagerServName, xContext),
207 xPlayer = xManager->createPlayer( rURL );
209 SAL_INFO(
"avmedia",
"failed to create media player service " << rManagerServName );
210 }
catch (
const uno::Exception & )
218 OUString
const& rTempURL, OUString
const& rReferer)
236 if (!rTempURL.isEmpty())
245 if (
aURL.GetProtocol() != INetProtocol::NotValid)
271 awt::Size aPrefSize(
mxPlayer->getPreferredPlayerWindowSize() );
414 uno::Reference<media::XPlayerWindow> xPlayerWindow;
418 sal_IntPtr nParentWindowHandle(0);
422 nParentWindowHandle =
mpChildWindow->GetParentWindowHandle();
423 uno::Sequence<uno::Any> aArgs{
433 xPlayerWindow =
mxPlayer->createPlayerWindow( aArgs );
435 catch(
const uno::RuntimeException& )
442 if( xPlayerWindow.is() )
444 xPlayerWindow->addKeyListener( uno::Reference< awt::XKeyListener >(
mxEvents ) );
445 xPlayerWindow->addMouseListener( uno::Reference< awt::XMouseListener >(
mxEvents ) );
446 xPlayerWindow->addMouseMotionListener( uno::Reference< awt::XMouseMotionListener >(
mxEvents ) );
447 xPlayerWindow->addFocusListener( uno::Reference< awt::XFocusListener >(
mxEvents ) );
486 case PointerStyle::Cross:
487 nPointer = awt::SystemPointer::CROSS;
489 case PointerStyle::Hand:
490 nPointer = awt::SystemPointer::HAND;
492 case PointerStyle::Move:
493 nPointer = awt::SystemPointer::MOVE;
495 case PointerStyle::Wait:
496 nPointer = awt::SystemPointer::WAIT;
499 nPointer = awt::SystemPointer::ARROW;
511 Size aPlayerWindowSize(aCurSize.
Width() - (nOffset << 1),
512 aCurSize.
Height() - (nOffset << 1));
517 const sal_Int32 nControlY = std::max(aCurSize.
Height() - nControlHeight - nOffset,
tools::Long(0));
519 aPlayerWindowSize.
setHeight( nControlY - (nOffset << 1) );
537 case StateChangedType::Visible:
544 case StateChangedType::Enable:
588 const Color aBackgroundColor(67, 67, 67);
592 rRenderContext.
DrawRect(aVideoRect);
597 const double fLogoWH = double(aLogoSize.
Width()) / aLogoSize.
Height();
static OUString GetToolkitName()
const Size & GetSizePixel() const
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
void * GetEventData() const
bool IsMouseEvent() const
virtual void dispose() override
MouseEventModifiers GetMode() const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
void DrawRect(const tools::Rectangle &rRect)
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
Point OutputToScreenPixel(const Point &rPos) const
vcl::Window * GetParent() const
virtual void Command(const CommandEvent &rCEvt)
virtual void MouseButtonDown(const MouseEvent &rMEvt)
virtual void MouseButtonUp(const MouseEvent &rMEvt)
virtual void KeyInput(const KeyEvent &rKEvt)
virtual void MouseMove(const MouseEvent &rMEvt)
Size GetOutputSizePixel() const
virtual void SetPointer(PointerStyle)
virtual void KeyUp(const KeyEvent &rKEvt)
Point ScreenToOutputPixel(const Point &rPos) const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral HID_AVMEDIA_PLAYERWINDOW
#define SAL_INFO(area, stream)
bool isUntrustedReferer(OUString const &referer)
WinBits const WB_CLIPCHILDREN