[Spice-commits] 3 commits - doc/reference src/channel-cursor.c src/channel-cursor.h src/channel-display.c src/channel-display.h src/channel-inputs.c src/channel-inputs.h src/channel-main.c src/channel-main.h src/channel-playback.c src/channel-playback.h src/channel-port.c src/channel-port.h src/channel-record.c src/channel-record.h src/channel-smartcard.c src/channel-smartcard.h src/channel-usbredir.c src/channel-usbredir.h src/channel-webdav.c src/channel-webdav.h src/Makefile.am src/smartcard-manager.c src/smartcard-manager.h src/spice-audio.c src/spice-audio.h src/spice-channel.c src/spice-channel.h src/spice-client-gtk.h src/spice-client.h src/spice-grabsequence.h src/spice-gtk-session.c src/spice-gtk-session.h src/spice-option.h src/spice-session.c src/spice-session.h src/spice-types.h src/spice-uri.c src/spice-uri.h src/spice-util.c src/spice-version.h.in src/spice-widget.c src/spice-widget.h src/spice-widget-priv.h src/usb-device-manager.c src/usb-device-manager.h src/usb-device-widg et.c src/usb-device-widget.h

Jonathon Jongsma jjongsma at kemper.freedesktop.org
Fri Oct 9 08:02:36 PDT 2015


 doc/reference/Makefile.am |    2 +-
 src/Makefile.am           |    2 ++
 src/channel-cursor.c      |    2 +-
 src/channel-cursor.h      |    4 ++++
 src/channel-display.c     |    2 +-
 src/channel-display.h     |    4 ++++
 src/channel-inputs.c      |    2 +-
 src/channel-inputs.h      |    4 ++++
 src/channel-main.c        |    2 +-
 src/channel-main.h        |    4 ++++
 src/channel-playback.c    |    2 +-
 src/channel-playback.h    |    4 ++++
 src/channel-port.c        |    2 +-
 src/channel-port.h        |    4 ++++
 src/channel-record.c      |    2 +-
 src/channel-record.h      |    4 ++++
 src/channel-smartcard.c   |    2 +-
 src/channel-smartcard.h   |    4 ++++
 src/channel-usbredir.c    |    2 +-
 src/channel-usbredir.h    |    4 ++++
 src/channel-webdav.c      |    2 +-
 src/channel-webdav.h      |    4 ++++
 src/smartcard-manager.c   |    2 +-
 src/smartcard-manager.h   |    6 +++++-
 src/spice-audio.c         |    2 +-
 src/spice-audio.h         |    4 ++++
 src/spice-channel.c       |    2 +-
 src/spice-channel.h       |    7 ++++++-
 src/spice-client-gtk.h    |   32 ++++++++++++++++++++++++++++++++
 src/spice-client.h        |    4 ++++
 src/spice-grabsequence.h  |    4 ++++
 src/spice-gtk-session.c   |    2 +-
 src/spice-gtk-session.h   |    4 ++++
 src/spice-option.h        |    4 ++++
 src/spice-session.c       |    2 +-
 src/spice-session.h       |    4 ++++
 src/spice-types.h         |    4 ++++
 src/spice-uri.c           |    2 +-
 src/spice-uri.h           |    4 ++++
 src/spice-util.c          |    2 +-
 src/spice-version.h.in    |    4 ++++
 src/spice-widget-priv.h   |    4 ++--
 src/spice-widget.c        |    2 +-
 src/spice-widget.h        |    4 ++++
 src/usb-device-manager.c  |    2 +-
 src/usb-device-manager.h  |    4 ++++
 src/usb-device-widget.c   |    2 +-
 src/usb-device-widget.h   |    4 ++++
 48 files changed, 156 insertions(+), 25 deletions(-)

New commits:
commit 9c47d3a39277144b8f3c04113d3a8672af2ed357
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date:   Wed Sep 23 11:36:01 2015 -0500

    Don't wrap included headers in G_BEGIN|END_DECLS
    
    Only the local declarations should be declared extern "C", otherwise it
    can result in unexpected errors such as this (encountered while re-ordering
    some include statements for a different patch):
    
      CC       channel-inputs.lo
    In file included from /usr/include/glib-2.0/glib/gmacros.h:38:0,
                     from /usr/lib64/glib-2.0/include/glibconfig.h:9,
                     from /usr/include/glib-2.0/glib/gtypes.h:32,
                     from /usr/include/glib-2.0/glib/galloca.h:32,
                     from /usr/include/glib-2.0/glib.h:30,
                     from /usr/include/glib-2.0/gobject/gbinding.h:28,
                     from /usr/include/glib-2.0/glib-object.h:23,
                     from /usr/include/glib-2.0/gio/gioenums.h:28,
                     from /usr/include/glib-2.0/gio/giotypes.h:28,
                     from /usr/include/glib-2.0/gio/gio.h:26,
                     from ../../src/spice-channel.h:27,
                     from ../../src/channel-inputs.h:25,
                     from ../../src/channel-inputs.c:20:
    /usr/lib/gcc/x86_64-redhat-linux/4.9.2/include/stddef.h:147:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
     typedef __PTRDIFF_TYPE__ ptrdiff_t;
     ^

diff --git a/src/smartcard-manager.h b/src/smartcard-manager.h
index f74098f..e4a6277 100644
--- a/src/smartcard-manager.h
+++ b/src/smartcard-manager.h
@@ -22,11 +22,11 @@
 #warning "Only <spice-client.h> can be included directly"
 #endif
 
-G_BEGIN_DECLS
-
 #include "spice-types.h"
 #include "spice-util.h"
 
+G_BEGIN_DECLS
+
 #define SPICE_TYPE_SMARTCARD_MANAGER            (spice_smartcard_manager_get_type ())
 #define SPICE_SMARTCARD_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_SMARTCARD_MANAGER, SpiceSmartcardManager))
 #define SPICE_SMARTCARD_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_SMARTCARD_MANAGER, SpiceSmartcardManagerClass))
diff --git a/src/spice-channel.h b/src/spice-channel.h
index da31843..3b0bffb 100644
--- a/src/spice-channel.h
+++ b/src/spice-channel.h
@@ -22,13 +22,14 @@
 #warning "Only <spice-client.h> can be included directly"
 #endif
 
-G_BEGIN_DECLS
-
 #include <gio/gio.h>
+
 #include "spice-types.h"
 #include "spice-glib-enums.h"
 #include "spice-util.h"
 
+G_BEGIN_DECLS
+
 #define SPICE_TYPE_CHANNEL            (spice_channel_get_type ())
 #define SPICE_CHANNEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_CHANNEL, SpiceChannel))
 #define SPICE_CHANNEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_CHANNEL, SpiceChannelClass))
diff --git a/src/spice-widget-priv.h b/src/spice-widget-priv.h
index 0e1f661..682e889 100644
--- a/src/spice-widget-priv.h
+++ b/src/spice-widget-priv.h
@@ -18,8 +18,6 @@
 #ifndef __SPICE_WIDGET_PRIV_H__
 #define __SPICE_WIDGET_PRIV_H__
 
-G_BEGIN_DECLS
-
 #include "config.h"
 
 #ifdef WITH_X11
@@ -36,6 +34,8 @@ G_BEGIN_DECLS
 #include "spice-common.h"
 #include "spice-gtk-session.h"
 
+G_BEGIN_DECLS
+
 #define SPICE_DISPLAY_GET_PRIVATE(obj)                                  \
     (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_DISPLAY, SpiceDisplayPrivate))
 
commit 056f0510a955f1b292567b8a4ab1962b2727da11
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date:   Thu Sep 24 17:05:39 2015 -0500

    Gtk applications should only include spice-client-gtk.h
    
    This header is the single include needed for all gtk-related
    functionality, similar to spice-client.h. Generate a compiler warning if
    a different header is included.

diff --git a/src/Makefile.am b/src/Makefile.am
index 90ebf33..aa5d2b1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -176,6 +176,7 @@ endif
 
 libspice_client_gtkincludedir = $(includedir)/spice-client-gtk-$(SPICE_GTK_API_VERSION)
 libspice_client_gtkinclude_HEADERS =	\
+	spice-client-gtk.h		\
 	spice-gtk-session.h		\
 	spice-widget.h			\
 	spice-grabsequence.h		\
diff --git a/src/spice-client-gtk.h b/src/spice-client-gtk.h
new file mode 100644
index 0000000..0667145
--- /dev/null
+++ b/src/spice-client-gtk.h
@@ -0,0 +1,32 @@
+/*
+   Copyright (C) 2015 Red Hat, Inc.
+
+   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, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef __SPICE_CLIENT_GTK_H__
+#define __SPICE_CLIENT_GTK_H__
+
+#include "spice-client.h"
+
+#define __SPICE_CLIENT_GTK_H_INSIDE__
+
+#include "spice-grabsequence.h"
+#include "spice-gtk-session.h"
+#include "spice-widget-enums.h"
+#include "spice-widget.h"
+#include "usb-device-widget.h"
+
+#undef __SPICE_CLIENT_GTK_H_INSIDE__
+
+#endif /* __SPICE_CLIENT_GTK_H__ */
diff --git a/src/spice-grabsequence.h b/src/spice-grabsequence.h
index af227b0..28979ec 100644
--- a/src/spice-grabsequence.h
+++ b/src/spice-grabsequence.h
@@ -22,6 +22,10 @@
 #ifndef SPICE_GRAB_SEQUENCE_H
 #define SPICE_GRAB_SEQUENCE_H
 
+#if !defined(__SPICE_CLIENT_GTK_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client-gtk.h> can be included directly"
+#endif
+
 #include <glib.h>
 #include <glib-object.h>
 
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 90f5116..5abb16c 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -73,7 +73,7 @@ struct _SpiceGtkSessionPrivate {
  * @section_id:
  * @see_also: #SpiceSession, and the GTK widget #SpiceDisplay
  * @stability: Stable
- * @include: spice-gtk-session.h
+ * @include: spice-client-gtk.h
  *
  * The #SpiceGtkSession class is the spice-client-gtk counter part of
  * #SpiceSession. It contains functionality which should be handled per
diff --git a/src/spice-gtk-session.h b/src/spice-gtk-session.h
index a69c174..9a45d85 100644
--- a/src/spice-gtk-session.h
+++ b/src/spice-gtk-session.h
@@ -18,6 +18,10 @@
 #ifndef __SPICE_CLIENT_GTK_SESSION_H__
 #define __SPICE_CLIENT_GTK_SESSION_H__
 
+#if !defined(__SPICE_CLIENT_GTK_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client-gtk.h> can be included directly"
+#endif
+
 #include "spice-client.h"
 
 G_BEGIN_DECLS
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 524263d..503f82a 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -52,7 +52,7 @@
  * @title: Spice Display
  * @section_id:
  * @stability: Stable
- * @include: spice-widget.h
+ * @include: spice-client-gtk.h
  *
  * A GTK widget that displays a SPICE server. It sends keyboard/mouse
  * events and can also share clipboard...
diff --git a/src/spice-widget.h b/src/spice-widget.h
index f180a43..213db7a 100644
--- a/src/spice-widget.h
+++ b/src/spice-widget.h
@@ -18,6 +18,10 @@
 #ifndef __SPICE_CLIENT_WIDGET_H__
 #define __SPICE_CLIENT_WIDGET_H__
 
+#if !defined(__SPICE_CLIENT_GTK_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client-gtk.h> can be included directly"
+#endif
+
 #include "spice-client.h"
 
 #include <gtk/gtk.h>
diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index 84435b2..fe983c9 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -33,7 +33,7 @@
  * @section_id:
  * @see_also:
  * @stability: Stable
- * @include: usb-device-widget.h
+ * @include: spice-client-gtk.h
  *
  * #SpiceUsbDeviceWidget is a gtk widget which apps can use to easily
  * add an UI to select USB devices to redirect (or unredirect).
diff --git a/src/usb-device-widget.h b/src/usb-device-widget.h
index 9143d5c..8ce91f2 100644
--- a/src/usb-device-widget.h
+++ b/src/usb-device-widget.h
@@ -21,6 +21,10 @@
 #ifndef __SPICE_USB_DEVICE_WIDGET_H__
 #define __SPICE_USB_DEVICE_WIDGET_H__
 
+#if !defined(__SPICE_CLIENT_GTK_H_INSIDE__) && !defined(SPICE_COMPILATION)
+#warning "Only <spice-client-gtk.h> can be included directly"
+#endif
+
 #include <gtk/gtk.h>
 #include "spice-client.h"
 
commit d2f33178c40ac51b1c8b1bf796a328631d9869c7
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date:   Wed Sep 23 11:16:58 2015 -0500

    Glib applications should only include spice-client.h
    
    Generate a compiler warning if an application attempts to include a
    different header.

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>
 


More information about the Spice-commits mailing list