[gnome-keyring/trust-store: 24/26] [gcr] Move to a single header model.



commit be49d7a554b0f7cf284ac5050610287b82552a9c
Author: Stef Walter <stefw collabora co uk>
Date:   Mon Dec 6 22:00:41 2010 +0000

    [gcr] Move to a single header model.
    
    Similar to gtk, where you can only include <gcr/gcr.h> to prevent
    future API breaks because of headers.

 gcr/Makefile.am                    |    1 +
 gcr/gcr-certificate-renderer.h     |    4 ++++
 gcr/gcr-certificate-widget.h       |    4 ++++
 gcr/gcr-certificate.h              |    4 ++++
 gcr/gcr-importer.h                 |    4 ++++
 gcr/gcr-key-renderer.h             |    4 ++++
 gcr/gcr-key-widget.h               |    4 ++++
 gcr/gcr-parser.h                   |    4 ++++
 gcr/gcr-simple-certificate.h       |    4 ++++
 gcr/gcr-trust.h                    |    4 ++++
 gcr/gcr-types.h                    |   31 +++++++++++++++++++++++++++----
 gcr/gcr-unlock-options-widget.h    |    4 ++++
 gcr/gcr.h                          |   33 +++++++++++++++++++++++++--------
 gcr/tests/ui-test-certificate.c    |   25 +++++++++++++++++++++++--
 gcr/tests/ui-test-key.c            |   25 +++++++++++++++++++++++--
 gcr/tests/ui-test-unlock-options.c |   24 +++++++++++++++++++++++-
 tool/gkr-tool-import.c             |    3 +--
 ui/gku-prompt-tool.c               |    2 +-
 18 files changed, 164 insertions(+), 20 deletions(-)
---
diff --git a/gcr/Makefile.am b/gcr/Makefile.am
index cffa886..9675eb1 100644
--- a/gcr/Makefile.am
+++ b/gcr/Makefile.am
@@ -73,6 +73,7 @@ libgcr GCR_VERSION_SUFFIX@_la_CFLAGS = \
 	-DPKCS11_MODULE_PATH=\""$(libdir)/gnome-keyring/gnome-keyring-pkcs11.so"\" \
 	-DGCK_API_SUBJECT_TO_CHANGE \
 	-DGCR_API_SUBJECT_TO_CHANGE \
+	-DGCR_COMPILATION \
 	-DUIDIR=\""$(uidir)"\"
 
 libgcr GCR_VERSION_SUFFIX@_la_LDFLAGS = \
diff --git a/gcr/gcr-certificate-renderer.h b/gcr/gcr-certificate-renderer.h
index 685c04e..e91787b 100644
--- a/gcr/gcr-certificate-renderer.h
+++ b/gcr/gcr-certificate-renderer.h
@@ -17,6 +17,10 @@
  * 02111-1307, USA.
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_CERTIFICATE_RENDERER_H__
 #define __GCR_CERTIFICATE_RENDERER_H__
 
diff --git a/gcr/gcr-certificate-widget.h b/gcr/gcr-certificate-widget.h
index c88284e..1da64fa 100644
--- a/gcr/gcr-certificate-widget.h
+++ b/gcr/gcr-certificate-widget.h
@@ -17,6 +17,10 @@
  * 02111-1307, USA.
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_CERTIFICATE_WIDGET_H__
 #define __GCR_CERTIFICATE_WIDGET_H__
 
diff --git a/gcr/gcr-certificate.h b/gcr/gcr-certificate.h
index 21f151d..1232500 100644
--- a/gcr/gcr-certificate.h
+++ b/gcr/gcr-certificate.h
@@ -19,6 +19,10 @@
  * 02111-1307, USA.  
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_CERTIFICATE_H__
 #define __GCR_CERTIFICATE_H__
 
diff --git a/gcr/gcr-importer.h b/gcr/gcr-importer.h
index 2e836aa..3d6eb13 100644
--- a/gcr/gcr-importer.h
+++ b/gcr/gcr-importer.h
@@ -19,6 +19,10 @@
  * 02111-1307, USA.  
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_IMPORTER_H__
 #define __GCR_IMPORTER_H__
 
diff --git a/gcr/gcr-key-renderer.h b/gcr/gcr-key-renderer.h
index 1d25528..ead181d 100644
--- a/gcr/gcr-key-renderer.h
+++ b/gcr/gcr-key-renderer.h
@@ -17,6 +17,10 @@
  * 02111-1307, USA.
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_KEY_RENDERER_H__
 #define __GCR_KEY_RENDERER_H__
 
diff --git a/gcr/gcr-key-widget.h b/gcr/gcr-key-widget.h
index 5393e02..7c321f7 100644
--- a/gcr/gcr-key-widget.h
+++ b/gcr/gcr-key-widget.h
@@ -17,6 +17,10 @@
  * 02111-1307, USA.
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_KEY_WIDGET_H__
 #define __GCR_KEY_WIDGET_H__
 
diff --git a/gcr/gcr-parser.h b/gcr/gcr-parser.h
index 39085d2..dc1a340 100644
--- a/gcr/gcr-parser.h
+++ b/gcr/gcr-parser.h
@@ -19,6 +19,10 @@
  * 02111-1307, USA.  
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_PARSER_H__
 #define __GCR_PARSER_H__
 
diff --git a/gcr/gcr-simple-certificate.h b/gcr/gcr-simple-certificate.h
index e5a3863..37c8f8b 100644
--- a/gcr/gcr-simple-certificate.h
+++ b/gcr/gcr-simple-certificate.h
@@ -19,6 +19,10 @@
  * 02111-1307, USA.  
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_SIMPLE_CERTIFICATE_H__
 #define __GCR_SIMPLE_CERTIFICATE_H__
 
diff --git a/gcr/gcr-trust.h b/gcr/gcr-trust.h
index bce4d27..c49ca3b 100644
--- a/gcr/gcr-trust.h
+++ b/gcr/gcr-trust.h
@@ -19,6 +19,10 @@
  * 02111-1307, USA.
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_TRUST_H__
 #define __GCR_TRUST_H__
 
diff --git a/gcr/gcr-types.h b/gcr/gcr-types.h
index 6d7decc..8bb14d4 100644
--- a/gcr/gcr-types.h
+++ b/gcr/gcr-types.h
@@ -1,10 +1,33 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Author: Stef Walter <stefw collabora co uk>
+ */
+
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef GCRTYPES_H_
 #define GCRTYPES_H_
 
-#ifndef GCR_API_SUBJECT_TO_CHANGE
-#error "This API has not yet reached stability." 
-#endif 
-
 #include <glib.h>
 
 G_BEGIN_DECLS
diff --git a/gcr/gcr-unlock-options-widget.h b/gcr/gcr-unlock-options-widget.h
index aab34e6..1e1ade6 100644
--- a/gcr/gcr-unlock-options-widget.h
+++ b/gcr/gcr-unlock-options-widget.h
@@ -17,6 +17,10 @@
  * 02111-1307, USA.
  */
 
+#if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> can be included directly."
+#endif
+
 #ifndef __GCR_UNLOCK_OPTIONS_WIDGET_H__
 #define __GCR_UNLOCK_OPTIONS_WIDGET_H__
 
diff --git a/gcr/gcr.h b/gcr/gcr.h
index 2d0ba4b..be822ab 100644
--- a/gcr/gcr.h
+++ b/gcr/gcr.h
@@ -1,35 +1,52 @@
-/* 
+/*
  * gnome-keyring
- * 
- * Copyright (C) 2008 Stefan Walter
- * 
- * This program is free software; you can redistribute it and/or modify 
+ *
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as
  * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.  
+ * 02111-1307, USA.
+ *
+ * Author: Stef Walter <stefw collabora co uk>
  */
 
+#ifndef GCR_API_SUBJECT_TO_CHANGE
+#error "This API has not yet reached stability."
+#endif
+
 #ifndef __GCR_H__
 #define __GCR_H__
 
 #include <glib.h>
 
+#define __GCR_H_INSIDE__
+
 #include "gcr-certificate.h"
+#include "gcr-certificate-renderer.h"
 #include "gcr-certificate-widget.h"
+#include "gcr-key-renderer.h"
+#include "gcr-key-widget.h"
 #include "gcr-importer.h"
 #include "gcr-parser.h"
+#include "gcr-pkcs11-certificate.h"
 #include "gcr-simple-certificate.h"
 #include "gcr-trust.h"
 #include "gcr-types.h"
+#include "gcr-unlock-options.h"
+#include "gcr-unlock-options-widget.h"
+#include "gcr-viewer.h"
+
+#undef __GCR_H_INSIDE__
 
 #endif /* __GCR_H__ */
diff --git a/gcr/tests/ui-test-certificate.c b/gcr/tests/ui-test-certificate.c
index 3b741b5..cc9b7a6 100644
--- a/gcr/tests/ui-test-certificate.c
+++ b/gcr/tests/ui-test-certificate.c
@@ -1,8 +1,29 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Author: Stef Walter <stefw collabora co uk>
+ */
 
 #include "config.h"
 
-#include "gcr-certificate-widget.h"
-#include "gcr-simple-certificate.h"
+#include "gcr/gcr.h"
 
 #include <gtk/gtk.h>
 
diff --git a/gcr/tests/ui-test-key.c b/gcr/tests/ui-test-key.c
index 4ccba3e..cd02be6 100644
--- a/gcr/tests/ui-test-key.c
+++ b/gcr/tests/ui-test-key.c
@@ -1,8 +1,29 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Author: Stef Walter <stefw collabora co uk>
+ */
 
 #include "config.h"
 
-#include "gcr-key-widget.h"
-#include "gcr-parser.h"
+#include "gcr/gcr.h"
 
 #include <gtk/gtk.h>
 
diff --git a/gcr/tests/ui-test-unlock-options.c b/gcr/tests/ui-test-unlock-options.c
index 9b05d59..96b9ff5 100644
--- a/gcr/tests/ui-test-unlock-options.c
+++ b/gcr/tests/ui-test-unlock-options.c
@@ -1,7 +1,29 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Author: Stef Walter <stefw collabora co uk>
+ */
 
 #include "config.h"
 
-#include "gcr-unlock-options-widget.h"
+#include "gcr/gcr.h"
 
 #include <gtk/gtk.h>
 
diff --git a/tool/gkr-tool-import.c b/tool/gkr-tool-import.c
index 97f37a4..f6aa2f2 100644
--- a/tool/gkr-tool-import.c
+++ b/tool/gkr-tool-import.c
@@ -26,8 +26,7 @@
 #include "gkr-tool.h"
 
 #include "gck/gck.h"
-
-#include "gcr/gcr-importer.h"
+#include "gcr/gcr.h"
 
 #include "egg/egg-hex.h"
 
diff --git a/ui/gku-prompt-tool.c b/ui/gku-prompt-tool.c
index 01ab16a..16b9826 100644
--- a/ui/gku-prompt-tool.c
+++ b/ui/gku-prompt-tool.c
@@ -31,7 +31,7 @@
 #include "egg/egg-libgcrypt.h"
 #include "egg/egg-secure-memory.h"
 
-#include "gcr/gcr-unlock-options-widget.h"
+#include "gcr/gcr.h"
 
 #include <gcrypt.h>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]