Changeset View
Changeset View
Standalone View
Standalone View
screenedge.h
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Line(s) | |||||
193 | * the action should be triggered or the cursor be pushed back | 193 | * the action should be triggered or the cursor be pushed back | ||
194 | * @li Time difference between two entering events is not larger than a certain threshold | 194 | * @li Time difference between two entering events is not larger than a certain threshold | ||
195 | * @li Time difference between two entering events is larger than @ref timeThreshold | 195 | * @li Time difference between two entering events is larger than @ref timeThreshold | ||
196 | * @li Time difference between two activations is larger than @ref reActivateThreshold | 196 | * @li Time difference between two activations is larger than @ref reActivateThreshold | ||
197 | * @li Distance between two enter events is not larger than a defined pixel distance | 197 | * @li Distance between two enter events is not larger than a defined pixel distance | ||
198 | * These checks are performed in @ref Edge | 198 | * These checks are performed in @ref Edge | ||
199 | * | 199 | * | ||
200 | * @todo change way how Effects/Scripts can reserve an edge and are notified. | 200 | * @todo change way how Effects/Scripts can reserve an edge and are notified. | ||
201 | */ | 201 | **/ | ||
202 | class KWIN_EXPORT ScreenEdges : public QObject | 202 | class KWIN_EXPORT ScreenEdges : public QObject | ||
203 | { | 203 | { | ||
204 | Q_OBJECT | 204 | Q_OBJECT | ||
205 | Q_PROPERTY(bool desktopSwitching READ isDesktopSwitching) | 205 | Q_PROPERTY(bool desktopSwitching READ isDesktopSwitching) | ||
206 | Q_PROPERTY(bool desktopSwitchingMovingClients READ isDesktopSwitchingMovingClients) | 206 | Q_PROPERTY(bool desktopSwitchingMovingClients READ isDesktopSwitchingMovingClients) | ||
207 | Q_PROPERTY(QSize cursorPushBackDistance READ cursorPushBackDistance) | 207 | Q_PROPERTY(QSize cursorPushBackDistance READ cursorPushBackDistance) | ||
208 | Q_PROPERTY(int timeThreshold READ timeThreshold) | 208 | Q_PROPERTY(int timeThreshold READ timeThreshold) | ||
209 | Q_PROPERTY(int reActivateThreshold READ reActivationThreshold) | 209 | Q_PROPERTY(int reActivateThreshold READ reActivationThreshold) | ||
Show All 9 Lines | 218 | public: | |||
219 | virtual ~ScreenEdges(); | 219 | virtual ~ScreenEdges(); | ||
220 | /** | 220 | /** | ||
221 | * @internal | 221 | * @internal | ||
222 | **/ | 222 | **/ | ||
223 | void setConfig(KSharedConfig::Ptr config); | 223 | void setConfig(KSharedConfig::Ptr config); | ||
224 | /** | 224 | /** | ||
225 | * Initialize the screen edges. | 225 | * Initialize the screen edges. | ||
226 | * @internal | 226 | * @internal | ||
227 | */ | 227 | **/ | ||
228 | void init(); | 228 | void init(); | ||
229 | /** | 229 | /** | ||
230 | * Check, if a screen edge is entered and trigger the appropriate action | 230 | * Check, if a screen edge is entered and trigger the appropriate action | ||
231 | * if one is enabled for the current region and the timeout is satisfied | 231 | * if one is enabled for the current region and the timeout is satisfied | ||
232 | * @param pos the position of the mouse pointer | 232 | * @param pos the position of the mouse pointer | ||
233 | * @param now the time when the function is called | 233 | * @param now the time when the function is called | ||
234 | * @param forceNoPushBack needs to be called to workaround some DnD clients, don't use unless you want to chek on a DnD event | 234 | * @param forceNoPushBack needs to be called to workaround some DnD clients, don't use unless you want to chek on a DnD event | ||
235 | */ | 235 | **/ | ||
236 | void check(const QPoint& pos, const QDateTime &now, bool forceNoPushBack = false); | 236 | void check(const QPoint& pos, const QDateTime &now, bool forceNoPushBack = false); | ||
237 | /** | 237 | /** | ||
238 | * The (dpi dependent) length, reserved for the active corners of each edge - 1/3" | 238 | * The (dpi dependent) length, reserved for the active corners of each edge - 1/3" | ||
239 | */ | 239 | **/ | ||
240 | int cornerOffset() const; | 240 | int cornerOffset() const; | ||
241 | /** | 241 | /** | ||
242 | * Mark the specified screen edge as reserved. This method is provided for external activation | 242 | * Mark the specified screen edge as reserved. This method is provided for external activation | ||
243 | * like effects and scripts. When the effect/script does no longer need the edge it is supposed | 243 | * like effects and scripts. When the effect/script does no longer need the edge it is supposed | ||
244 | * to call @ref unreserve. | 244 | * to call @ref unreserve. | ||
245 | * @param border the screen edge to mark as reserved | 245 | * @param border the screen edge to mark as reserved | ||
246 | * @param object The object on which the @p callback needs to be invoked | 246 | * @param object The object on which the @p callback needs to be invoked | ||
247 | * @param callback The method name to be invoked - uses QMetaObject::invokeMethod | 247 | * @param callback The method name to be invoked - uses QMetaObject::invokeMethod | ||
248 | * @see unreserve | 248 | * @see unreserve | ||
249 | * @todo: add pointer to script/effect | 249 | * @todo: add pointer to script/effect | ||
250 | */ | 250 | **/ | ||
251 | void reserve(ElectricBorder border, QObject *object, const char *callback); | 251 | void reserve(ElectricBorder border, QObject *object, const char *callback); | ||
252 | /** | 252 | /** | ||
253 | * Mark the specified screen edge as unreserved. This method is provided for external activation | 253 | * Mark the specified screen edge as unreserved. This method is provided for external activation | ||
254 | * like effects and scripts. This method is only allowed to be called if @ref reserve had been | 254 | * like effects and scripts. This method is only allowed to be called if @ref reserve had been | ||
255 | * called before for the same @p border. An unbalanced calling of reserve/unreserve leads to the | 255 | * called before for the same @p border. An unbalanced calling of reserve/unreserve leads to the | ||
256 | * edge never being active or never being able to deactivate again. | 256 | * edge never being active or never being able to deactivate again. | ||
257 | * @param border the screen edge to mark as unreserved | 257 | * @param border the screen edge to mark as unreserved | ||
258 | * @param object the object on which the callback had been invoked | 258 | * @param object the object on which the callback had been invoked | ||
259 | * @see reserve | 259 | * @see reserve | ||
260 | * @todo: add pointer to script/effect | 260 | * @todo: add pointer to script/effect | ||
261 | */ | 261 | **/ | ||
262 | void unreserve(ElectricBorder border, QObject *object); | 262 | void unreserve(ElectricBorder border, QObject *object); | ||
263 | /** | 263 | /** | ||
264 | * Reserves an edge for the @p client. The idea behind this is to show the @p client if the | 264 | * Reserves an edge for the @p client. The idea behind this is to show the @p client if the | ||
265 | * screen edge which the @p client borders gets triggered. | 265 | * screen edge which the @p client borders gets triggered. | ||
266 | * | 266 | * | ||
267 | * When first called it is tried to create an Edge for the client. This is only done if the | 267 | * When first called it is tried to create an Edge for the client. This is only done if the | ||
268 | * client borders with a screen edge specified by @p border. If the client doesn't border the | 268 | * client borders with a screen edge specified by @p border. If the client doesn't border the | ||
269 | * screen edge, no Edge gets created and the client is shown again. Otherwise there would not | 269 | * screen edge, no Edge gets created and the client is shown again. Otherwise there would not | ||
Show All 31 Lines | |||||
301 | * @since 5.10 | 301 | * @since 5.10 | ||
302 | **/ | 302 | **/ | ||
303 | void unreserveTouch(ElectricBorder border, QAction *action); | 303 | void unreserveTouch(ElectricBorder border, QAction *action); | ||
304 | 304 | | |||
305 | /** | 305 | /** | ||
306 | * Reserve desktop switching for screen edges, if @p isToReserve is @c true. Unreserve otherwise. | 306 | * Reserve desktop switching for screen edges, if @p isToReserve is @c true. Unreserve otherwise. | ||
307 | * @param isToReserve indicated whether desktop switching should be reserved or unreseved | 307 | * @param isToReserve indicated whether desktop switching should be reserved or unreseved | ||
308 | * @param o Qt orientations | 308 | * @param o Qt orientations | ||
309 | */ | 309 | **/ | ||
310 | void reserveDesktopSwitching(bool isToReserve, Qt::Orientations o); | 310 | void reserveDesktopSwitching(bool isToReserve, Qt::Orientations o); | ||
311 | /** | 311 | /** | ||
312 | * Raise electric border windows to the real top of the screen. We only need | 312 | * Raise electric border windows to the real top of the screen. We only need | ||
313 | * to do this if an effect input window is active. | 313 | * to do this if an effect input window is active. | ||
314 | */ | 314 | **/ | ||
315 | void ensureOnTop(); | 315 | void ensureOnTop(); | ||
316 | bool isEntered(QMouseEvent *event); | 316 | bool isEntered(QMouseEvent *event); | ||
317 | 317 | | |||
318 | /** | 318 | /** | ||
319 | * Returns a QVector of all existing screen edge windows | 319 | * Returns a QVector of all existing screen edge windows | ||
320 | * @return all existing screen edge windows in a QVector | 320 | * @return all existing screen edge windows in a QVector | ||
321 | */ | 321 | **/ | ||
322 | QVector< xcb_window_t > windows() const; | 322 | QVector< xcb_window_t > windows() const; | ||
323 | 323 | | |||
324 | bool isDesktopSwitching() const; | 324 | bool isDesktopSwitching() const; | ||
325 | bool isDesktopSwitchingMovingClients() const; | 325 | bool isDesktopSwitchingMovingClients() const; | ||
326 | const QSize &cursorPushBackDistance() const; | 326 | const QSize &cursorPushBackDistance() const; | ||
327 | /** | 327 | /** | ||
328 | * Minimum time between the push back of the cursor and the activation by re-entering the edge. | 328 | * Minimum time between the push back of the cursor and the activation by re-entering the edge. | ||
329 | **/ | 329 | **/ | ||
▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines |