Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
unity-api (8.9+ubports) xenial; urgency=medium

[ Nick Dedekind ]
* MirPlatformCursor - updates for multi-screen.

-- Marius Gripsgard <marius@ubports.com> Tue, 23 Apr 2019 18:26:36 +0200

unity-api (8.8+ubports) xenial; urgency=medium

* Imported to UBports
Expand Down
3 changes: 3 additions & 0 deletions include/unity/shell/application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ set(INCLUDE_INSTALL_DIR include/unity/shell/application)
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
file(GLOB internal_headers "${CMAKE_CURRENT_SOURCE_DIR}/internal/*.h")

add_custom_target(appheaders
SOURCES ${headers} ${internal_headers})

install(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR})

set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
Expand Down
25 changes: 2 additions & 23 deletions include/unity/shell/application/MirMousePointerInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class MirMousePointerInterface : public QQuickItem {

virtual void setThemeName(const QString &themeName) = 0;
virtual QString themeName() const = 0;

virtual void moveTo(const QPoint& position) = 0;
/// @endcond

/**
Expand All @@ -70,29 +72,6 @@ class MirMousePointerInterface : public QQuickItem {
void cursorNameChanged(QString name);
void themeNameChanged(QString name);
/// @endcond

public Q_SLOTS:
/**
* @brief Handler for Mir mouse events
* The implementation should respond to Mir mouse events by moving itself along its parent
* area.
* This is called by Mir's platform cursor.
*
* Note that we get only relative mouse movement, since the mouse pointer position is defined
* by this very item. Ie., it's up to this class to decide whether or not it (the mouse pointer)
* should move (and how much) due to movement in a mouse device.
*
* @param movement Movement vector
*/
virtual void handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButtons buttons,
Qt::KeyboardModifiers modifiers) = 0;

/**
* @brief Handler for Mir mouse wheel events
* This is called by Mir's platform cursor.
*/
virtual void handleWheelEvent(ulong timestamp, QPoint angleDelta, Qt::KeyboardModifiers modifiers) = 0;

};

#endif // MIR_MOUSE_POINTER_INTERFACE_H
9 changes: 7 additions & 2 deletions include/unity/shell/application/MirPlatformCursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ class MirPlatformCursor : public QPlatformCursor
{
public:
/**
* @brief Set the QML mouse pointer that this platform cursor will talk to
* @brief Register a mouse pointer that this platform cursor will talk to
*/
virtual void setMousePointer(MirMousePointerInterface *mousePointer) = 0;
virtual void registerMousePointer(MirMousePointerInterface *mousePointer) = 0;

/**
* @brief Unregister a mouse pointer that this platform cursor will talk to
*/
virtual void unregisterMousePointer(MirMousePointerInterface *mousePointer) = 0;
};

#endif // MIR_PLATFORM_CURSOR_H
27 changes: 27 additions & 0 deletions include/unity/shell/application/SurfaceManagerInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@
#ifndef UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H
#define UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H

#include "Mir.h"

#include <QObject>
#include <QVector>

#include <memory>

namespace miral {
class Window;
class Workspace;
}

namespace unity {
namespace shell {
namespace application {
Expand All @@ -36,9 +45,27 @@ class SurfaceManagerInterface : public QObject
virtual void raise(MirSurfaceInterface *surface) = 0;
virtual void activate(MirSurfaceInterface *surface) = 0;

virtual void forEachSurfaceInWorkspace(const std::shared_ptr<miral::Workspace> &workspace,
const std::function<void(unity::shell::application::MirSurfaceInterface*)> &callback) = 0;
virtual void moveSurfaceToWorkspace(unity::shell::application::MirSurfaceInterface* surface,
const std::shared_ptr<miral::Workspace> &workspace) = 0;
virtual void moveWorkspaceContentToWorkspace(const std::shared_ptr<miral::Workspace> &to,
const std::shared_ptr<miral::Workspace> &from) = 0;

Q_SIGNALS:
void surfaceCreated(unity::shell::application::MirSurfaceInterface *surface);
void surfaceRemoved(unity::shell::application::MirSurfaceInterface *surface);
void surfaceReady(unity::shell::application::MirSurfaceInterface *surface);
void surfaceMoved(unity::shell::application::MirSurfaceInterface *surface, const QPoint &topLeft);
void surfaceResized(unity::shell::application::MirSurfaceInterface *surface, const QSize &size);
void surfaceStateChanged(unity::shell::application::MirSurfaceInterface *surface, Mir::State state);
void surfaceFocusChanged(unity::shell::application::MirSurfaceInterface *surface, bool focused);
void surfacesRaised(const QVector<unity::shell::application::MirSurfaceInterface*> &surfaces);
void surfaceRequestedRaise(unity::shell::application::MirSurfaceInterface *surface);
void surfacesAddedToWorkspace(const std::shared_ptr<miral::Workspace> &workspace,
const QVector<unity::shell::application::MirSurfaceInterface*> &surfaces);
void surfacesAboutToBeRemovedFromWorkspace(const std::shared_ptr<miral::Workspace> &workspace,
const QVector<unity::shell::application::MirSurfaceInterface*> &surfaces);
void modificationsStarted();
void modificationsEnded();
};
Expand Down