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.
24 #include <accessible.h>
27 * This file contains utilities for loading introspection XML
28 * from the local file system.
30 * There is an installation directory with files containing introspection xml.
31 * Each file is named after the interface it describes.
35 * Provides the path for the introspection directory.
37 #if !defined ATSPI_DBUS_INTROSPECTION_DIRECTORY
38 #error "No introspection XML directory defined"
41 const char *spi_introspection_header =
42 "<?xml version=\"1.0\"?>\n";
44 const char *spi_introspection_node_element =
45 "<node name=\"%s\">\n";
47 const char *spi_introspection_footer =
51 spi_append_interface (GString *str, const char *interface)
55 char *introspection_directory;
60 introspection_directory = (char *) g_getenv("ATSPI_DBUS_INTROSPECTION_DIRECTORY");
61 if (introspection_directory == NULL)
62 introspection_directory = ATSPI_DBUS_INTROSPECTION_DIRECTORY;
64 filename = g_build_filename(introspection_directory, interface, NULL);
66 if (g_file_get_contents(filename, &contents, &len, &err))
68 g_string_append_len(str, contents, len);
72 g_warning("AT-SPI: Cannot find introspection XML file %s - %s",
73 filename, err->message);
77 g_string_append(str, "\n");