add G_DISABLE_SINGLE_INCLUDES and ATK_DISABLE_SINGLE_INCLUDES to CPPFLAGS.
authorMichael Natterer <mitch@imendio.com>
Thu, 5 Jun 2008 09:03:47 +0000 (09:03 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Thu, 5 Jun 2008 09:03:47 +0000 (09:03 +0000)
2008-06-05  Michael Natterer  <mitch@imendio.com>

* configure.in: add G_DISABLE_SINGLE_INCLUDES and
ATK_DISABLE_SINGLE_INCLUDES to CPPFLAGS.

* atk/atk.h: define __ATK_H_INSIDE__ around including all other
headers.

* atk/atk*.h: add single-include guards that #error out if
ATK_DISABLE_SINGLE_INCLUDES is defined and any of these files is
included individually. Use G_BEGIN_DECLS/G_END_DECLS in all files.

* atk/Makefile.am: define ATK_COMPILATION while building ATK.
Add single-include guards to the generated atk-enum-types.h too.

svn path=/trunk/; revision=1246

30 files changed:
ChangeLog
atk/Makefile.am
atk/atk.h
atk/atkaction.h
atk/atkcomponent.h
atk/atkdocument.h
atk/atkeditabletext.h
atk/atkgobjectaccessible.h
atk/atkhyperlink.h
atk/atkhyperlinkimpl.h
atk/atkhypertext.h
atk/atkimage.h
atk/atkmisc.h
atk/atknoopobject.h
atk/atknoopobjectfactory.h
atk/atkobject.h
atk/atkobjectfactory.h
atk/atkregistry.h
atk/atkrelation.h
atk/atkrelationset.h
atk/atkrelationtype.h
atk/atkselection.h
atk/atkstate.h
atk/atkstateset.h
atk/atkstreamablecontent.h
atk/atktable.h
atk/atktext.h
atk/atkutil.h
atk/atkvalue.h
configure.in

index 9c8cf11..ab489e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2008-06-05  Michael Natterer  <mitch@imendio.com>
+
+       * configure.in: add G_DISABLE_SINGLE_INCLUDES and
+       ATK_DISABLE_SINGLE_INCLUDES to CPPFLAGS.
+
+       * atk/atk.h: define __ATK_H_INSIDE__ around including all other
+       headers.
+
+       * atk/atk*.h: add single-include guards that #error out if
+       ATK_DISABLE_SINGLE_INCLUDES is defined and any of these files is
+       included individually. Use G_BEGIN_DECLS/G_END_DECLS in all files.
+
+       * atk/Makefile.am: define ATK_COMPILATION while building ATK.
+       Add single-include guards to the generated atk-enum-types.h too.
+
 2008-03-10  Li Yuan  <li.yuan@sun.com>
 
        * NEWS:
index f243d38..7bb3155 100644 (file)
@@ -11,6 +11,7 @@ endif
 INCLUDES = \
        -I$(top_srcdir)         \
        -DG_DISABLE_DEPRECATED  \
+       -DATK_COMPILATION       \
        -DATK_LOCALEDIR="\"$(datadir)/locale\"" \
        $(DEP_CFLAGS)
 
@@ -109,7 +110,7 @@ atk-enum-types.h: s-enum-types-h
        @true
 s-enum-types-h: @REBUILD@ $(atk_headers) Makefile
        ( cd $(srcdir) && $(GLIB_MKENUMS) \
-                       --fhead "#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+                       --fhead "#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)\n#error \"Only <atk/atk.h> can be included directly.\"\n#endif\n\n#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
                        --fprod "/* enumerations from \"@filename@\" */\n" \
                        --vhead "GType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
                        --ftail "G_END_DECLS\n\n#endif /* __ATK_ENUM_TYPES_H__ */" \
index 04d9539..a7536a0 100755 (executable)
--- a/atk/atk.h
+++ b/atk/atk.h
@@ -20,6 +20,8 @@
 #ifndef __ATK_H__
 #define __ATK_H__
 
+#define __ATK_H_INSIDE__
+
 #include <atk/atkobject.h>
 #include <atk/atkaction.h>
 #include <atk/atkcomponent.h>
@@ -47,4 +49,6 @@
 #include <atk/atkmisc.h>
 #include <atk/atkvalue.h>
 
+#undef __ATK_H_INSIDE__
+
 #endif /* __ATK_H__ */
index 8dfee9f..45d74b8 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_ACTION_H__
 #define __ATK_ACTION_H__
 
 #include <atk/atkobject.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The interface AtkAction should be supported by any object that can 
@@ -104,9 +106,6 @@ G_CONST_RETURN gchar* atk_action_get_localized_name (AtkAction       *action,
  *       (an accessible action, or the list of actions, has changed)
  */
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_ACTION_H__ */
index c72a728..cf6dc9f 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_COMPONENT_H__
 #define __ATK_COMPONENT_H__
 
 #include <atk/atkobject.h>
 #include <atk/atkutil.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The AtkComponent interface should be supported by any object that is 
@@ -163,9 +165,7 @@ gboolean              atk_component_set_size               (AtkComponent    *com
                                                             gint            width,
                                                             gint            height);
 gdouble               atk_component_get_alpha              (AtkComponent    *component);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
 
+G_END_DECLS
 
 #endif /* __ATK_COMPONENT_H__ */
index 202cbef..275b5e8 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_DOCUMENT_H__
 #define __ATK_DOCUMENT_H__
 
 #include <atk/atkobject.h>
 #include <atk/atkutil.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The AtkDocument interface should be supported by any object that is a container
@@ -75,7 +77,7 @@ G_CONST_RETURN gchar* atk_document_get_attribute_value (AtkDocument *document,
 gboolean              atk_document_set_attribute_value (AtkDocument *document,
                                                         const gchar *attribute_name,
                                                         const gchar *attribute_value);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+
+G_END_DECLS
+
 #endif /* __ATK_DOCUMENT_H__ */
index 02937ff..da60bbd 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_EDITABLE_TEXT_H__
 #define __ATK_EDITABLE_TEXT_H__
 
 #include <atk/atkobject.h>
 #include <atk/atktext.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * AtkEditableText is used to support access in an "accessibility" context
@@ -96,10 +98,7 @@ void atk_editable_text_delete_text          (AtkEditableText  *text,
                                              gint             end_pos);
 void atk_editable_text_paste_text           (AtkEditableText  *text,
                                              gint             position);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
 
+G_END_DECLS
 
 #endif /* __ATK_EDITABLE_TEXT_H__ */
index adb46cd..13950ae 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_GOBJECT_ACCESSIBLE_H__
 #define __ATK_GOBJECT_ACCESSIBLE_H__
 
 #include <atk/atk.h>
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The AtkGObjectAccessible class is provided as a basis for implementing
@@ -59,9 +60,6 @@ struct _AtkGObjectAccessibleClass
 AtkObject *atk_gobject_accessible_for_object      (GObject           *obj);
 GObject   *atk_gobject_accessible_get_object      (AtkGObjectAccessible *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_GOBJECT_ACCESSIBLE_H__ */
index a5d3716..01bab83 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_HYPERLINK_H__
 #define __ATK_HYPERLINK_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <atk/atkaction.h>
 
+G_BEGIN_DECLS
+
 /*
  * AtkHyperlink encapsulates a link or set of links in a hypertext document.
  *
@@ -97,10 +99,6 @@ gboolean         atk_hyperlink_is_inline             (AtkHyperlink     *link_);
 gint            atk_hyperlink_get_n_anchors        (AtkHyperlink     *link_);
 gboolean         atk_hyperlink_is_selected_link     (AtkHyperlink     *link_);
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_HYPERLINK_H__ */
index b08a1d5..d07a2fc 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_HYPERLINK_IMPL_H__
 #define __ATK_HYPERLINK_IMPL_H__
 
 #include <atk/atkobject.h>
 #include <atk/atkhyperlink.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The AtkHyperlinkImpl interface should be supported by objects
@@ -68,9 +70,6 @@ GType            atk_hyperlink_impl_get_type (void);
 
 AtkHyperlink    *atk_hyperlink_impl_get_hyperlink (AtkHyperlinkImpl *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_HYPERLINK_IMPL_H__ */
index 18464d9..d8328a8 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_HYPERTEXT_H__
 #define __ATK_HYPERTEXT_H__
 
 #include <atk/atkobject.h>
 #include <atk/atkhyperlink.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The AtkHypertext interface provides standard  mechanisms for manipulating 
@@ -71,10 +73,6 @@ gint          atk_hypertext_get_n_links    (AtkHypertext *hypertext);
 gint          atk_hypertext_get_link_index (AtkHypertext *hypertext,
                                             gint          char_index);
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_HYPERTEXT_H__ */
index 7e60c81..dd45916 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_IMAGE_H__
 #define __ATK_IMAGE_H__
 
 #include <atk/atkobject.h>
 #include <atk/atkutil.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The AtkImage interface should be supported by any object that has an 
@@ -80,7 +82,6 @@ void     atk_image_get_image_position    (AtkImage         *image,
 
 G_CONST_RETURN gchar* atk_image_get_image_locale (AtkImage   *image);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
+
 #endif /* __ATK_IMAGE_H__ */
index d750e2d..dda4568 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_MISC_H__
 #define __ATK_MISC_H__
 
 #include <glib-object.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #define ATK_TYPE_MISC                   (atk_misc_get_type ())
 #define ATK_IS_MISC(obj)                G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_MISC)
@@ -82,9 +84,6 @@ void     atk_misc_threads_leave  (AtkMisc *misc);
  */
 const AtkMisc *atk_misc_get_instance (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_MISC_H__ */
index 3c4e432..261571c 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_NO_OP_OBJECT_H__
 #define __ATK_NO_OP_OBJECT_H__
 
index c324531..b216d6c 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_NO_OP_OBJECT_FACTORY_H__
 #define __ATK_NO_OP_OBJECT_FACTORY_H__
 
 #include <atk/atkobjectfactory.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #define ATK_TYPE_NO_OP_OBJECT_FACTORY                (atk_no_op_object_factory_get_type ())
 #define ATK_NO_OP_OBJECT_FACTORY(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_NO_OP_OBJECT_FACTORY, AtkNoOpObjectFactory))
@@ -50,9 +52,6 @@ GType atk_no_op_object_factory_get_type(void);
 
 AtkObjectFactory *atk_no_op_object_factory_new(void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_NO_OP_OBJECT_FACTORY_H__ */
index bb9b55a..39499e7 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_OBJECT_H__
 #define __ATK_OBJECT_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <glib-object.h>
 #include <atk/atkstate.h>
 #include <atk/atkrelationtype.h>
 
+G_BEGIN_DECLS
+
 /*
  * AtkObject represents the minimum information all accessible objects
  * return. This information includes accessible name, accessible
@@ -640,9 +642,6 @@ G_CONST_RETURN gchar* atk_role_get_localized_name              (AtkRole     role
  *    cpos = atk_text_get_caret_position (ATK_TEXT (accessible));
  */
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_OBJECT_H__ */
index fb163ad..ff7e254 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_OBJECT_FACTORY_H__
 #define __ATK_OBJECT_FACTORY_H__
 
 #include <glib-object.h>
 #include <atk/atkobject.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #define ATK_TYPE_OBJECT_FACTORY                     (atk_object_factory_get_type ())
 #define ATK_OBJECT_FACTORY(obj)                     (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_OBJECT_FACTORY, AtkObjectFactory))
@@ -59,10 +61,7 @@ GType atk_object_factory_get_type(void);
 AtkObject* atk_object_factory_create_accessible (AtkObjectFactory *factory, GObject *obj);
 void       atk_object_factory_invalidate (AtkObjectFactory *factory);
 GType      atk_object_factory_get_accessible_type (AtkObjectFactory *factory);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
 
+G_END_DECLS
 
 #endif /* __GTK_OBJECT_FACTORY_H__ */
-
index 3ab0414..eb16403 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_REGISTRY_H__
 #define __ATK_REGISTRY_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <glib-object.h>
 #include "atkobjectfactory.h"
 
+G_BEGIN_DECLS
+
 #define ATK_TYPE_REGISTRY                (atk_registry_get_type ())
 #define ATK_REGISTRY(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_REGISTRY, AtkRegistry))
 #define ATK_REGISTRY_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_REGISTRY, AtkRegistryClass))
@@ -61,9 +63,7 @@ AtkObjectFactory* atk_registry_get_factory      (AtkRegistry *registry,
 
 AtkRegistry*      atk_get_default_registry      (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __ATK_REGISTRY_H__ */
 
index 08b0708..88db375 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_RELATION_H__
 #define __ATK_RELATION_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #include <glib-object.h>
 #include <atk/atkrelationtype.h>
@@ -79,10 +81,7 @@ AtkRelationType       atk_relation_get_relation_type  (AtkRelation     *relation
 GPtrArray*            atk_relation_get_target         (AtkRelation     *relation);
 void                  atk_relation_add_target         (AtkRelation     *relation,
                                                        AtkObject       *target);
-                
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __ATK_RELATION_H__ */
index 2225baf..9bf572c 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_RELATION_SET_H__
 #define __ATK_RELATION_SET_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #include <glib-object.h>
 #include <atk/atkobject.h>
@@ -71,9 +73,6 @@ void            atk_relation_set_add_relation_by_type (AtkRelationSet  *set,
                                                        AtkRelationType relationship,
                                                        AtkObject       *target);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_RELATION_SET_H__ */
index 665c675..ad34bfc 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_RELATION_TYPE_H__
 #define __ATK_RELATION_TYPE_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+#include <glib.h>
+
+G_BEGIN_DECLS
 
 /**
  *AtkRelationType:
@@ -72,8 +76,6 @@ typedef enum
   ATK_RELATION_LAST_DEFINED
 } AtkRelationType;
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __ATK_RELATION_TYPE_H__ */
index 7b16930..9a0050f 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_SELECTION_H__
 #define __ATK_SELECTION_H__
 
 #include <atk/atkobject.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * This AtkSelection interface provides the standard mechanism for an 
@@ -88,9 +90,6 @@ gboolean     atk_selection_remove_selection     (AtkSelection   *selection,
 
 gboolean     atk_selection_select_all_selection (AtkSelection   *selection);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_SELECTION_H__ */
index 3317346..0beba72 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_STATE_H__
 #define __ATK_STATE_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <glib-object.h>
 
+G_BEGIN_DECLS
+
 /**
  *AtkStateType:
  *@ATK_STATE_INVALID: Indicates an invalid state - probably an error condition.
@@ -171,8 +173,6 @@ AtkStateType atk_state_type_register            (const gchar *name);
 G_CONST_RETURN gchar* atk_state_type_get_name   (AtkStateType type);
 AtkStateType          atk_state_type_for_name   (const gchar  *name);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __ATK_STATE_H__ */
index 43c3ea3..b592eb5 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_STATE_SET_H__
 #define __ATK_STATE_SET_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <glib-object.h>
 #include <atk/atkobject.h>
 #include <atk/atkstate.h>
 
+G_BEGIN_DECLS
+
 #define ATK_TYPE_STATE_SET                        (atk_state_set_get_type ())
 #define ATK_STATE_SET(obj)                        (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_STATE_SET, AtkStateSet))
 #define ATK_STATE_SET_CLASS(klass)                (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_STATE_SET, AtkStateSetClass))
@@ -73,9 +75,6 @@ AtkStateSet*    atk_state_set_or_sets           (AtkStateSet  *set,
 AtkStateSet*    atk_state_set_xor_sets          (AtkStateSet  *set,
                                                  AtkStateSet  *compare_set);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_STATE_SET_H__ */
index abdbfa9..b3bd98d 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_STREAMABLE_CONTENT_H__
 #define __ATK_STREAMABLE_CONTENT_H__
 
 #include <atk/atkobject.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #define ATK_TYPE_STREAMABLE_CONTENT           (atk_streamable_content_get_type ())
 #define ATK_IS_STREAMABLE_CONTENT(obj)        G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_STREAMABLE_CONTENT)
@@ -98,10 +100,6 @@ GIOChannel*             atk_streamable_content_get_stream       (AtkStreamableCo
 gchar*                  atk_streamable_content_get_uri          (AtkStreamableContent     *streamable,
                                                                  const gchar              *mime_type);
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_STREAMABLE_CONTENT_H__ */
index 790fbb4..909b508 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_TABLE_H__
 #define __ATK_TABLE_H__
 
 #include <atk/atkobject.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * AtkTable describes a user-interface component that presents data in
@@ -210,9 +212,6 @@ gboolean          atk_table_remove_column_selection
                                                  (AtkTable         *table,
                                                   gint             column);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_TABLE_H__ */
index 191e231..7ff3521 100755 (executable)
@@ -17,6 +17,9 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
 
 #ifndef __ATK_TEXT_H__
 #define __ATK_TEXT_H__
@@ -25,9 +28,7 @@
 #include <atk/atkobject.h>
 #include <atk/atkutil.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /**
  *AtkTextAttribute
@@ -359,9 +360,6 @@ AtkTextAttribute       atk_text_attribute_for_name        (const gchar      *nam
 G_CONST_RETURN gchar*  atk_text_attribute_get_value       (AtkTextAttribute attr,
                                                            gint             index_);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_TEXT_H__ */
index e96eb64..9b73599 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_UTIL_H__
 #define __ATK_UTIL_H__
 
 #include <atk/atkobject.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #define ATK_TYPE_UTIL                   (atk_util_get_type ())
 #define ATK_IS_UTIL(obj)                G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_UTIL)
@@ -306,10 +308,6 @@ type_name##_get_type (void) \
   return g_define_type_id__volatile;   \
 } /* closes type_name##_get_type() */
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_UTIL_H__ */
index f66c015..276b679 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> can be included directly."
+#endif
+
 #ifndef __ATK_VALUE_H__
 #define __ATK_VALUE_H__
 
 #include <atk/atkobject.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /*
  * The AtkValue interface should be supported by any object that 
@@ -86,10 +88,6 @@ void     atk_value_get_minimum_increment  (AtkValue     *obj,
  *       (the accessible value has changed)
  */
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __ATK_VALUE_H__ */
index c80256b..058e928 100644 (file)
@@ -132,6 +132,8 @@ AC_ARG_ENABLE(rebuilds,
                               [disable all source autogeneration rules])],,
               [enable_rebuilds=yes])
 
+CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES"
+
 changequote(,)dnl
 if test "x$GCC" = "xyes"; then
   case " $CFLAGS " in