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 26 Lines | |||||
109 | #endif | 112 | #endif | ||
110 | /** | 113 | /** | ||
111 | * Replaces Surface::inputIsInfitine instead. | 114 | * Replaces Surface::inputIsInfitine instead. | ||
112 | * @since 5.5 | 115 | * @since 5.5 | ||
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; | ||
120 | #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 5) | ||||
117 | /** | 121 | /** | ||
118 | * @returns the current BufferInterface, might be @c nullptr. | 122 | * @returns the current BufferInterface, might be @c nullptr. | ||
123 | * @deprecated Since 5.66, use constBuffer | ||||
119 | **/ | 124 | **/ | ||
120 | BufferInterface *buffer(); | 125 | BufferInterface *buffer(); | ||
126 | #endif | ||||
127 | /** | ||||
128 | * @returns the current BufferInterface, might be @c nullptr. | ||||
129 | **/ | ||||
130 | BufferInterface *constBuffer() 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… | |||||
121 | QPoint offset() const; | 131 | QPoint offset() const; | ||
122 | /** | 132 | /** | ||
123 | * The size of the Surface in global compositor space. | 133 | * The size of the Surface in global compositor space. | ||
124 | * @see For buffer size use BufferInterface::size | 134 | * @see For buffer size use BufferInterface::size | ||
125 | * from SurfaceInterface::buffer | 135 | * from SurfaceInterface::buffer | ||
126 | * @since 5.3 | 136 | * @since 5.3 | ||
127 | **/ | 137 | **/ | ||
128 | QSize size() const; | 138 | QSize size() const; | ||
Show All 27 Lines | |||||
156 | 166 | | |||
157 | /** | 167 | /** | ||
158 | * @returns The Contrast for this Surface. | 168 | * @returns The Contrast for this Surface. | ||
159 | * @since 5.5 | 169 | * @since 5.5 | ||
160 | **/ | 170 | **/ | ||
161 | QPointer<ContrastInterface> contrast() const; | 171 | QPointer<ContrastInterface> contrast() const; | ||
162 | 172 | | |||
163 | /** | 173 | /** | ||
174 | * @returns The Viewport for this Surface. | ||||
175 | * @since 5.66 | ||||
176 | **/ | ||||
177 | QPointer<ViewportInterface> viewport() const; | ||||
178 | | ||||
179 | /** | ||||
164 | * Whether the SurfaceInterface is currently considered to be mapped. | 180 | * Whether the SurfaceInterface is currently considered to be mapped. | ||
165 | * A SurfaceInterface is mapped if it has a non-null BufferInterface attached. | 181 | * A SurfaceInterface is mapped if it has a non-null BufferInterface attached. | ||
166 | * If the SurfaceInterface references a SubSurfaceInterface it is only considered | 182 | * If the SurfaceInterface references a SubSurfaceInterface it is only considered | ||
167 | * mapped if it has a BufferInterface attached and the parent SurfaceInterface is mapped. | 183 | * mapped if it has a BufferInterface attached and the parent SurfaceInterface is mapped. | ||
168 | * | 184 | * | ||
169 | * @returns Whether the SurfaceInterface is currently mapped | 185 | * @returns Whether the SurfaceInterface is currently mapped | ||
170 | * @since 5.22 | 186 | * @since 5.22 | ||
171 | **/ | 187 | **/ | ||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | |||||
288 | void setDataProxy(SurfaceInterface *surface); | 304 | void setDataProxy(SurfaceInterface *surface); | ||
289 | /** | 305 | /** | ||
290 | * Returns the data proxy of this SurfaceInterface or null if there | 306 | * Returns the data proxy of this SurfaceInterface or null if there | ||
291 | * is none set. | 307 | * is none set. | ||
292 | * @since 5.56 | 308 | * @since 5.56 | ||
293 | **/ | 309 | **/ | ||
294 | SurfaceInterface* dataProxy() const; | 310 | SurfaceInterface* dataProxy() const; | ||
295 | 311 | | |||
312 | /** | ||||
313 | * Returns the source rectangle. If none is set the returned rectangle is not valid. | ||||
314 | * @since 5.66 | ||||
315 | **/ | ||||
316 | QRectF sourceRectangle() const; | ||||
317 | | ||||
296 | Q_SIGNALS: | 318 | Q_SIGNALS: | ||
297 | /** | 319 | /** | ||
298 | * Emitted whenever the SurfaceInterface got damaged. | 320 | * Emitted whenever the SurfaceInterface got damaged. | ||
299 | * The signal is only emitted during the commit of state. | 321 | * The signal is only emitted during the commit of state. | ||
300 | * A damage means that a new BufferInterface got attached. | 322 | * A damage means that a new BufferInterface got attached. | ||
301 | * | 323 | * | ||
302 | * @see buffer | 324 | * @see buffer | ||
303 | * @see damage | 325 | * @see damage | ||
Show All 23 Lines | |||||
327 | * @since 5.5 | 349 | * @since 5.5 | ||
328 | **/ | 350 | **/ | ||
329 | void slideOnShowHideChanged(); | 351 | void slideOnShowHideChanged(); | ||
330 | /** | 352 | /** | ||
331 | * @since 5.5 | 353 | * @since 5.5 | ||
332 | **/ | 354 | **/ | ||
333 | void contrastChanged(); | 355 | void contrastChanged(); | ||
334 | /** | 356 | /** | ||
357 | * @since 5.66 | ||||
358 | **/ | ||||
359 | void sourceRectangleChanged(); | ||||
360 | /** | ||||
335 | * Emitted whenever the tree of sub-surfaces changes in a way which requires a repaint. | 361 | * Emitted whenever the tree of sub-surfaces changes in a way which requires a repaint. | ||
336 | * @since 5.22 | 362 | * @since 5.22 | ||
337 | **/ | 363 | **/ | ||
338 | void subSurfaceTreeChanged(); | 364 | void subSurfaceTreeChanged(); | ||
339 | 365 | | |||
340 | /** | 366 | /** | ||
341 | * Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface. | 367 | * Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface. | ||
342 | * | 368 | * | ||
Show All 27 Lines | 394 | private: | |||
370 | friend class SubSurfaceInterface; | 396 | friend class SubSurfaceInterface; | ||
371 | friend class ShadowManagerInterface; | 397 | friend class ShadowManagerInterface; | ||
372 | friend class BlurManagerInterface; | 398 | friend class BlurManagerInterface; | ||
373 | friend class SlideManagerInterface; | 399 | friend class SlideManagerInterface; | ||
374 | friend class ContrastManagerInterface; | 400 | friend class ContrastManagerInterface; | ||
375 | friend class IdleInhibitManagerUnstableV1Interface; | 401 | friend class IdleInhibitManagerUnstableV1Interface; | ||
376 | friend class PointerConstraintsUnstableV1Interface; | 402 | friend class PointerConstraintsUnstableV1Interface; | ||
377 | friend class SurfaceRole; | 403 | friend class SurfaceRole; | ||
404 | friend class ViewporterInterface; | ||||
405 | | ||||
378 | explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource); | 406 | explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource); | ||
379 | 407 | | |||
380 | class Private; | 408 | class Private; | ||
381 | Private *d_func() const; | 409 | Private *d_func() const; | ||
382 | }; | 410 | }; | ||
383 | 411 | | |||
384 | } | 412 | } | ||
385 | } | 413 | } | ||
386 | 414 | | |||
387 | Q_DECLARE_METATYPE(KWayland::Server::SurfaceInterface*) | 415 | Q_DECLARE_METATYPE(KWayland::Server::SurfaceInterface*) | ||
388 | 416 | | |||
389 | #endif | 417 | #endif |
Needed for a call in a const function in KWin. Do we want to do it like that? Other suggestions?