2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2008 Codethink Ltd.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
26 * This file contains utilities for loading introspection XML
27 * from the local file system.
29 * There is an installation directory with files containing introspection xml.
30 * Each file is named after the interface it describes.
34 * Provides the path for the introspection directory.
36 #if !defined ATSPI_INTROSPECTION_PATH
37 #error "No introspection XML directory defined"
40 const char *spi_introspection_header =
41 "<?xml version=\"1.0\"?>\n";
43 const char *spi_introspection_node_element =
44 "<node name=\"%s\">\n";
46 const char *spi_introspection_footer =
50 spi_append_interface (GString *str, const char *interface)
54 char *introspection_directory;
59 introspection_directory = (char *) g_getenv("ATSPI_INTROSPECTION_PATH");
60 if (introspection_directory == NULL)
61 introspection_directory = ATSPI_INTROSPECTION_PATH;
63 filename = g_build_filename(introspection_directory, interface, NULL);
65 if (g_file_get_contents(filename, &contents, &len, &err))
67 g_string_append_len(str, contents, len);
71 g_warning("AT-SPI: Cannot find introspection XML file %s - %s",
72 filename, err->message);
76 g_string_append(str, "\n");