Mir
basic.c: A simple mir client

demo_client shows the use of mir API. This program opens a mir connection and creates a surface.

demo_client()

Opens a mir connection and creates a surface and advances the current buffer before closing the surface and connection.

request and wait for connection handle

// Call mir_connect and wait for callback to complete.
mir_wait_for(mir_connect(server, __FILE__, connection_callback, &mcd));
puts("Connected");

request and wait for surface handle

// ...we create a surface using that format and wait for callback to complete.
mir_wait_for(mir_surface_create(spec, surface_create_callback, &mcd));
puts("Surface created");

exchange the current buffer for a new one

We release our surface

// We should release our surface
mir_wait_for(mir_surface_release(mcd.surface, surface_release_callback, &mcd));
puts("Surface released");

We release our connection

// We should release our connection
mir_connection_release(mcd.connection);
puts("Connection released");

the raw, platform-specific buffer handle for the current buffer

MirNativeBuffer* buffer_package = NULL;
assert(buffer_package != NULL);
MirGraphicsRegion graphics_region;

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