Mir
mir_surface.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012-2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #ifndef MIR_TOOLKIT_MIR_SURFACE_H_
19 #define MIR_TOOLKIT_MIR_SURFACE_H_
20 
23 #include <mir_toolkit/common.h>
25 
26 #include <stdbool.h>
27 
28 #ifdef __cplusplus
29 
33 extern "C" {
34 #endif
35 
49  int width,
50  int height,
51  MirPixelFormat format);
52 
80  int width,
81  int height,
82  MirPixelFormat format,
83  MirSurface* parent,
84  MirRectangle* rect,
85  MirEdgeAttachment edge);
86 
112  int width,
113  int height,
114  MirPixelFormat format,
115  MirSurface* parent,
116  MirRectangle* zone);
117 
142  int width,
143  int height,
144  MirPixelFormat format,
145  MirSurface* parent);
146 
166  int width,
167  int height,
168  MirPixelFormat format);
169 
183 
195 
208 MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,
209  mir_surface_callback callback, void* context);
210 
217 MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification);
218 
226 
245 
257 void mir_surface_spec_set_name(MirSurfaceSpec* spec, char const* name);
258 
268 void mir_surface_spec_set_width(MirSurfaceSpec* spec, unsigned width);
269 
280 
292 void mir_surface_spec_set_width_increment(MirSurfaceSpec* spec, unsigned width_inc);
293 
305 void mir_surface_spec_set_height_increment(MirSurfaceSpec* spec, unsigned height_inc);
306 
316 void mir_surface_spec_set_min_width(MirSurfaceSpec* spec, unsigned min_width);
317 
327 void mir_surface_spec_set_min_height(MirSurfaceSpec* spec, unsigned min_height);
337 void mir_surface_spec_set_max_width(MirSurfaceSpec* spec, unsigned max_width);
338 
348 void mir_surface_spec_set_max_height(MirSurfaceSpec* spec, unsigned max_height);
349 
361 void mir_surface_spec_set_min_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height);
362 
374 void mir_surface_spec_set_max_aspect_ratio(MirSurfaceSpec* spec, unsigned width, unsigned height);
375 
386 
397 
406 void mir_surface_spec_set_fullscreen_on_output(MirSurfaceSpec* spec, uint32_t output_id);
407 
417 
438  MirPersistentId* parent,
439  MirRectangle* attachment_rect,
440  MirEdgeAttachment edge);
441 
451 
458 
478  MirBufferStreamInfo* streams,
479  unsigned int num_streams);
480 
494  MirRectangle const *rectangles,
495  size_t n_rects);
496 
509  MirSurfaceSpec* spec,
511  void* context);
512 
513 
522 
532 
546  void* context);
547 
562 
569 bool mir_surface_is_valid(MirSurface *surface);
570 
580 char const *mir_surface_get_error_message(MirSurface *surface);
581 
589 
603  MirSurface *surface,
604  mir_surface_callback callback,
605  void *context);
606 
612 void mir_surface_release_sync(MirSurface *surface);
613 
620 
628  MirSurfaceState state);
629 
636 
651 MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval);
652 
662 
668 int mir_surface_get_dpi(MirSurface* surface);
669 
676 
683 
695 
702 
712 
719 
732  int width,
733  int height,
734  MirPixelFormat format);
735 
743 void mir_surface_apply_spec(MirSurface* surface, MirSurfaceSpec* spec);
744 
759 
767 
776 
784 
794 
800 MirPersistentId* mir_persistent_id_from_string(char const* string_representation);
801 
809 void mir_surface_raise(MirSurface* surface, MirCookie const* cookie);
810 
811 #ifdef __cplusplus
812 }
814 #endif
815 
816 #endif /* MIR_TOOLKIT_MIR_SURFACE_H_ */
void mir_surface_spec_release(MirSurfaceSpec *spec)
Release the resources held by a MirSurfaceSpec.
Definition: mir_surface_api.cpp:234
Definition: mir_surface.h:86
void mir_surface_spec_set_type(MirSurfaceSpec *spec, MirSurfaceType type)
Update a surface specification with a surface type.
Definition: mir_surface_api.cpp:646
Definition: mir_surface.h:147
void mir_surface_spec_set_max_aspect_ratio(MirSurfaceSpec *spec, unsigned width, unsigned height)
Set the maximum aspect ratio.
Definition: mir_surface_api.cpp:686
struct MirBufferStream MirBufferStream
Definition: client_types.h:46
void(* mir_surface_id_callback)(MirSurface *surface, MirPersistentId *id, void *context)
Definition: client_types.h:151
void mir_surface_spec_set_height_increment(MirSurfaceSpec *spec, unsigned height_inc)
Set the requested height increment, in pixels Defines an arithmetic progression of sizes starting wit...
Definition: mir_surface_api.cpp:666
void(* mir_surface_event_callback)(MirSurface *surface, MirEvent const *event, void *context)
Callback for handling of surface events.
Definition: client_types.h:104
Definition: mir_wait_handle.h:31
void mir_surface_spec_set_min_aspect_ratio(MirSurfaceSpec *spec, unsigned width, unsigned height)
Set the minimum aspect ratio.
Definition: mir_surface_api.cpp:676
MirSurfaceType mir_surface_get_type(MirSurface *surface)
Get the type (purpose) of a surface.
Definition: mir_surface_api.cpp:284
MirWaitHandle * mir_surface_set_preferred_orientation(MirSurface *surface, MirOrientationMode orientation)
Request to set the preferred orientations of a surface.
Definition: mir_surface_api.cpp:479
MirPersistentId * mir_persistent_id_from_string(char const *string_representation)
Deserialise a string representation of a MirSurfaceId.
Definition: mir_surface_api.cpp:768
MirSurfaceSpec * mir_connection_create_spec_for_changes(MirConnection *connection)
Create a surface specification for updating a surface.
Definition: mir_surface_api.cpp:535
void mir_surface_spec_set_shell_chrome(MirSurfaceSpec *spec, MirShellChrome style)
Ask the shell to customize "chrome" for this surface.
Definition: mir_surface_api.cpp:228
void mir_surface_spec_set_min_width(MirSurfaceSpec *spec, unsigned min_width)
Set the minimum width, in pixels.
Definition: mir_surface_api.cpp:175
void mir_surface_spec_set_buffer_usage(MirSurfaceSpec *spec, MirBufferUsage usage)
Set the requested buffer usage.
Definition: mir_surface_api.cpp:200
MirWaitHandle * mir_surface_set_state(MirSurface *surface, MirSurfaceState state)
Change the state of a surface.
Definition: mir_surface_api.cpp:300
bool mir_persistent_id_is_valid(MirPersistentId *id)
Check the validity of a MirPersistentId.
Definition: mir_surface_api.cpp:733
The displacement from the top-left corner of the surface.
Definition: client_types.h:364
MirPointerConfinementState
Pointer Confinement.
Definition: common.h:228
char const * mir_surface_get_error_message(MirSurface *surface)
Retrieve a text description of the error.
Definition: mir_surface_api.cpp:251
void mir_surface_release_sync(MirSurface *surface)
Release the specified surface like in mir_surface_release(), but also wait for the operation to compl...
Definition: mir_surface_api.cpp:277
MirSurfaceFocusState mir_surface_get_focus(MirSurface *surface)
Query the focus state for a surface.
Definition: mir_surface_api.cpp:406
char const * mir_persistent_id_as_string(MirPersistentId *id)
Get a string representation of a MirSurfaceId.
Definition: mir_surface_api.cpp:763
void mir_surface_raise(MirSurface *surface, MirCookie const *cookie)
Attempts to raise the surface to the front.
Definition: mir_surface_api.cpp:496
void mir_surface_spec_set_pixel_format(MirSurfaceSpec *spec, MirPixelFormat format)
Set the requested pixel format.
Definition: mir_surface_api.cpp:195
MirWaitHandle * mir_surface_set_swapinterval(MirSurface *surface, int interval)
Set the swapinterval for the default stream.
Definition: mir_surface_api.cpp:346
MirSurfaceSpec * mir_connection_create_spec_for_tooltip(MirConnection *connection, int width, int height, MirPixelFormat format, MirSurface *parent, MirRectangle *zone)
Create a surface specification for a tooltip surface.
Definition: mir_surface_api.cpp:78
MirWaitHandle * mir_surface_configure_cursor(MirSurface *surface, MirCursorConfiguration const *parameters)
Choose the cursor state for a surface: whether a cursor is shown, and which cursor if so...
Definition: mir_surface_api.cpp:444
bool mir_surface_spec_attach_to_foreign_parent(MirSurfaceSpec *spec, MirPersistentId *parent, MirRectangle *attachment_rect, MirEdgeAttachment edge)
Request that the created surface be attached to a surface of a different client.
Definition: mir_surface_api.cpp:743
MirSurfaceVisibility mir_surface_get_visibility(MirSurface *surface)
Query the visibility state for a surface.
Definition: mir_surface_api.cpp:425
MirSurfaceState mir_surface_get_state(MirSurface *surface)
Get the current state of a surface.
Definition: mir_surface_api.cpp:313
MirSurfaceSpec * mir_connection_create_spec_for_modal_dialog(MirConnection *connection, int width, int height, MirPixelFormat format, MirSurface *parent)
Create a surface specification for a modal dialog surface.
Definition: mir_surface_api.cpp:115
int mir_surface_get_swapinterval(MirSurface *surface)
Query the swapinterval that the surface is operating with.
Definition: mir_surface_api.cpp:367
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
MirWaitHandle * mir_surface_release(MirSurface *surface, mir_surface_callback callback, void *context)
Release the supplied surface and any associated buffer.
Definition: mir_surface_api.cpp:261
void mir_surface_spec_set_height(MirSurfaceSpec *spec, unsigned height)
Set the requested height, in pixels.
Definition: mir_surface_api.cpp:170
void mir_surface_spec_set_max_height(MirSurfaceSpec *spec, unsigned max_height)
Set the maximum height, in pixels.
Definition: mir_surface_api.cpp:190
void mir_persistent_id_release(MirPersistentId *id)
Free a MirPersistentId.
Definition: mir_surface_api.cpp:738
Definition: mir_surface.h:136
void mir_surface_spec_set_parent(MirSurfaceSpec *spec, MirSurface *parent)
Set the requested parent.
Definition: mir_surface_api.cpp:635
MirWaitHandle * mir_surface_request_persistent_id(MirSurface *surface, mir_surface_id_callback callback, void *context)
Request an ID for the surface that can be shared cross-process and across restarts.
Definition: mir_surface_api.cpp:706
MirSurfaceState
Definition: common.h:64
void mir_surface_spec_set_input_shape(MirSurfaceSpec *spec, MirRectangle const *rectangles, size_t n_rects)
Set a collection of input rectangles assosciated with the spec.
Definition: mir_surface_api.cpp:617
void mir_surface_spec_set_event_handler(MirSurfaceSpec *spec, mir_surface_event_callback callback, void *context)
Set the event handler to be called when events arrive for a surface.
Definition: mir_surface_api.cpp:221
void mir_surface_spec_set_width(MirSurfaceSpec *spec, unsigned width)
Set the requested width, in pixels.
Definition: mir_surface_api.cpp:165
bool mir_surface_is_valid(MirSurface *surface)
Test for a valid surface.
Definition: mir_surface_api.cpp:246
void mir_surface_spec_set_fullscreen_on_output(MirSurfaceSpec *spec, uint32_t output_id)
Definition: mir_surface_api.cpp:210
void mir_surface_spec_set_width_increment(MirSurfaceSpec *spec, unsigned width_inc)
Set the requested width increment, in pixels.
Definition: mir_surface_api.cpp:656
unsigned int width
Definition: touchspot_image.c:4
MirBufferStream * mir_surface_get_buffer_stream(MirSurface *surface)
Retrieve the primary MirBufferStream associated with a surface (to advance buffers, obtain EGLNativeWindow, etc...)
Definition: mir_surface_api.cpp:510
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:159
MirSurfaceType
Definition: common.h:48
void mir_surface_spec_set_state(MirSurfaceSpec *spec, MirSurfaceState state)
Set the requested state.
Definition: mir_surface_api.cpp:205
void mir_surface_spec_set_pointer_confinement(MirSurfaceSpec *spec, MirPointerConfinementState state)
Attempts to set the pointer confinement spec for this surface.
Definition: mir_surface_api.cpp:696
int mir_surface_get_dpi(MirSurface *surface)
Query the DPI value of the surface (dots per inch).
Definition: mir_surface_api.cpp:387
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
void(* mir_surface_callback)(MirSurface *surface, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:87
Definition: cursor_configuration.h:34
MirSurfaceFocusState
Definition: common.h:82
MirSurfaceVisibility
Definition: common.h:88
void mir_surface_spec_set_max_width(MirSurfaceSpec *spec, unsigned max_width)
Set the maximum width, in pixels.
Definition: mir_surface_api.cpp:185
MirSurfaceSpec * mir_connection_create_spec_for_input_method(MirConnection *connection, int width, int height, MirPixelFormat format)
Create a surface specification for an input method surface.
Definition: mir_surface_api.cpp:105
MirShellChrome
Shell chrome.
Definition: common.h:218
MirOrientationMode mir_surface_get_preferred_orientation(MirSurface *surface)
Get the preferred orientation modes of a surface.
Definition: mir_surface_api.cpp:461
void mir_surface_spec_set_preferred_orientation(MirSurfaceSpec *spec, MirOrientationMode mode)
Set the requested preferred orientation mode.
Definition: mir_surface_api.cpp:216
MirSurfaceSpec * mir_connection_create_spec_for_menu(MirConnection *connection, int width, int height, MirPixelFormat format, MirSurface *parent, MirRectangle *rect, MirEdgeAttachment edge)
Create a surface specification for a menu surface.
Definition: mir_surface_api.cpp:59
MirSurfaceSpec * mir_create_surface_spec(MirConnection *connection)
Create a surface specification.
Definition: mir_surface_api.cpp:521
void mir_surface_spec_set_streams(MirSurfaceSpec *spec, MirBufferStreamInfo *streams, unsigned int num_streams)
Set the streams associated with the spec.
Definition: mir_surface_api.cpp:554
unsigned int height
Definition: touchspot_image.c:5
Definition: mir_connection.h:96
void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters)
Get a surface&#39;s parameters.
Definition: mir_surface_api.cpp:256
Definition: client_types.h:371
MirSurfaceSpec * mir_connection_create_spec_for_dialog(MirConnection *connection, int width, int height, MirPixelFormat format)
Create a surface specification for a parentless dialog surface.
Definition: mir_surface_api.cpp:95
MirOrientation mir_surface_get_orientation(MirSurface *surface)
Get the orientation of a surface.
Definition: mir_surface_api.cpp:341
MirSurface * mir_surface_create_sync(MirSurfaceSpec *requested_specification)
Create a surface from a given specification and wait for the result.
Definition: mir_surface_api.cpp:130
MirOrientationMode
Definition: common.h:180
MirSurfaceSpec * mir_connection_create_spec_for_normal_surface(MirConnection *connection, int width, int height, MirPixelFormat format)
Create a surface specification for a normal surface.
Definition: mir_surface_api.cpp:50
MirPersistentId * mir_surface_request_persistent_id_sync(MirSurface *surface)
Request a persistent ID for a surface and wait for the result.
Definition: mir_surface_api.cpp:722
void mir_surface_apply_spec(MirSurface *surface, MirSurfaceSpec *spec)
Request changes to the specification of a surface.
Definition: mir_surface_api.cpp:540
MirWaitHandle * mir_surface_create(MirSurfaceSpec *requested_specification, mir_surface_callback callback, void *context)
Create a surface from a given specification.
Definition: mir_surface_api.cpp:141
void mir_surface_set_event_handler(MirSurface *surface, mir_surface_event_callback callback, void *context)
Set the event handler to be called when events arrive for a surface.
Definition: mir_surface_api.cpp:240
void mir_surface_spec_set_min_height(MirSurfaceSpec *spec, unsigned min_height)
Set the minimum height, in pixels.
Definition: mir_surface_api.cpp:180
void mir_surface_spec_set_name(MirSurfaceSpec *spec, char const *name)
Set the requested name.
Definition: mir_surface_api.cpp:160
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:169
MirEdgeAttachment
Definition: common.h:194

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016