[PATCH v2 05/10] gtk: move SpiceGrabSequence

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

 



Do not leak internals of SpiceGrabSequence in public headers. This makes also
the class final, which let us extend more easily without fear of breaking ABI.

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxx>
---
 src/Makefile.am               |  1 +
 src/spice-grabsequence-priv.h | 28 ++++++++++++++++++++++++++++
 src/spice-grabsequence.c      |  1 +
 src/spice-grabsequence.h      | 13 -------------
 src/spice-widget.c            |  1 +
 5 files changed, 31 insertions(+), 13 deletions(-)
 create mode 100644 src/spice-grabsequence-priv.h

diff --git a/src/Makefile.am b/src/Makefile.am
index e35c046..d6935cf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -140,6 +140,7 @@ SPICE_GTK_SOURCES_COMMON =		\
 	vncdisplaykeymap.h		\
 	spice-grabsequence.c		\
 	spice-grabsequence.h		\
+	spice-grabsequence-priv.h	\
 	desktop-integration.c		\
 	desktop-integration.h		\
 	usb-device-widget.c		\
diff --git a/src/spice-grabsequence-priv.h b/src/spice-grabsequence-priv.h
new file mode 100644
index 0000000..5475730
--- /dev/null
+++ b/src/spice-grabsequence-priv.h
@@ -0,0 +1,28 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+  Copyright (C) 2016 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_GRABSEQUENCE_PRIV_H__
+#define __SPICE_GRABSEQUENCE_PRIV_H__
+
+#include <glib.h>
+
+struct _SpiceGrabSequence {
+    guint nkeysyms;
+    guint *keysyms;
+};
+
+#endif
diff --git a/src/spice-grabsequence.c b/src/spice-grabsequence.c
index a51d9e6..50e774d 100644
--- a/src/spice-grabsequence.c
+++ b/src/spice-grabsequence.c
@@ -24,6 +24,7 @@
 #include <gdk/gdk.h>
 
 #include "spice-grabsequence.h"
+#include "spice-grabsequence-priv.h"
 
 GType spice_grab_sequence_get_type(void)
 {
diff --git a/src/spice-grabsequence.h b/src/spice-grabsequence.h
index 28979ec..6e68e29 100644
--- a/src/spice-grabsequence.h
+++ b/src/spice-grabsequence.h
@@ -35,19 +35,6 @@ G_BEGIN_DECLS
 
 typedef struct _SpiceGrabSequence SpiceGrabSequence;
 
-/**
- * SpiceGrabSequence:
- *
- * The #SpiceGrabSequence struct is opaque and should not be accessed directly.
- */
-struct _SpiceGrabSequence {
-        /*< private >*/
-	guint nkeysyms;
-	guint *keysyms;
-
-	/* Do not add fields to this struct */
-};
-
 GType spice_grab_sequence_get_type(void);
 
 SpiceGrabSequence *spice_grab_sequence_new(guint nkeysyms, guint *keysyms);
diff --git a/src/spice-widget.c b/src/spice-widget.c
index c3577a1..ef166cb 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -40,6 +40,7 @@
 #include "spice-widget-priv.h"
 #include "spice-gtk-session-priv.h"
 #include "vncdisplaykeymap.h"
+#include "spice-grabsequence-priv.h"
 
 #include "glib-compat.h"
 #include "gtk-compat.h"
-- 
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]