summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-09-23 11:16:58 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2015-10-09 10:00:56 -0500
commitd2f33178c40ac51b1c8b1bf796a328631d9869c7 (patch)
tree46d293aac260682fe88ae54bd2f53ece953b281b
parent75253b7a8fb8fa59c317abeb01b4fa3981597d9e (diff)
downloadspice-gtk-d2f33178c40ac51b1c8b1bf796a328631d9869c7.tar.gz
spice-gtk-d2f33178c40ac51b1c8b1bf796a328631d9869c7.tar.xz
spice-gtk-d2f33178c40ac51b1c8b1bf796a328631d9869c7.zip
Glib applications should only include spice-client.h
Generate a compiler warning if an application attempts to include a different header.
-rw-r--r--doc/reference/Makefile.am2
-rw-r--r--src/Makefile.am1
-rw-r--r--src/channel-cursor.c2
-rw-r--r--src/channel-cursor.h4
-rw-r--r--src/channel-display.c2
-rw-r--r--src/channel-display.h4
-rw-r--r--src/channel-inputs.c2
-rw-r--r--src/channel-inputs.h4
-rw-r--r--src/channel-main.c2
-rw-r--r--src/channel-main.h4
-rw-r--r--src/channel-playback.c2
-rw-r--r--src/channel-playback.h4
-rw-r--r--src/channel-port.c2
-rw-r--r--src/channel-port.h4
-rw-r--r--src/channel-record.c2
-rw-r--r--src/channel-record.h4
-rw-r--r--src/channel-smartcard.c2
-rw-r--r--src/channel-smartcard.h4
-rw-r--r--src/channel-usbredir.c2
-rw-r--r--src/channel-usbredir.h4
-rw-r--r--src/channel-webdav.c2
-rw-r--r--src/channel-webdav.h4
-rw-r--r--src/smartcard-manager.c2
-rw-r--r--src/smartcard-manager.h4
-rw-r--r--src/spice-audio.c2
-rw-r--r--src/spice-audio.h4
-rw-r--r--src/spice-channel.c2
-rw-r--r--src/spice-channel.h4
-rw-r--r--src/spice-client.h4
-rw-r--r--src/spice-option.h4
-rw-r--r--src/spice-session.c2
-rw-r--r--src/spice-session.h4
-rw-r--r--src/spice-types.h4
-rw-r--r--src/spice-uri.c2
-rw-r--r--src/spice-uri.h4
-rw-r--r--src/spice-util.c2
-rw-r--r--src/spice-version.h.in4
-rw-r--r--src/usb-device-manager.c2
-rw-r--r--src/usb-device-manager.h4
39 files changed, 99 insertions, 18 deletions
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index ed94138..2d13863 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -54,7 +54,7 @@ IGNORE_HFILES= \
$(NULL)
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
-GTKDOC_CFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src $(SPICE_GLIB_CFLAGS) $(SPICE_GTK_CFLAGS) $(COMMON_CFLAGS)
+GTKDOC_CFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src $(SPICE_GLIB_CFLAGS) $(SPICE_GTK_CFLAGS) $(COMMON_CFLAGS) -DSPICE_COMPILATION
GTKDOC_LIBS = $(top_builddir)/src/libspice-client-glib-2.0.la $(top_builddir)/src/libspice-client-gtk-$(SPICE_GTK_API_VERSION).la $(GTK_LIBS)
include $(top_srcdir)/gtk-doc.make
diff --git a/src/Makefile.am b/src/Makefile.am
index cf02198..90ebf33 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -79,6 +79,7 @@ endif
KEYMAP_GEN = $(srcdir)/keymap-gen.pl
SPICE_COMMON_CPPFLAGS = \
+ -DSPICE_COMPILATION \
-DG_LOG_DOMAIN=\"GSpice\" \
-DSPICE_NO_DEPRECATED \
-DSPICE_GTK_LOCALEDIR=\"${SPICE_GTK_LOCALEDIR}\" \
diff --git a/src/channel-cursor.c b/src/channel-cursor.c
index e6514a2..6a9d60a 100644
--- a/src/channel-cursor.c
+++ b/src/channel-cursor.c
@@ -32,7 +32,7 @@
* @section_id:
* @see_also: #SpiceChannel, and the GTK widget #SpiceDisplay
* @stability: Stable
- * @include: channel-cursor.h
+ * @include: spice-client.h
*
* The Spice protocol defines a set of messages for controlling cursor
* shape and position on the remote display area. The cursor changes
diff --git a/src/channel-cursor.h b/src/channel-cursor.h
index 5b5ed47..20f0380 100644
--- a/src/channel-cursor.h
+++ b/src/channel-cursor.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_CURSOR_CHANNEL_H__
#define __SPICE_CLIENT_CURSOR_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-display.c b/src/channel-display.c
index c3a504f..9f9d62a 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -46,7 +46,7 @@
* @section_id:
* @see_also: #SpiceChannel, and the GTK widget #SpiceDisplay
* @stability: Stable
- * @include: channel-display.h
+ * @include: spice-client.h
*
* A class that handles the rendering of the remote display and inform
* of its updates.
diff --git a/src/channel-display.h b/src/channel-display.h
index 88e60d9..8e68b60 100644
--- a/src/channel-display.h
+++ b/src/channel-display.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_DISPLAY_CHANNEL_H__
#define __SPICE_CLIENT_DISPLAY_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-inputs.c b/src/channel-inputs.c
index 93cfd2e..7572bff 100644
--- a/src/channel-inputs.c
+++ b/src/channel-inputs.c
@@ -28,7 +28,7 @@
* @section_id:
* @see_also: #SpiceChannel, and the GTK widget #SpiceDisplay
* @stability: Stable
- * @include: channel-inputs.h
+ * @include: spice-client.h
*
* Spice supports sending keyboard key events and keyboard leds
* synchronization. The key events are sent using
diff --git a/src/channel-inputs.h b/src/channel-inputs.h
index 8933116..5123c47 100644
--- a/src/channel-inputs.h
+++ b/src/channel-inputs.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_INPUTS_CHANNEL_H__
#define __SPICE_CLIENT_INPUTS_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-main.c b/src/channel-main.c
index 2af9e64..688b486 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -39,7 +39,7 @@
* @section_id:
* @see_also: #SpiceChannel, and the GTK widget #SpiceDisplay
* @stability: Stable
- * @include: channel-main.h
+ * @include: spice-client.h
*
* The main channel is the Spice session control channel. It handles
* communication initialization (channels list), migrations, mouse
diff --git a/src/channel-main.h b/src/channel-main.h
index 86bb46b..6b94c25 100644
--- a/src/channel-main.h
+++ b/src/channel-main.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_MAIN_CHANNEL_H__
#define __SPICE_CLIENT_MAIN_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-playback.c b/src/channel-playback.c
index 020f809..a124cbb 100644
--- a/src/channel-playback.c
+++ b/src/channel-playback.c
@@ -33,7 +33,7 @@
* @section_id:
* @see_also: #SpiceChannel, and #SpiceAudio
* @stability: Stable
- * @include: channel-playback.h
+ * @include: spice-client.h
*
* #SpicePlaybackChannel class handles an audio playback stream. The
* audio data is received via #SpicePlaybackChannel::playback-data
diff --git a/src/channel-playback.h b/src/channel-playback.h
index 9cf68cf..e61409d 100644
--- a/src/channel-playback.h
+++ b/src/channel-playback.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_PLAYBACK_CHANNEL_H__
#define __SPICE_CLIENT_PLAYBACK_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-port.c b/src/channel-port.c
index 222074c..6e01caa 100644
--- a/src/channel-port.c
+++ b/src/channel-port.c
@@ -30,7 +30,7 @@
* @section_id:
* @see_also: #SpiceChannel
* @stability: Stable
- * @include: channel-port.h
+ * @include: spice-client.h
*
* A Spice port channel carry arbitrary data between the Spice client
* and the Spice server. It may be used to provide additional
diff --git a/src/channel-port.h b/src/channel-port.h
index 08c15dc..8fc19cc 100644
--- a/src/channel-port.h
+++ b/src/channel-port.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_PORT_CHANNEL_H__
#define __SPICE_CLIENT_PORT_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include <gio/gio.h>
#include "spice-channel.h"
diff --git a/src/channel-record.c b/src/channel-record.c
index a44c860..08269c9 100644
--- a/src/channel-record.c
+++ b/src/channel-record.c
@@ -33,7 +33,7 @@
* @section_id:
* @see_also: #SpiceChannel, and #SpiceAudio
* @stability: Stable
- * @include: channel-record.h
+ * @include: spice-client.h
*
* #SpiceRecordChannel class handles an audio recording stream. The
* audio stream should start when #SpiceRecordChannel::record-start is
diff --git a/src/channel-record.h b/src/channel-record.h
index 20a9ad3..c851421 100644
--- a/src/channel-record.h
+++ b/src/channel-record.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_RECORD_CHANNEL_H__
#define __SPICE_CLIENT_RECORD_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-smartcard.c b/src/channel-smartcard.c
index d91c9a0..942f973 100644
--- a/src/channel-smartcard.c
+++ b/src/channel-smartcard.c
@@ -36,7 +36,7 @@
* @section_id:
* @see_also: #SpiceSmartcardManager, #SpiceSession
* @stability: API Stable (channel in development)
- * @include: channel-smartcard.h
+ * @include: spice-client.h
*
* The Spice protocol defines a set of messages to forward smartcard
* information from the Spice client to the VM. This channel handles
diff --git a/src/channel-smartcard.h b/src/channel-smartcard.h
index 28c8b88..10926d0 100644
--- a/src/channel-smartcard.h
+++ b/src/channel-smartcard.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_SMARTCARD_CHANNEL_H__
#define __SPICE_CLIENT_SMARTCARD_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index 89f5c9d..c236ee7 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -44,7 +44,7 @@
* @title: USB Redirection Channel
* @section_id:
* @stability: API Stable (channel in development)
- * @include: channel-usbredir.h
+ * @include: spice-client.h
*
* The Spice protocol defines a set of messages to redirect USB devices
* from the Spice client to the VM. This channel handles these messages.
diff --git a/src/channel-usbredir.h b/src/channel-usbredir.h
index 0cc4fbf..0b43060 100644
--- a/src/channel-usbredir.h
+++ b/src/channel-usbredir.h
@@ -21,6 +21,10 @@
#ifndef __SPICE_CLIENT_USBREDIR_CHANNEL_H__
#define __SPICE_CLIENT_USBREDIR_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
G_BEGIN_DECLS
diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 06db70d..e72c92c 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -33,7 +33,7 @@
* @section_id:
* @see_also: #SpiceChannel
* @stability: Stable
- * @include: channel-webdav.h
+ * @include: spice-client.h
*
* The "webdav" channel exports a directory to the guest for file
* manipulation (read/write/copy etc). The underlying protocol is
diff --git a/src/channel-webdav.h b/src/channel-webdav.h
index 7940706..45bcb28 100644
--- a/src/channel-webdav.h
+++ b/src/channel-webdav.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_WEBDAV_CHANNEL_H__
#define __SPICE_WEBDAV_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include <gio/gio.h>
#include "spice-client.h"
#include "channel-port.h"
diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c
index 0cce42b..8e0d239 100644
--- a/src/smartcard-manager.c
+++ b/src/smartcard-manager.c
@@ -40,7 +40,7 @@
* @section_id:
* @see_also:
* @stability: Stable
- * @include: smartcard-manager.h
+ * @include: spice-client.h
*
* #SpiceSmartcardManager monitors smartcard reader plugging/unplugging,
* and smartcard insertions/removals. It also provides methods to handle
diff --git a/src/smartcard-manager.h b/src/smartcard-manager.h
index 2a7fd48..f74098f 100644
--- a/src/smartcard-manager.h
+++ b/src/smartcard-manager.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_SMARTCARD_MANAGER_H__
#define __SPICE_SMARTCARD_MANAGER_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
G_BEGIN_DECLS
#include "spice-types.h"
diff --git a/src/spice-audio.c b/src/spice-audio.c
index 3114a0a..75742d7 100644
--- a/src/spice-audio.c
+++ b/src/spice-audio.c
@@ -26,7 +26,7 @@
* @section_id:
* @see_also: #SpiceRecordChannel, and #SpicePlaybackChannel
* @stability: Stable
- * @include: spice-audio.h
+ * @include: spice-client.h
*
* A class that handles the playback and record channels for your
* application, and connect them to the default sound system.
diff --git a/src/spice-audio.h b/src/spice-audio.h
index 0bf625b..01f564a 100644
--- a/src/spice-audio.h
+++ b/src/spice-audio.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_AUDIO_H__
#define __SPICE_CLIENT_AUDIO_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include <glib-object.h>
#include <gio/gio.h>
#include "spice-util.h"
diff --git a/src/spice-channel.c b/src/spice-channel.c
index 2ce52c7..d459ec4 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -63,7 +63,7 @@ static gboolean channel_connect(SpiceChannel *channel, gboolean tls);
* @section_id:
* @see_also: #SpiceSession, #SpiceMainChannel and other channels
* @stability: Stable
- * @include: spice-channel.h
+ * @include: spice-client.h
*
* #SpiceChannel is the base class for the different kind of Spice
* channel connections, such as #SpiceMainChannel, or
diff --git a/src/spice-channel.h b/src/spice-channel.h
index f465572..da31843 100644
--- a/src/spice-channel.h
+++ b/src/spice-channel.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_CHANNEL_H__
#define __SPICE_CLIENT_CHANNEL_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
G_BEGIN_DECLS
#include <gio/gio.h>
diff --git a/src/spice-client.h b/src/spice-client.h
index 5a4d838..aaa6775 100644
--- a/src/spice-client.h
+++ b/src/spice-client.h
@@ -22,6 +22,8 @@
#include <glib.h>
#include <glib-object.h>
+#define __SPICE_CLIENT_H_INSIDE__
+
/* spice-protocol */
#include <spice/enums.h>
#include <spice/protocol.h>
@@ -88,4 +90,6 @@ GQuark spice_client_error_quark(void);
G_END_DECLS
+#undef __SPICE_CLIENT_H_INSIDE__
+
#endif /* __SPICE_CLIENT_CLIENT_H__ */
diff --git a/src/spice-option.h b/src/spice-option.h
index ce24f65..847e14c 100644
--- a/src/spice-option.h
+++ b/src/spice-option.h
@@ -18,6 +18,10 @@
#ifndef SPICE_OPTION_H
#define SPICE_OPTION_H
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include <glib.h>
#include "spice-session.h"
diff --git a/src/spice-session.c b/src/spice-session.c
index e1d9997..85640a5 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -134,7 +134,7 @@ struct _SpiceSessionPrivate {
* @section_id:
* @see_also: #SpiceChannel, and the GTK widget #SpiceDisplay
* @stability: Stable
- * @include: spice-session.h
+ * @include: spice-client.h
*
* The #SpiceSession class handles all the #SpiceChannel connections.
* It's also the class that contains connections informations, such as
diff --git a/src/spice-session.h b/src/spice-session.h
index 56f6959..cfe02b1 100644
--- a/src/spice-session.h
+++ b/src/spice-session.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_SESSION_H__
#define __SPICE_CLIENT_SESSION_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include <glib-object.h>
#include "spice-types.h"
#include "spice-uri.h"
diff --git a/src/spice-types.h b/src/spice-types.h
index f149094..ccc0c3a 100644
--- a/src/spice-types.h
+++ b/src/spice-types.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_CLIENT_TYPES_H__
#define __SPICE_CLIENT_TYPES_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
G_BEGIN_DECLS
/* SpiceSession */
diff --git a/src/spice-uri.c b/src/spice-uri.c
index 82aefdb..e2c5c9a 100644
--- a/src/spice-uri.c
+++ b/src/spice-uri.c
@@ -30,7 +30,7 @@
* @title: SpiceURI
* @section_id:
* @stability: Stable
- * @include: spice-uri.h
+ * @include: spice-client.h
*
* A SpiceURI represents a (parsed) URI.
* Since: 0.24
diff --git a/src/spice-uri.h b/src/spice-uri.h
index 65ffd0a..9960712 100644
--- a/src/spice-uri.h
+++ b/src/spice-uri.h
@@ -18,6 +18,10 @@
#ifndef __SPICE_URI_H__
#define __SPICE_URI_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include <glib-object.h>
G_BEGIN_DECLS
diff --git a/src/spice-util.c b/src/spice-util.c
index b4bc085..84ed94a 100644
--- a/src/spice-util.c
+++ b/src/spice-util.c
@@ -33,7 +33,7 @@
* @title: Utilities
* @section_id:
* @stability: Stable
- * @include: spice-util.h
+ * @include: spice-client.h
*
* Various functions for debugging and informational purposes.
*/
diff --git a/src/spice-version.h.in b/src/spice-version.h.in
index 49164f8..2314022 100644
--- a/src/spice-version.h.in
+++ b/src/spice-version.h.in
@@ -18,6 +18,10 @@
#ifndef __SPICE_VERSION_H__
#define __SPICE_VERSION_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
/**
* SECTION:spice-version
* @short_description: Spice-Gtk version checking
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 777fdf0..c62f56e 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -64,7 +64,7 @@
* @section_id:
* @see_also:
* @stability: Stable
- * @include: usb-device-manager.h
+ * @include: spice-client.h
*
* #SpiceUsbDeviceManager monitors USB redirection channels and USB
* devices plugging/unplugging. If #SpiceUsbDeviceManager:auto-connect
diff --git a/src/usb-device-manager.h b/src/usb-device-manager.h
index c1e3f76..e05ebae 100644
--- a/src/usb-device-manager.h
+++ b/src/usb-device-manager.h
@@ -21,6 +21,10 @@
#ifndef __SPICE_USB_DEVICE_MANAGER_H__
#define __SPICE_USB_DEVICE_MANAGER_H__
+#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client.h> can be included directly"
+#endif
+
#include "spice-client.h"
#include <gio/gio.h>