diff --git a/AUTHORS b/AUTHORS index 1adc118..48478c4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,22 +3,64 @@ The Virt Viewer application is written by - Daniel P. Berrange + Daniel P. Berrange With additional patches from: - Chris Lalancette - Atsushi SAKAI - Richard W.M. Jones - Guido G\374nther - Hiroyuki Kaguchi + Atsushi SAKAI + Chris Lalancette + Guannan Ren + Guido G\374nther + Hans de Goede + Hiroyuki Kaguchi + Jiri Denemark + Marc-André Lureau + Pavel Raiskup + Richard W.M. Jones Ronnie Sahlberg - Marc-André Lureau + Yann E. MORIN ...send patches to get your name here... -The Translation team are listed in the .po files for their -languages under the po/ directory. +Translations have been provided by + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- End diff --git a/ChangeLog b/ChangeLog index ac33f72..cb47e8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,234 @@ +2012-02-14 Daniel P. Berrange + + Update for release 0.5.0 + +2012-02-14 Marc-André Lureau + + First %d in controller title should be substituted with window nth + + Add libp11-kit-0.dll to nsis script + +2012-02-14 Daniel P. Berrange + + Set pretty icon for remote-viewer windows too + + Don't hardcode 'localhost' in no @listen parameter is given + If no @listen parameter is given, we must not hardcode 'localhost' + since we can't assume we are running on the same host. Instead use + the hostname from the connection URI + + Extract tlsPort for SPICE and use it to enable secure connections + +2012-02-08 Daniel P. Berrange + + Don't do whitespace checks on icons + + Set transient parent for screenshot dialog + + Ensure auth popup windows have correct transient parent + +2012-02-08 Marc-André Lureau + + Make the password field activates default widget + When pressing "Enter", the default auth dialog action isn't activated. + Setting activates_default to TRUE fixes this issue. + + Do not resize guest desktop if !auto-resize + If auto-resize is enabled, the guest desktop size will be resized to + match current window*zoom size. + + This can be a problem if the user explicitely set the desktop size to + a different resolution and want to keep it. Disabling auto-resize + sounds like a simple way to allow that. + + Resize Spice guest display to the container size + The SpiceDisplay doesn't receive the full allocation, because + VirtViewerDisplay maintains current aspect ratio. However, the guest + display can be resize up to its container size. + + This fixes going full-screen and not getting native resolution for + instance. + +2012-02-08 Daniel P. Berrange + + Ensure About dialog has transient hints setup + + Import a pretty icon for virt-viewer application + + Re-added GtkBuilder XML files to POTFILES.in + Adapt syntax-check rule to allow XML files in POTFILES.in and + re-add the GtkBuilder XML files + + Implement SPICE desktop resizing that takes account of zoom level + The standard SPICE widget guest resize implementation does not + take into account the zoom level settings in virt-viewer, because + it has no knowledge of this functionality. The guest resize can, + however, be done by calling spice_main_set_display() directly. + This allows virt-viewer to resize the guest taking into account + zoom levels. + + ie, if virt-viewer is run with --zoom 50 and the window + is resized to 400x300, then the guest agent should + be told to set its resolution to 800x600 + +2012-02-07 Daniel P. Berrange + + Revert support for resizing guest desktop + The SpiceDisplay widget has built-in support for resizing the + guest desktop, but this does not know that virt-viewer has a + zoom level setting. This makes the virt-viewer zoom completely + inoperable. Revert use of the 'resize-guest' property. + +2012-02-06 Marc-André Lureau + + Add spice-xpi-client-remote-viewer alternative + + man: add remote-viewer man page + +2012-02-06 Daniel P. Berrange + + Import GNULIB rules for syntax checking code + + Add config.h to every source file + + Use exit() constants + + copyright fix + + End of file whitespace cleanup + + Update POTFILES.in + + Replace @FOO@ with $(FOO) in all Makefile.am + + Update copyright headers + + Remove useless if() before free() + + Update AUTHORS file + + Simplify no-op debug macro & fix plugin header + + Fix makefile.am subsitutions for plugin + + Convert TABS to spaces & reindent everywhere + +2012-02-06 Hans de Goede + + Only make the USB device selection sensitive when the vm is USB capable + + Add a menu entry for USB device selection + +2012-02-06 Marc-André Lureau + + Grab the focus when showing the display + Override the grab_focus() method in the display class. Since both VNC + and Spice displays are the direct child, let's just grab the child. + It can be that this behaviour need to be overriden if Spice or VNC + display become more complex (using sub-childs or different objects) + +2012-01-31 Daniel P. Berrange + + Ignore more generated files + +2012-01-31 Guannan Ren + + Disconnect virt-viewer when receiving signal session-cancelled + + Register a new signal session-cancelled + + Tune the first argument in calls to g_type_class_add_private() + +2012-01-31 Daniel P. Berrange + + Support for virDomainOpenGraphics API + Add a new flag --attach, which instructs virt-viewer to attach + to the target display using virDomainOpenGraphics, instead of + initiating a VNC/SPICE connection directly. + + Make VNC support opening connections based on URI + + Adapt remote-viewer so that it builds without SPICE + +2012-01-31 Marc-André Lureau + + Add virt-viewer.nsis + Use ${DESTDIR} variable and @prefix@ to look for files. + Can't easily be generated, it has too much customization. + +2012-01-31 Marc-André Lureau + + Enable spice auto-usbredir + + Remove usage of deprecated property + + Add error dialog for USB redirection failure + + Resize guest desktop with SPICE + This is the method we prefer, even though we can't keep aspect ratio. + We could eventually support aspect ration in spice-gtk. + +2012-01-31 Marc-André Lureau + + build: make libvirt optionnal + +2012-01-31 Marc-André Lureau + + Use a first letter capital in help + The GLib/GNOME convention seems to have first letter as capital for + option description strings. + +2012-01-31 Marc-André Lureau + + Add spice_get_option_group() + + Add spice controller support in remote-viewer + Usage is simply "remote-viewer --spice-controller" + + Add remote-viewer program + This program is meant for direct URI connections. + ex: remote-viewer vnc://uri + +2012-01-30 Marc-André Lureau + + Add a few property getters, used by controller + - virt_viewer_app_get_windows() + - virt_viewer_window_get_builder() + - "VirtViewerSessionSpice:spice-session" property + + build: use AM_GLIB_GNU_GETTEXT + Using intltool macro only causes build issues on exotic platforms, + such as MinGW. + + As long as this bug isn't fixed, we should use AM_GLIB_GNU_GETTEXT + https://bugs.launchpad.net/intltool/+bug/398571 + + NB this partially reverts + + 3473c4bb49adc0caca58dc1a8b6ce81c6870558a + + The difference is the ordering of the rules. With AM_GLIB_GNU_GETTEXT + appearing after IT_PROG_INTLTOOL, the --disable-nls arg to configure + is broken. Thus AM_GLIB_GNU_GETTEXT is called first in this change. + +2012-01-30 Marc-André Lureau + + Make virt_viewer_activate() a vfunc + since other equivalent methods are already overridable. + + Add window-added & window-removed signals + + Use graphical URI for connection + If specified, use URI for connection details + + Add virt_viewer_session_open_uri + + build: replace deprecated functions + +2012-01-30 Daniel P. Berrange + + Add support for --system arg to autogen.sh + 2011-11-09 Daniel P. Berrange Prep for 0.4.2 release diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..ca88b6b --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,132 @@ +# Having a separate GNUmakefile lets me `include' the dynamically +# generated rules created via cfg.mk (package-local configuration) +# as well as maint.mk (generic maintainer rules). +# This makefile is used only if you run GNU Make. +# It is necessary if you want to build targets usually of interest +# only to the maintainer. + +# Copyright (C) 2001, 2003, 2006-2011 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Systems where /bin/sh is not the default shell need this. The $(shell) +# command below won't work with e.g. stock DOS/Windows shells. +ifeq ($(wildcard /bin/s[h]),/bin/sh) +SHELL = /bin/sh +else +# will be used only with the next shell-test line, then overwritten +# by a configured-in value +SHELL = sh +endif + +# If the user runs GNU make but has not yet run ./configure, +# give them a diagnostic. +_have-Makefile := $(shell test -f Makefile && echo yes) +ifeq ($(_have-Makefile),yes) + +# Make tar archive easier to reproduce. +export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner + +# Allow the user to add to this in the Makefile. +ALL_RECURSIVE_TARGETS = + +include Makefile + +# Some projects override e.g., _autoreconf here. +-include $(srcdir)/cfg.mk + +# Allow cfg.mk to override these. +_build-aux ?= build-aux +_autoreconf ?= autoreconf -v + +include $(srcdir)/maint.mk + +# Ensure that $(VERSION) is up to date for dist-related targets, but not +# for others: rerunning autoreconf and recompiling everything isn't cheap. +_have-git-version-gen := \ + $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes) +ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL)) + _is-dist-target ?= $(filter-out %clean, \ + $(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS))) + _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS))) + ifneq (,$(_is-dist-target)$(_is-install-target)) + _curr-ver := $(shell cd $(srcdir) \ + && $(_build-aux)/git-version-gen \ + .tarball-version \ + $(git-version-gen-tag-sed-script)) + ifneq ($(_curr-ver),$(VERSION)) + ifeq ($(_curr-ver),UNKNOWN) + $(info WARNING: unable to verify if $(VERSION) is the correct version) + else + ifneq (,$(_is-install-target)) + # GNU Coding Standards state that 'make install' should not cause + # recompilation after 'make all'. But as long as changing the version + # string alters config.h, the cost of having 'make all' always have an + # up-to-date version is prohibitive. So, as a compromise, we merely + # warn when installing a version string that is out of date; the user + # should run 'autoreconf' (or something like 'make distcheck') to + # fix the version, 'make all' to propagate it, then 'make install'. + $(info WARNING: version string $(VERSION) is out of date;) + $(info run '$(MAKE) _version' to fix it) + else + $(info INFO: running autoreconf for new version string: $(_curr-ver)) +GNUmakefile: _version + touch GNUmakefile + endif + endif + endif + endif +endif + +.PHONY: _version +_version: + cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf) + $(MAKE) $(AM_MAKEFLAGS) Makefile + +else + +.DEFAULT_GOAL := abort-due-to-no-makefile +srcdir = . + +# The package can override .DEFAULT_GOAL to run actions like autoreconf. +-include ./cfg.mk +include ./maint.mk + +ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile) +$(MAKECMDGOALS): abort-due-to-no-makefile +endif + +abort-due-to-no-makefile: + @echo There seems to be no Makefile in this directory. 1>&2 + @echo "You must run ./configure before running \`make'." 1>&2 + @exit 1 + +endif + +# Tell version 3.79 and up of GNU make to not build goals in this +# directory in parallel, in case someone tries to build multiple +# targets, and one of them can cause a recursive target to be invoked. + +# Only set this if Automake doesn't provide it. +AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) \ + dist distcheck tags ctags + +ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS) + +ifneq ($(word 2, $(MAKECMDGOALS)), ) +ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) +.NOTPARALLEL: +endif +endif diff --git a/Makefile.am b/Makefile.am index a40b3c0..d25207f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,24 +1,36 @@ +NULL = ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src man plugin po +SUBDIRS = src man plugin po data icons -EXTRA_DIST = @PACKAGE@.spec \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in +EXTRA_DIST = \ + $(PACKAGE).spec \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in \ + GNUmakefile \ + maint.mk \ + cfg.mk \ + build-aux/gitlog-to-changelog \ + build-aux/useless-if-before-free \ + build-aux/vc-list-files \ + $(NULL) -DISTCLEAN_FILES = @PACKAGE@.spec \ - intltool-extract \ - intltool-merge \ - intltool-update +DISTCLEAN_FILES = \ + $(PACKAGE).spec \ + intltool-extract \ + intltool-merge \ + intltool-update \ + $(NULL) -MAINTAINERCLEANFILES = \ - m4/libtool.m4 \ - m4/lt~obsolete.m4 \ - m4/ltoptions.m4 \ - m4/ltsugar.m4 \ - m4/ltversion.m4 +MAINTAINERCLEANFILES = \ + m4/libtool.m4 \ + m4/ltoptions.m4 \ + m4/ltsugar.m4 \ + m4/ltversion.m4 \ + m4/lt~obsolete.m4 \ + $(NULL) dist-hook: gen-ChangeLog diff --git a/Makefile.in b/Makefile.in index c902816..83a2063 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51,7 +51,7 @@ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = virt-viewer.spec mingw32-virt-viewer.spec +CONFIG_CLEAN_FILES = mingw32-virt-viewer.spec virt-viewer.spec CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) @@ -121,6 +121,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -144,6 +146,7 @@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_API_VERSION = @GTK_API_VERSION@ @@ -158,6 +161,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ @@ -177,9 +182,11 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -200,6 +207,10 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -263,24 +274,36 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +NULL = ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src man plugin po -EXTRA_DIST = @PACKAGE@.spec \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in - -DISTCLEAN_FILES = @PACKAGE@.spec \ - intltool-extract \ - intltool-merge \ - intltool-update +SUBDIRS = src man plugin po data icons +EXTRA_DIST = \ + $(PACKAGE).spec \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in \ + GNUmakefile \ + maint.mk \ + cfg.mk \ + build-aux/gitlog-to-changelog \ + build-aux/useless-if-before-free \ + build-aux/vc-list-files \ + $(NULL) + +DISTCLEAN_FILES = \ + $(PACKAGE).spec \ + intltool-extract \ + intltool-merge \ + intltool-update \ + $(NULL) MAINTAINERCLEANFILES = \ - m4/libtool.m4 \ - m4/lt~obsolete.m4 \ - m4/ltoptions.m4 \ - m4/ltsugar.m4 \ - m4/ltversion.m4 + m4/libtool.m4 \ + m4/ltoptions.m4 \ + m4/ltsugar.m4 \ + m4/ltversion.m4 \ + m4/lt~obsolete.m4 \ + $(NULL) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -337,9 +360,9 @@ distclean-hdr: -rm -f config.h stamp-h1 +mingw32-virt-viewer.spec: $(top_builddir)/config.status $(srcdir)/mingw32-virt-viewer.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ virt-viewer.spec: $(top_builddir)/config.status $(srcdir)/virt-viewer.spec.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -mingw32-virt-viewer.spec: $(top_builddir)/config.status $(srcdir)/mingw32-virt-viewer.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: diff --git a/NEWS b/NEWS index a66480c..b698561 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,24 @@ Virt Viewer News ================ + +0.5.0: Feb 14, 2012 +------------------- + + - Add a remote-viewer binary for connecting to a SPICE/VNC + server based on URI, instead of querying libvirt + - Add ability to attach to a local VM via libvirt instead of + connecting over UNIX sockets + - Add support for SPICE controller + - Allow build without libvirt, for remote-viewer only + - Automatically resize guest desktop when resizing window with SPICE + - Add support for redirecting host USB devices to remote guest + - Grab focus when first showing the display + - Register as a spice-xpi-client-remote alternative + - Add pretty icon for virt-viewer app + - Set transient window hints on all popups + - Activate password 'Ok' button when pressing Enter + - Support secure connections with SPICE + - Don't hardcode 'localhost' for hostname 0.4.2: Nov 9, 2011 ------------------- diff --git a/README b/README index caecb69..b7b0e9d 100644 --- a/README +++ b/README @@ -19,7 +19,7 @@ http://gtk-vnc.sourceforge.net/ -Virt Viewer uses the SPICE-GTK (>= 0.6) widget to provide a +Virt Viewer uses the SPICE-GTK (>= 0.9) widget to provide a display of the SPICE protocol, which is available from: http://spice-space.org/page/Spice-Gtk diff --git a/aclocal.m4 b/aclocal.m4 index bb090aa..63d3128 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -18,6 +18,443 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003,2004 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995, 1996 +# +# Modified to never use included libintl. +# Owen Taylor , 12/15/1998 +# +# Major rework to remove unused code +# Owen Taylor , 12/11/2002 +# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 +# +# Modified to require ngettext +# Matthias Clasen 08/06/2004 +# +# We need this here as well, since someone might use autoconf-2.5x +# to configure GLib then an older version to configure a package +# using AM_GLIB_GNU_GETTEXT +AC_PREREQ(2.53) + +dnl +dnl We go to great lengths to make sure that aclocal won't +dnl try to pull in the installed version of these macros +dnl when running aclocal in the glib directory. +dnl +m4_copy([AC_DEFUN],[glib_DEFUN]) +m4_copy([AC_REQUIRE],[glib_REQUIRE]) +dnl +dnl At the end, if we're not within glib, we'll define the public +dnl definitions in terms of our private definitions. +dnl + +# GLIB_LC_MESSAGES +#-------------------- +glib_DEFUN([GLIB_LC_MESSAGES], + [AC_CHECK_HEADERS([locale.h]) + if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# GLIB_PATH_PROG_WITH_TEST +#---------------------------- +dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# GLIB_WITH_NLS +#----------------- +glib_DEFUN([GLIB_WITH_NLS], + dnl NLS is obligatory + [USE_NLS=yes + AC_SUBST(USE_NLS) + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + AC_CHECK_HEADER(libintl.h, + [gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, + [AC_TRY_LINK([ +#include +], + [return !ngettext ("","", 1)], + gt_cv_func_ngettext_libc=yes, + gt_cv_func_ngettext_libc=no) + ]) + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return !dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CHECK_FUNCS(bind_textdomain_codeset) + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)])]) + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + AC_MSG_CHECKING([if -liconv is needed to use gettext]) + AC_MSG_RESULT([]) + AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dcgettext, + [gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv], + :,-liconv)], + :,-liconv) + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + AC_CHECK_FUNCS(bind_textdomain_codeset) + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + AC_DEFINE(HAVE_GETTEXT,1, + [Define if the GNU gettext() function is already present or preinstalled.]) + GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + MSGFMT_OPTS= + AC_MSG_CHECKING([if msgfmt accepts -c]) + GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) + AC_SUBST(MSGFMT_OPTS) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share and + dnl and CATOBJEXT=.gmo in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; + *-*-openbsd*) + CATOBJEXT=.mo + DATADIRNAME=share + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac]) + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + ]) + + if test "$gt_cv_have_gettext" = "yes" ; then + AC_DEFINE(ENABLE_NLS, 1, + [always defined to indicate that i18n is enabled]) + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is not GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.ac. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLLIBS) + AC_SUBST(PO_IN_DATADIR_TRUE) + AC_SUBST(PO_IN_DATADIR_FALSE) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +# AM_GLIB_GNU_GETTEXT +# ------------------- +# Do checks necessary for use of gettext. If a suitable implementation +# of gettext is found in either in libintl or in the C library, +# it will set INTLLIBS to the libraries needed for use of gettext +# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable +# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() +# on various variables needed by the Makefile.in.in installed by +# glib-gettextize. +dnl +glib_DEFUN([GLIB_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + + GLIB_LC_MESSAGES + GLIB_WITH_NLS + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) +# ------------------------------- +# Define VARIABLE to the location where catalog files will +# be installed by po/Makefile. +glib_DEFUN([GLIB_DEFINE_LOCALEDIR], +[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" +AC_DEFINE_UNQUOTED($1, "$localedir", + [Define the location where the catalogs will be installed]) +]) + +dnl +dnl Now the definitions that aclocal will find +dnl +ifdef(glib_configure_ac,[],[ +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) +])dnl + +# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) +# +# Create a temporary file with TEST-FILE as its contents and pass the +# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with +# 0 and perform ACTION-IF-FAIL for any other exit status. +AC_DEFUN([GLIB_RUN_PROG], +[cat >conftest.foo <<_ACEOF +$2 +_ACEOF +if AC_RUN_LOG([$1 conftest.foo]); then + m4_ifval([$3], [$3], [:]) +m4_ifvaln([$4], [else $4])dnl +echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD +sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD +fi]) + dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog new file mode 100755 index 0000000..4559704 --- /dev/null +++ b/build-aux/gitlog-to-changelog @@ -0,0 +1,191 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Convert git log output to ChangeLog format. + +my $VERSION = '2009-10-30 13:46'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2008-2011 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; +use POSIX qw(strftime); + +(my $ME = $0) =~ s|.*/||; + +# use File::Coda; # http://meyering.net/code/Coda/ +END { + defined fileno STDOUT or return; + close STDOUT and return; + warn "$ME: failed to close standard output: $!\n"; + $? ||= 1; +} + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try `$ME --help' for more information.\n"; + } + else + { + print $STREAM < ChangeLog + $ME -- -n 5 foo > last-5-commits-to-branch-foo + +EOF + } + exit $exit_code; +} + +# If the string $S is a well-behaved file name, simply return it. +# If it contains white space, quotes, etc., quote it, and return the new string. +sub shell_quote($) +{ + my ($s) = @_; + if ($s =~ m![^\w+/.,-]!) + { + # Convert each single quote to '\'' + $s =~ s/\'/\'\\\'\'/g; + # Then single quote the string. + $s = "'$s'"; + } + return $s; +} + +sub quoted_cmd(@) +{ + return join (' ', map {shell_quote $_} @_); +} + +{ + my $since_date = '1970-01-01 UTC'; + my $format_string = '%s%n%b%n'; + GetOptions + ( + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + 'since=s' => \$since_date, + 'format=s' => \$format_string, + ) or usage 1; + + my @cmd = (qw (git log --log-size), "--since=$since_date", + '--pretty=format:%ct %an <%ae>%n%n'.$format_string, @ARGV); + open PIPE, '-|', @cmd + or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n" + . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); + + my $prev_date_line = ''; + while (1) + { + defined (my $in = ) + or last; + $in =~ /^log size (\d+)$/ + or die "$ME:$.: Invalid line (expected log size):\n$in"; + my $log_nbytes = $1; + + my $log; + my $n_read = read PIPE, $log, $log_nbytes; + $n_read == $log_nbytes + or die "$ME:$.: unexpected EOF\n"; + + my @line = split "\n", $log; + my $author_line = shift @line; + defined $author_line + or die "$ME:$.: unexpected EOF\n"; + $author_line =~ /^(\d+) (.*>)$/ + or die "$ME:$.: Invalid line " + . "(expected date/author/email):\n$author_line\n"; + + my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1)); + # If this line would be the same as the previous date/name/email + # line, then arrange not to print it. + if ($date_line ne $prev_date_line) + { + $prev_date_line eq '' + or print "\n"; + print $date_line; + } + $prev_date_line = $date_line; + + # Omit "Signed-off-by..." lines. + @line = grep !/^Signed-off-by: .*>$/, @line; + + # If there were any lines + if (@line == 0) + { + warn "$ME: warning: empty commit message:\n $date_line\n"; + } + else + { + # Remove leading and trailing blank lines. + while ($line[0] =~ /^\s*$/) { shift @line; } + while ($line[$#line] =~ /^\s*$/) { pop @line; } + + # Prefix each non-empty line with a TAB. + @line = map { length $_ ? "\t$_" : '' } @line; + + print "\n", join ("\n", @line), "\n"; + } + + defined ($in = ) + or last; + $in ne "\n" + and die "$ME:$.: unexpected line:\n$in"; + } + + close PIPE + or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n"; + # FIXME-someday: include $PROCESS_STATUS in the diagnostic +} + +# Local Variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d %02H:%02M" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "'; # UTC" +# End: diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free new file mode 100755 index 0000000..b8f5a26 --- /dev/null +++ b/build-aux/useless-if-before-free @@ -0,0 +1,207 @@ +eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}' + & eval 'exec perl -wST "$0" $argv:q' + if 0; +# Detect instances of "if (p) free (p);". +# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. + +my $VERSION = '2011-04-20 13:43'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2008-2011 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; + +(my $ME = $0) =~ s|.*/||; + +# use File::Coda; # http://meyering.net/code/Coda/ +END { + defined fileno STDOUT or return; + close STDOUT and return; + warn "$ME: failed to close standard output: $!\n"; + $? ||= 1; +} + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try `$ME --help' for more information.\n"; + } + else + { + print $STREAM < sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + list => \$list, + 'name=s@' => \@name, + ) or usage 1; + + # Make sure we have the right number of non-option arguments. + # Always tell the user why we fail. + @ARGV < 1 + and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR; + + my $or = join '|', @name; + my $regexp = qr/(?:$or)/; + + # Set the input record separator. + # Note: this makes it impractical to print line numbers. + $/ = '"'; + + my $found_match = 0; + FILE: + foreach my $file (@ARGV) + { + open FH, '<', $file + or (warn "$ME: can't open `$file' for reading: $!\n"), + $err = EXIT_ERROR, next; + while (defined (my $line = )) + { + while ($line =~ + /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\) + # 1 2 3 + (?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;| + \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg) + { + my $all = $1; + my ($lhs, $rhs) = ($2, $3); + my ($free_opnd, $braced_free_opnd) = ($4, $5); + my $non_NULL; + if (!defined $rhs) { $non_NULL = $lhs } + elsif (is_NULL $rhs) { $non_NULL = $lhs } + elsif (is_NULL $lhs) { $non_NULL = $rhs } + else { next } + + # Compare the non-NULL part of the "if" expression and the + # free'd expression, without regard to white space. + $non_NULL =~ tr/ \t//d; + my $e2 = defined $free_opnd ? $free_opnd : $braced_free_opnd; + $e2 =~ tr/ \t//d; + if ($non_NULL eq $e2) + { + $found_match = 1; + $list + and (print "$file\0"), next FILE; + print "$file: $all\n"; + } + } + } + } + continue + { + close FH; + } + + $found_match && $err == EXIT_NO_MATCH + and $err = EXIT_MATCH; + + exit $err; +} + +my $foo = <<'EOF'; +# The above is to *find* them. +# This adjusts them, removing the unnecessary "if (p)" part. + +# FIXME: do something like this as an option (doesn't do braces): +free=xfree +git grep -l -z "$free *(" \ + | xargs -0 useless-if-before-free -l --name="$free" \ + | xargs -0 perl -0x3b -pi -e \ + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s' + +# Use the following to remove redundant uses of kfree inside braces. +# Note that -0777 puts perl in slurp-whole-file mode; +# but we have plenty of memory, these days... +free=kfree +git grep -l -z "$free *(" \ + | xargs -0 useless-if-before-free -l --name="$free" \ + | xargs -0 perl -0777 -pi -e \ + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms' + +Be careful that the result of the above transformation is valid. +If the matched string is followed by "else", then obviously, it won't be. + +When modifying files, refuse to process anything other than a regular file. +EOF + +## Local Variables: +## mode: perl +## indent-tabs-mode: nil +## eval: (add-hook 'write-file-hooks 'time-stamp) +## time-stamp-start: "my $VERSION = '" +## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-time-zone: "UTC" +## time-stamp-end: "'; # UTC" +## End: diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files new file mode 100755 index 0000000..405e458 --- /dev/null +++ b/build-aux/vc-list-files @@ -0,0 +1,113 @@ +#!/bin/sh +# List version-controlled file names. + +# Print a version string. +scriptversion=2011-05-16.22; # UTC + +# Copyright (C) 2006-2011 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# List the specified version-controlled files. +# With no argument, list them all. With a single DIRECTORY argument, +# list the version-controlled files in that directory. + +# If there's an argument, it must be a single, "."-relative directory name. +# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/ + +postprocess= +case $1 in + --help) cat <. +EOF + exit ;; + + --version) + year=`echo "$scriptversion" | sed 's/[^0-9].*//'` + cat < +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +EOF + exit ;; + + -C) + test "$2" = . || postprocess="| sed 's|^|$2/|'" + cd "$2" || exit 1 + shift; shift ;; +esac + +test $# = 0 && set . + +for dir +do + if test -d .git; then + test "x$dir" = x. \ + && dir= sed_esc= \ + || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; } + # Ignore git symlinks - either they point into the tree, in which case + # we don't need to visit the target twice, or they point somewhere + # else (often into a submodule), in which case the content does not + # belong to this package. + eval exec git ls-tree -r 'HEAD:"$dir"' \ + \| sed -n '"s/^100[^ ]*./$sed_esc/p"' $postprocess + elif test -d .hg; then + eval exec hg locate '"$dir/*"' $postprocess + elif test -d .bzr; then + test "$postprocess" = '' && postprocess="| sed 's|^\./||'" + eval exec bzr ls -R --versioned '"$dir"' $postprocess + elif test -d CVS; then + test "$postprocess" = '' && postprocess="| sed 's|^\./||'" + if test -x build-aux/cvsu; then + eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess + elif (cvsu --help) >/dev/null 2>&1; then + eval cvsu --find --types=AFGM '"$dir"' $postprocess + else + eval awk -F/ \''{ \ + if (!$1 && $3 !~ /^-/) { \ + f=FILENAME; \ + if (f ~ /CVS\/Entries$/) \ + f = substr(f, 1, length(f)-11); \ + print f $2; \ + }}'\'' \ + `find "$dir" -name Entries -print` /dev/null' $postprocess + fi + elif test -d .svn; then + eval exec svn list -R '"$dir"' $postprocess + else + echo "$0: Failed to determine type of version control used in `pwd`" 1>&2 + exit 1 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/cfg.mk b/cfg.mk new file mode 100644 index 0000000..ca46013 --- /dev/null +++ b/cfg.mk @@ -0,0 +1,134 @@ +# Customize Makefile.maint. -*- makefile -*- +# Copyright (C) 2008-2011 Red Hat, Inc. +# Copyright (C) 2003-2008 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Tests not to run as part of "make distcheck". +local-checks-to-skip = \ + changelog-check \ + check-AUTHORS \ + makefile-check \ + makefile_path_separator_check \ + patch-check \ + sc_GPL_version \ + sc_always_defined_macros \ + sc_cast_of_alloca_return_value \ + sc_cross_check_PATH_usage_in_tests \ + sc_dd_max_sym_length \ + sc_error_exit_success \ + sc_file_system \ + sc_immutable_NEWS \ + sc_makefile_path_separator_check \ + sc_obsolete_symbols \ + sc_prohibit_always_true_header_tests \ + sc_prohibit_S_IS_definition \ + sc_prohibit_atoi_atof \ + sc_prohibit_hash_without_use \ + sc_prohibit_jm_in_m4 \ + sc_prohibit_quote_without_use \ + sc_prohibit_quotearg_without_use \ + sc_prohibit_stat_st_blocks \ + sc_root_tests \ + sc_space_tab \ + sc_sun_os_names \ + sc_system_h_headers \ + sc_texinfo_acronym \ + sc_tight_scope \ + sc_two_space_separator_in_usage \ + sc_error_message_uppercase \ + sc_program_name \ + sc_require_test_exit_idiom \ + sc_makefile_check \ + sc_useless_cpp_parens + +# Files that should never cause syntax check failures. +VC_LIST_ALWAYS_EXCLUDE_REGEX = \ + (^HACKING|\.po|maint.mk)$$ + +# Functions like free() that are no-ops on NULL arguments. +useless_free_options = \ + --name=g_free \ + --name=xmlBufferFree \ + --name=xmlFree \ + --name=xmlFreeDoc \ + --name=xmlXPathFreeContext \ + --name=xmlFreeParserContext \ + --name=xmlXPathFreeObject + +# Ensure that no C source file, docs, or rng schema uses TABs for +# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude +# files in gnulib, since they're imported. +space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py)|(daemon|tools)/.*\.in) +sc_TAB_in_indentation: + @prohibit='^ * ' \ + in_vc_files='$(space_indent_files)$$' \ + halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \ + $(_sc_search_regexp) + +# G_GNUC_UNUSED should only be applied in implementations, not +# header declarations +sc_avoid_attribute_unused_in_header: + @prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \ + in_vc_files='\.h$$' \ + halt='use G_GNUC_UNUSED in .c rather than .h files' \ + $(_sc_search_regexp) + +# Enforce recommended preprocessor indentation style. +sc_preprocessor_indentation: + @if cppi --version >/dev/null 2>&1; then \ + $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \ + || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ + exit 1; }; \ + else \ + echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ + fi + +sc_copyright_format: + @require='Copyright .*Red 'Hat', Inc\.' \ + containing='Copyright .*Red 'Hat \ + halt='Red Hat copyright is missing Inc.' \ + $(_sc_search_regexp) + @prohibit='Copyright [^(].*Red 'Hat \ + halt='consistently use (C) in Red Hat copyright' \ + $(_sc_search_regexp) + @prohibit='\' \ + halt='spell Red Hat as two words' \ + $(_sc_search_regexp) + +# We don't use this feature of maint.mk. +prev_version_file = /dev/null + +# Give credit where due: +# Ensure that each commit author email address (possibly mapped via +# git log's .mailmap) appears in our AUTHORS file. +sc_check_author_list: + @fail=0; \ + for i in $$(git log --pretty=format:%aE%n|sort -u|grep -v '^$$'); do \ + sanitized=$$(echo "$$i"|LC_ALL=C sed 's/\([^a-zA-Z0-9_@-]\)/\\\1/g'); \ + grep -iq "<$$sanitized>" $(srcdir)/AUTHORS \ + || { printf '%s\n' "$$i" >&2; fail=1; }; \ + done; \ + test $$fail = 1 \ + && echo '$(ME): committer(s) not listed in AUTHORS' >&2; \ + test $$fail = 0 + + +exclude_file_name_regexp--sc_preprocessor_indentation = ^*/*.[ch] +exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch] +exclude_file_name_regexp--sc_require_config_h = ^plugin/ +exclude_file_name_regexp--sc_require_config_h_first = ^plugin/ + +exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^icons/ +exclude_file_name_regexp--sc_trailing_blank = ^icons/ diff --git a/config.h.in b/config.h.in index b35774b..b359d9a 100644 --- a/config.h.in +++ b/config.h.in @@ -1,7 +1,16 @@ /* config.h.in. Generated from configure.ac by autoheader. */ + +/* always defined to indicate that i18n is enabled */ +#undef ENABLE_NLS /* GETTEXT package name */ #undef GETTEXT_PACKAGE + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#undef HAVE_BIND_TEXTDOMAIN_CODESET + +/* Define to 1 if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -9,11 +18,23 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + /* Have gtk-vnc? */ #undef HAVE_GTK_VNC /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H + +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Have libvirt? */ +#undef HAVE_LIBVIRT + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/configure b/configure index 5c1b2cb..4fbf825 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for virt-viewer 0.4.2. +# Generated by GNU Autoconf 2.68 for virt-viewer 0.5.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -567,8 +567,8 @@ # Identity of this package. PACKAGE_NAME='virt-viewer' PACKAGE_TARNAME='virt-viewer' -PACKAGE_VERSION='0.4.2' -PACKAGE_STRING='virt-viewer 0.4.2' +PACKAGE_VERSION='0.5.0' +PACKAGE_STRING='virt-viewer 0.5.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -639,6 +639,8 @@ GTK_VNC_API_VERSION GTK_REQUIRED GTK_API_VERSION +HAVE_LIBVIRT_FALSE +HAVE_LIBVIRT_TRUE LIBVIRT_LIBS LIBVIRT_CFLAGS LIBXML2_LIBS @@ -648,13 +650,9 @@ PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG -DATADIRNAME ALL_LINGUAS INTLTOOL_PERL -GMSGFMT -MSGFMT MSGMERGE -XGETTEXT INTLTOOL_POLICY_RULE INTLTOOL_SERVICE_RULE INTLTOOL_THEME_RULE @@ -677,6 +675,21 @@ INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE +MKINSTALLDIRS +POSUB +POFILES +PO_IN_DATADIR_FALSE +PO_IN_DATADIR_TRUE +INTLLIBS +INSTOBJEXT +GMOFILES +DATADIRNAME +CATOBJEXT +CATALOGS +XGETTEXT +GMSGFMT +MSGFMT_OPTS +MSGFMT USE_NLS GETTEXT_PACKAGE WARN_CFLAGS @@ -804,6 +817,7 @@ enable_compile_warnings enable_iso_c enable_nls +with_libvirt with_gtk with_gtk_vnc with_spice_gtk @@ -1381,7 +1395,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures virt-viewer 0.4.2 to adapt to many kinds of systems. +\`configure' configures virt-viewer 0.5.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1451,7 +1465,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of virt-viewer 0.4.2:";; + short | recursive ) echo "Configuration of virt-viewer 0.5.0:";; esac cat <<\_ACEOF @@ -1482,6 +1496,7 @@ --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --without-libvirt Ignore presence of libvirt and disable it --with-gtk=2.0|3.0 which gtk+ version to compile against (default: 2.0) --without-gtk-vnc Ignore presence of gtk-vnc and disable it --without-spice-gtk Ignore presence of spice-gtk and disable it @@ -1599,7 +1614,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -virt-viewer configure 0.4.2 +virt-viewer configure 0.5.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1964,7 +1979,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by virt-viewer $as_me 0.4.2, which was +It was created by virt-viewer $as_me 0.5.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2782,7 +2797,7 @@ # Define the identity of the package. PACKAGE='virt-viewer' - VERSION='0.4.2' + VERSION='0.5.0' cat >>confdefs.h <<_ACEOF @@ -2915,7 +2930,7 @@ GTK2_REQUIRED="2.12.0" GTK3_REQUIRED="3.0" GTK_VNC_REQUIRED="0.4.3" -SPICE_GTK_REQUIRED="0.6" +SPICE_GTK_REQUIRED="0.9" ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -11490,6 +11505,15 @@ $as_echo "#define _GNU_SOURCE /**/" >>confdefs.h +# Autoconf 2.61a.99 and earlier don't support linking a file only +# in VPATH builds. But since GNUmakefile is for maintainer use +# only, it does not matter if we skip the link with older autoconf. +# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH +# builds, so use a shell variable to bypass this. +GNUmakefile=GNUmakefile +ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + # Check whether --enable-compile-warnings was given. @@ -11601,6 +11625,714 @@ + for ac_header in locale.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_H 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_locale_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if ${am_cv_val_LC_MESSAGES+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_val_LC_MESSAGES=yes +else + am_cv_val_LC_MESSAGES=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 +$as_echo "$am_cv_val_LC_MESSAGES" >&6; } + if test $am_cv_val_LC_MESSAGES = yes; then + +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h + + fi + fi + USE_NLS=yes + + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes; then : + gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 +$as_echo_n "checking for ngettext in libc... " >&6; } +if ${gt_cv_func_ngettext_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ +return !ngettext ("","", 1) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_ngettext_libc=yes +else + gt_cv_func_ngettext_libc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 +$as_echo "$gt_cv_func_ngettext_libc" >&6; } + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 +$as_echo_n "checking for dgettext in libc... " >&6; } +if ${gt_cv_func_dgettext_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ +return !dgettext ("","") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_dgettext_libc=yes +else + gt_cv_func_dgettext_libc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 +$as_echo "$gt_cv_func_dgettext_libc" >&6; } + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 +_ACEOF + +fi +done + + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 +$as_echo_n "checking for bindtextdomain in -lintl... " >&6; } +if ${ac_cv_lib_intl_bindtextdomain+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char bindtextdomain (); +int +main () +{ +return bindtextdomain (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_bindtextdomain=yes +else + ac_cv_lib_intl_bindtextdomain=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 +$as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } +if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_ngettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngettext (); +int +main () +{ +return ngettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes +else + ac_cv_lib_intl_ngettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 +$as_echo_n "checking for dgettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_dgettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dgettext (); +int +main () +{ +return dgettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dgettext=yes +else + ac_cv_lib_intl_dgettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 +$as_echo "$ac_cv_lib_intl_dgettext" >&6; } +if test "x$ac_cv_lib_intl_dgettext" = xyes; then : + gt_cv_func_dgettext_libintl=yes +fi + +fi + +fi + + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 +$as_echo_n "checking if -liconv is needed to use gettext... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_ngettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngettext (); +int +main () +{ +return ngettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes +else + ac_cv_lib_intl_ngettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 +$as_echo_n "checking for dcgettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_dcgettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dcgettext (); +int +main () +{ +return dcgettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dcgettext=yes +else + ac_cv_lib_intl_dcgettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 +$as_echo "$ac_cv_lib_intl_dcgettext" >&6; } +if test "x$ac_cv_lib_intl_dcgettext" = xyes; then : + gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv +else + : +fi + +else + : +fi + + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 +_ACEOF + +fi +done + + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + for ac_func in dcgettext +do : + ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" +if test "x$ac_cv_func_dcgettext" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DCGETTEXT 1 +_ACEOF + +fi +done + + MSGFMT_OPTS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 +$as_echo_n "checking if msgfmt accepts -c... " >&6; } + cat >conftest.foo <<_ACEOF + +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" + +_ACEOF +if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 + ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +echo "$as_me: failed input was:" >&5 +sed 's/^/| /' conftest.foo >&5 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GMSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XGETTEXT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + case $host in + *-*-solaris*) + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + CATOBJEXT=.mo + DATADIRNAME=lib +fi + + ;; + *-*-openbsd*) + CATOBJEXT=.mo + DATADIRNAME=share + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + +fi + + + + if test "$gt_cv_have_gettext" = "yes" ; then + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 +$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + ac_config_commands="$ac_config_commands default-1" + + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + + + + + + + + + + + + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 +$as_echo_n "checking for catalogs to be installed... " >&6; } + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 +$as_echo "$LINGUAS" >&6; } + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. @@ -12462,6 +13194,15 @@ fi + +# Check whether --with-libvirt was given. +if test "${with_libvirt+set}" = set; then : + withval=$with_libvirt; +fi + + +if test "x$with_libvirt" != "xno"; then : + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVIRT" >&5 $as_echo_n "checking for LIBVIRT... " >&6; } @@ -12470,12 +13211,12 @@ pkg_cv_LIBVIRT_CFLAGS="$LIBVIRT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= \$LIBVIRT_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libvirt >= $LIBVIRT_REQUIRED") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libvirt") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVIRT_CFLAGS=`$PKG_CONFIG --cflags "libvirt >= $LIBVIRT_REQUIRED" 2>/dev/null` + pkg_cv_LIBVIRT_CFLAGS=`$PKG_CONFIG --cflags "libvirt" 2>/dev/null` else pkg_failed=yes fi @@ -12486,12 +13227,12 @@ pkg_cv_LIBVIRT_LIBS="$LIBVIRT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= \$LIBVIRT_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libvirt >= $LIBVIRT_REQUIRED") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libvirt") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBVIRT_LIBS=`$PKG_CONFIG --libs "libvirt >= $LIBVIRT_REQUIRED" 2>/dev/null` + pkg_cv_LIBVIRT_LIBS=`$PKG_CONFIG --libs "libvirt" 2>/dev/null` else pkg_failed=yes fi @@ -12511,47 +13252,48 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libvirt >= $LIBVIRT_REQUIRED" 2>&1` + LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libvirt" 2>&1` else - LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --print-errors "libvirt >= $LIBVIRT_REQUIRED" 2>&1` + LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --print-errors "libvirt" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBVIRT_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libvirt >= $LIBVIRT_REQUIRED) were not met: - -$LIBVIRT_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables LIBVIRT_CFLAGS -and LIBVIRT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 - + have_libvirt=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables LIBVIRT_CFLAGS -and LIBVIRT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } - + have_libvirt=no else LIBVIRT_CFLAGS=$pkg_cv_LIBVIRT_CFLAGS LIBVIRT_LIBS=$pkg_cv_LIBVIRT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - -fi + have_libvirt=yes +fi +else + have_libvirt=no +fi + +if test "x$have_libvirt" = "xyes"; then : + +$as_echo "#define HAVE_LIBVIRT 1" >>confdefs.h + +else + if test "x$with_libvirt" = "xyes"; then : + as_fn_error $? "libvirt requested but not found" "$LINENO" 5 + +fi + +fi + if test "x$have_libvirt" = "xyes"; then + HAVE_LIBVIRT_TRUE= + HAVE_LIBVIRT_FALSE='#' +else + HAVE_LIBVIRT_TRUE='#' + HAVE_LIBVIRT_FALSE= +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which gtk+ version to compile against" >&5 $as_echo_n "checking which gtk+ version to compile against... " >&6; } @@ -12812,12 +13554,15 @@ pkg_cv_SPICE_GTK_CFLAGS="$SPICE_GTK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED + spice-controller\""; } >&5 + ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED + spice-controller") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SPICE_GTK_CFLAGS=`$PKG_CONFIG --cflags "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>/dev/null` + pkg_cv_SPICE_GTK_CFLAGS=`$PKG_CONFIG --cflags "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED + spice-controller" 2>/dev/null` else pkg_failed=yes fi @@ -12828,12 +13573,15 @@ pkg_cv_SPICE_GTK_LIBS="$SPICE_GTK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED\""; } >&5 - ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED + spice-controller\""; } >&5 + ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED + spice-controller") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SPICE_GTK_LIBS=`$PKG_CONFIG --libs "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>/dev/null` + pkg_cv_SPICE_GTK_LIBS=`$PKG_CONFIG --libs "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED + spice-controller" 2>/dev/null` else pkg_failed=yes fi @@ -12853,9 +13601,11 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>&1` + SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED + spice-controller" 2>&1` else - SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>&1` + SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED + spice-controller" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SPICE_GTK_PKG_ERRORS" >&5 @@ -13293,7 +14043,7 @@ fi -ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile po/Makefile.in plugin/Makefile virt-viewer.spec mingw32-virt-viewer.spec" +ac_config_files="$ac_config_files Makefile data/Makefile data/virt-viewer.nsis icons/Makefile icons/16x16/Makefile icons/22x22/Makefile icons/24x24/Makefile icons/32x32/Makefile icons/48x48/Makefile icons/256x256/Makefile man/Makefile mingw32-virt-viewer.spec plugin/Makefile po/Makefile.in src/Makefile virt-viewer.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -13424,6 +14174,10 @@ ac_config_commands="$ac_config_commands po/stamp-it" +if test -z "${HAVE_LIBVIRT_TRUE}" && test -z "${HAVE_LIBVIRT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBVIRT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_GTK_2_TRUE}" && test -z "${HAVE_GTK_2_FALSE}"; then as_fn_error $? "conditional \"HAVE_GTK_2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13853,7 +14607,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by virt-viewer $as_me 0.4.2, which was +This file was extended by virt-viewer $as_me 0.5.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13880,6 +14634,7 @@ # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" +config_links="$ac_config_links" config_commands="$ac_config_commands" _ACEOF @@ -13910,6 +14665,9 @@ Configuration headers: $config_headers +Configuration links: +$config_links + Configuration commands: $config_commands @@ -13919,7 +14677,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -virt-viewer config.status 0.4.2 +virt-viewer config.status 0.5.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -14316,6 +15074,8 @@ +GNUmakefile=$GNUmakefile + _ACEOF @@ -14328,13 +15088,24 @@ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; + "data/virt-viewer.nsis") CONFIG_FILES="$CONFIG_FILES data/virt-viewer.nsis" ;; + "icons/Makefile") CONFIG_FILES="$CONFIG_FILES icons/Makefile" ;; + "icons/16x16/Makefile") CONFIG_FILES="$CONFIG_FILES icons/16x16/Makefile" ;; + "icons/22x22/Makefile") CONFIG_FILES="$CONFIG_FILES icons/22x22/Makefile" ;; + "icons/24x24/Makefile") CONFIG_FILES="$CONFIG_FILES icons/24x24/Makefile" ;; + "icons/32x32/Makefile") CONFIG_FILES="$CONFIG_FILES icons/32x32/Makefile" ;; + "icons/48x48/Makefile") CONFIG_FILES="$CONFIG_FILES icons/48x48/Makefile" ;; + "icons/256x256/Makefile") CONFIG_FILES="$CONFIG_FILES icons/256x256/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "mingw32-virt-viewer.spec") CONFIG_FILES="$CONFIG_FILES mingw32-virt-viewer.spec" ;; + "plugin/Makefile") CONFIG_FILES="$CONFIG_FILES plugin/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; - "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; - "plugin/Makefile") CONFIG_FILES="$CONFIG_FILES plugin/Makefile" ;; "virt-viewer.spec") CONFIG_FILES="$CONFIG_FILES virt-viewer.spec" ;; - "mingw32-virt-viewer.spec") CONFIG_FILES="$CONFIG_FILES mingw32-virt-viewer.spec" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -14349,6 +15120,7 @@ if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi @@ -14646,7 +15418,7 @@ fi # test -n "$CONFIG_HEADERS" -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" shift for ac_tag do @@ -14923,7 +15695,38 @@ } s/.*/./; q'`/stamp-h$_am_stamp_count ;; - + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; @@ -15657,6 +16460,9 @@ chmod +x "$ofile" ;; + "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac ;; "po/stamp-it":C) if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 diff --git a/configure.ac b/configure.ac index e47d60a..56281df 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -AC_INIT(virt-viewer, 0.4.2) +AC_INIT(virt-viewer, 0.5.0) AC_CONFIG_SRCDIR(src/virt-viewer-main.c) AM_CONFIG_HEADER(config.h) dnl Make automake keep quiet about wildcards & other GNUmake-isms @@ -16,7 +16,7 @@ GTK2_REQUIRED="2.12.0" GTK3_REQUIRED="3.0" GTK_VNC_REQUIRED="0.4.3" -SPICE_GTK_REQUIRED="0.6" +SPICE_GTK_REQUIRED="0.9" AC_PROG_CC AM_PROG_CC_C_O @@ -26,18 +26,46 @@ AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions]) +# Autoconf 2.61a.99 and earlier don't support linking a file only +# in VPATH builds. But since GNUmakefile is for maintainer use +# only, it does not matter if we skip the link with older autoconf. +# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH +# builds, so use a shell variable to bypass this. +GNUmakefile=GNUmakefile +m4_if(m4_version_compare([2.61a.100], + m4_defn([m4_PACKAGE_VERSION])), [1], [], + [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], + [GNUmakefile=$GNUmakefile])]) + VIRT_VIEWER_COMPILE_WARNINGS(maximum) GETTEXT_PACKAGE=virt-viewer AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) - +AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [GETTEXT package name]) + +AM_GLIB_GNU_GETTEXT IT_PROG_INTLTOOL([0.35.0]) PKG_CHECK_MODULES(GMODULE2, gmodule-export-2.0 >= $GMODULE2_REQUIRED) PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED) -PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED) + +AC_ARG_WITH([libvirt], + AS_HELP_STRING([--without-libvirt], [Ignore presence of libvirt and disable it])) + +AS_IF([test "x$with_libvirt" != "xno"], + [PKG_CHECK_MODULES(LIBVIRT, + [libvirt], + [have_libvirt=yes], [have_libvirt=no])], + [have_libvirt=no]) + +AS_IF([test "x$have_libvirt" = "xyes"], + [AC_DEFINE([HAVE_LIBVIRT], 1, [Have libvirt?])], + [AS_IF([test "x$with_libvirt" = "xyes"], + [AC_MSG_ERROR([libvirt requested but not found]) + ]) +]) +AM_CONDITIONAL([HAVE_LIBVIRT], [test "x$have_libvirt" = "xyes"]) AC_MSG_CHECKING([which gtk+ version to compile against]) AC_ARG_WITH([gtk], @@ -92,7 +120,8 @@ AS_IF([test "x$with_spice_gtk" != "xno"], [PKG_CHECK_MODULES(SPICE_GTK, - spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED, + [spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED + spice-controller], [have_spice_gtk=yes], [have_spice_gtk=no])], [have_spice_gtk=no]) @@ -131,13 +160,24 @@ fi AM_CONDITIONAL(ENABLE_PLUGIN, [test "x$enable_plugin" = "xyes"]) -AC_OUTPUT(Makefile - src/Makefile - man/Makefile - po/Makefile.in - plugin/Makefile - virt-viewer.spec - mingw32-virt-viewer.spec) +AC_OUTPUT([ + Makefile + data/Makefile + data/virt-viewer.nsis + icons/Makefile + icons/16x16/Makefile + icons/22x22/Makefile + icons/24x24/Makefile + icons/32x32/Makefile + icons/48x48/Makefile + icons/256x256/Makefile + man/Makefile + mingw32-virt-viewer.spec + plugin/Makefile + po/Makefile.in + src/Makefile + virt-viewer.spec +]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..50c9571 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,6 @@ +NULL= + +EXTRA_DIST = \ + spice-xpi-client-remote-viewer \ + virt-viewer.nsis.in \ + $(NULL) diff --git a/data/Makefile.in b/data/Makefile.in new file mode 100644 index 0000000..df37e2a --- /dev/null +++ b/data/Makefile.in @@ -0,0 +1,416 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = data +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/virt-viewer.nsis.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = virt-viewer.nsis +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +NULL = +EXTRA_DIST = \ + spice-xpi-client-remote-viewer \ + virt-viewer.nsis.in \ + $(NULL) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu data/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +virt-viewer.nsis: $(top_builddir)/config.status $(srcdir)/virt-viewer.nsis.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/data/spice-xpi-client-remote-viewer b/data/spice-xpi-client-remote-viewer new file mode 100644 index 0000000..3109c66 --- /dev/null +++ b/data/spice-xpi-client-remote-viewer @@ -0,0 +1,6 @@ +#!/bin/sh + +logger -t spice "starting remote-viewer --spice-controller $@..." +env | logger -t spice +exec remote-viewer --spice-controller "$@" 2>&1 | logger -t spice +logger -t spice "remote-viewer execution failed" diff --git a/data/virt-viewer.nsis.in b/data/virt-viewer.nsis.in new file mode 100644 index 0000000..a3cfa74 --- /dev/null +++ b/data/virt-viewer.nsis.in @@ -0,0 +1,267 @@ +#!Nsis Installer Command Script +# @configure_input@ +# To build an installer from the script you would normally do: +# +# makensis virt-viewer.nsis +# +# which will generate the output file 'virt-viewer-@VERSION@.exe' which is a Windows +# installer containing your program. + +Name "virt-viewer" +OutFile "virt-viewer-@VERSION@.exe" +InstallDir "c:\virt-viewer" +InstallDirRegKey HKLM SOFTWARE\virt-viewer "Install_Dir" + +ShowInstDetails hide +ShowUninstDetails hide + +SetCompressor bzip2 + +XPStyle on + +# Page components +Page directory +Page instfiles + +ComponentText "Select which optional components you want to install." + +DirText "Please select the installation folder." + +Section "virt-viewer" + SectionIn RO + + SetOutPath "$INSTDIR\bin" + File "@prefix@/bin/gst-discoverer-0.10.exe" + File "@prefix@/bin/gst-feedback.exe" + File "@prefix@/bin/gst-inspect-0.10.exe" + File "@prefix@/bin/gst-inspect.exe" + File "@prefix@/bin/gst-launch-0.10.exe" + File "@prefix@/bin/gst-launch.exe" + File "@prefix@/bin/gst-typefind-0.10.exe" + File "@prefix@/bin/gst-typefind.exe" + File "@prefix@/bin/gst-xmlinspect-0.10.exe" + File "@prefix@/bin/gst-xmlinspect.exe" + File "@prefix@/bin/gst-xmllaunch-0.10.exe" + File "@prefix@/bin/gst-xmllaunch.exe" + File "@prefix@/bin/libatk-1.0-0.dll" + File "@prefix@/bin/libcairo-2.dll" + File "@prefix@/bin/libcelt051-0.dll" + File "@prefix@/bin/libcrypto-10.dll" + File "@prefix@/bin/libffi-6.dll" + File "@prefix@/bin/libfontconfig-1.dll" + File "@prefix@/bin/libfreetype-6.dll" + File "@prefix@/bin/libgdk-win32-2.0-0.dll" + File "@prefix@/bin/libgdk-win32-2.0-0.dll" + File "@prefix@/bin/libgdk_pixbuf-2.0-0.dll" + File "@prefix@/bin/libgdk_pixbuf-2.0-0.dll" + File "@prefix@/bin/libgio-2.0-0.dll" + File "@prefix@/bin/libglib-2.0-0.dll" + File "@prefix@/bin/libgmodule-2.0-0.dll" + File "@prefix@/bin/libgobject-2.0-0.dll" + File "@prefix@/bin/libgstapp-0.10-0.dll" + File "@prefix@/bin/libgstaudio-0.10-0.dll" + File "@prefix@/bin/libgstbase-0.10-0.dll" + File "@prefix@/bin/libgstcontroller-0.10-0.dll" + File "@prefix@/bin/libgstfft-0.10-0.dll" + File "@prefix@/bin/libgstinterfaces-0.10-0.dll" + File "@prefix@/bin/libgstpbutils-0.10-0.dll" + File "@prefix@/bin/libgstreamer-0.10-0.dll" + File "@prefix@/bin/libgstvideo-0.10-0.dll" + File "@prefix@/bin/libgthread-2.0-0.dll" + File "@prefix@/bin/libgtk-win32-2.0-0.dll" + File "@prefix@/bin/iconv.dll" + File "@prefix@/bin/libintl-8.dll" + File "@prefix@/bin/libjpeg-62.dll" + File "@prefix@/bin/liborc-0.4-0.dll" + File "@prefix@/bin/liborc-test-0.4-0.dll" + File "@prefix@/bin/libpango-1.0-0.dll" + File "@prefix@/bin/libpangocairo-1.0-0.dll" + File "@prefix@/bin/libpangoft2-1.0-0.dll" + File "@prefix@/bin/libpangowin32-1.0-0.dll" + File "@prefix@/bin/libpixman-1-0.dll" + File "@prefix@/bin/libpng15-15.dll" + File "@prefix@/bin/libspice-client-glib-2.0-1.dll" + File "@prefix@/bin/libspice-client-gtk-2.0-1.dll" + File "@prefix@/bin/libspice-controller-0.dll" + File "@prefix@/bin/libssl-10.dll" + File "@prefix@/bin/libxml2-2.dll" + File "@prefix@/bin/libp11-kit-0.dll" + File "@prefix@/bin/libssh2-1.dll" + File "@prefix@/bin/libcurl-4.dll" + File "@prefix@/bin/libportablexdr-0.dll" + File "@prefix@/bin/libidn-11.dll" + File "@prefix@/bin/libssp-0.dll" + File "@prefix@/bin/libvirt-0.dll" + File "@prefix@/bin/libvirt-qemu-0.dll" + File "@prefix@/bin/virsh.exe" + File "@prefix@/bin/virt-pki-validate" + File "@prefix@/bin/virt-xml-validate" + + #gtkvnc + File "@prefix@/bin/libgnutls-26.dll" + File "@prefix@/bin/libgpg-error-0.dll" + File "@prefix@/bin/libgcrypt-11.dll" + File "@prefix@/bin/libgvnc-1.0-0.dll" + File "@prefix@/bin/libgtk-vnc-1.0-0.dll" + + File "@prefix@/bin/pango-querymodules.exe" + File "${DESTDIR}@prefix@/bin/remote-viewer.exe" + File "${DESTDIR}@prefix@/bin/virt-viewer.exe" + File "@prefix@/bin/zlib1.dll" + + SetOutPath "$INSTDIR\etc" + File /r "@prefix@/etc/fonts" + File /r "@prefix@/etc/gtk-2.0" + File /r "@prefix@/etc/libvirt" + CreateDirectory "$INSTDIR\etc\pango" + + CreateDirectory "$INSTDIR\etc\gtk-2.0" + + SetOutPath "$INSTDIR\lib" + File /r "@prefix@/lib/gdk-pixbuf-2.0" + File /r "@prefix@/lib/gtk-2.0" + File /r "@prefix@/lib/pango" + + SetOutPath "$INSTDIR\lib\gstreamer-0.10" + File "@prefix@/lib/gstreamer-0.10/libgstapp.dll" + File "@prefix@/lib/gstreamer-0.10/libgstaudioconvert.dll" + File "@prefix@/lib/gstreamer-0.10/libgstaudiofx.dll" + File "@prefix@/lib/gstreamer-0.10/libgstaudiorate.dll" + File "@prefix@/lib/gstreamer-0.10/libgstaudioresample.dll" + File "@prefix@/lib/gstreamer-0.10/libgstaudiotestsrc.dll" + File "@prefix@/lib/gstreamer-0.10/libgstautodetect.dll" + File "@prefix@/lib/gstreamer-0.10/libgstcoreelements.dll" + File "@prefix@/lib/gstreamer-0.10/libgstdirectsoundsink.dll" + File "@prefix@/lib/gstreamer-0.10/libgstdirectsoundsrc.dll" + + SetOutPath "$INSTDIR\share" + File /r "@prefix@/share/libvirt" + + # fixme for all languages + SetOutPath "$INSTDIR\share\locale\fr" + File "@prefix@/share/locale/fr/LC_MESSAGES/libvirt.*" + File "${DESTDIR}@prefix@/share/locale/fr/LC_MESSAGES/virt-viewer.*" + + SetOutPath "$INSTDIR\share\virt-viewer\ui" + File "${DESTDIR}@prefix@/share/virt-viewer/ui/*.xml" + + SetOutPath "$INSTDIR\share\themes\MS-Windows\gtk-2.0" + File "@prefix@/share/themes/MS-Windows/gtk-2.0/gtkrc" + + ReadEnvStr $0 COMSPEC + SetOutPath "$INSTDIR" + nsExec::ExecToLog '$0 /C bin\pango-querymodules.exe > etc\pango\pango.modules' + nsExec::ExecToLog 'echo gtk-theme-name = "MS-Windows" > etc\gtk-2.0\gtkrc' + +SectionEnd + +Section "Start Menu Shortcuts" + CreateDirectory "$SMPROGRAMS\virt-viewer" + CreateShortCut "$SMPROGRAMS\virt-viewer\Uninstall virt-viewer.lnk" "$INSTDIR\Uninstall virt-viewer.exe" "" "$INSTDIR\Uninstall virt-viewer.exe" 0 +# CreateShortCut "$SMPROGRAMS\virt-viewer\virt-viewer.exe.lnk" "$INSTDIR\bin\virt-viewer.exe" "" "$INSTDIR\bin\virt-viewer.exe" 0 +SectionEnd + +Section "Desktop Icons" +# CreateShortCut "$DESKTOP\virt-viewer.exe.lnk" "$INSTDIR\bin\virt-viewer.exe" "" "$INSTDIR\bin\virt-viewer.exe" 0 +SectionEnd + +Section "Uninstall" +# Delete /rebootok "$DESKTOP\virt-viewer.exe.lnk" +# Delete /rebootok "$SMPROGRAMS\virt-viewer\virt-viewer.exe.lnk" + Delete /rebootok "$SMPROGRAMS\virt-viewer\Uninstall virt-viewer.lnk" + RMDir "$SMPROGRAMS\virt-viewer" + + RMDir /r "$INSTDIR\lib\pango" + + RMDir /r "$INSTDIR\lib\gtk-2.0" + + Delete /rebootok "$INSTDIR\share\virt-viewer\ui\*.xml" + Delete /rebootok "$INSTDIR\share\themes\MS-Windows\gtk-2.0\gtkrc" + + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstdirectsoundsrc.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstdirectsoundsink.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstcoreelements.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstautodetect.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiotestsrc.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudioresample.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiorate.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiofx.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudioconvert.dll" + Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstapp.dll" + RMDir "$INSTDIR\lib\gstreamer-0.10" + + RMDir /r "$INSTDIR\lib\gdk-pixbuf-2.0" + + RMDir /r "$INSTDIR\etc\pango" + + RMDir /r "$INSTDIR\etc\gtk-2.0" + + RMDir /r "$INSTDIR\etc\fonts" + + Delete /rebootok "$INSTDIR\bin\remote-viewer.exe" + Delete /rebootok "$INSTDIR\bin\pango-querymodules.exe" + Delete /rebootok "$INSTDIR\bin\libpangoft2-1.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgdk-win32-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\gst-xmllaunch.exe" + Delete /rebootok "$INSTDIR\bin\gst-xmllaunch-0.10.exe" + Delete /rebootok "$INSTDIR\bin\gst-xmlinspect.exe" + Delete /rebootok "$INSTDIR\bin\gst-xmlinspect-0.10.exe" + Delete /rebootok "$INSTDIR\bin\gst-typefind.exe" + Delete /rebootok "$INSTDIR\bin\gst-typefind-0.10.exe" + Delete /rebootok "$INSTDIR\bin\gst-launch.exe" + Delete /rebootok "$INSTDIR\bin\gst-launch-0.10.exe" + Delete /rebootok "$INSTDIR\bin\gst-inspect.exe" + Delete /rebootok "$INSTDIR\bin\gst-inspect-0.10.exe" + Delete /rebootok "$INSTDIR\bin\gst-feedback.exe" + Delete /rebootok "$INSTDIR\bin\gst-discoverer-0.10.exe" + RMDir "$INSTDIR\bin" + + Delete /rebootok "$INSTDIR\bin\libffi-6.dll" + Delete /rebootok "$INSTDIR\bin\zlib1.dll" + Delete /rebootok "$INSTDIR\bin\libp11-kit-0.dll" + Delete /rebootok "$INSTDIR\bin\libxml2-2.dll" + Delete /rebootok "$INSTDIR\bin\libssl-10.dll" + Delete /rebootok "$INSTDIR\bin\libspice-client-gtk-2.0-1.dll" + Delete /rebootok "$INSTDIR\bin\libspice-client-glib-2.0-1.dll" + Delete /rebootok "$INSTDIR\bin\libspice-controller-0.dll" + Delete /rebootok "$INSTDIR\bin\libpng15-15.dll" + Delete /rebootok "$INSTDIR\bin\libpixman-1-0.dll" + Delete /rebootok "$INSTDIR\bin\libpangowin32-1.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libpangocairo-1.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libpango-1.0-0.dll" + Delete /rebootok "$INSTDIR\bin\liborc-test-0.4-0.dll" + Delete /rebootok "$INSTDIR\bin\liborc-0.4-0.dll" + Delete /rebootok "$INSTDIR\bin\libjpeg-62.dll" + Delete /rebootok "$INSTDIR\bin\libintl-8.dll" + Delete /rebootok "$INSTDIR\bin\iconv.dll" + Delete /rebootok "$INSTDIR\bin\libgtk-win32-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgthread-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstvideo-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstreamer-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstpbutils-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstinterfaces-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstfft-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstcontroller-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstbase-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstaudio-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgstapp-0.10-0.dll" + Delete /rebootok "$INSTDIR\bin\libgobject-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgmodule-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libglib-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgio-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libgdk-win32-2.0-0.dll" + Delete /rebootok "$INSTDIR\bin\libfreetype-6.dll" + Delete /rebootok "$INSTDIR\bin\libfontconfig-1.dll" + Delete /rebootok "$INSTDIR\bin\libcrypto-10.dll" + Delete /rebootok "$INSTDIR\bin\libcelt051-0.dll" + Delete /rebootok "$INSTDIR\bin\libcairo-2.dll" + Delete /rebootok "$INSTDIR\bin\libatk-1.0-0.dll" + RMDir "$INSTDIR\bin" + RMDir "$INSTDIR" +SectionEnd + +Section -post + WriteUninstaller "$INSTDIR\Uninstall virt-viewer.exe" +SectionEnd diff --git a/icons/16x16/Makefile.am b/icons/16x16/Makefile.am new file mode 100644 index 0000000..355b4d1 --- /dev/null +++ b/icons/16x16/Makefile.am @@ -0,0 +1,5 @@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png + +EXTRA_DIST = $(icon_DATA) diff --git a/icons/16x16/Makefile.in b/icons/16x16/Makefile.in new file mode 100644 index 0000000..d0bd58c --- /dev/null +++ b/icons/16x16/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = icons/16x16 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(icondir)" +DATA = $(icon_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png +EXTRA_DIST = $(icon_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/16x16/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu icons/16x16/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(icondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-iconDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-iconDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-iconDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/icons/16x16/virt-viewer.png b/icons/16x16/virt-viewer.png new file mode 100644 index 0000000..226881f Binary files /dev/null and b/icons/16x16/virt-viewer.png differ diff --git a/icons/22x22/Makefile.am b/icons/22x22/Makefile.am new file mode 100644 index 0000000..355b4d1 --- /dev/null +++ b/icons/22x22/Makefile.am @@ -0,0 +1,5 @@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png + +EXTRA_DIST = $(icon_DATA) diff --git a/icons/22x22/Makefile.in b/icons/22x22/Makefile.in new file mode 100644 index 0000000..6b6c2b2 --- /dev/null +++ b/icons/22x22/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = icons/22x22 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(icondir)" +DATA = $(icon_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png +EXTRA_DIST = $(icon_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/22x22/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu icons/22x22/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(icondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-iconDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-iconDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-iconDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/icons/22x22/virt-viewer.png b/icons/22x22/virt-viewer.png new file mode 100644 index 0000000..f244adb Binary files /dev/null and b/icons/22x22/virt-viewer.png differ diff --git a/icons/24x24/Makefile.am b/icons/24x24/Makefile.am new file mode 100644 index 0000000..355b4d1 --- /dev/null +++ b/icons/24x24/Makefile.am @@ -0,0 +1,5 @@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png + +EXTRA_DIST = $(icon_DATA) diff --git a/icons/24x24/Makefile.in b/icons/24x24/Makefile.in new file mode 100644 index 0000000..5f8eeec --- /dev/null +++ b/icons/24x24/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = icons/24x24 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(icondir)" +DATA = $(icon_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png +EXTRA_DIST = $(icon_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/24x24/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu icons/24x24/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(icondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-iconDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-iconDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-iconDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/icons/24x24/virt-viewer.png b/icons/24x24/virt-viewer.png new file mode 100644 index 0000000..f3d2e65 Binary files /dev/null and b/icons/24x24/virt-viewer.png differ diff --git a/icons/256x256/Makefile.am b/icons/256x256/Makefile.am new file mode 100644 index 0000000..355b4d1 --- /dev/null +++ b/icons/256x256/Makefile.am @@ -0,0 +1,5 @@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png + +EXTRA_DIST = $(icon_DATA) diff --git a/icons/256x256/Makefile.in b/icons/256x256/Makefile.in new file mode 100644 index 0000000..943d9c8 --- /dev/null +++ b/icons/256x256/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = icons/256x256 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(icondir)" +DATA = $(icon_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png +EXTRA_DIST = $(icon_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/256x256/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu icons/256x256/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(icondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-iconDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-iconDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-iconDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/icons/256x256/virt-viewer.png b/icons/256x256/virt-viewer.png new file mode 100644 index 0000000..d861b86 Binary files /dev/null and b/icons/256x256/virt-viewer.png differ diff --git a/icons/32x32/Makefile.am b/icons/32x32/Makefile.am new file mode 100644 index 0000000..355b4d1 --- /dev/null +++ b/icons/32x32/Makefile.am @@ -0,0 +1,5 @@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png + +EXTRA_DIST = $(icon_DATA) diff --git a/icons/32x32/Makefile.in b/icons/32x32/Makefile.in new file mode 100644 index 0000000..945d528 --- /dev/null +++ b/icons/32x32/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = icons/32x32 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(icondir)" +DATA = $(icon_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png +EXTRA_DIST = $(icon_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/32x32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu icons/32x32/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(icondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-iconDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-iconDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-iconDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/icons/32x32/virt-viewer.png b/icons/32x32/virt-viewer.png new file mode 100644 index 0000000..b95ea5d Binary files /dev/null and b/icons/32x32/virt-viewer.png differ diff --git a/icons/48x48/Makefile.am b/icons/48x48/Makefile.am new file mode 100644 index 0000000..355b4d1 --- /dev/null +++ b/icons/48x48/Makefile.am @@ -0,0 +1,5 @@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png + +EXTRA_DIST = $(icon_DATA) diff --git a/icons/48x48/Makefile.in b/icons/48x48/Makefile.in new file mode 100644 index 0000000..3daef9c --- /dev/null +++ b/icons/48x48/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = icons/48x48 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(icondir)" +DATA = $(icon_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +size = $(notdir $(PWD)) +icondir = $(datadir)/icons/hicolor/$(size)/apps/ +icon_DATA = $(PACKAGE).png +EXTRA_DIST = $(icon_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/48x48/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu icons/48x48/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(icondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-iconDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-iconDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-iconDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/icons/48x48/virt-viewer.png b/icons/48x48/virt-viewer.png new file mode 100644 index 0000000..28396d1 Binary files /dev/null and b/icons/48x48/virt-viewer.png differ diff --git a/icons/Makefile.am b/icons/Makefile.am new file mode 100644 index 0000000..189ea2b --- /dev/null +++ b/icons/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = 16x16 22x22 24x24 32x32 48x48 256x256 diff --git a/icons/Makefile.in b/icons/Makefile.in new file mode 100644 index 0000000..549b51c --- /dev/null +++ b/icons/Makefile.in @@ -0,0 +1,610 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = icons +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@ +FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ +GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK_API_VERSION = @GTK_API_VERSION@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_REQUIRED = @GTK_REQUIRED@ +GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@ +GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@ +GTK_VNC_LIBS = @GTK_VNC_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ +LIBVIRT_LIBS = @LIBVIRT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ +MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@ +SPICE_GTK_LIBS = @SPICE_GTK_LIBS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = 16x16 22x22 24x24 32x32 48x48 256x256 +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu icons/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/maint.mk b/maint.mk new file mode 100644 index 0000000..9e59a02 --- /dev/null +++ b/maint.mk @@ -0,0 +1,1512 @@ +# -*-Makefile-*- +# This Makefile fragment tries to be general-purpose enough to be +# used by many projects via the gnulib maintainer-makefile module. + +## Copyright (C) 2001-2011 Free Software Foundation, Inc. +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program 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 General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . + +# This is reported not to work with make-3.79.1 +# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +ME := maint.mk + +# Diagnostic for continued use of deprecated variable. +# Remove in 2013 +ifneq ($(build_aux),) + $(error "$(ME): \ +set $$(_build-aux) relative to $$(srcdir) instead of $$(build_aux)") +endif + +# Do not save the original name or timestamp in the .tar.gz file. +# Use --rsyncable if available. +gzip_rsyncable := \ + $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \ + && printf %s --rsyncable) +GZIP_ENV = '--no-name --best $(gzip_rsyncable)' + +GIT = git +VC = $(GIT) + +VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir) + +# You can override this variable in cfg.mk to set your own regexp +# matching files to ignore. +VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$ + +# This is to preprocess robustly the output of $(VC_LIST), so that even +# when $(srcdir) is a pathological name like "....", the leading sed command +# removes only the intended prefix. +_dot_escaped_srcdir = $(subst .,\.,$(srcdir)) + +# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only +# when $(srcdir) is not ".". +ifeq ($(srcdir),.) +_prepend_srcdir_prefix = +else +_prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|' +endif + +# In order to be able to consistently filter "."-relative names, +# (i.e., with no $(srcdir) prefix), this definition is careful to +# remove any $(srcdir) prefix, and to restore what it removes. +_sc_excl = \ + $(if $(exclude_file_name_regexp--$@),$(exclude_file_name_regexp--$@),^$$) +VC_LIST_EXCEPT = \ + $(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \ + | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \ + else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \ + | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \ + $(_prepend_srcdir_prefix) + +ifeq ($(origin prev_version_file), undefined) + prev_version_file = $(srcdir)/.prev-version +endif + +PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null) +VERSION_REGEXP = $(subst .,\.,$(VERSION)) +PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION)) + +ifeq ($(VC),$(GIT)) +this-vc-tag = v$(VERSION) +this-vc-tag-regexp = v$(VERSION_REGEXP) +else +tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]') +tag-this-version = $(subst .,_,$(VERSION)) +this-vc-tag = $(tag-package)-$(tag-this-version) +this-vc-tag-regexp = $(this-vc-tag) +endif +my_distdir = $(PACKAGE)-$(VERSION) + +# Old releases are stored here. +release_archive_dir ?= ../release + +# Override gnu_rel_host and url_dir_list in cfg.mk if these are not right. +# Use alpha.gnu.org for alpha and beta releases. +# Use ftp.gnu.org for stable releases. +gnu_ftp_host-alpha = alpha.gnu.org +gnu_ftp_host-beta = alpha.gnu.org +gnu_ftp_host-stable = ftp.gnu.org +gnu_rel_host ?= $(gnu_ftp_host-$(RELEASE_TYPE)) + +ifeq ($(gnu_rel_host),ftp.gnu.org) +url_dir_list ?= http://ftpmirror.gnu.org/$(PACKAGE) +else +url_dir_list ?= ftp://$(gnu_rel_host)/gnu/$(PACKAGE) +endif + +# Override this in cfg.mk if you are using a different format in your +# NEWS file. +today = $(shell date +%Y-%m-%d) + +# Select which lines of NEWS are searched for $(news-check-regexp). +# This is a sed line number spec. The default says that we search +# lines 1..10 of NEWS for $(news-check-regexp). +# If you want to search only line 3 or only lines 20-22, use "3" or "20,22". +news-check-lines-spec ?= 1,10 +news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)' + +# Prevent programs like 'sort' from considering distinct strings to be equal. +# Doing it here saves us from having to set LC_ALL elsewhere in this file. +export LC_ALL = C + +## --------------- ## +## Sanity checks. ## +## --------------- ## + +_cfg_mk := $(shell test -f $(srcdir)/cfg.mk && echo '$(srcdir)/cfg.mk') + +# Collect the names of rules starting with `sc_'. +syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \ + $(srcdir)/$(ME) $(_cfg_mk))) +.PHONY: $(syntax-check-rules) + +ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0) +local-checks-available += $(syntax-check-rules) +else +local-checks-available += no-vc-detected +no-vc-detected: + @echo "No version control files detected; skipping syntax check" +endif +.PHONY: $(local-checks-available) + +# Arrange to print the name of each syntax-checking rule just before running it. +$(syntax-check-rules): %: %.m +sc_m_rules_ = $(patsubst %, %.m, $(syntax-check-rules)) +.PHONY: $(sc_m_rules_) +$(sc_m_rules_): + @echo $(patsubst sc_%.m, %, $@) + @date +%s.%N > .sc-start-$(basename $@) + +# Compute and print the elapsed time for each syntax-check rule. +sc_z_rules_ = $(patsubst %, %.z, $(syntax-check-rules)) +.PHONY: $(sc_z_rules_) +$(sc_z_rules_): %.z: % + @end=$$(date +%s.%N); \ + start=$$(cat .sc-start-$*); \ + rm -f .sc-start-$*; \ + awk -v s=$$start -v e=$$end \ + 'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null + +# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper +# that computes and prints elapsed time. +local-check := \ + $(patsubst sc_%, sc_%.z, \ + $(filter-out $(local-checks-to-skip), $(local-checks-available))) + +syntax-check: $(local-check) + +# _sc_search_regexp +# +# This macro searches for a given construct in the selected files and +# then takes some action. +# +# Parameters (shell variables): +# +# prohibit | require +# +# Regular expression (ERE) denoting either a forbidden construct +# or a required construct. Those arguments are exclusive. +# +# in_vc_files | in_files +# +# grep-E-style regexp denoting the files to check. If no files +# are specified the default are all the files that are under +# version control. +# +# containing | non_containing +# +# Select the files (non) containing strings matching this regexp. +# If both arguments are specified then CONTAINING takes +# precedence. +# +# with_grep_options +# +# Extra options for grep. +# +# ignore_case +# +# Ignore case. +# +# halt +# +# Message to display before to halting execution. +# +# Finally, you may exempt files based on an ERE matching file names. +# For example, to exempt from the sc_space_tab check all files with the +# .diff suffix, set this Make variable: +# +# exclude_file_name_regexp--sc_space_tab = \.diff$ +# +# Note that while this functionality is mostly inherited via VC_LIST_EXCEPT, +# when filtering by name via in_files, we explicitly filter out matching +# names here as well. + +# By default, _sc_search_regexp does not ignore case. +export ignore_case = +_ignore_case = $$(test -n "$$ignore_case" && printf %s -i || :) + +define _sc_say_and_exit + dummy=; : so we do not need a semicolon before each use; \ + { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; }; +endef + +# _sc_search_regexp used to be named _prohibit_regexp. However, +# upgrading to the new definition and leaving the old name undefined +# would usually convert each custom rule using $(_prohibit_regexp) +# (usually defined in cfg.mk) into a no-op. This definition ensures +# that people know right away if they're still using the old name. +# FIXME: remove in 2012. +_prohibit_regexp = \ + $(error '*** you need to s/_prohibit_regexp/_sc_search_regexp/, and adapt') + +define _sc_search_regexp + dummy=; : so we do not need a semicolon before each use; \ + \ + : Check arguments; \ + test -n "$$prohibit" && test -n "$$require" \ + && { msg='Cannot specify both prohibit and require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -z "$$require" \ + && { msg='Should specify either prohibit or require' \ + $(_sc_say_and_exit) } || :; \ + test -n "$$in_vc_files" && test -n "$$in_files" \ + && { msg='Cannot specify both in_vc_files and in_files' \ + $(_sc_say_and_exit) } || :; \ + test "x$$halt" != x \ + || { msg='halt not defined' $(_sc_say_and_exit) }; \ + \ + : Filter by file name; \ + if test -n "$$in_files"; then \ + files=$$(find $(srcdir) | grep -E "$$in_files" \ + | grep -Ev '$(exclude_file_name_regexp--$@)'); \ + else \ + files=$$($(VC_LIST_EXCEPT)); \ + if test -n "$$in_vc_files"; then \ + files=$$(echo "$$files" | grep -E "$$in_vc_files"); \ + fi; \ + fi; \ + \ + : Filter by content; \ + test -n "$$files" && test -n "$$containing" \ + && { files=$$(grep -l "$$containing" $$files); } || :; \ + test -n "$$files" && test -n "$$non_containing" \ + && { files=$$(grep -vl "$$non_containing" $$files); } || :; \ + \ + : Check for the construct; \ + if test -n "$$files"; then \ + if test -n "$$prohibit"; then \ + grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \ + && { msg="$$halt" $(_sc_say_and_exit) } || :; \ + else \ + grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \ + | grep . \ + && { msg="$$halt" $(_sc_say_and_exit) } || :; \ + fi \ + else :; \ + fi || :; +endef + +sc_avoid_if_before_free: + @$(srcdir)/$(_build-aux)/useless-if-before-free \ + $(useless_free_options) \ + $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \ + { echo '$(ME): found useless "if" before "free" above' 1>&2; \ + exit 1; } || : + +sc_cast_of_argument_to_free: + @prohibit='\&2; exit 1; } || : + +# Pass EXIT_*, not number, to usage, exit, and error (when exiting) +# Convert all uses automatically, via these two commands: +# git grep -l '\&2; \ + exit 1; } || : + +# Error messages should not start with a capital letter +sc_error_message_uppercase: + @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '"[A-Z]' \ + | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \ + { echo '$(ME): found capitalized error message' 1>&2; \ + exit 1; } || : + +# Error messages should not end with a period +sc_error_message_period: + @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '[^."]\."' && \ + { echo '$(ME): found error message ending in period' 1>&2; \ + exit 1; } || : + +sc_file_system: + @prohibit=file''system \ + ignore_case=1 \ + halt='found use of "file''system"; spell it "file system"' \ + $(_sc_search_regexp) + +# Don't use cpp tests of this symbol. All code assumes config.h is included. +sc_prohibit_have_config_h: + @prohibit='^# *if.*HAVE''_CONFIG_H' \ + halt='found use of HAVE''_CONFIG_H; remove' \ + $(_sc_search_regexp) + +# Nearly all .c files must include . However, we also permit this +# via inclusion of a package-specific header, if cfg.mk specified one. +# config_h_header must be suitable for grep -E. +config_h_header ?= +sc_require_config_h: + @require='^# *include $(config_h_header)' \ + in_vc_files='\.c$$' \ + halt='the above files do not include ' \ + $(_sc_search_regexp) + +# You must include before including any other header file. +# This can possibly be via a package-specific header, if given by cfg.mk. +sc_require_config_h_first: + @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \ + fail=0; \ + for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \ + grep '^# *include\>' $$i | sed 1q \ + | grep -E '^# *include $(config_h_header)' > /dev/null \ + || { echo $$i; fail=1; }; \ + done; \ + test $$fail = 1 && \ + { echo '$(ME): the above files include some other header' \ + 'before ' 1>&2; exit 1; } || :; \ + else :; \ + fi + +sc_prohibit_HAVE_MBRTOWC: + @prohibit='\bHAVE_MBRTOWC\b' \ + halt="do not use $$prohibit; it is always defined" \ + $(_sc_search_regexp) + +# To use this "command" macro, you must first define two shell variables: +# h: the header name, with no enclosing <> or "" +# re: a regular expression that matches IFF something provided by $h is used. +define _sc_header_without_use + dummy=; : so we do not need a semicolon before each use; \ + h_esc=`echo '[<"]'"$$h"'[">]'|sed 's/\./\\\\./g'`; \ + if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \ + files=$$(grep -l '^# *include '"$$h_esc" \ + $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \ + grep -LE "$$re" $$files | grep . && \ + { echo "$(ME): the above files include $$h but don't use it" \ + 1>&2; exit 1; } || :; \ + else :; \ + fi +endef + +# Prohibit the inclusion of assert.h without an actual use of assert. +sc_prohibit_assert_without_use: + @h='assert.h' re='\new(file => "/dev/stdin")->as_string'|sed 's/\?://g' +# Note this was produced by the above: +# _xa1 = \ +#x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup) +# But we can do better, in at least two ways: +# 1) take advantage of two "dup"-suffixed strings: +# x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup) +# 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable +# "char|[cmz]" +# x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup) +_xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup) +_xa2 = X([CZ]|N?M)ALLOC +sc_prohibit_xalloc_without_use: + @h='xalloc.h' \ + re='\<($(_xa1)|$(_xa2)) *\('\ + $(_sc_header_without_use) + +# Extract function names: +# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/hash.h +_hash_re = \ +clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning +_hash_fn = \<($(_hash_re)) *\( +_hash_struct = (struct )?\<[Hh]ash_(table|tuning)\> +sc_prohibit_hash_without_use: + @h='hash.h' \ + re='$(_hash_fn)|$(_hash_struct)'\ + $(_sc_header_without_use) + +sc_prohibit_cloexec_without_use: + @h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \ + $(_sc_header_without_use) + +sc_prohibit_posixver_without_use: + @h='posixver.h' re='\' \ + halt='do not use HAVE''_FCNTL_H or O'_NDELAY \ + $(_sc_search_regexp) + +# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ + +# Each nonempty ChangeLog line must start with a year number, or a TAB. +sc_changelog: + @prohibit='^[^12 ]' \ + in_vc_files='^ChangeLog$$' \ + halt='found unexpected prefix in a ChangeLog' \ + $(_sc_search_regexp) + +# Ensure that each .c file containing a "main" function also +# calls set_program_name. +sc_program_name: + @require='set_program_name *\(m?argv\[0\]\);' \ + in_vc_files='\.c$$' \ + containing='\
/dev/null \ + && : || { die=1; echo $$i; } \ + done; \ + test $$die = 1 && \ + { echo 1>&2 '$(ME): the final line in each of the above is not:'; \ + echo 1>&2 'Exit something'; \ + exit 1; } || :; \ + fi + +sc_trailing_blank: + @prohibit='[ ]$$' \ + halt='found trailing blank(s)' \ + $(_sc_search_regexp) + +# Match lines like the following, but where there is only one space +# between the options and the description: +# -D, --all-repeated[=delimit-method] print all duplicate lines\n +longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)? +sc_two_space_separator_in_usage: + @prohibit='^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \ + halt='help2man requires at least two spaces between an option and its description'\ + $(_sc_search_regexp) + +# A regexp matching function names like "error" that may be used +# to emit translatable messages. +_gl_translatable_diag_func_re ?= error + +# Look for diagnostics that aren't marked for translation. +# This won't find any for which error's format string is on a separate line. +sc_unmarked_diagnostics: + @grep -nE \ + '\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \ + $$($(VC_LIST_EXCEPT)) \ + | grep -Ev '(_|ngettext ?)\(' && \ + { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ + exit 1; } || : + +# Avoid useless parentheses like those in this example: +# #if defined (SYMBOL) || defined (SYM2) +sc_useless_cpp_parens: + @prohibit='^# *if .*defined *\(' \ + halt='found useless parentheses in cpp directive' \ + $(_sc_search_regexp) + +# List headers for which HAVE_HEADER_H is always true, assuming you are +# using the appropriate gnulib module. CAUTION: for each "unnecessary" +# #if HAVE_HEADER_H that you remove, be sure that your project explicitly +# requires the gnulib module that guarantees the usability of that header. +gl_assured_headers_ = \ + cd $(gnulib_dir)/lib && echo *.in.h|sed 's/\.in\.h//g' + +# Convert the list of names to upper case, and replace each space with "|". +az_ = abcdefghijklmnopqrstuvwxyz +AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ +gl_header_upper_case_or_ = \ + $$($(gl_assured_headers_) \ + | tr $(az_)/.- $(AZ_)___ \ + | tr -s ' ' '|' \ + ) +sc_prohibit_always_true_header_tests: + @or=$(gl_header_upper_case_or_); \ + re="HAVE_($$or)_H"; \ + prohibit='\<'"$$re"'\>' \ + halt=$$(printf '%s\n' \ + 'do not test the above HAVE_
_H symbol(s);' \ + ' with the corresponding gnulib module, they are always true') \ + $(_sc_search_regexp) + +# ================================================================== +gl_other_headers_ ?= \ + intprops.h \ + openat.h \ + stat-macros.h + +# Perl -lne code to extract "significant" cpp-defined symbols from a +# gnulib header file, eliminating a few common false-positives. +# The exempted names below are defined only conditionally in gnulib, +# and hence sometimes must/may be defined in application code. +gl_extract_significant_defines_ = \ + /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\ + && $$2 !~ /(?:rpl_|_used_without_)/\ + && $$1 !~ /^(?:NSIG|ENODATA)$$/\ + && $$1 !~ /^(?:SA_RESETHAND|SA_RESTART)$$/\ + and print $$1 + +# Create a list of regular expressions matching the names +# of macros that are guaranteed to be defined by parts of gnulib. +define def_sym_regex + gen_h=$(gl_generated_headers_); \ + (cd $(gnulib_dir)/lib; \ + for f in *.in.h $(gl_other_headers_); do \ + test -f $$f \ + && perl -lne '$(gl_extract_significant_defines_)' $$f; \ + done; \ + ) | sort -u \ + | sed 's/^/^ *# *(define|undef) */;s/$$/\\>/' +endef + +# Don't define macros that we already get from gnulib header files. +sc_prohibit_always-defined_macros: + @if test -d $(gnulib_dir); then \ + case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \ + echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \ + esac; \ + $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT)) \ + && { echo '$(ME): define the above via some gnulib .h file' \ + 1>&2; exit 1; } || :; \ + fi +# ================================================================== + +# Prohibit checked in backup files. +sc_prohibit_backup_files: + @$(VC_LIST) | grep '~$$' && \ + { echo '$(ME): found version controlled backup file' 1>&2; \ + exit 1; } || : + +# Require the latest GPL. +sc_GPL_version: + @prohibit='either ''version [^3]' \ + halt='GPL vN, N!=3' \ + $(_sc_search_regexp) + +# Require the latest GFDL. Two regexp, since some .texi files end up +# line wrapping between 'Free Documentation License,' and 'Version'. +_GFDL_regexp = (Free ''Documentation.*Version 1\.[^3]|Version 1\.[^3] or any) +sc_GFDL_version: + @prohibit='$(_GFDL_regexp)' \ + halt='GFDL vN, N!=3' \ + $(_sc_search_regexp) + +# Don't use Texinfo's @acronym{}. +# http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html +texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$ +sc_texinfo_acronym: + @prohibit='@acronym\{' \ + in_vc_files='$(texinfo_suffix_re_)' \ + halt='found use of Texinfo @acronym{}' \ + $(_sc_search_regexp) + +cvs_keywords = \ + Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State + +sc_prohibit_cvs_keyword: + @prohibit='\$$($(cvs_keywords))\$$' \ + halt='do not use CVS keyword expansion' \ + $(_sc_search_regexp) + +# This Perl code is slightly obfuscated. Not only is each "$" doubled +# because it's in a Makefile, but the $$c's are comments; we cannot +# use "#" due to the way the script ends up concatenated onto one line. +# It would be much more concise, and would produce better output (including +# counts) if written as: +# perl -ln -0777 -e '/\n(\n+)$/ and print "$ARGV: ".length $1' ... +# but that would be far less efficient, reading the entire contents +# of each file, rather than just the last two bytes of each. +# In addition, while the code below detects both blank lines and a missing +# newline at EOF, the above detects only the former. +# +# This is a perl script that is expected to be the single-quoted argument +# to a command-line "-le". The remaining arguments are file names. +# Print the name of each file that ends in exactly one newline byte. +# I.e., warn if there are blank lines (2 or more newlines), or if the +# last byte is not a newline. However, currently we don't complain +# about any file that contains exactly one byte. +# Exit nonzero if at least one such file is found, otherwise, exit 0. +# Warn about, but otherwise ignore open failure. Ignore seek/read failure. +# +# Use this if you want to remove trailing empty lines from selected files: +# perl -pi -0777 -e 's/\n\n+$/\n/' files... +# +require_exactly_one_NL_at_EOF_ = \ + foreach my $$f (@ARGV) \ + { \ + open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \ + my $$p = sysseek (F, -2, 2); \ + my $$c = "seek failure probably means file has < 2 bytes; ignore"; \ + my $$last_two_bytes; \ + defined $$p and $$p = sysread F, $$last_two_bytes, 2; \ + close F; \ + $$c = "ignore read failure"; \ + $$p && ($$last_two_bytes eq "\n\n" \ + || substr ($$last_two_bytes,1) ne "\n") \ + and (print $$f), $$fail=1; \ + } \ + END { exit defined $$fail } +sc_prohibit_empty_lines_at_EOF: + @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \ + || { echo '$(ME): empty line(s) or no newline at EOF' \ + 1>&2; exit 1; } || : + +# Make sure we don't use st_blocks. Use ST_NBLOCKS instead. +# This is a bit of a kludge, since it prevents use of the string +# even in comments, but for now it does the job with no false positives. +sc_prohibit_stat_st_blocks: + @prohibit='[.>]st_blocks' \ + halt='do not use st_blocks; use ST_NBLOCKS' \ + $(_sc_search_regexp) + +# Make sure we don't define any S_IS* macros in src/*.c files. +# They're already defined via gnulib's sys/stat.h replacement. +sc_prohibit_S_IS_definition: + @prohibit='^ *# *define *S_IS' \ + halt='do not define S_IS* macros; include ' \ + $(_sc_search_regexp) + +# Perl block to convert a match to FILE_NAME:LINENO:TEST, +# that is shared by two definitions below. +perl_filename_lineno_text_ = \ + -e ' {' \ + -e ' $$n = ($$` =~ tr/\n/\n/ + 1);' \ + -e ' ($$v = $$&) =~ s/\n/\\n/g;' \ + -e ' print "$$ARGV:$$n:$$v\n";' \ + -e ' }' + +prohibit_doubled_word_RE_ ?= \ + /\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims +prohibit_doubled_word_ = \ + -e 'while ($(prohibit_doubled_word_RE_))' \ + $(perl_filename_lineno_text_) + +# Define this to a regular expression that matches +# any filename:dd:match lines you want to ignore. +# The default is to ignore no matches. +ignore_doubled_word_match_RE_ ?= ^$$ + +sc_prohibit_doubled_word: + @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \ + | grep -vE '$(ignore_doubled_word_match_RE_)' \ + | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || : + +# A regular expression matching undesirable combinations of words like +# "can not"; this matches them even when the two words appear on different +# lines, but not when there is an intervening delimiter like "#" or "*". +prohibit_undesirable_word_seq_RE_ ?= \ + /\bcan\s+not\b/gims +prohibit_undesirable_word_seq_ = \ + -e 'while ($(prohibit_undesirable_word_seq_RE_))' \ + $(perl_filename_lineno_text_) +# Define this to a regular expression that matches +# any filename:dd:match lines you want to ignore. +# The default is to ignore no matches. +ignore_undesirable_word_sequence_RE_ ?= ^$$ + +sc_prohibit_undesirable_word_seq: + @perl -n -0777 $(prohibit_undesirable_word_seq_) \ + $$($(VC_LIST_EXCEPT)) \ + | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \ + && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || : + +_ptm1 = use "test C1 && test C2", not "test C1 -''a C2" +_ptm2 = use "test C1 || test C2", not "test C1 -''o C2" +# Using test's -a and -o operators is not portable. +# We prefer test over [, since the latter is spelled [[ in configure.ac. +sc_prohibit_test_minus_ao: + @prohibit='(\ /dev/null \ + || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \ + done; \ + test $$fail = 1 && \ + { echo 1>&2 '$(ME): the above do not link with any ICONV library'; \ + exit 1; } || :; \ + fi + +# Warn about "c0nst struct Foo const foo[]", +# but not about "char const *const foo" or "#define const const". +sc_redundant_const: + @prohibit='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \ + halt='redundant "const" in declarations' \ + $(_sc_search_regexp) + +sc_const_long_option: + @grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \ + | grep -Ev 'const struct option|struct option const' && { \ + echo 1>&2 '$(ME): add "const" to the above declarations'; \ + exit 1; } || : + +NEWS_hash = \ + $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \ + $(srcdir)/NEWS \ + | perl -0777 -pe \ + 's/^Copyright.+?Free\sSoftware\sFoundation,\sInc\.\n//ms' \ + | md5sum - \ + | sed 's/ .*//') + +# Ensure that we don't accidentally insert an entry into an old NEWS block. +sc_immutable_NEWS: + @if test -f $(srcdir)/NEWS; then \ + test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \ + { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \ + fi + +# Update the hash stored above. Do this after each release and +# for any corrections to old entries. +update-NEWS-hash: NEWS + perl -pi -e 's/^(old_NEWS_hash[ \t]+:?=[ \t]+).*/$${1}'"$(NEWS_hash)/" \ + $(srcdir)/cfg.mk + +# Ensure that we use only the standard $(VAR) notation, +# not @...@ in Makefile.am, now that we can rely on automake +# to emit a definition for each substituted variable. +# However, there is still one case in which @VAR@ use is not just +# legitimate, but actually required: when augmenting an automake-defined +# variable with a prefix. For example, gettext uses this: +# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@ +# otherwise, makeinfo would put German or French (current locale) +# navigation hints in the otherwise-English documentation. +# +# Allow the package to add exceptions via a hook in cfg.mk; +# for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by +# setting this to ' && !/PRAGMA_SYSTEM_HEADER/'. +_makefile_at_at_check_exceptions ?= +sc_makefile_at_at_check: + @perl -ne '/\@[A-Z_0-9]+\@/' \ + -e ' && !/([A-Z_0-9]+)\s+=.*\@\1\@$$/' \ + -e ''$(_makefile_at_at_check_exceptions) \ + -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \ + $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \ + && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || : + +news-check: NEWS + if sed -n $(news-check-lines-spec)p $(srcdir)/NEWS \ + | grep -E $(news-check-regexp) >/dev/null; then \ + :; \ + else \ + echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \ + exit 1; \ + fi + +sc_makefile_TAB_only_indentation: + @prohibit='^ [ ]{8}' \ + in_vc_files='akefile|\.mk$$' \ + halt='found TAB-8-space indentation' \ + $(_sc_search_regexp) + +sc_m4_quote_check: + @prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \ + in_vc_files='(^configure\.ac|\.m4)$$' \ + halt='quote the first arg to AC_DEF*' \ + $(_sc_search_regexp) + +fix_po_file_diag = \ +'you have changed the set of files with translatable diagnostics;\n\ +apply the above patch\n' + +# Verify that all source files using _() are listed in po/POTFILES.in. +po_file ?= $(srcdir)/po/POTFILES.in +generated_files ?= $(srcdir)/lib/*.[ch] +sc_po_check: + @if test -f $(po_file); then \ + grep -E -v '^(#|$$)' $(po_file) \ + | grep -v '^src/false\.c$$' | sort > $@-1; \ + files=; \ + for file in $$($(VC_LIST_EXCEPT)) $(generated_files); do \ + test -r $$file || continue; \ + case $$file in \ + *.m4|*.mk) continue ;; \ + *.?|*.??) ;; \ + *.xml) ;; \ + *) continue;; \ + esac; \ + case $$file in \ + *.[ch]) \ + base=`expr " $$file" : ' \(.*\)\..'`; \ + { test -f $$base.l || test -f $$base.y; } && continue;; \ + esac; \ + files="$$files $$file"; \ + done; \ + grep -E -l '(\b(N?_|gettext *)\([^)"]*("|$$))|()' $$files \ + | sed 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \ + diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ + || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \ + rm -f $@-1 $@-2; \ + fi + +# Sometimes it is useful to change the PATH environment variable +# in Makefiles. When doing so, it's better not to use the Unix-centric +# path separator of `:', but rather the automake-provided `$(PATH_SEPARATOR)'. +msg = '$(ME): Do not use `:'\'' above; use $$(PATH_SEPARATOR) instead' +sc_makefile_path_separator_check: + @prohibit='PATH[=].*:' \ + in_vc_files='akefile|\.mk$$' \ + halt=$(msg) \ + $(_sc_search_regexp) + +# Check that `make alpha' will not fail at the end of the process, +# i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release) +# and is read-only. +writable-files: + if test -d $(release_archive_dir); then \ + for file in $(DIST_ARCHIVES); do \ + for p in ./ $(release_archive_dir)/; do \ + test -e $$p$$file || continue; \ + test -w $$p$$file \ + || { echo ERROR: $$p$$file is not writable; fail=1; }; \ + done; \ + done; \ + test "$$fail" && exit 1 || : ; \ + else :; \ + fi + +v_etc_file = $(gnulib_dir)/lib/version-etc.c +sample-test = tests/sample-test +texi = doc/$(PACKAGE).texi +# Make sure that the copyright date in $(v_etc_file) is up to date. +# Do the same for the $(sample-test) and the main doc/.texi file. +sc_copyright_check: + @require='enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' \ + in_files=$(v_etc_file) \ + halt='out of date copyright in $(v_etc_file); update it' \ + $(_sc_search_regexp) + @require='# Copyright \(C\) '$$(date +%Y)' Free' \ + in_vc_files=$(sample-test) \ + halt='out of date copyright in $(sample-test); update it' \ + $(_sc_search_regexp) + @require='Copyright @copyright\{\} .*'$$(date +%Y)' Free' \ + in_vc_files=$(texi) \ + halt='out of date copyright in $(texi); update it' \ + $(_sc_search_regexp) + +# If tests/help-version exists and seems to be new enough, assume that its +# use of init.sh and path_prepend_ is correct, and ensure that every other +# use of init.sh is identical. +# This is useful because help-version cross-checks prog --version +# with $(VERSION), which verifies that its path_prepend_ invocation +# sets PATH correctly. This is an inexpensive way to ensure that +# the other init.sh-using tests also get it right. +_hv_file ?= $(srcdir)/tests/help-version +_hv_regex_weak ?= ^ *\. .*/init\.sh" +# Fix syntax-highlighters " +_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh" +sc_cross_check_PATH_usage_in_tests: + @if test -f $(_hv_file); then \ + grep -l 'VERSION mismatch' $(_hv_file) >/dev/null \ + || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2; \ + exit 0; }; \ + grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \ + || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \ + exit 1; }; \ + good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file)); \ + grep -LFx "$$good" \ + $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT))) \ + | grep . && \ + { echo "$(ME): the above files use path_prepend_ inconsistently" \ + 1>&2; exit 1; } || :; \ + fi + +# #if HAVE_... will evaluate to false for any non numeric string. +# That would be flagged by using -Wundef, however gnulib currently +# tests many undefined macros, and so we can't enable that option. +# So at least preclude common boolean strings as macro values. +sc_Wundef_boolean: + @prohibit='^#define.*(yes|no|true|false)$$' \ + in_files='$(CONFIG_INCLUDE)' \ + halt='Use 0 or 1 for macro values' \ + $(_sc_search_regexp) + +# Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might +# not be constant, or might overflow a stack. In general, use PATH_MAX as +# a limit, not an array or alloca size. +sc_prohibit_path_max_allocation: + @prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX' \ + halt='Avoid stack allocations of size PATH_MAX' \ + $(_sc_search_regexp) + +sc_vulnerable_makefile_CVE-2009-4029: + @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \ + in_files=$$(find $(srcdir) -name Makefile.in) \ + halt=$$(printf '%s\n' \ + 'the above files are vulnerable; beware of running' \ + ' "make dist*" rules, and upgrade to fixed automake' \ + ' see http://bugzilla.redhat.com/542609 for details') \ + $(_sc_search_regexp) + +vc-diff-check: + (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || : + if test -s vc-diffs; then \ + cat vc-diffs; \ + echo "Some files are locally modified:" 1>&2; \ + exit 1; \ + else \ + rm vc-diffs; \ + fi + +rel-files = $(DIST_ARCHIVES) + +gnulib_dir ?= $(srcdir)/gnulib +gnulib-version = $$(cd $(gnulib_dir) && git describe) +bootstrap-tools ?= autoconf,automake,gnulib + +# If it's not already specified, derive the GPG key ID from +# the signed tag we've just applied to mark this release. +gpg_key_ID ?= \ + $$(git cat-file tag v$(VERSION) > .ann-sig \ + && gpgv .ann-sig - < /dev/null 2>&1 \ + | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig) + +translation_project_ ?= coordinator@translationproject.org + +# Make info-gnu the default only for a stable release. +ifeq ($(RELEASE_TYPE),stable) + announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT) + announcement_mail_headers_ ?= \ + To: info-gnu@gnu.org \ + Cc: $(announcement_Cc_) \ + Mail-Followup-To: $(PACKAGE_BUGREPORT) +else + announcement_Cc_ ?= $(translation_project_) + announcement_mail_headers_ ?= \ + To: $(PACKAGE_BUGREPORT) \ + Cc: $(announcement_Cc_) +endif + +announcement: NEWS ChangeLog $(rel-files) + @$(srcdir)/$(_build-aux)/announce-gen \ + --mail-headers='$(announcement_mail_headers_)' \ + --release-type=$(RELEASE_TYPE) \ + --package=$(PACKAGE) \ + --prev=$(PREV_VERSION) \ + --curr=$(VERSION) \ + --gpg-key-id=$(gpg_key_ID) \ + --news=$(srcdir)/NEWS \ + --bootstrap-tools=$(bootstrap-tools) \ + --gnulib-version=$(gnulib-version) \ + --no-print-checksums \ + $(addprefix --url-dir=, $(url_dir_list)) + +## ---------------- ## +## Updating files. ## +## ---------------- ## + +ftp-gnu = ftp://ftp.gnu.org/gnu +www-gnu = http://www.gnu.org + +upload_dest_dir_ ?= $(PACKAGE) +emit_upload_commands: + @echo ===================================== + @echo ===================================== + @echo "$(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\" + @echo " --to $(gnu_rel_host):$(upload_dest_dir_) \\" + @echo " $(rel-files)" + @echo '# send the ~/announce-$(my_distdir) e-mail' + @echo ===================================== + @echo ===================================== + +define emit-commit-log + printf '%s\n' 'maint: post-release administrivia' '' \ + '* NEWS: Add header line for next release.' \ + '* .prev-version: Record previous version.' \ + '* cfg.mk (old_NEWS_hash): Auto-update.' +endef + +.PHONY: no-submodule-changes +no-submodule-changes: + if test -d $(srcdir)/.git; then \ + diff=$$(cd $(srcdir) && git submodule -q foreach \ + git diff-index --name-only HEAD) \ + || exit 1; \ + case $$diff in '') ;; \ + *) echo '$(ME): submodule files are locally modified:'; \ + echo "$$diff"; exit 1;; esac; \ + else \ + : ; \ + fi + +submodule-checks ?= no-submodule-changes public-submodule-commit + +# Ensure that each sub-module commit we're using is public. +# Without this, it is too easy to tag and release code that +# cannot be built from a fresh clone. +.PHONY: public-submodule-commit +public-submodule-commit: + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + cd $(srcdir) && \ + git submodule --quiet foreach test '$$(git rev-parse $$sha1)' \ + = '$$(git merge-base origin $$sha1)' \ + || { echo '$(ME): found non-public submodule commit' >&2; \ + exit 1; }; \ + else \ + : ; \ + fi +# This rule has a high enough utility/cost ratio that it should be a +# dependent of "check" by default. However, some of us do occasionally +# commit a temporary change that deliberately points to a non-public +# submodule commit, and want to be able to use rules like "make check". +# In that case, run e.g., "make check gl_public_submodule_commit=" +# to disable this test. +gl_public_submodule_commit ?= public-submodule-commit +check: $(gl_public_submodule_commit) + +.PHONY: alpha beta stable +ALL_RECURSIVE_TARGETS += alpha beta stable +alpha beta stable: $(local-check) writable-files $(submodule-checks) + test $@ = stable \ + && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \ + || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\ + || : + $(MAKE) vc-diff-check + $(MAKE) news-check + $(MAKE) distcheck + $(MAKE) dist XZ_OPT=-9ev + $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@ + $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@ + +# Override this in cfg.mk if you follow different procedures. +release-prep-hook ?= release-prep + +gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?] +.PHONY: release-prep +release-prep: + case $$RELEASE_TYPE in alpha|beta|stable) ;; \ + *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac + $(MAKE) --no-print-directory -s announcement > ~/announce-$(my_distdir) + if test -d $(release_archive_dir); then \ + ln $(rel-files) $(release_archive_dir); \ + chmod a-w $(rel-files); \ + fi + echo $(VERSION) > $(prev_version_file) + $(MAKE) update-NEWS-hash + perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' NEWS + $(emit-commit-log) > .ci-msg + $(VC) commit -F .ci-msg -a + rm .ci-msg + +# Override this with e.g., -s $(srcdir)/some_other_name.texi +# if the default $(PACKAGE)-derived name doesn't apply. +gendocs_options_ ?= + +.PHONY: web-manual +web-manual: + @test -z "$(manual_title)" \ + && { echo define manual_title in cfg.mk 1>&2; exit 1; } || : + @cd '$(srcdir)/doc'; \ + $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \ + -o '$(abs_builddir)/doc/manual' \ + --email $(PACKAGE_BUGREPORT) $(PACKAGE) \ + "$(PACKAGE_NAME) - $(manual_title)" + @echo " *** Upload the doc/manual directory to web-cvs." + +# Code Coverage + +init-coverage: + $(MAKE) $(AM_MAKEFLAGS) clean + lcov --directory . --zerocounters + +COVERAGE_CCOPTS ?= "-g --coverage" +COVERAGE_OUT ?= doc/coverage + +build-coverage: + $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) + $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) check + mkdir -p $(COVERAGE_OUT) + lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \ + --capture + +gen-coverage: + genhtml --output-directory $(COVERAGE_OUT) \ + $(COVERAGE_OUT)/$(PACKAGE).info \ + --highlight --frames --legend \ + --title "$(PACKAGE_NAME)" + +coverage: init-coverage build-coverage gen-coverage + +# Update gettext files. +PACKAGE ?= $(shell basename $(PWD)) +PO_DOMAIN ?= $(PACKAGE) +POURL = http://translationproject.org/latest/$(PO_DOMAIN)/ +PODIR ?= po +refresh-po: + rm -f $(PODIR)/*.po && \ + echo "$(ME): getting translations into po (please ignore the robots.txt ERROR 404)..." && \ + wget --no-verbose --directory-prefix $(PODIR) --no-directories --recursive --level 1 --accept .po --accept .po.1 $(POURL) && \ + echo 'en@boldquot' > $(PODIR)/LINGUAS && \ + echo 'en@quot' >> $(PODIR)/LINGUAS && \ + ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> $(PODIR)/LINGUAS + + # Running indent once is not idempotent, but running it twice is. +INDENT_SOURCES ?= $(C_SOURCES) +.PHONY: indent +indent: + indent $(INDENT_SOURCES) + indent $(INDENT_SOURCES) + +# If you want to set UPDATE_COPYRIGHT_* environment variables, +# put the assignments in this variable. +update-copyright-env ?= + +# Run this rule once per year (usually early in January) +# to update all FSF copyright year lists in your project. +# If you have an additional project-specific rule, +# add it in cfg.mk along with a line 'update-copyright: prereq'. +# By default, exclude all variants of COPYING; you can also +# add exemptions (such as ChangeLog..* for rotated change logs) +# in the file .x-update-copyright. +.PHONY: update-copyright +update-copyright: + grep -l -w Copyright \ + $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \ + | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@ + +# This tight_scope test is skipped with a warning if $(_gl_TS_headers) is not +# overridden and $(_gl_TS_dir)/Makefile.am does not mention noinst_HEADERS. + +# NOTE: to override any _gl_TS_* default value, you must +# define the variable(s) using "export" in cfg.mk. +_gl_TS_dir ?= src + +ALL_RECURSIVE_TARGETS += sc_tight_scope +sc_tight_scope: tight-scope.mk + @fail=0; \ + if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \ + > /dev/null \ + && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \ + > /dev/null 2>&1; then \ + echo '$(ME): skipping $@'; \ + else \ + $(MAKE) -s -C $(_gl_TS_dir) \ + -f Makefile \ + -f $(abs_top_srcdir)/cfg.mk \ + -f $(abs_top_builddir)/$< \ + _gl_tight_scope \ + || fail=1; \ + fi; \ + rm -f $<; \ + exit $$fail + +tight-scope.mk: $(ME) + @rm -f $@ $@-t + @perl -ne '/^# TS-start/.../^# TS-end/ and print' $(ME) > $@-t + @chmod a=r $@-t && mv $@-t $@ + +ifeq (a,b) +# TS-start + +# Most functions should have static scope. +# Any that don't must be marked with `extern', but `main' +# and `usage' are exceptions: they're always extern, but +# do not need to be marked. Symbols matching `__.*' are +# reserved by the compiler, so are automatically excluded below. +_gl_TS_unmarked_extern_functions ?= main usage +_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\S+) *\(/ + +# If your project uses a macro like "XTERN", then put +# the following in cfg.mk to override this default: +# export _gl_TS_extern = extern|XTERN +_gl_TS_extern ?= extern + +# The second nm|grep checks for file-scope variables with `extern' scope. +# Without gnulib's progname module, you might put program_name here. +# Symbols matching `__.*' are reserved by the compiler, +# so are automatically excluded below. +_gl_TS_unmarked_extern_vars ?= + +# NOTE: the _match variables are perl expressions -- not mere regular +# expressions -- so that you can extend them to match other patterns +# and easily extract matched variable names. +# For example, if your project declares some global variables via +# a macro like this: GLOBAL(type, var_name, initializer), then you +# can override this definition to automatically extract those names: +# export _gl_TS_var_match = \ +# /^(?:$(_gl_TS_extern)) .*?\**(\w+)(\[.*?\])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/ +_gl_TS_var_match ?= /^(?:$(_gl_TS_extern)) .*?(\w+)(\[.*?\])?;/ + +# The names of object files in (or relative to) $(_gl_TS_dir). +_gl_TS_obj_files ?= *.$(OBJEXT) + +# Files in which to search for the one-line style extern declarations. +# $(_gl_TS_dir)-relative. +_gl_TS_headers ?= $(noinst_HEADERS) + +.PHONY: _gl_tight_scope +_gl_tight_scope: $(bin_PROGRAMS) + t=exceptions-$$$$; \ + trap 's=$$?; rm -f $$t; exit $$s' 0; \ + for sig in 1 2 3 13 15; do \ + eval "trap 'v=`expr $$sig + 128`; (exit $$v); exit $$v' $$sig"; \ + done; \ + src=`for f in $(SOURCES); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + hdr=`for f in $(_gl_TS_headers); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ + grep -h -A1 '^extern .*[^;]$$' $$src \ + | grep -vE '^(extern |--)' | sed 's/ .*//'; \ + perl -lne \ + '$(_gl_TS_function_match) and print "^$$1\$$"' $$hdr; \ + ) | sort -u > $$t; \ + nm -e $(_gl_TS_obj_files) | sed -n 's/.* T //p'|grep -Ev -f $$t \ + && { echo the above functions should have static scope >&2; \ + exit 1; } || : ; \ + ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars); \ + perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' $$hdr *.h \ + ) | sort -u > $$t; \ + nm -e $(_gl_TS_obj_files) | sed -n 's/.* [BCDGRS] //p' \ + | sort -u | grep -Ev -f $$t \ + && { echo the above variables should have static scope >&2; \ + exit 1; } || : +# TS-end +endif diff --git a/man/Makefile.am b/man/Makefile.am index 9257ce2..09ca502 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,7 +1,15 @@ +NULL = -man_MANS = virt-viewer.1 +man_MANS = \ + remote-viewer.1 \ + virt-viewer.1 \ + $(NULL) -EXTRA_DIST = virt-viewer.pod +EXTRA_DIST = \ + remote-viewer.pod \ + virt-viewer.pod \ + $(NULL) + DISTCLEANFILES = $(man_MANS) %.1: %.pod diff --git a/man/Makefile.in b/man/Makefile.in index 2c9ee83..fd2dd7c 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -89,6 +89,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -112,6 +114,7 @@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_API_VERSION = @GTK_API_VERSION@ @@ -126,6 +129,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ @@ -145,9 +150,11 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -168,6 +175,10 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -231,8 +242,17 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -man_MANS = virt-viewer.1 -EXTRA_DIST = virt-viewer.pod +NULL = +man_MANS = \ + remote-viewer.1 \ + virt-viewer.1 \ + $(NULL) + +EXTRA_DIST = \ + remote-viewer.pod \ + virt-viewer.pod \ + $(NULL) + DISTCLEANFILES = $(man_MANS) all: all-am diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod new file mode 100644 index 0000000..3e73af1 --- /dev/null +++ b/man/remote-viewer.pod @@ -0,0 +1,78 @@ + +=head1 NAME + +remote-viewer - a simple remote desktop client + +=head1 SYNOPSIS + +B [OPTIONS] URI + +=head1 DESCRIPTION + +B is a simple remote display client. The supported +protocols are SPICE and VNC. + +=head1 OPTIONS + +The following options are accepted when running C: + +=over 4 + +=item -h, --help + +Display command line help summary + +=item -V, --version + +Display program version number + +=item -v, --verbose + +Display information about the connection + +=item -z PCT, --zoom=PCT + +Zoom level of the display window in percentage. Range 10-200. + +=item -f, --fullscreen + +Start with the window maximised to fullscreen + +=item --spice-controller + +Use the SPICE controller to initialize the connection with the SPICE +server. This option is used by the SPICE browser addons to allow web +page to start a client. + +=item --debug + +Print debugging information + +=back + +=head1 EXAMPLES + +To connect to SPICE server on host "makai" with port 5900 + + remote-viewer spice://makai:5900 + +To connect to VNC server on host "tsingy" with port 5900 + + remote-viewer vnc://tsingy:5900 + +=head1 BUGS + +Report bugs to the mailing list C + +=head1 COPYRIGHT + +Copyright (C) 2012 Red Hat, Inc., and various contributors. +This is free software. You may redistribute copies of it under the terms of the GNU General +Public License C. There is NO WARRANTY, to the extent +permitted by law. + +=head1 SEE ALSO + +C, the project website C + +=cut diff --git a/man/virt-viewer.pod b/man/virt-viewer.pod index ec74f33..7ba0cd3 100644 --- a/man/virt-viewer.pod +++ b/man/virt-viewer.pod @@ -97,11 +97,11 @@ =head1 BUGS -Report bugs to the mailing list C +Report bugs to the mailing list C =head1 COPYRIGHT -Copyright (C) 2007-2008 Red Hat, Inc, and various contributors. +Copyright (C) 2007-2008 Red Hat, Inc., and various contributors. This is free software. You may redistribute copies of it under the terms of the GNU General Public License C. There is NO WARRANTY, to the extent permitted by law. @@ -111,4 +111,3 @@ C, C, the project website C =cut - diff --git a/mingw32-virt-viewer.spec.in b/mingw32-virt-viewer.spec.in index 39565b4..5ca433a 100644 --- a/mingw32-virt-viewer.spec.in +++ b/mingw32-virt-viewer.spec.in @@ -69,13 +69,16 @@ %files -f virt-viewer.lang %defattr(-,root,root) %{_mingw32_bindir}/virt-viewer.exe +%{_mingw32_bindir}/remote-viewer.exe %dir %{_mingw32_datadir}/virt-viewer/ %dir %{_mingw32_datadir}/virt-viewer/ui/ %{_mingw32_datadir}/virt-viewer/ui/virt-viewer.xml %{_mingw32_datadir}/virt-viewer/ui/virt-viewer-about.xml %{_mingw32_datadir}/virt-viewer/ui/virt-viewer-auth.xml +%{_mingw32_datadir}/icons/hicolor/*/apps/* %{_mingw32_mandir}/man1/virt-viewer.1* +%{_mingw32_mandir}/man1/remote-viewer.1* %changelog diff --git a/plugin/Makefile.am b/plugin/Makefile.am index 34dbd02..9c00853 100644 --- a/plugin/Makefile.am +++ b/plugin/Makefile.am @@ -11,22 +11,20 @@ virt-viewer-plugin.c virt-viewer-plugin.h \ npshell.c npunix.c virt_viewer_plugin_la_LIBADD = \ - @FIREFOX_PLUGIN_LIBS@ \ - @GTKVNC_LIBS@ \ - @GTK2_LIBS@ \ - @LIBXML2_LIBS@ \ - @LIBGLADE2_LIBS@ \ - @LIBVIRT_LIBS@ + $(FIREFOX_PLUGIN_LIBS) \ + $(GTK_VNC_LIBS) \ + $(GTK_LIBS) \ + $(LIBXML2_LIBS) \ + $(LIBVIRT_LIBS) virt_viewer_plugin_la_LDFLAGS = \ -module -avoid-version virt_viewer_plugin_la_CFLAGS = \ -DPLUGIN=1 -DENABLE_DEBUG=1 \ - @FIREFOX_PLUGIN_CFLAGS@ \ - @GTKVNC_CFLAGS@ \ - @GTK2_CFLAGS@ \ - @LIBXML2_CFLAGS@ \ - @LIBGLADE2_CFLAGS@ \ - @LIBVIRT_CFLAGS@ \ + $(FIREFOX_PLUGIN_CFLAGS) \ + $(GTK_VNC_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBXML2_CFLAGS) \ + $(LIBVIRT_CFLAGS) \ -DGLADE_DIR="\"$(gladedir)\"" \ -I$(top_srcdir)/src diff --git a/plugin/Makefile.in b/plugin/Makefile.in index 761f04c..dff5767 100644 --- a/plugin/Makefile.in +++ b/plugin/Makefile.in @@ -70,7 +70,13 @@ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(plugindir)" LTLIBRARIES = $(plugin_LTLIBRARIES) -virt_viewer_plugin_la_DEPENDENCIES = +am__DEPENDENCIES_1 = +@ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_DEPENDENCIES = \ +@ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) am__virt_viewer_plugin_la_SOURCES_DIST = ../src/virt-viewer-util.c \ ../src/virt-viewer-util.h ../src/virt-viewer-auth.c \ ../src/virt-viewer-auth.h ../src/virt-viewer.c \ @@ -135,6 +141,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -158,6 +166,7 @@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_API_VERSION = @GTK_API_VERSION@ @@ -172,6 +181,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ @@ -191,9 +202,11 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -214,6 +227,10 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -288,24 +305,22 @@ @ENABLE_PLUGIN_TRUE@ npshell.c npunix.c @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_LIBADD = \ -@ENABLE_PLUGIN_TRUE@ @FIREFOX_PLUGIN_LIBS@ \ -@ENABLE_PLUGIN_TRUE@ @GTKVNC_LIBS@ \ -@ENABLE_PLUGIN_TRUE@ @GTK2_LIBS@ \ -@ENABLE_PLUGIN_TRUE@ @LIBXML2_LIBS@ \ -@ENABLE_PLUGIN_TRUE@ @LIBGLADE2_LIBS@ \ -@ENABLE_PLUGIN_TRUE@ @LIBVIRT_LIBS@ +@ENABLE_PLUGIN_TRUE@ $(FIREFOX_PLUGIN_LIBS) \ +@ENABLE_PLUGIN_TRUE@ $(GTK_VNC_LIBS) \ +@ENABLE_PLUGIN_TRUE@ $(GTK_LIBS) \ +@ENABLE_PLUGIN_TRUE@ $(LIBXML2_LIBS) \ +@ENABLE_PLUGIN_TRUE@ $(LIBVIRT_LIBS) @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_LDFLAGS = \ @ENABLE_PLUGIN_TRUE@ -module -avoid-version @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_CFLAGS = \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN=1 -DENABLE_DEBUG=1 \ -@ENABLE_PLUGIN_TRUE@ @FIREFOX_PLUGIN_CFLAGS@ \ -@ENABLE_PLUGIN_TRUE@ @GTKVNC_CFLAGS@ \ -@ENABLE_PLUGIN_TRUE@ @GTK2_CFLAGS@ \ -@ENABLE_PLUGIN_TRUE@ @LIBXML2_CFLAGS@ \ -@ENABLE_PLUGIN_TRUE@ @LIBGLADE2_CFLAGS@ \ -@ENABLE_PLUGIN_TRUE@ @LIBVIRT_CFLAGS@ \ +@ENABLE_PLUGIN_TRUE@ $(FIREFOX_PLUGIN_CFLAGS) \ +@ENABLE_PLUGIN_TRUE@ $(GTK_VNC_CFLAGS) \ +@ENABLE_PLUGIN_TRUE@ $(GTK_CFLAGS) \ +@ENABLE_PLUGIN_TRUE@ $(LIBXML2_CFLAGS) \ +@ENABLE_PLUGIN_TRUE@ $(LIBVIRT_CFLAGS) \ @ENABLE_PLUGIN_TRUE@ -DGLADE_DIR="\"$(gladedir)\"" \ @ENABLE_PLUGIN_TRUE@ -I$(top_srcdir)/src diff --git a/plugin/npshell.c b/plugin/npshell.c index ccd11a5..bb43da3 100644 --- a/plugin/npshell.c +++ b/plugin/npshell.c @@ -46,8 +46,8 @@ * This file defines a "shell" plugin that plugin developers can use * as the basis for a real plugin. This shell just provides empty * implementations of all functions that the plugin can implement - * that will be called by Netscape (the NPP_xxx methods defined in - * npapi.h). + * that will be called by Netscape (the NPP_xxx methods defined in + * npapi.h). * * dp Suresh * updated 5/1998 @@ -59,11 +59,11 @@ /* The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance +Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ -Software distributed under the License is distributed on an "AS IS" basis, -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is stub code that defines the binary interface to a Mozilla @@ -147,7 +147,7 @@ debug ("NPP_Shutdown"); } -NPError +NPError NPP_New(NPMIMEType pluginType G_GNUC_UNUSED, NPP instance, uint16 mode, @@ -220,7 +220,7 @@ return NPERR_NO_ERROR; } -NPError +NPError NPP_Destroy(NPP instance, NPSavedData** save G_GNUC_UNUSED) { PluginInstance* This; @@ -235,8 +235,8 @@ if (This != NULL) { (void) VirtViewerDestroyWindow (instance); - if (This->uri) free (This->uri); - if (This->name) free (This->name); + free (This->uri); + free (This->name); NPN_MemFree(instance->pdata); instance->pdata = NULL; } @@ -245,7 +245,7 @@ } -NPError +NPError NPP_SetWindow(NPP instance, NPWindow* window) { debug ("NPP_SetWindow"); @@ -253,7 +253,7 @@ return VirtViewerXSetWindow(instance, window); } -int32 +int32 NPP_WriteReady(NPP instance, NPStream *stream) { /*printf("NPP_WriteReady()\n");*/ @@ -267,7 +267,7 @@ return -1L; /* don't accept any bytes in NPP_Write() */ } -int32 +int32 NPP_Write(NPP instance, NPStream *stream, int32 offset G_GNUC_UNUSED, int32 len G_GNUC_UNUSED, void *buffer G_GNUC_UNUSED) @@ -282,7 +282,7 @@ return -1L; /* don't accept any bytes in NPP_Write() */ } -NPError +NPError NPP_DestroyStream(NPP instance, NPStream *stream G_GNUC_UNUSED, NPError reason G_GNUC_UNUSED) { @@ -298,7 +298,7 @@ return NPERR_NO_ERROR; } -void +void NPP_StreamAsFile(NPP instance G_GNUC_UNUSED, NPStream *stream G_GNUC_UNUSED, const char* fname G_GNUC_UNUSED) { @@ -323,7 +323,7 @@ } -void +void NPP_Print(NPP instance, NPPrint* printInfo) { /*printf("NPP_Print()\n");*/ @@ -334,7 +334,7 @@ /***** Insert NPP_Print code here *****\ PluginInstance* This = (PluginInstance*) instance->pdata; \**************************************/ - + if (printInfo->mode == NP_FULL) { /* * PLUGIN DEVELOPERS: @@ -359,7 +359,7 @@ NPBool printOne = printInfo->print.fullPrint.printOne; \**************************************/ - + /* Do the default*/ printInfo->print.fullPrint.pluginPrinted = FALSE; } diff --git a/plugin/npunix.c b/plugin/npunix.c index ddc4bdf..48948d0 100644 --- a/plugin/npunix.c +++ b/plugin/npunix.c @@ -262,7 +262,7 @@ * Wrapper functions : Netscape Navigator -> plugin * * These functions let the plugin developer just create the APIs - * as documented and defined in npapi.h, without needing to + * as documented and defined in npapi.h, without needing to * install those functions in the function table or worry about * setting up globals for 68K plugins. * @@ -275,7 +275,7 @@ NPError ret; PLUGINDEBUGSTR("New"); ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved); - return ret; + return ret; } static NPError @@ -344,7 +344,6 @@ static void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) - { PLUGINDEBUGSTR("URLNotify"); NPP_URLNotify(instance, url, reason, notifyData); @@ -353,8 +352,8 @@ static NPError Private_GetValue(void *instance, NPPVariable variable, void *result) { - NPError rv = NPP_GetValue(instance, variable, result); - return rv; + NPError rv = NPP_GetValue(instance, variable, result); + return rv; } static void @@ -377,13 +376,13 @@ } #endif -static int16 +static int16 Private_HandleEvent(NPP instance, void* event) { return NPP_HandleEvent(instance, event); } -/*********************************************************************** +/*********************************************************************** * * These functions are located automagically by netscape. * @@ -436,12 +435,12 @@ NPError err = NPERR_NO_ERROR; PLUGINDEBUGSTR("NP_Initialize"); - + /* validate input parameters */ if ((nsTable == NULL) || (pluginFuncs == NULL)) err = NPERR_INVALID_FUNCTABLE_ERROR; - + /* * Check the major version passed in Netscape's function table. * We won't load if the major version is newer than what we expect. @@ -456,11 +455,10 @@ err = NPERR_INCOMPATIBLE_VERSION_ERROR; if (nsTable->size < sizeof(NPNetscapeFuncs)) err = NPERR_INVALID_FUNCTABLE_ERROR; - if (pluginFuncs->size < sizeof(NPPluginFuncs)) + if (pluginFuncs->size < sizeof(NPPluginFuncs)) err = NPERR_INVALID_FUNCTABLE_ERROR; } - - + if (err == NPERR_NO_ERROR) { /* * Copy all the fields of Netscape function table into our @@ -519,7 +517,7 @@ err = NPP_Initialize(); } - + return err; } diff --git a/plugin/virt-viewer-plugin.c b/plugin/virt-viewer-plugin.c index 00902e1..3fd6e84 100644 --- a/plugin/virt-viewer-plugin.c +++ b/plugin/virt-viewer-plugin.c @@ -2,7 +2,7 @@ VIRT-VIEWER-PLUGIN By Richard W.M. Jones - Copyright (C) 2008 Red Hat Inc. + Copyright (C) 2008-2012 Red Hat, Inc. Largely based on DiamondX (http://multimedia.cx/diamondx/), which itself is based on Mozilla sources. @@ -83,7 +83,7 @@ /* Make the VNC widget. */ if (This->uri && This->name) { 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); + 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->debug, 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 f53f782..add97df 100644 --- a/plugin/virt-viewer-plugin.h +++ b/plugin/virt-viewer-plugin.h @@ -2,7 +2,7 @@ VIRT_VIEWER-PLUGIN By Richard W.M. Jones - Copyright (C) 2008 Red Hat Inc. + Copyright (C) 2008-2012 Red Hat, Inc. Largely based on DiamondX (http://multimedia.cx/diamondx/), which itself is based on Mozilla sources. @@ -39,7 +39,7 @@ #include #include #include -#include "viewer.h" +#include "virt-viewer-app.h" #define PLUGIN_NAME "Virt-viewer browser plugin" #define MIME_TYPES_HANDLED "application/x-virt-viewer:virt-viewer:Virt viewer" @@ -77,7 +77,7 @@ fflush (stderr); } #else -static void debug (const char *msg G_GNUC_UNUSED, ...) { } +#define debug(msg...) #endif #endif /* VIRT_VIEWER_PLUGIN_H */ diff --git a/po/POTFILES.in b/po/POTFILES.in index 57b6c52..317ccef 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,17 +1,11 @@ +src/remote-viewer-main.c +src/remote-viewer.c src/virt-viewer-about.xml src/virt-viewer-app.c -src/virt-viewer-auth.c src/virt-viewer-auth.xml -src/virt-viewer-display-spice.c -src/virt-viewer-display-vnc.c -src/virt-viewer-display.c -src/virt-viewer-events.c src/virt-viewer-main.c -src/virt-viewer-notebook.c src/virt-viewer-session-spice.c src/virt-viewer-session-vnc.c -src/virt-viewer-session.c -src/virt-viewer-util.c src/virt-viewer-window.c src/virt-viewer.c src/virt-viewer.xml diff --git a/src/Makefile.am b/src/Makefile.am index 4643de9..a459622 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,57 +1,86 @@ -bin_PROGRAMS = virt-viewer +NULL = +# we are forced to use a shared library, +# because libtool reordred .a after .la libs, and it fails to link +noinst_LTLIBRARIES = libvirt-viewer.la +bin_PROGRAMS = builderxmldir = $(pkgdatadir)/ui -builderxml_DATA = \ - virt-viewer.xml \ - virt-viewer-about.xml \ - virt-viewer-auth.xml +builderxml_DATA = \ + virt-viewer.xml \ + virt-viewer-about.xml \ + virt-viewer-auth.xml \ + $(NULL) EXTRA_DIST = $(builderxml_DATA) -virt_viewer_SOURCES = \ - virt-viewer-main.c \ - virt-viewer.h virt-viewer.c \ - virt-viewer-util.h virt-viewer-util.c \ - virt-viewer-auth.h virt-viewer-auth.c \ - virt-viewer-events.h virt-viewer-events.c \ - virt-viewer-app.h virt-viewer-app.c \ - virt-viewer-session.h virt-viewer-session.c \ - virt-viewer-display.h virt-viewer-display.c \ - virt-viewer-notebook.h virt-viewer-notebook.c \ - virt-viewer-window.h virt-viewer-window.c \ - view/autoDrawer.c \ - view/autoDrawer.h \ - view/drawer.c \ - view/drawer.h \ - view/ovBox.c \ - view/ovBox.h +if HAVE_LIBVIRT +bin_PROGRAMS += virt-viewer +virt_viewer_SOURCES = \ + virt-viewer-events.h virt-viewer-events.c \ + virt-viewer.h virt-viewer.c \ + virt-viewer-main.c \ + $(NULL) +virt_viewer_LDADD = libvirt-viewer.la +virt_viewer_LDFLAGS = \ + $(LIBVIRT_LIBS) \ + $(GMODULE2_LIBS) \ + $(NULL) +virt_viewer_CFLAGS = $(AM_CFLAGS) $(LIBVIRT_CFLAGS) +endif + +bin_PROGRAMS += remote-viewer +remote_viewer_SOURCES = \ + remote-viewer.h remote-viewer.c \ + remote-viewer-main.c \ + $(NULL) +remote_viewer_LDADD = libvirt-viewer.la +remote_viewer_LDFLAGS = \ + $(GMODULE2_LIBS) \ + $(NULL) + +libvirt_viewer_la_SOURCES = \ + virt-viewer-util.h virt-viewer-util.c \ + virt-viewer-auth.h virt-viewer-auth.c \ + virt-viewer-app.h virt-viewer-app.c \ + virt-viewer-session.h virt-viewer-session.c \ + virt-viewer-display.h virt-viewer-display.c \ + virt-viewer-notebook.h virt-viewer-notebook.c \ + virt-viewer-window.h virt-viewer-window.c \ + view/autoDrawer.c \ + view/autoDrawer.h \ + view/drawer.c \ + view/drawer.h \ + view/ovBox.c \ + view/ovBox.h \ + $(NULL) +libvirt_viewer_la_LIBADD = \ + $(GMODULE2_LIBS) \ + $(GTK_LIBS) \ + $(LIBXML2_LIBS) \ + $(NULL) if HAVE_GTK_VNC -virt_viewer_SOURCES += \ - virt-viewer-session-vnc.h virt-viewer-session-vnc.c \ - virt-viewer-display-vnc.h virt-viewer-display-vnc.c +libvirt_viewer_la_SOURCES += \ + virt-viewer-session-vnc.h virt-viewer-session-vnc.c \ + virt-viewer-display-vnc.h virt-viewer-display-vnc.c \ + $(NULL) +libvirt_viewer_la_LIBADD += $(GTK_VNC_LIBS) endif if HAVE_SPICE_GTK -virt_viewer_SOURCES += \ - virt-viewer-session-spice.h virt-viewer-session-spice.c \ - virt-viewer-display-spice.h virt-viewer-display-spice.c +libvirt_viewer_la_SOURCES += \ + virt-viewer-session-spice.h virt-viewer-session-spice.c \ + virt-viewer-display-spice.h virt-viewer-display-spice.c \ + $(NULL) +libvirt_viewer_la_LIBADD += $(SPICE_GTK_LIBS) endif -virt_viewer_LDADD = \ - @GTK_VNC_LIBS@ \ - @SPICE_GTK_LIBS@ \ - @GMODULE2_LIBS@ \ - @GTK_LIBS@ \ - @LIBXML2_LIBS@ \ - @LIBVIRT_LIBS@ - -virt_viewer_CFLAGS = \ - @GTK_VNC_CFLAGS@ \ - @SPICE_GTK_CFLAGS@ \ - @GMODULE2_CFLAGS@ \ - @GTK_CFLAGS@ \ - @LIBXML2_CFLAGS@ \ - @LIBVIRT_CFLAGS@ \ - @WARN_CFLAGS@ \ - -DLOCALE_DIR=\""$(datadir)/locale"\" +AM_CFLAGS = \ + $(GMODULE2_CFLAGS) \ + $(GTK_CFLAGS) \ + $(GTK_VNC_CFLAGS) \ + $(LIBXML2_CFLAGS) \ + $(SPICE_GTK_CFLAGS) \ + $(WARN_CFLAGS) \ + -DLOCALE_DIR=\""$(datadir)/locale"\" \ + $(NULL) diff --git a/src/Makefile.in b/src/Makefile.in index ae64407..1691950 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -14,6 +14,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ @@ -35,15 +36,20 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = virt-viewer$(EXEEXT) -@HAVE_GTK_VNC_TRUE@am__append_1 = \ -@HAVE_GTK_VNC_TRUE@ virt-viewer-session-vnc.h virt-viewer-session-vnc.c \ -@HAVE_GTK_VNC_TRUE@ virt-viewer-display-vnc.h virt-viewer-display-vnc.c - -@HAVE_SPICE_GTK_TRUE@am__append_2 = \ -@HAVE_SPICE_GTK_TRUE@ virt-viewer-session-spice.h virt-viewer-session-spice.c \ -@HAVE_SPICE_GTK_TRUE@ virt-viewer-display-spice.h virt-viewer-display-spice.c - +bin_PROGRAMS = $(am__EXEEXT_1) remote-viewer$(EXEEXT) +@HAVE_LIBVIRT_TRUE@am__append_1 = virt-viewer +@HAVE_GTK_VNC_TRUE@am__append_2 = \ +@HAVE_GTK_VNC_TRUE@ virt-viewer-session-vnc.h virt-viewer-session-vnc.c \ +@HAVE_GTK_VNC_TRUE@ virt-viewer-display-vnc.h virt-viewer-display-vnc.c \ +@HAVE_GTK_VNC_TRUE@ $(NULL) + +@HAVE_GTK_VNC_TRUE@am__append_3 = $(GTK_VNC_LIBS) +@HAVE_SPICE_GTK_TRUE@am__append_4 = \ +@HAVE_SPICE_GTK_TRUE@ virt-viewer-session-spice.h virt-viewer-session-spice.c \ +@HAVE_SPICE_GTK_TRUE@ virt-viewer-display-spice.h virt-viewer-display-spice.c \ +@HAVE_SPICE_GTK_TRUE@ $(NULL) + +@HAVE_SPICE_GTK_TRUE@am__append_5 = $(SPICE_GTK_LIBS) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -57,46 +63,64 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)" -PROGRAMS = $(bin_PROGRAMS) -am__virt_viewer_SOURCES_DIST = virt-viewer-main.c virt-viewer.h \ - virt-viewer.c virt-viewer-util.h virt-viewer-util.c \ - virt-viewer-auth.h virt-viewer-auth.c virt-viewer-events.h \ - virt-viewer-events.c virt-viewer-app.h virt-viewer-app.c \ - virt-viewer-session.h virt-viewer-session.c \ - virt-viewer-display.h virt-viewer-display.c \ - virt-viewer-notebook.h virt-viewer-notebook.c \ - virt-viewer-window.h virt-viewer-window.c view/autoDrawer.c \ - view/autoDrawer.h view/drawer.c view/drawer.h view/ovBox.c \ - view/ovBox.h virt-viewer-session-vnc.h \ - virt-viewer-session-vnc.c virt-viewer-display-vnc.h \ - virt-viewer-display-vnc.c virt-viewer-session-spice.h \ - virt-viewer-session-spice.c virt-viewer-display-spice.h \ - virt-viewer-display-spice.c -@HAVE_GTK_VNC_TRUE@am__objects_1 = virt_viewer-virt-viewer-session-vnc.$(OBJEXT) \ -@HAVE_GTK_VNC_TRUE@ virt_viewer-virt-viewer-display-vnc.$(OBJEXT) -@HAVE_SPICE_GTK_TRUE@am__objects_2 = virt_viewer-virt-viewer-session-spice.$(OBJEXT) \ -@HAVE_SPICE_GTK_TRUE@ virt_viewer-virt-viewer-display-spice.$(OBJEXT) -am_virt_viewer_OBJECTS = virt_viewer-virt-viewer-main.$(OBJEXT) \ - virt_viewer-virt-viewer.$(OBJEXT) \ - virt_viewer-virt-viewer-util.$(OBJEXT) \ - virt_viewer-virt-viewer-auth.$(OBJEXT) \ - virt_viewer-virt-viewer-events.$(OBJEXT) \ - virt_viewer-virt-viewer-app.$(OBJEXT) \ - virt_viewer-virt-viewer-session.$(OBJEXT) \ - virt_viewer-virt-viewer-display.$(OBJEXT) \ - virt_viewer-virt-viewer-notebook.$(OBJEXT) \ - virt_viewer-virt-viewer-window.$(OBJEXT) \ - virt_viewer-autoDrawer.$(OBJEXT) virt_viewer-drawer.$(OBJEXT) \ - virt_viewer-ovBox.$(OBJEXT) $(am__objects_1) $(am__objects_2) -virt_viewer_OBJECTS = $(am_virt_viewer_OBJECTS) -virt_viewer_DEPENDENCIES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +@HAVE_GTK_VNC_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@HAVE_SPICE_GTK_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) +libvirt_viewer_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am__libvirt_viewer_la_SOURCES_DIST = virt-viewer-util.h \ + virt-viewer-util.c virt-viewer-auth.h virt-viewer-auth.c \ + virt-viewer-app.h virt-viewer-app.c virt-viewer-session.h \ + virt-viewer-session.c virt-viewer-display.h \ + virt-viewer-display.c virt-viewer-notebook.h \ + virt-viewer-notebook.c virt-viewer-window.h \ + virt-viewer-window.c view/autoDrawer.c view/autoDrawer.h \ + view/drawer.c view/drawer.h view/ovBox.c view/ovBox.h \ + virt-viewer-session-vnc.h virt-viewer-session-vnc.c \ + virt-viewer-display-vnc.h virt-viewer-display-vnc.c \ + virt-viewer-session-spice.h virt-viewer-session-spice.c \ + virt-viewer-display-spice.h virt-viewer-display-spice.c +am__objects_1 = +@HAVE_GTK_VNC_TRUE@am__objects_2 = virt-viewer-session-vnc.lo \ +@HAVE_GTK_VNC_TRUE@ virt-viewer-display-vnc.lo $(am__objects_1) +@HAVE_SPICE_GTK_TRUE@am__objects_3 = virt-viewer-session-spice.lo \ +@HAVE_SPICE_GTK_TRUE@ virt-viewer-display-spice.lo \ +@HAVE_SPICE_GTK_TRUE@ $(am__objects_1) +am_libvirt_viewer_la_OBJECTS = virt-viewer-util.lo virt-viewer-auth.lo \ + virt-viewer-app.lo virt-viewer-session.lo \ + virt-viewer-display.lo virt-viewer-notebook.lo \ + virt-viewer-window.lo autoDrawer.lo drawer.lo ovBox.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) +libvirt_viewer_la_OBJECTS = $(am_libvirt_viewer_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent +@HAVE_LIBVIRT_TRUE@am__EXEEXT_1 = virt-viewer$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)" +PROGRAMS = $(bin_PROGRAMS) +am_remote_viewer_OBJECTS = remote-viewer.$(OBJEXT) \ + remote-viewer-main.$(OBJEXT) $(am__objects_1) +remote_viewer_OBJECTS = $(am_remote_viewer_OBJECTS) +remote_viewer_DEPENDENCIES = libvirt-viewer.la +remote_viewer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(remote_viewer_LDFLAGS) $(LDFLAGS) -o $@ +am__virt_viewer_SOURCES_DIST = virt-viewer-events.h \ + virt-viewer-events.c virt-viewer.h virt-viewer.c \ + virt-viewer-main.c +@HAVE_LIBVIRT_TRUE@am_virt_viewer_OBJECTS = \ +@HAVE_LIBVIRT_TRUE@ virt_viewer-virt-viewer-events.$(OBJEXT) \ +@HAVE_LIBVIRT_TRUE@ virt_viewer-virt-viewer.$(OBJEXT) \ +@HAVE_LIBVIRT_TRUE@ virt_viewer-virt-viewer-main.$(OBJEXT) \ +@HAVE_LIBVIRT_TRUE@ $(am__objects_1) +virt_viewer_OBJECTS = $(am_virt_viewer_OBJECTS) +@HAVE_LIBVIRT_TRUE@virt_viewer_DEPENDENCIES = libvirt-viewer.la virt_viewer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(virt_viewer_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(virt_viewer_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -123,8 +147,10 @@ AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(virt_viewer_SOURCES) -DIST_SOURCES = $(am__virt_viewer_SOURCES_DIST) +SOURCES = $(libvirt_viewer_la_SOURCES) $(remote_viewer_SOURCES) \ + $(virt_viewer_SOURCES) +DIST_SOURCES = $(am__libvirt_viewer_la_SOURCES_DIST) \ + $(remote_viewer_SOURCES) $(am__virt_viewer_SOURCES_DIST) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -159,6 +185,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -182,6 +210,7 @@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMODULE2_CFLAGS = @GMODULE2_CFLAGS@ GMODULE2_LIBS = @GMODULE2_LIBS@ +GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_API_VERSION = @GTK_API_VERSION@ @@ -196,6 +225,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ @@ -215,9 +246,11 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@ MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@ MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -238,6 +271,10 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -301,40 +338,60 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +NULL = +# we are forced to use a shared library, +# because libtool reordred .a after .la libs, and it fails to link +noinst_LTLIBRARIES = libvirt-viewer.la builderxmldir = $(pkgdatadir)/ui builderxml_DATA = \ - virt-viewer.xml \ - virt-viewer-about.xml \ - virt-viewer-auth.xml + virt-viewer.xml \ + virt-viewer-about.xml \ + virt-viewer-auth.xml \ + $(NULL) EXTRA_DIST = $(builderxml_DATA) -virt_viewer_SOURCES = virt-viewer-main.c virt-viewer.h virt-viewer.c \ - virt-viewer-util.h virt-viewer-util.c virt-viewer-auth.h \ - virt-viewer-auth.c virt-viewer-events.h virt-viewer-events.c \ - virt-viewer-app.h virt-viewer-app.c virt-viewer-session.h \ - virt-viewer-session.c virt-viewer-display.h \ - virt-viewer-display.c virt-viewer-notebook.h \ - virt-viewer-notebook.c virt-viewer-window.h \ - virt-viewer-window.c view/autoDrawer.c view/autoDrawer.h \ - view/drawer.c view/drawer.h view/ovBox.c view/ovBox.h \ - $(am__append_1) $(am__append_2) -virt_viewer_LDADD = \ - @GTK_VNC_LIBS@ \ - @SPICE_GTK_LIBS@ \ - @GMODULE2_LIBS@ \ - @GTK_LIBS@ \ - @LIBXML2_LIBS@ \ - @LIBVIRT_LIBS@ - -virt_viewer_CFLAGS = \ - @GTK_VNC_CFLAGS@ \ - @SPICE_GTK_CFLAGS@ \ - @GMODULE2_CFLAGS@ \ - @GTK_CFLAGS@ \ - @LIBXML2_CFLAGS@ \ - @LIBVIRT_CFLAGS@ \ - @WARN_CFLAGS@ \ - -DLOCALE_DIR=\""$(datadir)/locale"\" +@HAVE_LIBVIRT_TRUE@virt_viewer_SOURCES = \ +@HAVE_LIBVIRT_TRUE@ virt-viewer-events.h virt-viewer-events.c \ +@HAVE_LIBVIRT_TRUE@ virt-viewer.h virt-viewer.c \ +@HAVE_LIBVIRT_TRUE@ virt-viewer-main.c \ +@HAVE_LIBVIRT_TRUE@ $(NULL) + +@HAVE_LIBVIRT_TRUE@virt_viewer_LDADD = libvirt-viewer.la +@HAVE_LIBVIRT_TRUE@virt_viewer_LDFLAGS = \ +@HAVE_LIBVIRT_TRUE@ $(LIBVIRT_LIBS) \ +@HAVE_LIBVIRT_TRUE@ $(GMODULE2_LIBS) \ +@HAVE_LIBVIRT_TRUE@ $(NULL) + +@HAVE_LIBVIRT_TRUE@virt_viewer_CFLAGS = $(AM_CFLAGS) $(LIBVIRT_CFLAGS) +remote_viewer_SOURCES = \ + remote-viewer.h remote-viewer.c \ + remote-viewer-main.c \ + $(NULL) + +remote_viewer_LDADD = libvirt-viewer.la +remote_viewer_LDFLAGS = \ + $(GMODULE2_LIBS) \ + $(NULL) + +libvirt_viewer_la_SOURCES = virt-viewer-util.h virt-viewer-util.c \ + virt-viewer-auth.h virt-viewer-auth.c virt-viewer-app.h \ + virt-viewer-app.c virt-viewer-session.h virt-viewer-session.c \ + virt-viewer-display.h virt-viewer-display.c \ + virt-viewer-notebook.h virt-viewer-notebook.c \ + virt-viewer-window.h virt-viewer-window.c view/autoDrawer.c \ + view/autoDrawer.h view/drawer.c view/drawer.h view/ovBox.c \ + view/ovBox.h $(NULL) $(am__append_2) $(am__append_4) +libvirt_viewer_la_LIBADD = $(GMODULE2_LIBS) $(GTK_LIBS) \ + $(LIBXML2_LIBS) $(NULL) $(am__append_3) $(am__append_5) +AM_CFLAGS = \ + $(GMODULE2_CFLAGS) \ + $(GTK_CFLAGS) \ + $(GTK_VNC_CFLAGS) \ + $(LIBXML2_CFLAGS) \ + $(SPICE_GTK_CFLAGS) \ + $(WARN_CFLAGS) \ + -DLOCALE_DIR=\""$(datadir)/locale"\" \ + $(NULL) all: all-am @@ -370,6 +427,17 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libvirt-viewer.la: $(libvirt_viewer_la_OBJECTS) $(libvirt_viewer_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libvirt_viewer_la_OBJECTS) $(libvirt_viewer_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @@ -413,6 +481,9 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +remote-viewer$(EXEEXT): $(remote_viewer_OBJECTS) $(remote_viewer_DEPENDENCIES) + @rm -f remote-viewer$(EXEEXT) + $(AM_V_CCLD)$(remote_viewer_LINK) $(remote_viewer_OBJECTS) $(remote_viewer_LDADD) $(LIBS) virt-viewer$(EXEEXT): $(virt_viewer_OBJECTS) $(virt_viewer_DEPENDENCIES) @rm -f virt-viewer$(EXEEXT) $(AM_V_CCLD)$(virt_viewer_LINK) $(virt_viewer_OBJECTS) $(virt_viewer_LDADD) $(LIBS) @@ -423,22 +494,24 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-autoDrawer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-drawer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-ovBox.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-app.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-auth.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/autoDrawer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drawer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ovBox.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-viewer-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-viewer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-app.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-auth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-display-spice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-display-vnc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-display.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-notebook.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-session-spice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-session-vnc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-session.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-notebook.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer.Po@am__quote@ .c.o: @@ -465,6 +538,62 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +autoDrawer.lo: view/autoDrawer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT autoDrawer.lo -MD -MP -MF $(DEPDIR)/autoDrawer.Tpo -c -o autoDrawer.lo `test -f 'view/autoDrawer.c' || echo '$(srcdir)/'`view/autoDrawer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/autoDrawer.Tpo $(DEPDIR)/autoDrawer.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='autoDrawer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o autoDrawer.lo `test -f 'view/autoDrawer.c' || echo '$(srcdir)/'`view/autoDrawer.c + +drawer.lo: view/drawer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT drawer.lo -MD -MP -MF $(DEPDIR)/drawer.Tpo -c -o drawer.lo `test -f 'view/drawer.c' || echo '$(srcdir)/'`view/drawer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/drawer.Tpo $(DEPDIR)/drawer.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='drawer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drawer.lo `test -f 'view/drawer.c' || echo '$(srcdir)/'`view/drawer.c + +ovBox.lo: view/ovBox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ovBox.lo -MD -MP -MF $(DEPDIR)/ovBox.Tpo -c -o ovBox.lo `test -f 'view/ovBox.c' || echo '$(srcdir)/'`view/ovBox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ovBox.Tpo $(DEPDIR)/ovBox.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='ovBox.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ovBox.lo `test -f 'view/ovBox.c' || echo '$(srcdir)/'`view/ovBox.c + +virt_viewer-virt-viewer-events.o: virt-viewer-events.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-events.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo -c -o virt_viewer-virt-viewer-events.o `test -f 'virt-viewer-events.c' || echo '$(srcdir)/'`virt-viewer-events.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-events.o `test -f 'virt-viewer-events.c' || echo '$(srcdir)/'`virt-viewer-events.c + +virt_viewer-virt-viewer-events.obj: virt-viewer-events.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-events.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo -c -o virt_viewer-virt-viewer-events.obj `if test -f 'virt-viewer-events.c'; then $(CYGPATH_W) 'virt-viewer-events.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-events.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-events.obj `if test -f 'virt-viewer-events.c'; then $(CYGPATH_W) 'virt-viewer-events.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-events.c'; fi` + +virt_viewer-virt-viewer.o: virt-viewer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer.Tpo -c -o virt_viewer-virt-viewer.o `test -f 'virt-viewer.c' || echo '$(srcdir)/'`virt-viewer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer.o `test -f 'virt-viewer.c' || echo '$(srcdir)/'`virt-viewer.c + +virt_viewer-virt-viewer.obj: virt-viewer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer.Tpo -c -o virt_viewer-virt-viewer.obj `if test -f 'virt-viewer.c'; then $(CYGPATH_W) 'virt-viewer.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer.obj `if test -f 'virt-viewer.c'; then $(CYGPATH_W) 'virt-viewer.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer.c'; fi` + virt_viewer-virt-viewer-main.o: virt-viewer-main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-main.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-main.Tpo -c -o virt_viewer-virt-viewer-main.o `test -f 'virt-viewer-main.c' || echo '$(srcdir)/'`virt-viewer-main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-main.Tpo $(DEPDIR)/virt_viewer-virt-viewer-main.Po @@ -480,262 +609,6 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-main.c' object='virt_viewer-virt-viewer-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-main.obj `if test -f 'virt-viewer-main.c'; then $(CYGPATH_W) 'virt-viewer-main.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-main.c'; fi` - -virt_viewer-virt-viewer.o: virt-viewer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer.Tpo -c -o virt_viewer-virt-viewer.o `test -f 'virt-viewer.c' || echo '$(srcdir)/'`virt-viewer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer.o `test -f 'virt-viewer.c' || echo '$(srcdir)/'`virt-viewer.c - -virt_viewer-virt-viewer.obj: virt-viewer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer.Tpo -c -o virt_viewer-virt-viewer.obj `if test -f 'virt-viewer.c'; then $(CYGPATH_W) 'virt-viewer.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer.obj `if test -f 'virt-viewer.c'; then $(CYGPATH_W) 'virt-viewer.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer.c'; fi` - -virt_viewer-virt-viewer-util.o: virt-viewer-util.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-util.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo -c -o virt_viewer-virt-viewer-util.o `test -f 'virt-viewer-util.c' || echo '$(srcdir)/'`virt-viewer-util.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo $(DEPDIR)/virt_viewer-virt-viewer-util.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-util.c' object='virt_viewer-virt-viewer-util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-util.o `test -f 'virt-viewer-util.c' || echo '$(srcdir)/'`virt-viewer-util.c - -virt_viewer-virt-viewer-util.obj: virt-viewer-util.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-util.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo -c -o virt_viewer-virt-viewer-util.obj `if test -f 'virt-viewer-util.c'; then $(CYGPATH_W) 'virt-viewer-util.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-util.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo $(DEPDIR)/virt_viewer-virt-viewer-util.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-util.c' object='virt_viewer-virt-viewer-util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-util.obj `if test -f 'virt-viewer-util.c'; then $(CYGPATH_W) 'virt-viewer-util.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-util.c'; fi` - -virt_viewer-virt-viewer-auth.o: virt-viewer-auth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-auth.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo -c -o virt_viewer-virt-viewer-auth.o `test -f 'virt-viewer-auth.c' || echo '$(srcdir)/'`virt-viewer-auth.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo $(DEPDIR)/virt_viewer-virt-viewer-auth.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-auth.c' object='virt_viewer-virt-viewer-auth.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-auth.o `test -f 'virt-viewer-auth.c' || echo '$(srcdir)/'`virt-viewer-auth.c - -virt_viewer-virt-viewer-auth.obj: virt-viewer-auth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-auth.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo -c -o virt_viewer-virt-viewer-auth.obj `if test -f 'virt-viewer-auth.c'; then $(CYGPATH_W) 'virt-viewer-auth.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-auth.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo $(DEPDIR)/virt_viewer-virt-viewer-auth.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-auth.c' object='virt_viewer-virt-viewer-auth.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-auth.obj `if test -f 'virt-viewer-auth.c'; then $(CYGPATH_W) 'virt-viewer-auth.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-auth.c'; fi` - -virt_viewer-virt-viewer-events.o: virt-viewer-events.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-events.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo -c -o virt_viewer-virt-viewer-events.o `test -f 'virt-viewer-events.c' || echo '$(srcdir)/'`virt-viewer-events.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-events.o `test -f 'virt-viewer-events.c' || echo '$(srcdir)/'`virt-viewer-events.c - -virt_viewer-virt-viewer-events.obj: virt-viewer-events.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-events.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo -c -o virt_viewer-virt-viewer-events.obj `if test -f 'virt-viewer-events.c'; then $(CYGPATH_W) 'virt-viewer-events.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-events.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-events.obj `if test -f 'virt-viewer-events.c'; then $(CYGPATH_W) 'virt-viewer-events.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-events.c'; fi` - -virt_viewer-virt-viewer-app.o: virt-viewer-app.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-app.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-app.Tpo -c -o virt_viewer-virt-viewer-app.o `test -f 'virt-viewer-app.c' || echo '$(srcdir)/'`virt-viewer-app.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-app.Tpo $(DEPDIR)/virt_viewer-virt-viewer-app.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-app.c' object='virt_viewer-virt-viewer-app.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-app.o `test -f 'virt-viewer-app.c' || echo '$(srcdir)/'`virt-viewer-app.c - -virt_viewer-virt-viewer-app.obj: virt-viewer-app.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-app.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-app.Tpo -c -o virt_viewer-virt-viewer-app.obj `if test -f 'virt-viewer-app.c'; then $(CYGPATH_W) 'virt-viewer-app.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-app.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-app.Tpo $(DEPDIR)/virt_viewer-virt-viewer-app.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-app.c' object='virt_viewer-virt-viewer-app.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-app.obj `if test -f 'virt-viewer-app.c'; then $(CYGPATH_W) 'virt-viewer-app.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-app.c'; fi` - -virt_viewer-virt-viewer-session.o: virt-viewer-session.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo -c -o virt_viewer-virt-viewer-session.o `test -f 'virt-viewer-session.c' || echo '$(srcdir)/'`virt-viewer-session.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session.c' object='virt_viewer-virt-viewer-session.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session.o `test -f 'virt-viewer-session.c' || echo '$(srcdir)/'`virt-viewer-session.c - -virt_viewer-virt-viewer-session.obj: virt-viewer-session.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo -c -o virt_viewer-virt-viewer-session.obj `if test -f 'virt-viewer-session.c'; then $(CYGPATH_W) 'virt-viewer-session.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session.c' object='virt_viewer-virt-viewer-session.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session.obj `if test -f 'virt-viewer-session.c'; then $(CYGPATH_W) 'virt-viewer-session.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session.c'; fi` - -virt_viewer-virt-viewer-display.o: virt-viewer-display.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo -c -o virt_viewer-virt-viewer-display.o `test -f 'virt-viewer-display.c' || echo '$(srcdir)/'`virt-viewer-display.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display.c' object='virt_viewer-virt-viewer-display.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display.o `test -f 'virt-viewer-display.c' || echo '$(srcdir)/'`virt-viewer-display.c - -virt_viewer-virt-viewer-display.obj: virt-viewer-display.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo -c -o virt_viewer-virt-viewer-display.obj `if test -f 'virt-viewer-display.c'; then $(CYGPATH_W) 'virt-viewer-display.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display.c' object='virt_viewer-virt-viewer-display.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display.obj `if test -f 'virt-viewer-display.c'; then $(CYGPATH_W) 'virt-viewer-display.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display.c'; fi` - -virt_viewer-virt-viewer-notebook.o: virt-viewer-notebook.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-notebook.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-notebook.Tpo -c -o virt_viewer-virt-viewer-notebook.o `test -f 'virt-viewer-notebook.c' || echo '$(srcdir)/'`virt-viewer-notebook.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-notebook.Tpo $(DEPDIR)/virt_viewer-virt-viewer-notebook.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-notebook.c' object='virt_viewer-virt-viewer-notebook.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-notebook.o `test -f 'virt-viewer-notebook.c' || echo '$(srcdir)/'`virt-viewer-notebook.c - -virt_viewer-virt-viewer-notebook.obj: virt-viewer-notebook.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-notebook.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-notebook.Tpo -c -o virt_viewer-virt-viewer-notebook.obj `if test -f 'virt-viewer-notebook.c'; then $(CYGPATH_W) 'virt-viewer-notebook.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-notebook.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-notebook.Tpo $(DEPDIR)/virt_viewer-virt-viewer-notebook.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-notebook.c' object='virt_viewer-virt-viewer-notebook.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-notebook.obj `if test -f 'virt-viewer-notebook.c'; then $(CYGPATH_W) 'virt-viewer-notebook.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-notebook.c'; fi` - -virt_viewer-virt-viewer-window.o: virt-viewer-window.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-window.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-window.Tpo -c -o virt_viewer-virt-viewer-window.o `test -f 'virt-viewer-window.c' || echo '$(srcdir)/'`virt-viewer-window.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-window.Tpo $(DEPDIR)/virt_viewer-virt-viewer-window.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-window.c' object='virt_viewer-virt-viewer-window.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-window.o `test -f 'virt-viewer-window.c' || echo '$(srcdir)/'`virt-viewer-window.c - -virt_viewer-virt-viewer-window.obj: virt-viewer-window.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-window.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-window.Tpo -c -o virt_viewer-virt-viewer-window.obj `if test -f 'virt-viewer-window.c'; then $(CYGPATH_W) 'virt-viewer-window.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-window.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-window.Tpo $(DEPDIR)/virt_viewer-virt-viewer-window.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-window.c' object='virt_viewer-virt-viewer-window.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-window.obj `if test -f 'virt-viewer-window.c'; then $(CYGPATH_W) 'virt-viewer-window.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-window.c'; fi` - -virt_viewer-autoDrawer.o: view/autoDrawer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-autoDrawer.o -MD -MP -MF $(DEPDIR)/virt_viewer-autoDrawer.Tpo -c -o virt_viewer-autoDrawer.o `test -f 'view/autoDrawer.c' || echo '$(srcdir)/'`view/autoDrawer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-autoDrawer.Tpo $(DEPDIR)/virt_viewer-autoDrawer.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='virt_viewer-autoDrawer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-autoDrawer.o `test -f 'view/autoDrawer.c' || echo '$(srcdir)/'`view/autoDrawer.c - -virt_viewer-autoDrawer.obj: view/autoDrawer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-autoDrawer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-autoDrawer.Tpo -c -o virt_viewer-autoDrawer.obj `if test -f 'view/autoDrawer.c'; then $(CYGPATH_W) 'view/autoDrawer.c'; else $(CYGPATH_W) '$(srcdir)/view/autoDrawer.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-autoDrawer.Tpo $(DEPDIR)/virt_viewer-autoDrawer.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='virt_viewer-autoDrawer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-autoDrawer.obj `if test -f 'view/autoDrawer.c'; then $(CYGPATH_W) 'view/autoDrawer.c'; else $(CYGPATH_W) '$(srcdir)/view/autoDrawer.c'; fi` - -virt_viewer-drawer.o: view/drawer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-drawer.o -MD -MP -MF $(DEPDIR)/virt_viewer-drawer.Tpo -c -o virt_viewer-drawer.o `test -f 'view/drawer.c' || echo '$(srcdir)/'`view/drawer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-drawer.Tpo $(DEPDIR)/virt_viewer-drawer.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='virt_viewer-drawer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-drawer.o `test -f 'view/drawer.c' || echo '$(srcdir)/'`view/drawer.c - -virt_viewer-drawer.obj: view/drawer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-drawer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-drawer.Tpo -c -o virt_viewer-drawer.obj `if test -f 'view/drawer.c'; then $(CYGPATH_W) 'view/drawer.c'; else $(CYGPATH_W) '$(srcdir)/view/drawer.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-drawer.Tpo $(DEPDIR)/virt_viewer-drawer.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='virt_viewer-drawer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-drawer.obj `if test -f 'view/drawer.c'; then $(CYGPATH_W) 'view/drawer.c'; else $(CYGPATH_W) '$(srcdir)/view/drawer.c'; fi` - -virt_viewer-ovBox.o: view/ovBox.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-ovBox.o -MD -MP -MF $(DEPDIR)/virt_viewer-ovBox.Tpo -c -o virt_viewer-ovBox.o `test -f 'view/ovBox.c' || echo '$(srcdir)/'`view/ovBox.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-ovBox.Tpo $(DEPDIR)/virt_viewer-ovBox.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='virt_viewer-ovBox.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-ovBox.o `test -f 'view/ovBox.c' || echo '$(srcdir)/'`view/ovBox.c - -virt_viewer-ovBox.obj: view/ovBox.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-ovBox.obj -MD -MP -MF $(DEPDIR)/virt_viewer-ovBox.Tpo -c -o virt_viewer-ovBox.obj `if test -f 'view/ovBox.c'; then $(CYGPATH_W) 'view/ovBox.c'; else $(CYGPATH_W) '$(srcdir)/view/ovBox.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-ovBox.Tpo $(DEPDIR)/virt_viewer-ovBox.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='virt_viewer-ovBox.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-ovBox.obj `if test -f 'view/ovBox.c'; then $(CYGPATH_W) 'view/ovBox.c'; else $(CYGPATH_W) '$(srcdir)/view/ovBox.c'; fi` - -virt_viewer-virt-viewer-session-vnc.o: virt-viewer-session-vnc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-vnc.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo -c -o virt_viewer-virt-viewer-session-vnc.o `test -f 'virt-viewer-session-vnc.c' || echo '$(srcdir)/'`virt-viewer-session-vnc.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-vnc.c' object='virt_viewer-virt-viewer-session-vnc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-vnc.o `test -f 'virt-viewer-session-vnc.c' || echo '$(srcdir)/'`virt-viewer-session-vnc.c - -virt_viewer-virt-viewer-session-vnc.obj: virt-viewer-session-vnc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-vnc.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo -c -o virt_viewer-virt-viewer-session-vnc.obj `if test -f 'virt-viewer-session-vnc.c'; then $(CYGPATH_W) 'virt-viewer-session-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-vnc.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-vnc.c' object='virt_viewer-virt-viewer-session-vnc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-vnc.obj `if test -f 'virt-viewer-session-vnc.c'; then $(CYGPATH_W) 'virt-viewer-session-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-vnc.c'; fi` - -virt_viewer-virt-viewer-display-vnc.o: virt-viewer-display-vnc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-vnc.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo -c -o virt_viewer-virt-viewer-display-vnc.o `test -f 'virt-viewer-display-vnc.c' || echo '$(srcdir)/'`virt-viewer-display-vnc.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-vnc.c' object='virt_viewer-virt-viewer-display-vnc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-vnc.o `test -f 'virt-viewer-display-vnc.c' || echo '$(srcdir)/'`virt-viewer-display-vnc.c - -virt_viewer-virt-viewer-display-vnc.obj: virt-viewer-display-vnc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-vnc.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo -c -o virt_viewer-virt-viewer-display-vnc.obj `if test -f 'virt-viewer-display-vnc.c'; then $(CYGPATH_W) 'virt-viewer-display-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-vnc.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-vnc.c' object='virt_viewer-virt-viewer-display-vnc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-vnc.obj `if test -f 'virt-viewer-display-vnc.c'; then $(CYGPATH_W) 'virt-viewer-display-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-vnc.c'; fi` - -virt_viewer-virt-viewer-session-spice.o: virt-viewer-session-spice.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-spice.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo -c -o virt_viewer-virt-viewer-session-spice.o `test -f 'virt-viewer-session-spice.c' || echo '$(srcdir)/'`virt-viewer-session-spice.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-spice.c' object='virt_viewer-virt-viewer-session-spice.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-spice.o `test -f 'virt-viewer-session-spice.c' || echo '$(srcdir)/'`virt-viewer-session-spice.c - -virt_viewer-virt-viewer-session-spice.obj: virt-viewer-session-spice.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-spice.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo -c -o virt_viewer-virt-viewer-session-spice.obj `if test -f 'virt-viewer-session-spice.c'; then $(CYGPATH_W) 'virt-viewer-session-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-spice.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-spice.c' object='virt_viewer-virt-viewer-session-spice.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-spice.obj `if test -f 'virt-viewer-session-spice.c'; then $(CYGPATH_W) 'virt-viewer-session-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-spice.c'; fi` - -virt_viewer-virt-viewer-display-spice.o: virt-viewer-display-spice.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-spice.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo -c -o virt_viewer-virt-viewer-display-spice.o `test -f 'virt-viewer-display-spice.c' || echo '$(srcdir)/'`virt-viewer-display-spice.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-spice.c' object='virt_viewer-virt-viewer-display-spice.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-spice.o `test -f 'virt-viewer-display-spice.c' || echo '$(srcdir)/'`virt-viewer-display-spice.c - -virt_viewer-virt-viewer-display-spice.obj: virt-viewer-display-spice.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-spice.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo -c -o virt_viewer-virt-viewer-display-spice.obj `if test -f 'virt-viewer-display-spice.c'; then $(CYGPATH_W) 'virt-viewer-display-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-spice.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-spice.c' object='virt_viewer-virt-viewer-display-spice.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-spice.obj `if test -f 'virt-viewer-display-spice.c'; then $(CYGPATH_W) 'virt-viewer-display-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-spice.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -847,7 +720,7 @@ done check-am: all-am check: check-am -all-am: Makefile $(PROGRAMS) $(DATA) +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -879,7 +752,8 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -950,19 +824,19 @@ .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-builderxmlDATA install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-builderxmlDATA + clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-builderxmlDATA install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-builderxmlDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/src/remote-viewer-main.c b/src/remote-viewer-main.c new file mode 100644 index 0000000..f0c4efa --- /dev/null +++ b/src/remote-viewer-main.c @@ -0,0 +1,170 @@ +/* + * Remote Viewer: A spice/vnc client based on virt-viewer + * + * Copyright (C) 2011-2012 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Marc-André Lureau + */ + +#include +#include +#include +#include +#include + +#ifdef HAVE_GTK_VNC +#include +#endif +#ifdef HAVE_SPICE_GTK +#include +#endif + +#include "remote-viewer.h" +#include "virt-viewer-app.h" + +static void +remote_viewer_version(void) +{ + g_print(_("remote-viewer version %s\n"), VERSION); + exit(EXIT_SUCCESS); +} + +int +main(int argc, char **argv) +{ + GOptionContext *context; + GError *error = NULL; + int ret = 1; + int zoom = 100; + gchar **args = NULL; + gboolean verbose = FALSE; + gboolean debug = FALSE; + gboolean direct = FALSE; + gboolean fullscreen = FALSE; + RemoteViewer *viewer = NULL; +#if HAVE_SPICE_GTK + gboolean controller = FALSE; +#endif + VirtViewerApp *app; + const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options"); + const GOptionEntry options [] = { + { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + remote_viewer_version, N_("Display version information"), NULL }, + { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, + N_("Display verbose information"), NULL }, + { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct, + N_("Direct connection with no automatic tunnels"), NULL }, + { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom, + N_("Zoom level of window, in percentage"), "ZOOM" }, + { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug, + N_("Display debugging information"), NULL }, + { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen, + N_("Open in full screen mode"), NULL }, +#if HAVE_SPICE_GTK + { "spice-controller", '\0', 0, G_OPTION_ARG_NONE, &controller, + N_("Open connection using Spice controller communication"), NULL }, +#endif + { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args, + NULL, "URI" }, + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } + }; + + setlocale(LC_ALL, ""); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + textdomain(GETTEXT_PACKAGE); + + /* Setup command line options */ + context = g_option_context_new (_("- Remote viewer client")); + g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); +#ifdef HAVE_GTK_VNC + g_option_context_add_group (context, vnc_display_get_option_group ()); +#endif +#ifdef HAVE_SPICE_GTK + g_option_context_add_group (context, spice_get_option_group ()); +#endif + g_option_context_parse (context, &argc, &argv, &error); + if (error) { + g_printerr("%s\n%s\n", + error->message, + gettext(help_msg)); + g_error_free(error); + goto cleanup; + } + + g_option_context_free(context); + + if ((!args || (g_strv_length(args) != 1)) +#if HAVE_SPICE_GTK + && !controller +#endif + ) { + g_printerr(_("\nUsage: %s [OPTIONS] URI\n\n%s\n\n"), argv[0], help_msg); + goto cleanup; + } + + if (zoom < 10 || zoom > 200) { + g_printerr(_("Zoom level must be within 10-200\n")); + goto cleanup; + } + + gtk_window_set_default_icon_name("virt-viewer"); + + virt_viewer_app_set_debug(debug); + +#if HAVE_SPICE_GTK + if (controller) { + viewer = remote_viewer_new_with_controller(verbose); + g_object_set(viewer, "guest-name", "defined by Spice controller", NULL); + } else { +#endif + viewer = remote_viewer_new(args[0], verbose); + g_object_set(viewer, "guest-name", args[0], NULL); +#if HAVE_SPICE_GTK + } +#endif + if (viewer == NULL) + goto cleanup; + + app = VIRT_VIEWER_APP(viewer); + g_object_set(app, "fullscreen", fullscreen, NULL); + virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom); + virt_viewer_app_set_direct(app, direct); + + if (!virt_viewer_app_start(app)) + goto cleanup; + + gtk_main(); + + ret = 0; + + cleanup: + if (viewer) + g_object_unref(viewer); + g_strfreev(args); + + return ret; +} + +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/remote-viewer.c b/src/remote-viewer.c new file mode 100644 index 0000000..1fddad4 --- /dev/null +++ b/src/remote-viewer.c @@ -0,0 +1,503 @@ +/* + * Virt Viewer: A virtual machine console viewer + * + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange + * Copyright (C) 2010 Marc-André Lureau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Marc-André Lureau + */ + +#include +#include +#include +#include + +#ifdef HAVE_SPICE_GTK +#include +#endif + +#ifdef HAVE_SPICE_GTK +#include "virt-viewer-session-spice.h" +#endif +#include "virt-viewer-app.h" +#include "remote-viewer.h" + +struct _RemoteViewerPrivate { +#ifdef HAVE_SPICE_GTK + SpiceCtrlController *controller; +#endif + GtkWidget *controller_menu; +}; + +G_DEFINE_TYPE (RemoteViewer, remote_viewer, VIRT_VIEWER_TYPE_APP) +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), REMOTE_VIEWER_TYPE, RemoteViewerPrivate)) + +#if HAVE_SPICE_GTK +enum { + PROP_0, + PROP_CONTROLLER, +}; +#endif + +static gboolean remote_viewer_start(VirtViewerApp *self); +#if HAVE_SPICE_GTK +static int remote_viewer_activate(VirtViewerApp *self); +#endif +static void remote_viewer_window_added(VirtViewerApp *self, VirtViewerWindow *win); + +#if HAVE_SPICE_GTK +static void +remote_viewer_get_property (GObject *object, guint property_id, + GValue *value, GParamSpec *pspec) +{ + RemoteViewer *self = REMOTE_VIEWER(object); + RemoteViewerPrivate *priv = self->priv; + + switch (property_id) { + case PROP_CONTROLLER: + g_value_set_object(value, priv->controller); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +remote_viewer_set_property (GObject *object, guint property_id, + const GValue *value, GParamSpec *pspec) +{ + RemoteViewer *self = REMOTE_VIEWER(object); + RemoteViewerPrivate *priv = self->priv; + + switch (property_id) { + case PROP_CONTROLLER: + g_return_if_fail(priv->controller == NULL); + priv->controller = g_value_dup_object(value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +remote_viewer_dispose (GObject *object) +{ + RemoteViewer *self = REMOTE_VIEWER(object); + RemoteViewerPrivate *priv = self->priv; + + if (priv->controller) { + g_object_unref(priv->controller); + priv->controller = NULL; + } + + G_OBJECT_CLASS(remote_viewer_parent_class)->dispose (object); +} +#endif + + +static void +remote_viewer_class_init (RemoteViewerClass *klass) +{ +#if HAVE_SPICE_GTK + GObjectClass *object_class = G_OBJECT_CLASS (klass); +#endif + VirtViewerAppClass *app_class = VIRT_VIEWER_APP_CLASS (klass); + + g_type_class_add_private (klass, sizeof (RemoteViewerPrivate)); + +#if HAVE_SPICE_GTK + object_class->get_property = remote_viewer_get_property; + object_class->set_property = remote_viewer_set_property; + object_class->dispose = remote_viewer_dispose; +#endif + + app_class->start = remote_viewer_start; +#if HAVE_SPICE_GTK + app_class->activate = remote_viewer_activate; +#endif + app_class->window_added = remote_viewer_window_added; + +#if HAVE_SPICE_GTK + g_object_class_install_property(object_class, + PROP_CONTROLLER, + g_param_spec_object("controller", + "Controller", + "Spice controller", + SPICE_CTRL_TYPE_CONTROLLER, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); +#endif +} + +static void +remote_viewer_init(RemoteViewer *self) +{ + self->priv = GET_PRIVATE(self); +} + +RemoteViewer * +remote_viewer_new(const gchar *uri, gboolean verbose) +{ + return g_object_new(REMOTE_VIEWER_TYPE, + "guri", uri, + "verbose", verbose, + NULL); +} + +#if HAVE_SPICE_GTK +RemoteViewer * +remote_viewer_new_with_controller(gboolean verbose) +{ + RemoteViewer *self; + SpiceCtrlController *ctrl = spice_ctrl_controller_new(); + + self = g_object_new(REMOTE_VIEWER_TYPE, + "controller", ctrl, + "verbose", verbose, + NULL); + g_object_unref(ctrl); + + return self; +} + +static void +spice_ctrl_do_connect(SpiceCtrlController *ctrl G_GNUC_UNUSED, + VirtViewerApp *self) +{ + if (virt_viewer_app_initial_connect(self) < 0) { + virt_viewer_app_simple_message_dialog(self, _("Failed to initiate connection")); + } +} + +static void +spice_ctrl_show(SpiceCtrlController *ctrl G_GNUC_UNUSED, RemoteViewer *self) +{ + virt_viewer_app_show_display(VIRT_VIEWER_APP(self)); +} + +static void +spice_ctrl_hide(SpiceCtrlController *ctrl G_GNUC_UNUSED, RemoteViewer *self) +{ + virt_viewer_app_show_status(VIRT_VIEWER_APP(self), _("Display disabled by controller")); +} + +static void +spice_menuitem_activate_cb(GtkMenuItem *mi, RemoteViewer *self) +{ + SpiceCtrlMenuItem *menuitem = g_object_get_data(G_OBJECT(mi), "spice-menuitem"); + + g_return_if_fail(menuitem != NULL); + if (gtk_menu_item_get_submenu(mi)) + return; + + spice_ctrl_controller_menu_item_click_msg(self->priv->controller, menuitem->id); +} + +static GtkWidget * +ctrlmenu_to_gtkmenu (RemoteViewer *self, SpiceCtrlMenu *ctrlmenu) +{ + GList *l; + GtkWidget *menu = gtk_menu_new(); + guint n = 0; + + for (l = ctrlmenu->items; l != NULL; l = l->next) { + SpiceCtrlMenuItem *menuitem = l->data; + GtkWidget *item; + char *s; + if (menuitem->text == NULL) { + g_warn_if_reached(); + continue; + } + + for (s = menuitem->text; *s; s++) + if (*s == '&') + *s = '_'; + + if (g_str_equal(menuitem->text, "-")){ + item = gtk_separator_menu_item_new(); + } else { + item = gtk_menu_item_new_with_mnemonic(menuitem->text); + } + + g_object_set_data_full(G_OBJECT(item), "spice-menuitem", + g_object_ref(menuitem), g_object_unref); + g_signal_connect(item, "activate", G_CALLBACK(spice_menuitem_activate_cb), self); + gtk_menu_attach(GTK_MENU (menu), item, 0, 1, n, n + 1); + n += 1; + + if (menuitem->submenu) { + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), + ctrlmenu_to_gtkmenu(self, menuitem->submenu)); + } + } + + if (n == 0) { + g_object_ref_sink(menu); + g_object_unref(menu); + menu = NULL; + } + + gtk_widget_show_all(menu); + return menu; +} + +static void +spice_menu_set_visible(gpointer key G_GNUC_UNUSED, + gpointer value, + gpointer user_data) +{ + gboolean visible = GPOINTER_TO_INT(user_data); + GtkWidget *menu = g_object_get_data(value, "spice-menu"); + + gtk_widget_set_visible(menu, visible); +} + +static void +remote_viewer_window_spice_menu_set_visible(RemoteViewer *self, + gboolean visible) +{ + GHashTable *windows = virt_viewer_app_get_windows(VIRT_VIEWER_APP(self)); + + g_hash_table_foreach(windows, spice_menu_set_visible, GINT_TO_POINTER(visible)); +} + +static void +spice_menu_update(gpointer key G_GNUC_UNUSED, + gpointer value, + gpointer user_data) +{ + RemoteViewer *self = REMOTE_VIEWER(user_data); + GtkWidget *menuitem = g_object_get_data(value, "spice-menu"); + SpiceCtrlMenu *menu; + + g_object_get(self->priv->controller, "menu", &menu, NULL); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), ctrlmenu_to_gtkmenu(self, menu)); + g_object_unref(menu); +} + +static void +spice_ctrl_menu_updated(RemoteViewer *self, + SpiceCtrlMenu *menu) +{ + GHashTable *windows = virt_viewer_app_get_windows(VIRT_VIEWER_APP(self)); + RemoteViewerPrivate *priv = self->priv; + gboolean visible; + + DEBUG_LOG("Spice controller menu updated"); + + if (priv->controller_menu != NULL) { + g_object_unref (priv->controller_menu); + priv->controller_menu = NULL; + } + + if (menu && g_list_length(menu->items) > 0) { + priv->controller_menu = ctrlmenu_to_gtkmenu(self, menu); + g_hash_table_foreach(windows, spice_menu_update, self); + } + + visible = priv->controller_menu != NULL; + + remote_viewer_window_spice_menu_set_visible(self, visible); +} + +static SpiceSession * +remote_viewer_get_spice_session(RemoteViewer *self) +{ + VirtViewerSession *vsession = NULL; + SpiceSession *session = NULL; + + g_object_get(self, "session", &vsession, NULL); + g_return_val_if_fail(vsession != NULL, NULL); + + g_object_get(vsession, "spice-session", &session, NULL); + + g_object_unref(vsession); + + return session; +} + +#ifndef G_VALUE_INIT /* see bug https://bugzilla.gnome.org/show_bug.cgi?id=654793 */ +#define G_VALUE_INIT { 0, { { 0 } } } +#endif + +static void +spice_ctrl_notified(SpiceCtrlController *ctrl, + GParamSpec *pspec, + RemoteViewer *self) +{ + SpiceSession *session = remote_viewer_get_spice_session(self); + GValue value = G_VALUE_INIT; + VirtViewerApp *app = VIRT_VIEWER_APP(self); + + g_return_if_fail(session != NULL); + + g_value_init(&value, pspec->value_type); + g_object_get_property(G_OBJECT(ctrl), pspec->name, &value); + + if (g_str_equal(pspec->name, "host") || + g_str_equal(pspec->name, "port") || + g_str_equal(pspec->name, "password") || + g_str_equal(pspec->name, "ca-file")) { + g_object_set_property(G_OBJECT(session), pspec->name, &value); + } else if (g_str_equal(pspec->name, "sport")) { + g_object_set_property(G_OBJECT(session), "tls-port", &value); + } else if (g_str_equal(pspec->name, "tls-ciphers")) { + g_object_set_property(G_OBJECT(session), "ciphers", &value); + } else if (g_str_equal(pspec->name, "host-subject")) { + g_object_set_property(G_OBJECT(session), "cert-subject", &value); + } else if (g_str_equal(pspec->name, "title")) { + g_object_set_property(G_OBJECT(app), "title", &value); + } else if (g_str_equal(pspec->name, "display-flags")) { + guint flags = g_value_get_uint(&value); + gboolean fullscreen = flags & CONTROLLER_SET_FULL_SCREEN; + gboolean auto_res = flags & CONTROLLER_AUTO_DISPLAY_RES; + g_object_set(G_OBJECT(self), "fullscreen", fullscreen, NULL); + g_debug("unimplemented resize-guest %d", auto_res); + /* g_object_set(G_OBJECT(self), "resize-guest", auto_res, NULL); */ + } else if (g_str_equal(pspec->name, "menu")) { + spice_ctrl_menu_updated(self, g_value_get_object(&value)); + } else { + gchar *content = g_strdup_value_contents(&value); + + g_debug("unimplemented property: %s=%s", pspec->name, content); + g_free(content); + } + + g_object_unref(session); + g_value_unset(&value); +} + +static void +spice_ctrl_listen_async_cb(GObject *object, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + + spice_ctrl_controller_listen_finish(SPICE_CTRL_CONTROLLER(object), res, &error); + + if (error != NULL) { + virt_viewer_app_simple_message_dialog(VIRT_VIEWER_APP(user_data), + _("Controller connection failed: %s"), + error->message); + g_clear_error(&error); + exit(EXIT_FAILURE); /* TODO: make start async? */ + } +} + + +static int +remote_viewer_activate(VirtViewerApp *app) +{ + g_return_val_if_fail(REMOTE_VIEWER_IS(app), -1); + RemoteViewer *self = REMOTE_VIEWER(app); + int ret = -1; + + if (self->priv->controller) { + SpiceSession *session = remote_viewer_get_spice_session(self); + ret = spice_session_connect(session); + g_object_unref(session); + } else { + ret = VIRT_VIEWER_APP_CLASS(remote_viewer_parent_class)->activate(app); + } + + return ret; +} +#endif + +static void +remote_viewer_window_added(VirtViewerApp *self G_GNUC_UNUSED, + VirtViewerWindow *win) +{ + GtkMenuShell *shell = GTK_MENU_SHELL(gtk_builder_get_object(virt_viewer_window_get_builder(win), "top-menu")); + GtkWidget *spice = gtk_menu_item_new_with_label("Spice"); + + gtk_menu_shell_append(shell, spice); + g_object_set_data(G_OBJECT(win), "spice-menu", spice); +} + +static gboolean +remote_viewer_start(VirtViewerApp *app) +{ + g_return_val_if_fail(REMOTE_VIEWER_IS(app), FALSE); + +#if HAVE_SPICE_GTK + RemoteViewer *self = REMOTE_VIEWER(app); + RemoteViewerPrivate *priv = self->priv; +#endif + gboolean ret = FALSE; + gchar *guri = NULL; + gchar *type = NULL; + +#if HAVE_SPICE_GTK + if (priv->controller) { + if (virt_viewer_app_create_session(app, "spice") < 0) { + virt_viewer_app_simple_message_dialog(app, _("Couldn't create a Spice session")); + goto cleanup; + } + + g_signal_connect(priv->controller, "notify", G_CALLBACK(spice_ctrl_notified), self); + g_signal_connect(priv->controller, "do_connect", G_CALLBACK(spice_ctrl_do_connect), self); + g_signal_connect(priv->controller, "show", G_CALLBACK(spice_ctrl_show), self); + g_signal_connect(priv->controller, "hide", G_CALLBACK(spice_ctrl_hide), self); + + spice_ctrl_controller_listen(priv->controller, NULL, spice_ctrl_listen_async_cb, self); + virt_viewer_app_show_status(VIRT_VIEWER_APP(self), _("Setting up Spice session...")); + } else { +#endif + g_object_get(app, "guri", &guri, NULL); + g_return_val_if_fail(guri != NULL, FALSE); + + DEBUG_LOG("Opening display to %s", guri); + g_object_set(app, "title", guri, NULL); + + if (virt_viewer_util_extract_host(guri, &type, NULL, NULL, NULL, NULL) < 0) { + virt_viewer_app_simple_message_dialog(app, _("Cannot determine the connection type from URI")); + goto cleanup; + } + + if (virt_viewer_app_create_session(app, type) < 0) { + virt_viewer_app_simple_message_dialog(app, _("Couldn't create a session for this type: %s"), type); + goto cleanup; + } + + if (virt_viewer_app_initial_connect(app) < 0) { + virt_viewer_app_simple_message_dialog(app, _("Failed to initiate connection")); + goto cleanup; + } +#if HAVE_SPICE_GTK + } +#endif + + ret = VIRT_VIEWER_APP_CLASS(remote_viewer_parent_class)->start(app); + + cleanup: + g_free(guri); + g_free(type); + return ret; +} + +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/remote-viewer.h b/src/remote-viewer.h new file mode 100644 index 0000000..a465b7e --- /dev/null +++ b/src/remote-viewer.h @@ -0,0 +1,63 @@ +/* + * Virt Viewer: A virtual machine console viewer + * + * Copyright (C) 2007-2012 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Daniel P. Berrange + */ + +#ifndef REMOTE_VIEWER_H +#define REMOTE_VIEWER_H + +#include +#include "virt-viewer-app.h" + +G_BEGIN_DECLS + +#define REMOTE_VIEWER_TYPE remote_viewer_get_type() +#define REMOTE_VIEWER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), REMOTE_VIEWER_TYPE, RemoteViewer)) +#define REMOTE_VIEWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), REMOTE_VIEWER_TYPE, RemoteViewerClass)) +#define REMOTE_VIEWER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), REMOTE_VIEWER_TYPE)) +#define REMOTE_VIEWER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), REMOTE_VIEWER_TYPE)) +#define REMOTE_VIEWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REMOTE_VIEWER_TYPE, RemoteViewerClass)) + +typedef struct _RemoteViewerPrivate RemoteViewerPrivate; + +typedef struct { + VirtViewerApp parent; + RemoteViewerPrivate *priv; +} RemoteViewer; + +typedef struct { + VirtViewerAppClass parent_class; +} RemoteViewerClass; + +GType remote_viewer_get_type (void); + +RemoteViewer* remote_viewer_new(const gchar *uri, gboolean verbose); +RemoteViewer* remote_viewer_new_with_controller(gboolean verbose); + +G_END_DECLS + +#endif /* REMOTE_VIEWER_H */ +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/view/autoDrawer.c b/src/view/autoDrawer.c index 6fa5483..b0c5028 100644 --- a/src/view/autoDrawer.c +++ b/src/view/autoDrawer.c @@ -29,6 +29,7 @@ * moused-over and auto-closes when the mouse leaves. */ +#include #include "autoDrawer.h" @@ -257,7 +258,7 @@ } #else if (window->group && window->group->grabs) { - grabbed = GTK_WIDGET(window->group->grabs->data); + grabbed = GTK_WIDGET(window->group->grabs->data); } #endif if (!grabbed) { @@ -440,7 +441,7 @@ static void ViewAutoDrawerOnHierarchyChanged(ViewAutoDrawer *that, // IN - GtkWidget *oldToplevel) // IN + GtkWidget *oldToplevel) // IN { GtkWidget *newToplevel = gtk_widget_get_toplevel(GTK_WIDGET(that)); @@ -653,7 +654,7 @@ ovBoxClass->set_over = ViewAutoDrawerSetOver; - g_type_class_add_private(objectClass, sizeof(ViewAutoDrawerPrivate)); + g_type_class_add_private(klass, sizeof(ViewAutoDrawerPrivate)); } @@ -689,7 +690,7 @@ sizeof (ViewAutoDrawer), 0, /* n_preallocs */ (GInstanceInitFunc)ViewAutoDrawerInit, - NULL, + NULL, }; type = g_type_register_static(VIEW_TYPE_DRAWER, "ViewAutoDrawer", &info, 0); diff --git a/src/view/drawer.c b/src/view/drawer.c index 43b7e1a..40b71dd 100644 --- a/src/view/drawer.c +++ b/src/view/drawer.c @@ -28,6 +28,7 @@ * sliding smoothly, at constant speed, over another one. */ +#include #include "drawer.h" @@ -139,7 +140,7 @@ objectClass->finalize = ViewDrawerFinalize; - g_type_class_add_private(objectClass, sizeof(ViewDrawerPrivate)); + g_type_class_add_private(klass, sizeof(ViewDrawerPrivate)); } @@ -175,7 +176,7 @@ sizeof (ViewDrawer), 0, /* n_preallocs */ (GInstanceInitFunc)ViewDrawerInit, - NULL + NULL }; type = g_type_register_static(VIEW_TYPE_OV_BOX, "ViewDrawer", &info, 0); diff --git a/src/view/ovBox.c b/src/view/ovBox.c index 5d8355e..10cf142 100644 --- a/src/view/ovBox.c +++ b/src/view/ovBox.c @@ -72,13 +72,14 @@ * --hpreg */ +#include #include "ovBox.h" #if ! GTK_CHECK_VERSION(3, 0, 0) -#define gtk_widget_set_realized(widget, val) \ +#define gtk_widget_set_realized(widget, val) \ GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED) -#define gtk_widget_get_realized(widget) \ +#define gtk_widget_get_realized(widget) \ GTK_WIDGET_REALIZED(widget) #endif @@ -706,10 +707,8 @@ static void ViewOvBoxClassInit(ViewOvBoxClass *klass) // IN { - GObjectClass *objectClass; GtkWidgetClass *widgetClass; - objectClass = G_OBJECT_CLASS(klass); widgetClass = GTK_WIDGET_CLASS(klass); widgetClass->map = ViewOvBoxMap; @@ -729,7 +728,7 @@ parentClass = g_type_class_peek_parent(klass); - g_type_class_add_private(objectClass, sizeof(ViewOvBoxPrivate)); + g_type_class_add_private(klass, sizeof(ViewOvBoxPrivate)); } @@ -765,7 +764,7 @@ sizeof (ViewOvBox), 0, /* n_preallocs */ (GInstanceInitFunc)ViewOvBoxInit, - NULL, + NULL, }; type = g_type_register_static(GTK_TYPE_BOX, "ViewOvBox", &info, 0); diff --git a/src/virt-viewer-about.xml b/src/virt-viewer-about.xml index 01ac17c..e9ae52a 100644 --- a/src/virt-viewer-about.xml +++ b/src/virt-viewer-about.xml @@ -1,16 +1,20 @@ - + - + False 5 About Glade False + True center-on-parent + True dialog + True + True Virtual Machine Viewer - Copyright 2007-2011 Daniel P. Berrange -Copyright 2007-2011 Red Hat, Inc. + Copyright (C) 2007-2012 Daniel P. Berrange +Copyright (C) 2007-2012 Red Hat, Inc. A remote desktop client built with GTK-VNC, SPICE-GTK and libvirt http://virt-manager.org/ virt-manager.org @@ -32,25 +36,30 @@ Marc-André Lureau The Fedora Translation Team - - + virt-viewer + + - + True + False + vertical 2 - - - - + True + False end False + True end 0 + + + diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index 3b468b3..985edca 100644 --- a/src/virt-viewer-app.c +++ b/src/virt-viewer-app.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -70,209 +70,228 @@ /* Internal methods */ static void virt_viewer_app_connected(VirtViewerSession *session, - VirtViewerApp *self); + VirtViewerApp *self); static void virt_viewer_app_initialized(VirtViewerSession *session, - VirtViewerApp *self); + VirtViewerApp *self); static void virt_viewer_app_disconnected(VirtViewerSession *session, - VirtViewerApp *self); + VirtViewerApp *self); static void virt_viewer_app_auth_refused(VirtViewerSession *session, - const char *msg, - VirtViewerApp *self); + const char *msg, + VirtViewerApp *self); static void virt_viewer_app_auth_failed(VirtViewerSession *session, - const char *msg, - VirtViewerApp *self); + const char *msg, + VirtViewerApp *self); +static void virt_viewer_app_usb_failed(VirtViewerSession *session, + const char *msg, + VirtViewerApp *self); static void virt_viewer_app_server_cut_text(VirtViewerSession *session, - const gchar *text, - VirtViewerApp *self); + const gchar *text, + VirtViewerApp *self); static void virt_viewer_app_bell(VirtViewerSession *session, - VirtViewerApp *self); + VirtViewerApp *self); + +static void virt_viewer_app_cancelled(VirtViewerSession *session, + VirtViewerApp *self); static void virt_viewer_app_channel_open(VirtViewerSession *session, - VirtViewerSessionChannel *channel, - VirtViewerApp *self); + VirtViewerSessionChannel *channel, + VirtViewerApp *self); static void virt_viewer_app_update_pretty_address(VirtViewerApp *self); static void virt_viewer_app_set_fullscreen(VirtViewerApp *self, gboolean fullscreen); static void virt_viewer_app_update_menu_displays(VirtViewerApp *self); struct _VirtViewerAppPrivate { - VirtViewerWindow *main_window; - GtkWidget *main_notebook; - GtkWidget *container; - GHashTable *windows; - gchar *clipboard; - - gboolean direct; - gboolean verbose; - gboolean authretry; - gboolean started; - gboolean fullscreen; - - VirtViewerSession *session; - gboolean active; - gboolean connected; - guint reconnect_poll; /* source id */ - char *unixsock; - char *ghost; - char *gport; - char *host; /* ssh */ - int port;/* ssh */ - char *user; /* ssh */ - char *transport; - char *pretty_address; - gchar *guest_name; - gboolean grabbed; - char *title; + VirtViewerWindow *main_window; + GtkWidget *main_notebook; + GtkWidget *container; + GHashTable *windows; + gchar *clipboard; + + gboolean direct; + gboolean verbose; + gboolean authretry; + gboolean started; + gboolean fullscreen; + gboolean attach; + + VirtViewerSession *session; + gboolean active; + gboolean connected; + gboolean cancelled; + guint reconnect_poll; /* source id */ + char *unixsock; + char *guri; /* prefered over ghost:gport */ + char *ghost; + char *gport; + char *gtlsport; + char *host; /* ssh */ + int port;/* ssh */ + char *user; /* ssh */ + char *transport; + char *pretty_address; + gchar *guest_name; + gboolean grabbed; + char *title; }; G_DEFINE_ABSTRACT_TYPE(VirtViewerApp, virt_viewer_app, G_TYPE_OBJECT) -#define GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_APP, VirtViewerAppPrivate)) +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_APP, VirtViewerAppPrivate)) enum { - PROP_0, - PROP_VERBOSE, - PROP_CONTAINER, - PROP_SESSION, - PROP_GUEST_NAME, - PROP_FULLSCREEN, - PROP_TITLE, + PROP_0, + PROP_VERBOSE, + PROP_CONTAINER, + PROP_SESSION, + PROP_GUEST_NAME, + PROP_GURI, + PROP_FULLSCREEN, + PROP_TITLE, }; + +enum { + SIGNAL_WINDOW_ADDED, + SIGNAL_WINDOW_REMOVED, + SIGNAL_LAST, +}; + +static guint signals[SIGNAL_LAST]; void virt_viewer_app_set_debug(gboolean debug) { - doDebug = debug; + doDebug = debug; } void virt_viewer_app_simple_message_dialog(VirtViewerApp *self, - const char *fmt, ...) -{ - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - GtkWindow *window = GTK_WINDOW(virt_viewer_window_get_window(self->priv->main_window)); - GtkWidget *dialog; - char *msg; - va_list vargs; - - va_start(vargs, fmt); - - msg = g_strdup_vprintf(fmt, vargs); - - va_end(vargs); - - dialog = gtk_message_dialog_new(window, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s", - msg); - - gtk_dialog_run(GTK_DIALOG(dialog)); - - gtk_widget_destroy(dialog); - - g_free(msg); + const char *fmt, ...) +{ + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + GtkWindow *window = GTK_WINDOW(virt_viewer_window_get_window(self->priv->main_window)); + GtkWidget *dialog; + char *msg; + va_list vargs; + + va_start(vargs, fmt); + + msg = g_strdup_vprintf(fmt, vargs); + + va_end(vargs); + + dialog = gtk_message_dialog_new(window, + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", + msg); + + gtk_dialog_run(GTK_DIALOG(dialog)); + + gtk_widget_destroy(dialog); + + g_free(msg); } void virt_viewer_app_quit(VirtViewerApp *self) { - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - VirtViewerAppPrivate *priv = self->priv; - - if (priv->session) - virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session)); - gtk_main_quit(); + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + VirtViewerAppPrivate *priv = self->priv; + + if (priv->session) + virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session)); + gtk_main_quit(); } static void count_window_visible(gpointer key G_GNUC_UNUSED, - gpointer value, - gpointer user_data) -{ - GtkWindow *win = virt_viewer_window_get_window(VIRT_VIEWER_WINDOW(value)); - guint *n = (guint*)user_data; - - if (gtk_widget_get_visible(GTK_WIDGET(win))) - *n += 1; + gpointer value, + gpointer user_data) +{ + GtkWindow *win = virt_viewer_window_get_window(VIRT_VIEWER_WINDOW(value)); + guint *n = (guint*)user_data; + + if (gtk_widget_get_visible(GTK_WIDGET(win))) + *n += 1; } static guint virt_viewer_app_get_n_windows_visible(VirtViewerApp *self) { - guint n = 0; - g_hash_table_foreach(self->priv->windows, count_window_visible, &n); - return n; + guint n = 0; + g_hash_table_foreach(self->priv->windows, count_window_visible, &n); + return n; } static guint virt_viewer_app_get_n_windows(VirtViewerApp *self) { - return g_hash_table_size(self->priv->windows); + return g_hash_table_size(self->priv->windows); } gboolean virt_viewer_app_window_set_visible(VirtViewerApp *self, - VirtViewerWindow *vwin, - gboolean visible) -{ - GtkWidget *window; - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); - g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(vwin), FALSE); - - window = GTK_WIDGET(virt_viewer_window_get_window(vwin)); - if (visible) { - gtk_widget_show(window); - return TRUE; - } else { - if (virt_viewer_app_get_n_windows_visible(self) > 1) { - gtk_widget_hide(window); - return FALSE; - } else if (virt_viewer_app_get_n_windows(self) > 1) { - GtkWidget *dialog = - gtk_message_dialog_new (GTK_WINDOW(window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_OK_CANCEL, - _("This is the last visible display. Do you want to quit?")); - gint result = gtk_dialog_run (GTK_DIALOG (dialog)); - switch (result) { - case GTK_RESPONSE_OK: - virt_viewer_app_quit(self); - break; - default: - break; - } - gtk_widget_destroy(dialog); - return FALSE; - } else { - virt_viewer_app_quit(self); - return FALSE; - } - } - - g_warn_if_reached(); - return FALSE; + VirtViewerWindow *vwin, + gboolean visible) +{ + GtkWidget *window; + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); + g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(vwin), FALSE); + + window = GTK_WIDGET(virt_viewer_window_get_window(vwin)); + if (visible) { + gtk_widget_show(window); + return TRUE; + } else { + if (virt_viewer_app_get_n_windows_visible(self) > 1) { + gtk_widget_hide(window); + return FALSE; + } else if (virt_viewer_app_get_n_windows(self) > 1) { + GtkWidget *dialog = + gtk_message_dialog_new (GTK_WINDOW(window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_OK_CANCEL, + _("This is the last visible display. Do you want to quit?")); + gint result = gtk_dialog_run (GTK_DIALOG (dialog)); + switch (result) { + case GTK_RESPONSE_OK: + virt_viewer_app_quit(self); + break; + default: + break; + } + gtk_widget_destroy(dialog); + return FALSE; + } else { + virt_viewer_app_quit(self); + return FALSE; + } + } + + g_warn_if_reached(); + return FALSE; } G_MODULE_EXPORT void virt_viewer_app_about_close(GtkWidget *dialog, - VirtViewerApp *self G_GNUC_UNUSED) -{ - gtk_widget_hide(dialog); - gtk_widget_destroy(dialog); + VirtViewerApp *self G_GNUC_UNUSED) +{ + gtk_widget_hide(dialog); + gtk_widget_destroy(dialog); } G_MODULE_EXPORT void virt_viewer_app_about_delete(GtkWidget *dialog, - void *dummy G_GNUC_UNUSED, - VirtViewerApp *self G_GNUC_UNUSED) -{ - gtk_widget_hide(dialog); - gtk_widget_destroy(dialog); + void *dummy G_GNUC_UNUSED, + VirtViewerApp *self G_GNUC_UNUSED) +{ + gtk_widget_hide(dialog); + gtk_widget_destroy(dialog); } #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) @@ -280,1173 +299,1365 @@ static int virt_viewer_app_open_tunnel(const char **cmd) { - int fd[2]; - pid_t pid; - - if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) < 0) - return -1; - - pid = fork(); - if (pid == -1) { - close(fd[0]); - close(fd[1]); - return -1; - } - - if (pid == 0) { /* child */ - close(fd[0]); - close(0); - close(1); - if (dup(fd[1]) < 0) - _exit(1); - if (dup(fd[1]) < 0) - _exit(1); - close(fd[1]); - execvp("ssh", (char *const*)cmd); - _exit(1); - } - close(fd[1]); - return fd[0]; + int fd[2]; + pid_t pid; + + if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) < 0) + return -1; + + pid = fork(); + if (pid == -1) { + close(fd[0]); + close(fd[1]); + return -1; + } + + if (pid == 0) { /* child */ + close(fd[0]); + close(0); + close(1); + if (dup(fd[1]) < 0) + _exit(1); + if (dup(fd[1]) < 0) + _exit(1); + close(fd[1]); + execvp("ssh", (char *const*)cmd); + _exit(1); + } + close(fd[1]); + return fd[0]; } static int virt_viewer_app_open_tunnel_ssh(const char *sshhost, - int sshport, - const char *sshuser, - const char *host, - const char *port, - const char *unixsock) -{ - const char *cmd[10]; - char portstr[50]; - int n = 0; - - cmd[n++] = "ssh"; - if (sshport) { - cmd[n++] = "-p"; - sprintf(portstr, "%d", sshport); - cmd[n++] = portstr; - } - if (sshuser) { - cmd[n++] = "-l"; - cmd[n++] = sshuser; - } - cmd[n++] = sshhost; - cmd[n++] = "nc"; - if (port) { - cmd[n++] = host; - cmd[n++] = port; - } else { - cmd[n++] = "-U"; - cmd[n++] = unixsock; - } - cmd[n++] = NULL; - - return virt_viewer_app_open_tunnel(cmd); + int sshport, + const char *sshuser, + const char *host, + const char *port, + const char *unixsock) +{ + const char *cmd[10]; + char portstr[50]; + int n = 0; + + cmd[n++] = "ssh"; + if (sshport) { + cmd[n++] = "-p"; + sprintf(portstr, "%d", sshport); + cmd[n++] = portstr; + } + if (sshuser) { + cmd[n++] = "-l"; + cmd[n++] = sshuser; + } + cmd[n++] = sshhost; + cmd[n++] = "nc"; + if (port) { + cmd[n++] = host; + cmd[n++] = port; + } else { + cmd[n++] = "-U"; + cmd[n++] = unixsock; + } + cmd[n++] = NULL; + + return virt_viewer_app_open_tunnel(cmd); } static int virt_viewer_app_open_unix_sock(const char *unixsock) { - struct sockaddr_un addr; - int fd; - - memset(&addr, 0, sizeof addr); - addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, unixsock); - - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) - return -1; - - if (connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) { - close(fd); - return -1; - } - - return fd; + struct sockaddr_un addr; + int fd; + + memset(&addr, 0, sizeof addr); + addr.sun_family = AF_UNIX; + strcpy(addr.sun_path, unixsock); + + if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) + return -1; + + if (connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) { + close(fd); + return -1; + } + + return fd; } #endif /* defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) */ void virt_viewer_app_trace(VirtViewerApp *self, - const char *fmt, ...) -{ - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - va_list ap; - VirtViewerAppPrivate *priv = self->priv; - - if (doDebug) { - va_start(ap, fmt); - g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fmt, ap); - va_end(ap); - } - - if (priv->verbose) { - va_start(ap, fmt); - g_vprintf(fmt, ap); - va_end(ap); - } + const char *fmt, ...) +{ + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + va_list ap; + VirtViewerAppPrivate *priv = self->priv; + + if (doDebug) { + va_start(ap, fmt); + g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fmt, ap); + va_end(ap); + } + + if (priv->verbose) { + va_start(ap, fmt); + g_vprintf(fmt, ap); + va_end(ap); + } } static void virt_viewer_app_set_window_subtitle(VirtViewerApp *app, - VirtViewerWindow *window, - int nth) -{ - gchar *subtitle = app->priv->title ? g_strdup_printf("%s (%d)", app->priv->title, nth + 1) : NULL; - g_object_set(window, "subtitle", subtitle, NULL); - g_free(subtitle); + VirtViewerWindow *window, + int nth) +{ + gchar *subtitle = NULL; + + if (app->priv->title != NULL) { + gchar *d = strstr(app->priv->title, "%d"); + if (d != NULL) { + *d = '\0'; + subtitle = g_strdup_printf("%s%d%s", app->priv->title, nth + 1, d + 2); + *d = '%'; + } else + subtitle = g_strdup_printf("%s (%d)", app->priv->title, nth + 1); + } + + g_object_set(window, "subtitle", subtitle, NULL); + g_free(subtitle); } static void set_title(gpointer key, - gpointer value, - gpointer user_data) -{ - gint *nth = key; - VirtViewerApp *app = user_data; - VirtViewerWindow *window = value; - virt_viewer_app_set_window_subtitle(app, window, *nth); + gpointer value, + gpointer user_data) +{ + gint *nth = key; + VirtViewerApp *app = user_data; + VirtViewerWindow *window = value; + virt_viewer_app_set_window_subtitle(app, window, *nth); } static void virt_viewer_app_set_all_window_subtitles(VirtViewerApp *app) { - virt_viewer_app_set_window_subtitle(app, app->priv->main_window, 0); - g_hash_table_foreach(app->priv->windows, set_title, app); + virt_viewer_app_set_window_subtitle(app, app->priv->main_window, 0); + g_hash_table_foreach(app->priv->windows, set_title, app); } static void update_title(gpointer key G_GNUC_UNUSED, - gpointer value, - gpointer user_data G_GNUC_UNUSED) -{ - virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(value)); + gpointer value, + gpointer user_data G_GNUC_UNUSED) +{ + virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(value)); } static void virt_viewer_app_update_title(VirtViewerApp *self) { - g_hash_table_foreach(self->priv->windows, update_title, NULL); + g_hash_table_foreach(self->priv->windows, update_title, NULL); +} + +static void set_usb_options_sensitive(gpointer key G_GNUC_UNUSED, + gpointer value, + gpointer user_data) +{ + virt_viewer_window_set_usb_options_sensitive( + VIRT_VIEWER_WINDOW(value), GPOINTER_TO_INT(user_data)); +} + +static void +virt_viewer_app_set_usb_options_sensitive(VirtViewerApp *self, gboolean sensitive) +{ + g_hash_table_foreach(self->priv->windows, set_usb_options_sensitive, + GINT_TO_POINTER(sensitive)); } static VirtViewerWindow * virt_viewer_app_get_nth_window(VirtViewerApp *self, gint nth) { - return g_hash_table_lookup(self->priv->windows, &nth); + return g_hash_table_lookup(self->priv->windows, &nth); } static gboolean virt_viewer_app_remove_nth_window(VirtViewerApp *self, gint nth) { - gboolean removed; - - g_return_val_if_fail(nth != 0, FALSE); - removed = g_hash_table_remove(self->priv->windows, &nth); - g_warn_if_fail(removed); - - return removed; + VirtViewerWindow *win; + gboolean removed; + + g_return_val_if_fail(nth != 0, FALSE); + + win = virt_viewer_app_get_nth_window(self, nth); + g_return_val_if_fail(win != NULL, FALSE); + + removed = g_hash_table_steal(self->priv->windows, &nth); + g_warn_if_fail(removed); + + if (removed) + g_signal_emit(self, signals[SIGNAL_WINDOW_REMOVED], 0, win); + + g_object_unref(win); + + return removed; } static void virt_viewer_app_set_nth_window(VirtViewerApp *self, gint nth, VirtViewerWindow *win) { - gint *key; - - g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL); - key = g_malloc(sizeof(gint)); - *key = nth; - g_hash_table_insert(self->priv->windows, key, win); - virt_viewer_app_set_window_subtitle(self, win, nth); + gint *key; + + g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL); + key = g_malloc(sizeof(gint)); + *key = nth; + g_hash_table_insert(self->priv->windows, key, win); + virt_viewer_app_set_window_subtitle(self, win, nth); + + g_signal_emit(self, signals[SIGNAL_WINDOW_ADDED], 0, win); } static void viewer_window_visible_cb(GtkWidget *widget G_GNUC_UNUSED, - gpointer user_data) -{ - virt_viewer_app_update_menu_displays(VIRT_VIEWER_APP(user_data)); + gpointer user_data) +{ + virt_viewer_app_update_menu_displays(VIRT_VIEWER_APP(user_data)); } static VirtViewerWindow* virt_viewer_app_window_new(VirtViewerApp *self, GtkWidget *container, gint nth) { - VirtViewerWindow* window; - GtkWindow *w; - - window = g_object_new(VIRT_VIEWER_TYPE_WINDOW, - "app", self, - "container", container, - NULL); - if (self->priv->main_window) - virt_viewer_window_set_zoom_level(window, virt_viewer_window_get_zoom_level(self->priv->main_window)); - virt_viewer_app_set_nth_window(self, nth, window); - w = virt_viewer_window_get_window(window); - - /* this will set new window to fullscreen if necessary */ - virt_viewer_app_set_fullscreen(self, self->priv->fullscreen); - g_signal_connect(w, "hide", G_CALLBACK(viewer_window_visible_cb), self); - g_signal_connect(w, "show", G_CALLBACK(viewer_window_visible_cb), self); - return window; + VirtViewerWindow* window; + GtkWindow *w; + + window = g_object_new(VIRT_VIEWER_TYPE_WINDOW, + "app", self, + "container", container, + NULL); + if (self->priv->main_window) + virt_viewer_window_set_zoom_level(window, virt_viewer_window_get_zoom_level(self->priv->main_window)); + virt_viewer_app_set_nth_window(self, nth, window); + w = virt_viewer_window_get_window(window); + + /* this will set new window to fullscreen if necessary */ + virt_viewer_app_set_fullscreen(self, self->priv->fullscreen); + g_signal_connect(w, "hide", G_CALLBACK(viewer_window_visible_cb), self); + g_signal_connect(w, "show", G_CALLBACK(viewer_window_visible_cb), self); + return window; } static void display_show_hint(VirtViewerDisplay *display, - GParamSpec *pspec G_GNUC_UNUSED, - VirtViewerWindow *win) -{ - VirtViewerApp *self; - VirtViewerNotebook *nb = virt_viewer_window_get_notebook(win); - GtkWindow *w = virt_viewer_window_get_window(win); - gint nth, hint; - - g_object_get(win, - "app", &self, - NULL); - g_object_get(display, - "nth-display", &nth, - "show-hint", &hint, - NULL); - - if (hint == VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE) { - if (win != self->priv->main_window && - g_getenv("VIRT_VIEWER_HIDE")) - gtk_widget_hide(GTK_WIDGET(w)); - virt_viewer_notebook_show_status(nb, _("Waiting for display %d..."), nth + 1); - } else { - virt_viewer_notebook_show_display(nb); - gtk_widget_show(GTK_WIDGET(w)); - gtk_window_present(w); - } - - g_object_unref(self); + GParamSpec *pspec G_GNUC_UNUSED, + VirtViewerWindow *win) +{ + VirtViewerApp *self; + VirtViewerNotebook *nb = virt_viewer_window_get_notebook(win); + GtkWindow *w = virt_viewer_window_get_window(win); + gint nth, hint; + + g_object_get(win, + "app", &self, + NULL); + g_object_get(display, + "nth-display", &nth, + "show-hint", &hint, + NULL); + + if (hint == VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE) { + if (win != self->priv->main_window && + g_getenv("VIRT_VIEWER_HIDE")) + gtk_widget_hide(GTK_WIDGET(w)); + virt_viewer_notebook_show_status(nb, _("Waiting for display %d..."), nth + 1); + } else { + virt_viewer_notebook_show_display(nb); + gtk_widget_show(GTK_WIDGET(w)); + gtk_window_present(w); + } + + g_object_unref(self); } static void virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED, - VirtViewerDisplay *display, - VirtViewerApp *self) -{ - VirtViewerAppPrivate *priv = self->priv; - VirtViewerWindow *window; - gint nth; - - g_object_get(display, "nth-display", &nth, NULL); - if (nth == 0) { - window = priv->main_window; - } else { - if (priv->container) { - g_warning("multi-head not yet supported within container"); - return; - } - - g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL); - window = virt_viewer_app_window_new(self, NULL, nth); - } - - virt_viewer_window_set_display(window, display); - g_signal_connect(display, "notify::show-hint", - G_CALLBACK(display_show_hint), window); - g_object_notify(G_OBJECT(display), "show-hint"); /* call display_show_hint */ + VirtViewerDisplay *display, + VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv = self->priv; + VirtViewerWindow *window; + gint nth; + + g_object_get(display, "nth-display", &nth, NULL); + if (nth == 0) { + window = priv->main_window; + } else { + if (priv->container) { + g_warning("multi-head not yet supported within container"); + return; + } + + g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL); + window = virt_viewer_app_window_new(self, NULL, nth); + } + + virt_viewer_window_set_display(window, display); + g_signal_connect(display, "notify::show-hint", + G_CALLBACK(display_show_hint), window); + g_object_notify(G_OBJECT(display), "show-hint"); /* call display_show_hint */ } static void virt_viewer_app_display_removed(VirtViewerSession *session G_GNUC_UNUSED, - VirtViewerDisplay *display, - VirtViewerApp *self) -{ - VirtViewerWindow *win = NULL; - gint nth; - - gtk_widget_hide(GTK_WIDGET(display)); - g_object_get(display, "nth-display", &nth, NULL); - win = virt_viewer_app_get_nth_window(self, nth); - virt_viewer_window_set_display(win, NULL); - - if (nth != 0) - virt_viewer_app_remove_nth_window(self, nth); + VirtViewerDisplay *display, + VirtViewerApp *self) +{ + VirtViewerWindow *win = NULL; + gint nth; + + gtk_widget_hide(GTK_WIDGET(display)); + g_object_get(display, "nth-display", &nth, NULL); + win = virt_viewer_app_get_nth_window(self, nth); + virt_viewer_window_set_display(win, NULL); + + if (nth != 0) + virt_viewer_app_remove_nth_window(self, nth); } int virt_viewer_app_create_session(VirtViewerApp *self, const gchar *type) { - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1); - VirtViewerAppPrivate *priv = self->priv; - g_return_val_if_fail(priv->session == NULL, -1); + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1); + VirtViewerAppPrivate *priv = self->priv; + g_return_val_if_fail(priv->session == NULL, -1); #ifdef HAVE_GTK_VNC - if (g_strcasecmp(type, "vnc") == 0) { - virt_viewer_app_trace(self, "Guest %s has a %s display\n", - priv->guest_name, type); - priv->session = virt_viewer_session_vnc_new(); - } else + if (g_ascii_strcasecmp(type, "vnc") == 0) { + GtkWindow *window = virt_viewer_window_get_window(priv->main_window); + virt_viewer_app_trace(self, "Guest %s has a %s display\n", + priv->guest_name, type); + priv->session = virt_viewer_session_vnc_new(window); + } else #endif #ifdef HAVE_SPICE_GTK - if (g_strcasecmp(type, "spice") == 0) { - virt_viewer_app_trace(self, "Guest %s has a %s display\n", - priv->guest_name, type); - priv->session = virt_viewer_session_spice_new(); - } else + if (g_ascii_strcasecmp(type, "spice") == 0) { + GtkWindow *window = virt_viewer_window_get_window(priv->main_window); + virt_viewer_app_trace(self, "Guest %s has a %s display\n", + priv->guest_name, type); + priv->session = virt_viewer_session_spice_new(window); + } else #endif - { - virt_viewer_app_trace(self, "Guest %s has unsupported %s display type\n", - priv->guest_name, type); - virt_viewer_app_simple_message_dialog(self, _("Unknown graphic type for the guest %s"), - priv->guest_name); - return -1; - } - - g_signal_connect(priv->session, "session-initialized", - G_CALLBACK(virt_viewer_app_initialized), self); - g_signal_connect(priv->session, "session-connected", - G_CALLBACK(virt_viewer_app_connected), self); - g_signal_connect(priv->session, "session-disconnected", - G_CALLBACK(virt_viewer_app_disconnected), self); - g_signal_connect(priv->session, "session-channel-open", - G_CALLBACK(virt_viewer_app_channel_open), self); - g_signal_connect(priv->session, "session-auth-refused", - G_CALLBACK(virt_viewer_app_auth_refused), self); - g_signal_connect(priv->session, "session-auth-failed", - G_CALLBACK(virt_viewer_app_auth_failed), self); - g_signal_connect(priv->session, "session-display-added", - G_CALLBACK(virt_viewer_app_display_added), self); - g_signal_connect(priv->session, "session-display-removed", - G_CALLBACK(virt_viewer_app_display_removed), self); - - g_signal_connect(priv->session, "session-cut-text", - G_CALLBACK(virt_viewer_app_server_cut_text), self); - g_signal_connect(priv->session, "session-bell", - G_CALLBACK(virt_viewer_app_bell), self); - - return 0; -} + { + virt_viewer_app_trace(self, "Guest %s has unsupported %s display type\n", + priv->guest_name, type); + virt_viewer_app_simple_message_dialog(self, _("Unknown graphic type for the guest %s"), + priv->guest_name); + return -1; + } + + g_signal_connect(priv->session, "session-initialized", + G_CALLBACK(virt_viewer_app_initialized), self); + g_signal_connect(priv->session, "session-connected", + G_CALLBACK(virt_viewer_app_connected), self); + g_signal_connect(priv->session, "session-disconnected", + G_CALLBACK(virt_viewer_app_disconnected), self); + g_signal_connect(priv->session, "session-channel-open", + G_CALLBACK(virt_viewer_app_channel_open), self); + g_signal_connect(priv->session, "session-auth-refused", + G_CALLBACK(virt_viewer_app_auth_refused), self); + g_signal_connect(priv->session, "session-auth-failed", + G_CALLBACK(virt_viewer_app_auth_failed), self); + g_signal_connect(priv->session, "session-usb-failed", + G_CALLBACK(virt_viewer_app_usb_failed), self); + g_signal_connect(priv->session, "session-display-added", + G_CALLBACK(virt_viewer_app_display_added), self); + g_signal_connect(priv->session, "session-display-removed", + G_CALLBACK(virt_viewer_app_display_removed), self); + + g_signal_connect(priv->session, "session-cut-text", + G_CALLBACK(virt_viewer_app_server_cut_text), self); + g_signal_connect(priv->session, "session-bell", + G_CALLBACK(virt_viewer_app_bell), self); + g_signal_connect(priv->session, "session-cancelled", + G_CALLBACK(virt_viewer_app_cancelled), self); + + return 0; +} + +static gboolean +virt_viewer_app_default_open_connection(VirtViewerApp *self G_GNUC_UNUSED, int *fd) +{ + *fd = -1; + return TRUE; +} + + +static int +virt_viewer_app_open_connection(VirtViewerApp *self, int *fd) +{ + VirtViewerAppClass *klass; + + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1); + klass = VIRT_VIEWER_APP_GET_CLASS(self); + + return klass->open_connection(self, fd); +} + #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) static void virt_viewer_app_channel_open(VirtViewerSession *session, - VirtViewerSessionChannel *channel, - VirtViewerApp *self) -{ - VirtViewerAppPrivate *priv; - int fd = -1; - - g_return_if_fail(self != NULL); - - priv = self->priv; - if (priv->transport && g_strcasecmp(priv->transport, "ssh") == 0 && - !priv->direct) { - if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port, priv->user, - priv->ghost, priv->gport, NULL)) < 0) - virt_viewer_app_simple_message_dialog(self, _("Connect to ssh failed.")); - } else { - virt_viewer_app_simple_message_dialog(self, _("Can't connect to channel, SSH only supported.")); - } - - if (fd >= 0) - virt_viewer_session_channel_open_fd(session, channel, fd); + VirtViewerSessionChannel *channel, + VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv; + int fd = -1; + + g_return_if_fail(self != NULL); + + if (!virt_viewer_app_open_connection(self, &fd)) + return; + + DEBUG_LOG("After open connection callback fd=%d", fd); + + priv = self->priv; + if (priv->transport && g_ascii_strcasecmp(priv->transport, "ssh") == 0 && + !priv->direct && fd == -1) { + if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port, priv->user, + priv->ghost, priv->gport, NULL)) < 0) + virt_viewer_app_simple_message_dialog(self, _("Connect to ssh failed.")); + } else if (fd == -1) { + virt_viewer_app_simple_message_dialog(self, _("Can't connect to channel, SSH only supported.")); + } + + if (fd >= 0) + virt_viewer_session_channel_open_fd(session, channel, fd); } #else static void virt_viewer_app_channel_open(VirtViewerSession *session G_GNUC_UNUSED, - VirtViewerSessionChannel *channel G_GNUC_UNUSED, - VirtViewerApp *self) -{ - virt_viewer_app_simple_message_dialog(self, _("Connect to channel unsupported.")); + VirtViewerSessionChannel *channel G_GNUC_UNUSED, + VirtViewerApp *self) +{ + virt_viewer_app_simple_message_dialog(self, _("Connect to channel unsupported.")); } #endif + +static int +virt_viewer_app_default_activate(VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv = self->priv; + int fd = -1; + + if (!virt_viewer_app_open_connection(self, &fd)) + return -1; + + DEBUG_LOG("After open connection callback fd=%d", fd); + +#if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) + if (priv->transport && + g_ascii_strcasecmp(priv->transport, "ssh") == 0 && + !priv->direct && + fd == -1) { + gchar *p = NULL; + + if (priv->gport) { + virt_viewer_app_trace(self, "Opening indirect TCP connection to display at %s:%s\n", + priv->ghost, priv->gport); + } else { + virt_viewer_app_trace(self, "Opening indirect UNIX connection to display at %s\n", + priv->unixsock); + } + if (priv->port) + p = g_strdup_printf(":%d", priv->port); + + virt_viewer_app_trace(self, "Setting up SSH tunnel via %s%s%s%s\n", + priv->user ? priv->user : "", + priv->user ? "@" : "", + priv->host, p ? p : ""); + g_free(p); + + if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port, + priv->user, priv->ghost, + priv->gport, priv->unixsock)) < 0) + return -1; + } else if (priv->unixsock && fd == -1) { + virt_viewer_app_trace(self, "Opening direct UNIX connection to display at %s", + priv->unixsock); + if ((fd = virt_viewer_app_open_unix_sock(priv->unixsock)) < 0) + return -1; + } +#endif + + if (fd >= 0) { + return virt_viewer_session_open_fd(VIRT_VIEWER_SESSION(priv->session), fd); + } else if (priv->guri) { + virt_viewer_app_trace(self, "Opening connection to display at %s\n", priv->guri); + return virt_viewer_session_open_uri(VIRT_VIEWER_SESSION(priv->session), priv->guri); + } else { + virt_viewer_app_trace(self, "Opening direct TCP connection to display at %s:%s:%s\n", + priv->ghost, priv->gport, priv->gtlsport ? priv->gtlsport : "-1"); + return virt_viewer_session_open_host(VIRT_VIEWER_SESSION(priv->session), + priv->ghost, priv->gport, priv->gtlsport); + } + + return -1; +} int virt_viewer_app_activate(VirtViewerApp *self) { - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1); - VirtViewerAppPrivate *priv = self->priv; - int fd = -1; - int ret = -1; - - if (priv->active) - goto cleanup; - -#if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) - if (priv->transport && - g_strcasecmp(priv->transport, "ssh") == 0 && - !priv->direct) { - gchar *p = NULL; - - if (priv->gport) { - virt_viewer_app_trace(self, "Opening indirect TCP connection to display at %s:%s\n", - priv->ghost, priv->gport); - } else { - virt_viewer_app_trace(self, "Opening indirect UNIX connection to display at %s\n", - priv->unixsock); - } - if (priv->port) - p = g_strdup_printf(":%d", priv->port); - - virt_viewer_app_trace(self, "Setting up SSH tunnel via %s%s%s%s\n", - priv->user ? priv->user : "", - priv->user ? "@" : "", - priv->host, p ? p : ""); - g_free(p); - - if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port, - priv->user, priv->ghost, - priv->gport, priv->unixsock)) < 0) - return -1; - } else if (priv->unixsock) { - virt_viewer_app_trace(self, "Opening direct UNIX connection to display at %s", - priv->unixsock); - if ((fd = virt_viewer_app_open_unix_sock(priv->unixsock)) < 0) - return -1; - } -#endif - - if (fd >= 0) { - ret = virt_viewer_session_open_fd(VIRT_VIEWER_SESSION(priv->session), fd); - } else { - virt_viewer_app_trace(self, "Opening direct TCP connection to display at %s:%s\n", - priv->ghost, priv->gport); - ret = virt_viewer_session_open_host(VIRT_VIEWER_SESSION(priv->session), - priv->ghost, priv->gport); - } - - virt_viewer_app_show_status(self, _("Connecting to graphic server")); - - priv->connected = FALSE; - priv->active = TRUE; - priv->grabbed = FALSE; - virt_viewer_app_update_title(self); - - cleanup: - return ret; + VirtViewerAppPrivate *priv; + int ret; + + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1); + + priv = self->priv; + if (priv->active) + return -1; + + ret = VIRT_VIEWER_APP_GET_CLASS(self)->activate(self); + + if (ret != -1) { + virt_viewer_app_show_status(self, _("Connecting to graphic server")); + priv->connected = FALSE; + priv->cancelled = FALSE; + priv->active = TRUE; + priv->grabbed = FALSE; + virt_viewer_app_update_title(self); + } + + return ret; } /* text was actually requested */ static void virt_viewer_app_clipboard_copy(GtkClipboard *clipboard G_GNUC_UNUSED, - GtkSelectionData *data, - guint info G_GNUC_UNUSED, - VirtViewerApp *self) -{ - VirtViewerAppPrivate *priv = self->priv; - - gtk_selection_data_set_text(data, priv->clipboard, -1); + GtkSelectionData *data, + guint info G_GNUC_UNUSED, + VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv = self->priv; + + gtk_selection_data_set_text(data, priv->clipboard, -1); } static void virt_viewer_app_server_cut_text(VirtViewerSession *session G_GNUC_UNUSED, - const gchar *text, - VirtViewerApp *self) -{ - GtkClipboard *cb; - gsize a, b; - VirtViewerAppPrivate *priv = self->priv; - GtkTargetEntry targets[] = { - {g_strdup("UTF8_STRING"), 0, 0}, - {g_strdup("COMPOUND_TEXT"), 0, 0}, - {g_strdup("TEXT"), 0, 0}, - {g_strdup("STRING"), 0, 0}, - }; - - if (!text) - return; - - g_free (priv->clipboard); - priv->clipboard = g_convert (text, -1, "utf-8", "iso8859-1", &a, &b, NULL); - - if (priv->clipboard) { - cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); - - gtk_clipboard_set_with_owner (cb, - targets, - G_N_ELEMENTS(targets), - (GtkClipboardGetFunc)virt_viewer_app_clipboard_copy, - NULL, - G_OBJECT (self)); - } + const gchar *text, + VirtViewerApp *self) +{ + GtkClipboard *cb; + gsize a, b; + VirtViewerAppPrivate *priv = self->priv; + GtkTargetEntry targets[] = { + {g_strdup("UTF8_STRING"), 0, 0}, + {g_strdup("COMPOUND_TEXT"), 0, 0}, + {g_strdup("TEXT"), 0, 0}, + {g_strdup("STRING"), 0, 0}, + }; + + if (!text) + return; + + g_free (priv->clipboard); + priv->clipboard = g_convert (text, -1, "utf-8", "iso8859-1", &a, &b, NULL); + + if (priv->clipboard) { + cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); + + gtk_clipboard_set_with_owner (cb, + targets, + G_N_ELEMENTS(targets), + (GtkClipboardGetFunc)virt_viewer_app_clipboard_copy, + NULL, + G_OBJECT (self)); + } } static void virt_viewer_app_bell(VirtViewerSession *session G_GNUC_UNUSED, - VirtViewerApp *self) -{ - VirtViewerAppPrivate *priv = self->priv; - - gdk_window_beep(gtk_widget_get_window(GTK_WIDGET(virt_viewer_window_get_window(priv->main_window)))); + VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv = self->priv; + + gdk_window_beep(gtk_widget_get_window(GTK_WIDGET(virt_viewer_window_get_window(priv->main_window)))); } static int virt_viewer_app_default_initial_connect(VirtViewerApp *self) { - return virt_viewer_app_activate(self); + return virt_viewer_app_activate(self); } int virt_viewer_app_initial_connect(VirtViewerApp *self) { - VirtViewerAppClass *klass; - - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1); - klass = VIRT_VIEWER_APP_GET_CLASS(self); - - return klass->initial_connect(self); + VirtViewerAppClass *klass; + + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1); + klass = VIRT_VIEWER_APP_GET_CLASS(self); + + return klass->initial_connect(self); } static gboolean virt_viewer_app_retryauth(gpointer opaque) { - VirtViewerApp *self = opaque; - - virt_viewer_app_initial_connect(self); - - return FALSE; + VirtViewerApp *self = opaque; + + virt_viewer_app_initial_connect(self); + + return FALSE; } static gboolean virt_viewer_app_connect_timer(void *opaque) { - VirtViewerApp *self = opaque; - VirtViewerAppPrivate *priv = self->priv; - - DEBUG_LOG("Connect timer fired"); - - if (!priv->active && - virt_viewer_app_initial_connect(self) < 0) - gtk_main_quit(); - - if (priv->active) { - priv->reconnect_poll = 0; - return FALSE; - } - - return TRUE; + VirtViewerApp *self = opaque; + VirtViewerAppPrivate *priv = self->priv; + + DEBUG_LOG("Connect timer fired"); + + if (!priv->active && + virt_viewer_app_initial_connect(self) < 0) + gtk_main_quit(); + + if (priv->active) { + priv->reconnect_poll = 0; + return FALSE; + } + + return TRUE; } void virt_viewer_app_start_reconnect_poll(VirtViewerApp *self) { - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - VirtViewerAppPrivate *priv = self->priv; - - if (priv->reconnect_poll != 0) - return; - - priv->reconnect_poll = g_timeout_add(500, virt_viewer_app_connect_timer, self); + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + VirtViewerAppPrivate *priv = self->priv; + + if (priv->reconnect_poll != 0) + return; + + priv->reconnect_poll = g_timeout_add(500, virt_viewer_app_connect_timer, self); } static void virt_viewer_app_default_deactivated(VirtViewerApp *self) { - VirtViewerAppPrivate *priv = self->priv; - - virt_viewer_app_show_status(self, _("Guest domain has shutdown")); - virt_viewer_app_trace(self, "Guest %s display has disconnected, shutting down", - priv->guest_name); - gtk_main_quit(); + VirtViewerAppPrivate *priv = self->priv; + + virt_viewer_app_show_status(self, _("Guest domain has shutdown")); + virt_viewer_app_trace(self, "Guest %s display has disconnected, shutting down", + priv->guest_name); + gtk_main_quit(); } static void virt_viewer_app_deactivated(VirtViewerApp *self) { - VirtViewerAppClass *klass; - klass = VIRT_VIEWER_APP_GET_CLASS(self); - - klass->deactivated(self); + VirtViewerAppClass *klass; + klass = VIRT_VIEWER_APP_GET_CLASS(self); + + klass->deactivated(self); } static void virt_viewer_app_deactivate(VirtViewerApp *self) { - VirtViewerAppPrivate *priv = self->priv; - - if (!priv->active) - return; - - if (priv->session) - virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session)); - - priv->connected = FALSE; - priv->active = FALSE; + VirtViewerAppPrivate *priv = self->priv; + + if (!priv->active) + return; + + if (priv->session) + virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session)); + + priv->connected = FALSE; + priv->active = FALSE; #if 0 - g_free(priv->pretty_address); - priv->pretty_address = NULL; + g_free(priv->pretty_address); + priv->pretty_address = NULL; #endif - priv->grabbed = FALSE; - virt_viewer_app_update_title(self); - - if (priv->authretry) { - priv->authretry = FALSE; - g_idle_add(virt_viewer_app_retryauth, self); - } else - virt_viewer_app_deactivated(self); + priv->grabbed = FALSE; + virt_viewer_app_update_title(self); + + if (priv->authretry) { + priv->authretry = FALSE; + g_idle_add(virt_viewer_app_retryauth, self); + } else + virt_viewer_app_deactivated(self); } static void virt_viewer_app_connected(VirtViewerSession *session G_GNUC_UNUSED, - VirtViewerApp *self) -{ - VirtViewerAppPrivate *priv = self->priv; - - priv->connected = TRUE; - virt_viewer_app_show_status(self, _("Connected to graphic server")); + VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv = self->priv; + + priv->connected = TRUE; + virt_viewer_app_show_status(self, _("Connected to graphic server")); } static void virt_viewer_app_initialized(VirtViewerSession *session G_GNUC_UNUSED, - VirtViewerApp *self) -{ - virt_viewer_app_update_title(self); + VirtViewerApp *self) +{ + gboolean has_usb = virt_viewer_session_has_usb(self->priv->session); + + virt_viewer_app_update_title(self); + virt_viewer_app_set_usb_options_sensitive(self, has_usb); } static void virt_viewer_app_disconnected(VirtViewerSession *session G_GNUC_UNUSED, - VirtViewerApp *self) -{ - VirtViewerAppPrivate *priv = self->priv; - - if (!priv->connected) { - virt_viewer_app_simple_message_dialog(self, - _("Unable to connect to the graphic server %s"), - priv->pretty_address); - } - virt_viewer_app_deactivate(self); + VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv = self->priv; + + if (!priv->connected && !priv->cancelled) { + virt_viewer_app_simple_message_dialog(self, + _("Unable to connect to the graphic server %s"), + priv->pretty_address); + } + virt_viewer_app_set_usb_options_sensitive(self, FALSE); + virt_viewer_app_deactivate(self); +} + +static void virt_viewer_app_cancelled(VirtViewerSession *session, + VirtViewerApp *self) +{ + VirtViewerAppPrivate *priv = self->priv; + priv->cancelled = TRUE; + virt_viewer_app_disconnected(session, self); } static void virt_viewer_app_auth_refused(VirtViewerSession *session G_GNUC_UNUSED, - const char *msg, - VirtViewerApp *self) -{ - GtkWidget *dialog; - int ret; - VirtViewerAppPrivate *priv = self->priv; - - dialog = gtk_message_dialog_new(virt_viewer_window_get_window(priv->main_window), - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_YES_NO, - _("Unable to authenticate with remote desktop server at %s: %s\n" - "Retry connection again?"), - priv->pretty_address, msg); - - ret = gtk_dialog_run(GTK_DIALOG(dialog)); - - gtk_widget_destroy(dialog); - - if (ret == GTK_RESPONSE_YES) - priv->authretry = TRUE; - else - priv->authretry = FALSE; + const char *msg, + VirtViewerApp *self) +{ + GtkWidget *dialog; + int ret; + VirtViewerAppPrivate *priv = self->priv; + + dialog = gtk_message_dialog_new(virt_viewer_window_get_window(priv->main_window), + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_YES_NO, + _("Unable to authenticate with remote desktop server at %s: %s\n" + "Retry connection again?"), + priv->pretty_address, msg); + + ret = gtk_dialog_run(GTK_DIALOG(dialog)); + + gtk_widget_destroy(dialog); + + if (ret == GTK_RESPONSE_YES) + priv->authretry = TRUE; + else + priv->authretry = FALSE; } static void virt_viewer_app_auth_failed(VirtViewerSession *session G_GNUC_UNUSED, - const char *msg, - VirtViewerApp *self) -{ - VirtViewerAppPrivate *priv = self->priv; - - virt_viewer_app_simple_message_dialog(self, - _("Unable to authenticate with remote desktop server at %s"), - priv->pretty_address, msg); + const char *msg, + VirtViewerApp *self) +{ + virt_viewer_app_simple_message_dialog(self, + _("Unable to authenticate with remote desktop server: %s"), + msg); +} + +static void virt_viewer_app_usb_failed(VirtViewerSession *session G_GNUC_UNUSED, + const gchar *msg, + VirtViewerApp *self) +{ + virt_viewer_app_simple_message_dialog(self, _("USB redirection error: %s"), msg); } static void virt_viewer_app_get_property (GObject *object, guint property_id, - GValue *value G_GNUC_UNUSED, GParamSpec *pspec) -{ - g_return_if_fail(VIRT_VIEWER_IS_APP(object)); - VirtViewerApp *self = VIRT_VIEWER_APP(object); - VirtViewerAppPrivate *priv = self->priv; - - switch (property_id) { - case PROP_VERBOSE: - g_value_set_boolean(value, priv->verbose); - break; - - case PROP_CONTAINER: - g_value_set_object(value, priv->container); - break; - - case PROP_SESSION: - g_value_set_object(value, priv->session); - break; - - case PROP_GUEST_NAME: - g_value_set_string(value, priv->guest_name); - break; - - case PROP_FULLSCREEN: - g_value_set_boolean(value, priv->fullscreen); - break; - - case PROP_TITLE: - g_value_set_string(value, priv->title); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + GValue *value G_GNUC_UNUSED, GParamSpec *pspec) +{ + g_return_if_fail(VIRT_VIEWER_IS_APP(object)); + VirtViewerApp *self = VIRT_VIEWER_APP(object); + VirtViewerAppPrivate *priv = self->priv; + + switch (property_id) { + case PROP_VERBOSE: + g_value_set_boolean(value, priv->verbose); + break; + + case PROP_CONTAINER: + g_value_set_object(value, priv->container); + break; + + case PROP_SESSION: + g_value_set_object(value, priv->session); + break; + + case PROP_GUEST_NAME: + g_value_set_string(value, priv->guest_name); + break; + + case PROP_GURI: + g_value_set_string(value, priv->guri); + break; + + case PROP_FULLSCREEN: + g_value_set_boolean(value, priv->fullscreen); + break; + + case PROP_TITLE: + g_value_set_string(value, priv->title); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_app_set_property (GObject *object, guint property_id, - const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) -{ - g_return_if_fail(VIRT_VIEWER_IS_APP(object)); - VirtViewerApp *self = VIRT_VIEWER_APP(object); - VirtViewerAppPrivate *priv = self->priv; - - switch (property_id) { - case PROP_VERBOSE: - priv->verbose = g_value_get_boolean(value); - break; - - case PROP_CONTAINER: - g_return_if_fail(priv->container == NULL); - priv->container = g_value_dup_object(value); - break; - - case PROP_GUEST_NAME: - g_free(priv->guest_name); - priv->guest_name = g_value_dup_string(value); - break; - - case PROP_FULLSCREEN: - virt_viewer_app_set_fullscreen(self, g_value_get_boolean(value)); - break; - - case PROP_TITLE: - g_free(priv->title); - priv->title = g_value_dup_string(value); - virt_viewer_app_set_all_window_subtitles(self); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) +{ + g_return_if_fail(VIRT_VIEWER_IS_APP(object)); + VirtViewerApp *self = VIRT_VIEWER_APP(object); + VirtViewerAppPrivate *priv = self->priv; + + switch (property_id) { + case PROP_VERBOSE: + priv->verbose = g_value_get_boolean(value); + break; + + case PROP_CONTAINER: + g_return_if_fail(priv->container == NULL); + priv->container = g_value_dup_object(value); + break; + + case PROP_GUEST_NAME: + g_free(priv->guest_name); + priv->guest_name = g_value_dup_string(value); + break; + + case PROP_GURI: + g_free(priv->guri); + priv->guri = g_value_dup_string(value); + virt_viewer_app_update_pretty_address(self); + break; + + case PROP_FULLSCREEN: + virt_viewer_app_set_fullscreen(self, g_value_get_boolean(value)); + break; + + case PROP_TITLE: + g_free(priv->title); + priv->title = g_value_dup_string(value); + virt_viewer_app_set_all_window_subtitles(self); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_app_dispose (GObject *object) { - VirtViewerApp *self = VIRT_VIEWER_APP(object); - VirtViewerAppPrivate *priv = self->priv; - - if (priv->windows) { - g_hash_table_unref(priv->windows); - priv->windows = NULL; - } - - if (priv->main_window) { - g_object_unref(priv->main_window); - priv->main_window = NULL; - } - - if (priv->container) { - g_object_unref(priv->container); - priv->container = NULL; - } - g_free(priv->title); - - virt_viewer_app_free_connect_info(self); - - G_OBJECT_CLASS (virt_viewer_app_parent_class)->dispose (object); + VirtViewerApp *self = VIRT_VIEWER_APP(object); + VirtViewerAppPrivate *priv = self->priv; + + if (priv->windows) { + g_hash_table_unref(priv->windows); + priv->windows = NULL; + } + + if (priv->main_window) { + g_object_unref(priv->main_window); + priv->main_window = NULL; + } + + if (priv->container) { + g_object_unref(priv->container); + priv->container = NULL; + } + g_free(priv->title); + + virt_viewer_app_free_connect_info(self); + + G_OBJECT_CLASS (virt_viewer_app_parent_class)->dispose (object); } static gboolean virt_viewer_app_default_start(VirtViewerApp *self) { - VirtViewerAppPrivate *priv; - GtkWindow *win; - priv = self->priv; - - win = virt_viewer_window_get_window(priv->main_window); - if (win) - gtk_widget_show(GTK_WIDGET(win)); - else { - gtk_box_pack_end(GTK_BOX(priv->container), priv->main_notebook, TRUE, TRUE, 0); - gtk_widget_show(GTK_WIDGET(priv->main_notebook)); - } - - return TRUE; + VirtViewerAppPrivate *priv; + GtkWindow *win; + priv = self->priv; + + win = virt_viewer_window_get_window(priv->main_window); + if (win) + gtk_widget_show(GTK_WIDGET(win)); + else { + gtk_box_pack_end(GTK_BOX(priv->container), priv->main_notebook, TRUE, TRUE, 0); + gtk_widget_show(GTK_WIDGET(priv->main_notebook)); + } + + return TRUE; } gboolean virt_viewer_app_start(VirtViewerApp *self) { - VirtViewerAppClass *klass; - - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); - klass = VIRT_VIEWER_APP_GET_CLASS(self); - - g_return_val_if_fail(!self->priv->started, TRUE); - - self->priv->started = klass->start(self); - return self->priv->started; + VirtViewerAppClass *klass; + + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); + klass = VIRT_VIEWER_APP_GET_CLASS(self); + + g_return_val_if_fail(!self->priv->started, TRUE); + + self->priv->started = klass->start(self); + return self->priv->started; } static void virt_viewer_app_init (VirtViewerApp *self) { - self->priv = GET_PRIVATE(self); - self->priv->windows = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, g_object_unref); + self->priv = GET_PRIVATE(self); + self->priv->windows = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, g_object_unref); } static GObject * virt_viewer_app_constructor (GType gtype, - guint n_properties, - GObjectConstructParam *properties) -{ - GObject *obj; - VirtViewerApp *self; - VirtViewerAppPrivate *priv; - - obj = G_OBJECT_CLASS (virt_viewer_app_parent_class)->constructor (gtype, n_properties, properties); - self = VIRT_VIEWER_APP(obj); - priv = self->priv; - - priv->main_window = virt_viewer_app_window_new(self, priv->container, 0); - priv->main_notebook = GTK_WIDGET(virt_viewer_window_get_notebook(priv->main_window)); - - return obj; + guint n_properties, + GObjectConstructParam *properties) +{ + GObject *obj; + VirtViewerApp *self; + VirtViewerAppPrivate *priv; + + obj = G_OBJECT_CLASS (virt_viewer_app_parent_class)->constructor (gtype, n_properties, properties); + self = VIRT_VIEWER_APP(obj); + priv = self->priv; + + priv->main_window = virt_viewer_app_window_new(self, priv->container, 0); + priv->main_notebook = GTK_WIDGET(virt_viewer_window_get_notebook(priv->main_window)); + + return obj; } static void virt_viewer_app_class_init (VirtViewerAppClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (klass, sizeof (VirtViewerAppPrivate)); - - object_class->constructor = virt_viewer_app_constructor; - object_class->get_property = virt_viewer_app_get_property; - object_class->set_property = virt_viewer_app_set_property; - object_class->dispose = virt_viewer_app_dispose; - - klass->start = virt_viewer_app_default_start; - klass->initial_connect = virt_viewer_app_default_initial_connect; - klass->deactivated = virt_viewer_app_default_deactivated; - - g_object_class_install_property(object_class, - PROP_VERBOSE, - g_param_spec_boolean("verbose", - "Verbose", - "Verbose trace", - FALSE, - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_CONTAINER, - g_param_spec_object("container", - "Container", - "Widget container", - GTK_TYPE_WIDGET, - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_SESSION, - g_param_spec_object("session", - "Session", - "ViewerSession", - VIRT_VIEWER_TYPE_SESSION, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_GUEST_NAME, - g_param_spec_string("guest-name", - "Guest name", - "Guest name", - "", - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_FULLSCREEN, - g_param_spec_boolean("fullscreen", - "Fullscreen", - "Fullscreen", - FALSE, - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_STATIC_STRINGS)); - g_object_class_install_property(object_class, - PROP_TITLE, - g_param_spec_string("title", - "Title", - "Title", - "", - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_STATIC_STRINGS)); - + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (VirtViewerAppPrivate)); + + object_class->constructor = virt_viewer_app_constructor; + object_class->get_property = virt_viewer_app_get_property; + object_class->set_property = virt_viewer_app_set_property; + object_class->dispose = virt_viewer_app_dispose; + + klass->start = virt_viewer_app_default_start; + klass->initial_connect = virt_viewer_app_default_initial_connect; + klass->activate = virt_viewer_app_default_activate; + klass->deactivated = virt_viewer_app_default_deactivated; + klass->open_connection = virt_viewer_app_default_open_connection; + + g_object_class_install_property(object_class, + PROP_VERBOSE, + g_param_spec_boolean("verbose", + "Verbose", + "Verbose trace", + FALSE, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_CONTAINER, + g_param_spec_object("container", + "Container", + "Widget container", + GTK_TYPE_WIDGET, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_SESSION, + g_param_spec_object("session", + "Session", + "ViewerSession", + VIRT_VIEWER_TYPE_SESSION, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_GUEST_NAME, + g_param_spec_string("guest-name", + "Guest name", + "Guest name", + "", + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_GURI, + g_param_spec_string("guri", + "guri", + "Remote graphical URI", + "", + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_FULLSCREEN, + g_param_spec_boolean("fullscreen", + "Fullscreen", + "Fullscreen", + FALSE, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_STATIC_STRINGS)); + g_object_class_install_property(object_class, + PROP_TITLE, + g_param_spec_string("title", + "Title", + "Title", + "", + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_STATIC_STRINGS)); + + signals[SIGNAL_WINDOW_ADDED] = + g_signal_new("window-added", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(VirtViewerAppClass, window_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + G_TYPE_OBJECT); + + signals[SIGNAL_WINDOW_REMOVED] = + g_signal_new("window-removed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(VirtViewerAppClass, window_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + G_TYPE_OBJECT); } void virt_viewer_app_set_direct(VirtViewerApp *self, gboolean direct) { - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - - self->priv->direct = direct; + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + + self->priv->direct = direct; +} + +void +virt_viewer_app_set_attach(VirtViewerApp *self, gboolean attach) +{ + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + + self->priv->attach = attach; +} + +gboolean +virt_viewer_app_get_attach(VirtViewerApp *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); + + return self->priv->attach; } gboolean virt_viewer_app_is_active(VirtViewerApp *self) { - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); - - return self->priv->active; + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); + + return self->priv->active; } gboolean virt_viewer_app_has_session(VirtViewerApp *self) { - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); - - return self->priv->session != NULL; + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); + + return self->priv->session != NULL; } static void virt_viewer_app_update_pretty_address(VirtViewerApp *self) { - VirtViewerAppPrivate *priv; - - priv = self->priv; - g_free(priv->pretty_address); - if (priv->gport) - priv->pretty_address = g_strdup_printf("%s:%s", priv->ghost, priv->gport); - else - priv->pretty_address = g_strdup_printf("%s:%s", priv->host, priv->unixsock); + VirtViewerAppPrivate *priv; + + priv = self->priv; + g_free(priv->pretty_address); + if (priv->guri) + priv->pretty_address = g_strdup(priv->guri); + else if (priv->gport) + priv->pretty_address = g_strdup_printf("%s:%s", priv->ghost, priv->gport); + else + priv->pretty_address = g_strdup_printf("%s:%s", priv->host, priv->unixsock); } typedef struct { - gboolean fullscreen; - gboolean move; + gboolean fullscreen; + gboolean move; } FullscreenOptions; static void fullscreen_cb(gpointer key, - gpointer value, - gpointer user_data) -{ - gint nth = *(gint*)key; - FullscreenOptions *options = (FullscreenOptions *)user_data; - VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(value); - - DEBUG_LOG("fullscreen display %d: %d", nth, options->fullscreen); - if (options->fullscreen) { - GdkScreen *screen = gdk_screen_get_default (); - GdkRectangle mon; - - if (nth >= gdk_screen_get_n_monitors(screen)) { - DEBUG_LOG("skipping display %d", nth); - return; - } - gdk_screen_get_monitor_geometry(screen, nth, &mon); - virt_viewer_window_enter_fullscreen(vwin, options->move, mon.x, mon.y); - } else - virt_viewer_window_leave_fullscreen(vwin); + gpointer value, + gpointer user_data) +{ + gint nth = *(gint*)key; + FullscreenOptions *options = (FullscreenOptions *)user_data; + VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(value); + + DEBUG_LOG("fullscreen display %d: %d", nth, options->fullscreen); + if (options->fullscreen) { + GdkScreen *screen = gdk_screen_get_default (); + GdkRectangle mon; + + if (nth >= gdk_screen_get_n_monitors(screen)) { + DEBUG_LOG("skipping display %d", nth); + return; + } + gdk_screen_get_monitor_geometry(screen, nth, &mon); + virt_viewer_window_enter_fullscreen(vwin, options->move, mon.x, mon.y); + } else + virt_viewer_window_leave_fullscreen(vwin); } static void virt_viewer_app_set_fullscreen(VirtViewerApp *self, gboolean fullscreen) { - VirtViewerAppPrivate *priv = self->priv; - FullscreenOptions options = { - .fullscreen = fullscreen, - .move = virt_viewer_app_get_n_windows_visible(self) > 1, - }; - - /* we iterate unconditionnaly, even if it was set before to update new windows */ - priv->fullscreen = fullscreen; - g_hash_table_foreach(priv->windows, fullscreen_cb, &options); + VirtViewerAppPrivate *priv = self->priv; + FullscreenOptions options = { + .fullscreen = fullscreen, + .move = virt_viewer_app_get_n_windows_visible(self) > 1, + }; + + /* we iterate unconditionnaly, even if it was set before to update new windows */ + priv->fullscreen = fullscreen; + g_hash_table_foreach(priv->windows, fullscreen_cb, &options); } static void menu_display_visible_toggled_cb(GtkCheckMenuItem *checkmenuitem, - VirtViewerWindow *vwin) -{ - VirtViewerApp *self; - gboolean visible; - static gboolean reentering = FALSE; - - if (reentering) /* do not reenter if I switch you back */ - return; - - reentering = TRUE; - g_object_get(vwin, "app", &self, NULL); - visible = virt_viewer_app_window_set_visible(self, vwin, - gtk_check_menu_item_get_active(checkmenuitem)); - gtk_check_menu_item_set_active(checkmenuitem, /* will be toggled again */ !visible); - g_object_unref(self); - reentering = FALSE; + VirtViewerWindow *vwin) +{ + VirtViewerApp *self; + gboolean visible; + static gboolean reentering = FALSE; + + if (reentering) /* do not reenter if I switch you back */ + return; + + reentering = TRUE; + g_object_get(vwin, "app", &self, NULL); + visible = virt_viewer_app_window_set_visible(self, vwin, + gtk_check_menu_item_get_active(checkmenuitem)); + gtk_check_menu_item_set_active(checkmenuitem, /* will be toggled again */ !visible); + g_object_unref(self); + reentering = FALSE; } static gint update_menu_displays_sort(gconstpointer a, gconstpointer b) { - const int *ai = a; - const int *bi = b; - - if (*ai > *bi) - return 1; - else if (*ai < *bi) - return -1; - else - return 0; + const int *ai = a; + const int *bi = b; + + if (*ai > *bi) + return 1; + else if (*ai < *bi) + return -1; + else + return 0; } static void window_update_menu_displays_cb(gpointer key G_GNUC_UNUSED, - gpointer value, - gpointer user_data) -{ - VirtViewerApp *self = VIRT_VIEWER_APP(user_data); - VirtViewerWindow *window = VIRT_VIEWER_WINDOW(value); - GtkMenuShell *submenu = GTK_MENU_SHELL(gtk_menu_new()); - GtkMenuItem *menu = virt_viewer_window_get_menu_displays(window); - GList *keys = g_hash_table_get_keys(self->priv->windows); - GList *tmp; - - keys = g_list_sort(keys, update_menu_displays_sort); - - tmp = keys; - while (tmp) { - int *nth = tmp->data; - VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(g_hash_table_lookup(self->priv->windows, nth)); - GtkWidget *item; - gboolean visible; - - item = gtk_check_menu_item_new_with_label(g_strdup_printf("Display %d", *nth)); - visible = gtk_widget_get_visible(GTK_WIDGET(virt_viewer_window_get_window(vwin))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), visible); - g_signal_connect(G_OBJECT(item), - "toggled", G_CALLBACK(menu_display_visible_toggled_cb), vwin); - gtk_menu_shell_append(submenu, item); - tmp = tmp->next; - } - - gtk_widget_show_all(GTK_WIDGET(submenu)); - gtk_menu_item_set_submenu(menu, GTK_WIDGET(submenu)); - g_list_free(keys); + gpointer value, + gpointer user_data) +{ + VirtViewerApp *self = VIRT_VIEWER_APP(user_data); + VirtViewerWindow *window = VIRT_VIEWER_WINDOW(value); + GtkMenuShell *submenu = GTK_MENU_SHELL(gtk_menu_new()); + GtkMenuItem *menu = virt_viewer_window_get_menu_displays(window); + GList *keys = g_hash_table_get_keys(self->priv->windows); + GList *tmp; + + keys = g_list_sort(keys, update_menu_displays_sort); + + tmp = keys; + while (tmp) { + int *nth = tmp->data; + VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(g_hash_table_lookup(self->priv->windows, nth)); + GtkWidget *item; + gboolean visible; + + item = gtk_check_menu_item_new_with_label(g_strdup_printf("Display %d", *nth)); + visible = gtk_widget_get_visible(GTK_WIDGET(virt_viewer_window_get_window(vwin))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), visible); + g_signal_connect(G_OBJECT(item), + "toggled", G_CALLBACK(menu_display_visible_toggled_cb), vwin); + gtk_menu_shell_append(submenu, item); + tmp = tmp->next; + } + + gtk_widget_show_all(GTK_WIDGET(submenu)); + gtk_menu_item_set_submenu(menu, GTK_WIDGET(submenu)); + g_list_free(keys); } static void virt_viewer_app_update_menu_displays(VirtViewerApp *self) { - g_hash_table_foreach(self->priv->windows, window_update_menu_displays_cb, self); + g_hash_table_foreach(self->priv->windows, window_update_menu_displays_cb, self); } void virt_viewer_app_set_connect_info(VirtViewerApp *self, - const gchar *host, - const gchar *ghost, - const gchar *gport, - const gchar *transport, - const gchar *unixsock, - const gchar *user, - gint port) -{ - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - VirtViewerAppPrivate *priv = self->priv; - - DEBUG_LOG("Set connect info: %s,%s,%s,%s,%s,%s,%d", - host, ghost, gport, transport, unixsock, user, port); - - g_free(priv->host); - g_free(priv->ghost); - g_free(priv->gport); - g_free(priv->transport); - g_free(priv->unixsock); - g_free(priv->user); - - priv->host = g_strdup(host); - priv->ghost = g_strdup(ghost); - priv->gport = g_strdup(gport); - priv->transport = g_strdup(transport); - priv->unixsock = g_strdup(unixsock); - priv->user = g_strdup(user); - priv->port = port; - - virt_viewer_app_update_pretty_address(self); + const gchar *host, + const gchar *ghost, + const gchar *gport, + const gchar *gtlsport, + const gchar *transport, + const gchar *unixsock, + const gchar *user, + gint port, + const gchar *guri) +{ + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + VirtViewerAppPrivate *priv = self->priv; + + DEBUG_LOG("Set connect info: %s,%s,%s,%s,%s,%s,%s,%d", + host, ghost, gport, gtlsport ? gtlsport : "-1", transport, unixsock, user, port); + + g_free(priv->host); + g_free(priv->ghost); + g_free(priv->gport); + g_free(priv->gtlsport); + g_free(priv->transport); + g_free(priv->unixsock); + g_free(priv->user); + g_free(priv->guri); + + priv->host = g_strdup(host); + priv->ghost = g_strdup(ghost); + priv->gport = g_strdup(gport); + priv->gtlsport = gtlsport ? g_strdup(gtlsport) : NULL; + priv->transport = g_strdup(transport); + priv->unixsock = g_strdup(unixsock); + priv->user = g_strdup(user); + priv->guri = g_strdup(guri); + priv->port = port; + + virt_viewer_app_update_pretty_address(self); } void virt_viewer_app_free_connect_info(VirtViewerApp *self) { - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - - virt_viewer_app_set_connect_info(self, NULL, NULL, NULL, NULL, NULL, NULL, 0); + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + + virt_viewer_app_set_connect_info(self, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL); } VirtViewerWindow* virt_viewer_app_get_main_window(VirtViewerApp *self) { - g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL); - - return self->priv->main_window; + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL); + + return self->priv->main_window; } static void show_status_cb(gpointer key G_GNUC_UNUSED, - gpointer value, - gpointer user_data) -{ - VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value)); - gchar *text = (gchar*)user_data; - - virt_viewer_notebook_show_status(nb, text); + gpointer value, + gpointer user_data) +{ + VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value)); + gchar *text = (gchar*)user_data; + + virt_viewer_notebook_show_status(nb, text); } void virt_viewer_app_show_status(VirtViewerApp *self, const gchar *fmt, ...) { - va_list args; - gchar *text; - - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - - va_start(args, fmt); - text = g_strdup_vprintf(fmt, args); - va_end(args); - - g_hash_table_foreach(self->priv->windows, show_status_cb, text); - g_free(text); + va_list args; + gchar *text; + + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + g_return_if_fail(fmt != NULL); + + va_start(args, fmt); + text = g_strdup_vprintf(fmt, args); + va_end(args); + + g_hash_table_foreach(self->priv->windows, show_status_cb, text); + g_free(text); } static void show_display_cb(gpointer key G_GNUC_UNUSED, - gpointer value, - gpointer user_data G_GNUC_UNUSED) -{ - VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value)); - - virt_viewer_notebook_show_display(nb); + gpointer value, + gpointer user_data G_GNUC_UNUSED) +{ + VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value)); + + virt_viewer_notebook_show_display(nb); } void virt_viewer_app_show_display(VirtViewerApp *self) { - g_return_if_fail(VIRT_VIEWER_IS_APP(self)); - g_hash_table_foreach(self->priv->windows, show_display_cb, self); + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + g_hash_table_foreach(self->priv->windows, show_display_cb, self); +} + +GHashTable* +virt_viewer_app_get_windows(VirtViewerApp *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL); + return self->priv->windows; +} + +void virt_viewer_app_usb_device_selection(VirtViewerApp *self, + GtkWindow *parent) +{ + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + g_return_if_fail(self->priv->session != NULL); + + virt_viewer_session_usb_device_selection(self->priv->session, parent); } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h index f3fbadd..4022ddf 100644 --- a/src/virt-viewer-app.h +++ b/src/virt-viewer-app.h @@ -1,7 +1,7 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007 Red Hat, + * Copyright (C) 2007-2012 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,16 +39,23 @@ typedef struct _VirtViewerAppPrivate VirtViewerAppPrivate; typedef struct { - GObject parent; - VirtViewerAppPrivate *priv; + GObject parent; + VirtViewerAppPrivate *priv; } VirtViewerApp; typedef struct { - GObjectClass parent_class; + GObjectClass parent_class; - gboolean (*start) (VirtViewerApp *self); - int (*initial_connect) (VirtViewerApp *self); - void (*deactivated) (VirtViewerApp *self); + /* signals */ + void (*window_added) (VirtViewerApp *self, VirtViewerWindow *window); + void (*window_removed) (VirtViewerApp *self, VirtViewerWindow *window); + + /*< private >*/ + gboolean (*start) (VirtViewerApp *self); + int (*initial_connect) (VirtViewerApp *self); + int (*activate) (VirtViewerApp *self); + void (*deactivated) (VirtViewerApp *self); + gboolean (*open_connection)(VirtViewerApp *self, int *fd); } VirtViewerAppClass; GType virt_viewer_app_get_type (void); @@ -67,19 +74,34 @@ void virt_viewer_app_start_reconnect_poll(VirtViewerApp *self); void virt_viewer_app_set_zoom_level(VirtViewerApp *self, gint zoom_level); void virt_viewer_app_set_direct(VirtViewerApp *self, gboolean direct); +void virt_viewer_app_set_attach(VirtViewerApp *self, gboolean attach); +gboolean virt_viewer_app_get_attach(VirtViewerApp *self); gboolean virt_viewer_app_has_session(VirtViewerApp *self); void virt_viewer_app_set_connect_info(VirtViewerApp *self, const gchar *host, const gchar *ghost, const gchar *gport, + const gchar *gtlsport, const gchar *transport, const gchar *unixsock, const gchar *user, - gint port); + gint port, + const gchar *guri); gboolean virt_viewer_app_window_set_visible(VirtViewerApp *self, VirtViewerWindow *window, gboolean visible); void virt_viewer_app_show_status(VirtViewerApp *self, const gchar *fmt, ...); void virt_viewer_app_show_display(VirtViewerApp *self); +GHashTable* virt_viewer_app_get_windows(VirtViewerApp *self); + +void virt_viewer_app_usb_device_selection(VirtViewerApp *self, + GtkWindow *parent); G_END_DECLS #endif /* VIRT_VIEWER_APP_H */ +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/virt-viewer-auth.c b/src/virt-viewer-auth.c index d6c0300..8c4041d 100644 --- a/src/virt-viewer-auth.c +++ b/src/virt-viewer-auth.c @@ -1,7 +1,7 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, + * Copyright (C) 2007-2012 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,209 +33,154 @@ int -virt_viewer_auth_collect_credentials(const char *type, - const char *address, - char **username, - char **password) +virt_viewer_auth_collect_credentials(GtkWindow *window, + const char *type, + const char *address, + char **username, + char **password) { - GtkWidget *dialog = NULL; - GtkBuilder *creds = virt_viewer_util_load_ui("virt-viewer-auth.xml"); - GtkWidget *credUsername; - GtkWidget *credPassword; - GtkWidget *promptUsername; - GtkWidget *promptPassword; - GtkWidget *labelMessage; - int response; - char *message; + GtkWidget *dialog = NULL; + GtkBuilder *creds = virt_viewer_util_load_ui("virt-viewer-auth.xml"); + GtkWidget *credUsername; + GtkWidget *credPassword; + GtkWidget *promptUsername; + GtkWidget *promptPassword; + GtkWidget *labelMessage; + int response; + char *message; - dialog = GTK_WIDGET(gtk_builder_get_object(creds, "auth")); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); + dialog = GTK_WIDGET(gtk_builder_get_object(creds, "auth")); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); + gtk_window_set_transient_for(GTK_WINDOW(dialog), window); - labelMessage = GTK_WIDGET(gtk_builder_get_object(creds, "message")); - credUsername = GTK_WIDGET(gtk_builder_get_object(creds, "cred-username")); - promptUsername = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-username")); - credPassword = GTK_WIDGET(gtk_builder_get_object(creds, "cred-password")); - promptPassword = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-password")); + labelMessage = GTK_WIDGET(gtk_builder_get_object(creds, "message")); + credUsername = GTK_WIDGET(gtk_builder_get_object(creds, "cred-username")); + promptUsername = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-username")); + credPassword = GTK_WIDGET(gtk_builder_get_object(creds, "cred-password")); + promptPassword = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-password")); - gtk_widget_set_sensitive(credUsername, username != NULL); - gtk_widget_set_sensitive(promptUsername, username != NULL); - gtk_widget_set_sensitive(credPassword, password != NULL); - gtk_widget_set_sensitive(promptPassword, password != NULL); + gtk_widget_set_sensitive(credUsername, username != NULL); + gtk_widget_set_sensitive(promptUsername, username != NULL); + gtk_widget_set_sensitive(credPassword, password != NULL); + gtk_widget_set_sensitive(promptPassword, password != NULL); - if (address) { - message = g_strdup_printf("Authentication is required for the %s connection to:\n\n" - "%s\n\n", - type, - address); - } else { - message = g_strdup_printf("Authentication is required for the %s connection:\n", - type); - } + if (address) { + message = g_strdup_printf("Authentication is required for the %s connection to:\n\n" + "%s\n\n", + type, + address); + } else { + message = g_strdup_printf("Authentication is required for the %s connection:\n", + type); + } - gtk_label_set_markup(GTK_LABEL(labelMessage), message); - g_free(message); + gtk_label_set_markup(GTK_LABEL(labelMessage), message); + g_free(message); - gtk_widget_show_all(dialog); - response = gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_hide(dialog); + gtk_widget_show_all(dialog); + response = gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_hide(dialog); - if (response == GTK_RESPONSE_OK) { - if (username) - *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(credUsername))); - if (password) - *password = g_strdup(gtk_entry_get_text(GTK_ENTRY(credPassword))); - } + if (response == GTK_RESPONSE_OK) { + if (username) + *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(credUsername))); + if (password) + *password = g_strdup(gtk_entry_get_text(GTK_ENTRY(credPassword))); + } - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(GTK_WIDGET(dialog)); - return response == GTK_RESPONSE_OK ? 0 : -1; + return response == GTK_RESPONSE_OK ? 0 : -1; } #ifdef HAVE_GTK_VNC void -virt_viewer_auth_vnc_credentials(GtkWidget *vnc, - GValueArray *credList, - char **vncAddress) +virt_viewer_auth_vnc_credentials(GtkWindow *window, + GtkWidget *vnc, + GValueArray *credList, + char *vncAddress) { - char *username = NULL, *password = NULL; - gboolean wantPassword = FALSE, wantUsername = FALSE; - int i; + char *username = NULL, *password = NULL; + gboolean wantPassword = FALSE, wantUsername = FALSE; + int i; - DEBUG_LOG("Got VNC credential request for %d credential(s)", credList->n_values); + DEBUG_LOG("Got VNC credential request for %d credential(s)", credList->n_values); - for (i = 0 ; i < credList->n_values ; i++) { - GValue *cred = g_value_array_get_nth(credList, i); - switch (g_value_get_enum(cred)) { - case VNC_DISPLAY_CREDENTIAL_USERNAME: - wantUsername = TRUE; - break; - case VNC_DISPLAY_CREDENTIAL_PASSWORD: - wantPassword = TRUE; - break; - case VNC_DISPLAY_CREDENTIAL_CLIENTNAME: - break; - default: - DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred)); - vnc_display_close(VNC_DISPLAY(vnc)); - goto cleanup; - } + for (i = 0 ; i < credList->n_values ; i++) { + GValue *cred = g_value_array_get_nth(credList, i); + switch (g_value_get_enum(cred)) { + case VNC_DISPLAY_CREDENTIAL_USERNAME: + wantUsername = TRUE; + break; + case VNC_DISPLAY_CREDENTIAL_PASSWORD: + wantPassword = TRUE; + break; + case VNC_DISPLAY_CREDENTIAL_CLIENTNAME: + break; + default: + DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred)); + vnc_display_close(VNC_DISPLAY(vnc)); + goto cleanup; } + } - if (wantUsername || wantPassword) { - int ret = virt_viewer_auth_collect_credentials("VNC", vncAddress ? *vncAddress : NULL, - wantUsername ? &username : NULL, - wantPassword ? &password : NULL); + if (wantUsername || wantPassword) { + int ret = virt_viewer_auth_collect_credentials(window, + "VNC", vncAddress, + wantUsername ? &username : NULL, + wantPassword ? &password : NULL); - if (ret < 0) { - vnc_display_close(VNC_DISPLAY(vnc)); - goto cleanup; - } + if (ret < 0) { + vnc_display_close(VNC_DISPLAY(vnc)); + goto cleanup; } + } - for (i = 0 ; i < credList->n_values ; i++) { - GValue *cred = g_value_array_get_nth(credList, i); - switch (g_value_get_enum(cred)) { - case VNC_DISPLAY_CREDENTIAL_USERNAME: - if (!username || - vnc_display_set_credential(VNC_DISPLAY(vnc), - g_value_get_enum(cred), - username)) { - DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred)); - vnc_display_close(VNC_DISPLAY(vnc)); - } - break; - case VNC_DISPLAY_CREDENTIAL_PASSWORD: - if (!password || - vnc_display_set_credential(VNC_DISPLAY(vnc), - g_value_get_enum(cred), - password)) { - DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred)); - vnc_display_close(VNC_DISPLAY(vnc)); - } - break; - case VNC_DISPLAY_CREDENTIAL_CLIENTNAME: - if (vnc_display_set_credential(VNC_DISPLAY(vnc), - g_value_get_enum(cred), - "libvirt")) { - DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred)); - vnc_display_close(VNC_DISPLAY(vnc)); - } - break; - default: - DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred)); - vnc_display_close(VNC_DISPLAY(vnc)); - } + for (i = 0 ; i < credList->n_values ; i++) { + GValue *cred = g_value_array_get_nth(credList, i); + switch (g_value_get_enum(cred)) { + case VNC_DISPLAY_CREDENTIAL_USERNAME: + if (!username || + vnc_display_set_credential(VNC_DISPLAY(vnc), + g_value_get_enum(cred), + username)) { + DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred)); + vnc_display_close(VNC_DISPLAY(vnc)); + } + break; + case VNC_DISPLAY_CREDENTIAL_PASSWORD: + if (!password || + vnc_display_set_credential(VNC_DISPLAY(vnc), + g_value_get_enum(cred), + password)) { + DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred)); + vnc_display_close(VNC_DISPLAY(vnc)); + } + break; + case VNC_DISPLAY_CREDENTIAL_CLIENTNAME: + if (vnc_display_set_credential(VNC_DISPLAY(vnc), + g_value_get_enum(cred), + "libvirt")) { + DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred)); + vnc_display_close(VNC_DISPLAY(vnc)); + } + break; + default: + DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred)); + vnc_display_close(VNC_DISPLAY(vnc)); } + } cleanup: - g_free(username); - g_free(password); + g_free(username); + g_free(password); } #endif - -int -virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred, - unsigned int ncred, - void *cbdata) -{ - char **username = NULL, **password = NULL; - const char *uri = cbdata; - int i; - int ret = -1; - - DEBUG_LOG("Got libvirt credential request for %d credential(s)", ncred); - - for (i = 0 ; i < ncred ; i++) { - switch (cred[i].type) { - case VIR_CRED_USERNAME: - case VIR_CRED_AUTHNAME: - username = &cred[i].result; - break; - case VIR_CRED_PASSPHRASE: - password = &cred[i].result; - break; - default: - DEBUG_LOG("Unsupported libvirt credential %d", cred[i].type); - return -1; - } - } - - if (username || password) { - ret = virt_viewer_auth_collect_credentials("libvirt", uri, - username, password); - if (ret < 0) - goto cleanup; - } else { - ret = 0; - } - - for (i = 0 ; i < ncred ; i++) { - switch (cred[i].type) { - case VIR_CRED_AUTHNAME: - case VIR_CRED_USERNAME: - case VIR_CRED_PASSPHRASE: - if (cred[i].result) - cred[i].resultlen = strlen(cred[i].result); - else - cred[i].resultlen = 0; - DEBUG_LOG("Got '%s' %d %d", cred[i].result, cred[i].resultlen, cred[i].type); - break; - } - } - - cleanup: - DEBUG_LOG("Return %d", ret); - return ret; -} - - - - /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-auth.h b/src/virt-viewer-auth.h index 1cbf2b6..5b4c546 100644 --- a/src/virt-viewer-auth.h +++ b/src/virt-viewer-auth.h @@ -1,7 +1,7 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, + * Copyright (C) 2007-2012 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,21 +23,30 @@ #ifndef VIRT_VIEWER_AUTH_H #define VIRT_VIEWER_AUTH_H +#include "config.h" + +#ifdef HAVE_LIBVIRT #include +#endif #include "virt-viewer-util.h" -void virt_viewer_auth_vnc_credentials(GtkWidget *vnc, - GValueArray *credList, - char **message); +void virt_viewer_auth_vnc_credentials(GtkWindow *window, + GtkWidget *vnc, + GValueArray *credList, + char *vncAddress); -int virt_viewer_auth_collect_credentials(const char *type, - const char *address, - char **username, - char **password); - -int virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred, - unsigned int ncred, - void *cbdata); +int virt_viewer_auth_collect_credentials(GtkWindow *window, + const char *type, + const char *address, + char **username, + char **password); #endif +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/virt-viewer-auth.xml b/src/virt-viewer-auth.xml index f45143d..0da1181 100644 --- a/src/virt-viewer-auth.xml +++ b/src/virt-viewer-auth.xml @@ -1,31 +1,86 @@ - + - + False 5 Authentication required + True center-on-parent + True dialog + True + True - + True + False + vertical 2 + + + True + False + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + gtk-ok + True + True + True + True + True + False + True + + + False + False + 3 + + + + + False + True + end + 0 + + True + False 0 0 label True + False + True 1 True + False 2 2 6 @@ -33,6 +88,7 @@ True + False 1 Password: @@ -44,6 +100,7 @@ True + False 1 Username: @@ -63,6 +120,7 @@ True True False + True 1 @@ -73,48 +131,9 @@ + False + True 2 - - - - - True - end - - - gtk-cancel - True - True - True - True - - - False - False - 0 - - - - - gtk-ok - True - True - True - True - True - True - - - False - False - 3 - - - - - False - end - 0 diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c index c73692d..e4f41f9 100644 --- a/src/virt-viewer-display-spice.c +++ b/src/virt-viewer-display-spice.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2009 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -22,6 +22,8 @@ * Author: Daniel P. Berrange */ +#include + #include #include @@ -33,170 +35,203 @@ G_DEFINE_TYPE (VirtViewerDisplaySpice, virt_viewer_display_spice, VIRT_VIEWER_TYPE_DISPLAY) struct _VirtViewerDisplaySpicePrivate { - SpiceChannel *channel; - SpiceDisplay *display; + SpiceChannel *channel; + SpiceDisplay *display; }; #define VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpicePrivate)) static void virt_viewer_display_spice_send_keys(VirtViewerDisplay *display, - const guint *keyvals, - int nkeyvals); + const guint *keyvals, + int nkeyvals); static GdkPixbuf *virt_viewer_display_spice_get_pixbuf(VirtViewerDisplay *display); static void virt_viewer_display_spice_finalize(GObject *obj) { - VirtViewerDisplaySpice *spice = VIRT_VIEWER_DISPLAY_SPICE(obj); - - g_object_unref(spice->priv->display); - g_object_unref(spice->priv->channel); - - G_OBJECT_CLASS(virt_viewer_display_spice_parent_class)->finalize(obj); + VirtViewerDisplaySpice *spice = VIRT_VIEWER_DISPLAY_SPICE(obj); + + g_object_unref(spice->priv->display); + g_object_unref(spice->priv->channel); + + G_OBJECT_CLASS(virt_viewer_display_spice_parent_class)->finalize(obj); } static void virt_viewer_display_spice_class_init(VirtViewerDisplaySpiceClass *klass) { - VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass); - GObjectClass *oclass = G_OBJECT_CLASS(klass); - - oclass->finalize = virt_viewer_display_spice_finalize; - - dclass->send_keys = virt_viewer_display_spice_send_keys; - dclass->get_pixbuf = virt_viewer_display_spice_get_pixbuf; - - g_type_class_add_private(oclass, sizeof(VirtViewerDisplaySpicePrivate)); + VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass); + GObjectClass *oclass = G_OBJECT_CLASS(klass); + + oclass->finalize = virt_viewer_display_spice_finalize; + + dclass->send_keys = virt_viewer_display_spice_send_keys; + dclass->get_pixbuf = virt_viewer_display_spice_get_pixbuf; + + g_type_class_add_private(klass, sizeof(VirtViewerDisplaySpicePrivate)); } static void virt_viewer_display_spice_init(VirtViewerDisplaySpice *self G_GNUC_UNUSED) { - self->priv = VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(self); + self->priv = VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(self); } static void virt_viewer_display_spice_send_keys(VirtViewerDisplay *display, - const guint *keyvals, - int nkeyvals) -{ - VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display); - - g_return_if_fail(self != NULL); - g_return_if_fail(self->priv->display != NULL); - - spice_display_send_keys(self->priv->display, keyvals, nkeyvals, SPICE_DISPLAY_KEY_EVENT_CLICK); + const guint *keyvals, + int nkeyvals) +{ + VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display); + + g_return_if_fail(self != NULL); + g_return_if_fail(self->priv->display != NULL); + + spice_display_send_keys(self->priv->display, keyvals, nkeyvals, SPICE_DISPLAY_KEY_EVENT_CLICK); } static GdkPixbuf * virt_viewer_display_spice_get_pixbuf(VirtViewerDisplay *display) { - VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display); - - g_return_val_if_fail(self != NULL, NULL); - g_return_val_if_fail(self->priv->display != NULL, NULL); - - return spice_display_get_pixbuf(self->priv->display); + VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display); + + g_return_val_if_fail(self != NULL, NULL); + g_return_val_if_fail(self->priv->display != NULL, NULL); + + return spice_display_get_pixbuf(self->priv->display); } static void display_mark(SpiceChannel *channel G_GNUC_UNUSED, - gint mark, - VirtViewerDisplay *display) -{ - DEBUG_LOG("display mark %d", mark); - - virt_viewer_display_set_show_hint(display, mark); + gint mark, + VirtViewerDisplay *display) +{ + DEBUG_LOG("display mark %d", mark); + + virt_viewer_display_set_show_hint(display, mark); } static void primary_create(SpiceChannel *channel G_GNUC_UNUSED, - gint format G_GNUC_UNUSED, - gint width, - gint height, - gint stride G_GNUC_UNUSED, - gint shmid G_GNUC_UNUSED, - gpointer imgdata G_GNUC_UNUSED, - VirtViewerDisplay *display) -{ - DEBUG_LOG("spice desktop resize %dx%d", width, height); - - virt_viewer_display_set_desktop_size(display, width, height); + gint format G_GNUC_UNUSED, + gint width, + gint height, + gint stride G_GNUC_UNUSED, + gint shmid G_GNUC_UNUSED, + gpointer imgdata G_GNUC_UNUSED, + VirtViewerDisplay *display) +{ + DEBUG_LOG("spice desktop resize %dx%d", width, height); + + virt_viewer_display_set_desktop_size(display, width, height); } static void virt_viewer_display_spice_keyboard_grab(SpiceDisplay *display G_GNUC_UNUSED, - int grabbed, - VirtViewerDisplaySpice *self) -{ - if (grabbed) - g_signal_emit_by_name(self, "display-keyboard-grab"); - else - g_signal_emit_by_name(self, "display-keyboard-ungrab"); + int grabbed, + VirtViewerDisplaySpice *self) +{ + if (grabbed) + g_signal_emit_by_name(self, "display-keyboard-grab"); + else + g_signal_emit_by_name(self, "display-keyboard-ungrab"); } static void virt_viewer_display_spice_mouse_grab(SpiceDisplay *display G_GNUC_UNUSED, - int grabbed, - VirtViewerDisplaySpice *self) -{ - if (grabbed) - g_signal_emit_by_name(self, "display-pointer-grab"); - else - g_signal_emit_by_name(self, "display-pointer-ungrab"); + int grabbed, + VirtViewerDisplaySpice *self) +{ + if (grabbed) + g_signal_emit_by_name(self, "display-pointer-grab"); + else + g_signal_emit_by_name(self, "display-pointer-ungrab"); +} + + +static void +virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self, + GtkAllocation *allocation, + gpointer data G_GNUC_UNUSED) +{ + gdouble dw = allocation->width, dh = allocation->height; + guint zoom = 100; + guint channelid; + + if (virt_viewer_display_get_auto_resize(VIRT_VIEWER_DISPLAY(self)) == FALSE) + return; + + if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) { + zoom = virt_viewer_display_get_zoom_level(VIRT_VIEWER_DISPLAY(self)); + + dw /= ((double)zoom / 100.0); + dh /= ((double)zoom / 100.0); + } + + g_object_get(self->priv->channel, "channel-id", &channelid, NULL); + + SpiceMainChannel *main_channel = virt_viewer_session_spice_get_main_channel( + VIRT_VIEWER_SESSION_SPICE(virt_viewer_display_get_session(VIRT_VIEWER_DISPLAY(self)))); + spice_main_set_display(main_channel, + channelid, + 0, 0, dw, dh); } GtkWidget * -virt_viewer_display_spice_new(SpiceChannel *channel, - SpiceDisplay *display) -{ - VirtViewerDisplaySpice *self; - gint channelid; - - g_return_val_if_fail(SPICE_IS_DISPLAY_CHANNEL(channel), NULL); - g_return_val_if_fail(SPICE_IS_DISPLAY(display), NULL); - - g_object_get(channel, "channel-id", &channelid, NULL); - - self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_SPICE, - "nth-display", channelid, - NULL); - self->priv->channel = g_object_ref(channel); - self->priv->display = g_object_ref(display); - - g_signal_connect(channel, "display-primary-create", - G_CALLBACK(primary_create), self); - g_signal_connect(channel, "display-mark", - G_CALLBACK(display_mark), self); - - gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(self->priv->display)); - gtk_widget_show(GTK_WIDGET(self->priv->display)); - g_object_set(self->priv->display, - "grab-keyboard", TRUE, - "grab-mouse", TRUE, - "resize-guest", FALSE, - "scaling", TRUE, - "auto-clipboard", TRUE, - NULL); - - g_signal_connect(self->priv->display, - "keyboard-grab", - G_CALLBACK(virt_viewer_display_spice_keyboard_grab), self); - g_signal_connect(self->priv->display, - "mouse-grab", - G_CALLBACK(virt_viewer_display_spice_mouse_grab), self); - - return GTK_WIDGET(self); +virt_viewer_display_spice_new(VirtViewerSessionSpice *session, + SpiceChannel *channel, + SpiceDisplay *display) +{ + VirtViewerDisplaySpice *self; + gint channelid; + + g_return_val_if_fail(SPICE_IS_DISPLAY_CHANNEL(channel), NULL); + g_return_val_if_fail(SPICE_IS_DISPLAY(display), NULL); + + g_object_get(channel, "channel-id", &channelid, NULL); + + self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_SPICE, + "session", session, + "nth-display", channelid, + NULL); + self->priv->channel = g_object_ref(channel); + self->priv->display = g_object_ref(display); + + g_signal_connect(channel, "display-primary-create", + G_CALLBACK(primary_create), self); + g_signal_connect(channel, "display-mark", + G_CALLBACK(display_mark), self); + + gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(self->priv->display)); + gtk_widget_show(GTK_WIDGET(self->priv->display)); + g_object_set(self->priv->display, + "grab-keyboard", TRUE, + "grab-mouse", TRUE, + "resize-guest", FALSE, + "scaling", TRUE, + NULL); + + g_signal_connect(self->priv->display, + "keyboard-grab", + G_CALLBACK(virt_viewer_display_spice_keyboard_grab), self); + g_signal_connect(self->priv->display, + "mouse-grab", + G_CALLBACK(virt_viewer_display_spice_mouse_grab), self); + g_signal_connect(self, + "size-allocate", + G_CALLBACK(virt_viewer_display_spice_size_allocate), self); + + + return GTK_WIDGET(self); } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-display-spice.h b/src/virt-viewer-display-spice.h index 90bd1d0..eecc03e 100644 --- a/src/virt-viewer-display-spice.h +++ b/src/virt-viewer-display-spice.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -29,53 +29,54 @@ #include #include "virt-viewer-display.h" +#include "virt-viewer-session-spice.h" G_BEGIN_DECLS #define VIRT_VIEWER_TYPE_DISPLAY_SPICE virt_viewer_display_spice_get_type() -#define VIRT_VIEWER_DISPLAY_SPICE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpice)) +#define VIRT_VIEWER_DISPLAY_SPICE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpice)) -#define VIRT_VIEWER_DISPLAY_SPICE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass)) +#define VIRT_VIEWER_DISPLAY_SPICE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass)) -#define VIRT_VIEWER_IS_DISPLAY_SPICE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE)) +#define VIRT_VIEWER_IS_DISPLAY_SPICE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE)) -#define VIRT_VIEWER_IS_DISPLAY_SPICE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE)) +#define VIRT_VIEWER_IS_DISPLAY_SPICE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE)) -#define VIRT_VIEWER_DISPLAY_SPICE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass)) +#define VIRT_VIEWER_DISPLAY_SPICE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass)) typedef struct _VirtViewerDisplaySpice VirtViewerDisplaySpice; typedef struct _VirtViewerDisplaySpiceClass VirtViewerDisplaySpiceClass; typedef struct _VirtViewerDisplaySpicePrivate VirtViewerDisplaySpicePrivate; struct _VirtViewerDisplaySpice { - VirtViewerDisplay parent; + VirtViewerDisplay parent; - VirtViewerDisplaySpicePrivate *priv; + VirtViewerDisplaySpicePrivate *priv; }; struct _VirtViewerDisplaySpiceClass { - VirtViewerDisplayClass parent_class; + VirtViewerDisplayClass parent_class; }; GType virt_viewer_display_spice_get_type(void); -GtkWidget* virt_viewer_display_spice_new(SpiceChannel *channel, - SpiceDisplay *display); +GtkWidget* virt_viewer_display_spice_new(VirtViewerSessionSpice *session, + SpiceChannel *channel, + SpiceDisplay *display); G_END_DECLS #endif /* _VIRT_VIEWER_DISPLAY_SPICE_H */ - /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-display-vnc.c b/src/virt-viewer-display-vnc.c index 5dd9744..878740f 100644 --- a/src/virt-viewer-display-vnc.c +++ b/src/virt-viewer-display-vnc.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -22,6 +22,8 @@ * Author: Daniel P. Berrange */ +#include + #include "virt-viewer-auth.h" #include "virt-viewer-display-vnc.h" @@ -30,7 +32,7 @@ G_DEFINE_TYPE(VirtViewerDisplayVnc, virt_viewer_display_vnc, VIRT_VIEWER_TYPE_DISPLAY) struct _VirtViewerDisplayVncPrivate { - VncDisplay *vnc; + VncDisplay *vnc; }; #define VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncPrivate)) @@ -41,88 +43,88 @@ static void virt_viewer_display_vnc_finalize(GObject *obj) { - VirtViewerDisplayVnc *vnc = VIRT_VIEWER_DISPLAY_VNC(obj); + VirtViewerDisplayVnc *vnc = VIRT_VIEWER_DISPLAY_VNC(obj); - g_object_unref(vnc->priv->vnc); + g_object_unref(vnc->priv->vnc); - G_OBJECT_CLASS(virt_viewer_display_vnc_parent_class)->finalize(obj); + G_OBJECT_CLASS(virt_viewer_display_vnc_parent_class)->finalize(obj); } static void virt_viewer_display_vnc_class_init(VirtViewerDisplayVncClass *klass) { - VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass); - GObjectClass *oclass = G_OBJECT_CLASS(klass); + VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass); + GObjectClass *oclass = G_OBJECT_CLASS(klass); - oclass->finalize = virt_viewer_display_vnc_finalize; + oclass->finalize = virt_viewer_display_vnc_finalize; - dclass->send_keys = virt_viewer_display_vnc_send_keys; - dclass->get_pixbuf = virt_viewer_display_vnc_get_pixbuf; + dclass->send_keys = virt_viewer_display_vnc_send_keys; + dclass->get_pixbuf = virt_viewer_display_vnc_get_pixbuf; - g_type_class_add_private(oclass, sizeof(VirtViewerDisplayVncPrivate)); + g_type_class_add_private(klass, sizeof(VirtViewerDisplayVncPrivate)); } static void virt_viewer_display_vnc_init(VirtViewerDisplayVnc *self G_GNUC_UNUSED) { - self->priv = VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(self); + self->priv = VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(self); } static void virt_viewer_display_vnc_mouse_grab(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerDisplay *display) + VirtViewerDisplay *display) { - g_signal_emit_by_name(display, "display-pointer-grab"); + g_signal_emit_by_name(display, "display-pointer-grab"); } static void virt_viewer_display_vnc_mouse_ungrab(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerDisplay *display) + VirtViewerDisplay *display) { - g_signal_emit_by_name(display, "display-pointer-ungrab"); + g_signal_emit_by_name(display, "display-pointer-ungrab"); } static void virt_viewer_display_vnc_key_grab(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerDisplay *display) + VirtViewerDisplay *display) { - g_signal_emit_by_name(display, "display-keyboard-grab"); + g_signal_emit_by_name(display, "display-keyboard-grab"); } static void virt_viewer_display_vnc_key_ungrab(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerDisplay *display) + VirtViewerDisplay *display) { - g_signal_emit_by_name(display, "display-keyboard-ungrab"); + g_signal_emit_by_name(display, "display-keyboard-ungrab"); } static void virt_viewer_display_vnc_send_keys(VirtViewerDisplay* display, - const guint *keyvals, - int nkeyvals) + const guint *keyvals, + int nkeyvals) { - VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display); + VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display); - g_return_if_fail(self != NULL); - g_return_if_fail(keyvals != NULL); - g_return_if_fail(self->priv->vnc != NULL); + g_return_if_fail(self != NULL); + g_return_if_fail(keyvals != NULL); + g_return_if_fail(self->priv->vnc != NULL); - vnc_display_send_keys(self->priv->vnc, keyvals, nkeyvals); + vnc_display_send_keys(self->priv->vnc, keyvals, nkeyvals); } static GdkPixbuf * virt_viewer_display_vnc_get_pixbuf(VirtViewerDisplay* display) { - VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display); + VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display); - g_return_val_if_fail(self != NULL, NULL); - g_return_val_if_fail(self->priv->vnc != NULL, NULL); + g_return_val_if_fail(self != NULL, NULL); + g_return_val_if_fail(self->priv->vnc != NULL, NULL); - return vnc_display_get_pixbuf(self->priv->vnc); + return vnc_display_get_pixbuf(self->priv->vnc); } @@ -134,65 +136,62 @@ */ static void virt_viewer_display_vnc_resize_desktop(VncDisplay *vnc G_GNUC_UNUSED, - int width, int height, - VirtViewerDisplay *display) + int width, int height, + VirtViewerDisplay *display) { - DEBUG_LOG("desktop resize %dx%d", width, height); + DEBUG_LOG("desktop resize %dx%d", width, height); - virt_viewer_display_set_desktop_size(display, width, height); + virt_viewer_display_set_desktop_size(display, width, height); } GtkWidget * virt_viewer_display_vnc_new(VncDisplay *vnc) { - VirtViewerDisplayVnc *display; + VirtViewerDisplayVnc *display; - display = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_VNC, NULL); + display = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_VNC, NULL); - g_object_ref(vnc); - g_object_ref(vnc); /* Because gtk_container_add steals the first ref */ - display->priv->vnc = vnc; + g_object_ref(vnc); + g_object_ref(vnc); /* Because gtk_container_add steals the first ref */ + display->priv->vnc = vnc; - gtk_container_add(GTK_CONTAINER(display), GTK_WIDGET(display->priv->vnc)); - vnc_display_set_keyboard_grab(display->priv->vnc, TRUE); - vnc_display_set_pointer_grab(display->priv->vnc, TRUE); + gtk_container_add(GTK_CONTAINER(display), GTK_WIDGET(display->priv->vnc)); + vnc_display_set_keyboard_grab(display->priv->vnc, TRUE); + vnc_display_set_pointer_grab(display->priv->vnc, TRUE); - /* - * In auto-resize mode we have things setup so that we always - * automatically resize the top level window to be exactly the - * same size as the VNC desktop, except when it won't fit on - * the local screen, at which point we let it scale down. - * The upshot is, we always want scaling enabled. - * We disable force_size because we want to allow user to - * manually size the widget smaller too - */ - vnc_display_set_force_size(display->priv->vnc, FALSE); - vnc_display_set_scaling(display->priv->vnc, TRUE); + /* + * In auto-resize mode we have things setup so that we always + * automatically resize the top level window to be exactly the + * same size as the VNC desktop, except when it won't fit on + * the local screen, at which point we let it scale down. + * The upshot is, we always want scaling enabled. + * We disable force_size because we want to allow user to + * manually size the widget smaller too + */ + vnc_display_set_force_size(display->priv->vnc, FALSE); + vnc_display_set_scaling(display->priv->vnc, TRUE); - /* When VNC desktop resizes, we have to resize the containing widget */ - g_signal_connect(display->priv->vnc, "vnc-desktop-resize", - G_CALLBACK(virt_viewer_display_vnc_resize_desktop), display); + /* When VNC desktop resizes, we have to resize the containing widget */ + g_signal_connect(display->priv->vnc, "vnc-desktop-resize", + G_CALLBACK(virt_viewer_display_vnc_resize_desktop), display); - g_signal_connect(display->priv->vnc, "vnc-pointer-grab", - G_CALLBACK(virt_viewer_display_vnc_mouse_grab), display); - g_signal_connect(display->priv->vnc, "vnc-pointer-ungrab", - G_CALLBACK(virt_viewer_display_vnc_mouse_ungrab), display); - g_signal_connect(display->priv->vnc, "vnc-keyboard-grab", - G_CALLBACK(virt_viewer_display_vnc_key_grab), display); - g_signal_connect(display->priv->vnc, "vnc-keyboard-ungrab", - G_CALLBACK(virt_viewer_display_vnc_key_ungrab), display); + g_signal_connect(display->priv->vnc, "vnc-pointer-grab", + G_CALLBACK(virt_viewer_display_vnc_mouse_grab), display); + g_signal_connect(display->priv->vnc, "vnc-pointer-ungrab", + G_CALLBACK(virt_viewer_display_vnc_mouse_ungrab), display); + g_signal_connect(display->priv->vnc, "vnc-keyboard-grab", + G_CALLBACK(virt_viewer_display_vnc_key_grab), display); + g_signal_connect(display->priv->vnc, "vnc-keyboard-ungrab", + G_CALLBACK(virt_viewer_display_vnc_key_ungrab), display); - return GTK_WIDGET(display); + return GTK_WIDGET(display); } - - - /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-display-vnc.h b/src/virt-viewer-display-vnc.h index ce9ec5f..7020437 100644 --- a/src/virt-viewer-display-vnc.h +++ b/src/virt-viewer-display-vnc.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -33,33 +33,33 @@ #define VIRT_VIEWER_TYPE_DISPLAY_VNC virt_viewer_display_vnc_get_type() -#define VIRT_VIEWER_DISPLAY_VNC(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVnc)) +#define VIRT_VIEWER_DISPLAY_VNC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVnc)) -#define VIRT_VIEWER_DISPLAY_VNC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass)) +#define VIRT_VIEWER_DISPLAY_VNC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass)) -#define VIRT_VIEWER_IS_DISPLAY_VNC(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC)) +#define VIRT_VIEWER_IS_DISPLAY_VNC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC)) -#define VIRT_VIEWER_IS_DISPLAY_VNC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC)) +#define VIRT_VIEWER_IS_DISPLAY_VNC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC)) -#define VIRT_VIEWER_DISPLAY_VNC_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass)) +#define VIRT_VIEWER_DISPLAY_VNC_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass)) typedef struct _VirtViewerDisplayVnc VirtViewerDisplayVnc; typedef struct _VirtViewerDisplayVncClass VirtViewerDisplayVncClass; typedef struct _VirtViewerDisplayVncPrivate VirtViewerDisplayVncPrivate; struct _VirtViewerDisplayVnc { - VirtViewerDisplay parent; + VirtViewerDisplay parent; - VirtViewerDisplayVncPrivate *priv; + VirtViewerDisplayVncPrivate *priv; }; struct _VirtViewerDisplayVncClass { - VirtViewerDisplayClass parent_class; + VirtViewerDisplayClass parent_class; }; GType virt_viewer_display_vnc_get_type(void); @@ -69,11 +69,10 @@ G_END_DECLS #endif /* _VIRT_VIEWER_DISPLAY_VNC_H */ - /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c index fe25a8e..5b2cdc1 100644 --- a/src/virt-viewer-display.c +++ b/src/virt-viewer-display.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -26,6 +26,7 @@ #include +#include "virt-viewer-session.h" #include "virt-viewer-display.h" #include "virt-viewer-util.h" @@ -33,475 +34,543 @@ struct _VirtViewerDisplayPrivate { - gboolean dirty; - guint desktopWidth; - guint desktopHeight; - guint zoom_level; - gboolean zoom; - gint nth_display; - gint show_hint; + gboolean dirty; + guint desktopWidth; + guint desktopHeight; + guint zoom_level; + gboolean zoom; + gint nth_display; + gint show_hint; + VirtViewerSession *session; + gboolean auto_resize; }; static void virt_viewer_display_size_request(GtkWidget *widget, - GtkRequisition *requisition); + GtkRequisition *requisition); #if GTK_CHECK_VERSION(3, 0, 0) static void virt_viewer_display_get_preferred_width(GtkWidget *widget, - int *minwidth, - int *defwidth); + int *minwidth, + int *defwidth); static void virt_viewer_display_get_preferred_height(GtkWidget *widget, - int *minheight, - int *defheight); + int *minheight, + int *defheight); #endif static void virt_viewer_display_size_allocate(GtkWidget *widget, - GtkAllocation *allocation); + GtkAllocation *allocation); static void virt_viewer_display_set_property(GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); + guint prop_id, + const GValue *value, + GParamSpec *pspec); static void virt_viewer_display_get_property(GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void virt_viewer_display_grab_focus(GtkWidget *widget); G_DEFINE_ABSTRACT_TYPE(VirtViewerDisplay, virt_viewer_display, GTK_TYPE_BIN) enum { - PROP_0, - - PROP_DESKTOP_WIDTH, - PROP_DESKTOP_HEIGHT, - PROP_NTH_DISPLAY, - PROP_ZOOM, - PROP_ZOOM_LEVEL, - PROP_SHOW_HINT, + PROP_0, + + PROP_DESKTOP_WIDTH, + PROP_DESKTOP_HEIGHT, + PROP_NTH_DISPLAY, + PROP_ZOOM, + PROP_ZOOM_LEVEL, + PROP_SHOW_HINT, + PROP_SESSION, }; static void virt_viewer_display_class_init(VirtViewerDisplayClass *class) { - GObjectClass *object_class = G_OBJECT_CLASS(class); - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class); - - object_class->set_property = virt_viewer_display_set_property; - object_class->get_property = virt_viewer_display_get_property; + GObjectClass *object_class = G_OBJECT_CLASS(class); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class); + + object_class->set_property = virt_viewer_display_set_property; + object_class->get_property = virt_viewer_display_get_property; #if GTK_CHECK_VERSION(3, 0, 0) - widget_class->get_preferred_width = virt_viewer_display_get_preferred_width; - widget_class->get_preferred_height = virt_viewer_display_get_preferred_height; + widget_class->get_preferred_width = virt_viewer_display_get_preferred_width; + widget_class->get_preferred_height = virt_viewer_display_get_preferred_height; #else - widget_class->size_request = virt_viewer_display_size_request; + widget_class->size_request = virt_viewer_display_size_request; #endif - widget_class->size_allocate = virt_viewer_display_size_allocate; - - g_object_class_install_property(object_class, - PROP_DESKTOP_WIDTH, - g_param_spec_int("desktop-width", - "Width", - "Desktop width", - 100, - G_MAXINT32, - 100, - G_PARAM_READWRITE)); - - g_object_class_install_property(object_class, - PROP_DESKTOP_HEIGHT, - g_param_spec_int("desktop-height", - "Height", - "Desktop height", - 100, - G_MAXINT32, - 100, - G_PARAM_READWRITE)); - - g_object_class_install_property(object_class, - PROP_ZOOM, - g_param_spec_boolean("zoom", - "Zoom", - "Zoom", - TRUE, - G_PARAM_READWRITE)); - - g_object_class_install_property(object_class, - PROP_ZOOM_LEVEL, - g_param_spec_int("zoom-level", - "Zoom", - "Zoom level", - 10, - 400, - 100, - G_PARAM_READWRITE)); - - g_object_class_install_property(object_class, - PROP_NTH_DISPLAY, - g_param_spec_int("nth-display", - "Nth display", - "Nth display", - 0, - G_MAXINT32, - 0, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property(object_class, - PROP_SHOW_HINT, - g_param_spec_int("show-hint", - "Show hint", - "Show state hint", - 0, - G_MAXINT32, - 0, - G_PARAM_READABLE)); - - - g_signal_new("display-pointer-grab", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_grab), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_signal_new("display-pointer-ungrab", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_ungrab), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_signal_new("display-keyboard-grab", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_grab), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_signal_new("display-keyboard-ungrab", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_ungrab), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_signal_new("display-desktop-resize", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerDisplayClass, display_desktop_resize), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_type_class_add_private(object_class, sizeof(VirtViewerDisplayPrivate)); + widget_class->size_allocate = virt_viewer_display_size_allocate; + widget_class->grab_focus = virt_viewer_display_grab_focus; + + g_object_class_install_property(object_class, + PROP_DESKTOP_WIDTH, + g_param_spec_int("desktop-width", + "Width", + "Desktop width", + 100, + G_MAXINT32, + 100, + G_PARAM_READWRITE)); + + g_object_class_install_property(object_class, + PROP_DESKTOP_HEIGHT, + g_param_spec_int("desktop-height", + "Height", + "Desktop height", + 100, + G_MAXINT32, + 100, + G_PARAM_READWRITE)); + + g_object_class_install_property(object_class, + PROP_ZOOM, + g_param_spec_boolean("zoom", + "Zoom", + "Zoom", + TRUE, + G_PARAM_READWRITE)); + + g_object_class_install_property(object_class, + PROP_ZOOM_LEVEL, + g_param_spec_int("zoom-level", + "Zoom", + "Zoom level", + 10, + 400, + 100, + G_PARAM_READWRITE)); + + g_object_class_install_property(object_class, + PROP_NTH_DISPLAY, + g_param_spec_int("nth-display", + "Nth display", + "Nth display", + 0, + G_MAXINT32, + 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property(object_class, + PROP_SHOW_HINT, + g_param_spec_int("show-hint", + "Show hint", + "Show state hint", + 0, + G_MAXINT32, + 0, + G_PARAM_READABLE)); + + g_object_class_install_property(object_class, + PROP_SESSION, + g_param_spec_object("session", + "Session", + "VirtSession", + VIRT_VIEWER_TYPE_SESSION, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + + g_signal_new("display-pointer-grab", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_grab), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("display-pointer-ungrab", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_ungrab), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("display-keyboard-grab", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_grab), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("display-keyboard-ungrab", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_ungrab), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("display-desktop-resize", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerDisplayClass, display_desktop_resize), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_type_class_add_private(class, sizeof(VirtViewerDisplayPrivate)); } static void virt_viewer_display_init(VirtViewerDisplay *display) { - gtk_widget_set_has_window(GTK_WIDGET(display), FALSE); - gtk_widget_set_redraw_on_allocate(GTK_WIDGET(display), FALSE); - - display->priv = VIRT_VIEWER_DISPLAY_GET_PRIVATE(display); - - display->priv->desktopWidth = 100; - display->priv->desktopHeight = 100; - display->priv->zoom_level = 100; - display->priv->zoom = TRUE; - display->priv->dirty = TRUE; + gtk_widget_set_has_window(GTK_WIDGET(display), FALSE); + gtk_widget_set_redraw_on_allocate(GTK_WIDGET(display), FALSE); + + display->priv = VIRT_VIEWER_DISPLAY_GET_PRIVATE(display); + + display->priv->desktopWidth = 100; + display->priv->desktopHeight = 100; + display->priv->zoom_level = 100; + display->priv->zoom = TRUE; + display->priv->dirty = TRUE; + display->priv->auto_resize = TRUE; } GtkWidget* virt_viewer_display_new(void) { - return g_object_new(VIRT_VIEWER_TYPE_DISPLAY, NULL); + return g_object_new(VIRT_VIEWER_TYPE_DISPLAY, NULL); } static void virt_viewer_display_set_property(GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object); - VirtViewerDisplayPrivate *priv = display->priv; - - switch (prop_id) { - case PROP_DESKTOP_WIDTH: - virt_viewer_display_set_desktop_size(display, - g_value_get_int(value), - priv->desktopHeight); - break; - case PROP_DESKTOP_HEIGHT: - virt_viewer_display_set_desktop_size(display, - priv->desktopWidth, - g_value_get_int(value)); - break; - case PROP_NTH_DISPLAY: - priv->nth_display = g_value_get_int(value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object); + VirtViewerDisplayPrivate *priv = display->priv; + + switch (prop_id) { + case PROP_DESKTOP_WIDTH: + virt_viewer_display_set_desktop_size(display, + g_value_get_int(value), + priv->desktopHeight); + break; + case PROP_DESKTOP_HEIGHT: + virt_viewer_display_set_desktop_size(display, + priv->desktopWidth, + g_value_get_int(value)); + break; + case PROP_NTH_DISPLAY: + priv->nth_display = g_value_get_int(value); + break; + case PROP_SESSION: + g_warn_if_fail(priv->session == NULL); + priv->session = g_value_dup_object(value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } } static void virt_viewer_display_get_property(GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object); - VirtViewerDisplayPrivate *priv = display->priv; - - switch (prop_id) { - case PROP_DESKTOP_WIDTH: - g_value_set_int(value, priv->desktopWidth); - break; - case PROP_DESKTOP_HEIGHT: - g_value_set_int(value, priv->desktopHeight); - break; - case PROP_NTH_DISPLAY: - g_value_set_int(value, priv->nth_display); - break; - case PROP_SHOW_HINT: - g_value_set_int(value, priv->show_hint); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object); + VirtViewerDisplayPrivate *priv = display->priv; + + switch (prop_id) { + case PROP_DESKTOP_WIDTH: + g_value_set_int(value, priv->desktopWidth); + break; + case PROP_DESKTOP_HEIGHT: + g_value_set_int(value, priv->desktopHeight); + break; + case PROP_NTH_DISPLAY: + g_value_set_int(value, priv->nth_display); + break; + case PROP_SHOW_HINT: + g_value_set_int(value, priv->show_hint); + break; + case PROP_SESSION: + g_value_set_object(value, virt_viewer_display_get_session(display)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static void +virt_viewer_display_grab_focus(GtkWidget *widget) +{ + GtkBin *bin = GTK_BIN(widget); + + gtk_widget_grab_focus(gtk_bin_get_child(bin)); } static gboolean virt_viewer_display_idle(gpointer opaque) { - VirtViewerDisplay *display = opaque; - VirtViewerDisplayPrivate *priv = display->priv; - if (!priv->dirty) - gtk_widget_queue_resize_no_redraw(GTK_WIDGET(display)); - return FALSE; + VirtViewerDisplay *display = opaque; + VirtViewerDisplayPrivate *priv = display->priv; + if (!priv->dirty) + gtk_widget_queue_resize_no_redraw(GTK_WIDGET(display)); + return FALSE; } static void virt_viewer_display_size_request(GtkWidget *widget, - GtkRequisition *requisition) -{ - VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget); - VirtViewerDisplayPrivate *priv = display->priv; - int border_width = gtk_container_get_border_width(GTK_CONTAINER(widget)); - - requisition->width = border_width * 2; - requisition->height = border_width * 2; - - if (priv->dirty) { - if (priv->zoom) - requisition->width += priv->desktopWidth * priv->zoom_level / 100; - else - requisition->width += priv->desktopWidth; - } else { - requisition->width += 50; - } - if (priv->dirty) { - if (priv->zoom) - requisition->height += priv->desktopHeight * priv->zoom_level / 100; - else - requisition->height += priv->desktopHeight; - } else { - requisition->height += 50; - } - - DEBUG_LOG("Display size request %dx%d (desktop %dx%d)", - requisition->width, requisition->height, - priv->desktopWidth, priv->desktopHeight); + GtkRequisition *requisition) +{ + VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget); + VirtViewerDisplayPrivate *priv = display->priv; + int border_width = gtk_container_get_border_width(GTK_CONTAINER(widget)); + + requisition->width = border_width * 2; + requisition->height = border_width * 2; + + if (priv->dirty) { + if (priv->zoom) + requisition->width += priv->desktopWidth * priv->zoom_level / 100; + else + requisition->width += priv->desktopWidth; + } else { + requisition->width += 50; + } + if (priv->dirty) { + if (priv->zoom) + requisition->height += priv->desktopHeight * priv->zoom_level / 100; + else + requisition->height += priv->desktopHeight; + } else { + requisition->height += 50; + } + + DEBUG_LOG("Display size request %dx%d (desktop %dx%d)", + requisition->width, requisition->height, + priv->desktopWidth, priv->desktopHeight); } #if GTK_CHECK_VERSION(3, 0, 0) static void virt_viewer_display_get_preferred_width(GtkWidget *widget, - int *minwidth, - int *defwidth) -{ - GtkRequisition req; - - virt_viewer_display_size_request(widget, &req); - - *minwidth = *defwidth = req.width; + int *minwidth, + int *defwidth) +{ + GtkRequisition req; + + virt_viewer_display_size_request(widget, &req); + + *minwidth = *defwidth = req.width; } static void virt_viewer_display_get_preferred_height(GtkWidget *widget, - int *minheight, - int *defheight) -{ - GtkRequisition req; - - virt_viewer_display_size_request(widget, &req); - - *minheight = *defheight = req.height; + int *minheight, + int *defheight) +{ + GtkRequisition req; + + virt_viewer_display_size_request(widget, &req); + + *minheight = *defheight = req.height; } #endif static void virt_viewer_display_size_allocate(GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkBin *bin = GTK_BIN(widget); - VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget); - VirtViewerDisplayPrivate *priv = display->priv; - GtkAllocation child_allocation; - gint width, height; - gint border_width; - double desktopAspect; - double actualAspect; - GtkWidget *child = gtk_bin_get_child(bin); - - DEBUG_LOG("Allocated %dx%d", allocation->width, allocation->height); - gtk_widget_set_allocation(widget, allocation); - - desktopAspect = (double)priv->desktopWidth / (double)priv->desktopHeight; - - if (child && gtk_widget_get_visible(child)) { - border_width = gtk_container_get_border_width(GTK_CONTAINER(display)); - - width = MAX(1, allocation->width - 2 * border_width); - height = MAX(1, allocation->height - 2 * border_width); - actualAspect = (double)width / (double)height; - - if (actualAspect > desktopAspect) { - child_allocation.width = height * desktopAspect; - child_allocation.height = height; - } else { - child_allocation.width = width; - child_allocation.height = width / desktopAspect; - } - - child_allocation.x = 0.5 * (width - child_allocation.width) + allocation->x + border_width; - child_allocation.y = 0.5 * (height - child_allocation.height) + allocation->y + border_width; - - DEBUG_LOG("Child allocate %dx%d", child_allocation.width, child_allocation.height); - gtk_widget_size_allocate(child, &child_allocation); - } - - - /* This unsets the size request, so that the user can - * manually resize the window smaller again - */ - if (priv->dirty) { - g_idle_add(virt_viewer_display_idle, widget); - priv->dirty = FALSE; - } + GtkAllocation *allocation) +{ + GtkBin *bin = GTK_BIN(widget); + VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget); + VirtViewerDisplayPrivate *priv = display->priv; + GtkAllocation child_allocation; + gint width, height; + gint border_width; + double desktopAspect; + double actualAspect; + GtkWidget *child = gtk_bin_get_child(bin); + + DEBUG_LOG("Allocated %dx%d", allocation->width, allocation->height); + gtk_widget_set_allocation(widget, allocation); + + desktopAspect = (double)priv->desktopWidth / (double)priv->desktopHeight; + + if (child && gtk_widget_get_visible(child)) { + border_width = gtk_container_get_border_width(GTK_CONTAINER(display)); + + width = MAX(1, allocation->width - 2 * border_width); + height = MAX(1, allocation->height - 2 * border_width); + actualAspect = (double)width / (double)height; + + if (actualAspect > desktopAspect) { + child_allocation.width = height * desktopAspect; + child_allocation.height = height; + } else { + child_allocation.width = width; + child_allocation.height = width / desktopAspect; + } + + child_allocation.x = 0.5 * (width - child_allocation.width) + allocation->x + border_width; + child_allocation.y = 0.5 * (height - child_allocation.height) + allocation->y + border_width; + + DEBUG_LOG("Child allocate %dx%d", child_allocation.width, child_allocation.height); + gtk_widget_size_allocate(child, &child_allocation); + } + + + /* This unsets the size request, so that the user can + * manually resize the window smaller again + */ + if (priv->dirty) { + g_idle_add(virt_viewer_display_idle, widget); + priv->dirty = FALSE; + } } void virt_viewer_display_set_desktop_size(VirtViewerDisplay *display, - guint width, - guint height) -{ - VirtViewerDisplayPrivate *priv = display->priv; - - if (width == priv->desktopWidth && height == priv->desktopHeight) - return; - - priv->desktopWidth = width; - priv->desktopHeight = height; - priv->dirty = TRUE; - - gtk_widget_queue_resize(GTK_WIDGET(display)); - g_signal_emit_by_name(display, "display-desktop-resize"); + guint width, + guint height) +{ + VirtViewerDisplayPrivate *priv = display->priv; + + if (width == priv->desktopWidth && height == priv->desktopHeight) + return; + + priv->desktopWidth = width; + priv->desktopHeight = height; + priv->dirty = TRUE; + + gtk_widget_queue_resize(GTK_WIDGET(display)); + g_signal_emit_by_name(display, "display-desktop-resize"); } void virt_viewer_display_get_desktop_size(VirtViewerDisplay *display, - guint *width, - guint *height) -{ - VirtViewerDisplayPrivate *priv = display->priv; - - *width = priv->desktopWidth; - *height = priv->desktopHeight; + guint *width, + guint *height) +{ + VirtViewerDisplayPrivate *priv = display->priv; + + *width = priv->desktopWidth; + *height = priv->desktopHeight; } void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display, - guint zoom) -{ - VirtViewerDisplayPrivate *priv = display->priv; - GtkWidget *child = gtk_bin_get_child(GTK_BIN(display)); - - if (zoom < 10) - zoom = 10; - if (zoom > 400) - zoom = 400; - priv->zoom_level = zoom; - - if (child && gtk_widget_get_visible(child)) { - priv->dirty = TRUE; - gtk_widget_queue_resize(GTK_WIDGET(display)); - } + guint zoom) +{ + VirtViewerDisplayPrivate *priv = display->priv; + GtkWidget *child = gtk_bin_get_child(GTK_BIN(display)); + + if (zoom < 10) + zoom = 10; + if (zoom > 400) + zoom = 400; + priv->zoom_level = zoom; + + if (child && gtk_widget_get_visible(child)) { + priv->dirty = TRUE; + gtk_widget_queue_resize(GTK_WIDGET(display)); + } +} + + +guint virt_viewer_display_get_zoom_level(VirtViewerDisplay *display) +{ + VirtViewerDisplayPrivate *priv = display->priv; + return priv->zoom_level; } void virt_viewer_display_set_zoom(VirtViewerDisplay *display, - gboolean zoom) -{ - VirtViewerDisplayPrivate *priv = display->priv; - GtkWidget *child = gtk_bin_get_child(GTK_BIN(display)); - - priv->zoom = zoom; - if (child && gtk_widget_get_visible(child)) { - priv->dirty = TRUE; - gtk_widget_queue_resize(GTK_WIDGET(display)); - } -} + gboolean zoom) +{ + VirtViewerDisplayPrivate *priv = display->priv; + GtkWidget *child = gtk_bin_get_child(GTK_BIN(display)); + + priv->zoom = zoom; + if (child && gtk_widget_get_visible(child)) { + priv->dirty = TRUE; + gtk_widget_queue_resize(GTK_WIDGET(display)); + } +} + + +gboolean virt_viewer_display_get_zoom(VirtViewerDisplay *display) +{ + VirtViewerDisplayPrivate *priv = display->priv; + return priv->zoom; +} + void virt_viewer_display_send_keys(VirtViewerDisplay *display, - const guint *keyvals, int nkeyvals) -{ - g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(display)); - - VIRT_VIEWER_DISPLAY_GET_CLASS(display)->send_keys(display, keyvals, nkeyvals); + const guint *keyvals, int nkeyvals) +{ + g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(display)); + + VIRT_VIEWER_DISPLAY_GET_CLASS(display)->send_keys(display, keyvals, nkeyvals); } GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay *display) { - g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(display), NULL); - - return VIRT_VIEWER_DISPLAY_GET_CLASS(display)->get_pixbuf(display); + g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(display), NULL); + + return VIRT_VIEWER_DISPLAY_GET_CLASS(display)->get_pixbuf(display); } void virt_viewer_display_set_show_hint(VirtViewerDisplay *self, gint hint) { - VirtViewerDisplayPrivate *priv; - g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self)); - - priv = self->priv; - if (priv->show_hint == hint) - return; - - priv->show_hint = hint; - g_object_notify(G_OBJECT(self), "show-hint"); + VirtViewerDisplayPrivate *priv; + g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self)); + + priv = self->priv; + if (priv->show_hint == hint) + return; + + priv->show_hint = hint; + g_object_notify(G_OBJECT(self), "show-hint"); +} + +VirtViewerSession* virt_viewer_display_get_session(VirtViewerDisplay *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), NULL); + + return self->priv->session; +} + +void virt_viewer_display_set_auto_resize(VirtViewerDisplay *self, gboolean auto_resize) +{ + g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self)); + + self->priv->auto_resize = auto_resize; +} + +gboolean virt_viewer_display_get_auto_resize(VirtViewerDisplay *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), FALSE); + + return self->priv->auto_resize; } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-display.h b/src/virt-viewer-display.h index d49dd67..17a3390 100644 --- a/src/virt-viewer-display.h +++ b/src/virt-viewer-display.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -30,20 +30,23 @@ #define VIRT_VIEWER_TYPE_DISPLAY virt_viewer_display_get_type() -#define VIRT_VIEWER_DISPLAY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplay)) +#define VIRT_VIEWER_DISPLAY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplay)) -#define VIRT_VIEWER_DISPLAY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass)) +#define VIRT_VIEWER_DISPLAY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass)) #define VIRT_VIEWER_IS_DISPLAY(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY)) + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY)) #define VIRT_VIEWER_IS_DISPLAY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY)) + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY)) -#define VIRT_VIEWER_DISPLAY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass)) +#define VIRT_VIEWER_DISPLAY_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass)) + +typedef struct _VirtViewerSession VirtViewerSession; +typedef struct _VirtViewerSessionClass VirtViewerSessionClass; typedef struct _VirtViewerDisplay VirtViewerDisplay; typedef struct _VirtViewerDisplayClass VirtViewerDisplayClass; @@ -52,32 +55,32 @@ typedef struct _VirtViewerDisplayChannel VirtViewerDisplayChannel; enum { - VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE = 0, - VIRT_VIEWER_DISPLAY_SHOW_HINT_READY, + VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE = 0, + VIRT_VIEWER_DISPLAY_SHOW_HINT_READY, }; /* perhaps this become an interface, and be pushed in gtkvnc and spice? */ struct _VirtViewerDisplay { - GtkBin parent; + GtkBin parent; - VirtViewerDisplayPrivate *priv; + VirtViewerDisplayPrivate *priv; }; struct _VirtViewerDisplayClass { - GtkBinClass parent_class; + GtkBinClass parent_class; - /* virtual methods */ - void (*send_keys)(VirtViewerDisplay* display, - const guint *keyvals, int nkeyvals); - GdkPixbuf *(*get_pixbuf)(VirtViewerDisplay* display); + /* virtual methods */ + void (*send_keys)(VirtViewerDisplay* display, + const guint *keyvals, int nkeyvals); + GdkPixbuf *(*get_pixbuf)(VirtViewerDisplay* display); - /* signals */ - void (*display_pointer_grab)(VirtViewerDisplay *display); - void (*display_pointer_ungrab)(VirtViewerDisplay *display); - void (*display_keyboard_grab)(VirtViewerDisplay *display); - void (*display_keyboard_ungrab)(VirtViewerDisplay *display); + /* signals */ + void (*display_pointer_grab)(VirtViewerDisplay *display); + void (*display_pointer_ungrab)(VirtViewerDisplay *display); + void (*display_keyboard_grab)(VirtViewerDisplay *display); + void (*display_keyboard_ungrab)(VirtViewerDisplay *display); - void (*display_desktop_resize)(VirtViewerDisplay *display); + void (*display_desktop_resize)(VirtViewerDisplay *display); }; GType virt_viewer_display_get_type(void); @@ -85,30 +88,34 @@ GtkWidget *virt_viewer_display_new(void); void virt_viewer_display_set_desktop_size(VirtViewerDisplay *display, - guint width, - guint height); + guint width, + guint height); void virt_viewer_display_get_desktop_size(VirtViewerDisplay *display, - guint *width, - guint *height); + guint *width, + guint *height); void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display, - guint zoom); + guint zoom); +guint virt_viewer_display_get_zoom_level(VirtViewerDisplay *display); void virt_viewer_display_set_zoom(VirtViewerDisplay *display, - gboolean zoom); + gboolean zoom); +gboolean virt_viewer_display_get_zoom(VirtViewerDisplay *display); void virt_viewer_display_send_keys(VirtViewerDisplay *display, - const guint *keyvals, int nkeyvals); + const guint *keyvals, int nkeyvals); GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay *display); void virt_viewer_display_set_show_hint(VirtViewerDisplay *display, gint hint); - +VirtViewerSession* virt_viewer_display_get_session(VirtViewerDisplay *display); +void virt_viewer_display_set_auto_resize(VirtViewerDisplay *display, gboolean auto_resize); +gboolean virt_viewer_display_get_auto_resize(VirtViewerDisplay *display); G_END_DECLS #endif /* _VIRT_VIEWER_DISPLAY_H */ /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-events.c b/src/virt-viewer-events.c index 87df739..216ed93 100644 --- a/src/virt-viewer-events.c +++ b/src/virt-viewer-events.c @@ -1,7 +1,7 @@ /* * events.c: event loop integration * - * Copyright (C) 2008-2009 Daniel P. Berrange + * Copyright (C) 2008-2012 Daniel P. Berrange * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,7 @@ * Author: Daniel P. Berrange */ +#include #include #include @@ -48,8 +49,8 @@ static gboolean virt_viewer_events_dispatch_handle(GIOChannel *source G_GNUC_UNUSED, - GIOCondition condition, - gpointer opaque) + GIOCondition condition, + gpointer opaque) { struct virt_viewer_events_handle *data = opaque; int events = 0; @@ -73,10 +74,10 @@ static int virt_viewer_events_add_handle(int fd, - int events, - virEventHandleCallback cb, - void *opaque, - virFreeCallback ff) + int events, + virEventHandleCallback cb, + void *opaque, + virFreeCallback ff) { struct virt_viewer_events_handle *data; GIOCondition cond = 0; @@ -123,7 +124,7 @@ static void virt_viewer_events_update_handle(int watch, - int events) + int events) { struct virt_viewer_events_handle *data = virt_viewer_events_find_handle(watch); @@ -227,9 +228,9 @@ static int virt_viewer_events_add_timeout(int interval, - virEventTimeoutCallback cb, - void *opaque, - virFreeCallback ff) + virEventTimeoutCallback cb, + void *opaque, + virFreeCallback ff) { struct virt_viewer_events_timeout *data; @@ -269,7 +270,7 @@ static void virt_viewer_events_update_timeout(int timer, - int interval) + int interval) { struct virt_viewer_events_timeout *data = virt_viewer_events_find_timeout(timer); @@ -346,3 +347,10 @@ virt_viewer_events_remove_timeout); } +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/virt-viewer-events.h b/src/virt-viewer-events.h index 44ff8d7..c56950f 100644 --- a/src/virt-viewer-events.h +++ b/src/virt-viewer-events.h @@ -1,7 +1,7 @@ /* * events.h: event loop integration * - * Copyright (C) 2008-2009 Daniel P. Berrange + * Copyright (C) 2008-2012 Daniel P. Berrange * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,3 +28,10 @@ void virt_viewer_events_register(void); #endif +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c index 7e2886b..cf7f55e 100644 --- a/src/virt-viewer-main.c +++ b/src/virt-viewer-main.c @@ -1,7 +1,7 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007 Red Hat, + * Copyright (C) 2007-2012 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,124 +25,132 @@ #include #include #include - #ifdef HAVE_GTK_VNC #include #endif - +#ifdef HAVE_SPICE_GTK +#include +#endif #include "virt-viewer.h" static void virt_viewer_version(void) { - g_print(_("%s version %s\n"), PACKAGE, VERSION); + g_print(_("%s version %s\n"), PACKAGE, VERSION); - exit(0); + exit(EXIT_SUCCESS); } int main(int argc, char **argv) { - GOptionContext *context; - GError *error = NULL; - int ret = 1; - char *uri = NULL; - int zoom = 100; - gchar **args = NULL; - gboolean verbose = FALSE; - gboolean debug = FALSE; - gboolean direct = FALSE; - gboolean waitvm = FALSE; - gboolean reconnect = FALSE; - gboolean fullscreen = FALSE; - VirtViewer *viewer = NULL; - const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options"); - const GOptionEntry options [] = { - { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, - virt_viewer_version, N_("display version information"), NULL }, - { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, - N_("display verbose information"), NULL }, - { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct, - N_("direct connection with no automatic tunnels"), NULL }, - { "connect", 'c', 0, G_OPTION_ARG_STRING, &uri, - N_("connect to hypervisor"), "URI"}, - { "wait", 'w', 0, G_OPTION_ARG_NONE, &waitvm, - N_("wait for domain to start"), NULL }, - { "reconnect", 'r', 0, G_OPTION_ARG_NONE, &reconnect, - N_("reconnect to domain upon restart"), NULL }, - { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom, - N_("Zoom level of window, in percentage"), "ZOOM" }, - { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug, - N_("display debugging information"), NULL }, - { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen, - N_("Open in full screen mode"), NULL }, - { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args, - NULL, "DOMAIN-NAME|ID|UUID" }, - { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } - }; + GOptionContext *context; + GError *error = NULL; + int ret = 1; + char *uri = NULL; + int zoom = 100; + gchar **args = NULL; + gboolean verbose = FALSE; + gboolean debug = FALSE; + gboolean direct = FALSE; + gboolean attach = FALSE; + gboolean waitvm = FALSE; + gboolean reconnect = FALSE; + gboolean fullscreen = FALSE; + VirtViewer *viewer = NULL; + const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options"); + const GOptionEntry options [] = { + { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + virt_viewer_version, N_("Display version information"), NULL }, + { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, + N_("Display verbose information"), NULL }, + { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct, + N_("Direct connection with no automatic tunnels"), NULL }, + { "attach", 'a', 0, G_OPTION_ARG_NONE, &attach, + N_("Attach to the local display using libvirt"), NULL }, + { "connect", 'c', 0, G_OPTION_ARG_STRING, &uri, + N_("Connect to hypervisor"), "URI"}, + { "wait", 'w', 0, G_OPTION_ARG_NONE, &waitvm, + N_("Wait for domain to start"), NULL }, + { "reconnect", 'r', 0, G_OPTION_ARG_NONE, &reconnect, + N_("Reconnect to domain upon restart"), NULL }, + { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom, + N_("Zoom level of window, in percentage"), "ZOOM" }, + { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug, + N_("Display debugging information"), NULL }, + { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen, + N_("Open in full screen mode"), NULL }, + { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args, + NULL, "DOMAIN-NAME|ID|UUID" }, + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } + }; - setlocale(LC_ALL, ""); - bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); - bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); - textdomain(GETTEXT_PACKAGE); + setlocale(LC_ALL, ""); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + textdomain(GETTEXT_PACKAGE); - g_set_application_name(_("Virt Viewer")); + g_set_application_name(_("Virt Viewer")); - /* Setup command line options */ - context = g_option_context_new (_("- Virtual machine graphical console")); - g_option_context_add_main_entries (context, options, NULL); - g_option_context_add_group (context, gtk_get_option_group (TRUE)); + /* Setup command line options */ + context = g_option_context_new (_("- Virtual machine graphical console")); + g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); #ifdef HAVE_GTK_VNC - g_option_context_add_group (context, vnc_display_get_option_group ()); + g_option_context_add_group (context, vnc_display_get_option_group ()); #endif - g_option_context_parse (context, &argc, &argv, &error); - if (error) { - g_printerr("%s\n%s\n", - error->message, - gettext(help_msg)); - g_error_free(error); - goto cleanup; - } +#ifdef HAVE_SPICE_GTK + g_option_context_add_group (context, spice_get_option_group ()); +#endif + g_option_context_parse (context, &argc, &argv, &error); + if (error) { + g_printerr("%s\n%s\n", + error->message, + gettext(help_msg)); + g_error_free(error); + goto cleanup; + } - g_option_context_free(context); + g_option_context_free(context); - if (!args || (g_strv_length(args) != 1)) { - g_printerr(_("\nUsage: %s [OPTIONS] DOMAIN-NAME|ID|UUID\n\n%s\n\n"), argv[0], help_msg); - goto cleanup; - } + if (!args || (g_strv_length(args) != 1)) { + g_printerr(_("\nUsage: %s [OPTIONS] DOMAIN-NAME|ID|UUID\n\n%s\n\n"), argv[0], help_msg); + goto cleanup; + } - if (zoom < 10 || zoom > 200) { - g_printerr(_("Zoom level must be within 10-200\n")); - goto cleanup; - } + if (zoom < 10 || zoom > 200) { + g_printerr(_("Zoom level must be within 10-200\n")); + goto cleanup; + } - virt_viewer_app_set_debug(debug); + gtk_window_set_default_icon_name("virt-viewer"); - viewer = virt_viewer_new(uri, args[0], zoom, direct, waitvm, reconnect, verbose, NULL); - if (viewer == NULL) - goto cleanup; + virt_viewer_app_set_debug(debug); - g_object_set(viewer, "fullscreen", fullscreen, NULL); - if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer))) - goto cleanup; + viewer = virt_viewer_new(uri, args[0], zoom, direct, attach, waitvm, reconnect, verbose, NULL); + if (viewer == NULL) + goto cleanup; - gtk_main(); + g_object_set(viewer, "fullscreen", fullscreen, NULL); + if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer))) + goto cleanup; - ret = 0; + gtk_main(); -cleanup: - if (viewer) - g_object_unref(viewer); - g_free(uri); - g_strfreev(args); + ret = 0; - return ret; + cleanup: + if (viewer) + g_object_unref(viewer); + g_free(uri); + g_strfreev(args); + + return ret; } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-notebook.c b/src/virt-viewer-notebook.c index fa28593..0249021 100644 --- a/src/virt-viewer-notebook.c +++ b/src/virt-viewer-notebook.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -21,128 +21,131 @@ * * Author: Daniel P. Berrange */ + +#include + #include "virt-viewer-notebook.h" #include "virt-viewer-util.h" G_DEFINE_TYPE (VirtViewerNotebook, virt_viewer_notebook, GTK_TYPE_NOTEBOOK) -#define GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookPrivate)) +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookPrivate)) struct _VirtViewerNotebookPrivate { - GtkWidget *status; + GtkWidget *status; }; static void virt_viewer_notebook_get_property (GObject *object, guint property_id, - GValue *value G_GNUC_UNUSED, GParamSpec *pspec) + GValue *value G_GNUC_UNUSED, GParamSpec *pspec) { - switch (property_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_notebook_set_property (GObject *object, guint property_id, - const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) + const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) { - switch (property_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_notebook_dispose (GObject *object) { - G_OBJECT_CLASS (virt_viewer_notebook_parent_class)->dispose (object); + G_OBJECT_CLASS (virt_viewer_notebook_parent_class)->dispose (object); } static void virt_viewer_notebook_class_init (VirtViewerNotebookClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (VirtViewerNotebookPrivate)); + g_type_class_add_private (klass, sizeof (VirtViewerNotebookPrivate)); - object_class->get_property = virt_viewer_notebook_get_property; - object_class->set_property = virt_viewer_notebook_set_property; - object_class->dispose = virt_viewer_notebook_dispose; + object_class->get_property = virt_viewer_notebook_get_property; + object_class->set_property = virt_viewer_notebook_set_property; + object_class->dispose = virt_viewer_notebook_dispose; } static void virt_viewer_notebook_init (VirtViewerNotebook *self) { - VirtViewerNotebookPrivate *priv; - GdkColor color; + VirtViewerNotebookPrivate *priv; + GdkColor color; - self->priv = GET_PRIVATE(self); - priv = self->priv; + self->priv = GET_PRIVATE(self); + priv = self->priv; - priv->status = gtk_label_new(""); - gtk_notebook_set_show_tabs(GTK_NOTEBOOK(self), FALSE); - gtk_notebook_set_show_border(GTK_NOTEBOOK(self), FALSE); - gtk_notebook_append_page(GTK_NOTEBOOK(self), priv->status, NULL); - gdk_color_parse("white", &color); - gtk_widget_modify_fg(priv->status, GTK_STATE_NORMAL, &color); + priv->status = gtk_label_new(""); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(self), FALSE); + gtk_notebook_set_show_border(GTK_NOTEBOOK(self), FALSE); + gtk_notebook_append_page(GTK_NOTEBOOK(self), priv->status, NULL); + gdk_color_parse("white", &color); + gtk_widget_modify_fg(priv->status, GTK_STATE_NORMAL, &color); } void virt_viewer_notebook_show_status_va(VirtViewerNotebook *self, const gchar *fmt, va_list args) { - VirtViewerNotebookPrivate *priv; - gchar *text; + VirtViewerNotebookPrivate *priv; + gchar *text; - DEBUG_LOG("notebook show status %p", self); - g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self)); + DEBUG_LOG("notebook show status %p", self); + g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self)); - text = g_strdup_vprintf(fmt, args); - priv = self->priv; - gtk_label_set_text(GTK_LABEL(priv->status), text); - gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 0); - gtk_widget_show_all(GTK_WIDGET(self)); - g_free(text); + text = g_strdup_vprintf(fmt, args); + priv = self->priv; + gtk_label_set_text(GTK_LABEL(priv->status), text); + gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 0); + gtk_widget_show_all(GTK_WIDGET(self)); + g_free(text); } void virt_viewer_notebook_show_status(VirtViewerNotebook *self, const gchar *fmt, ...) { - va_list args; + va_list args; - g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self)); + g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self)); - va_start(args, fmt); - virt_viewer_notebook_show_status_va(self, fmt, args); - va_end(args); + va_start(args, fmt); + virt_viewer_notebook_show_status_va(self, fmt, args); + va_end(args); } void virt_viewer_notebook_show_display(VirtViewerNotebook *self) { - GtkWidget *display; + GtkWidget *display; - DEBUG_LOG("notebook show display %p", self); - g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self)); + DEBUG_LOG("notebook show display %p", self); + g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self)); - display = gtk_notebook_get_nth_page(GTK_NOTEBOOK(self), 1); - g_warn_if_fail(display != NULL); + display = gtk_notebook_get_nth_page(GTK_NOTEBOOK(self), 1); + g_warn_if_fail(display != NULL); + gtk_widget_grab_focus(display); - gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 1); - gtk_widget_show_all(GTK_WIDGET(self)); + gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 1); + gtk_widget_show_all(GTK_WIDGET(self)); } VirtViewerNotebook* virt_viewer_notebook_new (void) { - return g_object_new (VIRT_VIEWER_TYPE_NOTEBOOK, NULL); + return g_object_new (VIRT_VIEWER_TYPE_NOTEBOOK, NULL); } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-notebook.h b/src/virt-viewer-notebook.h index 0d2b0ce..64c02a6 100644 --- a/src/virt-viewer-notebook.h +++ b/src/virt-viewer-notebook.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -31,30 +31,30 @@ #define VIRT_VIEWER_TYPE_NOTEBOOK virt_viewer_notebook_get_type() -#define VIRT_VIEWER_NOTEBOOK(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebook)) +#define VIRT_VIEWER_NOTEBOOK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebook)) -#define VIRT_VIEWER_NOTEBOOK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass)) +#define VIRT_VIEWER_NOTEBOOK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass)) -#define VIRT_VIEWER_IS_NOTEBOOK(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_NOTEBOOK)) +#define VIRT_VIEWER_IS_NOTEBOOK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_NOTEBOOK)) -#define VIRT_VIEWER_IS_NOTEBOOK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_NOTEBOOK)) +#define VIRT_VIEWER_IS_NOTEBOOK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_NOTEBOOK)) -#define VIRT_VIEWER_NOTEBOOK_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass)) +#define VIRT_VIEWER_NOTEBOOK_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass)) typedef struct _VirtViewerNotebookPrivate VirtViewerNotebookPrivate; typedef struct { - GtkNotebook parent; - VirtViewerNotebookPrivate *priv; + GtkNotebook parent; + VirtViewerNotebookPrivate *priv; } VirtViewerNotebook; typedef struct { - GtkNotebookClass parent_class; + GtkNotebookClass parent_class; } VirtViewerNotebookClass; GType virt_viewer_notebook_get_type (void); @@ -67,12 +67,10 @@ G_END_DECLS #endif /* _VIRT_VIEWER_NOTEBOOK */ - /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c index d0d6e29..cc43bed 100644 --- a/src/virt-viewer-session-spice.c +++ b/src/virt-viewer-session-spice.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -22,10 +22,13 @@ * Author: Daniel P. Berrange */ +#include + #include - #include +#include +#include #include "virt-viewer-util.h" #include "virt-viewer-session-spice.h" #include "virt-viewer-display-spice.h" @@ -35,276 +38,442 @@ struct _VirtViewerSessionSpicePrivate { - SpiceSession *session; - SpiceAudio *audio; + GtkWindow *main_window; + SpiceSession *session; + SpiceGtkSession *gtk_session; + SpiceMainChannel *main_channel; + SpiceAudio *audio; }; #define VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpicePrivate)) + +enum { + PROP_0, + PROP_SPICE_SESSION, +}; + static void virt_viewer_session_spice_close(VirtViewerSession *session); static gboolean virt_viewer_session_spice_open_fd(VirtViewerSession *session, int fd); -static gboolean virt_viewer_session_spice_open_host(VirtViewerSession *session, char *host, char *port); +static gboolean virt_viewer_session_spice_open_host(VirtViewerSession *session, const gchar *host, const gchar *port, const gchar *tlsport); +static gboolean virt_viewer_session_spice_open_uri(VirtViewerSession *session, const gchar *uri); static gboolean virt_viewer_session_spice_channel_open_fd(VirtViewerSession *session, VirtViewerSessionChannel *channel, int fd); +static gboolean virt_viewer_session_spice_has_usb(VirtViewerSession *session); +static void virt_viewer_session_spice_usb_device_selection(VirtViewerSession *session, GtkWindow *parent); static void virt_viewer_session_spice_channel_new(SpiceSession *s, - SpiceChannel *channel, - VirtViewerSession *session); + SpiceChannel *channel, + VirtViewerSession *session); static void virt_viewer_session_spice_channel_destroy(SpiceSession *s, - SpiceChannel *channel, - VirtViewerSession *session); - - -static void -virt_viewer_session_spice_finalize(GObject *obj) -{ - VirtViewerSessionSpice *spice = VIRT_VIEWER_SESSION_SPICE(obj); - - if (spice->priv->session) { - spice_session_disconnect(spice->priv->session); - g_object_unref(spice->priv->session); - } - if (spice->priv->audio) - g_object_unref(spice->priv->audio); - - G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->finalize(obj); + SpiceChannel *channel, + VirtViewerSession *session); + + +static void +virt_viewer_session_spice_get_property(GObject *object, guint property_id, + GValue *value, GParamSpec *pspec) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(object); + VirtViewerSessionSpicePrivate *priv = self->priv; + + switch (property_id) { + case PROP_SPICE_SESSION: + g_value_set_object(value, priv->session); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +virt_viewer_session_spice_set_property(GObject *object, guint property_id, + const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) +{ + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +virt_viewer_session_spice_dispose(GObject *obj) +{ + VirtViewerSessionSpice *spice = VIRT_VIEWER_SESSION_SPICE(obj); + + if (spice->priv->session) { + spice_session_disconnect(spice->priv->session); + g_object_unref(spice->priv->session); + } + if (spice->priv->audio) + g_object_unref(spice->priv->audio); + if (spice->priv->main_channel) + g_object_unref(spice->priv->main_channel); + if (spice->priv->main_window) + g_object_unref(spice->priv->main_window); + + G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->finalize(obj); } static void virt_viewer_session_spice_class_init(VirtViewerSessionSpiceClass *klass) { - VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass); - GObjectClass *oclass = G_OBJECT_CLASS(klass); - - oclass->finalize = virt_viewer_session_spice_finalize; - - dclass->close = virt_viewer_session_spice_close; - dclass->open_fd = virt_viewer_session_spice_open_fd; - dclass->open_host = virt_viewer_session_spice_open_host; - dclass->channel_open_fd = virt_viewer_session_spice_channel_open_fd; - - g_type_class_add_private(oclass, sizeof(VirtViewerSessionSpicePrivate)); + VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass); + GObjectClass *oclass = G_OBJECT_CLASS(klass); + + oclass->get_property = virt_viewer_session_spice_get_property; + oclass->set_property = virt_viewer_session_spice_set_property; + oclass->dispose = virt_viewer_session_spice_dispose; + + dclass->close = virt_viewer_session_spice_close; + dclass->open_fd = virt_viewer_session_spice_open_fd; + dclass->open_host = virt_viewer_session_spice_open_host; + dclass->open_uri = virt_viewer_session_spice_open_uri; + dclass->channel_open_fd = virt_viewer_session_spice_channel_open_fd; + dclass->has_usb = virt_viewer_session_spice_has_usb; + dclass->usb_device_selection = virt_viewer_session_spice_usb_device_selection; + + g_type_class_add_private(klass, sizeof(VirtViewerSessionSpicePrivate)); + + g_object_class_install_property(oclass, + PROP_SPICE_SESSION, + g_param_spec_object("spice-session", + "Spice session", + "Spice session", + SPICE_TYPE_SESSION, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } static void virt_viewer_session_spice_init(VirtViewerSessionSpice *self G_GNUC_UNUSED) { - self->priv = VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(self); + self->priv = VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(self); +} + +static void +usb_connect_failed(GObject *object G_GNUC_UNUSED, + SpiceUsbDevice *device G_GNUC_UNUSED, + GError *error, VirtViewerSessionSpice *self) +{ + if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + return; + + g_signal_emit_by_name(self, "session-usb-failed", error->message); +} + +static void +create_spice_session(VirtViewerSessionSpice *self) +{ + SpiceUsbDeviceManager *manager; + + g_return_if_fail(self != NULL); + g_return_if_fail(self->priv->session == NULL); + + self->priv->session = spice_session_new(); + spice_set_session_option(self->priv->session); + + self->priv->gtk_session = spice_gtk_session_get(self->priv->session); + g_object_set(self->priv->gtk_session, "auto-clipboard", TRUE, NULL); + + g_signal_connect(self->priv->session, "channel-new", + G_CALLBACK(virt_viewer_session_spice_channel_new), self); + g_signal_connect(self->priv->session, "channel-destroy", + G_CALLBACK(virt_viewer_session_spice_channel_destroy), self); + + manager = spice_usb_device_manager_get(self->priv->session, NULL); + if (manager) + g_signal_connect(manager, "auto-connect-failed", + G_CALLBACK(usb_connect_failed), self); + + g_object_bind_property(self, "auto-usbredir", + self->priv->gtk_session, "auto-usbredir", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); } static void virt_viewer_session_spice_close(VirtViewerSession *session) { - VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); - - g_return_if_fail(self != NULL); - - virt_viewer_session_clear_displays(session); - - if (self->priv->session) { - spice_session_disconnect(self->priv->session); - g_object_unref(self->priv->session); - - if (self->priv->audio) - g_object_unref(self->priv->audio); - self->priv->audio = NULL; - } - - self->priv->session = spice_session_new(); - g_signal_connect(self->priv->session, "channel-new", - G_CALLBACK(virt_viewer_session_spice_channel_new), self); - g_signal_connect(self->priv->session, "channel-destroy", - G_CALLBACK(virt_viewer_session_spice_channel_destroy), self); - + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + + g_return_if_fail(self != NULL); + + virt_viewer_session_clear_displays(session); + + if (self->priv->session) { + spice_session_disconnect(self->priv->session); + g_object_unref(self->priv->session); + self->priv->session = NULL; + self->priv->gtk_session = NULL; + + if (self->priv->audio) + g_object_unref(self->priv->audio); + self->priv->audio = NULL; + } + + /* FIXME: version 0.7 of spice-gtk allows reuse of session */ + create_spice_session(self); } static gboolean virt_viewer_session_spice_open_host(VirtViewerSession *session, - char *host, - char *port) -{ - VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); - - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(self->priv->session != NULL, FALSE); - - g_object_set(self->priv->session, - "host", host, - "port", port, - NULL); - - return spice_session_connect(self->priv->session); + const gchar *host, + const gchar *port, + const gchar *tlsport) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(self->priv->session != NULL, FALSE); + + g_object_set(self->priv->session, + "host", host, + "port", port, + "tls-port", tlsport, + NULL); + + return spice_session_connect(self->priv->session); +} + +static gboolean +virt_viewer_session_spice_open_uri(VirtViewerSession *session, + const gchar *uri) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(self->priv->session != NULL, FALSE); + + g_object_set(self->priv->session, "uri", uri, NULL); + + return spice_session_connect(self->priv->session); } static gboolean virt_viewer_session_spice_open_fd(VirtViewerSession *session, - int fd) -{ - VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); - - g_return_val_if_fail(self != NULL, FALSE); - - return spice_session_open_fd(self->priv->session, fd); + int fd) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + + g_return_val_if_fail(self != NULL, FALSE); + + return spice_session_open_fd(self->priv->session, fd); } static gboolean virt_viewer_session_spice_channel_open_fd(VirtViewerSession *session, - VirtViewerSessionChannel *channel, - int fd) -{ - VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); - - g_return_val_if_fail(self != NULL, FALSE); - - return spice_channel_open_fd(SPICE_CHANNEL(channel), fd); + VirtViewerSessionChannel *channel, + int fd) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + + g_return_val_if_fail(self != NULL, FALSE); + + return spice_channel_open_fd(SPICE_CHANNEL(channel), fd); } static void virt_viewer_session_spice_channel_open_fd_request(SpiceChannel *channel, - gint tls G_GNUC_UNUSED, - VirtViewerSession *session) -{ - g_signal_emit_by_name(session, "session-channel-open", channel); + gint tls G_GNUC_UNUSED, + VirtViewerSession *session) +{ + g_signal_emit_by_name(session, "session-channel-open", channel); } static void virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED, - SpiceChannelEvent event, - VirtViewerSession *session) -{ - VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); - char *password = NULL; - - g_return_if_fail(self != NULL); - - switch (event) { - case SPICE_CHANNEL_OPENED: - DEBUG_LOG("main channel: opened"); - break; - case SPICE_CHANNEL_CLOSED: - DEBUG_LOG("main channel: closed"); - g_signal_emit_by_name(session, "session-disconnected"); - break; - case SPICE_CHANNEL_ERROR_CONNECT: - DEBUG_LOG("main channel: failed to connect"); - g_signal_emit_by_name(session, "session-disconnected"); - break; - case SPICE_CHANNEL_ERROR_AUTH: - DEBUG_LOG("main channel: auth failure (wrong password?)"); - int ret = virt_viewer_auth_collect_credentials("SPICE", - NULL, - NULL, &password); - if (ret < 0) { - g_signal_emit_by_name(session, "session-auth-refused", - _("Unable to collect credentials")); - } else { - g_object_set(self->priv->session, "password", password, NULL); - spice_session_connect(self->priv->session); - } - break; - default: - g_message("unhandled spice main channel event: %d", event); - g_signal_emit_by_name(session, "session-disconnected"); - break; - } - - g_free(password); -} - + SpiceChannelEvent event, + VirtViewerSession *session) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + gchar *password = NULL; + + g_return_if_fail(self != NULL); + + switch (event) { + case SPICE_CHANNEL_OPENED: + DEBUG_LOG("main channel: opened"); + break; + case SPICE_CHANNEL_CLOSED: + DEBUG_LOG("main channel: closed"); + g_signal_emit_by_name(session, "session-disconnected"); + break; + case SPICE_CHANNEL_ERROR_CONNECT: + DEBUG_LOG("main channel: failed to connect"); + g_signal_emit_by_name(session, "session-disconnected"); + break; + case SPICE_CHANNEL_ERROR_AUTH: + DEBUG_LOG("main channel: auth failure (wrong password?)"); + int ret = virt_viewer_auth_collect_credentials(self->priv->main_window, + "SPICE", + NULL, + NULL, &password); + if (ret < 0) { + g_signal_emit_by_name(session, "session-cancelled"); + } else { + g_object_set(self->priv->session, "password", password, NULL); + spice_session_connect(self->priv->session); + } + break; + default: + g_message("unhandled spice main channel event: %d", event); + g_signal_emit_by_name(session, "session-disconnected"); + break; + } + + g_free(password); +} + +static gboolean +virt_viewer_session_spice_has_usb(VirtViewerSession *session) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + VirtViewerSessionSpicePrivate *priv = self->priv; + + return spice_usb_device_manager_get(priv->session, NULL) && + spice_session_has_channel_type(priv->session, + SPICE_CHANNEL_USBREDIR); +} + +static void +virt_viewer_session_spice_usb_device_selection(VirtViewerSession *session, + GtkWindow *parent) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + VirtViewerSessionSpicePrivate *priv = self->priv; + GtkWidget *dialog, *area, *usb_device_widget; + + /* Create the widgets */ + dialog = gtk_dialog_new_with_buttons( + _("Select USB devices for redirection"), parent, + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + NULL); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); + + usb_device_widget = spice_usb_device_widget_new(priv->session, + "%s %s"); + g_signal_connect(usb_device_widget, "connect-failed", + G_CALLBACK(usb_connect_failed), self); + gtk_box_pack_start(GTK_BOX(area), usb_device_widget, TRUE, TRUE, 5); + + /* show and run */ + gtk_widget_show_all(dialog); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} static void virt_viewer_session_spice_channel_new(SpiceSession *s, - SpiceChannel *channel, - VirtViewerSession *session) -{ - VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); - int id; - - g_return_if_fail(self != NULL); - - g_signal_connect(channel, "open-fd", - G_CALLBACK(virt_viewer_session_spice_channel_open_fd_request), self); - - g_object_get(channel, "channel-id", &id, NULL); - - if (SPICE_IS_MAIN_CHANNEL(channel)) { - g_signal_connect(channel, "channel-event", - G_CALLBACK(virt_viewer_session_spice_main_channel_event), self); - } - - if (SPICE_IS_DISPLAY_CHANNEL(channel)) { - GtkWidget *display; - - g_signal_emit_by_name(session, "session-connected"); - - DEBUG_LOG("new session channel (#%d)", id); - display = virt_viewer_display_spice_new(channel, - spice_display_new(s, id)); - - virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session), - VIRT_VIEWER_DISPLAY(display)); - - g_signal_emit_by_name(session, "session-initialized"); - } - - if (SPICE_IS_INPUTS_CHANNEL(channel)) { - DEBUG_LOG("new inputs channel"); - } - - if (SPICE_IS_PLAYBACK_CHANNEL(channel)) { - DEBUG_LOG("new audio channel"); - if (self->priv->audio != NULL) - return; - self->priv->audio = spice_audio_new(s, NULL, NULL); - } + SpiceChannel *channel, + VirtViewerSession *session) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + int id; + + g_return_if_fail(self != NULL); + + g_signal_connect(channel, "open-fd", + G_CALLBACK(virt_viewer_session_spice_channel_open_fd_request), self); + + g_object_get(channel, "channel-id", &id, NULL); + + if (SPICE_IS_MAIN_CHANNEL(channel)) { + if (self->priv->main_channel != NULL) { + /* FIXME: use telepathy-glib g_signal_connect_object to automatically disconnect.. */ + g_signal_handlers_disconnect_by_func(self->priv->main_channel, + virt_viewer_session_spice_main_channel_event, self); + g_object_unref(self->priv->main_channel); + } + + g_signal_connect(channel, "channel-event", + G_CALLBACK(virt_viewer_session_spice_main_channel_event), self); + self->priv->main_channel = g_object_ref(channel); + } + + if (SPICE_IS_DISPLAY_CHANNEL(channel)) { + GtkWidget *display; + + g_signal_emit_by_name(session, "session-connected"); + + DEBUG_LOG("new session channel (#%d)", id); + display = virt_viewer_display_spice_new(self, + channel, + spice_display_new(s, id)); + + virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session), + VIRT_VIEWER_DISPLAY(display)); + + g_signal_emit_by_name(session, "session-initialized"); + } + + if (SPICE_IS_INPUTS_CHANNEL(channel)) { + DEBUG_LOG("new inputs channel"); + } + + if (SPICE_IS_PLAYBACK_CHANNEL(channel)) { + DEBUG_LOG("new audio channel"); + if (self->priv->audio != NULL) + return; + self->priv->audio = spice_audio_new(s, NULL, NULL); + } } static void virt_viewer_session_spice_channel_destroy(G_GNUC_UNUSED SpiceSession *s, - SpiceChannel *channel, - VirtViewerSession *session) -{ - VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); - int id; - - g_return_if_fail(self != NULL); - - g_object_get(channel, "channel-id", &id, NULL); - if (SPICE_IS_MAIN_CHANNEL(channel)) { - DEBUG_LOG("zap main channel"); - } - - if (SPICE_IS_DISPLAY_CHANNEL(channel)) { - DEBUG_LOG("zap session channel (#%d)", id); - } - - if (SPICE_IS_PLAYBACK_CHANNEL(channel) && self->priv->audio) { - DEBUG_LOG("zap audio channel"); - g_object_unref(self->priv->audio); - self->priv->audio = NULL; - } + SpiceChannel *channel, + VirtViewerSession *session) +{ + VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session); + int id; + + g_return_if_fail(self != NULL); + + g_object_get(channel, "channel-id", &id, NULL); + if (SPICE_IS_MAIN_CHANNEL(channel)) { + DEBUG_LOG("zap main channel"); + if (channel == SPICE_CHANNEL(self->priv->main_channel)) { + g_object_unref(self->priv->main_channel); + self->priv->main_channel = NULL; + } + } + + if (SPICE_IS_DISPLAY_CHANNEL(channel)) { + DEBUG_LOG("zap session channel (#%d)", id); + } + + if (SPICE_IS_PLAYBACK_CHANNEL(channel) && self->priv->audio) { + DEBUG_LOG("zap audio channel"); + g_object_unref(self->priv->audio); + self->priv->audio = NULL; + } } VirtViewerSession * -virt_viewer_session_spice_new(void) -{ - VirtViewerSessionSpice *self; - - self = g_object_new(VIRT_VIEWER_TYPE_SESSION_SPICE, NULL); - - self->priv->session = spice_session_new(); - g_signal_connect(self->priv->session, "channel-new", - G_CALLBACK(virt_viewer_session_spice_channel_new), self); - g_signal_connect(self->priv->session, "channel-destroy", - G_CALLBACK(virt_viewer_session_spice_channel_destroy), self); - - return VIRT_VIEWER_SESSION(self); +virt_viewer_session_spice_new(GtkWindow *main_window) +{ + VirtViewerSessionSpice *self; + + self = g_object_new(VIRT_VIEWER_TYPE_SESSION_SPICE, NULL); + + create_spice_session(self); + self->priv->main_window = g_object_ref(main_window); + + return VIRT_VIEWER_SESSION(self); +} + +SpiceMainChannel* +virt_viewer_session_spice_get_main_channel(VirtViewerSessionSpice *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_SESSION_SPICE(self), NULL); + + return self->priv->main_channel; } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-session-spice.h b/src/virt-viewer-session-spice.h index 8926940..f0d7e89 100644 --- a/src/virt-viewer-session-spice.h +++ b/src/virt-viewer-session-spice.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -34,47 +34,47 @@ #define VIRT_VIEWER_TYPE_SESSION_SPICE virt_viewer_session_spice_get_type() -#define VIRT_VIEWER_SESSION_SPICE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpice)) +#define VIRT_VIEWER_SESSION_SPICE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpice)) -#define VIRT_VIEWER_SESSION_SPICE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass)) +#define VIRT_VIEWER_SESSION_SPICE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass)) -#define VIRT_VIEWER_IS_SESSION_SPICE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE)) +#define VIRT_VIEWER_IS_SESSION_SPICE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE)) -#define VIRT_VIEWER_IS_SESSION_SPICE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE)) +#define VIRT_VIEWER_IS_SESSION_SPICE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE)) -#define VIRT_VIEWER_SESSION_SPICE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass)) +#define VIRT_VIEWER_SESSION_SPICE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass)) typedef struct _VirtViewerSessionSpice VirtViewerSessionSpice; typedef struct _VirtViewerSessionSpiceClass VirtViewerSessionSpiceClass; typedef struct _VirtViewerSessionSpicePrivate VirtViewerSessionSpicePrivate; struct _VirtViewerSessionSpice { - VirtViewerSession parent; + VirtViewerSession parent; - VirtViewerSessionSpicePrivate *priv; + VirtViewerSessionSpicePrivate *priv; }; struct _VirtViewerSessionSpiceClass { - VirtViewerSessionClass parent_class; + VirtViewerSessionClass parent_class; }; GType virt_viewer_session_spice_get_type(void); -VirtViewerSession* virt_viewer_session_spice_new(void); +VirtViewerSession* virt_viewer_session_spice_new(GtkWindow *main_window); +SpiceMainChannel* virt_viewer_session_spice_get_main_channel(VirtViewerSessionSpice *self); G_END_DECLS #endif /* _VIRT_VIEWER_SESSION_SPICE_H */ - /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c index ad3002a..075b1ce 100644 --- a/src/virt-viewer-session-vnc.c +++ b/src/virt-viewer-session-vnc.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -22,238 +22,283 @@ * Author: Daniel P. Berrange */ +#include + #include "virt-viewer-auth.h" #include "virt-viewer-session-vnc.h" #include "virt-viewer-display-vnc.h" #include +#include G_DEFINE_TYPE(VirtViewerSessionVnc, virt_viewer_session_vnc, VIRT_VIEWER_TYPE_SESSION) struct _VirtViewerSessionVncPrivate { - /* XXX we should really just have a VncConnection */ - VncDisplay *vnc; + GtkWindow *main_window; + /* XXX we should really just have a VncConnection */ + VncDisplay *vnc; }; #define VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncPrivate)) static void virt_viewer_session_vnc_close(VirtViewerSession* session); static gboolean virt_viewer_session_vnc_open_fd(VirtViewerSession* session, int fd); -static gboolean virt_viewer_session_vnc_open_host(VirtViewerSession* session, char *host, char *port); +static gboolean virt_viewer_session_vnc_open_host(VirtViewerSession* session, const gchar *host, const gchar *port, const gchar *tlsport); +static gboolean virt_viewer_session_vnc_open_uri(VirtViewerSession* session, const gchar *uri); static gboolean virt_viewer_session_vnc_channel_open_fd(VirtViewerSession* session, - VirtViewerSessionChannel* channel, int fd); + VirtViewerSessionChannel* channel, int fd); static void virt_viewer_session_vnc_finalize(GObject *obj) { - VirtViewerSessionVnc *vnc = VIRT_VIEWER_SESSION_VNC(obj); - - if (vnc->priv->vnc) { - vnc_display_close(vnc->priv->vnc); - g_object_unref(vnc->priv->vnc); - } - - G_OBJECT_CLASS(virt_viewer_session_vnc_parent_class)->finalize(obj); + VirtViewerSessionVnc *vnc = VIRT_VIEWER_SESSION_VNC(obj); + + if (vnc->priv->vnc) { + vnc_display_close(vnc->priv->vnc); + g_object_unref(vnc->priv->vnc); + } + if (vnc->priv->main_window) + g_object_unref(vnc->priv->main_window); + + G_OBJECT_CLASS(virt_viewer_session_vnc_parent_class)->finalize(obj); } static void virt_viewer_session_vnc_class_init(VirtViewerSessionVncClass *klass) { - VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass); - GObjectClass *oclass = G_OBJECT_CLASS(klass); - - oclass->finalize = virt_viewer_session_vnc_finalize; - - dclass->close = virt_viewer_session_vnc_close; - dclass->open_fd = virt_viewer_session_vnc_open_fd; - dclass->open_host = virt_viewer_session_vnc_open_host; - dclass->channel_open_fd = virt_viewer_session_vnc_channel_open_fd; - - g_type_class_add_private(oclass, sizeof(VirtViewerSessionVncPrivate)); + VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass); + GObjectClass *oclass = G_OBJECT_CLASS(klass); + + oclass->finalize = virt_viewer_session_vnc_finalize; + + dclass->close = virt_viewer_session_vnc_close; + dclass->open_fd = virt_viewer_session_vnc_open_fd; + dclass->open_host = virt_viewer_session_vnc_open_host; + dclass->open_uri = virt_viewer_session_vnc_open_uri; + dclass->channel_open_fd = virt_viewer_session_vnc_channel_open_fd; + + g_type_class_add_private(klass, sizeof(VirtViewerSessionVncPrivate)); } static void virt_viewer_session_vnc_init(VirtViewerSessionVnc *self G_GNUC_UNUSED) { - self->priv = VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(self); + self->priv = VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(self); } static void virt_viewer_session_vnc_connected(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerSessionVnc *session) -{ - GtkWidget *display = virt_viewer_display_vnc_new(session->priv->vnc); - g_signal_emit_by_name(session, "session-connected"); - virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(display), - VIRT_VIEWER_DISPLAY_SHOW_HINT_READY); - virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session), - VIRT_VIEWER_DISPLAY(display)); + VirtViewerSessionVnc *session) +{ + GtkWidget *display = virt_viewer_display_vnc_new(session->priv->vnc); + g_signal_emit_by_name(session, "session-connected"); + virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(display), + VIRT_VIEWER_DISPLAY_SHOW_HINT_READY); + virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session), + VIRT_VIEWER_DISPLAY(display)); } static void virt_viewer_session_vnc_disconnected(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerSessionVnc *session) -{ - g_signal_emit_by_name(session, "session-disconnected"); - /* TODO perhaps? */ - /* virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(session->priv->vnc), */ - /* VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE); */ + VirtViewerSessionVnc *session) +{ + g_signal_emit_by_name(session, "session-disconnected"); + /* TODO perhaps? */ + /* virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(session->priv->vnc), */ + /* VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE); */ } static void virt_viewer_session_vnc_initialized(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerSessionVnc *session) -{ - g_signal_emit_by_name(session, "session-initialized"); + VirtViewerSessionVnc *session) +{ + g_signal_emit_by_name(session, "session-initialized"); } static void virt_viewer_session_vnc_cut_text(VncDisplay *vnc G_GNUC_UNUSED, - const char *text, - VirtViewerSession *session) -{ - g_signal_emit_by_name(session, "session-cut-text", text); + const gchar *text, + VirtViewerSession *session) +{ + g_signal_emit_by_name(session, "session-cut-text", text); } static void virt_viewer_session_vnc_bell(VncDisplay *vnc G_GNUC_UNUSED, - VirtViewerSession *session) -{ - g_signal_emit_by_name(session, "session-bell"); + VirtViewerSession *session) +{ + g_signal_emit_by_name(session, "session-bell"); } static void virt_viewer_session_vnc_auth_unsupported(VncDisplay *vnc G_GNUC_UNUSED, - unsigned int authType, - VirtViewerSession *session) -{ - char *msg = g_strdup_printf(_("Unsupported authentication type %d"), - authType); - g_signal_emit_by_name(session, "session-auth-failed", msg); - g_free(msg); + unsigned int authType, + VirtViewerSession *session) +{ + gchar *msg = g_strdup_printf(_("Unsupported authentication type %d"), + authType); + g_signal_emit_by_name(session, "session-auth-failed", msg); + g_free(msg); } static void virt_viewer_session_vnc_auth_failure(VncDisplay *vnc G_GNUC_UNUSED, - const char *reason, - VirtViewerSession *session) -{ - - g_signal_emit_by_name(session, "session-auth-refused", reason); + const gchar *reason, + VirtViewerSession *session) +{ + + g_signal_emit_by_name(session, "session-auth-refused", reason); } static gboolean virt_viewer_session_vnc_open_fd(VirtViewerSession* session, - int fd) -{ - VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); - - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(self->priv->vnc != NULL, FALSE); - - return vnc_display_open_fd(self->priv->vnc, fd); + int fd) +{ + VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); + + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(self->priv->vnc != NULL, FALSE); + + return vnc_display_open_fd(self->priv->vnc, fd); } static gboolean virt_viewer_session_vnc_channel_open_fd(VirtViewerSession* session G_GNUC_UNUSED, - VirtViewerSessionChannel* channel G_GNUC_UNUSED, - int fd G_GNUC_UNUSED) -{ - g_warning("channel_open_fd is not supported by VNC"); - return FALSE; + VirtViewerSessionChannel* channel G_GNUC_UNUSED, + int fd G_GNUC_UNUSED) +{ + g_warning("channel_open_fd is not supported by VNC"); + return FALSE; } static gboolean virt_viewer_session_vnc_open_host(VirtViewerSession* session, - char *host, - char *port) -{ - VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); - - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(self->priv->vnc != NULL, FALSE); - - return vnc_display_open_host(self->priv->vnc, host, port); -} + const gchar *host, + const gchar *port, + const gchar *tlsport G_GNUC_UNUSED) +{ + VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); + + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(self->priv->vnc != NULL, FALSE); + + return vnc_display_open_host(self->priv->vnc, host, port); +} + +static gboolean +virt_viewer_session_vnc_open_uri(VirtViewerSession* session, + const gchar *uristr) +{ + VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); + xmlURIPtr uri = NULL; + gchar *portstr; + gboolean ret; + + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(self->priv->vnc != NULL, FALSE); + + if (!(uri = xmlParseURI(uristr))) + return FALSE; + + portstr = g_strdup_printf("%d", uri->port); + + ret = vnc_display_open_host(self->priv->vnc, uri->server, portstr); + g_free(portstr); + xmlFreeURI(uri); + return ret; +} + + +static void +virt_viewer_session_vnc_auth_credential(GtkWidget *src, + GValueArray *credList, + VirtViewerSession *session) +{ + VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); + + virt_viewer_auth_vnc_credentials(self->priv->main_window, + src, + credList, + NULL); +} + static void virt_viewer_session_vnc_close(VirtViewerSession* session) { - VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); - - g_return_if_fail(self != NULL); - - if (self->priv->vnc != NULL) { - virt_viewer_session_clear_displays(session); - vnc_display_close(self->priv->vnc); - g_object_unref(self->priv->vnc); - } - - self->priv->vnc = VNC_DISPLAY(vnc_display_new()); - - g_signal_connect(self->priv->vnc, "vnc-connected", - G_CALLBACK(virt_viewer_session_vnc_connected), session); - g_signal_connect(self->priv->vnc, "vnc-initialized", - G_CALLBACK(virt_viewer_session_vnc_initialized), session); - g_signal_connect(self->priv->vnc, "vnc-disconnected", - G_CALLBACK(virt_viewer_session_vnc_disconnected), session); - - g_signal_connect(self->priv->vnc, "vnc-bell", - G_CALLBACK(virt_viewer_session_vnc_bell), session); - g_signal_connect(self->priv->vnc, "vnc-auth-failure", - G_CALLBACK(virt_viewer_session_vnc_auth_failure), session); - g_signal_connect(self->priv->vnc, "vnc-auth-unsupported", - G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session); - g_signal_connect(self->priv->vnc, "vnc-server-cut-text", - G_CALLBACK(virt_viewer_session_vnc_cut_text), session); - - g_signal_connect(self->priv->vnc, "vnc-auth-credential", - G_CALLBACK(virt_viewer_auth_vnc_credentials), NULL); - - } + VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session); + + g_return_if_fail(self != NULL); + + if (self->priv->vnc != NULL) { + virt_viewer_session_clear_displays(session); + vnc_display_close(self->priv->vnc); + g_object_unref(self->priv->vnc); + } + + self->priv->vnc = VNC_DISPLAY(vnc_display_new()); + + g_signal_connect(self->priv->vnc, "vnc-connected", + G_CALLBACK(virt_viewer_session_vnc_connected), session); + g_signal_connect(self->priv->vnc, "vnc-initialized", + G_CALLBACK(virt_viewer_session_vnc_initialized), session); + g_signal_connect(self->priv->vnc, "vnc-disconnected", + G_CALLBACK(virt_viewer_session_vnc_disconnected), session); + + g_signal_connect(self->priv->vnc, "vnc-bell", + G_CALLBACK(virt_viewer_session_vnc_bell), session); + g_signal_connect(self->priv->vnc, "vnc-auth-failure", + G_CALLBACK(virt_viewer_session_vnc_auth_failure), session); + g_signal_connect(self->priv->vnc, "vnc-auth-unsupported", + G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session); + g_signal_connect(self->priv->vnc, "vnc-server-cut-text", + G_CALLBACK(virt_viewer_session_vnc_cut_text), session); + + g_signal_connect(self->priv->vnc, "vnc-auth-credential", + G_CALLBACK(virt_viewer_session_vnc_auth_credential), session); + +} VirtViewerSession * -virt_viewer_session_vnc_new(void) -{ - VirtViewerSessionVnc *session; - - session = g_object_new(VIRT_VIEWER_TYPE_SESSION_VNC, NULL); - - session->priv->vnc = VNC_DISPLAY(vnc_display_new()); - - g_signal_connect(session->priv->vnc, "vnc-connected", - G_CALLBACK(virt_viewer_session_vnc_connected), session); - g_signal_connect(session->priv->vnc, "vnc-initialized", - G_CALLBACK(virt_viewer_session_vnc_initialized), session); - g_signal_connect(session->priv->vnc, "vnc-disconnected", - G_CALLBACK(virt_viewer_session_vnc_disconnected), session); - - g_signal_connect(session->priv->vnc, "vnc-bell", - G_CALLBACK(virt_viewer_session_vnc_bell), session); - g_signal_connect(session->priv->vnc, "vnc-auth-failure", - G_CALLBACK(virt_viewer_session_vnc_auth_failure), session); - g_signal_connect(session->priv->vnc, "vnc-auth-unsupported", - G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session); - g_signal_connect(session->priv->vnc, "vnc-server-cut-text", - G_CALLBACK(virt_viewer_session_vnc_cut_text), session); - - g_signal_connect(session->priv->vnc, "vnc-auth-credential", - G_CALLBACK(virt_viewer_auth_vnc_credentials), NULL); - - return VIRT_VIEWER_SESSION(session); -} - - - +virt_viewer_session_vnc_new(GtkWindow *main_window) +{ + VirtViewerSessionVnc *session; + + session = g_object_new(VIRT_VIEWER_TYPE_SESSION_VNC, NULL); + + session->priv->vnc = VNC_DISPLAY(vnc_display_new()); + session->priv->main_window = g_object_ref(main_window); + + g_signal_connect(session->priv->vnc, "vnc-connected", + G_CALLBACK(virt_viewer_session_vnc_connected), session); + g_signal_connect(session->priv->vnc, "vnc-initialized", + G_CALLBACK(virt_viewer_session_vnc_initialized), session); + g_signal_connect(session->priv->vnc, "vnc-disconnected", + G_CALLBACK(virt_viewer_session_vnc_disconnected), session); + + g_signal_connect(session->priv->vnc, "vnc-bell", + G_CALLBACK(virt_viewer_session_vnc_bell), session); + g_signal_connect(session->priv->vnc, "vnc-auth-failure", + G_CALLBACK(virt_viewer_session_vnc_auth_failure), session); + g_signal_connect(session->priv->vnc, "vnc-auth-unsupported", + G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session); + g_signal_connect(session->priv->vnc, "vnc-server-cut-text", + G_CALLBACK(virt_viewer_session_vnc_cut_text), session); + + g_signal_connect(session->priv->vnc, "vnc-auth-credential", + G_CALLBACK(virt_viewer_session_vnc_auth_credential), session); + + return VIRT_VIEWER_SESSION(session); +} /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-session-vnc.h b/src/virt-viewer-session-vnc.h index 2684e45..2b95dde 100644 --- a/src/virt-viewer-session-vnc.h +++ b/src/virt-viewer-session-vnc.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -33,47 +33,46 @@ #define VIRT_VIEWER_TYPE_SESSION_VNC virt_viewer_session_vnc_get_type() -#define VIRT_VIEWER_SESSION_VNC(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVnc)) +#define VIRT_VIEWER_SESSION_VNC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVnc)) -#define VIRT_VIEWER_SESSION_VNC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass)) +#define VIRT_VIEWER_SESSION_VNC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass)) -#define VIRT_VIEWER_IS_SESSION_VNC(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_VNC)) +#define VIRT_VIEWER_IS_SESSION_VNC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_VNC)) -#define VIRT_VIEWER_IS_SESSION_VNC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_VNC)) +#define VIRT_VIEWER_IS_SESSION_VNC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_VNC)) -#define VIRT_VIEWER_SESSION_VNC_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass)) +#define VIRT_VIEWER_SESSION_VNC_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass)) typedef struct _VirtViewerSessionVnc VirtViewerSessionVnc; typedef struct _VirtViewerSessionVncClass VirtViewerSessionVncClass; typedef struct _VirtViewerSessionVncPrivate VirtViewerSessionVncPrivate; struct _VirtViewerSessionVnc { - VirtViewerSession parent; + VirtViewerSession parent; - VirtViewerSessionVncPrivate *priv; + VirtViewerSessionVncPrivate *priv; }; struct _VirtViewerSessionVncClass { - VirtViewerSessionClass parent_class; + VirtViewerSessionClass parent_class; }; GType virt_viewer_session_vnc_get_type(void); -VirtViewerSession *virt_viewer_session_vnc_new(void); +VirtViewerSession *virt_viewer_session_vnc_new(GtkWindow *main_window); G_END_DECLS #endif /* _VIRT_VIEWER_SESSION_VNC_H */ - /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c index d151238..7551567 100644 --- a/src/virt-viewer-session.c +++ b/src/virt-viewer-session.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -34,223 +34,354 @@ struct _VirtViewerSessionPrivate { - GList *displays; + GList *displays; + + gboolean auto_usbredir; }; G_DEFINE_ABSTRACT_TYPE(VirtViewerSession, virt_viewer_session, G_TYPE_OBJECT) +enum { + PROP_0, + + PROP_AUTO_USBREDIR, +}; + static void virt_viewer_session_finalize(GObject *obj) { - VirtViewerSession *session = VIRT_VIEWER_SESSION(obj); - GList *tmp = session->priv->displays; - - while (tmp) { - g_object_unref(tmp->data); - tmp = tmp->next; - } - g_list_free(session->priv->displays); - - G_OBJECT_CLASS(virt_viewer_session_parent_class)->finalize(obj); + VirtViewerSession *session = VIRT_VIEWER_SESSION(obj); + GList *tmp = session->priv->displays; + + while (tmp) { + g_object_unref(tmp->data); + tmp = tmp->next; + } + g_list_free(session->priv->displays); + + G_OBJECT_CLASS(virt_viewer_session_parent_class)->finalize(obj); +} + +static void +virt_viewer_session_set_property(GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + VirtViewerSession *self = VIRT_VIEWER_SESSION(object); + + switch (prop_id) { + case PROP_AUTO_USBREDIR: + virt_viewer_session_set_auto_usbredir(self, g_value_get_boolean(value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } +} + +static void +virt_viewer_session_get_property(GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + VirtViewerSession *self = VIRT_VIEWER_SESSION(object); + + switch (prop_id) { + case PROP_AUTO_USBREDIR: + g_value_set_boolean(value, virt_viewer_session_get_auto_usbredir(self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } } static void virt_viewer_session_class_init(VirtViewerSessionClass *class) { - GObjectClass *object_class = G_OBJECT_CLASS(class); - - object_class->finalize = virt_viewer_session_finalize; - - g_signal_new("session-connected", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_connected), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_signal_new("session-initialized", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_initialized), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_signal_new("session-disconnected", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_disconnected), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_signal_new("session-channel-open", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_channel_open), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, - G_TYPE_OBJECT); - - g_signal_new("session-auth-refused", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_refused), - NULL, - NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, - 1, - G_TYPE_STRING); - - g_signal_new("session-auth-failed", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_failed), - NULL, - NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, - 1, - G_TYPE_STRING); - - - g_signal_new("session-display-added", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_added), - NULL, - NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, - VIRT_VIEWER_TYPE_DISPLAY); - - g_signal_new("session-display-removed", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_removed), - NULL, - NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, - VIRT_VIEWER_TYPE_DISPLAY); - - g_signal_new("session-cut-text", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_cut_text), - NULL, - NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, - 1, - G_TYPE_STRING); - - g_signal_new("session-bell", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, - G_STRUCT_OFFSET(VirtViewerSessionClass, session_bell), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_type_class_add_private(object_class, sizeof(VirtViewerSessionPrivate)); + GObjectClass *object_class = G_OBJECT_CLASS(class); + + object_class->set_property = virt_viewer_session_set_property; + object_class->get_property = virt_viewer_session_get_property; + object_class->finalize = virt_viewer_session_finalize; + + g_object_class_install_property(object_class, + PROP_AUTO_USBREDIR, + g_param_spec_boolean("auto-usbredir", + "USB redirection", + "USB redirection", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + g_signal_new("session-connected", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_connected), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("session-initialized", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_initialized), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("session-disconnected", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_disconnected), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("session-channel-open", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_channel_open), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + G_TYPE_OBJECT); + + g_signal_new("session-auth-refused", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_refused), + NULL, + NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, + 1, + G_TYPE_STRING); + + g_signal_new("session-auth-failed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_failed), + NULL, + NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, + 1, + G_TYPE_STRING); + + g_signal_new("session-usb-failed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_usb_failed), + NULL, + NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, + 1, + G_TYPE_STRING); + + g_signal_new("session-display-added", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_added), + NULL, + NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + VIRT_VIEWER_TYPE_DISPLAY); + + g_signal_new("session-display-removed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_removed), + NULL, + NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + VIRT_VIEWER_TYPE_DISPLAY); + + g_signal_new("session-cut-text", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_cut_text), + NULL, + NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, + 1, + G_TYPE_STRING); + + g_signal_new("session-bell", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_bell), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_signal_new("session-cancelled", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(VirtViewerSessionClass, session_cancelled), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_type_class_add_private(class, sizeof(VirtViewerSessionPrivate)); } static void virt_viewer_session_init(VirtViewerSession *session) { - session->priv = VIRT_VIEWER_SESSION_GET_PRIVATE(session); + session->priv = VIRT_VIEWER_SESSION_GET_PRIVATE(session); } GtkWidget* virt_viewer_session_new(void) { - return g_object_new(VIRT_VIEWER_TYPE_SESSION, NULL); + return g_object_new(VIRT_VIEWER_TYPE_SESSION, NULL); } void virt_viewer_session_add_display(VirtViewerSession *session, - VirtViewerDisplay *display) -{ - session->priv->displays = g_list_append(session->priv->displays, display); - g_object_ref(display); - g_signal_emit_by_name(session, "session-display-added", display); + VirtViewerDisplay *display) +{ + session->priv->displays = g_list_append(session->priv->displays, display); + g_object_ref(display); + g_signal_emit_by_name(session, "session-display-added", display); } void virt_viewer_session_remove_display(VirtViewerSession *session, - VirtViewerDisplay *display) -{ - if (!g_list_find(session->priv->displays, display)) - return; - - session->priv->displays = g_list_remove(session->priv->displays, display); - g_signal_emit_by_name(session, "session-display-removed", display); - g_object_unref(display); + VirtViewerDisplay *display) +{ + if (!g_list_find(session->priv->displays, display)) + return; + + session->priv->displays = g_list_remove(session->priv->displays, display); + g_signal_emit_by_name(session, "session-display-removed", display); + g_object_unref(display); } void virt_viewer_session_clear_displays(VirtViewerSession *session) { - GList *tmp = session->priv->displays; - - while (tmp) { - g_signal_emit_by_name(session, "session-display-removed", tmp->data); - g_object_unref(tmp->data); - tmp = tmp->next; - } - g_list_free(session->priv->displays); - session->priv->displays = NULL; + GList *tmp = session->priv->displays; + + while (tmp) { + g_signal_emit_by_name(session, "session-display-removed", tmp->data); + g_object_unref(tmp->data); + tmp = tmp->next; + } + g_list_free(session->priv->displays); + session->priv->displays = NULL; } void virt_viewer_session_close(VirtViewerSession *session) { - g_return_if_fail(VIRT_VIEWER_IS_SESSION(session)); - - VIRT_VIEWER_SESSION_GET_CLASS(session)->close(session); + g_return_if_fail(VIRT_VIEWER_IS_SESSION(session)); + + VIRT_VIEWER_SESSION_GET_CLASS(session)->close(session); } gboolean virt_viewer_session_open_fd(VirtViewerSession *session, int fd) { - g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE); - - return VIRT_VIEWER_SESSION_GET_CLASS(session)->open_fd(session, fd); -} - -gboolean virt_viewer_session_open_host(VirtViewerSession *session, char *host, char *port) -{ - VirtViewerSessionClass *klass; - - g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE); - - klass = VIRT_VIEWER_SESSION_GET_CLASS(session); - return klass->open_host(session, host, port); + g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE); + + return VIRT_VIEWER_SESSION_GET_CLASS(session)->open_fd(session, fd); +} + +gboolean virt_viewer_session_open_host(VirtViewerSession *session, const gchar *host, const gchar *port, const gchar *tlsport) +{ + VirtViewerSessionClass *klass; + + g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE); + + klass = VIRT_VIEWER_SESSION_GET_CLASS(session); + return klass->open_host(session, host, port, tlsport); +} + +gboolean virt_viewer_session_open_uri(VirtViewerSession *session, const gchar *uri) +{ + VirtViewerSessionClass *klass; + + g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE); + + klass = VIRT_VIEWER_SESSION_GET_CLASS(session); + g_return_val_if_fail(klass->open_uri != NULL, FALSE); + + return klass->open_uri(session, uri); } gboolean virt_viewer_session_channel_open_fd(VirtViewerSession *session, - VirtViewerSessionChannel *channel, int fd) -{ - g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE); - - return VIRT_VIEWER_SESSION_GET_CLASS(session)->channel_open_fd(session, channel, fd); + VirtViewerSessionChannel *channel, int fd) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE); + + return VIRT_VIEWER_SESSION_GET_CLASS(session)->channel_open_fd(session, channel, fd); +} + +void virt_viewer_session_set_auto_usbredir(VirtViewerSession *self, gboolean auto_usbredir) +{ + g_return_if_fail(VIRT_VIEWER_IS_SESSION(self)); + + if (self->priv->auto_usbredir == auto_usbredir) + return; + + self->priv->auto_usbredir = auto_usbredir; + g_object_notify(G_OBJECT(self), "auto-usbredir"); +} + +gboolean virt_viewer_session_get_auto_usbredir(VirtViewerSession *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(self), FALSE); + + return self->priv->auto_usbredir; +} + +gboolean virt_viewer_session_has_usb(VirtViewerSession *self) +{ + VirtViewerSessionClass *klass; + + g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(self), FALSE); + + klass = VIRT_VIEWER_SESSION_GET_CLASS(self); + if (klass->has_usb == NULL) + return FALSE; + + return klass->has_usb(self); +} + +void virt_viewer_session_usb_device_selection(VirtViewerSession *self, + GtkWindow *parent) +{ + VirtViewerSessionClass *klass; + + g_return_if_fail(VIRT_VIEWER_IS_SESSION(self)); + + klass = VIRT_VIEWER_SESSION_GET_CLASS(self); + g_return_if_fail(klass->usb_device_selection != NULL); + + klass->usb_device_selection(self, parent); } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-session.h b/src/virt-viewer-session.h index 48c8de3..59a7c61 100644 --- a/src/virt-viewer-session.h +++ b/src/virt-viewer-session.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -32,23 +32,21 @@ #define VIRT_VIEWER_TYPE_SESSION virt_viewer_session_get_type() -#define VIRT_VIEWER_SESSION(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSession)) +#define VIRT_VIEWER_SESSION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSession)) -#define VIRT_VIEWER_SESSION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass)) +#define VIRT_VIEWER_SESSION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass)) #define VIRT_VIEWER_IS_SESSION(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION)) + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION)) #define VIRT_VIEWER_IS_SESSION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION)) + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION)) -#define VIRT_VIEWER_SESSION_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass)) +#define VIRT_VIEWER_SESSION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass)) -typedef struct _VirtViewerSession VirtViewerSession; -typedef struct _VirtViewerSessionClass VirtViewerSessionClass; typedef struct _VirtViewerSessionPrivate VirtViewerSessionPrivate; typedef struct _VirtViewerSessionChannel VirtViewerSessionChannel; @@ -56,36 +54,41 @@ /* perhaps this become an interface, and be pushed in gtkvnc and spice? */ struct _VirtViewerSession { - GObject parent; + GObject parent; - VirtViewerSessionPrivate *priv; + VirtViewerSessionPrivate *priv; }; struct _VirtViewerSessionClass { - GObjectClass parent_class; + GObjectClass parent_class; - /* virtual methods */ - void (* close) (VirtViewerSession* session); - gboolean (* open_fd) (VirtViewerSession* session, int fd); - gboolean (* open_host) (VirtViewerSession* session, char *host, char *port); - gboolean (* channel_open_fd) (VirtViewerSession* session, VirtViewerSessionChannel *channel, int fd); + /* virtual methods */ + void (* close) (VirtViewerSession* session); + gboolean (* open_fd) (VirtViewerSession* session, int fd); + gboolean (* open_host) (VirtViewerSession* session, const gchar *host, const gchar *port, const gchar *tlsport); + gboolean (* open_uri) (VirtViewerSession* session, const gchar *uri); + gboolean (* channel_open_fd) (VirtViewerSession* session, VirtViewerSessionChannel *channel, int fd); + gboolean (* has_usb) (VirtViewerSession* session); + void (* usb_device_selection) (VirtViewerSession* session, GtkWindow *parent); - /* signals */ - void (*session_connected)(VirtViewerSession *session); - void (*session_initialized)(VirtViewerSession *session); - void (*session_disconnected)(VirtViewerSession *session); - void (*session_auth_refused)(VirtViewerSession *session, const char *msg); - void (*session_auth_failed)(VirtViewerSession *session, const char *msg); + /* signals */ + void (*session_connected)(VirtViewerSession *session); + void (*session_initialized)(VirtViewerSession *session); + void (*session_disconnected)(VirtViewerSession *session); + void (*session_auth_refused)(VirtViewerSession *session, const gchar *msg); + void (*session_auth_failed)(VirtViewerSession *session, const gchar *msg); + void (*session_usb_failed)(VirtViewerSession *session, const gchar *msg); - void (*session_channel_open)(VirtViewerSession *session, VirtViewerSessionChannel *channel); + void (*session_channel_open)(VirtViewerSession *session, VirtViewerSessionChannel *channel); - void (*session_display_added)(VirtViewerSession *session, - VirtViewerDisplay *display); - void (*session_display_removed)(VirtViewerSession *session, - VirtViewerDisplay *display); + void (*session_display_added)(VirtViewerSession *session, + VirtViewerDisplay *display); + void (*session_display_removed)(VirtViewerSession *session, + VirtViewerDisplay *display); - void (*session_cut_text)(VirtViewerSession *session, const char *str); - void (*session_bell)(VirtViewerSession *session); + void (*session_cut_text)(VirtViewerSession *session, const gchar *str); + void (*session_bell)(VirtViewerSession *session); + void (*session_cancelled)(VirtViewerSession *session); }; GType virt_viewer_session_get_type(void); @@ -93,25 +96,34 @@ GtkWidget *virt_viewer_session_new(void); void virt_viewer_session_add_display(VirtViewerSession *session, - VirtViewerDisplay *display); + VirtViewerDisplay *display); void virt_viewer_session_remove_display(VirtViewerSession *session, - VirtViewerDisplay *display); + VirtViewerDisplay *display); void virt_viewer_session_clear_displays(VirtViewerSession *session); void virt_viewer_session_close(VirtViewerSession* session); gboolean virt_viewer_session_open_fd(VirtViewerSession* session, int fd); -gboolean virt_viewer_session_open_host(VirtViewerSession* session, char *host, char *port); +gboolean virt_viewer_session_open_host(VirtViewerSession* session, const gchar *host, const gchar *port, const gchar *tlsport); GObject* virt_viewer_session_get(VirtViewerSession* session); gboolean virt_viewer_session_channel_open_fd(VirtViewerSession* session, - VirtViewerSessionChannel* channel, int fd); + VirtViewerSessionChannel* channel, int fd); +gboolean virt_viewer_session_open_uri(VirtViewerSession *session, const gchar *uri); + +void virt_viewer_session_set_auto_usbredir(VirtViewerSession* session, gboolean auto_usbredir); +gboolean virt_viewer_session_get_auto_usbredir(VirtViewerSession* session); + +gboolean virt_viewer_session_has_usb(VirtViewerSession *self); +void virt_viewer_session_usb_device_selection(VirtViewerSession *self, + GtkWindow *parent); G_END_DECLS #endif /* _VIRT_VIEWER_SESSION_H */ + /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-util.c b/src/virt-viewer-util.c index 69679e1..dbb0bce 100644 --- a/src/virt-viewer-util.c +++ b/src/virt-viewer-util.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,42 +34,42 @@ GtkBuilder *virt_viewer_util_load_ui(const char *name) { - struct stat sb; - GtkBuilder *builder; - GError *error = NULL; + struct stat sb; + GtkBuilder *builder; + GError *error = NULL; - builder = gtk_builder_new(); - if (stat(name, &sb) >= 0) { - gtk_builder_add_from_file(builder, name, &error); - } else { - const gchar * const * dirs = g_get_system_data_dirs(); - g_return_val_if_fail(dirs != NULL, NULL); + builder = gtk_builder_new(); + if (stat(name, &sb) >= 0) { + gtk_builder_add_from_file(builder, name, &error); + } else { + const gchar * const * dirs = g_get_system_data_dirs(); + g_return_val_if_fail(dirs != NULL, NULL); - while (dirs[0] != NULL) { - gchar *path = g_build_filename(dirs[0], PACKAGE, "ui", name, NULL); - if (gtk_builder_add_from_file(builder, path, NULL) != 0) { - g_free(path); - break; - } - g_free(path); - dirs++; - } - if (dirs[0] == NULL) - goto failed; - } + while (dirs[0] != NULL) { + gchar *path = g_build_filename(dirs[0], PACKAGE, "ui", name, NULL); + if (gtk_builder_add_from_file(builder, path, NULL) != 0) { + g_free(path); + break; + } + g_free(path); + dirs++; + } + if (dirs[0] == NULL) + goto failed; + } - if (error) { - g_error("Cannot load UI description %s: %s", name, - error->message); - g_clear_error(&error); - goto failed; - } + if (error) { + g_error("Cannot load UI description %s: %s", name, + error->message); + g_clear_error(&error); + goto failed; + } - return builder; -failed: - g_error("failed to find UI description file"); - g_object_unref(builder); - return NULL; + return builder; + failed: + g_error("failed to find UI description file"); + g_object_unref(builder); + return NULL; } int @@ -80,57 +80,57 @@ char **user, int *port) { - xmlURIPtr uri; - char *offset; + xmlURIPtr uri; + char *offset; - if (uristr == NULL || - !g_strcasecmp(uristr, "xen")) - uristr = "xen:///"; + if (uristr == NULL || + !g_ascii_strcasecmp(uristr, "xen")) + uristr = "xen:///"; - uri = xmlParseURI(uristr); - g_return_val_if_fail(uri != NULL, 1); + uri = xmlParseURI(uristr); + g_return_val_if_fail(uri != NULL, 1); - if (host) { - if (!uri || !uri->server) - *host = g_strdup("localhost"); - else - *host = g_strdup(uri->server); - } + if (host) { + if (!uri || !uri->server) + *host = g_strdup("localhost"); + else + *host = g_strdup(uri->server); + } - if (user) { - if (uri->user) - *user = g_strdup(uri->user); - else - *user = NULL; - } + if (user) { + if (uri->user) + *user = g_strdup(uri->user); + else + *user = NULL; + } - if (port) - *port = uri->port; + if (port) + *port = uri->port; - offset = strchr(uri->scheme, '+'); + offset = strchr(uri->scheme, '+'); - if (transport) { - if (offset) - *transport = g_strdup(offset+1); - else - *transport = NULL; - } + if (transport) { + if (offset) + *transport = g_strdup(offset+1); + else + *transport = NULL; + } - if (scheme) { - if (offset) - *scheme = g_strndup(uri->scheme, offset - uri->scheme); - else - *scheme = g_strdup(uri->scheme); - } + if (scheme) { + if (offset) + *scheme = g_strndup(uri->scheme, offset - uri->scheme); + else + *scheme = g_strdup(uri->scheme); + } - xmlFreeURI(uri); - return 0; + xmlFreeURI(uri); + return 0; } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-util.h b/src/virt-viewer-util.h index 034ab8f..3a40651 100644 --- a/src/virt-viewer-util.h +++ b/src/virt-viewer-util.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,3 +41,11 @@ int *port); #endif + +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c index 3176151..0b1d397 100644 --- a/src/virt-viewer-window.c +++ b/src/virt-viewer-window.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -51,6 +51,7 @@ void virt_viewer_window_menu_view_resize(GtkWidget *menu, VirtViewerWindow *self); void virt_viewer_window_menu_send(GtkWidget *menu, VirtViewerWindow *self); void virt_viewer_window_menu_file_screenshot(GtkWidget *menu, VirtViewerWindow *self); +void virt_viewer_window_menu_file_usb_device_selection(GtkWidget *menu, VirtViewerWindow *self); /* Internal methods */ static void virt_viewer_window_enable_modifiers(VirtViewerWindow *self); @@ -60,49 +61,49 @@ G_DEFINE_TYPE (VirtViewerWindow, virt_viewer_window, G_TYPE_OBJECT) -#define GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowPrivate)) +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowPrivate)) enum { - PROP_0, - PROP_WINDOW, - PROP_DISPLAY, - PROP_SUBTITLE, - PROP_CONTAINER, - PROP_APP, + PROP_0, + PROP_WINDOW, + PROP_DISPLAY, + PROP_SUBTITLE, + PROP_CONTAINER, + PROP_APP, }; enum menuNums { - FILE_MENU, - VIEW_MENU, - SEND_KEY_MENU, - HELP_MENU, - LAST_MENU // sentinel + FILE_MENU, + VIEW_MENU, + SEND_KEY_MENU, + HELP_MENU, + LAST_MENU // sentinel }; struct _VirtViewerWindowPrivate { - VirtViewerApp *app; - GtkContainer *container; /* if any, then there is no window */ - - GtkBuilder *builder; - GtkWidget *window; - GtkWidget *layout; - GtkWidget *toolbar; - VirtViewerNotebook *notebook; - VirtViewerDisplay *display; - - gboolean accel_enabled; - GValue accel_setting; - GSList *accel_list; - int accel_menu_sig[LAST_MENU]; - gboolean grabbed; - gboolean before_saved; - GdkRectangle before_fullscreen; - - gint zoomlevel; - gboolean auto_resize; - gboolean fullscreen; - gchar *subtitle; + VirtViewerApp *app; + GtkContainer *container; /* if any, then there is no window */ + + GtkBuilder *builder; + GtkWidget *window; + GtkWidget *layout; + GtkWidget *toolbar; + VirtViewerNotebook *notebook; + VirtViewerDisplay *display; + + gboolean accel_enabled; + GValue accel_setting; + GSList *accel_list; + int accel_menu_sig[LAST_MENU]; + gboolean grabbed; + gboolean before_saved; + GdkRectangle before_fullscreen; + + gint zoomlevel; + gboolean auto_resize; + gboolean fullscreen; + gchar *subtitle; }; #if GTK_CHECK_VERSION(3, 0, 0) @@ -127,248 +128,248 @@ static void virt_viewer_window_get_property (GObject *object, guint property_id, - GValue *value, GParamSpec *pspec) -{ - VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv; - - switch (property_id) { - case PROP_SUBTITLE: - g_value_set_string(value, priv->subtitle); - break; - - case PROP_WINDOW: - g_value_set_object(value, priv->window); - break; - - case PROP_DISPLAY: - g_value_set_object(value, priv->display); - break; - - case PROP_CONTAINER: - g_value_set_object(value, priv->container); - break; - - case PROP_APP: - g_value_set_object(value, priv->app); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + GValue *value, GParamSpec *pspec) +{ + VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv; + + switch (property_id) { + case PROP_SUBTITLE: + g_value_set_string(value, priv->subtitle); + break; + + case PROP_WINDOW: + g_value_set_object(value, priv->window); + break; + + case PROP_DISPLAY: + g_value_set_object(value, priv->display); + break; + + case PROP_CONTAINER: + g_value_set_object(value, priv->container); + break; + + case PROP_APP: + g_value_set_object(value, priv->app); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_window_set_property (GObject *object, guint property_id, - const GValue *value, GParamSpec *pspec) -{ - VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv; - - switch (property_id) { - case PROP_SUBTITLE: - g_free(priv->subtitle); - priv->subtitle = g_value_dup_string(value); - virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(object)); - break; - - case PROP_CONTAINER: - g_return_if_fail(priv->container == NULL); - priv->container = g_value_dup_object(value); - break; - - case PROP_APP: - g_return_if_fail(priv->app == NULL); - priv->app = g_value_dup_object(value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + const GValue *value, GParamSpec *pspec) +{ + VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv; + + switch (property_id) { + case PROP_SUBTITLE: + g_free(priv->subtitle); + priv->subtitle = g_value_dup_string(value); + virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(object)); + break; + + case PROP_CONTAINER: + g_return_if_fail(priv->container == NULL); + priv->container = g_value_dup_object(value); + break; + + case PROP_APP: + g_return_if_fail(priv->app == NULL); + priv->app = g_value_dup_object(value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_window_dispose (GObject *object) { - VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv; - G_OBJECT_CLASS (virt_viewer_window_parent_class)->dispose (object); - - if (priv->display) { - g_object_unref(priv->display); - priv->display = NULL; - } - - if (priv->app) { - g_object_unref(priv->app); - priv->app = NULL; - } - - g_free(priv->subtitle); - priv->subtitle = NULL; + VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv; + G_OBJECT_CLASS (virt_viewer_window_parent_class)->dispose (object); + + if (priv->display) { + g_object_unref(priv->display); + priv->display = NULL; + } + + if (priv->app) { + g_object_unref(priv->app); + priv->app = NULL; + } + + g_free(priv->subtitle); + priv->subtitle = NULL; } static void virt_viewer_window_class_init (VirtViewerWindowClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (klass, sizeof (VirtViewerWindowPrivate)); - - object_class->get_property = virt_viewer_window_get_property; - object_class->set_property = virt_viewer_window_set_property; - object_class->dispose = virt_viewer_window_dispose; - - g_object_class_install_property(object_class, - PROP_SUBTITLE, - g_param_spec_string("subtitle", - "Subtitle", - "Window subtitle", - "", - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_WINDOW, - g_param_spec_object("window", - "Window", - "GtkWindow", - GTK_TYPE_WIDGET, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_DISPLAY, - g_param_spec_object("display", - "Display", - "VirtDisplay", - VIRT_VIEWER_TYPE_DISPLAY, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_CONTAINER, - g_param_spec_object("container", - "Container", - "Container widget", - VIRT_VIEWER_TYPE_DISPLAY, - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property(object_class, - PROP_APP, - g_param_spec_object("app", - "App", - "VirtViewerApp", - VIRT_VIEWER_TYPE_APP, - G_PARAM_READABLE | - G_PARAM_WRITABLE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS)); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (VirtViewerWindowPrivate)); + + object_class->get_property = virt_viewer_window_get_property; + object_class->set_property = virt_viewer_window_set_property; + object_class->dispose = virt_viewer_window_dispose; + + g_object_class_install_property(object_class, + PROP_SUBTITLE, + g_param_spec_string("subtitle", + "Subtitle", + "Window subtitle", + "", + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_WINDOW, + g_param_spec_object("window", + "Window", + "GtkWindow", + GTK_TYPE_WIDGET, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_DISPLAY, + g_param_spec_object("display", + "Display", + "VirtDisplay", + VIRT_VIEWER_TYPE_DISPLAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_CONTAINER, + g_param_spec_object("container", + "Container", + "Container widget", + VIRT_VIEWER_TYPE_DISPLAY, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property(object_class, + PROP_APP, + g_param_spec_object("app", + "App", + "VirtViewerApp", + VIRT_VIEWER_TYPE_APP, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); } static void virt_viewer_window_init (VirtViewerWindow *self) { - VirtViewerWindowPrivate *priv; - GtkWidget *vbox; - GtkWidget *menu; - GdkColor color; - GSList *accels; - - self->priv = GET_PRIVATE(self); - priv = self->priv; - - priv->auto_resize = TRUE; - g_value_init(&priv->accel_setting, G_TYPE_STRING); - - priv->notebook = virt_viewer_notebook_new(); - priv->builder = virt_viewer_util_load_ui("virt-viewer.xml"); - - menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-view-resize")); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE); - - gtk_builder_connect_signals(priv->builder, self); - - vbox = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer-box")); - virt_viewer_window_toolbar_setup(self); - - gtk_box_pack_end(GTK_BOX(vbox), priv->layout, TRUE, TRUE, 0); - gdk_color_parse("black", &color); - gtk_widget_modify_bg(priv->layout, GTK_STATE_NORMAL, &color); - - priv->window = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer")); - - virt_viewer_window_update_title(self); - gtk_window_set_resizable(GTK_WINDOW(priv->window), TRUE); + VirtViewerWindowPrivate *priv; + GtkWidget *vbox; + GtkWidget *menu; + GdkColor color; + GSList *accels; + + self->priv = GET_PRIVATE(self); + priv = self->priv; + + priv->auto_resize = TRUE; + g_value_init(&priv->accel_setting, G_TYPE_STRING); + + priv->notebook = virt_viewer_notebook_new(); + priv->builder = virt_viewer_util_load_ui("virt-viewer.xml"); + + menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-view-resize")); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE); + + gtk_builder_connect_signals(priv->builder, self); + + vbox = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer-box")); + virt_viewer_window_toolbar_setup(self); + + gtk_box_pack_end(GTK_BOX(vbox), priv->layout, TRUE, TRUE, 0); + gdk_color_parse("black", &color); + gtk_widget_modify_bg(priv->layout, GTK_STATE_NORMAL, &color); + + priv->window = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer")); + + virt_viewer_window_update_title(self); + gtk_window_set_resizable(GTK_WINDOW(priv->window), TRUE); #if GTK_CHECK_VERSION(3, 0, 0) - gtk_window_set_has_resize_grip(GTK_WINDOW(priv->window), FALSE); + gtk_window_set_has_resize_grip(GTK_WINDOW(priv->window), FALSE); #endif - priv->accel_enabled = TRUE; - - accels = gtk_accel_groups_from_object(G_OBJECT(priv->window)); - for ( ; accels ; accels = accels->next) { - priv->accel_list = g_slist_append(priv->accel_list, accels->data); - g_object_ref(G_OBJECT(accels->data)); - } - - priv->zoomlevel = 100; + priv->accel_enabled = TRUE; + + accels = gtk_accel_groups_from_object(G_OBJECT(priv->window)); + for ( ; accels ; accels = accels->next) { + priv->accel_list = g_slist_append(priv->accel_list, accels->data); + g_object_ref(G_OBJECT(accels->data)); + } + + priv->zoomlevel = 100; } static void virt_viewer_window_desktop_resize(VirtViewerDisplay *display G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - VirtViewerWindowPrivate *priv = self->priv; - if (priv->auto_resize && priv->window && !priv->fullscreen) - virt_viewer_window_resize(self); + VirtViewerWindow *self) +{ + VirtViewerWindowPrivate *priv = self->priv; + if (priv->auto_resize && priv->window && !priv->fullscreen) + virt_viewer_window_resize(self); } G_MODULE_EXPORT void virt_viewer_window_menu_view_zoom_out(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - VirtViewerWindowPrivate *priv = self->priv; - - if (priv->zoomlevel > 10) - priv->zoomlevel -= 10; - - if (!priv->display) - return; - - gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); - if (priv->display) - virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); + VirtViewerWindow *self) +{ + VirtViewerWindowPrivate *priv = self->priv; + + if (priv->zoomlevel > 10) + priv->zoomlevel -= 10; + + if (!priv->display) + return; + + gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); + if (priv->display) + virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); } G_MODULE_EXPORT void virt_viewer_window_menu_view_zoom_in(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - VirtViewerWindowPrivate *priv = self->priv; - - if (priv->zoomlevel < 400) - priv->zoomlevel += 10; - - if (!priv->display) - return; - - gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); - if (priv->display) - virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); + VirtViewerWindow *self) +{ + VirtViewerWindowPrivate *priv = self->priv; + + if (priv->zoomlevel < 400) + priv->zoomlevel += 10; + + if (!priv->display) + return; + + gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); + if (priv->display) + virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); } G_MODULE_EXPORT void virt_viewer_window_menu_view_zoom_reset(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - VirtViewerWindowPrivate *priv = self->priv; - gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); - priv->zoomlevel = 100; - - if (priv->display) - virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); + VirtViewerWindow *self) +{ + VirtViewerWindowPrivate *priv = self->priv; + gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); + priv->zoomlevel = 100; + + if (priv->display) + virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); } /* @@ -380,546 +381,583 @@ static void virt_viewer_window_resize(VirtViewerWindow *self) { - GdkRectangle fullscreen; - GdkScreen *screen; - int width, height; - double desktopAspect; - double screenAspect; - guint desktopWidth; - guint desktopHeight; - VirtViewerWindowPrivate *priv = self->priv; - - DEBUG_LOG("Preparing main window resize"); - if (!priv->display) { - DEBUG_LOG("Skipping inactive resize"); - return; - } - - gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); - - virt_viewer_display_get_desktop_size(VIRT_VIEWER_DISPLAY(priv->display), - &desktopWidth, &desktopHeight); - - screen = gtk_widget_get_screen(priv->window); - gdk_screen_get_monitor_geometry(screen, - gdk_screen_get_monitor_at_window - (screen, gtk_widget_get_window(priv->window)), - &fullscreen); - - desktopAspect = (double)desktopWidth / (double)desktopHeight; - screenAspect = (double)(fullscreen.width - 128) / (double)(fullscreen.height - 128); - - if ((desktopWidth > (fullscreen.width - 128)) || - (desktopHeight > (fullscreen.height - 128))) { - /* Doesn't fit native res, so go as large as possible - maintaining aspect ratio */ - if (screenAspect > desktopAspect) { - width = desktopHeight * desktopAspect; - height = desktopHeight; - } else { - width = desktopWidth; - height = desktopWidth / desktopAspect; - } - } else { - width = desktopWidth; - height = desktopHeight; - } - - DEBUG_LOG("Decided todo %dx%d (desktop is %dx%d, fullscreen is %dx%d", - width, height, desktopWidth, desktopHeight, - fullscreen.width, fullscreen.height); - - virt_viewer_display_set_desktop_size(VIRT_VIEWER_DISPLAY(priv->display), - width, height); + GdkRectangle fullscreen; + GdkScreen *screen; + int width, height; + double desktopAspect; + double screenAspect; + guint desktopWidth; + guint desktopHeight; + VirtViewerWindowPrivate *priv = self->priv; + + DEBUG_LOG("Preparing main window resize"); + if (!priv->display) { + DEBUG_LOG("Skipping inactive resize"); + return; + } + + gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); + + virt_viewer_display_get_desktop_size(VIRT_VIEWER_DISPLAY(priv->display), + &desktopWidth, &desktopHeight); + + screen = gtk_widget_get_screen(priv->window); + gdk_screen_get_monitor_geometry(screen, + gdk_screen_get_monitor_at_window + (screen, gtk_widget_get_window(priv->window)), + &fullscreen); + + desktopAspect = (double)desktopWidth / (double)desktopHeight; + screenAspect = (double)(fullscreen.width - 128) / (double)(fullscreen.height - 128); + + if ((desktopWidth > (fullscreen.width - 128)) || + (desktopHeight > (fullscreen.height - 128))) { + /* Doesn't fit native res, so go as large as possible + maintaining aspect ratio */ + if (screenAspect > desktopAspect) { + width = desktopHeight * desktopAspect; + height = desktopHeight; + } else { + width = desktopWidth; + height = desktopWidth / desktopAspect; + } + } else { + width = desktopWidth; + height = desktopHeight; + } + + DEBUG_LOG("Decided todo %dx%d (desktop is %dx%d, fullscreen is %dx%d", + width, height, desktopWidth, desktopHeight, + fullscreen.width, fullscreen.height); + + virt_viewer_display_set_desktop_size(VIRT_VIEWER_DISPLAY(priv->display), + width, height); } void virt_viewer_window_leave_fullscreen(VirtViewerWindow *self) { - VirtViewerWindowPrivate *priv = self->priv; - GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu")); - GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen")); - - if (!priv->fullscreen) - return; - - gtk_check_menu_item_set_active(check, FALSE); - priv->fullscreen = FALSE; - ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE); - gtk_widget_show(menu); - gtk_widget_hide(priv->toolbar); + VirtViewerWindowPrivate *priv = self->priv; + GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu")); + GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen")); + + if (!priv->fullscreen) + return; + + gtk_check_menu_item_set_active(check, FALSE); + priv->fullscreen = FALSE; + ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE); + gtk_widget_show(menu); + gtk_widget_hide(priv->toolbar); #ifdef G_OS_WIN32 - gtk_widget_set_size_request(GTK_WIDGET(priv->window), -1, -1); + gtk_widget_set_size_request(GTK_WIDGET(priv->window), -1, -1); #endif - gtk_window_unfullscreen(GTK_WINDOW(priv->window)); - - if (priv->before_saved) { - gtk_window_move(GTK_WINDOW(priv->window), - priv->before_fullscreen.x, - priv->before_fullscreen.y); - gtk_window_resize(GTK_WINDOW(priv->window), - priv->before_fullscreen.width, - priv->before_fullscreen.height); - priv->before_saved = FALSE; - } + gtk_window_unfullscreen(GTK_WINDOW(priv->window)); + + if (priv->before_saved) { + gtk_window_move(GTK_WINDOW(priv->window), + priv->before_fullscreen.x, + priv->before_fullscreen.y); + gtk_window_resize(GTK_WINDOW(priv->window), + priv->before_fullscreen.width, + priv->before_fullscreen.height); + priv->before_saved = FALSE; + } } void virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gboolean move, gint x, gint y) { - VirtViewerWindowPrivate *priv = self->priv; - GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu")); - GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen")); - - if (!priv->before_saved) { - gtk_window_get_position(GTK_WINDOW(priv->window), - &priv->before_fullscreen.x, - &priv->before_fullscreen.y); - gtk_window_get_size(GTK_WINDOW(priv->window), - &priv->before_fullscreen.width, - &priv->before_fullscreen.height); - priv->before_saved = TRUE; - } - - if (!priv->fullscreen) { - gtk_check_menu_item_set_active(check, TRUE); - priv->fullscreen = TRUE; - gtk_widget_hide(menu); - gtk_widget_show(priv->toolbar); - ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), TRUE); - ViewAutoDrawer_Close(VIEW_AUTODRAWER(priv->layout)); - } - - if (move) - gtk_window_move(GTK_WINDOW(priv->window), x, y); - - gtk_window_fullscreen(GTK_WINDOW(priv->window)); + VirtViewerWindowPrivate *priv = self->priv; + GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu")); + GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen")); + + if (!priv->before_saved) { + gtk_window_get_position(GTK_WINDOW(priv->window), + &priv->before_fullscreen.x, + &priv->before_fullscreen.y); + gtk_window_get_size(GTK_WINDOW(priv->window), + &priv->before_fullscreen.width, + &priv->before_fullscreen.height); + priv->before_saved = TRUE; + } + + if (!priv->fullscreen) { + gtk_check_menu_item_set_active(check, TRUE); + priv->fullscreen = TRUE; + gtk_widget_hide(menu); + gtk_widget_show(priv->toolbar); + ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), TRUE); + ViewAutoDrawer_Close(VIEW_AUTODRAWER(priv->layout)); + } + + if (move) + gtk_window_move(GTK_WINDOW(priv->window), x, y); + + gtk_window_fullscreen(GTK_WINDOW(priv->window)); #ifdef G_OS_WIN32 - /* on windows, fullscreen doesn't always hide the taskbar - See https://bugzilla.gnome.org/show_bug.cgi?id=652049 */ - gtk_widget_set_size_request(GTK_WIDGET(priv->window), - gdk_screen_width(), - gdk_screen_height()); + /* on windows, fullscreen doesn't always hide the taskbar + See https://bugzilla.gnome.org/show_bug.cgi?id=652049 */ + gtk_widget_set_size_request(GTK_WIDGET(priv->window), + gdk_screen_width(), + gdk_screen_height()); #endif } #define MAX_KEY_COMBO 3 -struct keyComboDef { - guint keys[MAX_KEY_COMBO]; - guint nkeys; - const char *label; +struct keyComboDef { + guint keys[MAX_KEY_COMBO]; + guint nkeys; + const char *label; }; static const struct keyComboDef keyCombos[] = { - { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"}, - { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"}, - { {}, 0, "" }, - { { GDK_Control_L, GDK_Alt_L, GDK_F1 }, 3, "Ctrl+Alt+F_1"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F2 }, 3, "Ctrl+Alt+F_2"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F3 }, 3, "Ctrl+Alt+F_3"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F4 }, 3, "Ctrl+Alt+F_4"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_5"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F_6"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F_7"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F_8"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F9 }, 3, "Ctrl+Alt+F_9"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F10 }, 3, "Ctrl+Alt+F1_0"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F11 }, 3, "Ctrl+Alt+F11"}, - { { GDK_Control_L, GDK_Alt_L, GDK_F12 }, 3, "Ctrl+Alt+F12"}, - { {}, 0, "" }, - { { GDK_Print }, 1, "_PrintScreen"}, + { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"}, + { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"}, + { {}, 0, "" }, + { { GDK_Control_L, GDK_Alt_L, GDK_F1 }, 3, "Ctrl+Alt+F_1"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F2 }, 3, "Ctrl+Alt+F_2"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F3 }, 3, "Ctrl+Alt+F_3"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F4 }, 3, "Ctrl+Alt+F_4"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_5"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F_6"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F_7"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F_8"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F9 }, 3, "Ctrl+Alt+F_9"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F10 }, 3, "Ctrl+Alt+F1_0"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F11 }, 3, "Ctrl+Alt+F11"}, + { { GDK_Control_L, GDK_Alt_L, GDK_F12 }, 3, "Ctrl+Alt+F12"}, + { {}, 0, "" }, + { { GDK_Print }, 1, "_PrintScreen"}, }; G_MODULE_EXPORT void virt_viewer_window_menu_send(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - int i; - GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu)); - const char *text = gtk_label_get_label(GTK_LABEL(label)); - VirtViewerWindowPrivate *priv = self->priv; - - for (i = 0 ; i < G_N_ELEMENTS(keyCombos) ; i++) { - if (!strcmp(text, keyCombos[i].label)) { - DEBUG_LOG("Sending key combo %s", gtk_label_get_text(GTK_LABEL(label))); - virt_viewer_display_send_keys(VIRT_VIEWER_DISPLAY(priv->display), - keyCombos[i].keys, - keyCombos[i].nkeys); - return; - } - } - DEBUG_LOG("Failed to find key combo %s", gtk_label_get_text(GTK_LABEL(label))); + VirtViewerWindow *self) +{ + int i; + GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu)); + const char *text = gtk_label_get_label(GTK_LABEL(label)); + VirtViewerWindowPrivate *priv = self->priv; + + for (i = 0 ; i < G_N_ELEMENTS(keyCombos) ; i++) { + if (!strcmp(text, keyCombos[i].label)) { + DEBUG_LOG("Sending key combo %s", gtk_label_get_text(GTK_LABEL(label))); + virt_viewer_display_send_keys(VIRT_VIEWER_DISPLAY(priv->display), + keyCombos[i].keys, + keyCombos[i].nkeys); + return; + } + } + DEBUG_LOG("Failed to find key combo %s", gtk_label_get_text(GTK_LABEL(label))); } static gboolean virt_viewer_window_ignore_accel(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self G_GNUC_UNUSED) -{ - /* ignore accelerator */ - return TRUE; + VirtViewerWindow *self G_GNUC_UNUSED) +{ + /* ignore accelerator */ + return TRUE; } static const char * const menuNames[LAST_MENU] = { - "menu-file", "menu-view", "menu-send", "menu-help" + "menu-file", "menu-view", "menu-send", "menu-help" }; void virt_viewer_window_disable_modifiers(VirtViewerWindow *self) { - GtkSettings *settings = gtk_settings_get_default(); - VirtViewerWindowPrivate *priv = self->priv; - GValue empty; - GSList *accels; - int i; - - if (!priv->window) - return; - - if (!priv->accel_enabled) - return; - - /* This stops F10 activating menu bar */ - memset(&empty, 0, sizeof empty); - g_value_init(&empty, G_TYPE_STRING); - g_object_get_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting); - g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &empty); - - /* This stops global accelerators like Ctrl+Q == Quit */ - for (accels = priv->accel_list ; accels ; accels = accels->next) { - gtk_window_remove_accel_group(GTK_WINDOW(priv->window), accels->data); - } - - /* This stops menu bar shortcuts like Alt+F == File */ - for (i = 0 ; i < LAST_MENU ; i++) { - GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i])); - priv->accel_menu_sig[i] = - g_signal_connect(menu, "mnemonic-activate", - G_CALLBACK(virt_viewer_window_ignore_accel), self); - } - - priv->accel_enabled = FALSE; + GtkSettings *settings = gtk_settings_get_default(); + VirtViewerWindowPrivate *priv = self->priv; + GValue empty; + GSList *accels; + int i; + + if (!priv->window) + return; + + if (!priv->accel_enabled) + return; + + /* This stops F10 activating menu bar */ + memset(&empty, 0, sizeof empty); + g_value_init(&empty, G_TYPE_STRING); + g_object_get_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting); + g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &empty); + + /* This stops global accelerators like Ctrl+Q == Quit */ + for (accels = priv->accel_list ; accels ; accels = accels->next) { + gtk_window_remove_accel_group(GTK_WINDOW(priv->window), accels->data); + } + + /* This stops menu bar shortcuts like Alt+F == File */ + for (i = 0 ; i < LAST_MENU ; i++) { + GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i])); + priv->accel_menu_sig[i] = + g_signal_connect(menu, "mnemonic-activate", + G_CALLBACK(virt_viewer_window_ignore_accel), self); + } + + priv->accel_enabled = FALSE; } void virt_viewer_window_enable_modifiers(VirtViewerWindow *self) { - GtkSettings *settings = gtk_settings_get_default(); - VirtViewerWindowPrivate *priv = self->priv; - GSList *accels; - int i; - - if (!priv->window) - return; - - if (priv->accel_enabled) - return; - - /* This allows F10 activating menu bar */ - g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting); - - /* This allows global accelerators like Ctrl+Q == Quit */ - for (accels = priv->accel_list ; accels ; accels = accels->next) { - gtk_window_add_accel_group(GTK_WINDOW(priv->window), accels->data); - } - - /* This allows menu bar shortcuts like Alt+F == File */ - for (i = 0 ; i < LAST_MENU ; i++) { - GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i])); - g_signal_handler_disconnect(menu, priv->accel_menu_sig[i]); - } - - priv->accel_enabled = TRUE; + GtkSettings *settings = gtk_settings_get_default(); + VirtViewerWindowPrivate *priv = self->priv; + GSList *accels; + int i; + + if (!priv->window) + return; + + if (priv->accel_enabled) + return; + + /* This allows F10 activating menu bar */ + g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting); + + /* This allows global accelerators like Ctrl+Q == Quit */ + for (accels = priv->accel_list ; accels ; accels = accels->next) { + gtk_window_add_accel_group(GTK_WINDOW(priv->window), accels->data); + } + + /* This allows menu bar shortcuts like Alt+F == File */ + for (i = 0 ; i < LAST_MENU ; i++) { + GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i])); + g_signal_handler_disconnect(menu, priv->accel_menu_sig[i]); + } + + priv->accel_enabled = TRUE; } G_MODULE_EXPORT gboolean virt_viewer_window_delete(GtkWidget *src G_GNUC_UNUSED, - void *dummy G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - virt_viewer_app_window_set_visible(self->priv->app, self, FALSE); - return TRUE; + void *dummy G_GNUC_UNUSED, + VirtViewerWindow *self) +{ + virt_viewer_app_window_set_visible(self->priv->app, self, FALSE); + return TRUE; } G_MODULE_EXPORT void virt_viewer_window_menu_file_quit(GtkWidget *src G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - virt_viewer_app_quit(self->priv->app); + VirtViewerWindow *self) +{ + virt_viewer_app_quit(self->priv->app); } static void virt_viewer_window_toolbar_leave_fullscreen(GtkWidget *button G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - g_object_set(self->priv->app, "fullscreen", FALSE, NULL); + VirtViewerWindow *self) +{ + g_object_set(self->priv->app, "fullscreen", FALSE, NULL); } G_MODULE_EXPORT void virt_viewer_window_menu_view_fullscreen(GtkWidget *menu, - VirtViewerWindow *self) -{ - gboolean fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)); - - g_object_set(self->priv->app, "fullscreen", fullscreen, NULL); + VirtViewerWindow *self) +{ + gboolean fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu)); + + g_object_set(self->priv->app, "fullscreen", fullscreen, NULL); } G_MODULE_EXPORT void virt_viewer_window_menu_view_resize(GtkWidget *menu, - VirtViewerWindow *self) -{ - VirtViewerWindowPrivate *priv = self->priv; - - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) { - priv->auto_resize = TRUE; - if (!priv->fullscreen) - virt_viewer_window_resize(self); - } else { - priv->auto_resize = FALSE; - } + VirtViewerWindow *self) +{ + VirtViewerWindowPrivate *priv = self->priv; + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) { + priv->auto_resize = TRUE; + if (!priv->fullscreen) + virt_viewer_window_resize(self); + } else { + priv->auto_resize = FALSE; + } + + virt_viewer_display_set_auto_resize(priv->display, priv->auto_resize); } static void virt_viewer_window_save_screenshot(VirtViewerWindow *self, - const char *file) -{ - VirtViewerWindowPrivate *priv = self->priv; - GdkPixbuf *pix = virt_viewer_display_get_pixbuf(VIRT_VIEWER_DISPLAY(priv->display)); - - gdk_pixbuf_save(pix, file, "png", NULL, - "tEXt::Generator App", PACKAGE, NULL); - gdk_pixbuf_unref(pix); + const char *file) +{ + VirtViewerWindowPrivate *priv = self->priv; + GdkPixbuf *pix = virt_viewer_display_get_pixbuf(VIRT_VIEWER_DISPLAY(priv->display)); + + gdk_pixbuf_save(pix, file, "png", NULL, + "tEXt::Generator App", PACKAGE, NULL); + g_object_unref(pix); } G_MODULE_EXPORT void virt_viewer_window_menu_file_screenshot(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - GtkWidget *dialog; - VirtViewerWindowPrivate *priv = self->priv; - - g_return_if_fail(priv->display != NULL); - - dialog = gtk_file_chooser_dialog_new ("Save screenshot", - NULL, - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, - NULL); - gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); - - //gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving); - //gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Screenshot"); - - if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { - char *filename; - - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - virt_viewer_window_save_screenshot(self, filename); - g_free (filename); - } - - gtk_widget_destroy (dialog); + VirtViewerWindow *self) +{ + GtkWidget *dialog; + VirtViewerWindowPrivate *priv = self->priv; + + g_return_if_fail(priv->display != NULL); + + dialog = gtk_file_chooser_dialog_new("Save screenshot", + NULL, + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); + gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER (dialog), TRUE); + gtk_window_set_transient_for(GTK_WINDOW(dialog), + GTK_WINDOW(self->priv->window)); + + //gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving); + //gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Screenshot"); + + if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { + char *filename; + + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog)); + virt_viewer_window_save_screenshot(self, filename); + g_free(filename); + } + + gtk_widget_destroy(dialog); +} + +G_MODULE_EXPORT void +virt_viewer_window_menu_file_usb_device_selection(GtkWidget *menu G_GNUC_UNUSED, + VirtViewerWindow *self) +{ + virt_viewer_app_usb_device_selection(self->priv->app, + GTK_WINDOW(self->priv->window)); } G_MODULE_EXPORT void virt_viewer_window_menu_help_about(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - GtkBuilder *about = virt_viewer_util_load_ui("virt-viewer-about.xml"); - - GtkWidget *dialog = GTK_WIDGET(gtk_builder_get_object(about, "about")); - gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION); - - gtk_builder_connect_signals(about, self); - - gtk_widget_show_all(dialog); - - g_object_unref(G_OBJECT(about)); + VirtViewerWindow *self) +{ + GtkBuilder *about = virt_viewer_util_load_ui("virt-viewer-about.xml"); + + GtkWidget *dialog = GTK_WIDGET(gtk_builder_get_object(about, "about")); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION); + + gtk_window_set_transient_for(GTK_WINDOW(dialog), + GTK_WINDOW(self->priv->window)); + + gtk_builder_connect_signals(about, self); + + gtk_widget_show_all(dialog); + + g_object_unref(G_OBJECT(about)); } static void virt_viewer_window_toolbar_setup(VirtViewerWindow *self) { - GtkWidget *button; - VirtViewerWindowPrivate *priv = self->priv; - - priv->toolbar = gtk_toolbar_new(); - gtk_toolbar_set_show_arrow(GTK_TOOLBAR(priv->toolbar), FALSE); - gtk_widget_set_no_show_all(priv->toolbar, TRUE); - gtk_toolbar_set_style(GTK_TOOLBAR(priv->toolbar), GTK_TOOLBAR_BOTH_HORIZ); - - /* Close connection */ - button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_CLOSE)); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Disconnect")); - gtk_widget_show(GTK_WIDGET(button)); - gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM (button), 0); - g_signal_connect(button, "clicked", G_CALLBACK(gtk_main_quit), NULL); - - /* Leave fullscreen */ - button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_LEAVE_FULLSCREEN)); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), _("Leave fullscreen")); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Leave fullscreen")); - gtk_tool_item_set_is_important(GTK_TOOL_ITEM(button), TRUE); - gtk_widget_show(GTK_WIDGET(button)); - gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM(button), 0); - g_signal_connect(button, "clicked", G_CALLBACK(virt_viewer_window_toolbar_leave_fullscreen), self); - - priv->layout = ViewAutoDrawer_New(); - - ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE); - ViewOvBox_SetOver(VIEW_OV_BOX(priv->layout), priv->toolbar); - ViewOvBox_SetUnder(VIEW_OV_BOX(priv->layout), GTK_WIDGET(priv->notebook)); - ViewAutoDrawer_SetOffset(VIEW_AUTODRAWER(priv->layout), -1); - ViewAutoDrawer_SetFill(VIEW_AUTODRAWER(priv->layout), FALSE); - ViewAutoDrawer_SetOverlapPixels(VIEW_AUTODRAWER(priv->layout), 1); - ViewAutoDrawer_SetNoOverlapPixels(VIEW_AUTODRAWER(priv->layout), 0); - gtk_widget_show(priv->layout); + GtkWidget *button; + VirtViewerWindowPrivate *priv = self->priv; + + priv->toolbar = gtk_toolbar_new(); + gtk_toolbar_set_show_arrow(GTK_TOOLBAR(priv->toolbar), FALSE); + gtk_widget_set_no_show_all(priv->toolbar, TRUE); + gtk_toolbar_set_style(GTK_TOOLBAR(priv->toolbar), GTK_TOOLBAR_BOTH_HORIZ); + + /* Close connection */ + button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_CLOSE)); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Disconnect")); + gtk_widget_show(GTK_WIDGET(button)); + gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM (button), 0); + g_signal_connect(button, "clicked", G_CALLBACK(gtk_main_quit), NULL); + + /* Leave fullscreen */ + button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_LEAVE_FULLSCREEN)); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), _("Leave fullscreen")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Leave fullscreen")); + gtk_tool_item_set_is_important(GTK_TOOL_ITEM(button), TRUE); + gtk_widget_show(GTK_WIDGET(button)); + gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM(button), 0); + g_signal_connect(button, "clicked", G_CALLBACK(virt_viewer_window_toolbar_leave_fullscreen), self); + + priv->layout = ViewAutoDrawer_New(); + + ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE); + ViewOvBox_SetOver(VIEW_OV_BOX(priv->layout), priv->toolbar); + ViewOvBox_SetUnder(VIEW_OV_BOX(priv->layout), GTK_WIDGET(priv->notebook)); + ViewAutoDrawer_SetOffset(VIEW_AUTODRAWER(priv->layout), -1); + ViewAutoDrawer_SetFill(VIEW_AUTODRAWER(priv->layout), FALSE); + ViewAutoDrawer_SetOverlapPixels(VIEW_AUTODRAWER(priv->layout), 1); + ViewAutoDrawer_SetNoOverlapPixels(VIEW_AUTODRAWER(priv->layout), 0); + gtk_widget_show(priv->layout); } VirtViewerNotebook* virt_viewer_window_get_notebook (VirtViewerWindow *self) { - return VIRT_VIEWER_NOTEBOOK(self->priv->notebook); + return VIRT_VIEWER_NOTEBOOK(self->priv->notebook); } GtkWindow* virt_viewer_window_get_window (VirtViewerWindow *self) { - return GTK_WINDOW(self->priv->window); + return GTK_WINDOW(self->priv->window); } static void virt_viewer_window_pointer_grab(VirtViewerDisplay *display G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - VirtViewerWindowPrivate *priv = self->priv; - - priv->grabbed = TRUE; - virt_viewer_window_update_title(self); + VirtViewerWindow *self) +{ + VirtViewerWindowPrivate *priv = self->priv; + + priv->grabbed = TRUE; + virt_viewer_window_update_title(self); } static void virt_viewer_window_pointer_ungrab(VirtViewerDisplay *display G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - VirtViewerWindowPrivate *priv = self->priv; - - priv->grabbed = FALSE; - virt_viewer_window_update_title(self); + VirtViewerWindow *self) +{ + VirtViewerWindowPrivate *priv = self->priv; + + priv->grabbed = FALSE; + virt_viewer_window_update_title(self); } static void virt_viewer_window_keyboard_grab(VirtViewerDisplay *display G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - virt_viewer_window_disable_modifiers(self); + VirtViewerWindow *self) +{ + virt_viewer_window_disable_modifiers(self); } static void virt_viewer_window_keyboard_ungrab(VirtViewerDisplay *display G_GNUC_UNUSED, - VirtViewerWindow *self) -{ - virt_viewer_window_enable_modifiers(self); + VirtViewerWindow *self) +{ + virt_viewer_window_enable_modifiers(self); } void virt_viewer_window_update_title(VirtViewerWindow *self) { - VirtViewerWindowPrivate *priv = self->priv; - char *title; - const char *ungrab = NULL; - - if (priv->grabbed) - ungrab = _("(Press Ctrl+Alt to release pointer)"); - - if (!ungrab && !priv->subtitle) - title = g_strdup(g_get_application_name()); - else - /* translators: - * This is " - " - * Such as: "(Press Ctrl+Alt to release pointer) BigCorpTycoon MOTD - Virt Viewer" - */ - title = g_strdup_printf(_("%s%s%s - %s"), - /* translators: */ - ungrab ? ungrab : _(""), - /* translators: */ - ungrab && priv->subtitle ? _(" ") : _(""), - priv->subtitle, - g_get_application_name()); - - gtk_window_set_title(GTK_WINDOW(priv->window), title); - - g_free(title); + VirtViewerWindowPrivate *priv = self->priv; + char *title; + const char *ungrab = NULL; + + if (priv->grabbed) + ungrab = _("(Press Ctrl+Alt to release pointer)"); + + if (!ungrab && !priv->subtitle) + title = g_strdup(g_get_application_name()); + else + /* translators: + * This is " - " + * Such as: "(Press Ctrl+Alt to release pointer) BigCorpTycoon MOTD - Virt Viewer" + */ + title = g_strdup_printf(_("%s%s%s - %s"), + /* translators: */ + ungrab ? ungrab : _(""), + /* translators: */ + ungrab && priv->subtitle ? _(" ") : _(""), + priv->subtitle, + g_get_application_name()); + + gtk_window_set_title(GTK_WINDOW(priv->window), title); + + g_free(title); +} + +void +virt_viewer_window_set_usb_options_sensitive(VirtViewerWindow *self, gboolean sensitive) +{ + VirtViewerWindowPrivate *priv; + GtkWidget *menu; + + g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); + + priv = self->priv; + menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-file-usb-device-selection")); + gtk_widget_set_sensitive(menu, sensitive); } void virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *display) { - VirtViewerWindowPrivate *priv; - - g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); - g_return_if_fail(display == NULL || VIRT_VIEWER_IS_DISPLAY(display)); - - priv = self->priv; - if (priv->display) { - gtk_notebook_remove_page(GTK_NOTEBOOK(priv->notebook), 1); - g_object_unref(priv->display); - priv->display = NULL; - } - - if (display != NULL) { - priv->display = g_object_ref(display); - - virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); - - gtk_notebook_append_page(GTK_NOTEBOOK(priv->notebook), GTK_WIDGET(display), NULL); - gtk_widget_show_all(GTK_WIDGET(display)); - - g_signal_connect(display, "display-pointer-grab", - G_CALLBACK(virt_viewer_window_pointer_grab), self); - g_signal_connect(display, "display-pointer-ungrab", - G_CALLBACK(virt_viewer_window_pointer_ungrab), self); - g_signal_connect(display, "display-keyboard-grab", - G_CALLBACK(virt_viewer_window_keyboard_grab), self); - g_signal_connect(display, "display-keyboard-ungrab", - G_CALLBACK(virt_viewer_window_keyboard_ungrab), self); - g_signal_connect(display, "display-desktop-resize", - G_CALLBACK(virt_viewer_window_desktop_resize), self); - } + VirtViewerWindowPrivate *priv; + + g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); + g_return_if_fail(display == NULL || VIRT_VIEWER_IS_DISPLAY(display)); + + priv = self->priv; + if (priv->display) { + gtk_notebook_remove_page(GTK_NOTEBOOK(priv->notebook), 1); + g_object_unref(priv->display); + priv->display = NULL; + } + + if (display != NULL) { + priv->display = g_object_ref(display); + + virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel); + virt_viewer_display_set_auto_resize(VIRT_VIEWER_DISPLAY(priv->display), priv->auto_resize); + + gtk_notebook_append_page(GTK_NOTEBOOK(priv->notebook), GTK_WIDGET(display), NULL); + gtk_widget_show_all(GTK_WIDGET(display)); + + g_signal_connect(display, "display-pointer-grab", + G_CALLBACK(virt_viewer_window_pointer_grab), self); + g_signal_connect(display, "display-pointer-ungrab", + G_CALLBACK(virt_viewer_window_pointer_ungrab), self); + g_signal_connect(display, "display-keyboard-grab", + G_CALLBACK(virt_viewer_window_keyboard_grab), self); + g_signal_connect(display, "display-keyboard-ungrab", + G_CALLBACK(virt_viewer_window_keyboard_ungrab), self); + g_signal_connect(display, "display-desktop-resize", + G_CALLBACK(virt_viewer_window_desktop_resize), self); + } } void virt_viewer_window_set_zoom_level(VirtViewerWindow *self, gint zoom_level) { - g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); - - /* FIXME: turn into a dynamic property */ - self->priv->zoomlevel = zoom_level; + g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); + + /* FIXME: turn into a dynamic property */ + self->priv->zoomlevel = zoom_level; } gint virt_viewer_window_get_zoom_level(VirtViewerWindow *self) { - g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), 100); - return self->priv->zoomlevel; + g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), 100); + return self->priv->zoomlevel; } GtkMenuItem* virt_viewer_window_get_menu_displays(VirtViewerWindow *self) { - g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), NULL); - return GTK_MENU_ITEM(gtk_builder_get_object(self->priv->builder, "menu-displays")); + g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), NULL); + + return GTK_MENU_ITEM(gtk_builder_get_object(self->priv->builder, "menu-displays")); +} + +GtkBuilder* +virt_viewer_window_get_builder(VirtViewerWindow *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), NULL); + + return self->priv->builder; } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer-window.h b/src/virt-viewer-window.h index 9baab76..273d909 100644 --- a/src/virt-viewer-window.h +++ b/src/virt-viewer-window.h @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -32,30 +32,30 @@ #define VIRT_VIEWER_TYPE_WINDOW virt_viewer_window_get_type() -#define VIRT_VIEWER_WINDOW(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindow)) +#define VIRT_VIEWER_WINDOW(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindow)) -#define VIRT_VIEWER_WINDOW_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass)) +#define VIRT_VIEWER_WINDOW_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass)) -#define VIRT_VIEWER_IS_WINDOW(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_WINDOW)) +#define VIRT_VIEWER_IS_WINDOW(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_WINDOW)) -#define VIRT_VIEWER_IS_WINDOW_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_WINDOW)) +#define VIRT_VIEWER_IS_WINDOW_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_WINDOW)) -#define VIRT_VIEWER_WINDOW_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass)) +#define VIRT_VIEWER_WINDOW_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass)) typedef struct _VirtViewerWindowPrivate VirtViewerWindowPrivate; typedef struct { - GObject parent; - VirtViewerWindowPrivate *priv; + GObject parent; + VirtViewerWindowPrivate *priv; } VirtViewerWindow; typedef struct { - GObjectClass parent_class; + GObjectClass parent_class; } VirtViewerWindowClass; GType virt_viewer_window_get_type (void); @@ -63,21 +63,23 @@ GtkWindow* virt_viewer_window_get_window (VirtViewerWindow* window); VirtViewerNotebook* virt_viewer_window_get_notebook (VirtViewerWindow* window); void virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *display); +void virt_viewer_window_set_usb_options_sensitive(VirtViewerWindow *self, gboolean sensitive); void virt_viewer_window_update_title(VirtViewerWindow *self); void virt_viewer_window_set_zoom_level(VirtViewerWindow *self, gint zoom_level); gint virt_viewer_window_get_zoom_level(VirtViewerWindow *self); void virt_viewer_window_leave_fullscreen(VirtViewerWindow *self); void virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gboolean move, gint x, gint y); GtkMenuItem *virt_viewer_window_get_menu_displays(VirtViewerWindow *self); +GtkBuilder* virt_viewer_window_get_builder(VirtViewerWindow *window); G_END_DECLS #endif /* _VIRT_VIEWER_WINDOW */ + /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer.c b/src/virt-viewer.c index 7a7c488..3143104 100644 --- a/src/virt-viewer.c +++ b/src/virt-viewer.c @@ -1,8 +1,8 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007-2009 Red Hat, - * Copyright (C) 2009 Daniel P. Berrange + * Copyright (C) 2007-2012 Red Hat, Inc. + * Copyright (C) 2009-2012 Daniel P. Berrange * Copyright (C) 2010 Marc-André Lureau * * This program is free software; you can redistribute it and/or modify @@ -40,534 +40,656 @@ #include #include +#if defined(HAVE_SOCKETPAIR) +#include +#endif + #include "virt-viewer.h" #include "virt-viewer-app.h" #include "virt-viewer-events.h" #include "virt-viewer-auth.h" struct _VirtViewerPrivate { - char *uri; - virConnectPtr conn; - char *domkey; - gboolean withEvents; - gboolean waitvm; - gboolean reconnect; + char *uri; + virConnectPtr conn; + virDomainPtr dom; + char *domkey; + gboolean withEvents; + gboolean waitvm; + gboolean reconnect; }; G_DEFINE_TYPE (VirtViewer, virt_viewer, VIRT_VIEWER_TYPE_APP) -#define GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE, VirtViewerPrivate)) +#define GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE, VirtViewerPrivate)) static int virt_viewer_initial_connect(VirtViewerApp *self); +static gboolean virt_viewer_open_connection(VirtViewerApp *self, int *fd); static void virt_viewer_deactivated(VirtViewerApp *self); static gboolean virt_viewer_start(VirtViewerApp *self); static void virt_viewer_get_property (GObject *object, guint property_id, - GValue *value G_GNUC_UNUSED, GParamSpec *pspec) -{ - switch (property_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + GValue *value G_GNUC_UNUSED, GParamSpec *pspec) +{ + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_set_property (GObject *object, guint property_id, - const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) -{ - switch (property_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) +{ + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void virt_viewer_dispose (GObject *object) { - G_OBJECT_CLASS(virt_viewer_parent_class)->dispose (object); + VirtViewer *self = VIRT_VIEWER(object); + VirtViewerPrivate *priv = self->priv; + if (priv->dom) + virDomainFree(priv->dom); + if (priv->conn) + virConnectClose(priv->conn); + G_OBJECT_CLASS(virt_viewer_parent_class)->dispose (object); } static void virt_viewer_class_init (VirtViewerClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - VirtViewerAppClass *app_class = VIRT_VIEWER_APP_CLASS (klass); - - g_type_class_add_private (klass, sizeof (VirtViewerPrivate)); - - object_class->get_property = virt_viewer_get_property; - object_class->set_property = virt_viewer_set_property; - object_class->dispose = virt_viewer_dispose; - - app_class->initial_connect = virt_viewer_initial_connect; - app_class->deactivated = virt_viewer_deactivated; - app_class->start = virt_viewer_start; + GObjectClass *object_class = G_OBJECT_CLASS (klass); + VirtViewerAppClass *app_class = VIRT_VIEWER_APP_CLASS (klass); + + g_type_class_add_private (klass, sizeof (VirtViewerPrivate)); + + object_class->get_property = virt_viewer_get_property; + object_class->set_property = virt_viewer_set_property; + object_class->dispose = virt_viewer_dispose; + + app_class->initial_connect = virt_viewer_initial_connect; + app_class->deactivated = virt_viewer_deactivated; + app_class->open_connection = virt_viewer_open_connection; + app_class->start = virt_viewer_start; } static void virt_viewer_init(VirtViewer *self) { - self->priv = GET_PRIVATE(self); + self->priv = GET_PRIVATE(self); } static void virt_viewer_deactivated(VirtViewerApp *app) { - VirtViewer *self = VIRT_VIEWER(app); - VirtViewerPrivate *priv = self->priv; - - if (priv->reconnect) { - if (!priv->withEvents) { - DEBUG_LOG("No domain events, falling back to polling"); - virt_viewer_app_start_reconnect_poll(app); - } - - virt_viewer_app_show_status(app, _("Waiting for guest domain to re-start")); - virt_viewer_app_trace(app, "Guest %s display has disconnected, waiting to reconnect", priv->domkey); - } else { - VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->deactivated(app); - } + VirtViewer *self = VIRT_VIEWER(app); + VirtViewerPrivate *priv = self->priv; + + if (priv->dom) { + virDomainFree(priv->dom); + priv->dom = NULL; + } + + if (priv->reconnect) { + if (!priv->withEvents) { + DEBUG_LOG("No domain events, falling back to polling"); + virt_viewer_app_start_reconnect_poll(app); + } + + virt_viewer_app_show_status(app, _("Waiting for guest domain to re-start")); + virt_viewer_app_trace(app, "Guest %s display has disconnected, waiting to reconnect", priv->domkey); + } else { + VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->deactivated(app); + } } static int virt_viewer_parse_uuid(const char *name, - unsigned char *uuid) -{ - int i; - - const char *cur = name; - for (i = 0;i < 16;) { - uuid[i] = 0; - if (*cur == 0) - return -1; - if ((*cur == '-') || (*cur == ' ')) { - cur++; - continue; - } - if ((*cur >= '0') && (*cur <= '9')) - uuid[i] = *cur - '0'; - else if ((*cur >= 'a') && (*cur <= 'f')) - uuid[i] = *cur - 'a' + 10; - else if ((*cur >= 'A') && (*cur <= 'F')) - uuid[i] = *cur - 'A' + 10; - else - return -1; - uuid[i] *= 16; - cur++; - if (*cur == 0) - return -1; - if ((*cur >= '0') && (*cur <= '9')) - uuid[i] += *cur - '0'; - else if ((*cur >= 'a') && (*cur <= 'f')) - uuid[i] += *cur - 'a' + 10; - else if ((*cur >= 'A') && (*cur <= 'F')) - uuid[i] += *cur - 'A' + 10; - else - return -1; - i++; - cur++; - } - - return 0; + unsigned char *uuid) +{ + int i; + + const char *cur = name; + for (i = 0;i < 16;) { + uuid[i] = 0; + if (*cur == 0) + return -1; + if ((*cur == '-') || (*cur == ' ')) { + cur++; + continue; + } + if ((*cur >= '0') && (*cur <= '9')) + uuid[i] = *cur - '0'; + else if ((*cur >= 'a') && (*cur <= 'f')) + uuid[i] = *cur - 'a' + 10; + else if ((*cur >= 'A') && (*cur <= 'F')) + uuid[i] = *cur - 'A' + 10; + else + return -1; + uuid[i] *= 16; + cur++; + if (*cur == 0) + return -1; + if ((*cur >= '0') && (*cur <= '9')) + uuid[i] += *cur - '0'; + else if ((*cur >= 'a') && (*cur <= 'f')) + uuid[i] += *cur - 'a' + 10; + else if ((*cur >= 'A') && (*cur <= 'F')) + uuid[i] += *cur - 'A' + 10; + else + return -1; + i++; + cur++; + } + + return 0; } static virDomainPtr virt_viewer_lookup_domain(VirtViewer *self) { - char *end; - VirtViewerPrivate *priv = self->priv; - int id = strtol(priv->domkey, &end, 10); - virDomainPtr dom = NULL; - unsigned char uuid[16]; - - if (id >= 0 && end && !*end) { - dom = virDomainLookupByID(priv->conn, id); - } - if (!dom && virt_viewer_parse_uuid(priv->domkey, uuid) == 0) { - dom = virDomainLookupByUUID(priv->conn, uuid); - } - if (!dom) { - dom = virDomainLookupByName(priv->conn, priv->domkey); - } - return dom; + char *end; + VirtViewerPrivate *priv = self->priv; + int id = strtol(priv->domkey, &end, 10); + virDomainPtr dom = NULL; + unsigned char uuid[16]; + + if (id >= 0 && end && !*end) { + dom = virDomainLookupByID(priv->conn, id); + } + if (!dom && virt_viewer_parse_uuid(priv->domkey, uuid) == 0) { + dom = virDomainLookupByUUID(priv->conn, uuid); + } + if (!dom) { + dom = virDomainLookupByName(priv->conn, priv->domkey); + } + return dom; } static int virt_viewer_matches_domain(VirtViewer *self, - virDomainPtr dom) -{ - char *end; - const char *name; - VirtViewerPrivate *priv = self->priv; - int id = strtol(priv->domkey, &end, 10); - unsigned char wantuuid[16]; - unsigned char domuuid[16]; - - if (id >= 0 && end && !*end) { - if (virDomainGetID(dom) == id) - return 1; - } - if (virt_viewer_parse_uuid(priv->domkey, wantuuid) == 0) { - virDomainGetUUID(dom, domuuid); - if (memcmp(wantuuid, domuuid, VIR_UUID_BUFLEN) == 0) - return 1; - } - - name = virDomainGetName(dom); - if (strcmp(name, priv->domkey) == 0) - return 1; - - return 0; + virDomainPtr dom) +{ + char *end; + const char *name; + VirtViewerPrivate *priv = self->priv; + int id = strtol(priv->domkey, &end, 10); + unsigned char wantuuid[16]; + unsigned char domuuid[16]; + + if (id >= 0 && end && !*end) { + if (virDomainGetID(dom) == id) + return 1; + } + if (virt_viewer_parse_uuid(priv->domkey, wantuuid) == 0) { + virDomainGetUUID(dom, domuuid); + if (memcmp(wantuuid, domuuid, VIR_UUID_BUFLEN) == 0) + return 1; + } + + name = virDomainGetName(dom); + if (strcmp(name, priv->domkey) == 0) + return 1; + + return 0; } static char * virt_viewer_extract_xpath_string(const gchar *xmldesc, - const gchar *xpath) -{ - xmlDocPtr xml = NULL; - xmlParserCtxtPtr pctxt = NULL; - xmlXPathContextPtr ctxt = NULL; - xmlXPathObjectPtr obj = NULL; - char *port = NULL; - - pctxt = xmlNewParserCtxt(); - if (!pctxt || !pctxt->sax) - goto error; - - xml = xmlCtxtReadDoc(pctxt, (const xmlChar *)xmldesc, "domain.xml", NULL, - XML_PARSE_NOENT | XML_PARSE_NONET | - XML_PARSE_NOWARNING); - if (!xml) - goto error; - - ctxt = xmlXPathNewContext(xml); - if (!ctxt) - goto error; - - obj = xmlXPathEval((const xmlChar *)xpath, ctxt); - if (!obj || obj->type != XPATH_STRING || !obj->stringval || !obj->stringval[0]) - goto error; - if (!strcmp((const char*)obj->stringval, "-1")) - goto error; - - port = g_strdup((const char*)obj->stringval); - xmlXPathFreeObject(obj); - obj = NULL; + const gchar *xpath) +{ + xmlDocPtr xml = NULL; + xmlParserCtxtPtr pctxt = NULL; + xmlXPathContextPtr ctxt = NULL; + xmlXPathObjectPtr obj = NULL; + char *port = NULL; + + pctxt = xmlNewParserCtxt(); + if (!pctxt || !pctxt->sax) + goto error; + + xml = xmlCtxtReadDoc(pctxt, (const xmlChar *)xmldesc, "domain.xml", NULL, + XML_PARSE_NOENT | XML_PARSE_NONET | + XML_PARSE_NOWARNING); + if (!xml) + goto error; + + ctxt = xmlXPathNewContext(xml); + if (!ctxt) + goto error; + + obj = xmlXPathEval((const xmlChar *)xpath, ctxt); + if (!obj || obj->type != XPATH_STRING || !obj->stringval || !obj->stringval[0]) + goto error; + if (!strcmp((const char*)obj->stringval, "-1")) + goto error; + + port = g_strdup((const char*)obj->stringval); + xmlXPathFreeObject(obj); + obj = NULL; error: - if (obj) - xmlXPathFreeObject(obj); - if (ctxt) - xmlXPathFreeContext(ctxt); - if (xml) - xmlFreeDoc(xml); - if (pctxt) - xmlFreeParserCtxt(pctxt); - return port; + xmlXPathFreeObject(obj); + xmlXPathFreeContext(ctxt); + xmlFreeDoc(xml); + xmlFreeParserCtxt(pctxt); + return port; } static gboolean virt_viewer_extract_connect_info(VirtViewer *self, - virDomainPtr dom) -{ - char *type = NULL; - char *xpath = NULL; - gboolean retval = FALSE; - char *xmldesc = virDomainGetXMLDesc(dom, 0); - VirtViewerPrivate *priv = self->priv; - VirtViewerApp *app = VIRT_VIEWER_APP(self); - gchar *gport = NULL; - gchar *ghost = NULL; - gchar *unixsock = NULL; - gchar *host = NULL; - gchar *transport = NULL; - gchar *user = NULL; - gint port = 0; - gchar *uri = NULL; - - virt_viewer_app_free_connect_info(app); - - if ((type = virt_viewer_extract_xpath_string(xmldesc, "string(/domain/devices/graphics/@type)")) == NULL) { - virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic type for the guest %s"), - priv->domkey); - goto cleanup; - } - - if (virt_viewer_app_create_session(app, type) < 0) - goto cleanup; - - xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@port)", type); - if ((gport = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) { - free(xpath); - xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@socket)", type); - if ((unixsock = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) { - virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic address for the guest %s"), - priv->domkey); - goto cleanup; - } - } else { - free(xpath); - xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@listen)", type); - ghost = virt_viewer_extract_xpath_string(xmldesc, xpath); - if (ghost == NULL) - ghost = g_strdup("localhost"); - } - - if (ghost && gport) - DEBUG_LOG("Guest graphics address is %s:%s", ghost, gport); - else if (unixsock) - DEBUG_LOG("Guest graphics address is %s", unixsock); - - uri = virConnectGetURI(priv->conn); - if (virt_viewer_util_extract_host(uri, NULL, &host, &transport, &user, &port) < 0) { - virt_viewer_app_simple_message_dialog(app, _("Cannot determine the host for the guest %s"), - priv->domkey); - goto cleanup; - } - - /* If the XML listen attribute shows a wildcard address, we need to - * throw that away since you obviously can't 'connect(2)' to that - * from a remote host. Instead we fallback to the hostname used in - * the libvirt URI. This isn't perfect but it is better than nothing - */ - if (ghost && - (strcmp(ghost, "0.0.0.0") == 0 || - strcmp(ghost, "::") == 0)) { - DEBUG_LOG("Guest graphics listen '%s' is a wildcard, replacing with '%s'", - ghost, host); - g_free(ghost); - ghost = g_strdup(host); - } - - virt_viewer_app_set_connect_info(app, host, ghost, gport, transport, unixsock, user, port); - - retval = TRUE; + virDomainPtr dom) +{ + char *type = NULL; + char *xpath = NULL; + gboolean retval = FALSE; + char *xmldesc = virDomainGetXMLDesc(dom, 0); + VirtViewerPrivate *priv = self->priv; + VirtViewerApp *app = VIRT_VIEWER_APP(self); + gchar *gport = NULL; + gchar *gtlsport = NULL; + gchar *ghost = NULL; + gchar *unixsock = NULL; + gchar *host = NULL; + gchar *transport = NULL; + gchar *user = NULL; + gint port = 0; + gchar *uri = NULL; + + virt_viewer_app_free_connect_info(app); + + if ((type = virt_viewer_extract_xpath_string(xmldesc, "string(/domain/devices/graphics/@type)")) == NULL) { + virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic type for the guest %s"), + priv->domkey); + goto cleanup; + } + + if (virt_viewer_app_create_session(app, type) < 0) + goto cleanup; + + xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@port)", type); + if ((gport = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) { + free(xpath); + xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@socket)", type); + if ((unixsock = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) { + virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic address for the guest %s"), + priv->domkey); + goto cleanup; + } + } else { + if (g_str_equal(type, "spice")) { + free(xpath); + xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@tlsPort)", type); + gtlsport = virt_viewer_extract_xpath_string(xmldesc, xpath); + } + + free(xpath); + xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@listen)", type); + ghost = virt_viewer_extract_xpath_string(xmldesc, xpath); + } + + if (ghost && gport) + DEBUG_LOG("Guest graphics address is %s:%s", ghost, gport); + else if (unixsock) + DEBUG_LOG("Guest graphics address is %s", unixsock); + + uri = virConnectGetURI(priv->conn); + if (virt_viewer_util_extract_host(uri, NULL, &host, &transport, &user, &port) < 0) { + virt_viewer_app_simple_message_dialog(app, _("Cannot determine the host for the guest %s"), + priv->domkey); + goto cleanup; + } + + /* If the XML listen attribute shows a wildcard address, we need to + * throw that away since you obviously can't 'connect(2)' to that + * from a remote host. Instead we fallback to the hostname used in + * the libvirt URI. This isn't perfect but it is better than nothing + */ + if (!ghost || + (strcmp(ghost, "0.0.0.0") == 0 || + strcmp(ghost, "::") == 0)) { + DEBUG_LOG("Guest graphics listen '%s' is NULL or a wildcard, replacing with '%s'", + ghost ? ghost : "", host); + g_free(ghost); + ghost = g_strdup(host); + } + + virt_viewer_app_set_connect_info(app, host, ghost, gport, gtlsport,transport, unixsock, user, port, NULL); + + retval = TRUE; cleanup: - g_free(gport); - g_free(ghost); - g_free(unixsock); - g_free(host); - g_free(transport); - g_free(user); - g_free(type); - g_free(xpath); - g_free(xmldesc); - g_free(uri); - return retval; + g_free(gport); + g_free(gtlsport); + g_free(ghost); + g_free(unixsock); + g_free(host); + g_free(transport); + g_free(user); + g_free(type); + g_free(xpath); + g_free(xmldesc); + g_free(uri); + return retval; } static int virt_viewer_update_display(VirtViewer *self, virDomainPtr dom) { - VirtViewerPrivate *priv = self->priv; - VirtViewerApp *app = VIRT_VIEWER_APP(self); - - virt_viewer_app_trace(app, "Guest %s is running, determining display\n", - priv->domkey); - - g_object_set(app, "title", virDomainGetName(dom), NULL); - - if (!virt_viewer_app_has_session(app)) { - if (!virt_viewer_extract_connect_info(self, dom)) - return -1; - } - - return 0; + VirtViewerPrivate *priv = self->priv; + VirtViewerApp *app = VIRT_VIEWER_APP(self); + + if (priv->dom) + virDomainFree(priv->dom); + priv->dom = dom; + virDomainRef(priv->dom); + + virt_viewer_app_trace(app, "Guest %s is running, determining display\n", + priv->domkey); + + g_object_set(app, "title", virDomainGetName(dom), NULL); + + if (!virt_viewer_app_has_session(app)) { + if (!virt_viewer_extract_connect_info(self, dom)) + return -1; + } + + return 0; +} + +static gboolean +virt_viewer_open_connection(VirtViewerApp *self G_GNUC_UNUSED, int *fd) +{ +#if defined(HAVE_SOCKETPAIR) + VirtViewer *viewer = VIRT_VIEWER(self); + VirtViewerPrivate *priv = viewer->priv; + int pair[2]; +#endif + *fd = -1; +#if defined(HAVE_SOCKETPAIR) + if (!priv->dom) + return TRUE; + + if (socketpair(PF_UNIX, SOCK_STREAM, 0, pair) < 0) + return FALSE; + + if (virDomainOpenGraphics(priv->dom, 0, pair[0], + VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) < 0) { + virErrorPtr err = virGetLastError(); + DEBUG_LOG("Error %s", err && err->message ? err->message : "Unknown"); + close(pair[0]); + close(pair[1]); + return TRUE; + } + close(pair[0]); + *fd = pair[1]; +#endif + return TRUE; } static int virt_viewer_domain_event(virConnectPtr conn G_GNUC_UNUSED, - virDomainPtr dom, - int event, - int detail G_GNUC_UNUSED, - void *opaque) -{ - VirtViewer *self = opaque; - VirtViewerApp *app = VIRT_VIEWER_APP(self); - - DEBUG_LOG("Got domain event %d %d", event, detail); - - if (!virt_viewer_matches_domain(self, dom)) - return 0; - - switch (event) { - case VIR_DOMAIN_EVENT_STOPPED: - //virt_viewer_deactivate(self); - break; - - case VIR_DOMAIN_EVENT_STARTED: - virt_viewer_update_display(self, dom); - virt_viewer_app_activate(app); - break; - } - - return 0; + virDomainPtr dom, + int event, + int detail G_GNUC_UNUSED, + void *opaque) +{ + VirtViewer *self = opaque; + VirtViewerApp *app = VIRT_VIEWER_APP(self); + + DEBUG_LOG("Got domain event %d %d", event, detail); + + if (!virt_viewer_matches_domain(self, dom)) + return 0; + + switch (event) { + case VIR_DOMAIN_EVENT_STOPPED: + //virt_viewer_deactivate(self); + break; + + case VIR_DOMAIN_EVENT_STARTED: + virt_viewer_update_display(self, dom); + virt_viewer_app_activate(app); + break; + } + + return 0; } static int virt_viewer_initial_connect(VirtViewerApp *app) { - virDomainPtr dom = NULL; - virDomainInfo info; - int ret = -1; - VirtViewer *self = VIRT_VIEWER(app); - VirtViewerPrivate *priv = self->priv; - - virt_viewer_app_show_status(app, _("Finding guest domain")); - dom = virt_viewer_lookup_domain(self); - if (!dom) { - if (priv->waitvm) { - virt_viewer_app_show_status(app, _("Waiting for guest domain to be created")); - virt_viewer_app_trace(app, "Guest %s does not yet exist, waiting for it to be created\n", - priv->domkey); - goto done; - } else { - virt_viewer_app_simple_message_dialog(app, _("Cannot find guest domain %s"), - priv->domkey); - DEBUG_LOG("Cannot find guest %s", priv->domkey); - goto cleanup; - } - } - - virt_viewer_app_show_status(app, _("Checking guest domain status")); - if (virDomainGetInfo(dom, &info) < 0) { - DEBUG_LOG("Cannot get guest state"); - goto cleanup; - } - - if (info.state == VIR_DOMAIN_SHUTOFF) { - virt_viewer_app_show_status(app, _("Waiting for guest domain to start")); - } else { - ret = virt_viewer_update_display(self, dom); - if (ret >= 0) - ret = VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->initial_connect(app); - if (ret < 0) { - if (priv->waitvm) { - virt_viewer_app_show_status(app, _("Waiting for guest domain to start server")); - virt_viewer_app_trace(app, "Guest %s has not activated its display yet, waiting for it to start\n", - priv->domkey); - } else { - DEBUG_LOG("Failed to activate viewer"); - goto cleanup; - } - } else if (ret == 0) { - DEBUG_LOG("Failed to activate viewer"); - ret = -1; - goto cleanup; - } - } + virDomainPtr dom = NULL; + virDomainInfo info; + int ret = -1; + VirtViewer *self = VIRT_VIEWER(app); + VirtViewerPrivate *priv = self->priv; + + virt_viewer_app_show_status(app, _("Finding guest domain")); + dom = virt_viewer_lookup_domain(self); + if (!dom) { + if (priv->waitvm) { + virt_viewer_app_show_status(app, _("Waiting for guest domain to be created")); + virt_viewer_app_trace(app, "Guest %s does not yet exist, waiting for it to be created\n", + priv->domkey); + goto done; + } else { + virt_viewer_app_simple_message_dialog(app, _("Cannot find guest domain %s"), + priv->domkey); + DEBUG_LOG("Cannot find guest %s", priv->domkey); + goto cleanup; + } + } + + virt_viewer_app_show_status(app, _("Checking guest domain status")); + if (virDomainGetInfo(dom, &info) < 0) { + DEBUG_LOG("Cannot get guest state"); + goto cleanup; + } + + if (info.state == VIR_DOMAIN_SHUTOFF) { + virt_viewer_app_show_status(app, _("Waiting for guest domain to start")); + } else { + ret = virt_viewer_update_display(self, dom); + if (ret >= 0) + ret = VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->initial_connect(app); + if (ret < 0) { + if (priv->waitvm) { + virt_viewer_app_show_status(app, _("Waiting for guest domain to start server")); + virt_viewer_app_trace(app, "Guest %s has not activated its display yet, waiting for it to start\n", + priv->domkey); + } else { + DEBUG_LOG("Failed to activate viewer"); + goto cleanup; + } + } else if (ret == 0) { + DEBUG_LOG("Failed to activate viewer"); + ret = -1; + goto cleanup; + } + } done: - ret = 0; + ret = 0; cleanup: - if (dom) - virDomainFree(dom); - return ret; + if (dom) + virDomainFree(dom); + return ret; } static void virt_viewer_error_func (void *data G_GNUC_UNUSED, - virErrorPtr error G_GNUC_UNUSED) -{ - /* nada */ -} + virErrorPtr error G_GNUC_UNUSED) +{ + /* nada */ +} + + + +static int +virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred, + unsigned int ncred, + void *cbdata) +{ + char **username = NULL, **password = NULL; + VirtViewer *app = cbdata; + int i; + int ret = -1; + + DEBUG_LOG("Got libvirt credential request for %d credential(s)", ncred); + + for (i = 0 ; i < ncred ; i++) { + switch (cred[i].type) { + case VIR_CRED_USERNAME: + case VIR_CRED_AUTHNAME: + username = &cred[i].result; + break; + case VIR_CRED_PASSPHRASE: + password = &cred[i].result; + break; + default: + DEBUG_LOG("Unsupported libvirt credential %d", cred[i].type); + return -1; + } + } + + if (username || password) { + VirtViewerWindow *vwin = virt_viewer_app_get_main_window(VIRT_VIEWER_APP(app)); + GtkWindow *win = virt_viewer_window_get_window(vwin); + ret = virt_viewer_auth_collect_credentials(win, + "libvirt", + app->priv->uri, + username, password); + if (ret < 0) + goto cleanup; + } else { + ret = 0; + } + + for (i = 0 ; i < ncred ; i++) { + switch (cred[i].type) { + case VIR_CRED_AUTHNAME: + case VIR_CRED_USERNAME: + case VIR_CRED_PASSPHRASE: + if (cred[i].result) + cred[i].resultlen = strlen(cred[i].result); + else + cred[i].resultlen = 0; + DEBUG_LOG("Got '%s' %d %d", cred[i].result, cred[i].resultlen, cred[i].type); + break; + } + } + + cleanup: + DEBUG_LOG("Return %d", ret); + return ret; +} + static gboolean virt_viewer_start(VirtViewerApp *app) { - VirtViewer *self = VIRT_VIEWER(app); - VirtViewerPrivate *priv = self->priv; - int cred_types[] = - { VIR_CRED_AUTHNAME, VIR_CRED_PASSPHRASE }; - virConnectAuth auth_libvirt = { - .credtype = cred_types, - .ncredtype = ARRAY_CARDINALITY(cred_types), - .cb = virt_viewer_auth_libvirt_credentials, - .cbdata = (void *)priv->uri, - }; - - virt_viewer_events_register(); - - virSetErrorFunc(NULL, virt_viewer_error_func); - - virt_viewer_app_trace(app, "Opening connection to libvirt with URI %s\n", - priv->uri ? priv->uri : ""); - priv->conn = virConnectOpenAuth(priv->uri, - //virConnectAuthPtrDefault, - &auth_libvirt, - VIR_CONNECT_RO); - if (!priv->conn) { - virt_viewer_app_simple_message_dialog(app, _("Unable to connect to libvirt with URI %s"), - priv->uri ? priv->uri : _("[none]")); - return FALSE; - } - - if (virt_viewer_app_initial_connect(app) < 0) - return FALSE; - - if (virConnectDomainEventRegister(priv->conn, - virt_viewer_domain_event, - self, - NULL) < 0) - priv->withEvents = FALSE; - else - priv->withEvents = TRUE; - - if (!priv->withEvents && - !virt_viewer_app_is_active(app)) { - DEBUG_LOG("No domain events, falling back to polling"); - virt_viewer_app_start_reconnect_poll(app); - } - - return VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->start(app); + VirtViewer *self = VIRT_VIEWER(app); + VirtViewerPrivate *priv = self->priv; + int cred_types[] = + { VIR_CRED_AUTHNAME, VIR_CRED_PASSPHRASE }; + virConnectAuth auth_libvirt = { + .credtype = cred_types, + .ncredtype = ARRAY_CARDINALITY(cred_types), + .cb = virt_viewer_auth_libvirt_credentials, + .cbdata = app, + }; + int oflags = 0; + + if (!virt_viewer_app_get_attach(app)) + oflags |= VIR_CONNECT_RO; + + virt_viewer_events_register(); + + virSetErrorFunc(NULL, virt_viewer_error_func); + + virt_viewer_app_trace(app, "Opening connection to libvirt with URI %s\n", + priv->uri ? priv->uri : ""); + priv->conn = virConnectOpenAuth(priv->uri, + //virConnectAuthPtrDefault, + &auth_libvirt, + oflags); + if (!priv->conn) { + virt_viewer_app_simple_message_dialog(app, _("Unable to connect to libvirt with URI %s"), + priv->uri ? priv->uri : _("[none]")); + return FALSE; + } + + if (virt_viewer_app_initial_connect(app) < 0) + return FALSE; + + if (virConnectDomainEventRegister(priv->conn, + virt_viewer_domain_event, + self, + NULL) < 0) + priv->withEvents = FALSE; + else + priv->withEvents = TRUE; + + if (!priv->withEvents && + !virt_viewer_app_is_active(app)) { + DEBUG_LOG("No domain events, falling back to polling"); + virt_viewer_app_start_reconnect_poll(app); + } + + return VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->start(app); } VirtViewer * virt_viewer_new(const char *uri, - const char *name, - gint zoom, - gboolean direct, - gboolean waitvm, - gboolean reconnect, - gboolean verbose, - GtkWidget *container) -{ - VirtViewer *self; - VirtViewerApp *app; - VirtViewerPrivate *priv; - - self = g_object_new(VIRT_VIEWER_TYPE, - "container", container, - "verbose", verbose, - "guest-name", name, - NULL); - app = VIRT_VIEWER_APP(self); - priv = self->priv; - - /* Set initial title based on guest name arg, which can be a ID, - * UUID, or NAME string. To be replaced with the real guest name later - */ - g_object_set(app, "title", name, NULL); - virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom); - virt_viewer_app_set_direct(app, direct); - - /* should probably be properties instead */ - priv->uri = g_strdup(uri); - priv->domkey = g_strdup(name); - priv->waitvm = waitvm; - priv->reconnect = reconnect; - - return self; + const char *name, + gint zoom, + gboolean direct, + gboolean attach, + gboolean waitvm, + gboolean reconnect, + gboolean verbose, + GtkWidget *container) +{ + VirtViewer *self; + VirtViewerApp *app; + VirtViewerPrivate *priv; + + self = g_object_new(VIRT_VIEWER_TYPE, + "container", container, + "verbose", verbose, + "guest-name", name, + NULL); + app = VIRT_VIEWER_APP(self); + priv = self->priv; + + /* Set initial title based on guest name arg, which can be a ID, + * UUID, or NAME string. To be replaced with the real guest name later + */ + g_object_set(app, "title", name, NULL); + virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom); + virt_viewer_app_set_direct(app, direct); + virt_viewer_app_set_attach(app, attach); + + /* should probably be properties instead */ + priv->uri = g_strdup(uri); + priv->domkey = g_strdup(name); + priv->waitvm = waitvm; + priv->reconnect = reconnect; + + return self; } /* * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil * End: */ diff --git a/src/virt-viewer.h b/src/virt-viewer.h index 886a0f3..d136ade 100644 --- a/src/virt-viewer.h +++ b/src/virt-viewer.h @@ -1,7 +1,7 @@ /* * Virt Viewer: A virtual machine console viewer * - * Copyright (C) 2007 Red Hat, + * Copyright (C) 2007-2012 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,26 +38,35 @@ typedef struct _VirtViewerPrivate VirtViewerPrivate; typedef struct { - VirtViewerApp parent; - VirtViewerPrivate *priv; + VirtViewerApp parent; + VirtViewerPrivate *priv; } VirtViewer; typedef struct { - VirtViewerAppClass parent_class; + VirtViewerAppClass parent_class; } VirtViewerClass; GType virt_viewer_get_type (void); VirtViewer * virt_viewer_new(const char *uri, - const char *name, - gint zoom, - gboolean direct, - gboolean waitvm, - gboolean reconnect, - gboolean verbose, - GtkWidget *container); + const char *name, + gint zoom, + gboolean direct, + gboolean attach, + gboolean waitvm, + gboolean reconnect, + gboolean verbose, + GtkWidget *container); G_END_DECLS #endif /* VIRT_VIEWER_H */ + +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/src/virt-viewer.xml b/src/virt-viewer.xml index b701c2c..9075f26 100644 --- a/src/virt-viewer.xml +++ b/src/virt-viewer.xml @@ -33,6 +33,17 @@ Screenshot True + + + + + True + False + False + False + USB device selection + True + diff --git a/virt-viewer.spec b/virt-viewer.spec index 7f2faf5..cd128a8 100644 --- a/virt-viewer.spec +++ b/virt-viewer.spec @@ -20,7 +20,7 @@ %endif Name: virt-viewer -Version: 0.4.2 +Version: 0.5.0 Release: 1%{?dist}%{?extra_release} Summary: Virtual Machine Viewer Group: Applications/System @@ -29,6 +29,8 @@ Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: openssh-clients +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives %if %{with_gtk3} BuildRequires: gtk3-devel >= 3.0.0 @@ -44,9 +46,9 @@ %endif %if %{with_spice} %if %{with_gtk3} -BuildRequires: spice-gtk3-devel >= 0.6 +BuildRequires: spice-gtk3-devel >= 0.9 %else -BuildRequires: spice-gtk-devel >= 0.6 +BuildRequires: spice-gtk-devel >= 0.9 %endif %endif BuildRequires: /usr/bin/pod2man @@ -109,6 +111,9 @@ %install rm -rf $RPM_BUILD_ROOT %__make install DESTDIR=$RPM_BUILD_ROOT +mkdir -p %{buildroot}%{_libexecdir} +touch %{buildroot}%{_libexecdir}/spice-xpi-client +install -m 0755 data/spice-xpi-client-remote-viewer %{buildroot}%{_libexecdir}/ %if %{_with_plugin} rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.a rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.la @@ -118,16 +123,36 @@ %clean rm -rf $RPM_BUILD_ROOT +%post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +%{_sbindir}/update-alternatives --install %{_libexecdir}/spice-xpi-client \ + spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer 20 + +%postun +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + %{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer +fi + +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + %files -f %{name}.lang %defattr(-,root,root,-) %doc README COPYING AUTHORS ChangeLog NEWS %{_bindir}/%{name} +%{_bindir}/remote-viewer %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/ui/ %{_datadir}/%{name}/ui/virt-viewer.xml %{_datadir}/%{name}/ui/virt-viewer-auth.xml %{_datadir}/%{name}/ui/virt-viewer-about.xml -%{_mandir}/man1/%{name}* +%{_datadir}/icons/hicolor/*/apps/* +%ghost %{_libexecdir}/spice-xpi-client +%{_libexecdir}/spice-xpi-client-remote-viewer +%{_mandir}/man1/virt-viewer.1* +%{_mandir}/man1/remote-viewer.1* %if %{_with_plugin} %files plugin diff --git a/virt-viewer.spec.in b/virt-viewer.spec.in index c894099..12fccfc 100644 --- a/virt-viewer.spec.in +++ b/virt-viewer.spec.in @@ -29,6 +29,8 @@ Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: openssh-clients +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives %if %{with_gtk3} BuildRequires: gtk3-devel >= 3.0.0 @@ -44,9 +46,9 @@ %endif %if %{with_spice} %if %{with_gtk3} -BuildRequires: spice-gtk3-devel >= 0.6 +BuildRequires: spice-gtk3-devel >= 0.9 %else -BuildRequires: spice-gtk-devel >= 0.6 +BuildRequires: spice-gtk-devel >= 0.9 %endif %endif BuildRequires: /usr/bin/pod2man @@ -109,6 +111,9 @@ %install rm -rf $RPM_BUILD_ROOT %__make install DESTDIR=$RPM_BUILD_ROOT +mkdir -p %{buildroot}%{_libexecdir} +touch %{buildroot}%{_libexecdir}/spice-xpi-client +install -m 0755 data/spice-xpi-client-remote-viewer %{buildroot}%{_libexecdir}/ %if %{_with_plugin} rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.a rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.la @@ -118,16 +123,36 @@ %clean rm -rf $RPM_BUILD_ROOT +%post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +%{_sbindir}/update-alternatives --install %{_libexecdir}/spice-xpi-client \ + spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer 20 + +%postun +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + %{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer +fi + +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + %files -f %{name}.lang %defattr(-,root,root,-) %doc README COPYING AUTHORS ChangeLog NEWS %{_bindir}/%{name} +%{_bindir}/remote-viewer %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/ui/ %{_datadir}/%{name}/ui/virt-viewer.xml %{_datadir}/%{name}/ui/virt-viewer-auth.xml %{_datadir}/%{name}/ui/virt-viewer-about.xml -%{_mandir}/man1/%{name}* +%{_datadir}/icons/hicolor/*/apps/* +%ghost %{_libexecdir}/spice-xpi-client +%{_libexecdir}/spice-xpi-client-remote-viewer +%{_mandir}/man1/virt-viewer.1* +%{_mandir}/man1/remote-viewer.1* %if %{_with_plugin} %files plugin