61class KWIN_EXPORT
Edge :
public QObject
70 bool isBottom()
const;
71 bool isCorner()
const;
72 bool isScreenEdge()
const;
73 bool triggersFor(
const QPoint &cursorPos)
const;
74 bool check(
const QPoint &cursorPos,
const QDateTime &triggerTime,
bool forceNoPushBack =
false);
75 void markAsTriggered(
const QPoint &cursorPos,
const QDateTime &triggerTime);
76 bool isReserved()
const;
77 const QRect &approachGeometry()
const;
80 void reserve(QObject *
object,
const char *slot);
81 const QHash<QObject *, QByteArray> &callBacks()
const;
83 void unreserveTouchCallBack(QAction *action);
84 void startApproaching();
85 void stopApproaching();
86 bool isApproaching()
const;
87 void setClient(
Window *client);
89 void setOutput(
Output *output);
91 const QRect &geometry()
const;
94 bool activatesForPointer()
const;
95 bool activatesForTouchGesture()
const;
101 virtual quint32 window()
const;
108 virtual quint32 approachWindow()
const;
113 void unreserve(QObject *
object);
116 void setGeometry(
const QRect &geometry);
117 void updateApproaching(
const QPointF &point);
118 void checkBlocking();
126 bool isBlocked()
const;
127 virtual void doGeometryUpdate();
128 virtual void doActivate();
129 virtual void doDeactivate();
130 virtual void doStartApproaching();
131 virtual void doStopApproaching();
132 virtual void doUpdateBlocking();
137 bool canActivate(
const QPoint &cursorPos,
const QDateTime &triggerTime);
138 void handle(
const QPoint &cursorPos);
140 bool handlePointerAction()
142 return handleAction(m_action);
144 bool handleTouchAction()
146 return handleAction(m_touchAction);
148 bool handleByCallback();
149 void handleTouchCallback();
150 void switchDesktop(
const QPoint &cursorPos);
151 void pushCursorBack(
const QPoint &cursorPos);
152 void reserveTouchCallBack(
const TouchCallback &callback);
153 QList<TouchCallback> touchCallBacks()
const
155 return m_touchCallbacks;
157 ScreenEdges *m_edges;
163 QRect m_approachGeometry;
164 QDateTime m_lastTrigger;
165 QDateTime m_lastReset;
166 QPoint m_triggeredPoint;
167 QHash<QObject *, QByteArray> m_callBacks;
169 int m_lastApproachingFactor;
171 bool m_pushBackBlocked;
174 std::unique_ptr<SwipeGesture> m_gesture;
175 QList<TouchCallback> m_touchCallbacks;
224 Q_PROPERTY(
bool desktopSwitching READ isDesktopSwitching)
225 Q_PROPERTY(
bool desktopSwitchingMovingClients READ isDesktopSwitchingMovingClients)
226 Q_PROPERTY(QSize cursorPushBackDistance READ cursorPushBackDistance)
227 Q_PROPERTY(
int timeThreshold READ timeThreshold)
228 Q_PROPERTY(
int reActivateThreshold READ reActivationThreshold)
229 Q_PROPERTY(
int actionTopLeft READ actionTopLeft)
230 Q_PROPERTY(
int actionTop READ actionTop)
231 Q_PROPERTY(
int actionTopRight READ actionTopRight)
232 Q_PROPERTY(
int actionRight READ actionRight)
233 Q_PROPERTY(
int actionBottomRight READ actionBottomRight)
234 Q_PROPERTY(
int actionBottom READ actionBottom)
235 Q_PROPERTY(
int actionBottomLeft READ actionBottomLeft)
236 Q_PROPERTY(
int actionLeft READ actionLeft)
242 void setConfig(KSharedConfig::Ptr config);
255 void check(const QPoint &pos, const QDateTime &now,
bool forceNoPushBack = false);
259 int cornerOffset() const;
270 void reserve(
ElectricBorder border, QObject *
object, const
char *callback);
326 void reserveDesktopSwitching(
bool isToReserve, Qt::Orientations o);
332 bool isEntered(QMouseEvent *event);
338 QList<xcb_window_t> windows() const;
340 bool isDesktopSwitching() const;
341 bool isDesktopSwitchingMovingClients() const;
342 const QSize &cursorPushBackDistance() const;
346 int timeThreshold() const;
350 int reActivationThreshold() const;
364 return m_gestureRecognizer;
367 bool handleDndNotify(xcb_window_t window,
const QPoint &point);
368 bool handleEnterNotifiy(xcb_window_t window,
const QPoint &point,
const QDateTime ×tamp);
369 bool remainActiveOnFullscreen()
const;
370 const std::vector<std::unique_ptr<Edge>> &edges()
const;
382 void recreateEdges();
395 ElectricDisabled = 0,
396 ElectricMoveOnly = 1,
399 void setDesktopSwitching(
bool enable);
400 void setDesktopSwitchingMovingClients(
bool enable);
401 void setCursorPushBackDistance(
const QSize &distance);
402 void setTimeThreshold(
int threshold);
403 void setReActivationThreshold(
int threshold);
404 void createHorizontalEdge(
ElectricBorder border,
const QRect &screen,
const QRect &fullArea,
Output *output);
405 void createVerticalEdge(
ElectricBorder border,
const QRect &screen,
const QRect &fullArea,
Output *output);
406 std::unique_ptr<Edge> createEdge(
ElectricBorder border,
int x,
int y,
int width,
int height,
Output *output,
bool createAction =
true);
409 void setRemainActiveOnFullscreen(
bool remainActive);
413 void deleteEdgeForClient(
Window *client);
414 bool m_desktopSwitching;
415 bool m_desktopSwitchingMovingClients;
416 QSize m_cursorPushBackDistance;
418 int m_reactivateThreshold;
419 Qt::Orientations m_virtualDesktopLayout;
420 std::vector<std::unique_ptr<Edge>> m_edges;
421 KSharedConfig::Ptr m_config;
430 QMap<ElectricBorder, ElectricBorderAction> m_touchCallbacks;
433 bool m_remainActiveOnFullscreen =
false;