~mir-team/mir/trunk

« back to all changes in this revision

Viewing changes to src/client/mir_client_library.cpp

  • Committer: Tarmac
  • Author(s): Daniel van Vugt
  • Date: 2013-03-22 03:33:00 UTC
  • mfrom: (440.1.138 surface-types)
  • Revision ID: tarmac-20130322033300-qj6cjcvsqhl4mpaw
Add support for surface types (client API, protocol and server).

This work will also form the foundation of supporting surface states.

Approved by PS Jenkins bot, Alan Griffiths, Robert Ancell.

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
{
273
273
    // Ignore
274
274
}
 
275
 
 
276
mir_toolkit::MirWaitHandle* mir_toolkit::mir_surface_set_type(MirSurface *surf,
 
277
                                                           MirSurfaceType type)
 
278
{
 
279
    return surf ? surf->configure(mir_surface_attrib_type, type) : NULL;
 
280
}
 
281
 
 
282
MirSurfaceType mir_toolkit::mir_surface_get_type(MirSurface *surf)
 
283
{
 
284
    MirSurfaceType type = mir_surface_type_normal;
 
285
 
 
286
    if (surf)
 
287
    {
 
288
        // Only the client will ever change the type of a surface so it is
 
289
        // safe to get the type from a local cache surf->attrib().
 
290
 
 
291
        int t = surf->attrib(mir_surface_attrib_type);
 
292
        type = static_cast<MirSurfaceType>(t);
 
293
    }
 
294
 
 
295
    return type;
 
296
}