diff options
author | Jonathon Jongsma <jjongsma@redhat.com> | 2015-09-24 17:05:39 -0500 |
---|---|---|
committer | Jonathon Jongsma <jjongsma@redhat.com> | 2015-10-09 10:00:56 -0500 |
commit | 056f0510a955f1b292567b8a4ab1962b2727da11 (patch) | |
tree | 26b4f9b5afe4ca76020a7f3acb57cfe43b61c17a | |
parent | d2f33178c40ac51b1c8b1bf796a328631d9869c7 (diff) | |
download | spice-gtk-056f0510a955f1b292567b8a4ab1962b2727da11.tar.gz spice-gtk-056f0510a955f1b292567b8a4ab1962b2727da11.tar.xz spice-gtk-056f0510a955f1b292567b8a4ab1962b2727da11.zip |
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.
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/spice-client-gtk.h | 32 | ||||
-rw-r--r-- | src/spice-grabsequence.h | 4 | ||||
-rw-r--r-- | src/spice-gtk-session.c | 2 | ||||
-rw-r--r-- | src/spice-gtk-session.h | 4 | ||||
-rw-r--r-- | src/spice-widget.c | 2 | ||||
-rw-r--r-- | src/spice-widget.h | 4 | ||||
-rw-r--r-- | src/usb-device-widget.c | 2 | ||||
-rw-r--r-- | src/usb-device-widget.h | 4 |
9 files changed, 52 insertions, 3 deletions
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" |