2009-27-09 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / tests / cspi / simple-test.c
1 /*
2  * Copyright (C) 2008 Codethink Ltd.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include <glib.h>
21 #include <cspi/spi.h>
22
23 #include <stdio.h>
24
25 int
26 main (int argc, char **argv)
27 {
28         gint i;
29         gint n_desktops;
30         gchar *s;
31
32         SPI_init ();
33
34         n_desktops = SPI_getDesktopCount ();
35
36         for (i=0; i<n_desktops; ++i) {
37                 Accessible *desktop;
38
39                 desktop = SPI_getDesktop (i);
40                 s = Accessible_getName (desktop);
41                 fprintf (stderr, "desktop %d name: %s\n", i, s);
42                 SPI_freeString (s);
43                 Accessible_unref (desktop);
44         }
45         return SPI_exit ();
46 }