[tracker/extractor-dev] libtracker-client: Added tracker-client.h for central inclusion



commit 1ae10fd01f4c273f7f27e479fdfefcb254360971
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Mar 9 14:16:49 2010 +0000

    libtracker-client: Added tracker-client.h for central inclusion
    
    This avoids adding different headers from the same library for 3rd
    parties and is for compatibility with any new changes made. Note that
    the sparql-builder.h is not checked and can be included separately
    still because Vala has no easy way to add #define/#errors.

 .../libtracker-extract/tracker-extract-mockup.c    |    3 +-
 src/libtracker-client/Makefile.am                  |    3 ++
 src/libtracker-client/tracker-client.h             |   32 ++++++++++++++++++++
 src/libtracker-client/tracker.h                    |    4 ++
 src/plugins/nautilus/tracker-tags-extension.c      |    2 +-
 src/plugins/nautilus/tracker-tags-view.c           |    3 +-
 src/tracker-search-bar/tracker-results-window.c    |    2 +-
 7 files changed, 44 insertions(+), 5 deletions(-)
---
diff --git a/examples/libtracker-extract/tracker-extract-mockup.c b/examples/libtracker-extract/tracker-extract-mockup.c
index 00469d0..b751646 100644
--- a/examples/libtracker-extract/tracker-extract-mockup.c
+++ b/examples/libtracker-extract/tracker-extract-mockup.c
@@ -29,8 +29,7 @@
 #include <gio/gio.h>
 
 #include <libtracker-extract/tracker-extract.h>
-
-#include <libtracker-client/tracker.h>
+#include <libtracker-client/tracker-client.h>
 
 static void extract_mockup (const gchar          *uri,
                             TrackerSparqlBuilder *preupdate,
diff --git a/src/libtracker-client/Makefile.am b/src/libtracker-client/Makefile.am
index d9ac612..3112499 100644
--- a/src/libtracker-client/Makefile.am
+++ b/src/libtracker-client/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.decl
 INCLUDES = 					\
 	-DLOCALEDIR=\""$(localedir)"\" 		\
 	-DG_LOG_DOMAIN=\"Tracker\"		\
+	-DTRACKER_COMPILATION			\
 	-I$(top_srcdir)/src			\
 	$(WARN_CFLAGS)				\
 	$(GLIB2_CFLAGS)				\
@@ -18,6 +19,7 @@ libtracker_client_ TRACKER_API_VERSION@_la_VALASOURCES = \
 
 libtracker_client_ TRACKER_API_VERSION@_la_SOURCES = 	\
 	tracker.c					\
+	tracker-client.h				\
 	tracker-sparql-builder.c			\
 	tracker-sparql-builder.h			\
 	libtracker-client.vala.stamp			\
@@ -35,6 +37,7 @@ libtracker_client_ TRACKER_API_VERSION@_la_LIBADD =	\
 
 libtracker_clientinclude_HEADERS = 			\
 	tracker.h					\
+	tracker-client.h				\
 	tracker-sparql-builder.h
 
 # Generate DBus files from XML data.
diff --git a/src/libtracker-client/tracker-client.h b/src/libtracker-client/tracker-client.h
new file mode 100644
index 0000000..4716ac2
--- /dev/null
+++ b/src/libtracker-client/tracker-client.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010, Nokia
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+#ifndef __LIBTRACKER_CLIENT_H__
+#define __LIBTRACKER_CLIENT_H__
+
+#include <glib.h>
+
+#define __LIBTRACKER_CLIENT_INSIDE__
+
+#include "tracker.h"
+#include "tracker-sparql-builder.h"
+
+#undef __LIBTRACKER_CLIENT_INSIDE__
+
+#endif /* __LIBTRACKER_CLIENT_H__ */
diff --git a/src/libtracker-client/tracker.h b/src/libtracker-client/tracker.h
index 06b7c90..dc964df 100644
--- a/src/libtracker-client/tracker.h
+++ b/src/libtracker-client/tracker.h
@@ -21,6 +21,10 @@
 #ifndef __TRACKER_CLIENT_H__
 #define __TRACKER_CLIENT_H__
 
+#if !defined (__LIBTRACKER_CLIENT_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-client/tracker-client.h> must be included directly."
+#endif
+
 #include <glib-object.h>
 
 G_BEGIN_DECLS
diff --git a/src/plugins/nautilus/tracker-tags-extension.c b/src/plugins/nautilus/tracker-tags-extension.c
index 9e6958b..1b0b5d3 100644
--- a/src/plugins/nautilus/tracker-tags-extension.c
+++ b/src/plugins/nautilus/tracker-tags-extension.c
@@ -26,7 +26,7 @@
 #include <libnautilus-extension/nautilus-menu-provider.h>
 #include <libnautilus-extension/nautilus-property-page-provider.h>
 
-#include <libtracker-client/tracker.h>
+#include <libtracker-client/tracker-client.h>
 
 #include "tracker-tags-utils.h"
 #include "tracker-tags-view.h"
diff --git a/src/plugins/nautilus/tracker-tags-view.c b/src/plugins/nautilus/tracker-tags-view.c
index 7ffa709..cedca43 100644
--- a/src/plugins/nautilus/tracker-tags-view.c
+++ b/src/plugins/nautilus/tracker-tags-view.c
@@ -25,7 +25,8 @@
 #include <glib/gi18n.h>
 
 #include <libnautilus-extension/nautilus-file-info.h>
-#include <libtracker-client/tracker.h>
+
+#include <libtracker-client/tracker-client.h>
 
 #include "tracker-tags-utils.h"
 #include "tracker-tags-view.h"
diff --git a/src/tracker-search-bar/tracker-results-window.c b/src/tracker-search-bar/tracker-results-window.c
index 77ebaeb..eaa7fe1 100644
--- a/src/tracker-search-bar/tracker-results-window.c
+++ b/src/tracker-search-bar/tracker-results-window.c
@@ -29,7 +29,7 @@
 
 #include <panel-applet.h>
 
-#include <libtracker-client/tracker.h>
+#include <libtracker-client/tracker-client.h>
 
 #include "tracker-results-window.h"
 #include "tracker-aligned-window.h"



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