[libvirt] [libvirt-glib 0/4] Add missing GVirConfigDomainGraphics* API

Hey, This series adds various missing setters/getters to the GVirConfigDomainGraphics API. It also adds classes for the 'desktop' and 'rdp' graphics elements. Christophe

--- libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.c | 12 ++++++++++++ libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h | 2 ++ libvirt-gconfig/libvirt-gconfig.sym | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.c index 0954b5f..2097383 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.c +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.c @@ -94,3 +94,15 @@ void gvir_config_domain_graphics_sdl_set_display(GVirConfigDomainGraphicsSdl *gr "display", disp, NULL); } + +void gvir_config_domain_graphics_sdl_set_fullscreen(GVirConfigDomainGraphicsSdl *graphics, + gboolean fullscreen) +{ + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SDL(graphics)); + + gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(graphics), + "fullscreen", + G_TYPE_BOOLEAN, + fullscreen, + NULL); +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h index 7ff8938..5110f1c 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h @@ -65,6 +65,8 @@ void gvir_config_domain_graphics_sdl_set_xauthority(GVirConfigDomainGraphicsSdl const gchar *path); void gvir_config_domain_graphics_sdl_set_display(GVirConfigDomainGraphicsSdl *graphics, const gchar *disp); +void gvir_config_domain_graphics_sdl_set_fullscreen(GVirConfigDomainGraphicsSdl *graphics, + gboolean fullscreen); G_END_DECLS diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index a1b2cc1..ccda4c0 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -512,4 +512,9 @@ LIBVIRT_GCONFIG_0.1.6 { gvir_config_domain_graphics_spice_image_compression_get_type; } LIBVIRT_GCONFIG_0.1.5; +LIBVIRT_GCONFIG_0.1.7 { + global: + gvir_config_domain_graphics_sdl_set_fullscreen; +} LIBVIRT_GCONFIG_0.1.6; + # .... define new API here using predicted next version number .... -- 1.8.1.4

--- libvirt-gconfig/Makefile.am | 2 + .../libvirt-gconfig-domain-graphics-rdp.c | 130 +++++++++++++++++++++ .../libvirt-gconfig-domain-graphics-rdp.h | 79 +++++++++++++ libvirt-gconfig/libvirt-gconfig.h | 1 + libvirt-gconfig/libvirt-gconfig.sym | 7 ++ 5 files changed, 219 insertions(+) create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.c create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.h diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am index 6b3b2cb..acd5289 100644 --- a/libvirt-gconfig/Makefile.am +++ b/libvirt-gconfig/Makefile.am @@ -39,6 +39,7 @@ GCONFIG_HEADER_FILES = \ libvirt-gconfig-domain-disk.h \ libvirt-gconfig-domain-filesys.h \ libvirt-gconfig-domain-graphics.h \ + libvirt-gconfig-domain-graphics-rdp.h \ libvirt-gconfig-domain-graphics-sdl.h \ libvirt-gconfig-domain-graphics-spice.h \ libvirt-gconfig-domain-graphics-vnc.h \ @@ -116,6 +117,7 @@ GCONFIG_SOURCE_FILES = \ libvirt-gconfig-domain-disk.c \ libvirt-gconfig-domain-filesys.c \ libvirt-gconfig-domain-graphics.c \ + libvirt-gconfig-domain-graphics-rdp.c \ libvirt-gconfig-domain-graphics-sdl.c \ libvirt-gconfig-domain-graphics-spice.c \ libvirt-gconfig-domain-graphics-vnc.c \ diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.c new file mode 100644 index 0000000..8a4084e --- /dev/null +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.c @@ -0,0 +1,130 @@ +/* + * libvirt-gconfig-domain-graphics-rdp.c: libvirt domain RDP configuration + * + * Copyright (C) 2011 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/>. + * + * Author: Daniel P. Berrange <berrange@redhat.com> + */ + +#include <config.h> + +#include "libvirt-gconfig/libvirt-gconfig.h" +#include "libvirt-gconfig/libvirt-gconfig-private.h" + +#define GVIR_CONFIG_DOMAIN_GRAPHICS_RDP_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP, GVirConfigDomainGraphicsRdpPrivate)) + +struct _GVirConfigDomainGraphicsRdpPrivate +{ + gboolean unused; +}; + +G_DEFINE_TYPE(GVirConfigDomainGraphicsRdp, gvir_config_domain_graphics_rdp, GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS); + + +static void gvir_config_domain_graphics_rdp_class_init(GVirConfigDomainGraphicsRdpClass *klass) +{ + g_type_class_add_private(klass, sizeof(GVirConfigDomainGraphicsRdpPrivate)); +} + + +static void gvir_config_domain_graphics_rdp_init(GVirConfigDomainGraphicsRdp *graphics_rdp) +{ + g_debug("Init GVirConfigDomainGraphicsRdp=%p", graphics_rdp); + + graphics_rdp->priv = GVIR_CONFIG_DOMAIN_GRAPHICS_RDP_GET_PRIVATE(graphics_rdp); +} + + +GVirConfigDomainGraphicsRdp *gvir_config_domain_graphics_rdp_new(void) +{ + GVirConfigObject *object; + + object = gvir_config_object_new(GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP, + "graphics", NULL); + gvir_config_object_set_attribute(object, "type", "rdp", NULL); + return GVIR_CONFIG_DOMAIN_GRAPHICS_RDP(object); +} + +GVirConfigDomainGraphicsRdp * +gvir_config_domain_graphics_rdp_new_from_xml(const gchar *xml, + GError **error) +{ + GVirConfigObject *object; + + object = gvir_config_object_new_from_xml(GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP, + "graphics", NULL, xml, error); + if (g_strcmp0(gvir_config_object_get_attribute(object, NULL, "type"), "rdp") != 0) { + g_object_unref(G_OBJECT(object)); + return NULL; + } + return GVIR_CONFIG_DOMAIN_GRAPHICS_RDP(object); +} + +void gvir_config_domain_graphics_rdp_set_autoport(GVirConfigDomainGraphicsRdp *graphics, + gboolean autoport) +{ + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_RDP(graphics)); + + gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(graphics), + "autoport", G_TYPE_BOOLEAN, autoport, + NULL); +} + +int gvir_config_domain_graphics_rdp_get_port(GVirConfigDomainGraphicsRdp *graphics) +{ + g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_RDP(graphics), 0); + + return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(graphics), + NULL, "port", 0); +} + +void gvir_config_domain_graphics_rdp_set_port(GVirConfigDomainGraphicsRdp *graphics, + int port) +{ + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_RDP(graphics)); + + gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(graphics), + "port", G_TYPE_INT, port, + NULL); +} + + +void gvir_config_domain_graphics_rdp_set_replace_user(GVirConfigDomainGraphicsRdp *graphics, + gboolean replace_user) +{ + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_RDP(graphics)); + + gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(graphics), + "replaceUser", + G_TYPE_BOOLEAN, + replace_user, + NULL); +} + + +void gvir_config_domain_graphics_rdp_set_multi_user(GVirConfigDomainGraphicsRdp *graphics, + gboolean multi_user) +{ + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_RDP(graphics)); + + gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(graphics), + "multiUser", + G_TYPE_BOOLEAN, + multi_user, + NULL); +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.h new file mode 100644 index 0000000..fb47834 --- /dev/null +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.h @@ -0,0 +1,79 @@ +/* + * libvirt-gconfig-domain-graphics-rdp.h: libvirt domain RDP graphics configuration + * + * Copyright (C) 2011 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/>. + * + * Author: Daniel P. Berrange <berrange@redhat.com> + */ + +#if !defined(__LIBVIRT_GCONFIG_H__) && !defined(LIBVIRT_GCONFIG_BUILD) +#error "Only <libvirt-gconfig/libvirt-gconfig.h> can be included directly." +#endif + +#ifndef __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_RDP_H__ +#define __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_RDP_H__ + +G_BEGIN_DECLS + +#define GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP (gvir_config_domain_graphics_rdp_get_type ()) +#define GVIR_CONFIG_DOMAIN_GRAPHICS_RDP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP, GVirConfigDomainGraphicsRdp)) +#define GVIR_CONFIG_DOMAIN_GRAPHICS_RDP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP, GVirConfigDomainGraphicsRdpClass)) +#define GVIR_CONFIG_IS_DOMAIN_GRAPHICS_RDP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP)) +#define GVIR_CONFIG_IS_DOMAIN_GRAPHICS_RDP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP)) +#define GVIR_CONFIG_DOMAIN_GRAPHICS_RDP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP, GVirConfigDomainGraphicsRdpClass)) + +typedef struct _GVirConfigDomainGraphicsRdp GVirConfigDomainGraphicsRdp; +typedef struct _GVirConfigDomainGraphicsRdpPrivate GVirConfigDomainGraphicsRdpPrivate; +typedef struct _GVirConfigDomainGraphicsRdpClass GVirConfigDomainGraphicsRdpClass; + +struct _GVirConfigDomainGraphicsRdp +{ + GVirConfigDomainGraphics parent; + + GVirConfigDomainGraphicsRdpPrivate *priv; + + /* Do not add fields to this struct */ +}; + +struct _GVirConfigDomainGraphicsRdpClass +{ + GVirConfigDomainGraphicsClass parent_class; + + gpointer padding[20]; +}; + +GType gvir_config_domain_graphics_rdp_get_type(void); + +GVirConfigDomainGraphicsRdp *gvir_config_domain_graphics_rdp_new(void); +GVirConfigDomainGraphicsRdp *gvir_config_domain_graphics_rdp_new_from_xml(const gchar *xml, + GError **error); + +void gvir_config_domain_graphics_rdp_set_autoport(GVirConfigDomainGraphicsRdp *graphics, + gboolean autoport); + +int gvir_config_domain_graphics_rdp_get_port(GVirConfigDomainGraphicsRdp *graphics); +void gvir_config_domain_graphics_rdp_set_port(GVirConfigDomainGraphicsRdp *graphics, + int port); + +void gvir_config_domain_graphics_rdp_set_multi_user(GVirConfigDomainGraphicsRdp *graphics, + gboolean multi_user); +void gvir_config_domain_graphics_rdp_set_replace_user(GVirConfigDomainGraphicsRdp *graphics, + gboolean replace_user); + +G_END_DECLS + +#endif /* __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_RDP_H__ */ diff --git a/libvirt-gconfig/libvirt-gconfig.h b/libvirt-gconfig/libvirt-gconfig.h index d31b610..678389a 100644 --- a/libvirt-gconfig/libvirt-gconfig.h +++ b/libvirt-gconfig/libvirt-gconfig.h @@ -56,6 +56,7 @@ #include <libvirt-gconfig/libvirt-gconfig-domain-disk.h> #include <libvirt-gconfig/libvirt-gconfig-domain-filesys.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics.h> +#include <libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index ccda4c0..d06408f 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -515,6 +515,13 @@ LIBVIRT_GCONFIG_0.1.6 { LIBVIRT_GCONFIG_0.1.7 { global: gvir_config_domain_graphics_sdl_set_fullscreen; + + gvir_config_domain_graphics_rdp_get_type; + gvir_config_domain_graphics_rdp_new; + gvir_config_domain_graphics_rdp_new_from_xml; + gvir_config_domain_graphics_rdp_set_autoport; + gvir_config_domain_graphics_rdp_get_port; + gvir_config_domain_graphics_rdp_set_port; } LIBVIRT_GCONFIG_0.1.6; # .... define new API here using predicted next version number .... -- 1.8.1.4

--- libvirt-gconfig/Makefile.am | 2 + .../libvirt-gconfig-domain-graphics-desktop.c | 98 ++++++++++++++++++++++ .../libvirt-gconfig-domain-graphics-desktop.h | 71 ++++++++++++++++ libvirt-gconfig/libvirt-gconfig.h | 1 + libvirt-gconfig/libvirt-gconfig.sym | 6 ++ 5 files changed, 178 insertions(+) create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.c create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.h diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am index acd5289..68ba39d 100644 --- a/libvirt-gconfig/Makefile.am +++ b/libvirt-gconfig/Makefile.am @@ -39,6 +39,7 @@ GCONFIG_HEADER_FILES = \ libvirt-gconfig-domain-disk.h \ libvirt-gconfig-domain-filesys.h \ libvirt-gconfig-domain-graphics.h \ + libvirt-gconfig-domain-graphics-desktop.h \ libvirt-gconfig-domain-graphics-rdp.h \ libvirt-gconfig-domain-graphics-sdl.h \ libvirt-gconfig-domain-graphics-spice.h \ @@ -117,6 +118,7 @@ GCONFIG_SOURCE_FILES = \ libvirt-gconfig-domain-disk.c \ libvirt-gconfig-domain-filesys.c \ libvirt-gconfig-domain-graphics.c \ + libvirt-gconfig-domain-graphics-desktop.c \ libvirt-gconfig-domain-graphics-rdp.c \ libvirt-gconfig-domain-graphics-sdl.c \ libvirt-gconfig-domain-graphics-spice.c \ diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.c new file mode 100644 index 0000000..41b1112 --- /dev/null +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.c @@ -0,0 +1,98 @@ +/* + * libvirt-gconfig-domain-graphics-desktop.c: libvirt domain desktop configuration + * + * Copyright (C) 2011 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/>. + * + * Author: Daniel P. Berrange <berrange@redhat.com> + */ + +#include <config.h> + +#include "libvirt-gconfig/libvirt-gconfig.h" +#include "libvirt-gconfig/libvirt-gconfig-private.h" + +#define GVIR_CONFIG_DOMAIN_GRAPHICS_DESKTOP_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP, GVirConfigDomainGraphicsDesktopPrivate)) + +struct _GVirConfigDomainGraphicsDesktopPrivate +{ + gboolean unused; +}; + +G_DEFINE_TYPE(GVirConfigDomainGraphicsDesktop, gvir_config_domain_graphics_desktop, GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS); + + +static void gvir_config_domain_graphics_desktop_class_init(GVirConfigDomainGraphicsDesktopClass *klass) +{ + g_type_class_add_private(klass, sizeof(GVirConfigDomainGraphicsDesktopPrivate)); +} + + +static void gvir_config_domain_graphics_desktop_init(GVirConfigDomainGraphicsDesktop *graphics_desktop) +{ + g_debug("Init GVirConfigDomainGraphicsDesktop=%p", graphics_desktop); + + graphics_desktop->priv = GVIR_CONFIG_DOMAIN_GRAPHICS_DESKTOP_GET_PRIVATE(graphics_desktop); +} + + +GVirConfigDomainGraphicsDesktop *gvir_config_domain_graphics_desktop_new(void) +{ + GVirConfigObject *object; + + object = gvir_config_object_new(GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP, + "graphics", NULL); + gvir_config_object_set_attribute(object, "type", "desktop", NULL); + return GVIR_CONFIG_DOMAIN_GRAPHICS_DESKTOP(object); +} + +GVirConfigDomainGraphicsDesktop * +gvir_config_domain_graphics_desktop_new_from_xml(const gchar *xml, + GError **error) +{ + GVirConfigObject *object; + + object = gvir_config_object_new_from_xml(GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP, + "graphics", NULL, xml, error); + if (g_strcmp0(gvir_config_object_get_attribute(object, NULL, "type"), "desktop") != 0) { + g_object_unref(G_OBJECT(object)); + return NULL; + } + return GVIR_CONFIG_DOMAIN_GRAPHICS_DESKTOP(object); +} + +void gvir_config_domain_graphics_desktop_set_display(GVirConfigDomainGraphicsDesktop *graphics, + const gchar *disp) +{ + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_DESKTOP(graphics)); + + gvir_config_object_set_attribute(GVIR_CONFIG_OBJECT(graphics), + "display", disp, + NULL); +} + +void gvir_config_domain_graphics_desktop_set_fullscreen(GVirConfigDomainGraphicsDesktop *graphics, + gboolean fullscreen) +{ + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_DESKTOP(graphics)); + + gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(graphics), + "fullscreen", + G_TYPE_BOOLEAN, + fullscreen, + NULL); +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.h new file mode 100644 index 0000000..d16e3d8 --- /dev/null +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.h @@ -0,0 +1,71 @@ +/* + * libvirt-gconfig-domain-graphics-desktop.h: libvirt domain desktop configuration + * + * Copyright (C) 2011 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/>. + * + * Author: Daniel P. Berrange <berrange@redhat.com> + */ + +#if !defined(__LIBVIRT_GCONFIG_H__) && !defined(LIBVIRT_GCONFIG_BUILD) +#error "Only <libvirt-gconfig/libvirt-gconfig.h> can be included directly." +#endif + +#ifndef __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_DESKTOP_H__ +#define __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_DESKTOP_H__ + +G_BEGIN_DECLS + +#define GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP (gvir_config_domain_graphics_desktop_get_type ()) +#define GVIR_CONFIG_DOMAIN_GRAPHICS_DESKTOP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP, GVirConfigDomainGraphicsDesktop)) +#define GVIR_CONFIG_DOMAIN_GRAPHICS_DESKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP, GVirConfigDomainGraphicsDesktopClass)) +#define GVIR_CONFIG_IS_DOMAIN_GRAPHICS_DESKTOP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP)) +#define GVIR_CONFIG_IS_DOMAIN_GRAPHICS_DESKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP)) +#define GVIR_CONFIG_DOMAIN_GRAPHICS_DESKTOP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP, GVirConfigDomainGraphicsDesktopClass)) + +typedef struct _GVirConfigDomainGraphicsDesktop GVirConfigDomainGraphicsDesktop; +typedef struct _GVirConfigDomainGraphicsDesktopPrivate GVirConfigDomainGraphicsDesktopPrivate; +typedef struct _GVirConfigDomainGraphicsDesktopClass GVirConfigDomainGraphicsDesktopClass; + +struct _GVirConfigDomainGraphicsDesktop +{ + GVirConfigDomainGraphics parent; + + GVirConfigDomainGraphicsDesktopPrivate *priv; + + /* Do not add fields to this struct */ +}; + +struct _GVirConfigDomainGraphicsDesktopClass +{ + GVirConfigDomainGraphicsClass parent_class; + + gpointer padding[20]; +}; + +GType gvir_config_domain_graphics_desktop_get_type(void); + +GVirConfigDomainGraphicsDesktop *gvir_config_domain_graphics_desktop_new(void); +GVirConfigDomainGraphicsDesktop *gvir_config_domain_graphics_desktop_new_from_xml(const gchar *xml, + GError **error); +void gvir_config_domain_graphics_desktop_set_display(GVirConfigDomainGraphicsDesktop *graphics, + const gchar *disp); +void gvir_config_domain_graphics_desktop_set_fullscreen(GVirConfigDomainGraphicsDesktop *graphics, + gboolean fullscreen); + +G_END_DECLS + +#endif /* __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_DESKTOP_H__ */ diff --git a/libvirt-gconfig/libvirt-gconfig.h b/libvirt-gconfig/libvirt-gconfig.h index 678389a..b000747 100644 --- a/libvirt-gconfig/libvirt-gconfig.h +++ b/libvirt-gconfig/libvirt-gconfig.h @@ -56,6 +56,7 @@ #include <libvirt-gconfig/libvirt-gconfig-domain-disk.h> #include <libvirt-gconfig/libvirt-gconfig-domain-filesys.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics.h> +#include <libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h> #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index d06408f..886da2f 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -514,6 +514,12 @@ LIBVIRT_GCONFIG_0.1.6 { LIBVIRT_GCONFIG_0.1.7 { global: + gvir_config_domain_graphics_desktop_get_type; + gvir_config_domain_graphics_desktop_new; + gvir_config_domain_graphics_desktop_new_from_xml; + gvir_config_domain_graphics_desktop_set_display; + gvir_config_domain_graphics_desktop_set_fullscreen; + gvir_config_domain_graphics_sdl_set_fullscreen; gvir_config_domain_graphics_rdp_get_type; -- 1.8.1.4

--- libvirt-gconfig/libvirt-gconfig-domain-channel.c | 18 ++++++++++++++++++ libvirt-gconfig/libvirt-gconfig-domain-channel.h | 3 +++ libvirt-gconfig/libvirt-gconfig.sym | 3 +++ 3 files changed, 24 insertions(+) diff --git a/libvirt-gconfig/libvirt-gconfig-domain-channel.c b/libvirt-gconfig/libvirt-gconfig-domain-channel.c index 92dd674..9578bf3 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-channel.c +++ b/libvirt-gconfig/libvirt-gconfig-domain-channel.c @@ -71,6 +71,17 @@ GVirConfigDomainChannel *gvir_config_domain_channel_new_from_xml(const gchar *xm } +GVirConfigDomainChannelTargetType gvir_config_domain_channel_get_target_type(GVirConfigDomainChannel *channel) +{ + g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_CHANNEL(channel), + GVIR_CONFIG_DOMAIN_CHANNEL_TARGET_GUESTFWD); + + return gvir_config_object_get_attribute_genum(GVIR_CONFIG_OBJECT(channel), + "target", "type", + GVIR_CONFIG_TYPE_DOMAIN_CHANNEL_TARGET_TYPE, + GVIR_CONFIG_DOMAIN_CHANNEL_TARGET_GUESTFWD); +} + void gvir_config_domain_channel_set_target_type(GVirConfigDomainChannel *channel, GVirConfigDomainChannelTargetType type) { @@ -82,6 +93,13 @@ void gvir_config_domain_channel_set_target_type(GVirConfigDomainChannel *channel type); } +const gchar *gvir_config_domain_channel_get_target_name(GVirConfigDomainChannel *channel) +{ + g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_CHANNEL(channel), NULL); + + return gvir_config_object_get_attribute(GVIR_CONFIG_OBJECT(channel), + "target", "name"); +} void gvir_config_domain_channel_set_target_name(GVirConfigDomainChannel *channel, const gchar *name) diff --git a/libvirt-gconfig/libvirt-gconfig-domain-channel.h b/libvirt-gconfig/libvirt-gconfig-domain-channel.h index 3f3558b..889b09a 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-channel.h +++ b/libvirt-gconfig/libvirt-gconfig-domain-channel.h @@ -67,8 +67,11 @@ GVirConfigDomainChannel *gvir_config_domain_channel_new(void); GVirConfigDomainChannel *gvir_config_domain_channel_new_from_xml(const gchar *xml, GError **error); +GVirConfigDomainChannelTargetType gvir_config_domain_channel_get_target_type(GVirConfigDomainChannel *channel); void gvir_config_domain_channel_set_target_type(GVirConfigDomainChannel *channel, GVirConfigDomainChannelTargetType type); + +const gchar *gvir_config_domain_channel_get_target_name(GVirConfigDomainChannel *channel); void gvir_config_domain_channel_set_target_name(GVirConfigDomainChannel *channel, const gchar *name); diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index 886da2f..553d4fc 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -514,6 +514,9 @@ LIBVIRT_GCONFIG_0.1.6 { LIBVIRT_GCONFIG_0.1.7 { global: + gvir_config_domain_channel_get_target_name; + gvir_config_domain_channel_get_target_type; + gvir_config_domain_graphics_desktop_get_type; gvir_config_domain_graphics_desktop_new; gvir_config_domain_graphics_desktop_new_from_xml; -- 1.8.1.4
participants (1)
-
Christophe Fergeau