[API CHANGE] Drop css::drawing::XPresenterHelper

As the interface's documentation says:

    /** This interface is a collection of functions that were necessary to
        implement larger parts of the presenter screen as extension.  The
        methods of this interface give access to services that could only be
        implemented in the Office core, not in an extension.

        <p>As the presenter screen is no extension any more, this hack can go again;
        it just needs clean-up.</p>
    */
    interface XPresenterHelper

Now that all uses of the interface have been replaced
by using the concrete sd::presenter::PresenterHelper
class directly in previous commits (see the
`git log --grep="sd presenter"` output), drop the interface.

Take over method documentation to PresenterHelper.

Now that PresenterHelper no subclasses XPresenterHelper,
further cleanup/simplification is possible in upcoming commits.

Change-Id: Ie7bdad151d28762af1710db896bfaa1026dae65f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182259
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2025-02-26 17:17:42 +01:00
parent 907b39ef3e
commit a80dec4e7b
6 changed files with 101 additions and 186 deletions

View File

@@ -2378,7 +2378,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing,\
XLayerSupplier \
XMasterPageTarget \
XMasterPagesSupplier \
XPresenterHelper \
XSelectionFunction \
XShape \
XShapeAligner \

View File

@@ -1,147 +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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
module com { module sun { module star { module drawing {
/** This interface is a collection of functions that were necessary to
implement larger parts of the presenter screen as extension. The
methods of this interface give access to services that could only be
implemented in the Office core, not in an extension.
<p>As the presenter screen is no extension any more, this hack can go again;
it just needs clean-up.</p>
*/
interface XPresenterHelper
{
/** Create a new window as child window of the given parent window.
@param xParentWindow
The parent window of the new window.
@param bCreateSystemChildWindow
When `TRUE` then the new window will be a system window that,
in the context of the presenter screen, can not be painted over
by other windows that lie behind it.
@param bInitiallyVisible
When `TRUE` the new window will be visible from the start,
i.e. a window listener will not receive a windowShown signal.
@param bEnableChildTransparentMode
When `TRUE` the parent window is painted behind its child
windows. This is one half of allowing child windows to be
transparent.
@param bEnableParentClip
When `TRUE` then the parent window is not clipped where its
child windows are painted. This is the other half of allowing
child windows to be transparent.
*/
::com::sun::star::awt::XWindow createWindow (
[in] ::com::sun::star::awt::XWindow xParentWindow,
[in] boolean bCreateSystemChildWindow,
[in] boolean bInitiallyVisible,
[in] boolean bEnableChildTransparentMode,
[in] boolean bEnableParentClip);
/** Create a new canvas for the given window. The new canvas is a
wrapper around the given shared canvas. The wrapper only modifies
the origin in all output and clipping methods.
@param xUpdateCanvas
This canvas is used to call updateScreen() on. May be `NULL`
@param xUpdateWindow
The window that belongs to the update canvas. May also be
`NULL` (is expected to b `NULL` whenever xUpdateCanvas is.)
@param xSharedCanvas
The canvas that is shared by the wrapper.
@param xSharedWindow
The window of the shared canvas. This is used to determine the
proper offset.
@param xWindow
The canvas is created for this window. Must not be `NULL`
*/
::com::sun::star::rendering::XCanvas createSharedCanvas (
[in] ::com::sun::star::rendering::XSpriteCanvas xUpdateCanvas,
[in] ::com::sun::star::awt::XWindow xUpdateWindow,
[in] ::com::sun::star::rendering::XCanvas xSharedCanvas,
[in] ::com::sun::star::awt::XWindow xSharedWindow,
[in] ::com::sun::star::awt::XWindow xWindow);
/** Create a new canvas for the given window.
@param xWindow
The canvas is created for this window. Must not be `NULL`
@param nRequestedCanvasFeatureList
List of requested features that the new canvas should (has to)
provide. Use only values from the CanvasFeature
constants group.
@param sOptionalCanvasServiceName
When an explicit service name is given then a new object of this
service is created. This service name lets the caller select a
specific canvas implementation, e.g. with or without hardware
acceleration.
*/
::com::sun::star::rendering::XCanvas createCanvas (
[in] ::com::sun::star::awt::XWindow xWindow,
[in] short nRequestedCanvasFeatureList,
[in] string sOptionalCanvasServiceName);
/** Move the specified window to the top of its stacking order. As a
result the window will be painted over all its overlapping
siblings.
@param xWindow
This window will be moved to the top of its stacking order.
*/
void toTop (
[in] ::com::sun::star::awt::XWindow xWindow);
/** Load a bitmap with a given ID.
@param id
The ID of the bitmap.
@param xCanvas
The bitmap is created to be compatible, and possibly optimized,
for this canvas.
*/
::com::sun::star::rendering::XBitmap loadBitmap (
[in] string id,
[in] ::com::sun::star::rendering::XCanvas xCanvas);
/** Capture the mouse so that no other window will receive mouse events.
Note that this is a potentially dangerous method. Not calling
releaseMouse eventually can lead to an unresponsive application.
@param xWindow
The window for which mouse events will be notified even when the
mouse pointer moves outside the window or over other windows.
*/
void captureMouse (
[in] ::com::sun::star::awt::XWindow xWindow);
/** Release a previously captured mouse.
@param xWindow
The window from which the mouse will be released.
*/
void releaseMouse (
[in] ::com::sun::star::awt::XWindow xWindow);
/** Return the bounding box of the given child window relative to the
direct or indirect parent window.
*/
com::sun::star::awt::Rectangle getWindowExtentsRelative (
[in] ::com::sun::star::awt::XWindow xChildWindow,
[in] ::com::sun::star::awt::XWindow xParentWindow);
};
}; }; }; }; // ::com::sun::star::drawing
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -263,7 +263,6 @@ excludelist:
- com/sun/star/frame/XStatusListener.hpp
sd/source/ui/presenter/PresenterHelper.hxx:
# base class has to be a complete type
- com/sun/star/drawing/XPresenterHelper.hpp
- com/sun/star/lang/XInitialization.hpp
sd/source/ui/presenter/PresenterPreviewCache.hxx:
# base class has to be a complete type

View File

@@ -21,25 +21,19 @@
#include "sddllapi.h"
#include <com/sun/star/drawing/XPresenterHelper.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <comphelper/compbase.hxx>
namespace com::sun::star::uno { class XComponentContext; }
namespace sd::presenter {
typedef comphelper::WeakComponentImplHelper<
css::lang::XInitialization,
css::drawing::XPresenterHelper
> PresenterHelperInterfaceBase;
/** Implementation of the XPresenterHelper interface: functionality that can
not be implemented in an extension.
*/
class SD_DLLPUBLIC PresenterHelper final
: public PresenterHelperInterfaceBase
: public comphelper::WeakComponentImplHelper<css::lang::XInitialization>
{
public:
explicit PresenterHelper (const css::uno::Reference<css::uno::XComponentContext>& rxContext);
@@ -51,41 +45,114 @@ public:
virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments) override;
// XPresenterHelper
virtual css::uno::Reference<css::awt::XWindow> SAL_CALL createWindow (
/** Create a new window as child window of the given parent window.
@param xParentWindow
The parent window of the new window.
@param bCreateSystemChildWindow
When `TRUE` then the new window will be a system window that,
in the context of the presenter screen, can not be painted over
by other windows that lie behind it.
@param bInitiallyVisible
When `TRUE` the new window will be visible from the start,
i.e. a window listener will not receive a windowShown signal.
@param bEnableChildTransparentMode
When `TRUE` the parent window is painted behind its child
windows. This is one half of allowing child windows to be
transparent.
@param bEnableParentClip
When `TRUE` then the parent window is not clipped where its
child windows are painted. This is the other half of allowing
child windows to be transparent.
*/
virtual css::uno::Reference<css::awt::XWindow> createWindow (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
sal_Bool bCreateSystemChildWindow,
sal_Bool bInitiallyVisible,
sal_Bool bEnableChildTransparentMode,
sal_Bool bEnableParentClip) override;
sal_Bool bEnableParentClip);
virtual css::uno::Reference<css::rendering::XCanvas> SAL_CALL createSharedCanvas (
/** Create a new canvas for the given window. The new canvas is a
wrapper around the given shared canvas. The wrapper only modifies
the origin in all output and clipping methods.
@param xUpdateCanvas
This canvas is used to call updateScreen() on. May be `NULL`
@param xUpdateWindow
The window that belongs to the update canvas. May also be
`NULL` (is expected to b `NULL` whenever xUpdateCanvas is.)
@param xSharedCanvas
The canvas that is shared by the wrapper.
@param xSharedWindow
The window of the shared canvas. This is used to determine the
proper offset.
@param xWindow
The canvas is created for this window. Must not be `NULL`
*/
virtual css::uno::Reference<css::rendering::XCanvas> createSharedCanvas (
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxUpdateCanvas,
const css::uno::Reference<css::awt::XWindow>& rxUpdateWindow,
const css::uno::Reference<css::rendering::XCanvas>& rxSharedCanvas,
const css::uno::Reference<css::awt::XWindow>& rxSharedWindow,
const css::uno::Reference<css::awt::XWindow>& rxWindow) override;
const css::uno::Reference<css::awt::XWindow>& rxWindow);
virtual css::uno::Reference<css::rendering::XCanvas> SAL_CALL createCanvas (
/** Create a new canvas for the given window.
@param xWindow
The canvas is created for this window. Must not be `NULL`
@param nRequestedCanvasFeatureList
List of requested features that the new canvas should (has to)
provide. Use only values from the CanvasFeature
constants group.
@param sOptionalCanvasServiceName
When an explicit service name is given then a new object of this
service is created. This service name lets the caller select a
specific canvas implementation, e.g. with or without hardware
acceleration.
*/
virtual css::uno::Reference<css::rendering::XCanvas> createCanvas (
const css::uno::Reference<css::awt::XWindow>& rxWindow,
sal_Int16 nRequestedCanvasFeatures,
const OUString& rsOptionalCanvasServiceName) override;
const OUString& rsOptionalCanvasServiceName);
virtual void SAL_CALL toTop (
const css::uno::Reference<css::awt::XWindow>& rxWindow) override;
/** Move the specified window to the top of its stacking order. As a
result the window will be painted over all its overlapping
siblings.
@param xWindow
This window will be moved to the top of its stacking order.
*/
virtual void toTop (
const css::uno::Reference<css::awt::XWindow>& rxWindow);
virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL loadBitmap (
/** Load a bitmap with a given ID.
@param id
The ID of the bitmap.
@param xCanvas
The bitmap is created to be compatible, and possibly optimized,
for this canvas.
*/
virtual css::uno::Reference<css::rendering::XBitmap> loadBitmap (
const OUString& rsURL,
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas) override;
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas);
virtual void SAL_CALL captureMouse (const css::uno::Reference<css::awt::XWindow>& rxWindow) override;
/** Capture the mouse so that no other window will receive mouse events.
Note that this is a potentially dangerous method. Not calling
releaseMouse eventually can lead to an unresponsive application.
@param xWindow
The window for which mouse events will be notified even when the
mouse pointer moves outside the window or over other windows.
*/
virtual void captureMouse (const css::uno::Reference<css::awt::XWindow>& rxWindow);
virtual void SAL_CALL releaseMouse (const css::uno::Reference<css::awt::XWindow>& rxWindow) override;
/** Release a previously captured mouse.
@param xWindow
The window from which the mouse will be released.
*/
virtual void releaseMouse (const css::uno::Reference<css::awt::XWindow>& rxWindow);
virtual css::awt::Rectangle SAL_CALL getWindowExtentsRelative (
/** Return the bounding box of the given child window relative to the
direct or indirect parent window.
*/
virtual css::awt::Rectangle getWindowExtentsRelative (
const css::uno::Reference<css::awt::XWindow>& rxChildWindow,
const css::uno::Reference<css::awt::XWindow>& rxParentWindow) override;
const css::uno::Reference<css::awt::XWindow>& rxParentWindow);
private:
css::uno::Reference<css::uno::XComponentContext> mxComponentContext;

View File

@@ -256,7 +256,6 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XLayerSupplier.hpp>
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
#include <com/sun/star/drawing/XPresenterHelper.hpp>
#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XStorage.hpp>

View File

@@ -55,9 +55,8 @@ PresenterHelper::~PresenterHelper()
void SAL_CALL PresenterHelper::initialize (const Sequence<Any>&) {}
//----- XPaneHelper ----------------------------------------------------
Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
Reference<awt::XWindow> PresenterHelper::createWindow (
const Reference<awt::XWindow>& rxParentWindow,
sal_Bool bCreateSystemChildWindow,
sal_Bool bInitiallyVisible,
@@ -104,7 +103,7 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
return xWindow;
}
Reference<rendering::XCanvas> SAL_CALL PresenterHelper::createSharedCanvas (
Reference<rendering::XCanvas> PresenterHelper::createSharedCanvas (
const Reference<rendering::XSpriteCanvas>& rxUpdateCanvas,
const Reference<awt::XWindow>& rxUpdateWindow,
const Reference<rendering::XCanvas>& rxSharedCanvas,
@@ -129,7 +128,7 @@ Reference<rendering::XCanvas> SAL_CALL PresenterHelper::createSharedCanvas (
rxWindow);
}
Reference<rendering::XCanvas> SAL_CALL PresenterHelper::createCanvas (
Reference<rendering::XCanvas> PresenterHelper::createCanvas (
const Reference<awt::XWindow>& rxWindow,
sal_Int16,
const OUString& rsOptionalCanvasServiceName)
@@ -158,8 +157,7 @@ Reference<rendering::XCanvas> SAL_CALL PresenterHelper::createCanvas (
UNO_QUERY);
}
void SAL_CALL PresenterHelper::toTop (
const Reference<awt::XWindow>& rxWindow)
void PresenterHelper::toTop(const Reference<awt::XWindow>& rxWindow)
{
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(rxWindow);
if (pWindow)
@@ -178,7 +176,7 @@ struct IdMapEntry {
}
Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
Reference<rendering::XBitmap> PresenterHelper::loadBitmap (
const OUString& id,
const Reference<rendering::XCanvas>& rxCanvas)
{
@@ -413,7 +411,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
return nullptr;
}
void SAL_CALL PresenterHelper::captureMouse (
void PresenterHelper::captureMouse (
const Reference<awt::XWindow>& rxWindow)
{
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
@@ -426,7 +424,7 @@ void SAL_CALL PresenterHelper::captureMouse (
}
}
void SAL_CALL PresenterHelper::releaseMouse (const Reference<awt::XWindow>& rxWindow)
void PresenterHelper::releaseMouse (const Reference<awt::XWindow>& rxWindow)
{
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());