Merge lp:~mir-team/mir/client-api-deprecation into lp:mir
- client-api-deprecation
- Merge into development-branch
Status: | Rejected |
---|---|
Rejected by: | Daniel van Vugt |
Proposed branch: | lp:~mir-team/mir/client-api-deprecation |
Merge into: | lp:mir |
Diff against target: |
743 lines (+168/-8) 9 files modified
include/client/mir_toolkit/debug/surface.h (+8/-0) include/client/mir_toolkit/mir_buffer_stream.h (+28/-5) include/client/mir_toolkit/mir_connection.h (+25/-2) include/client/mir_toolkit/mir_cursor_configuration.h (+3/-0) include/client/mir_toolkit/mir_display_configuration.h (+6/-0) include/client/mir_toolkit/mir_platform_message.h (+19/-0) include/client/mir_toolkit/mir_screencast.h (+9/-0) include/client/mir_toolkit/mir_surface.h (+69/-1) include/core/mir_toolkit/common.h (+1/-0) |
To merge this branch: | bzr merge lp:~mir-team/mir/client-api-deprecation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Disapprove | ||
Andreas Pokorny (community) | Abstain | ||
Brandon Schaefer (community) | Approve | ||
Mir CI Bot | continuous-integration | Needs Fixing | |
Review via email: mp+309364@code.launchpad.net |
Commit message
DO NOT MERGE. At least not yet....
Description of the change
These are the client side APIs to deprecate as discussed during the sprint.
Alberto Aguirre (albaguirre) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3788
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Brandon Schaefer (brandontschaefer) wrote : | # |
lgtm
Kevin DuBois (kdub) wrote : | # |
Looks like what we all worked on together, lgtm to me.
I'm ok with merging, as long as some items like:
+ * \deprecated Use "get_platform" extension
get captured in todo's in a document tracking the road to 1.0. (did we have a doc like that?)
Also, might be worth planning how the transition will work... eg, assuming no server breaks are needed for other reasons, something like this makes sense to me:
0.25 gets published
0.26 has all final header versions along with deprecations
0.27 removes deprecations/is the client api/abi break
Brandon Schaefer (brandontschaefer) wrote : | # |
So we remember as well, need to go through the event api
Alberto Aguirre (albaguirre) wrote : | # |
On mir_buffer_
Are we still waiting on the outcome on this? https:/
Alan Griffiths (alan-griffiths) wrote : | # |
> Looks like what we all worked on together, lgtm to me.
>
> I'm ok with merging, as long as some items like:
> + * \deprecated Use "get_platform" extension
> get captured in todo's in a document tracking the road to 1.0. (did we have a
> doc like that?)
>
> Also, might be worth planning how the transition will work... eg, assuming no
> server breaks are needed for other reasons, something like this makes sense to
> me:
> 0.25 gets published
> 0.26 has all final header versions along with deprecations
> 0.27 removes deprecations/is the client api/abi break
Surely that's 1.0?!
Daniel van Vugt (vanvugt) wrote : | # |
Possibly don't deprecate 'get' functions and suggest events are an alternative. While libmirclient keeps such values cached, the most efficient and most convenient way to get at them is to 'get' from that cache. That avoids every toolkit having to re-implement the same cache for its getters.
Above the toolkit level, apps will sometimes want to get_some_
Daniel van Vugt (vanvugt) wrote : | # |
... unless on a case by case basis it can be shown that deprecating a getter makes it possible to completely remove caching of event values from libmirclient. You still have the duplication issue, but at least libmirclient would become smaller.
Daniel van Vugt (vanvugt) wrote : | # |
Regardless of the above comments, I would like to reiterate that not everyone wants to delete functions right now. I don't strongly endorse any deletions, and as we saw last week Gerry is also concerned. So whoever wants to delete client functions should also own all the corresponding downstream changes.
There are also changes unrelated to deprecation in this branch, so those could be proposed separately with less contention...
Daniel van Vugt (vanvugt) wrote : | # |
Actually I'm experiencing the (lack of) getter problem right now and having to implement caching in my app for some attributes that don't have getters (visibility and surface output refresh rate).
Maybe what we need instead of getters is: e = mir_surface_
That way all getters can indeed be replaced by the event query functions, but also each toolkit/app then doesn't have to duplicate too much code to write a getter for their own API.
Alberto Aguirre (albaguirre) wrote : | # |
> Regardless of the above comments, I would like to reiterate that not everyone
> wants to delete functions right now.
That's why we will deprecate things first before deleting in 1.0
> I don't strongly endorse any deletions,
> and as we saw last week Gerry is also concerned.
Just confirmed with Gerry that deprecating first is ok as long as corresponding new apis that cover similar functionality are in place so the transition can be made.
>So whoever wants to delete
> client functions should also own all the corresponding downstream changes.
>
We have historically done so, I don't see why this time would be any different.
Andreas Pokorny (andreas-pokorny) wrote : | # |
Hm from gdk/gtks perspective those removals are not problematic... I think some of the comments could point to the attribute change events..
Gerry Boland (gerboland) wrote : | # |
> Regardless of the above comments, I would like to reiterate that not everyone
> wants to delete functions right now. I don't strongly endorse any deletions,
> and as we saw last week Gerry is also concerned. So whoever wants to delete
> client functions should also own all the corresponding downstream changes.
To clarify my perspective, I don't mind deprecations as long as I've had time to react to them - which for me means there is a release where the old api is deprecated but not removed, and the new API ready for use. As long as new api is a superset of the old api and gives me similar behaviour, I am not too concerned. If I find that is not the case, then we at least will have time to figure it out.
Andreas Pokorny (andreas-pokorny) wrote : | # |
^ But will take a closer look with the current gtk+ ..
Daniel van Vugt (vanvugt) wrote : | # |
OK, I abstain on the whole deprecation bit.
Just want to see the new bool return value and chrome changes proposed separately. They're unrelated to deprecation really. And the first one requires further logic changes anyway:
bool mir_buffer_
Daniel van Vugt (vanvugt) : | # |
Daniel van Vugt (vanvugt) : | # |
Daniel van Vugt (vanvugt) wrote : | # |
Is this branch now superseded by Brandon's?
https:/
Cemil Azizoglu (cemil-azizoglu) wrote : | # |
79 + * \note TODO: Cleanup remove callback?
Yes we should.
-------
+ *
139 + * \note May need deprecation - Need a consistent API for high DPI scaling/destination size
140 + *
141 * \param [in] buffer_stream The buffer stream
142 * \param [in] scale The scale
143 - * \return A handle that can be passed to mir_wait_for
144 + * \return A handle that can be passed to mir_wait_for
145 */
146 MirWaitHandle *mir_buffer_
At least the wait handle needs to be done away with.
-------
479 + * \note There is no implicit buffer stream creation. See mir_xxx to attach content.
You mean the "default" buffer stream.
Also, it should read "mir_surface_
-------
488 + * \deprecated No replacement. This property is now part of the backing content
...
503 + * \deprecated No replacement. This property is now part of the backing content
More precisely, there is no default stream backing the surface.
-------
Brandon Schaefer (brandontschaefer) wrote : | # |
This branch is a TODO pretty much of the talk we had during the sprint. Soo more of a working/branch of document i support.
Daniel van Vugt (vanvugt) wrote : | # |
Sounds like status should not be "Needs review" then.
Look to reviewing this one instead:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
Alright, firstly Brandon's branch mentioned above replaced this one.
Secondly, he/we are in the process of proposing the various changes separately as smaller proposals, thus replacing Brandon's first-round-
Daniel van Vugt (vanvugt) wrote : | # |
I'm going to reject this because it's just a notepad. We can still refer to the notes even after it's rejected.
Unmerged revisions
- 3788. By Alberto Aguirre
-
Start deprecation of client side APIs
Preview Diff
1 | === modified file 'include/client/mir_toolkit/debug/surface.h' |
2 | --- include/client/mir_toolkit/debug/surface.h 2015-02-22 07:46:25 +0000 |
3 | +++ include/client/mir_toolkit/debug/surface.h 2016-10-26 15:43:25 +0000 |
4 | @@ -36,16 +36,23 @@ |
5 | |
6 | /** |
7 | * Get the ID of the surface's current buffer (only useful for debug purposes) |
8 | + * |
9 | + * \deprecated Not useful anymore |
10 | + * |
11 | * \pre The surface is valid |
12 | * \param [in] surface The surface |
13 | * \return The internal buffer ID of the surface's current buffer. |
14 | * This is the buffer that is currently being drawn to, |
15 | * and would be returned by mir_surface_get_current_buffer. |
16 | */ |
17 | +[[deprecated]] |
18 | uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); |
19 | |
20 | /** |
21 | * Get the screen coordinates corresponding to a pair of surface coordinates |
22 | + * |
23 | + * \deprecated Use the "debug_surface_coords" extension instead |
24 | + * |
25 | * \pre The surface is valid |
26 | * \param [in] surface The surface |
27 | * \param [in] x, y Surface coordinates to map to screen coordinates |
28 | @@ -59,6 +66,7 @@ |
29 | * This call will only be interesting for automated testing, where both the client |
30 | * and shell state is known and constrained. |
31 | */ |
32 | +[[deprecated]] |
33 | bool mir_debug_surface_coords_to_screen(MirSurface* surface, |
34 | int x, int y, |
35 | int* screen_x, int* screen_y); |
36 | |
37 | === modified file 'include/client/mir_toolkit/mir_buffer_stream.h' |
38 | --- include/client/mir_toolkit/mir_buffer_stream.h 2016-10-12 06:03:15 +0000 |
39 | +++ include/client/mir_toolkit/mir_buffer_stream.h 2016-10-26 15:43:25 +0000 |
40 | @@ -52,6 +52,8 @@ |
41 | /** |
42 | * Create a new buffer stream. |
43 | * |
44 | + * \deprecated See mir_render_surface_create_buffer_stream |
45 | + * |
46 | * For example, the resulting buffer stream may be used |
47 | * with mir_cursor_configuration_from_buffer_stream, |
48 | * in order to post images to the system cursor. |
49 | @@ -70,6 +72,7 @@ |
50 | * |
51 | * \return A handle that can be supplied to mir_wait_for |
52 | */ |
53 | +[[deprecated]] |
54 | MirWaitHandle* mir_connection_create_buffer_stream(MirConnection *connection, |
55 | int width, int height, |
56 | MirPixelFormat format, |
57 | @@ -83,6 +86,8 @@ |
58 | * mir_cursor_configuration_from_buffer_stream in order to post images |
59 | * to the system cursor. |
60 | * |
61 | + * \deprecated See mir_render_surface_create_buffer_stream_sync |
62 | + * |
63 | * \param [in] connection A valid connection |
64 | * \param [in] width Requested buffer width |
65 | * \param [in] height Requested buffer height |
66 | @@ -93,6 +98,7 @@ |
67 | * \return The new buffer stream. This is guaranteed non-null, |
68 | * but may be invalid in the case of error. |
69 | */ |
70 | +[[deprecated]] |
71 | MirBufferStream* mir_connection_create_buffer_stream_sync(MirConnection *connection, |
72 | int width, int height, |
73 | MirPixelFormat format, |
74 | @@ -100,6 +106,9 @@ |
75 | |
76 | /** |
77 | * Release the supplied stream and any associated buffer. The returned wait |
78 | + * |
79 | + * \note TODO: Cleanup remove callback? |
80 | + * |
81 | * handle remains valid until the connection to the server is released. |
82 | * \warning callback could be called from another thread. You must do any |
83 | * locking appropriate to protect your data accessed in the |
84 | @@ -140,17 +149,19 @@ |
85 | * \return One of mir_platform_type_android or |
86 | * mir_platform_type_gbm |
87 | */ |
88 | -/// @cond |
89 | -__attribute__ ((deprecated)) |
90 | -/// @endcond |
91 | +[[deprecated]] |
92 | MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream *stream); |
93 | |
94 | /** |
95 | * Retrieve the current buffer in "raw" representation. |
96 | + * |
97 | + * \deprecated Replaced by a platform specific extension |
98 | + * |
99 | * \pre The buffer stream is valid |
100 | * \param [in] buffer_stream The buffer stream |
101 | * \param [out] buffer_package Structure to be populated |
102 | */ |
103 | +[[deprecated]] |
104 | void mir_buffer_stream_get_current_buffer(MirBufferStream *buffer_stream, |
105 | MirNativeBuffer **buffer_package); |
106 | |
107 | @@ -181,35 +192,47 @@ |
108 | |
109 | /** |
110 | * Retrieve a buffer stream's graphics region |
111 | + * |
112 | * \warning Depending on platform, this can map the graphics buffer each |
113 | * time its called. The region remains mapped until |
114 | * mir_buffer_stream_swap_buffers(). |
115 | * \pre The buffer stream is valid |
116 | * \param [in] buffer_stream The buffer stream |
117 | * \param [out] graphics_region Structure to be populated |
118 | + * \return True if the region is valid, false otherwise. |
119 | */ |
120 | -void mir_buffer_stream_get_graphics_region( |
121 | +bool mir_buffer_stream_get_graphics_region( |
122 | MirBufferStream *buffer_stream, |
123 | MirGraphicsRegion *graphics_region); |
124 | |
125 | /** |
126 | * Retrieve a window type which may be used by EGL. |
127 | + * |
128 | + * \deprecated No replacement, use MirRenderSurface * directly with EGL |
129 | + * |
130 | * \param [in] buffer_stream The buffer stream |
131 | * \return An EGLNativeWindowType that the client can use |
132 | */ |
133 | +[[deprecated]] |
134 | MirEGLNativeWindowType mir_buffer_stream_get_egl_native_window(MirBufferStream *buffer_stream); |
135 | |
136 | /** |
137 | * Set the scale associated with all buffers in the stream |
138 | + * |
139 | + * \note May need deprecation - Need a consistent API for high DPI scaling/destination size |
140 | + * |
141 | * \param [in] buffer_stream The buffer stream |
142 | * \param [in] scale The scale |
143 | - * \return A handle that can be passed to mir_wait_for |
144 | + * \return A handle that can be passed to mir_wait_for |
145 | */ |
146 | MirWaitHandle *mir_buffer_stream_set_scale(MirBufferStream* buffer_stream, float scale); |
147 | |
148 | /** |
149 | * Set the scale as in mir_buffer_stream_set_scale(), but also wait for the |
150 | * operation to complete. |
151 | + * |
152 | + * \note May need deprecation - Need a consistent API for high DPI scaling/destination size |
153 | + * |
154 | * \param [in] buffer_stream The buffer stream |
155 | * \param [in] scale The scale |
156 | */ |
157 | |
158 | === modified file 'include/client/mir_toolkit/mir_connection.h' |
159 | --- include/client/mir_toolkit/mir_connection.h 2016-10-12 06:03:15 +0000 |
160 | +++ include/client/mir_toolkit/mir_connection.h 2016-10-26 15:43:25 +0000 |
161 | @@ -51,7 +51,7 @@ |
162 | char const *server, |
163 | char const *app_name, |
164 | mir_connected_callback callback, |
165 | - void *context); |
166 | + void *context);Â |
167 | |
168 | /** |
169 | * Perform a mir_connect() but also wait for and return the result. |
170 | @@ -89,20 +89,26 @@ |
171 | /** |
172 | * Query platform-specific data and/or file descriptors that are required to |
173 | * initialize GL/EGL features. |
174 | + * |
175 | + * \deprecated Use "get_platform" extension |
176 | + * |
177 | * \param [in] connection The connection |
178 | * \param [out] platform_package Structure to be populated |
179 | */ |
180 | +[[deprecated]] |
181 | void mir_connection_get_platform(MirConnection *connection, MirPlatformPackage *platform_package); |
182 | |
183 | /** |
184 | * Query graphics platform module. |
185 | * |
186 | + * \deprecated Use "get_graphics_module" extension |
187 | * \note The char pointers in MirModuleProperties are owned by the connection and should not be |
188 | * freed. They remain valid until the connection is released. |
189 | * |
190 | * \param [in] connection The connection |
191 | * \param [out] properties Structure to be populated |
192 | */ |
193 | +[[deprecated]] |
194 | void mir_connection_get_graphics_module(MirConnection *connection, MirModuleProperties *properties); |
195 | |
196 | /** |
197 | @@ -146,13 +152,14 @@ |
198 | /** |
199 | * Query the display |
200 | * |
201 | - * \deprecated Use mir_connection_create_display_configuration() instead. |
202 | + * \deprecated See mir_connection_create_display_configuration() |
203 | * |
204 | * \warning return value must be destroyed via mir_display_config_destroy() |
205 | * \warning may return null if connection is invalid |
206 | * \param [in] connection The connection |
207 | * \return structure that describes the display configuration |
208 | */ |
209 | +[[deprecated("Use mir_connection_create_display_configuration")]] |
210 | MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection); |
211 | |
212 | /** |
213 | @@ -189,6 +196,8 @@ |
214 | /** |
215 | * Apply the display configuration |
216 | * |
217 | + * \deprecated Replace with mir_connection_apply_display_configuration(...) |
218 | + * |
219 | * The display configuration is applied to this connection only (per-connection |
220 | * configuration) and is invalidated when a hardware change occurs. Clients should |
221 | * register a callback with mir_connection_set_display_config_change_callback() |
222 | @@ -199,11 +208,14 @@ |
223 | * \param [in] display_configuration The display_configuration to apply |
224 | * \return A handle that can be passed to mir_wait_for |
225 | */ |
226 | +[[deprecated]] |
227 | MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration); |
228 | |
229 | /** |
230 | * Set the base display configuration |
231 | * |
232 | + * \deprecated Use mir_connection_preview_base_display_configuration/mir_connection_confirm_base_display_configuration |
233 | + * |
234 | * The base display configuration is the configuration the server applies when |
235 | * there is no active per-connection configuration. |
236 | * |
237 | @@ -222,6 +234,7 @@ |
238 | * \param [in] display_configuration The display_configuration to set as base |
239 | * \return A handle that can be passed to mir_wait_for |
240 | */ |
241 | +[[deprecated]] |
242 | MirWaitHandle* mir_connection_set_base_display_config( |
243 | MirConnection* connection, |
244 | MirDisplayConfiguration const* display_configuration); |
245 | @@ -298,6 +311,9 @@ |
246 | |
247 | /** |
248 | * Get a display type that can be used for OpenGL ES 2.0 acceleration. |
249 | + * |
250 | + * \deprecated No replacement. Use MirConnection * directly with EGL |
251 | + * |
252 | * \param [in] connection The connection |
253 | * \return An EGLNativeDisplayType that the client can use |
254 | */ |
255 | @@ -306,11 +322,15 @@ |
256 | /** |
257 | * Get the exact MirPixelFormat to use in creating a surface for a chosen |
258 | * EGLConfig. |
259 | + * |
260 | + * \deprecated No replacement. Use EGL configs directly. |
261 | + * |
262 | * \param [in] connection The connection |
263 | * \param [in] egldisplay The EGLDisplay for the given config |
264 | * \param [in] eglconfig The EGLConfig you have chosen to use |
265 | * \return The MirPixelFormat to use in surface creation |
266 | */ |
267 | +[[deprecated]] |
268 | MirPixelFormat mir_connection_get_egl_pixel_format( |
269 | MirConnection *connection, void *egldisplay, void *eglconfig); |
270 | |
271 | @@ -336,6 +356,8 @@ |
272 | /** |
273 | * Perform a platform specific operation. |
274 | * |
275 | + * \deprecated Use the platform extensions API instead |
276 | + * |
277 | * The MirPlatformMessage used for the request needs to remain valid |
278 | * until this operation finishes. |
279 | * |
280 | @@ -345,6 +367,7 @@ |
281 | * \param [in,out] context User data passed to the callback function |
282 | * \return A handle that can be passed to mir_wait_for |
283 | */ |
284 | +[[deprecated]] |
285 | MirWaitHandle* mir_connection_platform_operation( |
286 | MirConnection* connection, |
287 | MirPlatformMessage const* request, |
288 | |
289 | === modified file 'include/client/mir_toolkit/mir_cursor_configuration.h' |
290 | --- include/client/mir_toolkit/mir_cursor_configuration.h 2016-09-08 02:58:56 +0000 |
291 | +++ include/client/mir_toolkit/mir_cursor_configuration.h 2016-10-26 15:43:25 +0000 |
292 | @@ -57,6 +57,9 @@ |
293 | * Returns a new cursor configuration tied to a given buffer stream. |
294 | * If the configuration is successfully applied buffers from the stream will be used |
295 | * to fill the system cursor. |
296 | + * |
297 | + * \note Replace MirBufferStream with MirRenderSurface |
298 | + * |
299 | * \param [in] stream The buffer stream |
300 | * \param [in] hotspot_x The x-coordinate to use as the cursor's hotspot. |
301 | * \param [in] hotspot_y The y-coordinate to use as the cursor's hotspot. |
302 | |
303 | === modified file 'include/client/mir_toolkit/mir_display_configuration.h' |
304 | --- include/client/mir_toolkit/mir_display_configuration.h 2016-10-20 15:07:39 +0000 |
305 | +++ include/client/mir_toolkit/mir_display_configuration.h 2016-10-26 15:43:25 +0000 |
306 | @@ -50,6 +50,8 @@ |
307 | * Get the maximum possible number of simultaneously active outputs this system |
308 | * supports. |
309 | * |
310 | + * No replacement. API is not useful. |
311 | + * |
312 | * \note There may be restrictions on the configuration required to achieve this |
313 | * many active outputs. Typically the achievable number of simultaneously active |
314 | * outputs is lower than this number. |
315 | @@ -58,6 +60,7 @@ |
316 | * \returns The maximum number of simultaneously active outputs |
317 | * supportable at this time. |
318 | */ |
319 | +[[deprecated]] |
320 | int mir_display_config_get_max_simultaneous_outputs( |
321 | MirDisplayConfig const* config); |
322 | |
323 | @@ -263,9 +266,12 @@ |
324 | /** |
325 | * Get the textual name of an output type. |
326 | * |
327 | + * \deprecated See mir_output_type_name |
328 | + * |
329 | * \param [in] type The MirDisplayOutputType to describe. |
330 | * \returns The name of the output type. |
331 | */ |
332 | +[[deprecated]] |
333 | char const* mir_display_output_type_name(MirDisplayOutputType type); |
334 | |
335 | /** |
336 | |
337 | === modified file 'include/client/mir_toolkit/mir_platform_message.h' |
338 | --- include/client/mir_toolkit/mir_platform_message.h 2014-12-10 11:02:04 +0000 |
339 | +++ include/client/mir_toolkit/mir_platform_message.h 2016-10-26 15:43:25 +0000 |
340 | @@ -48,16 +48,22 @@ |
341 | * Each call to mir_platform_message_create() should be matched by |
342 | * a call to mir_platform_message_release() to avoid memory leaks. |
343 | * |
344 | + * \deprecated Use platform extensions API |
345 | + * |
346 | * \param [in] opcode The platform message opcode |
347 | * \return The created MirPlatformMessage |
348 | */ |
349 | +[[deprecated]] |
350 | MirPlatformMessage* mir_platform_message_create(unsigned int opcode); |
351 | |
352 | /** |
353 | * Release a platform message. |
354 | * |
355 | + * \deprecated Use platform extensions API |
356 | + * |
357 | * \param [in] message The MirPlatformMessage |
358 | */ |
359 | +[[deprecated]] |
360 | void mir_platform_message_release(MirPlatformMessage const* message); |
361 | |
362 | /** |
363 | @@ -65,10 +71,13 @@ |
364 | * |
365 | * The data is copied into the message. |
366 | * |
367 | + * \deprecated Use platform extensions API |
368 | + * |
369 | * \param [in] message The MirPlatformMessage |
370 | * \param [in] data Pointer to the data |
371 | * \param [in] data_size The size of the data in bytes |
372 | */ |
373 | +[[deprecated]] |
374 | void mir_platform_message_set_data(MirPlatformMessage* message, void const* data, size_t data_size); |
375 | |
376 | /** |
377 | @@ -82,18 +91,24 @@ |
378 | * is released. The caller is responsible for closing the fds when the message |
379 | * doesn't need them anymore (see also mir_platform_message_get_fds()). |
380 | * |
381 | + * \deprecated Use platform extensions API |
382 | + * |
383 | * \param [in] message The MirPlatformMessage |
384 | * \param [in] fds Pointer to the array of fds |
385 | * \param [in] num_fds The number of fds |
386 | */ |
387 | +[[deprecated]] |
388 | void mir_platform_message_set_fds(MirPlatformMessage* message, int const* fds, size_t num_fds); |
389 | |
390 | /** |
391 | * Get the opcode of a message. |
392 | * |
393 | + * \deprecated Use platform extensions API |
394 | + * |
395 | * \param [in] message The MirPlatformMessage |
396 | * \return The opcode |
397 | */ |
398 | +[[deprecated]] |
399 | unsigned int mir_platform_message_get_opcode(MirPlatformMessage const* message); |
400 | |
401 | /** |
402 | @@ -103,9 +118,11 @@ |
403 | * valid only as long as the message is valid and mir_platform_set_data() is |
404 | * not called. You must not change or free the returned data array. |
405 | * |
406 | + * \deprecated Use platform extensions API |
407 | * \param [in] message The MirPlatformMessage |
408 | * \return The data |
409 | */ |
410 | +[[deprecated]] |
411 | MirPlatformMessageData mir_platform_message_get_data(MirPlatformMessage const* message); |
412 | |
413 | /** |
414 | @@ -119,9 +136,11 @@ |
415 | * message is released. Users are responsible for getting and closing the |
416 | * fds to avoid leaks. |
417 | * |
418 | + * \deprecated Use platform extensions API |
419 | * \param [in] message The MirPlatformMessage |
420 | * \return The fds |
421 | */ |
422 | +[[deprecated]] |
423 | MirPlatformMessageFds mir_platform_message_get_fds(MirPlatformMessage const* message); |
424 | |
425 | #ifdef __cplusplus |
426 | |
427 | === modified file 'include/client/mir_toolkit/mir_screencast.h' |
428 | --- include/client/mir_toolkit/mir_screencast.h 2016-07-18 07:38:38 +0000 |
429 | +++ include/client/mir_toolkit/mir_screencast.h 2016-10-26 15:43:25 +0000 |
430 | @@ -89,10 +89,13 @@ |
431 | /** |
432 | * Set the requested number of buffers to use. |
433 | * |
434 | + * \deprecated See mir_screencast_capture_to_buffer |
435 | + * |
436 | * \param [in] spec Specification to mutate |
437 | * \param [in] nbuffers The number of buffers to allocate for screencasting |
438 | * |
439 | */ |
440 | +[[deprecated]] |
441 | void mir_screencast_spec_set_number_of_buffers(MirScreencastSpec* spec, unsigned int nbuffers); |
442 | |
443 | /** |
444 | @@ -135,11 +138,14 @@ |
445 | * |
446 | * A screencast allows clients to read the contents of the screen. |
447 | * |
448 | + * \deprecated See mir_screencast_create_sync |
449 | + * |
450 | * \warning This request may be denied. |
451 | * \param [in] connection The connection |
452 | * \param [in] parameters The screencast parameters |
453 | * \return The resulting screencast |
454 | */ |
455 | +[[deprecated]] |
456 | MirScreencast* mir_connection_create_screencast_sync( |
457 | MirConnection* connection, |
458 | MirScreencastParameters* parameters); |
459 | @@ -155,8 +161,11 @@ |
460 | * Retrieve the MirBufferStream associated with a screencast |
461 | * (to advance buffers, obtain EGLNativeWindowType, etc...) |
462 | * |
463 | + * \deprecated See mir_screencast_capture_to_buffer |
464 | + * |
465 | * \param[in] screencast The screencast |
466 | */ |
467 | +[[deprecated]] |
468 | MirBufferStream* mir_screencast_get_buffer_stream(MirScreencast* screencast); |
469 | |
470 | #ifdef __cplusplus |
471 | |
472 | === modified file 'include/client/mir_toolkit/mir_surface.h' |
473 | --- include/client/mir_toolkit/mir_surface.h 2016-10-12 06:03:15 +0000 |
474 | +++ include/client/mir_toolkit/mir_surface.h 2016-10-26 15:43:25 +0000 |
475 | @@ -232,6 +232,7 @@ |
476 | /** |
477 | * Create a surface from a given specification |
478 | * |
479 | + * \note There is no implicit buffer stream creation. See mir_xxx to attach content. |
480 | * |
481 | * \param [in] requested_specification Specification of the attributes for the created surface |
482 | * \param [in] callback Callback function to be invoked when creation is complete |
483 | @@ -411,6 +412,9 @@ |
484 | |
485 | /** |
486 | * Set the requested pixel format. |
487 | + * |
488 | + * \deprecated No replacement. This property is now part of the backing content |
489 | + * |
490 | * \param [in] spec Specification to mutate |
491 | * \param [in] format Requested pixel format |
492 | * |
493 | @@ -418,10 +422,14 @@ |
494 | * If the server is unable to create a surface with this pixel format at |
495 | * the point mir_surface_create() is called it will instead return an invalid surface. |
496 | */ |
497 | +[[deprecated]] |
498 | void mir_surface_spec_set_pixel_format(MirSurfaceSpec* spec, MirPixelFormat format); |
499 | |
500 | /** |
501 | * Set the requested buffer usage. |
502 | + * |
503 | + * \deprecated No replacement. This property is now part of the backing content |
504 | + * |
505 | * \param [in] spec Specification to mutate |
506 | * \param [in] usage Requested buffer usage |
507 | * |
508 | @@ -429,13 +437,15 @@ |
509 | * If the server is unable to create a surface with this buffer usage at |
510 | * the point mir_surface_create() is called it will instead return an invalid surface. |
511 | */ |
512 | +[[deprecated]] |
513 | void mir_surface_spec_set_buffer_usage(MirSurfaceSpec* spec, MirBufferUsage usage); |
514 | |
515 | /** |
516 | * \param [in] spec Specification to mutate |
517 | * \param [in] output_id ID of output to place surface on. From MirDisplayOutput.output_id |
518 | * |
519 | - * \note If this call returns %true then a valid surface returned from mir_surface_create() is |
520 | + * \note Update comment below |
521 | + * \note If this call returns %t then a valid surface returned from mir_surface_create() is |
522 | * guaranteed to be fullscreen on the specified output. An invalid surface is returned |
523 | * if the server unable to, or policy prevents it from, honouring this request. |
524 | */ |
525 | @@ -501,6 +511,8 @@ |
526 | * but is in the list will be associated with the surface. |
527 | * Streams set a displacement from the top-left corner of the surface. |
528 | * |
529 | + * \deprecated Replaced by mir_surface_set_render_surfaces |
530 | + * |
531 | * \warning disassociating streams from the surface will not release() them. |
532 | * \warning It is wiser to arrange the streams within the bounds of the |
533 | * surface the spec is applied to. Shells can define their own |
534 | @@ -510,6 +522,7 @@ |
535 | * \param [in] streams An array of non-null streams info. |
536 | * \param [in] num_streams The number of elements in the streams array. |
537 | */ |
538 | +[[deprecated]] |
539 | void mir_surface_spec_set_streams(MirSurfaceSpec* spec, |
540 | MirBufferStreamInfo* streams, |
541 | unsigned int num_streams); |
542 | @@ -600,6 +613,9 @@ |
543 | |
544 | /** |
545 | * Set the event handler to be called when events arrive for a surface. |
546 | + * |
547 | + * \deprecated Use mir_surface_spec_set_event_handler instead. |
548 | + * |
549 | * \warning event_handler could be called from another thread. You must do |
550 | * any locking appropriate to protect your data accessed in the |
551 | * callback. There is also a chance that different events will be |
552 | @@ -609,6 +625,7 @@ |
553 | * \param [in] callback The callback function |
554 | * \param [in] context Additional argument to be passed to callback |
555 | */ |
556 | +[[deprecated("Use mir_surface_spec_set_event_handler")]] |
557 | void mir_surface_set_event_handler(MirSurface *surface, |
558 | mir_surface_event_callback callback, |
559 | void* context); |
560 | @@ -626,6 +643,7 @@ |
561 | * be removed, and this function will return NULL. |
562 | * \param[in] surface The surface |
563 | */ |
564 | +[[deprecated]] |
565 | MirBufferStream* mir_surface_get_buffer_stream(MirSurface *surface); |
566 | |
567 | /** |
568 | @@ -649,10 +667,14 @@ |
569 | |
570 | /** |
571 | * Get a surface's parameters. |
572 | + * |
573 | + * \deprecated MirSurfaceParameters is obsolete. |
574 | + * |
575 | * \pre The surface is valid |
576 | * \param [in] surface The surface |
577 | * \param [out] parameters Structure to be populated |
578 | */ |
579 | +[[deprecated]] |
580 | void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters); |
581 | |
582 | /** |
583 | @@ -681,29 +703,44 @@ |
584 | |
585 | /** |
586 | * Get the type (purpose) of a surface. |
587 | + * |
588 | + * \deprecated ? Mostly a convenience function. Look for MirSurfaceType events instead? |
589 | + * |
590 | * \param [in] surface The surface to query |
591 | * \return The type of the surface |
592 | */ |
593 | +[[deprecated]] |
594 | MirSurfaceType mir_surface_get_type(MirSurface *surface); |
595 | |
596 | /** |
597 | * Change the state of a surface. |
598 | + * |
599 | + * \deprecated Use mir_surface_apply_spec instead |
600 | + * |
601 | * \param [in] surface The surface to operate on |
602 | * \param [in] state The new state of the surface |
603 | * \return A wait handle that can be passed to mir_wait_for |
604 | */ |
605 | +[[deprecated("See mir_surface_apply_spec")]] |
606 | MirWaitHandle* mir_surface_set_state(MirSurface *surface, |
607 | MirSurfaceState state); |
608 | |
609 | /** |
610 | * Get the current state of a surface. |
611 | + * |
612 | + * \deprecated ? Mostly a convenience function. Look for MirSurfaceState events instead? |
613 | + * |
614 | * \param [in] surface The surface to query |
615 | * \return The state of the surface |
616 | */ |
617 | +[[deprecated]] |
618 | MirSurfaceState mir_surface_get_state(MirSurface *surface); |
619 | |
620 | /** |
621 | * Set the swapinterval for the default stream. |
622 | + * |
623 | + * \deprecated No replacement. This is not a property of the surface anymore. |
624 | + * |
625 | * \warning EGL users should use eglSwapInterval directly. |
626 | * \warning Only swapinterval of 0 or 1 is supported. |
627 | * \warning If the surface was created with, or modified to have a |
628 | @@ -716,27 +753,39 @@ |
629 | * \return A wait handle that can be passed to mir_wait_for, |
630 | * or NULL if the interval could not be supported |
631 | */ |
632 | +[[deprecated]] |
633 | MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval); |
634 | |
635 | /** |
636 | * Query the swapinterval that the surface is operating with. |
637 | * The default interval is 1. |
638 | + * |
639 | + * \deprecated No replacement. This is not a property of the surface anymore. |
640 | + * |
641 | * \param [in] surface The surface to operate on |
642 | * \return The swapinterval value that the client is operating with. |
643 | * Returns -1 if surface is invalid, or if the default stream |
644 | * was removed by use of mir_surface_spec_set_streams(). |
645 | */ |
646 | +[[deprecated]] |
647 | int mir_surface_get_swapinterval(MirSurface* surface); |
648 | |
649 | /** |
650 | * Query the DPI value of the surface (dots per inch). This will vary depending |
651 | * on the physical display configuration and where the surface is within it. |
652 | + * |
653 | + * \deprecated ? Mostly a convenience function - Use dpi events instead? |
654 | + * |
655 | * \return The DPI of the surface, or zero if unknown. |
656 | */ |
657 | +[[deprecated]] |
658 | int mir_surface_get_dpi(MirSurface* surface); |
659 | |
660 | /** |
661 | * Query the focus state for a surface. |
662 | + * |
663 | + * \deprecated |
664 | + * |
665 | * \param [in] surface The surface to operate on |
666 | * \return The focus state of said surface |
667 | */ |
668 | @@ -744,6 +793,9 @@ |
669 | |
670 | /** |
671 | * Query the visibility state for a surface. |
672 | + * |
673 | + * \deprecated |
674 | + * |
675 | * \param [in] surface The surface to operate on |
676 | * \return The visibility state of said surface |
677 | */ |
678 | @@ -752,6 +804,9 @@ |
679 | /** |
680 | * Choose the cursor state for a surface: whether a cursor is shown, |
681 | * and which cursor if so. |
682 | + * |
683 | + * \deprecated Use mir_surface_apply_spec instead |
684 | + * |
685 | * \param [in] surface The surface to operate on |
686 | * \param [in] parameters The configuration parameters obtained |
687 | * from mir_cursor* family of functions. |
688 | @@ -759,30 +814,43 @@ |
689 | * or NULL if parameters is invalid. |
690 | * |
691 | */ |
692 | +[[deprecated("See mir_surface_apply_spec")]] |
693 | MirWaitHandle* mir_surface_configure_cursor(MirSurface *surface, MirCursorConfiguration const* parameters); |
694 | |
695 | /** |
696 | * Get the orientation of a surface. |
697 | + * |
698 | + * \deprecated ? Mostly a convenience function - Use dpi events instead? |
699 | + * |
700 | * \param [in] surface The surface to query |
701 | * \return The orientation of the surface |
702 | */ |
703 | +[[deprecated]] |
704 | MirOrientation mir_surface_get_orientation(MirSurface *surface); |
705 | |
706 | /** |
707 | * Request to set the preferred orientations of a surface. |
708 | * The request may be rejected by the server; to check wait on the |
709 | * result and check the applied value using mir_surface_get_preferred_orientation |
710 | + * |
711 | + * \deprecated Use mir_surface_apply_spec instead |
712 | + * |
713 | * \param [in] surface The surface to operate on |
714 | * \param [in] orientation The preferred orientation modes |
715 | * \return A wait handle that can be passed to mir_wait_for |
716 | */ |
717 | +[[deprecated("See mir_surface_apply_spec")]] |
718 | MirWaitHandle* mir_surface_set_preferred_orientation(MirSurface *surface, MirOrientationMode orientation); |
719 | |
720 | /** |
721 | * Get the preferred orientation modes of a surface. |
722 | + * |
723 | + * \deprecated No alternative as client should already know what the preferred orientation the surface is set to. |
724 | + * |
725 | * \param [in] surface The surface to query |
726 | * \return The preferred orientation modes |
727 | */ |
728 | +[[deprecated]] |
729 | MirOrientationMode mir_surface_get_preferred_orientation(MirSurface *surface); |
730 | |
731 | /** |
732 | |
733 | === modified file 'include/core/mir_toolkit/common.h' |
734 | --- include/core/mir_toolkit/common.h 2016-10-20 15:05:56 +0000 |
735 | +++ include/core/mir_toolkit/common.h 2016-10-26 15:43:25 +0000 |
736 | @@ -349,6 +349,7 @@ |
737 | { |
738 | mir_shell_chrome_normal, |
739 | mir_shell_chrome_low, |
740 | + mir_shell_chrome_none |
741 | } MirShellChrome; |
742 | |
743 | /** |
Alexandros pointed out that the getter APIs (such as mir_surface_ get_state, mir_surface_ get_type, etc) are just as racy as receiving the corresponding events, therefore should be left in.