~ubuntu-branches/ubuntu/lucid/xcb-util/lucid

« back to all changes in this revision

Viewing changes to aux/xcb_aux.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Danjou
  • Date: 2009-02-15 12:58:13 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090215125813-fvdfqrch1341t8bd
Tags: 0.3.3-2
Add versioned link to GPL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2008 Bart Massey <bart@cs.pdx.edu>
 
3
 * Copyright © 2008 Ian Osgood <iano@quirkster.com>
 
4
 * Copyright © 2008 Jamey Sharp <jamey@minilop.net>
 
5
 * Copyright © 2008 Josh Triplett <josh@freedesktop.org>
 
6
 *
 
7
 * Permission is hereby granted, free of charge, to any person
 
8
 * obtaining a copy of this software and associated documentation
 
9
 * files (the "Software"), to deal in the Software without
 
10
 * restriction, including without limitation the rights to use, copy,
 
11
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 
12
 * of the Software, and to permit persons to whom the Software is
 
13
 * furnished to do so, subject to the following conditions:
 
14
 *
 
15
 * The above copyright notice and this permission notice shall be
 
16
 * included in all copies or substantial portions of the Software.
 
17
 *
 
18
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
19
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
20
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
21
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
 
22
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 
23
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 
24
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
25
 *
 
26
 * Except as contained in this notice, the names of the authors or
 
27
 * their institutions shall not be used in advertising or otherwise to
 
28
 * promote the sale, use or other dealings in this Software without
 
29
 * prior written authorization from the authors.
 
30
 */
 
31
 
1
32
#include <stdio.h>
2
33
#include <stdlib.h>
3
34
#include <string.h>
13
44
{
14
45
  xcb_drawable_t            drawable;
15
46
  xcb_get_geometry_reply_t *geom;
16
 
  int                       depth;
 
47
  int                       depth = 0;
17
48
 
18
49
  drawable = screen->root;
19
50
  geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0);
20
51
 
21
 
  if (!geom) {
22
 
    perror ("GetGeometry(root) failed");
23
 
    exit (0);
 
52
  if (geom) {
 
53
    depth = geom->depth;
 
54
    free (geom);
24
55
  }
25
 
  
26
 
  depth = geom->depth;
27
 
  free (geom);
28
56
 
29
57
  return depth;
30
58
}