~cemil-azizoglu/mir/enum-deprecation

« back to all changes in this revision

Viewing changes to include/client/mir_toolkit/mir_surface.h

  • Committer: Cemil Azizoglu
  • Date: 2017-01-03 18:06:41 UTC
  • Revision ID: cemil.azizoglu@canonical.com-20170103180641-1kv03uueb1kercvn
mir_window_create and mir_window_create_sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 * \param [in] width        Requested width. The server is not guaranteed to return a window of this width.
44
44
 * \param [in] height       Requested height. The server is not guaranteed to return a window of this height.
45
45
 *
46
 
 * \return                  A handle that can be passed to mir_surface_create() to complete construction.
 
46
 * \return                  A handle that can be passed to mir_window_create() to complete construction.
47
47
 */
48
48
MirWindowSpec* mir_create_normal_window_spec(MirConnection* connection,
49
49
                                             int width, int height);
69
69
 *                          location.
70
70
 * \param [in] edge         The preferred edge direction to attach to. Use
71
71
 *                          mir_edge_attachment_any for no preference.
72
 
 * \return                  A handle that can be passed to mir_surface_create()
 
72
 * \return                  A handle that can be passed to mir_window_create()
73
73
 *                          to complete construction.
74
74
 */
75
75
MirWindowSpec*
100
100
 *                          location.
101
101
 * \param [in] edge         The preferred edge direction to attach to. Use
102
102
 *                          mir_edge_attachment_any for no preference.
103
 
 * \return                  A handle that can be passed to mir_surface_create()
 
103
 * \return                  A handle that can be passed to mir_window_create()
104
104
 *                          to complete construction.
105
105
 */
106
106
MirWindowSpec*
163
163
 * \param [in] connection   Connection the window will be created on
164
164
 * \param [in] width        Requested width. The server is not guaranteed to return a window of this width.
165
165
 * \param [in] height       Requested height. The server is not guaranteed to return a window of this height.
166
 
 * \return                  A handle that can be passed to mir_surface_create() to complete construction.
 
166
 * \return                  A handle that can be passed to mir_window_create() to complete construction.
167
167
 */
168
168
MirWindowSpec*
169
169
mir_create_input_method_window_spec(MirConnection* connection,
171
171
 
172
172
/**
173
173
 * Create a window specification.
174
 
 * This can be used with mir_surface_create() to create a window or with
 
174
 * This can be used with mir_window_create() to create a window or with
175
175
 * mir_window_apply_spec() to change an existing window.
176
 
 * \remark For use with mir_surface_create() at least the type, width, height,
 
176
 * \remark For use with mir_window_create() at least the type, width, height,
177
177
 * format and buffer_usage must be set. (And for types requiring a parent that
178
178
 * too must be set.)
179
179
 *
180
180
 * \param [in] connection   a valid mir connection
181
181
 * \return                  A handle that can ultimately be passed to
182
 
 *                          mir_surface_create() or mir_window_apply_spec()
 
182
 *                          mir_window_create() or mir_window_apply_spec()
183
183
 */
184
184
MirWindowSpec* mir_create_window_spec(MirConnection* connection);
185
185
 
193
193
 
194
194
/**
195
195
 * Update a window specification with a window type.
196
 
 * This can be used with mir_surface_create() to create a window or with
 
196
 * This can be used with mir_window_create() to create a window or with
197
197
 * mir_window_apply_spec() to change an existing window.
198
198
 * \remark For use with mir_window_apply_spec() the shell need not support
199
199
 * arbitrary changes of type and some target types may require the setting of
345
345
 * \param [in] spec         Specification to mutate
346
346
 * \param [in] output_id    ID of output to place window on. From MirDisplayOutput.output_id
347
347
 *
348
 
 * \note    If this call returns %true then a valid window returned from mir_surface_create() is
 
348
 * \note    If this call returns %true then a valid window returned from mir_window_create() is
349
349
 *          guaranteed to be fullscreen on the specified output. An invalid window is returned
350
350
 *          if the server unable to, or policy prevents it from, honouring this request.
351
351
 */
357
357
 * \param [in] mode    Requested preferred orientation
358
358
 *
359
359
 * \note    If the server is unable to create a window with the preferred orientation at
360
 
 *          the point mir_surface_create() is called it will instead return an invalid window.
 
360
 *          the point mir_window_create() is called it will instead return an invalid window.
361
361
 */
362
362
void mir_window_spec_set_preferred_orientation(MirWindowSpec* spec, MirOrientationMode mode);
363
363
 
375
375
 *                              mir_edge_attachment_any for no preference.
376
376
 * \return                      False if the operation is invalid for this window type.
377
377
 *
378
 
 * \note    If the parent window becomes invalid before mir_surface_create() is processed,
 
378
 * \note    If the parent window becomes invalid before mir_window_create() is processed,
379
379
 *          it will return an invalid window. If the parent window is valid at the time
380
 
 *          mir_surface_create() is called but is later closed, this window will also receive
 
380
 *          mir_window_create() is called but is later closed, this window will also receive
381
381
 *          a close event.
382
382
 */
383
383
bool mir_window_spec_attach_to_foreign_parent(MirWindowSpec* spec,
391
391
 * \param [in] state   Requested state
392
392
 *
393
393
 * \note    If the server is unable to create a window with the requested state at
394
 
 *          the point mir_surface_create() is called it will instead return an invalid window.
 
394
 *          the point mir_window_create() is called it will instead return an invalid window.
395
395
 */
396
396
void mir_window_spec_set_state(MirWindowSpec* spec, MirSurfaceState state);
397
397
 
492
492
 *
493
493
 * \note    If this call returns %true then the server is guaranteed to honour this request.
494
494
 *          If the server is unable to create a window with this pixel format at
495
 
 *          the point mir_surface_create() is called it will instead return an invalid window.
 
495
 *          the point mir_window_create() is called it will instead return an invalid window.
496
496
 */
497
497
void mir_window_spec_set_pixel_format(MirWindowSpec* spec, MirPixelFormat format);
498
498
 
505
505
 *
506
506
 * \note    If this call returns %true then the server is guaranteed to honour this request.
507
507
 *          If the server is unable to create a window with this buffer usage at
508
 
 *          the point mir_surface_create() is called it will instead return an invalid window.
 
508
 *          the point mir_window_create() is called it will instead return an invalid window.
509
509
 */
510
510
void mir_window_spec_set_buffer_usage(MirWindowSpec* spec, MirBufferUsage usage);
511
511
 
550
550
void mir_window_apply_spec(MirWindow* window, MirWindowSpec* spec);
551
551
 
552
552
/**
 
553
 * Create a window from a given specification
 
554
 *
 
555
 *
 
556
 * \param [in] requested_specification  Specification of the attributes for the created window
 
557
 * \param [in] callback                 Callback function to be invoked when creation is complete
 
558
 * \param [in, out] context             User data passed to callback function.
 
559
 *                                      This callback is guaranteed to be called, and called with a
 
560
 *                                      non-null MirWindow*, but the window may be invalid in
 
561
 *                                      case of an error.
 
562
 */
 
563
void mir_window_create(MirWindowSpec* requested_specification,
 
564
                       mir_window_callback callback, void* context);
 
565
 
 
566
/**
 
567
 * Create a window from a given specification and wait for the result.
 
568
 * \param [in] requested_specification  Specification of the attributes for the created window
 
569
 * \return                              The new window. This is guaranteed non-null, but may be invalid
 
570
 *                                      in the case of error.
 
571
 */
 
572
MirWindow* mir_window_create_sync(MirWindowSpec* requested_specification);
 
573
 
 
574
/**
553
575
 * Test for a valid window
554
576
 *   \param [in] window   The window
555
577
 *   \return              True if the supplied window is valid, or
744
766
 */
745
767
MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,
746
768
                                  mir_surface_callback callback, void* context);
 
769
//__attribute__((deprecated("use mir_window_create() instead")));
747
770
 
748
 
/**
749
 
 * Create a surface from a given specification and wait for the result.
750
 
 * \param [in] requested_specification  Specification of the attributes for the created surface
751
 
 * \return                              The new surface. This is guaranteed non-null, but may be invalid
752
 
 *                                      in the case of error.
753
 
 */
754
771
MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification);
 
772
//__attribute__((deprecated("use mir_window_create_sync() instead")));
755
773
 
756
774
/**
757
775
 * Set the event handler to be called when events arrive for a surface.