]> icculus.org git repositories - dana/openbox.git/blob - obt/tests/ddtest.c
Add include of cairo.h when using librsvg
[dana/openbox.git] / obt / tests / ddtest.c
1 #/*
2 #!/bin/sh
3 #*/
4 #if 0
5 gcc -O0 -o ./ddtest `pkg-config --cflags --libs obt-3.5` ddtest.c && \
6 ./ddtest
7 exit
8 #endif
9
10 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
11
12    ddtest.c for the Openbox window manager
13    Copyright (c) 2010        Dana Jansens
14
15    This program is free software; you can redistribute it and/or modify
16    it under the terms of the GNU General Public License as published by
17    the Free Software Foundation; either version 2 of the License, or
18    (at your option) any later version.
19
20    This program is distributed in the hope that it will be useful,
21    but WITHOUT ANY WARRANTY; without even the implied warranty of
22    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23    GNU General Public License for more details.
24
25    See the COPYING file for a copy of the GNU General Public License.
26 */
27
28 #include <stdio.h>
29 #include <string.h>
30 #include <stdlib.h>
31 #include "obt/paths.h"
32 #include "obt/link.h"
33 #include <glib.h>
34
35 gint main(int argc, char **argv)
36 {
37     ObtPaths *obtpaths;
38     ObtLink *dd;
39     gchar *id;
40
41     if (argc < 2) {
42         g_print("pass path to .desktop\n");
43         return 1;
44     }
45
46     obtpaths = obt_paths_new();
47     dd = obt_link_from_ddfile(argv[1], obtpaths, "et", NULL, NULL);
48     obt_paths_unref(obtpaths);
49     if (dd) {
50         g_print("Success\n");
51         {
52             gulong i, n;
53             const GQuark *c = obt_link_app_categories(dd, &n);
54             for (i = 0; i < n; ++i)
55                 g_print("Category: %s\n",
56                         g_quark_to_string(c[i]));
57         }
58         obt_link_unref(dd);
59     }
60     return 0;
61 }