Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 #ifdef __cplusplus
27 
31 extern "C" {
32 #endif
33 
50  MirConnection *connection,
51  MirSurfaceParameters const *surface_parameters,
52  mir_surface_callback callback,
53  void *context);
54 
63  MirConnection *connection,
64  MirSurfaceParameters const *params);
65 
77  MirEventDelegate const *event_handler);
78 
85 
93 
103 char const *mir_surface_get_error_message(MirSurface *surface);
104 
112 
121 
128 void mir_surface_get_current_buffer(MirSurface *surface, MirNativeBuffer **buffer_package);
129 
138  MirSurface *surface,
139  MirGraphicsRegion *graphics_region);
140 
155  MirSurface *surface,
156  mir_surface_callback callback,
157  void *context);
158 
165 
179  MirSurface *surface,
180  mir_surface_callback callback,
181  void *context);
182 
188 void mir_surface_release_sync(MirSurface *surface);
189 
193 __attribute__((__deprecated__("Use mir_debug_surface_id()")))
194 int mir_surface_get_id(MirSurface *surface);
195 
205 
212 
220  MirSurfaceState state);
221 
228 
239 MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval);
240 
249 
255 int mir_surface_get_dpi(MirSurface* surface);
256 
263 
270 
282 
289 
290 #ifdef __cplusplus
291 }
293 #endif
294 
295 #endif /* MIR_TOOLKIT_MIR_SURFACE_H_ */
Definition: mir_surface.h:56
MirBool
Definition: client_types.h:37
Definition: mir_wait_handle.h:31
MirSurfaceType mir_surface_get_type(MirSurface *surface)
Get the type (purpose) of a surface.
Definition: mir_surface_api.cpp:173
MirWaitHandle * mir_connection_create_surface(MirConnection *connection, MirSurfaceParameters const *surface_parameters, mir_surface_callback callback, void *context)
Request a new Mir surface on the supplied connection with the supplied parameters.
Definition: mir_surface_api.cpp:41
MirBool mir_surface_is_valid(MirSurface *surface)
Test for a valid surface.
Definition: mir_surface_api.cpp:84
MirEGLNativeWindowType mir_surface_get_egl_native_window(MirSurface *surface)
Get a window type that can be used for OpenGL ES 2.0 acceleration.
Definition: mir_surface_api.cpp:79
MirWaitHandle * mir_surface_swap_buffers(MirSurface *surface, mir_surface_callback callback, void *context)
Advance a surface's buffer.
Definition: mir_surface_api.cpp:114
MirWaitHandle * mir_surface_set_state(MirSurface *surface, MirSurfaceState state)
Change the state of a surface.
Definition: mir_surface_api.cpp:189
char const * mir_surface_get_error_message(MirSurface *surface)
Retrieve a text description of the error.
Definition: mir_surface_api.cpp:89
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:148
MirSurfaceFocusState mir_surface_get_focus(MirSurface *surface)
Query the focus state for a surface.
Definition: mir_surface_api.cpp:281
MirWaitHandle * mir_surface_set_swapinterval(MirSurface *surface, int interval)
Set the swapinterval for mir_surface_swap_buffers.
Definition: mir_surface_api.cpp:233
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:317
MirSurfaceVisibility mir_surface_get_visibility(MirSurface *surface)
Query the visibility state for a surface.
Definition: mir_surface_api.cpp:299
Definition: mir_native_buffer.h:30
MirSurfaceState mir_surface_get_state(MirSurface *surface)
Get the current state of a surface.
Definition: mir_surface_api.cpp:201
int mir_surface_get_swapinterval(MirSurface *surface)
Query the swapinterval that the surface is operating with.
Definition: mir_surface_api.cpp:248
void mir_surface_set_event_handler(MirSurface *surface, MirEventDelegate const *event_handler)
Set the event handler to be called when events arrive for a surface.
Definition: mir_surface_api.cpp:73
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:134
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:134
void(* mir_surface_callback)(MirSurface *surface, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:75
MirEventDelegate may be used to specify (at surface creation time) callbacks for handling of events...
Definition: client_types.h:278
MirSurfaceState
Definition: common.h:61
void mir_surface_get_graphics_region(MirSurface *surface, MirGraphicsRegion *graphics_region)
Get a surface's graphics_region, i.e., map the graphics buffer to main memory.
Definition: mir_surface_api.cpp:109
MirSurfaceType
Definition: common.h:49
int mir_surface_get_dpi(MirSurface *surface)
Query the DPI value of the surface (dots per inch).
Definition: mir_surface_api.cpp:263
MirPlatformType mir_surface_get_platform_type(MirSurface *surface)
Get the underlying platform type so the buffer obtained in "raw" representation in mir_surface_get_cu...
Definition: mir_surface_api.cpp:99
void mir_surface_swap_buffers_sync(MirSurface *surface)
Advance a surface's buffer as in mir_surface_swap_buffers(), but also wait for the operation to compl...
Definition: mir_surface_api.cpp:127
Definition: cursor_configuration.h:26
MirSurfaceFocusState
Definition: common.h:77
void * MirEGLNativeWindowType
Definition: client_types.h:44
MirSurfaceVisibility
Definition: common.h:83
void mir_surface_get_current_buffer(MirSurface *surface, MirNativeBuffer **buffer_package)
Get a surface's buffer in "raw" representation.
Definition: mir_surface_api.cpp:104
Definition: mir_connection.h:72
void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters)
Get a surface's parameters.
Definition: mir_surface_api.cpp:94
MirWaitHandle * mir_surface_set_type(MirSurface *surface, MirSurfaceType type)
Set the type (purpose) of a surface.
Definition: mir_surface_api.cpp:160
MirSurface * mir_connection_create_surface_sync(MirConnection *connection, MirSurfaceParameters const *params)
Create a surface like in mir_connection_create_surface(), but also wait for creation to complete and ...
Definition: mir_surface_api.cpp:60
Retrieved information about a MirSurface.
Definition: client_types.h:178
MirOrientation mir_surface_get_orientation(MirSurface *surface)
Get the orientation of a surface.
Definition: mir_surface_api.cpp:228
__attribute__((__deprecated__("Use mir_debug_surface_id()"))) int mir_surface_get_id(MirSurface *surface)
int mir_surface_get_id(MirSurface *surface)
Definition: mir_surface_api.cpp:155
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:158
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:135

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014