Changeset View
Changeset View
Standalone View
Standalone View
src/server/surface_interface.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | class CompositorInterface; | 42 | class CompositorInterface; | ||
43 | class IdleInhibitManagerUnstableV1Interface; | 43 | class IdleInhibitManagerUnstableV1Interface; | ||
44 | class LockedPointerInterface; | 44 | class LockedPointerInterface; | ||
45 | class PointerConstraintsUnstableV1Interface; | 45 | class PointerConstraintsUnstableV1Interface; | ||
46 | class ShadowManagerInterface; | 46 | class ShadowManagerInterface; | ||
47 | class ShadowInterface; | 47 | class ShadowInterface; | ||
48 | class SlideInterface; | 48 | class SlideInterface; | ||
49 | class SubSurfaceInterface; | 49 | class SubSurfaceInterface; | ||
50 | class ViewportInterface; | ||||
51 | class ViewporterInterface; | ||||
50 | 52 | | |||
51 | /** | 53 | /** | ||
52 | * @brief Resource representing a wl_surface. | 54 | * @brief Resource representing a wl_surface. | ||
53 | * | 55 | * | ||
54 | * The SurfaceInterface gets created by the CompositorInterface. A SurfaceInterface normally | 56 | * The SurfaceInterface gets created by the CompositorInterface. A SurfaceInterface normally | ||
55 | * takes up a role by being "attached" to either a ShellSurfaceInterface, a SubSurfaceInterface | 57 | * takes up a role by being "attached" to either a ShellSurfaceInterface, a SubSurfaceInterface | ||
56 | * or a Cursor. | 58 | * or a Cursor. | ||
57 | * | 59 | * | ||
Show All 9 Lines | |||||
67 | * | 69 | * | ||
68 | * @see CompositorInterface | 70 | * @see CompositorInterface | ||
69 | * @see BufferInterface | 71 | * @see BufferInterface | ||
70 | * @see SubSurfaceInterface | 72 | * @see SubSurfaceInterface | ||
71 | * @see BlurInterface | 73 | * @see BlurInterface | ||
72 | * @see ContrastInterface | 74 | * @see ContrastInterface | ||
73 | * @see ShadowInterface | 75 | * @see ShadowInterface | ||
74 | * @see SlideInterface | 76 | * @see SlideInterface | ||
77 | * @see ViewportInterface | ||||
75 | **/ | 78 | **/ | ||
76 | class KWAYLANDSERVER_EXPORT SurfaceInterface : public Resource | 79 | class KWAYLANDSERVER_EXPORT SurfaceInterface : public Resource | ||
77 | { | 80 | { | ||
78 | Q_OBJECT | 81 | Q_OBJECT | ||
79 | /** | 82 | /** | ||
80 | * The current damage region. | 83 | * The current damage region. | ||
81 | **/ | 84 | **/ | ||
82 | Q_PROPERTY(QRegion damage READ damage NOTIFY damaged) | 85 | Q_PROPERTY(QRegion damage READ damage NOTIFY damaged) | ||
Show All 30 Lines | 112 | #endif | |||
113 | */ | 116 | */ | ||
114 | bool inputIsInfinite() const; | 117 | bool inputIsInfinite() const; | ||
115 | qint32 scale() const; | 118 | qint32 scale() const; | ||
116 | OutputInterface::Transform transform() const; | 119 | OutputInterface::Transform transform() const; | ||
117 | /** | 120 | /** | ||
118 | * @returns the current BufferInterface, might be @c nullptr. | 121 | * @returns the current BufferInterface, might be @c nullptr. | ||
119 | **/ | 122 | **/ | ||
120 | BufferInterface *buffer(); | 123 | BufferInterface *buffer(); | ||
124 | /** | ||||
125 | * @returns the current BufferInterface, might be @c nullptr. | ||||
126 | **/ | ||||
127 | BufferInterface *buffer() const; | ||||
121 | QPoint offset() const; | 128 | QPoint offset() const; | ||
romangg: Needed for a call in a const function in KWin. Do we want to do it like that? Other suggestions? | |||||
Why not just BufferInterface *buffer() const There's no reason why a caller would need to explicitly pick a const vs non-const version. davidedmundson: Why not just
BufferInterface *buffer() const
There's no reason why a caller would need to… | |||||
Yea, I added the new function for API/ABI-compatibility. But if you say making the function buffer() const is not a problem in this regard I will gladly do that. romangg: Yea, I added the new function for API/ABI-compatibility. But if you say making the function… | |||||
122 | /** | 129 | /** | ||
123 | * The size of the Surface in global compositor space. | 130 | * The size of the Surface in global compositor space. | ||
124 | * @see For buffer size use BufferInterface::size | 131 | * @see For buffer size use BufferInterface::size | ||
125 | * from SurfaceInterface::buffer | 132 | * from SurfaceInterface::buffer | ||
126 | * @since 5.3 | 133 | * @since 5.3 | ||
127 | **/ | 134 | **/ | ||
128 | QSize size() const; | 135 | QSize size() const; | ||
129 | 136 | | |||
Show All 26 Lines | |||||
156 | 163 | | |||
157 | /** | 164 | /** | ||
158 | * @returns The Contrast for this Surface. | 165 | * @returns The Contrast for this Surface. | ||
159 | * @since 5.5 | 166 | * @since 5.5 | ||
160 | **/ | 167 | **/ | ||
161 | QPointer<ContrastInterface> contrast() const; | 168 | QPointer<ContrastInterface> contrast() const; | ||
162 | 169 | | |||
163 | /** | 170 | /** | ||
171 | * @returns The Viewport for this Surface. | ||||
172 | * @since 5.66 | ||||
173 | **/ | ||||
174 | QPointer<ViewportInterface> viewport() const; | ||||
175 | | ||||
176 | /** | ||||
164 | * Whether the SurfaceInterface is currently considered to be mapped. | 177 | * Whether the SurfaceInterface is currently considered to be mapped. | ||
165 | * A SurfaceInterface is mapped if it has a non-null BufferInterface attached. | 178 | * A SurfaceInterface is mapped if it has a non-null BufferInterface attached. | ||
166 | * If the SurfaceInterface references a SubSurfaceInterface it is only considered | 179 | * If the SurfaceInterface references a SubSurfaceInterface it is only considered | ||
167 | * mapped if it has a BufferInterface attached and the parent SurfaceInterface is mapped. | 180 | * mapped if it has a BufferInterface attached and the parent SurfaceInterface is mapped. | ||
168 | * | 181 | * | ||
169 | * @returns Whether the SurfaceInterface is currently mapped | 182 | * @returns Whether the SurfaceInterface is currently mapped | ||
170 | * @since 5.22 | 183 | * @since 5.22 | ||
171 | **/ | 184 | **/ | ||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | |||||
288 | void setDataProxy(SurfaceInterface *surface); | 301 | void setDataProxy(SurfaceInterface *surface); | ||
289 | /** | 302 | /** | ||
290 | * Returns the data proxy of this SurfaceInterface or null if there | 303 | * Returns the data proxy of this SurfaceInterface or null if there | ||
291 | * is none set. | 304 | * is none set. | ||
292 | * @since 5.56 | 305 | * @since 5.56 | ||
293 | **/ | 306 | **/ | ||
294 | SurfaceInterface* dataProxy() const; | 307 | SurfaceInterface* dataProxy() const; | ||
295 | 308 | | |||
309 | /** | ||||
310 | * Returns the source rectangle. If none is set the returned rectangle is not valid. | ||||
311 | * @since 5.66 | ||||
312 | **/ | ||||
313 | QRectF sourceRectangle() const; | ||||
314 | | ||||
296 | Q_SIGNALS: | 315 | Q_SIGNALS: | ||
297 | /** | 316 | /** | ||
298 | * Emitted whenever the SurfaceInterface got damaged. | 317 | * Emitted whenever the SurfaceInterface got damaged. | ||
299 | * The signal is only emitted during the commit of state. | 318 | * The signal is only emitted during the commit of state. | ||
300 | * A damage means that a new BufferInterface got attached. | 319 | * A damage means that a new BufferInterface got attached. | ||
301 | * | 320 | * | ||
302 | * @see buffer | 321 | * @see buffer | ||
303 | * @see damage | 322 | * @see damage | ||
Show All 23 Lines | |||||
327 | * @since 5.5 | 346 | * @since 5.5 | ||
328 | **/ | 347 | **/ | ||
329 | void slideOnShowHideChanged(); | 348 | void slideOnShowHideChanged(); | ||
330 | /** | 349 | /** | ||
331 | * @since 5.5 | 350 | * @since 5.5 | ||
332 | **/ | 351 | **/ | ||
333 | void contrastChanged(); | 352 | void contrastChanged(); | ||
334 | /** | 353 | /** | ||
354 | * @since 5.66 | ||||
355 | **/ | ||||
356 | void sourceRectangleChanged(); | ||||
357 | /** | ||||
335 | * Emitted whenever the tree of sub-surfaces changes in a way which requires a repaint. | 358 | * Emitted whenever the tree of sub-surfaces changes in a way which requires a repaint. | ||
336 | * @since 5.22 | 359 | * @since 5.22 | ||
337 | **/ | 360 | **/ | ||
338 | void subSurfaceTreeChanged(); | 361 | void subSurfaceTreeChanged(); | ||
339 | 362 | | |||
340 | /** | 363 | /** | ||
341 | * Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface. | 364 | * Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface. | ||
342 | * | 365 | * | ||
Show All 27 Lines | 391 | private: | |||
370 | friend class SubSurfaceInterface; | 393 | friend class SubSurfaceInterface; | ||
371 | friend class ShadowManagerInterface; | 394 | friend class ShadowManagerInterface; | ||
372 | friend class BlurManagerInterface; | 395 | friend class BlurManagerInterface; | ||
373 | friend class SlideManagerInterface; | 396 | friend class SlideManagerInterface; | ||
374 | friend class ContrastManagerInterface; | 397 | friend class ContrastManagerInterface; | ||
375 | friend class IdleInhibitManagerUnstableV1Interface; | 398 | friend class IdleInhibitManagerUnstableV1Interface; | ||
376 | friend class PointerConstraintsUnstableV1Interface; | 399 | friend class PointerConstraintsUnstableV1Interface; | ||
377 | friend class SurfaceRole; | 400 | friend class SurfaceRole; | ||
401 | friend class ViewporterInterface; | ||||
402 | | ||||
378 | explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource); | 403 | explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource); | ||
379 | 404 | | |||
380 | class Private; | 405 | class Private; | ||
381 | Private *d_func() const; | 406 | Private *d_func() const; | ||
382 | }; | 407 | }; | ||
383 | 408 | | |||
384 | } | 409 | } | ||
385 | } | 410 | } | ||
386 | 411 | | |||
387 | Q_DECLARE_METATYPE(KWayland::Server::SurfaceInterface*) | 412 | Q_DECLARE_METATYPE(KWayland::Server::SurfaceInterface*) | ||
388 | 413 | | |||
389 | #endif | 414 | #endif |
Needed for a call in a const function in KWin. Do we want to do it like that? Other suggestions?