diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2008-11-26 13:03:50 -0500 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2008-11-26 13:03:50 -0500 |
commit | 61a05530b104c7cab018f691b4678824d04de9fa (patch) | |
tree | 85e73151b99a3a74f35a9353fb1a7bd77b0864fe /plugin | |
parent | 9951d5e831915ab3b90f4d2190739000a8cd88e9 (diff) |
Re-write completely to use Glade, libvirt events, and libvirt-glib integration
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/Makefile.am | 15 | ||||
-rw-r--r-- | plugin/npshell.c | 8 | ||||
-rw-r--r-- | plugin/virt-viewer-plugin.c | 12 | ||||
-rw-r--r-- | plugin/virt-viewer-plugin.h | 2 |
4 files changed, 22 insertions, 15 deletions
diff --git a/plugin/Makefile.am b/plugin/Makefile.am index 1735ba6..c64d80a 100644 --- a/plugin/Makefile.am +++ b/plugin/Makefile.am @@ -9,13 +9,24 @@ virt_viewer_plugin_la_SOURCES = \ npshell.c npunix.c virt_viewer_plugin_la_LIBADD = \ @FIREFOX_PLUGIN_LIBS@ \ - @GTKVNC_LIBS@ @GTK2_LIBS@ @LIBXML2_LIBS@ @LIBVIRT_LIBS@ + @GTKVNC_LIBS@ \ + @GTK2_LIBS@ \ + @LIBXML2_LIBS@ \ + @LIBGLADE2_LIBS@ \ + @LIBVIRT_LIBS@ \ + @LIBVIRT_GLIB_LIBS@ virt_viewer_plugin_la_LDFLAGS = \ -module -avoid-version virt_viewer_plugin_la_CFLAGS = \ -DPLUGIN=1 -DENABLE_DEBUG=1 -DDEBUG=1 \ @FIREFOX_PLUGIN_CFLAGS@ \ - @GTKVNC_CFLAGS@ @GTK2_CFLAGS@ @LIBXML2_CFLAGS@ @LIBVIRT_CFLAGS@ \ + @GTKVNC_CFLAGS@ \ + @GTK2_CFLAGS@ \ + @LIBXML2_CFLAGS@ \ + @LIBGLADE2_CFLAGS@ \ + @LIBVIRT_CFLAGS@ \ + @LIBVIRT_GLIB_CFLAGS@ \ + -DGLADE_DIR="\"$(pkgdatadir)/ui\"" \ @WARN_CFLAGS@ \ -I$(top_srcdir)/src diff --git a/plugin/npshell.c b/plugin/npshell.c index b2419a4..60010d6 100644 --- a/plugin/npshell.c +++ b/plugin/npshell.c @@ -198,7 +198,7 @@ NPP_New(NPMIMEType pluginType G_GNUC_UNUSED, This->mode = mode; This->instance = instance; This->uri = This->name = NULL; - This->direct = This->waitvnc = 0; + This->direct = This->waitvm = This->reconnect = 0; /* Read the parameters passed to the plugin. */ for (i = 0; i < argc; i++) @@ -209,8 +209,10 @@ NPP_New(NPMIMEType pluginType G_GNUC_UNUSED, This->name = strdup (argv[i]); else if (strcasecmp (argn[i], "direct") == 0) This->direct = strcmp (argv[i], "1") == 0; - else if (strcasecmp (argn[i], "waitvnc") == 0) - This->waitvnc = strcmp (argv[i], "1") == 0; + else if (strcasecmp (argn[i], "wait") == 0) + This->waitvm = strcmp (argv[i], "1") == 0; + else if (strcasecmp (argn[i], "reconnect") == 0) + This->reconnect = strcmp (argv[i], "1") == 0; } return NPERR_NO_ERROR; diff --git a/plugin/virt-viewer-plugin.c b/plugin/virt-viewer-plugin.c index 8d1bce3..ebd35f2 100644 --- a/plugin/virt-viewer-plugin.c +++ b/plugin/virt-viewer-plugin.c @@ -41,12 +41,6 @@ #include "virt-viewer-plugin.h" -static GtkWidget * -get_container (void *thisv) -{ - PluginInstance *This = (PluginInstance *) thisv; - return This->container; -} NPError VirtViewerXSetWindow (NPP instance, NPWindow *window) @@ -88,9 +82,9 @@ VirtViewerXSetWindow (NPP instance, NPWindow *window) /* Make the VNC widget. */ if (This->uri && This->name) { - debug ("calling viewer_start uri=%s name=%s direct=%d waitvnc=%d container=%p", This->uri, This->name, This->direct, This->waitvnc, This->container); - r = viewer_start (This->uri, This->name, This->direct, This->waitvnc, 1, - get_container, This, 0); + debug ("calling viewer_start uri=%s name=%s direct=%d waitvm=%d reconnect=%d container=%p", + This->uri, This->name, This->direct, This->waitvm, This->reconnect, This->container); + r = viewer_start (This->uri, This->name, This->direct, This->waitvm, This->reconnect, 1, This->container); if (r != 0) fprintf (stderr, "viewer_start returned %d != 0\n", r); } diff --git a/plugin/virt-viewer-plugin.h b/plugin/virt-viewer-plugin.h index 60b980a..d1d134b 100644 --- a/plugin/virt-viewer-plugin.h +++ b/plugin/virt-viewer-plugin.h @@ -57,7 +57,7 @@ typedef struct { GtkWidget *container; char *uri, *name; - int direct, waitvnc; + gboolean direct, waitvm, reconnect; } PluginInstance; extern NPError VirtViewerXSetWindow (NPP instance, NPWindow* window); |