summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2010-12-06 18:22:49 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2010-12-06 19:33:02 +0100
commit2cd0637c786e4753d2de2c1b28830167f649b222 (patch)
tree17d909603bda4ea5576e22f2b608c91180975eeb
parentec33cb55b3f200fe29a49a40ed0190eb38ec7a05 (diff)
gtk: s/vnc/spice/ grab_sequence, break API
-rw-r--r--doc/reference/Makefile.am3
-rw-r--r--doc/reference/spice-gtk-docs.xml1
-rw-r--r--doc/reference/spice-gtk.types2
-rw-r--r--gtk/Makefile.am12
-rw-r--r--gtk/spice-client-gtk.defs38
-rw-r--r--gtk/spice-client-gtk.override8
-rw-r--r--gtk/spice-grabsequence.c (renamed from gtk/vncgrabsequence.c)34
-rw-r--r--gtk/spice-grabsequence.h (renamed from gtk/vncgrabsequence.h)24
-rw-r--r--gtk/spice-widget.c16
-rw-r--r--gtk/spice-widget.h6
10 files changed, 73 insertions, 71 deletions
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index b01b6e7..04b3292 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -72,8 +72,7 @@ IGNORE_HFILES= \
spice-session-priv.h \
spice-types.h \
tcp.h \
- vncdisplaykeymap.h \
- vncgrabsequence.h
+ vncdisplaykeymap.h
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
diff --git a/doc/reference/spice-gtk-docs.xml b/doc/reference/spice-gtk-docs.xml
index 52903c4..0057119 100644
--- a/doc/reference/spice-gtk-docs.xml
+++ b/doc/reference/spice-gtk-docs.xml
@@ -47,6 +47,7 @@
<title>Display GTK Widget, from spice-client-gtk</title>
<xi:include href="xml/spice-widget.xml"/>
<xi:include href="xml/spice-widget-enums.xml"/>
+ <xi:include href="xml/spice-grabsequence.xml"/>
</chapter>
</part>
diff --git a/doc/reference/spice-gtk.types b/doc/reference/spice-gtk.types
index cc481b5..ebe2dc8 100644
--- a/doc/reference/spice-gtk.types
+++ b/doc/reference/spice-gtk.types
@@ -12,6 +12,7 @@
#include "channel-playback.h"
#include "channel-record.h"
#include "spice-widget.h"
+#include "spice-grabsequence.h"
spice_audio_get_type
spice_channel_get_type
@@ -25,3 +26,4 @@ spice_playback_channel_get_type
spice_record_channel_get_type
spice_session_get_type
spice_display_get_type
+spice_grab_sequence_get_type
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index c7634c1..1823a87 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -48,8 +48,9 @@ AM_CPPFLAGS = \
$(SPICE_COMMON_CPPFLAGS) \
$(SPICE_CFLAGS)
+# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libspice_client_gtk_la_LDFLAGS = \
- -version-number 0:0:1 \
+ -version-number 1:0:0 \
-no-undefined \
$(NULL)
@@ -64,20 +65,19 @@ libspice_client_gtk_la_SOURCES = \
spice-widget-enums.h \
vncdisplaykeymap.c \
vncdisplaykeymap.h \
- vncgrabsequence.c \
- vncgrabsequence.h \
+ spice-grabsequence.c \
+ spice-grabsequence.h \
$(NULL)
libspice_client_gtkincludedir = $(includedir)/spice-client-gtk
libspice_client_gtkinclude_HEADERS = \
spice-widget.h \
spice-widget-enums.h \
- vncgrabsequence.h \
+ spice-grabsequence.h \
$(NULL)
-
libspice_client_glib_la_LDFLAGS = \
- -version-number 0:0:1 \
+ -version-number 1:0:0 \
-no-undefined \
$(NULL)
diff --git a/gtk/spice-client-gtk.defs b/gtk/spice-client-gtk.defs
index a838e58..af6f4de 100644
--- a/gtk/spice-client-gtk.defs
+++ b/gtk/spice-client-gtk.defs
@@ -151,14 +151,14 @@
(c-name "spice_display_set_grab_keys")
(return-type "none")
(parameters
- '("VncGrabSequence*" "seq")
+ '("SpiceGrabSequence*" "seq")
)
)
(define-method get_grab_keys
(of-object "SpiceDisplay")
(c-name "spice_display_get_grab_keys")
- (return-type "VncGrabSequence*")
+ (return-type "SpiceGrabSequence*")
)
(define-method send_keys
@@ -189,46 +189,46 @@
-;; From vncgrabsequence.h
+;; From spice-grabsequence.h
-(define-function vnc_grab_sequence_get_type
- (c-name "vnc_grab_sequence_get_type")
+(define-function spice_grab_sequence_get_type
+ (c-name "spice_grab_sequence_get_type")
(return-type "GType")
)
-(define-function vnc_grab_sequence_new
- (c-name "vnc_grab_sequence_new")
- (is-constructor-of "VncGrabSequence")
- (return-type "VncGrabSequence*")
+(define-function spice_grab_sequence_new
+ (c-name "spice_grab_sequence_new")
+ (is-constructor-of "SpiceGrabSequence")
+ (return-type "SpiceGrabSequence*")
(parameters
'("guint" "nkeysyms")
'("guint*" "keysyms")
)
)
-(define-function vnc_grab_sequence_new_from_string
- (c-name "vnc_grab_sequence_new_from_string")
- (return-type "VncGrabSequence*")
+(define-function spice_grab_sequence_new_from_string
+ (c-name "spice_grab_sequence_new_from_string")
+ (return-type "SpiceGrabSequence*")
(parameters
'("const-gchar*" "str")
)
)
(define-method copy
- (of-object "VncGrabSequence")
- (c-name "vnc_grab_sequence_copy")
- (return-type "VncGrabSequence*")
+ (of-object "SpiceGrabSequence")
+ (c-name "spice_grab_sequence_copy")
+ (return-type "SpiceGrabSequence*")
)
(define-method free
- (of-object "VncGrabSequence")
- (c-name "vnc_grab_sequence_free")
+ (of-object "SpiceGrabSequence")
+ (c-name "spice_grab_sequence_free")
(return-type "none")
)
(define-method as_string
- (of-object "VncGrabSequence")
- (c-name "vnc_grab_sequence_as_string")
+ (of-object "SpiceGrabSequence")
+ (c-name "spice_grab_sequence_as_string")
(return-type "gchar*")
)
diff --git a/gtk/spice-client-gtk.override b/gtk/spice-client-gtk.override
index e72196c..7b3543a 100644
--- a/gtk/spice-client-gtk.override
+++ b/gtk/spice-client-gtk.override
@@ -61,7 +61,7 @@ static PyObject*
_wrap_spice_display_get_grab_keys(PyGObject *self,
PyObject *args, PyObject *kwargs)
{
- VncGrabSequence *seq;
+ SpiceGrabSequence *seq;
PyObject *keyList;
int i;
@@ -84,7 +84,7 @@ _wrap_spice_display_set_grab_keys(PyGObject *self,
int i;
guint nkeysyms;
guint *keysyms;
- VncGrabSequence *seq;
+ SpiceGrabSequence *seq;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"O|I:SpiceDisplay.set_grab_keys", kwlist,
@@ -102,12 +102,12 @@ _wrap_spice_display_set_grab_keys(PyGObject *self,
keysyms[i] = (guint)PyInt_AsLong(val);
}
- seq = vnc_grab_sequence_new(nkeysyms, keysyms);
+ seq = spice_grab_sequence_new(nkeysyms, keysyms);
g_free(keysyms);
spice_display_set_grab_keys(SPICE_DISPLAY(self->obj), seq);
- vnc_grab_sequence_free(seq);
+ spice_grab_sequence_free(seq);
Py_INCREF(Py_None);
return Py_None;
diff --git a/gtk/vncgrabsequence.c b/gtk/spice-grabsequence.c
index 21b88a9..2bb5822 100644
--- a/gtk/vncgrabsequence.c
+++ b/gtk/spice-grabsequence.c
@@ -23,28 +23,28 @@
#include <string.h>
#include <gdk/gdk.h>
-#include "vncgrabsequence.h"
+#include "spice-grabsequence.h"
-GType vnc_grab_sequence_get_type(void)
+GType spice_grab_sequence_get_type(void)
{
static GType grab_sequence_type = 0;
if (G_UNLIKELY(grab_sequence_type == 0)) {
grab_sequence_type = g_boxed_type_register_static
- ("VncGrabSequence",
- (GBoxedCopyFunc)vnc_grab_sequence_copy,
- (GBoxedFreeFunc)vnc_grab_sequence_free);
+ ("SpiceGrabSequence",
+ (GBoxedCopyFunc)spice_grab_sequence_copy,
+ (GBoxedFreeFunc)spice_grab_sequence_free);
}
return grab_sequence_type;
}
-VncGrabSequence *vnc_grab_sequence_new(guint nkeysyms, guint *keysyms)
+SpiceGrabSequence *spice_grab_sequence_new(guint nkeysyms, guint *keysyms)
{
- VncGrabSequence *sequence;
+ SpiceGrabSequence *sequence;
- sequence = g_slice_new0(VncGrabSequence);
+ sequence = g_slice_new0(SpiceGrabSequence);
sequence->nkeysyms = nkeysyms;
sequence->keysyms = g_new0(guint, nkeysyms);
memcpy(sequence->keysyms, keysyms, sizeof(guint)*nkeysyms);
@@ -53,13 +53,13 @@ VncGrabSequence *vnc_grab_sequence_new(guint nkeysyms, guint *keysyms)
}
-VncGrabSequence *vnc_grab_sequence_new_from_string(const gchar *str)
+SpiceGrabSequence *spice_grab_sequence_new_from_string(const gchar *str)
{
gchar **keysymstr;
int i;
- VncGrabSequence *sequence;
+ SpiceGrabSequence *sequence;
- sequence = g_slice_new0(VncGrabSequence);
+ sequence = g_slice_new0(SpiceGrabSequence);
keysymstr = g_strsplit(str, "+", 5);
@@ -77,11 +77,11 @@ VncGrabSequence *vnc_grab_sequence_new_from_string(const gchar *str)
}
-VncGrabSequence *vnc_grab_sequence_copy(VncGrabSequence *srcSequence)
+SpiceGrabSequence *spice_grab_sequence_copy(SpiceGrabSequence *srcSequence)
{
- VncGrabSequence *sequence;
+ SpiceGrabSequence *sequence;
- sequence = g_slice_dup(VncGrabSequence, srcSequence);
+ sequence = g_slice_dup(SpiceGrabSequence, srcSequence);
sequence->keysyms = g_new0(guint, srcSequence->nkeysyms);
memcpy(sequence->keysyms, srcSequence->keysyms,
sizeof(guint) * sequence->nkeysyms);
@@ -90,13 +90,13 @@ VncGrabSequence *vnc_grab_sequence_copy(VncGrabSequence *srcSequence)
}
-void vnc_grab_sequence_free(VncGrabSequence *sequence)
+void spice_grab_sequence_free(SpiceGrabSequence *sequence)
{
- g_slice_free(VncGrabSequence, sequence);
+ g_slice_free(SpiceGrabSequence, sequence);
}
-gchar *vnc_grab_sequence_as_string(VncGrabSequence *sequence)
+gchar *spice_grab_sequence_as_string(SpiceGrabSequence *sequence)
{
GString *str = g_string_new("");
int i;
diff --git a/gtk/vncgrabsequence.h b/gtk/spice-grabsequence.h
index c0b9bd1..d611186 100644
--- a/gtk/vncgrabsequence.h
+++ b/gtk/spice-grabsequence.h
@@ -19,37 +19,37 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef VNC_GRAB_SEQUENCE_H
-#define VNC_GRAB_SEQUENCE_H
+#ifndef SPICE_GRAB_SEQUENCE_H
+#define SPICE_GRAB_SEQUENCE_H
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
-#define VNC_TYPE_GRAB_SEQUENCE (vnc_grab_sequence_get_type ())
+#define SPICE_TYPE_GRAB_SEQUENCE (spice_grab_sequence_get_type ())
-typedef struct _VncGrabSequence VncGrabSequence;
+typedef struct _SpiceGrabSequence SpiceGrabSequence;
-struct _VncGrabSequence {
+struct _SpiceGrabSequence {
guint nkeysyms;
guint *keysyms;
/* Do not add fields to this struct */
};
-GType vnc_grab_sequence_get_type(void);
+GType spice_grab_sequence_get_type(void);
-VncGrabSequence *vnc_grab_sequence_new(guint nkeysyms, guint *keysyms);
-VncGrabSequence *vnc_grab_sequence_new_from_string(const gchar *str);
-VncGrabSequence *vnc_grab_sequence_copy(VncGrabSequence *sequence);
-void vnc_grab_sequence_free(VncGrabSequence *sequence);
-gchar *vnc_grab_sequence_as_string(VncGrabSequence *sequence);
+SpiceGrabSequence *spice_grab_sequence_new(guint nkeysyms, guint *keysyms);
+SpiceGrabSequence *spice_grab_sequence_new_from_string(const gchar *str);
+SpiceGrabSequence *spice_grab_sequence_copy(SpiceGrabSequence *sequence);
+void spice_grab_sequence_free(SpiceGrabSequence *sequence);
+gchar *spice_grab_sequence_as_string(SpiceGrabSequence *sequence);
G_END_DECLS
-#endif /* VNC_GRAB_SEQUENCE_H */
+#endif /* SPICE_GRAB_SEQUENCE_H */
/*
* Local variables:
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index f18b005..759cd17 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -87,7 +87,7 @@ struct spice_display {
const guint16 const *keycode_map;
size_t keycode_maplen;
uint32_t key_state[512 / 32];
- VncGrabSequence *grabseq; /* the configured key sequence */
+ SpiceGrabSequence *grabseq; /* the configured key sequence */
gboolean *activeseq; /* the currently pressed keys */
gint mark;
};
@@ -257,7 +257,7 @@ static void spice_display_finalize(GObject *obj)
SPICE_DEBUG("Finalize SpiceDisplay");
if (d->grabseq) {
- vnc_grab_sequence_free(d->grabseq);
+ spice_grab_sequence_free(d->grabseq);
d->grabseq = NULL;
}
@@ -285,7 +285,7 @@ static void spice_display_init(SpiceDisplay *display)
gtk_widget_set_can_focus(widget, true);
d->keycode_map = vnc_display_keymap_gdk2xtkbd_table(&d->keycode_maplen);
- d->grabseq = vnc_grab_sequence_new_from_string("Control_L+Alt_L");
+ d->grabseq = spice_grab_sequence_new_from_string("Control_L+Alt_L");
d->activeseq = g_new0(gboolean, d->grabseq->nkeysyms);
d->clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
@@ -393,23 +393,23 @@ static void spice_sync_keyboard_lock_modifiers(SpiceDisplay *display)
spice_inputs_set_key_locks(d->inputs, modifiers);
}
-void spice_display_set_grab_keys(SpiceDisplay *display, VncGrabSequence *seq)
+void spice_display_set_grab_keys(SpiceDisplay *display, SpiceGrabSequence *seq)
{
spice_display *d = SPICE_DISPLAY_GET_PRIVATE(display);
g_return_if_fail(d != NULL);
if (d->grabseq) {
- vnc_grab_sequence_free(d->grabseq);
+ spice_grab_sequence_free(d->grabseq);
g_free(d->activeseq);
}
if (seq)
- d->grabseq = vnc_grab_sequence_copy(seq);
+ d->grabseq = spice_grab_sequence_copy(seq);
else
- d->grabseq = vnc_grab_sequence_new_from_string("Control_L+Alt_L");
+ d->grabseq = spice_grab_sequence_new_from_string("Control_L+Alt_L");
d->activeseq = g_new0(gboolean, d->grabseq->nkeysyms);
}
-VncGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display)
+SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display)
{
spice_display *d = SPICE_DISPLAY_GET_PRIVATE(display);
g_return_val_if_fail(d != NULL, NULL);
diff --git a/gtk/spice-widget.h b/gtk/spice-widget.h
index 3c38507..83957a6 100644
--- a/gtk/spice-widget.h
+++ b/gtk/spice-widget.h
@@ -21,7 +21,7 @@
#include "spice-client.h"
#include <gtk/gtk.h>
-#include "vncgrabsequence.h"
+#include "spice-grabsequence.h"
#include "spice-widget-enums.h"
#include "spice-util.h"
@@ -72,8 +72,8 @@ SpiceDisplay* spice_display_new(SpiceSession *session, int id);
void spice_display_mouse_ungrab(SpiceDisplay *display);
void spice_display_copy_to_guest(SpiceDisplay *display);
void spice_display_paste_from_guest(SpiceDisplay *display);
-void spice_display_set_grab_keys(SpiceDisplay *display, VncGrabSequence *seq);
-VncGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display);
+void spice_display_set_grab_keys(SpiceDisplay *display, SpiceGrabSequence *seq);
+SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display);
void spice_display_send_keys(SpiceDisplay *display, const guint *keyvals,
int nkeyvals, SpiceDisplayKeyEvent kind);
GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay *display);