Codebase list virt-viewer / upstream/0.5.0
Imported Upstream version 0.5.0 Laurent Léonard 12 years ago
92 changed file(s) with 14205 addition(s) and 4497 deletion(s). Raw diff Collapse all Expand all
22
33 The Virt Viewer application is written by
44
5 Daniel P. Berrange <berrange-at-redhat-dot-com>
5 Daniel P. Berrange <berrange@redhat.com>
66
77 With additional patches from:
88
9 Chris Lalancette <clalance-at-redhat-dot-com>
10 Atsushi SAKAI <sakaia-at-jp-dot-fujitsu-dot-com>
11 Richard W.M. Jones <rjones-at-redhat-dot-com>
12 Guido G\374nther <agx-at-sigxcpu-dot-org>
13 Hiroyuki Kaguchi <fj7025cf-at-aa-dot-jp-dot-fujitsu-dot-com>
9 Atsushi SAKAI <sakaia@jp.fujitsu.com>
10 Chris Lalancette <clalance@redhat.com>
11 Guannan Ren <gren@redhat.com>
12 Guido G\374nther <agx@sigxcpu.org>
13 Hans de Goede <hdegoede@redhat.com>
14 Hiroyuki Kaguchi <fj7025cf@aa.jp.fujitsu.com>
15 Jiri Denemark <Jiri.Denemark@gmail.com>
16 Marc-André Lureau <marcandre.lureau@redhat.com>
17 Pavel Raiskup <praiskup@redhat.com>
18 Richard W.M. Jones <rjones@redhat.com>
1419 Ronnie Sahlberg <ronniesahlberg@gmail.com>
15 Marc-André Lureau <marcandre.lureau-at-redhat-dot-com>
20 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
1621
1722 ...send patches to get your name here...
1823
19 The Translation team are listed in the .po files for their
20 languages under the po/ directory.
24 Translations have been provided by
2125
26 <amitakhya@fedoraproject.org>
27 <andreyjktl@fedoraproject.org>
28 <anipeter@fedoraproject.org>
29 <ankit@fedoraproject.org>
30 <aron@fedoraproject.org>
31 <bozzo@fedoraproject.org>
32 <elsupergomez@fedoraproject.org>
33 <enshahar@fedoraproject.org>
34 <fdaluisio@fedoraproject.org>
35 <gcintra@fedoraproject.org>
36 <giallu@fedoraproject.org>
37 <hedda@fedoraproject.org>
38 <htaira@fedoraproject.org>
39 <ifelix@fedoraproject.org>
40 <jassy@fedoraproject.org>
41 <khasida@fedoraproject.org>
42 <kkrothap@fedoraproject.org>
43 <leahliu@fedoraproject.org>
44 <mgiri@fedoraproject.org>
45 <mospina@fedoraproject.org>
46 <mvdz@fedoraproject.org>
47 <rajesh@fedoraproject.org>
48 <raven@fedoraproject.org>
49 <renault@fedoraproject.org>
50 <runab@fedoraproject.org>
51 <samfreemanz@fedoraproject.org>
52 <sandeeps@fedoraproject.org>
53 <shanky@fedoraproject.org>
54 <snicore@fedoraproject.org>
55 <swkothar@fedoraproject.org>
56 <tchuang@fedoraproject.org>
57 <tombo@fedoraproject.org>
58 <tomspur@fedoraproject.org>
59 <warrink@fedoraproject.org>
60 <webappz@fedoraproject.org>
61 <ypoyarko@fedoraproject.org>
62 <yurchor@fedoraproject.org>
63 <zoltanh721@fedoraproject.org>
2264
2365 -- End
0 2012-02-14 Daniel P. Berrange <berrange@redhat.com>
1
2 Update for release 0.5.0
3
4 2012-02-14 Marc-André Lureau <marcandre.lureau@gmail.com>
5
6 First %d in controller title should be substituted with window nth
7
8 Add libp11-kit-0.dll to nsis script
9
10 2012-02-14 Daniel P. Berrange <berrange@redhat.com>
11
12 Set pretty icon for remote-viewer windows too
13
14 Don't hardcode 'localhost' in no @listen parameter is given
15 If no @listen parameter is given, we must not hardcode 'localhost'
16 since we can't assume we are running on the same host. Instead use
17 the hostname from the connection URI
18
19 Extract tlsPort for SPICE and use it to enable secure connections
20
21 2012-02-08 Daniel P. Berrange <berrange@redhat.com>
22
23 Don't do whitespace checks on icons
24
25 Set transient parent for screenshot dialog
26
27 Ensure auth popup windows have correct transient parent
28
29 2012-02-08 Marc-André Lureau <marcandre.lureau@gmail.com>
30
31 Make the password field activates default widget
32 When pressing "Enter", the default auth dialog action isn't activated.
33 Setting activates_default to TRUE fixes this issue.
34
35 Do not resize guest desktop if !auto-resize
36 If auto-resize is enabled, the guest desktop size will be resized to
37 match current window*zoom size.
38
39 This can be a problem if the user explicitely set the desktop size to
40 a different resolution and want to keep it. Disabling auto-resize
41 sounds like a simple way to allow that.
42
43 Resize Spice guest display to the container size
44 The SpiceDisplay doesn't receive the full allocation, because
45 VirtViewerDisplay maintains current aspect ratio. However, the guest
46 display can be resize up to its container size.
47
48 This fixes going full-screen and not getting native resolution for
49 instance.
50
51 2012-02-08 Daniel P. Berrange <berrange@redhat.com>
52
53 Ensure About dialog has transient hints setup
54
55 Import a pretty icon for virt-viewer application
56
57 Re-added GtkBuilder XML files to POTFILES.in
58 Adapt syntax-check rule to allow XML files in POTFILES.in and
59 re-add the GtkBuilder XML files
60
61 Implement SPICE desktop resizing that takes account of zoom level
62 The standard SPICE widget guest resize implementation does not
63 take into account the zoom level settings in virt-viewer, because
64 it has no knowledge of this functionality. The guest resize can,
65 however, be done by calling spice_main_set_display() directly.
66 This allows virt-viewer to resize the guest taking into account
67 zoom levels.
68
69 ie, if virt-viewer is run with --zoom 50 and the window
70 is resized to 400x300, then the guest agent should
71 be told to set its resolution to 800x600
72
73 2012-02-07 Daniel P. Berrange <berrange@redhat.com>
74
75 Revert support for resizing guest desktop
76 The SpiceDisplay widget has built-in support for resizing the
77 guest desktop, but this does not know that virt-viewer has a
78 zoom level setting. This makes the virt-viewer zoom completely
79 inoperable. Revert use of the 'resize-guest' property.
80
81 2012-02-06 Marc-André Lureau <marcandre.lureau@gmail.com>
82
83 Add spice-xpi-client-remote-viewer alternative
84
85 man: add remote-viewer man page
86
87 2012-02-06 Daniel P. Berrange <berrange@redhat.com>
88
89 Import GNULIB rules for syntax checking code
90
91 Add config.h to every source file
92
93 Use exit() constants
94
95 copyright fix
96
97 End of file whitespace cleanup
98
99 Update POTFILES.in
100
101 Replace @FOO@ with $(FOO) in all Makefile.am
102
103 Update copyright headers
104
105 Remove useless if() before free()
106
107 Update AUTHORS file
108
109 Simplify no-op debug macro & fix plugin header
110
111 Fix makefile.am subsitutions for plugin
112
113 Convert TABS to spaces & reindent everywhere
114
115 2012-02-06 Hans de Goede <hdegoede@redhat.com>
116
117 Only make the USB device selection sensitive when the vm is USB capable
118
119 Add a menu entry for USB device selection
120
121 2012-02-06 Marc-André Lureau <marcandre.lureau@gmail.com>
122
123 Grab the focus when showing the display
124 Override the grab_focus() method in the display class. Since both VNC
125 and Spice displays are the direct child, let's just grab the child.
126 It can be that this behaviour need to be overriden if Spice or VNC
127 display become more complex (using sub-childs or different objects)
128
129 2012-01-31 Daniel P. Berrange <berrange@redhat.com>
130
131 Ignore more generated files
132
133 2012-01-31 Guannan Ren <gren@redhat.com>
134
135 Disconnect virt-viewer when receiving signal session-cancelled
136
137 Register a new signal session-cancelled
138
139 Tune the first argument in calls to g_type_class_add_private()
140
141 2012-01-31 Daniel P. Berrange <berrange@redhat.com>
142
143 Support for virDomainOpenGraphics API
144 Add a new flag --attach, which instructs virt-viewer to attach
145 to the target display using virDomainOpenGraphics, instead of
146 initiating a VNC/SPICE connection directly.
147
148 Make VNC support opening connections based on URI
149
150 Adapt remote-viewer so that it builds without SPICE
151
152 2012-01-31 Marc-André Lureau <marcandre.lureau@redhat.com>
153
154 Add virt-viewer.nsis
155 Use ${DESTDIR} variable and @prefix@ to look for files.
156 Can't easily be generated, it has too much customization.
157
158 2012-01-31 Marc-André Lureau <marcandre.lureau@gmail.com>
159
160 Enable spice auto-usbredir
161
162 Remove usage of deprecated property
163
164 Add error dialog for USB redirection failure
165
166 Resize guest desktop with SPICE
167 This is the method we prefer, even though we can't keep aspect ratio.
168 We could eventually support aspect ration in spice-gtk.
169
170 2012-01-31 Marc-André Lureau <marcandre.lureau@redhat.com>
171
172 build: make libvirt optionnal
173
174 2012-01-31 Marc-André Lureau <marcandre.lureau@gmail.com>
175
176 Use a first letter capital in help
177 The GLib/GNOME convention seems to have first letter as capital for
178 option description strings.
179
180 2012-01-31 Marc-André Lureau <marcandre.lureau@redhat.com>
181
182 Add spice_get_option_group()
183
184 Add spice controller support in remote-viewer
185 Usage is simply "remote-viewer --spice-controller"
186
187 Add remote-viewer program
188 This program is meant for direct URI connections.
189 ex: remote-viewer vnc://uri
190
191 2012-01-30 Marc-André Lureau <marcandre.lureau@gmail.com>
192
193 Add a few property getters, used by controller
194 - virt_viewer_app_get_windows()
195 - virt_viewer_window_get_builder()
196 - "VirtViewerSessionSpice:spice-session" property
197
198 build: use AM_GLIB_GNU_GETTEXT
199 Using intltool macro only causes build issues on exotic platforms,
200 such as MinGW.
201
202 As long as this bug isn't fixed, we should use AM_GLIB_GNU_GETTEXT
203 https://bugs.launchpad.net/intltool/+bug/398571
204
205 NB this partially reverts
206
207 3473c4bb49adc0caca58dc1a8b6ce81c6870558a
208
209 The difference is the ordering of the rules. With AM_GLIB_GNU_GETTEXT
210 appearing after IT_PROG_INTLTOOL, the --disable-nls arg to configure
211 is broken. Thus AM_GLIB_GNU_GETTEXT is called first in this change.
212
213 2012-01-30 Marc-André Lureau <marcandre.lureau@redhat.com>
214
215 Make virt_viewer_activate() a vfunc
216 since other equivalent methods are already overridable.
217
218 Add window-added & window-removed signals
219
220 Use graphical URI for connection
221 If specified, use URI for connection details
222
223 Add virt_viewer_session_open_uri
224
225 build: replace deprecated functions
226
227 2012-01-30 Daniel P. Berrange <berrange@redhat.com>
228
229 Add support for --system arg to autogen.sh
230
0231 2011-11-09 Daniel P. Berrange <berrange@redhat.com>
1232
2233 Prep for 0.4.2 release
0 # Having a separate GNUmakefile lets me `include' the dynamically
1 # generated rules created via cfg.mk (package-local configuration)
2 # as well as maint.mk (generic maintainer rules).
3 # This makefile is used only if you run GNU Make.
4 # It is necessary if you want to build targets usually of interest
5 # only to the maintainer.
6
7 # Copyright (C) 2001, 2003, 2006-2011 Free Software Foundation, Inc.
8
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # Systems where /bin/sh is not the default shell need this. The $(shell)
23 # command below won't work with e.g. stock DOS/Windows shells.
24 ifeq ($(wildcard /bin/s[h]),/bin/sh)
25 SHELL = /bin/sh
26 else
27 # will be used only with the next shell-test line, then overwritten
28 # by a configured-in value
29 SHELL = sh
30 endif
31
32 # If the user runs GNU make but has not yet run ./configure,
33 # give them a diagnostic.
34 _have-Makefile := $(shell test -f Makefile && echo yes)
35 ifeq ($(_have-Makefile),yes)
36
37 # Make tar archive easier to reproduce.
38 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
39
40 # Allow the user to add to this in the Makefile.
41 ALL_RECURSIVE_TARGETS =
42
43 include Makefile
44
45 # Some projects override e.g., _autoreconf here.
46 -include $(srcdir)/cfg.mk
47
48 # Allow cfg.mk to override these.
49 _build-aux ?= build-aux
50 _autoreconf ?= autoreconf -v
51
52 include $(srcdir)/maint.mk
53
54 # Ensure that $(VERSION) is up to date for dist-related targets, but not
55 # for others: rerunning autoreconf and recompiling everything isn't cheap.
56 _have-git-version-gen := \
57 $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
58 ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
59 _is-dist-target ?= $(filter-out %clean, \
60 $(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
61 _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS)))
62 ifneq (,$(_is-dist-target)$(_is-install-target))
63 _curr-ver := $(shell cd $(srcdir) \
64 && $(_build-aux)/git-version-gen \
65 .tarball-version \
66 $(git-version-gen-tag-sed-script))
67 ifneq ($(_curr-ver),$(VERSION))
68 ifeq ($(_curr-ver),UNKNOWN)
69 $(info WARNING: unable to verify if $(VERSION) is the correct version)
70 else
71 ifneq (,$(_is-install-target))
72 # GNU Coding Standards state that 'make install' should not cause
73 # recompilation after 'make all'. But as long as changing the version
74 # string alters config.h, the cost of having 'make all' always have an
75 # up-to-date version is prohibitive. So, as a compromise, we merely
76 # warn when installing a version string that is out of date; the user
77 # should run 'autoreconf' (or something like 'make distcheck') to
78 # fix the version, 'make all' to propagate it, then 'make install'.
79 $(info WARNING: version string $(VERSION) is out of date;)
80 $(info run '$(MAKE) _version' to fix it)
81 else
82 $(info INFO: running autoreconf for new version string: $(_curr-ver))
83 GNUmakefile: _version
84 touch GNUmakefile
85 endif
86 endif
87 endif
88 endif
89 endif
90
91 .PHONY: _version
92 _version:
93 cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
94 $(MAKE) $(AM_MAKEFLAGS) Makefile
95
96 else
97
98 .DEFAULT_GOAL := abort-due-to-no-makefile
99 srcdir = .
100
101 # The package can override .DEFAULT_GOAL to run actions like autoreconf.
102 -include ./cfg.mk
103 include ./maint.mk
104
105 ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
106 $(MAKECMDGOALS): abort-due-to-no-makefile
107 endif
108
109 abort-due-to-no-makefile:
110 @echo There seems to be no Makefile in this directory. 1>&2
111 @echo "You must run ./configure before running \`make'." 1>&2
112 @exit 1
113
114 endif
115
116 # Tell version 3.79 and up of GNU make to not build goals in this
117 # directory in parallel, in case someone tries to build multiple
118 # targets, and one of them can cause a recursive target to be invoked.
119
120 # Only set this if Automake doesn't provide it.
121 AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \
122 $(RECURSIVE_CLEAN_TARGETS:-recursive=) \
123 dist distcheck tags ctags
124
125 ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS)
126
127 ifneq ($(word 2, $(MAKECMDGOALS)), )
128 ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), )
129 .NOTPARALLEL:
130 endif
131 endif
0 NULL =
01
12 ACLOCAL_AMFLAGS = -I m4
23
3 SUBDIRS = src man plugin po
4 SUBDIRS = src man plugin po data icons
45
5 EXTRA_DIST = @PACKAGE@.spec \
6 intltool-extract.in \
7 intltool-merge.in \
8 intltool-update.in
6 EXTRA_DIST = \
7 $(PACKAGE).spec \
8 intltool-extract.in \
9 intltool-merge.in \
10 intltool-update.in \
11 GNUmakefile \
12 maint.mk \
13 cfg.mk \
14 build-aux/gitlog-to-changelog \
15 build-aux/useless-if-before-free \
16 build-aux/vc-list-files \
17 $(NULL)
918
10 DISTCLEAN_FILES = @PACKAGE@.spec \
11 intltool-extract \
12 intltool-merge \
13 intltool-update
19 DISTCLEAN_FILES = \
20 $(PACKAGE).spec \
21 intltool-extract \
22 intltool-merge \
23 intltool-update \
24 $(NULL)
1425
15 MAINTAINERCLEANFILES = \
16 m4/libtool.m4 \
17 m4/lt~obsolete.m4 \
18 m4/ltoptions.m4 \
19 m4/ltsugar.m4 \
20 m4/ltversion.m4
26 MAINTAINERCLEANFILES = \
27 m4/libtool.m4 \
28 m4/ltoptions.m4 \
29 m4/ltsugar.m4 \
30 m4/ltversion.m4 \
31 m4/lt~obsolete.m4 \
32 $(NULL)
2133
2234 dist-hook: gen-ChangeLog
2335
5050 configure.lineno config.status.lineno
5151 mkinstalldirs = $(install_sh) -d
5252 CONFIG_HEADER = config.h
53 CONFIG_CLEAN_FILES = virt-viewer.spec mingw32-virt-viewer.spec
53 CONFIG_CLEAN_FILES = mingw32-virt-viewer.spec virt-viewer.spec
5454 CONFIG_CLEAN_VPATH_FILES =
5555 AM_V_GEN = $(am__v_GEN_$(V))
5656 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
120120 AUTOHEADER = @AUTOHEADER@
121121 AUTOMAKE = @AUTOMAKE@
122122 AWK = @AWK@
123 CATALOGS = @CATALOGS@
124 CATOBJEXT = @CATOBJEXT@
123125 CC = @CC@
124126 CCDEPMODE = @CCDEPMODE@
125127 CFLAGS = @CFLAGS@
143145 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
144146 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
145147 GMODULE2_LIBS = @GMODULE2_LIBS@
148 GMOFILES = @GMOFILES@
146149 GMSGFMT = @GMSGFMT@
147150 GREP = @GREP@
148151 GTK_API_VERSION = @GTK_API_VERSION@
157160 INSTALL_PROGRAM = @INSTALL_PROGRAM@
158161 INSTALL_SCRIPT = @INSTALL_SCRIPT@
159162 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
163 INSTOBJEXT = @INSTOBJEXT@
164 INTLLIBS = @INTLLIBS@
160165 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
161166 INTLTOOL_MERGE = @INTLTOOL_MERGE@
162167 INTLTOOL_PERL = @INTLTOOL_PERL@
176181 MAKEINFO = @MAKEINFO@
177182 MANIFEST_TOOL = @MANIFEST_TOOL@
178183 MKDIR_P = @MKDIR_P@
184 MKINSTALLDIRS = @MKINSTALLDIRS@
179185 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
180186 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
181187 MSGFMT = @MSGFMT@
188 MSGFMT_OPTS = @MSGFMT_OPTS@
182189 MSGMERGE = @MSGMERGE@
183190 NM = @NM@
184191 NMEDIT = @NMEDIT@
199206 PKG_CONFIG = @PKG_CONFIG@
200207 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
201208 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
209 POFILES = @POFILES@
210 POSUB = @POSUB@
211 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
212 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
202213 RANLIB = @RANLIB@
203214 SED = @SED@
204215 SET_MAKE = @SET_MAKE@
262273 top_build_prefix = @top_build_prefix@
263274 top_builddir = @top_builddir@
264275 top_srcdir = @top_srcdir@
276 NULL =
265277 ACLOCAL_AMFLAGS = -I m4
266 SUBDIRS = src man plugin po
267 EXTRA_DIST = @PACKAGE@.spec \
268 intltool-extract.in \
269 intltool-merge.in \
270 intltool-update.in
271
272 DISTCLEAN_FILES = @PACKAGE@.spec \
273 intltool-extract \
274 intltool-merge \
275 intltool-update
278 SUBDIRS = src man plugin po data icons
279 EXTRA_DIST = \
280 $(PACKAGE).spec \
281 intltool-extract.in \
282 intltool-merge.in \
283 intltool-update.in \
284 GNUmakefile \
285 maint.mk \
286 cfg.mk \
287 build-aux/gitlog-to-changelog \
288 build-aux/useless-if-before-free \
289 build-aux/vc-list-files \
290 $(NULL)
291
292 DISTCLEAN_FILES = \
293 $(PACKAGE).spec \
294 intltool-extract \
295 intltool-merge \
296 intltool-update \
297 $(NULL)
276298
277299 MAINTAINERCLEANFILES = \
278 m4/libtool.m4 \
279 m4/lt~obsolete.m4 \
280 m4/ltoptions.m4 \
281 m4/ltsugar.m4 \
282 m4/ltversion.m4
300 m4/libtool.m4 \
301 m4/ltoptions.m4 \
302 m4/ltsugar.m4 \
303 m4/ltversion.m4 \
304 m4/lt~obsolete.m4 \
305 $(NULL)
283306
284307 all: config.h
285308 $(MAKE) $(AM_MAKEFLAGS) all-recursive
336359
337360 distclean-hdr:
338361 -rm -f config.h stamp-h1
362 mingw32-virt-viewer.spec: $(top_builddir)/config.status $(srcdir)/mingw32-virt-viewer.spec.in
363 cd $(top_builddir) && $(SHELL) ./config.status $@
339364 virt-viewer.spec: $(top_builddir)/config.status $(srcdir)/virt-viewer.spec.in
340 cd $(top_builddir) && $(SHELL) ./config.status $@
341 mingw32-virt-viewer.spec: $(top_builddir)/config.status $(srcdir)/mingw32-virt-viewer.spec.in
342365 cd $(top_builddir) && $(SHELL) ./config.status $@
343366
344367 mostlyclean-libtool:
00 Virt Viewer News
11 ================
2
3 0.5.0: Feb 14, 2012
4 -------------------
5
6 - Add a remote-viewer binary for connecting to a SPICE/VNC
7 server based on URI, instead of querying libvirt
8 - Add ability to attach to a local VM via libvirt instead of
9 connecting over UNIX sockets
10 - Add support for SPICE controller
11 - Allow build without libvirt, for remote-viewer only
12 - Automatically resize guest desktop when resizing window with SPICE
13 - Add support for redirecting host USB devices to remote guest
14 - Grab focus when first showing the display
15 - Register as a spice-xpi-client-remote alternative
16 - Add pretty icon for virt-viewer app
17 - Set transient window hints on all popups
18 - Activate password 'Ok' button when pressing Enter
19 - Support secure connections with SPICE
20 - Don't hardcode 'localhost' for hostname
221
322 0.4.2: Nov 9, 2011
423 -------------------
1818
1919 http://gtk-vnc.sourceforge.net/
2020
21 Virt Viewer uses the SPICE-GTK (>= 0.6) widget to provide a
21 Virt Viewer uses the SPICE-GTK (>= 0.9) widget to provide a
2222 display of the SPICE protocol, which is available from:
2323
2424 http://spice-space.org/page/Spice-Gtk
1717 You have another version of autoconf. It may work, but is not guaranteed to.
1818 If you have problems, you may need to regenerate the build system entirely.
1919 To do so, use the procedure documented by the package, typically `autoreconf'.])])
20
21 # Copyright (C) 1995-2002 Free Software Foundation, Inc.
22 # Copyright (C) 2001-2003,2004 Red Hat, Inc.
23 #
24 # This file is free software, distributed under the terms of the GNU
25 # General Public License. As a special exception to the GNU General
26 # Public License, this file may be distributed as part of a program
27 # that contains a configuration script generated by Autoconf, under
28 # the same distribution terms as the rest of that program.
29 #
30 # This file can be copied and used freely without restrictions. It can
31 # be used in projects which are not available under the GNU Public License
32 # but which still want to provide support for the GNU gettext functionality.
33 #
34 # Macro to add for using GNU gettext.
35 # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
36 #
37 # Modified to never use included libintl.
38 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
39 #
40 # Major rework to remove unused code
41 # Owen Taylor <otaylor@redhat.com>, 12/11/2002
42 #
43 # Added better handling of ALL_LINGUAS from GNU gettext version
44 # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
45 #
46 # Modified to require ngettext
47 # Matthias Clasen <mclasen@redhat.com> 08/06/2004
48 #
49 # We need this here as well, since someone might use autoconf-2.5x
50 # to configure GLib then an older version to configure a package
51 # using AM_GLIB_GNU_GETTEXT
52 AC_PREREQ(2.53)
53
54 dnl
55 dnl We go to great lengths to make sure that aclocal won't
56 dnl try to pull in the installed version of these macros
57 dnl when running aclocal in the glib directory.
58 dnl
59 m4_copy([AC_DEFUN],[glib_DEFUN])
60 m4_copy([AC_REQUIRE],[glib_REQUIRE])
61 dnl
62 dnl At the end, if we're not within glib, we'll define the public
63 dnl definitions in terms of our private definitions.
64 dnl
65
66 # GLIB_LC_MESSAGES
67 #--------------------
68 glib_DEFUN([GLIB_LC_MESSAGES],
69 [AC_CHECK_HEADERS([locale.h])
70 if test $ac_cv_header_locale_h = yes; then
71 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
72 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
73 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
74 if test $am_cv_val_LC_MESSAGES = yes; then
75 AC_DEFINE(HAVE_LC_MESSAGES, 1,
76 [Define if your <locale.h> file defines LC_MESSAGES.])
77 fi
78 fi])
79
80 # GLIB_PATH_PROG_WITH_TEST
81 #----------------------------
82 dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
83 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
84 glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
85 [# Extract the first word of "$2", so it can be a program name with args.
86 set dummy $2; ac_word=[$]2
87 AC_MSG_CHECKING([for $ac_word])
88 AC_CACHE_VAL(ac_cv_path_$1,
89 [case "[$]$1" in
90 /*)
91 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
92 ;;
93 *)
94 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
95 for ac_dir in ifelse([$5], , $PATH, [$5]); do
96 test -z "$ac_dir" && ac_dir=.
97 if test -f $ac_dir/$ac_word; then
98 if [$3]; then
99 ac_cv_path_$1="$ac_dir/$ac_word"
100 break
101 fi
102 fi
103 done
104 IFS="$ac_save_ifs"
105 dnl If no 4th arg is given, leave the cache variable unset,
106 dnl so AC_PATH_PROGS will keep looking.
107 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
108 ])dnl
109 ;;
110 esac])dnl
111 $1="$ac_cv_path_$1"
112 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
113 AC_MSG_RESULT([$]$1)
114 else
115 AC_MSG_RESULT(no)
116 fi
117 AC_SUBST($1)dnl
118 ])
119
120 # GLIB_WITH_NLS
121 #-----------------
122 glib_DEFUN([GLIB_WITH_NLS],
123 dnl NLS is obligatory
124 [USE_NLS=yes
125 AC_SUBST(USE_NLS)
126
127 gt_cv_have_gettext=no
128
129 CATOBJEXT=NONE
130 XGETTEXT=:
131 INTLLIBS=
132
133 AC_CHECK_HEADER(libintl.h,
134 [gt_cv_func_dgettext_libintl="no"
135 libintl_extra_libs=""
136
137 #
138 # First check in libc
139 #
140 AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
141 [AC_TRY_LINK([
142 #include <libintl.h>
143 ],
144 [return !ngettext ("","", 1)],
145 gt_cv_func_ngettext_libc=yes,
146 gt_cv_func_ngettext_libc=no)
147 ])
148
149 if test "$gt_cv_func_ngettext_libc" = "yes" ; then
150 AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
151 [AC_TRY_LINK([
152 #include <libintl.h>
153 ],
154 [return !dgettext ("","")],
155 gt_cv_func_dgettext_libc=yes,
156 gt_cv_func_dgettext_libc=no)
157 ])
158 fi
159
160 if test "$gt_cv_func_ngettext_libc" = "yes" ; then
161 AC_CHECK_FUNCS(bind_textdomain_codeset)
162 fi
163
164 #
165 # If we don't have everything we want, check in libintl
166 #
167 if test "$gt_cv_func_dgettext_libc" != "yes" \
168 || test "$gt_cv_func_ngettext_libc" != "yes" \
169 || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
170
171 AC_CHECK_LIB(intl, bindtextdomain,
172 [AC_CHECK_LIB(intl, ngettext,
173 [AC_CHECK_LIB(intl, dgettext,
174 gt_cv_func_dgettext_libintl=yes)])])
175
176 if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
177 AC_MSG_CHECKING([if -liconv is needed to use gettext])
178 AC_MSG_RESULT([])
179 AC_CHECK_LIB(intl, ngettext,
180 [AC_CHECK_LIB(intl, dcgettext,
181 [gt_cv_func_dgettext_libintl=yes
182 libintl_extra_libs=-liconv],
183 :,-liconv)],
184 :,-liconv)
185 fi
186
187 #
188 # If we found libintl, then check in it for bind_textdomain_codeset();
189 # we'll prefer libc if neither have bind_textdomain_codeset(),
190 # and both have dgettext and ngettext
191 #
192 if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
193 glib_save_LIBS="$LIBS"
194 LIBS="$LIBS -lintl $libintl_extra_libs"
195 unset ac_cv_func_bind_textdomain_codeset
196 AC_CHECK_FUNCS(bind_textdomain_codeset)
197 LIBS="$glib_save_LIBS"
198
199 if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
200 gt_cv_func_dgettext_libc=no
201 else
202 if test "$gt_cv_func_dgettext_libc" = "yes" \
203 && test "$gt_cv_func_ngettext_libc" = "yes"; then
204 gt_cv_func_dgettext_libintl=no
205 fi
206 fi
207 fi
208 fi
209
210 if test "$gt_cv_func_dgettext_libc" = "yes" \
211 || test "$gt_cv_func_dgettext_libintl" = "yes"; then
212 gt_cv_have_gettext=yes
213 fi
214
215 if test "$gt_cv_func_dgettext_libintl" = "yes"; then
216 INTLLIBS="-lintl $libintl_extra_libs"
217 fi
218
219 if test "$gt_cv_have_gettext" = "yes"; then
220 AC_DEFINE(HAVE_GETTEXT,1,
221 [Define if the GNU gettext() function is already present or preinstalled.])
222 GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
223 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
224 if test "$MSGFMT" != "no"; then
225 glib_save_LIBS="$LIBS"
226 LIBS="$LIBS $INTLLIBS"
227 AC_CHECK_FUNCS(dcgettext)
228 MSGFMT_OPTS=
229 AC_MSG_CHECKING([if msgfmt accepts -c])
230 GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
231 msgid ""
232 msgstr ""
233 "Content-Type: text/plain; charset=UTF-8\n"
234 "Project-Id-Version: test 1.0\n"
235 "PO-Revision-Date: 2007-02-15 12:01+0100\n"
236 "Last-Translator: test <foo@bar.xx>\n"
237 "Language-Team: C <LL@li.org>\n"
238 "MIME-Version: 1.0\n"
239 "Content-Transfer-Encoding: 8bit\n"
240 ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
241 AC_SUBST(MSGFMT_OPTS)
242 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
243 GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
244 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
245 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
246 return _nl_msg_cat_cntr],
247 [CATOBJEXT=.gmo
248 DATADIRNAME=share],
249 [case $host in
250 *-*-solaris*)
251 dnl On Solaris, if bind_textdomain_codeset is in libc,
252 dnl GNU format message catalog is always supported,
253 dnl since both are added to the libc all together.
254 dnl Hence, we'd like to go with DATADIRNAME=share and
255 dnl and CATOBJEXT=.gmo in this case.
256 AC_CHECK_FUNC(bind_textdomain_codeset,
257 [CATOBJEXT=.gmo
258 DATADIRNAME=share],
259 [CATOBJEXT=.mo
260 DATADIRNAME=lib])
261 ;;
262 *-*-openbsd*)
263 CATOBJEXT=.mo
264 DATADIRNAME=share
265 ;;
266 *)
267 CATOBJEXT=.mo
268 DATADIRNAME=lib
269 ;;
270 esac])
271 LIBS="$glib_save_LIBS"
272 INSTOBJEXT=.mo
273 else
274 gt_cv_have_gettext=no
275 fi
276 fi
277 ])
278
279 if test "$gt_cv_have_gettext" = "yes" ; then
280 AC_DEFINE(ENABLE_NLS, 1,
281 [always defined to indicate that i18n is enabled])
282 fi
283
284 dnl Test whether we really found GNU xgettext.
285 if test "$XGETTEXT" != ":"; then
286 dnl If it is not GNU xgettext we define it as : so that the
287 dnl Makefiles still can work.
288 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
289 : ;
290 else
291 AC_MSG_RESULT(
292 [found xgettext program is not GNU xgettext; ignore it])
293 XGETTEXT=":"
294 fi
295 fi
296
297 # We need to process the po/ directory.
298 POSUB=po
299
300 AC_OUTPUT_COMMANDS(
301 [case "$CONFIG_FILES" in *po/Makefile.in*)
302 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
303 esac])
304
305 dnl These rules are solely for the distribution goal. While doing this
306 dnl we only have to keep exactly one list of the available catalogs
307 dnl in configure.ac.
308 for lang in $ALL_LINGUAS; do
309 GMOFILES="$GMOFILES $lang.gmo"
310 POFILES="$POFILES $lang.po"
311 done
312
313 dnl Make all variables we use known to autoconf.
314 AC_SUBST(CATALOGS)
315 AC_SUBST(CATOBJEXT)
316 AC_SUBST(DATADIRNAME)
317 AC_SUBST(GMOFILES)
318 AC_SUBST(INSTOBJEXT)
319 AC_SUBST(INTLLIBS)
320 AC_SUBST(PO_IN_DATADIR_TRUE)
321 AC_SUBST(PO_IN_DATADIR_FALSE)
322 AC_SUBST(POFILES)
323 AC_SUBST(POSUB)
324 ])
325
326 # AM_GLIB_GNU_GETTEXT
327 # -------------------
328 # Do checks necessary for use of gettext. If a suitable implementation
329 # of gettext is found in either in libintl or in the C library,
330 # it will set INTLLIBS to the libraries needed for use of gettext
331 # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
332 # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
333 # on various variables needed by the Makefile.in.in installed by
334 # glib-gettextize.
335 dnl
336 glib_DEFUN([GLIB_GNU_GETTEXT],
337 [AC_REQUIRE([AC_PROG_CC])dnl
338 AC_REQUIRE([AC_HEADER_STDC])dnl
339
340 GLIB_LC_MESSAGES
341 GLIB_WITH_NLS
342
343 if test "$gt_cv_have_gettext" = "yes"; then
344 if test "x$ALL_LINGUAS" = "x"; then
345 LINGUAS=
346 else
347 AC_MSG_CHECKING(for catalogs to be installed)
348 NEW_LINGUAS=
349 for presentlang in $ALL_LINGUAS; do
350 useit=no
351 if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
352 desiredlanguages="$LINGUAS"
353 else
354 desiredlanguages="$ALL_LINGUAS"
355 fi
356 for desiredlang in $desiredlanguages; do
357 # Use the presentlang catalog if desiredlang is
358 # a. equal to presentlang, or
359 # b. a variant of presentlang (because in this case,
360 # presentlang can be used as a fallback for messages
361 # which are not translated in the desiredlang catalog).
362 case "$desiredlang" in
363 "$presentlang"*) useit=yes;;
364 esac
365 done
366 if test $useit = yes; then
367 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
368 fi
369 done
370 LINGUAS=$NEW_LINGUAS
371 AC_MSG_RESULT($LINGUAS)
372 fi
373
374 dnl Construct list of names of catalog files to be constructed.
375 if test -n "$LINGUAS"; then
376 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
377 fi
378 fi
379
380 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
381 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
382 dnl Try to locate is.
383 MKINSTALLDIRS=
384 if test -n "$ac_aux_dir"; then
385 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
386 fi
387 if test -z "$MKINSTALLDIRS"; then
388 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
389 fi
390 AC_SUBST(MKINSTALLDIRS)
391
392 dnl Generate list of files to be processed by xgettext which will
393 dnl be included in po/Makefile.
394 test -d po || mkdir po
395 if test "x$srcdir" != "x."; then
396 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
397 posrcprefix="$srcdir/"
398 else
399 posrcprefix="../$srcdir/"
400 fi
401 else
402 posrcprefix="../"
403 fi
404 rm -f po/POTFILES
405 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
406 < $srcdir/po/POTFILES.in > po/POTFILES
407 ])
408
409 # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
410 # -------------------------------
411 # Define VARIABLE to the location where catalog files will
412 # be installed by po/Makefile.
413 glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
414 [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
415 glib_save_prefix="$prefix"
416 glib_save_exec_prefix="$exec_prefix"
417 glib_save_datarootdir="$datarootdir"
418 test "x$prefix" = xNONE && prefix=$ac_default_prefix
419 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
420 datarootdir=`eval echo "${datarootdir}"`
421 if test "x$CATOBJEXT" = "x.mo" ; then
422 localedir=`eval echo "${libdir}/locale"`
423 else
424 localedir=`eval echo "${datadir}/locale"`
425 fi
426 prefix="$glib_save_prefix"
427 exec_prefix="$glib_save_exec_prefix"
428 datarootdir="$glib_save_datarootdir"
429 AC_DEFINE_UNQUOTED($1, "$localedir",
430 [Define the location where the catalogs will be installed])
431 ])
432
433 dnl
434 dnl Now the definitions that aclocal will find
435 dnl
436 ifdef(glib_configure_ac,[],[
437 AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
438 AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
439 ])dnl
440
441 # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
442 #
443 # Create a temporary file with TEST-FILE as its contents and pass the
444 # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
445 # 0 and perform ACTION-IF-FAIL for any other exit status.
446 AC_DEFUN([GLIB_RUN_PROG],
447 [cat >conftest.foo <<_ACEOF
448 $2
449 _ACEOF
450 if AC_RUN_LOG([$1 conftest.foo]); then
451 m4_ifval([$3], [$3], [:])
452 m4_ifvaln([$4], [else $4])dnl
453 echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
454 sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
455 fi])
456
20457
21458
22459 dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
0 eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
1 & eval 'exec perl -wS "$0" $argv:q'
2 if 0;
3 # Convert git log output to ChangeLog format.
4
5 my $VERSION = '2009-10-30 13:46'; # UTC
6 # The definition above must lie within the first 8 lines in order
7 # for the Emacs time-stamp write hook (at end) to update it.
8 # If you change this file with Emacs, please let the write hook
9 # do its job. Otherwise, update this string manually.
10
11 # Copyright (C) 2008-2011 Free Software Foundation, Inc.
12
13 # This program is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation, either version 3 of the License, or
16 # (at your option) any later version.
17
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
22
23 # You should have received a copy of the GNU General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25
26 # Written by Jim Meyering
27
28 use strict;
29 use warnings;
30 use Getopt::Long;
31 use POSIX qw(strftime);
32
33 (my $ME = $0) =~ s|.*/||;
34
35 # use File::Coda; # http://meyering.net/code/Coda/
36 END {
37 defined fileno STDOUT or return;
38 close STDOUT and return;
39 warn "$ME: failed to close standard output: $!\n";
40 $? ||= 1;
41 }
42
43 sub usage ($)
44 {
45 my ($exit_code) = @_;
46 my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
47 if ($exit_code != 0)
48 {
49 print $STREAM "Try `$ME --help' for more information.\n";
50 }
51 else
52 {
53 print $STREAM <<EOF;
54 Usage: $ME [OPTIONS] [ARGS]
55
56 Convert git log output to ChangeLog format. If present, any ARGS
57 are passed to "git log". To avoid ARGS being parsed as options to
58 $ME, they may be preceded by '--'.
59
60 OPTIONS:
61
62 --since=DATE convert only the logs since DATE;
63 the default is to convert all log entries.
64 --format=FMT set format string for commit subject and body;
65 see 'man git-log' for the list of format metacharacters;
66 the default is '%s%n%b%n'
67
68 --help display this help and exit
69 --version output version information and exit
70
71 EXAMPLE:
72
73 $ME --since=2008-01-01 > ChangeLog
74 $ME -- -n 5 foo > last-5-commits-to-branch-foo
75
76 EOF
77 }
78 exit $exit_code;
79 }
80
81 # If the string $S is a well-behaved file name, simply return it.
82 # If it contains white space, quotes, etc., quote it, and return the new string.
83 sub shell_quote($)
84 {
85 my ($s) = @_;
86 if ($s =~ m![^\w+/.,-]!)
87 {
88 # Convert each single quote to '\''
89 $s =~ s/\'/\'\\\'\'/g;
90 # Then single quote the string.
91 $s = "'$s'";
92 }
93 return $s;
94 }
95
96 sub quoted_cmd(@)
97 {
98 return join (' ', map {shell_quote $_} @_);
99 }
100
101 {
102 my $since_date = '1970-01-01 UTC';
103 my $format_string = '%s%n%b%n';
104 GetOptions
105 (
106 help => sub { usage 0 },
107 version => sub { print "$ME version $VERSION\n"; exit },
108 'since=s' => \$since_date,
109 'format=s' => \$format_string,
110 ) or usage 1;
111
112 my @cmd = (qw (git log --log-size), "--since=$since_date",
113 '--pretty=format:%ct %an <%ae>%n%n'.$format_string, @ARGV);
114 open PIPE, '-|', @cmd
115 or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
116 . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
117
118 my $prev_date_line = '';
119 while (1)
120 {
121 defined (my $in = <PIPE>)
122 or last;
123 $in =~ /^log size (\d+)$/
124 or die "$ME:$.: Invalid line (expected log size):\n$in";
125 my $log_nbytes = $1;
126
127 my $log;
128 my $n_read = read PIPE, $log, $log_nbytes;
129 $n_read == $log_nbytes
130 or die "$ME:$.: unexpected EOF\n";
131
132 my @line = split "\n", $log;
133 my $author_line = shift @line;
134 defined $author_line
135 or die "$ME:$.: unexpected EOF\n";
136 $author_line =~ /^(\d+) (.*>)$/
137 or die "$ME:$.: Invalid line "
138 . "(expected date/author/email):\n$author_line\n";
139
140 my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1));
141 # If this line would be the same as the previous date/name/email
142 # line, then arrange not to print it.
143 if ($date_line ne $prev_date_line)
144 {
145 $prev_date_line eq ''
146 or print "\n";
147 print $date_line;
148 }
149 $prev_date_line = $date_line;
150
151 # Omit "Signed-off-by..." lines.
152 @line = grep !/^Signed-off-by: .*>$/, @line;
153
154 # If there were any lines
155 if (@line == 0)
156 {
157 warn "$ME: warning: empty commit message:\n $date_line\n";
158 }
159 else
160 {
161 # Remove leading and trailing blank lines.
162 while ($line[0] =~ /^\s*$/) { shift @line; }
163 while ($line[$#line] =~ /^\s*$/) { pop @line; }
164
165 # Prefix each non-empty line with a TAB.
166 @line = map { length $_ ? "\t$_" : '' } @line;
167
168 print "\n", join ("\n", @line), "\n";
169 }
170
171 defined ($in = <PIPE>)
172 or last;
173 $in ne "\n"
174 and die "$ME:$.: unexpected line:\n$in";
175 }
176
177 close PIPE
178 or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
179 # FIXME-someday: include $PROCESS_STATUS in the diagnostic
180 }
181
182 # Local Variables:
183 # mode: perl
184 # indent-tabs-mode: nil
185 # eval: (add-hook 'write-file-hooks 'time-stamp)
186 # time-stamp-start: "my $VERSION = '"
187 # time-stamp-format: "%:y-%02m-%02d %02H:%02M"
188 # time-stamp-time-zone: "UTC"
189 # time-stamp-end: "'; # UTC"
190 # End:
0 eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
1 & eval 'exec perl -wST "$0" $argv:q'
2 if 0;
3 # Detect instances of "if (p) free (p);".
4 # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
5
6 my $VERSION = '2011-04-20 13:43'; # UTC
7 # The definition above must lie within the first 8 lines in order
8 # for the Emacs time-stamp write hook (at end) to update it.
9 # If you change this file with Emacs, please let the write hook
10 # do its job. Otherwise, update this string manually.
11
12 # Copyright (C) 2008-2011 Free Software Foundation, Inc.
13
14 # This program is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 3 of the License, or
17 # (at your option) any later version.
18
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
23
24 # You should have received a copy of the GNU General Public License
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26
27 # Written by Jim Meyering
28
29 use strict;
30 use warnings;
31 use Getopt::Long;
32
33 (my $ME = $0) =~ s|.*/||;
34
35 # use File::Coda; # http://meyering.net/code/Coda/
36 END {
37 defined fileno STDOUT or return;
38 close STDOUT and return;
39 warn "$ME: failed to close standard output: $!\n";
40 $? ||= 1;
41 }
42
43 sub usage ($)
44 {
45 my ($exit_code) = @_;
46 my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
47 if ($exit_code != 0)
48 {
49 print $STREAM "Try `$ME --help' for more information.\n";
50 }
51 else
52 {
53 print $STREAM <<EOF;
54 Usage: $ME [OPTIONS] FILE...
55
56 Detect any instance in FILE of a useless "if" test before a free call, e.g.,
57 "if (p) free (p);". Any such test may be safely removed without affecting
58 the semantics of the C code in FILE. Use --name=FOO --name=BAR to also
59 detect free-like functions named FOO and BAR.
60
61 OPTIONS:
62
63 --list print only the name of each matching FILE (\\0-terminated)
64 --name=N add name N to the list of \`free\'-like functions to detect;
65 may be repeated
66
67 --help display this help and exit
68 --version output version information and exit
69
70 Exit status:
71
72 0 one or more matches
73 1 no match
74 2 an error
75
76 EXAMPLE:
77
78 For example, this command prints all removable "if" tests before "free"
79 and "kfree" calls in the linux kernel sources:
80
81 git ls-files -z |xargs -0 $ME --name=kfree
82
83 EOF
84 }
85 exit $exit_code;
86 }
87
88 sub is_NULL ($)
89 {
90 my ($expr) = @_;
91 return ($expr eq 'NULL' || $expr eq '0');
92 }
93
94 {
95 sub EXIT_MATCH {0}
96 sub EXIT_NO_MATCH {1}
97 sub EXIT_ERROR {2}
98 my $err = EXIT_NO_MATCH;
99
100 my $list;
101 my @name = qw(free);
102 GetOptions
103 (
104 help => sub { usage 0 },
105 version => sub { print "$ME version $VERSION\n"; exit },
106 list => \$list,
107 'name=s@' => \@name,
108 ) or usage 1;
109
110 # Make sure we have the right number of non-option arguments.
111 # Always tell the user why we fail.
112 @ARGV < 1
113 and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR;
114
115 my $or = join '|', @name;
116 my $regexp = qr/(?:$or)/;
117
118 # Set the input record separator.
119 # Note: this makes it impractical to print line numbers.
120 $/ = '"';
121
122 my $found_match = 0;
123 FILE:
124 foreach my $file (@ARGV)
125 {
126 open FH, '<', $file
127 or (warn "$ME: can't open `$file' for reading: $!\n"),
128 $err = EXIT_ERROR, next;
129 while (defined (my $line = <FH>))
130 {
131 while ($line =~
132 /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\)
133 # 1 2 3
134 (?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;|
135 \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg)
136 {
137 my $all = $1;
138 my ($lhs, $rhs) = ($2, $3);
139 my ($free_opnd, $braced_free_opnd) = ($4, $5);
140 my $non_NULL;
141 if (!defined $rhs) { $non_NULL = $lhs }
142 elsif (is_NULL $rhs) { $non_NULL = $lhs }
143 elsif (is_NULL $lhs) { $non_NULL = $rhs }
144 else { next }
145
146 # Compare the non-NULL part of the "if" expression and the
147 # free'd expression, without regard to white space.
148 $non_NULL =~ tr/ \t//d;
149 my $e2 = defined $free_opnd ? $free_opnd : $braced_free_opnd;
150 $e2 =~ tr/ \t//d;
151 if ($non_NULL eq $e2)
152 {
153 $found_match = 1;
154 $list
155 and (print "$file\0"), next FILE;
156 print "$file: $all\n";
157 }
158 }
159 }
160 }
161 continue
162 {
163 close FH;
164 }
165
166 $found_match && $err == EXIT_NO_MATCH
167 and $err = EXIT_MATCH;
168
169 exit $err;
170 }
171
172 my $foo = <<'EOF';
173 # The above is to *find* them.
174 # This adjusts them, removing the unnecessary "if (p)" part.
175
176 # FIXME: do something like this as an option (doesn't do braces):
177 free=xfree
178 git grep -l -z "$free *(" \
179 | xargs -0 useless-if-before-free -l --name="$free" \
180 | xargs -0 perl -0x3b -pi -e \
181 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s'
182
183 # Use the following to remove redundant uses of kfree inside braces.
184 # Note that -0777 puts perl in slurp-whole-file mode;
185 # but we have plenty of memory, these days...
186 free=kfree
187 git grep -l -z "$free *(" \
188 | xargs -0 useless-if-before-free -l --name="$free" \
189 | xargs -0 perl -0777 -pi -e \
190 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms'
191
192 Be careful that the result of the above transformation is valid.
193 If the matched string is followed by "else", then obviously, it won't be.
194
195 When modifying files, refuse to process anything other than a regular file.
196 EOF
197
198 ## Local Variables:
199 ## mode: perl
200 ## indent-tabs-mode: nil
201 ## eval: (add-hook 'write-file-hooks 'time-stamp)
202 ## time-stamp-start: "my $VERSION = '"
203 ## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
204 ## time-stamp-time-zone: "UTC"
205 ## time-stamp-end: "'; # UTC"
206 ## End:
0 #!/bin/sh
1 # List version-controlled file names.
2
3 # Print a version string.
4 scriptversion=2011-05-16.22; # UTC
5
6 # Copyright (C) 2006-2011 Free Software Foundation, Inc.
7
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21
22 # List the specified version-controlled files.
23 # With no argument, list them all. With a single DIRECTORY argument,
24 # list the version-controlled files in that directory.
25
26 # If there's an argument, it must be a single, "."-relative directory name.
27 # cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
28
29 postprocess=
30 case $1 in
31 --help) cat <<EOF
32 Usage: $0 [-C SRCDIR] [DIR...]
33
34 Output a list of version-controlled files in DIR (default .), relative to
35 SRCDIR (default .). SRCDIR must be the top directory of a checkout.
36
37 Options:
38 --help print this help, then exit
39 --version print version number, then exit
40 -C SRCDIR change directory to SRCDIR before generating list
41
42 Report bugs and patches to <bug-gnulib@gnu.org>.
43 EOF
44 exit ;;
45
46 --version)
47 year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
48 cat <<EOF
49 vc-list-files $scriptversion
50 Copyright (C) $year Free Software Foundation, Inc,
51 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
52 This is free software: you are free to change and redistribute it.
53 There is NO WARRANTY, to the extent permitted by law.
54 EOF
55 exit ;;
56
57 -C)
58 test "$2" = . || postprocess="| sed 's|^|$2/|'"
59 cd "$2" || exit 1
60 shift; shift ;;
61 esac
62
63 test $# = 0 && set .
64
65 for dir
66 do
67 if test -d .git; then
68 test "x$dir" = x. \
69 && dir= sed_esc= \
70 || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; }
71 # Ignore git symlinks - either they point into the tree, in which case
72 # we don't need to visit the target twice, or they point somewhere
73 # else (often into a submodule), in which case the content does not
74 # belong to this package.
75 eval exec git ls-tree -r 'HEAD:"$dir"' \
76 \| sed -n '"s/^100[^ ]*./$sed_esc/p"' $postprocess
77 elif test -d .hg; then
78 eval exec hg locate '"$dir/*"' $postprocess
79 elif test -d .bzr; then
80 test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
81 eval exec bzr ls -R --versioned '"$dir"' $postprocess
82 elif test -d CVS; then
83 test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
84 if test -x build-aux/cvsu; then
85 eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
86 elif (cvsu --help) >/dev/null 2>&1; then
87 eval cvsu --find --types=AFGM '"$dir"' $postprocess
88 else
89 eval awk -F/ \''{ \
90 if (!$1 && $3 !~ /^-/) { \
91 f=FILENAME; \
92 if (f ~ /CVS\/Entries$/) \
93 f = substr(f, 1, length(f)-11); \
94 print f $2; \
95 }}'\'' \
96 `find "$dir" -name Entries -print` /dev/null' $postprocess
97 fi
98 elif test -d .svn; then
99 eval exec svn list -R '"$dir"' $postprocess
100 else
101 echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
102 exit 1
103 fi
104 done
105
106 # Local variables:
107 # eval: (add-hook 'write-file-hooks 'time-stamp)
108 # time-stamp-start: "scriptversion="
109 # time-stamp-format: "%:y-%02m-%02d.%02H"
110 # time-stamp-time-zone: "UTC"
111 # time-stamp-end: "; # UTC"
112 # End:
0 # Customize Makefile.maint. -*- makefile -*-
1 # Copyright (C) 2008-2011 Red Hat, Inc.
2 # Copyright (C) 2003-2008 Free Software Foundation, Inc.
3
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 # Tests not to run as part of "make distcheck".
18 local-checks-to-skip = \
19 changelog-check \
20 check-AUTHORS \
21 makefile-check \
22 makefile_path_separator_check \
23 patch-check \
24 sc_GPL_version \
25 sc_always_defined_macros \
26 sc_cast_of_alloca_return_value \
27 sc_cross_check_PATH_usage_in_tests \
28 sc_dd_max_sym_length \
29 sc_error_exit_success \
30 sc_file_system \
31 sc_immutable_NEWS \
32 sc_makefile_path_separator_check \
33 sc_obsolete_symbols \
34 sc_prohibit_always_true_header_tests \
35 sc_prohibit_S_IS_definition \
36 sc_prohibit_atoi_atof \
37 sc_prohibit_hash_without_use \
38 sc_prohibit_jm_in_m4 \
39 sc_prohibit_quote_without_use \
40 sc_prohibit_quotearg_without_use \
41 sc_prohibit_stat_st_blocks \
42 sc_root_tests \
43 sc_space_tab \
44 sc_sun_os_names \
45 sc_system_h_headers \
46 sc_texinfo_acronym \
47 sc_tight_scope \
48 sc_two_space_separator_in_usage \
49 sc_error_message_uppercase \
50 sc_program_name \
51 sc_require_test_exit_idiom \
52 sc_makefile_check \
53 sc_useless_cpp_parens
54
55 # Files that should never cause syntax check failures.
56 VC_LIST_ALWAYS_EXCLUDE_REGEX = \
57 (^HACKING|\.po|maint.mk)$$
58
59 # Functions like free() that are no-ops on NULL arguments.
60 useless_free_options = \
61 --name=g_free \
62 --name=xmlBufferFree \
63 --name=xmlFree \
64 --name=xmlFreeDoc \
65 --name=xmlXPathFreeContext \
66 --name=xmlFreeParserContext \
67 --name=xmlXPathFreeObject
68
69 # Ensure that no C source file, docs, or rng schema uses TABs for
70 # indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
71 # files in gnulib, since they're imported.
72 space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py)|(daemon|tools)/.*\.in)
73 sc_TAB_in_indentation:
74 @prohibit='^ * ' \
75 in_vc_files='$(space_indent_files)$$' \
76 halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \
77 $(_sc_search_regexp)
78
79 # G_GNUC_UNUSED should only be applied in implementations, not
80 # header declarations
81 sc_avoid_attribute_unused_in_header:
82 @prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \
83 in_vc_files='\.h$$' \
84 halt='use G_GNUC_UNUSED in .c rather than .h files' \
85 $(_sc_search_regexp)
86
87 # Enforce recommended preprocessor indentation style.
88 sc_preprocessor_indentation:
89 @if cppi --version >/dev/null 2>&1; then \
90 $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
91 || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
92 exit 1; }; \
93 else \
94 echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
95 fi
96
97 sc_copyright_format:
98 @require='Copyright .*Red 'Hat', Inc\.' \
99 containing='Copyright .*Red 'Hat \
100 halt='Red Hat copyright is missing Inc.' \
101 $(_sc_search_regexp)
102 @prohibit='Copyright [^(].*Red 'Hat \
103 halt='consistently use (C) in Red Hat copyright' \
104 $(_sc_search_regexp)
105 @prohibit='\<Red''Hat\>' \
106 halt='spell Red Hat as two words' \
107 $(_sc_search_regexp)
108
109 # We don't use this feature of maint.mk.
110 prev_version_file = /dev/null
111
112 # Give credit where due:
113 # Ensure that each commit author email address (possibly mapped via
114 # git log's .mailmap) appears in our AUTHORS file.
115 sc_check_author_list:
116 @fail=0; \
117 for i in $$(git log --pretty=format:%aE%n|sort -u|grep -v '^$$'); do \
118 sanitized=$$(echo "$$i"|LC_ALL=C sed 's/\([^a-zA-Z0-9_@-]\)/\\\1/g'); \
119 grep -iq "<$$sanitized>" $(srcdir)/AUTHORS \
120 || { printf '%s\n' "$$i" >&2; fail=1; }; \
121 done; \
122 test $$fail = 1 \
123 && echo '$(ME): committer(s) not listed in AUTHORS' >&2; \
124 test $$fail = 0
125
126
127 exclude_file_name_regexp--sc_preprocessor_indentation = ^*/*.[ch]
128 exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch]
129 exclude_file_name_regexp--sc_require_config_h = ^plugin/
130 exclude_file_name_regexp--sc_require_config_h_first = ^plugin/
131
132 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^icons/
133 exclude_file_name_regexp--sc_trailing_blank = ^icons/
00 /* config.h.in. Generated from configure.ac by autoheader. */
1
2 /* always defined to indicate that i18n is enabled */
3 #undef ENABLE_NLS
14
25 /* GETTEXT package name */
36 #undef GETTEXT_PACKAGE
7
8 /* Define to 1 if you have the `bind_textdomain_codeset' function. */
9 #undef HAVE_BIND_TEXTDOMAIN_CODESET
10
11 /* Define to 1 if you have the `dcgettext' function. */
12 #undef HAVE_DCGETTEXT
413
514 /* Define to 1 if you have the <dlfcn.h> header file. */
615 #undef HAVE_DLFCN_H
817 /* Define to 1 if you have the `fork' function. */
918 #undef HAVE_FORK
1019
20 /* Define if the GNU gettext() function is already present or preinstalled. */
21 #undef HAVE_GETTEXT
22
1123 /* Have gtk-vnc? */
1224 #undef HAVE_GTK_VNC
1325
1426 /* Define to 1 if you have the <inttypes.h> header file. */
1527 #undef HAVE_INTTYPES_H
28
29 /* Define if your <locale.h> file defines LC_MESSAGES. */
30 #undef HAVE_LC_MESSAGES
31
32 /* Have libvirt? */
33 #undef HAVE_LIBVIRT
34
35 /* Define to 1 if you have the <locale.h> header file. */
36 #undef HAVE_LOCALE_H
1637
1738 /* Define to 1 if you have the <memory.h> header file. */
1839 #undef HAVE_MEMORY_H
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.68 for virt-viewer 0.4.2.
2 # Generated by GNU Autoconf 2.68 for virt-viewer 0.5.0.
33 #
44 #
55 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
566566 # Identity of this package.
567567 PACKAGE_NAME='virt-viewer'
568568 PACKAGE_TARNAME='virt-viewer'
569 PACKAGE_VERSION='0.4.2'
570 PACKAGE_STRING='virt-viewer 0.4.2'
569 PACKAGE_VERSION='0.5.0'
570 PACKAGE_STRING='virt-viewer 0.5.0'
571571 PACKAGE_BUGREPORT=''
572572 PACKAGE_URL=''
573573
638638 GTK_VNC_API_VERSION
639639 GTK_REQUIRED
640640 GTK_API_VERSION
641 HAVE_LIBVIRT_FALSE
642 HAVE_LIBVIRT_TRUE
641643 LIBVIRT_LIBS
642644 LIBVIRT_CFLAGS
643645 LIBXML2_LIBS
647649 PKG_CONFIG_LIBDIR
648650 PKG_CONFIG_PATH
649651 PKG_CONFIG
650 DATADIRNAME
651652 ALL_LINGUAS
652653 INTLTOOL_PERL
653 GMSGFMT
654 MSGFMT
655654 MSGMERGE
656 XGETTEXT
657655 INTLTOOL_POLICY_RULE
658656 INTLTOOL_SERVICE_RULE
659657 INTLTOOL_THEME_RULE
676674 INTLTOOL_EXTRACT
677675 INTLTOOL_MERGE
678676 INTLTOOL_UPDATE
677 MKINSTALLDIRS
678 POSUB
679 POFILES
680 PO_IN_DATADIR_FALSE
681 PO_IN_DATADIR_TRUE
682 INTLLIBS
683 INSTOBJEXT
684 GMOFILES
685 DATADIRNAME
686 CATOBJEXT
687 CATALOGS
688 XGETTEXT
689 GMSGFMT
690 MSGFMT_OPTS
691 MSGFMT
679692 USE_NLS
680693 GETTEXT_PACKAGE
681694 WARN_CFLAGS
803816 enable_compile_warnings
804817 enable_iso_c
805818 enable_nls
819 with_libvirt
806820 with_gtk
807821 with_gtk_vnc
808822 with_spice_gtk
13801394 # Omit some internal or obsolete options to make the list less imposing.
13811395 # This message is too long to be a string in the A/UX 3.1 sh.
13821396 cat <<_ACEOF
1383 \`configure' configures virt-viewer 0.4.2 to adapt to many kinds of systems.
1397 \`configure' configures virt-viewer 0.5.0 to adapt to many kinds of systems.
13841398
13851399 Usage: $0 [OPTION]... [VAR=VALUE]...
13861400
14501464
14511465 if test -n "$ac_init_help"; then
14521466 case $ac_init_help in
1453 short | recursive ) echo "Configuration of virt-viewer 0.4.2:";;
1467 short | recursive ) echo "Configuration of virt-viewer 0.5.0:";;
14541468 esac
14551469 cat <<\_ACEOF
14561470
14811495 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
14821496 --with-sysroot=DIR Search for dependent libraries within DIR
14831497 (or the compiler's sysroot if not specified).
1498 --without-libvirt Ignore presence of libvirt and disable it
14841499 --with-gtk=2.0|3.0 which gtk+ version to compile against (default: 2.0)
14851500 --without-gtk-vnc Ignore presence of gtk-vnc and disable it
14861501 --without-spice-gtk Ignore presence of spice-gtk and disable it
15981613 test -n "$ac_init_help" && exit $ac_status
15991614 if $ac_init_version; then
16001615 cat <<\_ACEOF
1601 virt-viewer configure 0.4.2
1616 virt-viewer configure 0.5.0
16021617 generated by GNU Autoconf 2.68
16031618
16041619 Copyright (C) 2010 Free Software Foundation, Inc.
19631978 This file contains any messages produced by compilers while
19641979 running configure, to aid debugging if configure makes a mistake.
19651980
1966 It was created by virt-viewer $as_me 0.4.2, which was
1981 It was created by virt-viewer $as_me 0.5.0, which was
19671982 generated by GNU Autoconf 2.68. Invocation command line was
19681983
19691984 $ $0 $@
27812796
27822797 # Define the identity of the package.
27832798 PACKAGE='virt-viewer'
2784 VERSION='0.4.2'
2799 VERSION='0.5.0'
27852800
27862801
27872802 cat >>confdefs.h <<_ACEOF
29142929 GTK2_REQUIRED="2.12.0"
29152930 GTK3_REQUIRED="3.0"
29162931 GTK_VNC_REQUIRED="0.4.3"
2917 SPICE_GTK_REQUIRED="0.6"
2932 SPICE_GTK_REQUIRED="0.9"
29182933
29192934 ac_ext=c
29202935 ac_cpp='$CPP $CPPFLAGS'
1148911504 $as_echo "#define _GNU_SOURCE /**/" >>confdefs.h
1149011505
1149111506
11507 # Autoconf 2.61a.99 and earlier don't support linking a file only
11508 # in VPATH builds. But since GNUmakefile is for maintainer use
11509 # only, it does not matter if we skip the link with older autoconf.
11510 # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
11511 # builds, so use a shell variable to bypass this.
11512 GNUmakefile=GNUmakefile
11513 ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
11514
11515
1149211516
1149311517
1149411518 # Check whether --enable-compile-warnings was given.
1160011624
1160111625
1160211626
11627 for ac_header in locale.h
11628 do :
11629 ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
11630 if test "x$ac_cv_header_locale_h" = xyes; then :
11631 cat >>confdefs.h <<_ACEOF
11632 #define HAVE_LOCALE_H 1
11633 _ACEOF
11634
11635 fi
11636
11637 done
11638
11639 if test $ac_cv_header_locale_h = yes; then
11640 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
11641 $as_echo_n "checking for LC_MESSAGES... " >&6; }
11642 if ${am_cv_val_LC_MESSAGES+:} false; then :
11643 $as_echo_n "(cached) " >&6
11644 else
11645 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11646 /* end confdefs.h. */
11647 #include <locale.h>
11648 int
11649 main ()
11650 {
11651 return LC_MESSAGES
11652 ;
11653 return 0;
11654 }
11655 _ACEOF
11656 if ac_fn_c_try_link "$LINENO"; then :
11657 am_cv_val_LC_MESSAGES=yes
11658 else
11659 am_cv_val_LC_MESSAGES=no
11660 fi
11661 rm -f core conftest.err conftest.$ac_objext \
11662 conftest$ac_exeext conftest.$ac_ext
11663 fi
11664 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5
11665 $as_echo "$am_cv_val_LC_MESSAGES" >&6; }
11666 if test $am_cv_val_LC_MESSAGES = yes; then
11667
11668 $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
11669
11670 fi
11671 fi
11672 USE_NLS=yes
11673
11674
11675 gt_cv_have_gettext=no
11676
11677 CATOBJEXT=NONE
11678 XGETTEXT=:
11679 INTLLIBS=
11680
11681 ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
11682 if test "x$ac_cv_header_libintl_h" = xyes; then :
11683 gt_cv_func_dgettext_libintl="no"
11684 libintl_extra_libs=""
11685
11686 #
11687 # First check in libc
11688 #
11689 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5
11690 $as_echo_n "checking for ngettext in libc... " >&6; }
11691 if ${gt_cv_func_ngettext_libc+:} false; then :
11692 $as_echo_n "(cached) " >&6
11693 else
11694 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11695 /* end confdefs.h. */
11696
11697 #include <libintl.h>
11698
11699 int
11700 main ()
11701 {
11702 return !ngettext ("","", 1)
11703 ;
11704 return 0;
11705 }
11706 _ACEOF
11707 if ac_fn_c_try_link "$LINENO"; then :
11708 gt_cv_func_ngettext_libc=yes
11709 else
11710 gt_cv_func_ngettext_libc=no
11711 fi
11712 rm -f core conftest.err conftest.$ac_objext \
11713 conftest$ac_exeext conftest.$ac_ext
11714
11715 fi
11716 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5
11717 $as_echo "$gt_cv_func_ngettext_libc" >&6; }
11718
11719 if test "$gt_cv_func_ngettext_libc" = "yes" ; then
11720 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5
11721 $as_echo_n "checking for dgettext in libc... " >&6; }
11722 if ${gt_cv_func_dgettext_libc+:} false; then :
11723 $as_echo_n "(cached) " >&6
11724 else
11725 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11726 /* end confdefs.h. */
11727
11728 #include <libintl.h>
11729
11730 int
11731 main ()
11732 {
11733 return !dgettext ("","")
11734 ;
11735 return 0;
11736 }
11737 _ACEOF
11738 if ac_fn_c_try_link "$LINENO"; then :
11739 gt_cv_func_dgettext_libc=yes
11740 else
11741 gt_cv_func_dgettext_libc=no
11742 fi
11743 rm -f core conftest.err conftest.$ac_objext \
11744 conftest$ac_exeext conftest.$ac_ext
11745
11746 fi
11747 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5
11748 $as_echo "$gt_cv_func_dgettext_libc" >&6; }
11749 fi
11750
11751 if test "$gt_cv_func_ngettext_libc" = "yes" ; then
11752 for ac_func in bind_textdomain_codeset
11753 do :
11754 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
11755 if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
11756 cat >>confdefs.h <<_ACEOF
11757 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
11758 _ACEOF
11759
11760 fi
11761 done
11762
11763 fi
11764
11765 #
11766 # If we don't have everything we want, check in libintl
11767 #
11768 if test "$gt_cv_func_dgettext_libc" != "yes" \
11769 || test "$gt_cv_func_ngettext_libc" != "yes" \
11770 || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
11771
11772 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5
11773 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; }
11774 if ${ac_cv_lib_intl_bindtextdomain+:} false; then :
11775 $as_echo_n "(cached) " >&6
11776 else
11777 ac_check_lib_save_LIBS=$LIBS
11778 LIBS="-lintl $LIBS"
11779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11780 /* end confdefs.h. */
11781
11782 /* Override any GCC internal prototype to avoid an error.
11783 Use char because int might match the return type of a GCC
11784 builtin and then its argument prototype would still apply. */
11785 #ifdef __cplusplus
11786 extern "C"
11787 #endif
11788 char bindtextdomain ();
11789 int
11790 main ()
11791 {
11792 return bindtextdomain ();
11793 ;
11794 return 0;
11795 }
11796 _ACEOF
11797 if ac_fn_c_try_link "$LINENO"; then :
11798 ac_cv_lib_intl_bindtextdomain=yes
11799 else
11800 ac_cv_lib_intl_bindtextdomain=no
11801 fi
11802 rm -f core conftest.err conftest.$ac_objext \
11803 conftest$ac_exeext conftest.$ac_ext
11804 LIBS=$ac_check_lib_save_LIBS
11805 fi
11806 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5
11807 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; }
11808 if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then :
11809 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5
11810 $as_echo_n "checking for ngettext in -lintl... " >&6; }
11811 if ${ac_cv_lib_intl_ngettext+:} false; then :
11812 $as_echo_n "(cached) " >&6
11813 else
11814 ac_check_lib_save_LIBS=$LIBS
11815 LIBS="-lintl $LIBS"
11816 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11817 /* end confdefs.h. */
11818
11819 /* Override any GCC internal prototype to avoid an error.
11820 Use char because int might match the return type of a GCC
11821 builtin and then its argument prototype would still apply. */
11822 #ifdef __cplusplus
11823 extern "C"
11824 #endif
11825 char ngettext ();
11826 int
11827 main ()
11828 {
11829 return ngettext ();
11830 ;
11831 return 0;
11832 }
11833 _ACEOF
11834 if ac_fn_c_try_link "$LINENO"; then :
11835 ac_cv_lib_intl_ngettext=yes
11836 else
11837 ac_cv_lib_intl_ngettext=no
11838 fi
11839 rm -f core conftest.err conftest.$ac_objext \
11840 conftest$ac_exeext conftest.$ac_ext
11841 LIBS=$ac_check_lib_save_LIBS
11842 fi
11843 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5
11844 $as_echo "$ac_cv_lib_intl_ngettext" >&6; }
11845 if test "x$ac_cv_lib_intl_ngettext" = xyes; then :
11846 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
11847 $as_echo_n "checking for dgettext in -lintl... " >&6; }
11848 if ${ac_cv_lib_intl_dgettext+:} false; then :
11849 $as_echo_n "(cached) " >&6
11850 else
11851 ac_check_lib_save_LIBS=$LIBS
11852 LIBS="-lintl $LIBS"
11853 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11854 /* end confdefs.h. */
11855
11856 /* Override any GCC internal prototype to avoid an error.
11857 Use char because int might match the return type of a GCC
11858 builtin and then its argument prototype would still apply. */
11859 #ifdef __cplusplus
11860 extern "C"
11861 #endif
11862 char dgettext ();
11863 int
11864 main ()
11865 {
11866 return dgettext ();
11867 ;
11868 return 0;
11869 }
11870 _ACEOF
11871 if ac_fn_c_try_link "$LINENO"; then :
11872 ac_cv_lib_intl_dgettext=yes
11873 else
11874 ac_cv_lib_intl_dgettext=no
11875 fi
11876 rm -f core conftest.err conftest.$ac_objext \
11877 conftest$ac_exeext conftest.$ac_ext
11878 LIBS=$ac_check_lib_save_LIBS
11879 fi
11880 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
11881 $as_echo "$ac_cv_lib_intl_dgettext" >&6; }
11882 if test "x$ac_cv_lib_intl_dgettext" = xyes; then :
11883 gt_cv_func_dgettext_libintl=yes
11884 fi
11885
11886 fi
11887
11888 fi
11889
11890
11891 if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
11892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5
11893 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; }
11894 { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
11895 $as_echo "" >&6; }
11896 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5
11897 $as_echo_n "checking for ngettext in -lintl... " >&6; }
11898 if ${ac_cv_lib_intl_ngettext+:} false; then :
11899 $as_echo_n "(cached) " >&6
11900 else
11901 ac_check_lib_save_LIBS=$LIBS
11902 LIBS="-lintl -liconv $LIBS"
11903 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11904 /* end confdefs.h. */
11905
11906 /* Override any GCC internal prototype to avoid an error.
11907 Use char because int might match the return type of a GCC
11908 builtin and then its argument prototype would still apply. */
11909 #ifdef __cplusplus
11910 extern "C"
11911 #endif
11912 char ngettext ();
11913 int
11914 main ()
11915 {
11916 return ngettext ();
11917 ;
11918 return 0;
11919 }
11920 _ACEOF
11921 if ac_fn_c_try_link "$LINENO"; then :
11922 ac_cv_lib_intl_ngettext=yes
11923 else
11924 ac_cv_lib_intl_ngettext=no
11925 fi
11926 rm -f core conftest.err conftest.$ac_objext \
11927 conftest$ac_exeext conftest.$ac_ext
11928 LIBS=$ac_check_lib_save_LIBS
11929 fi
11930 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5
11931 $as_echo "$ac_cv_lib_intl_ngettext" >&6; }
11932 if test "x$ac_cv_lib_intl_ngettext" = xyes; then :
11933 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5
11934 $as_echo_n "checking for dcgettext in -lintl... " >&6; }
11935 if ${ac_cv_lib_intl_dcgettext+:} false; then :
11936 $as_echo_n "(cached) " >&6
11937 else
11938 ac_check_lib_save_LIBS=$LIBS
11939 LIBS="-lintl -liconv $LIBS"
11940 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11941 /* end confdefs.h. */
11942
11943 /* Override any GCC internal prototype to avoid an error.
11944 Use char because int might match the return type of a GCC
11945 builtin and then its argument prototype would still apply. */
11946 #ifdef __cplusplus
11947 extern "C"
11948 #endif
11949 char dcgettext ();
11950 int
11951 main ()
11952 {
11953 return dcgettext ();
11954 ;
11955 return 0;
11956 }
11957 _ACEOF
11958 if ac_fn_c_try_link "$LINENO"; then :
11959 ac_cv_lib_intl_dcgettext=yes
11960 else
11961 ac_cv_lib_intl_dcgettext=no
11962 fi
11963 rm -f core conftest.err conftest.$ac_objext \
11964 conftest$ac_exeext conftest.$ac_ext
11965 LIBS=$ac_check_lib_save_LIBS
11966 fi
11967 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5
11968 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; }
11969 if test "x$ac_cv_lib_intl_dcgettext" = xyes; then :
11970 gt_cv_func_dgettext_libintl=yes
11971 libintl_extra_libs=-liconv
11972 else
11973 :
11974 fi
11975
11976 else
11977 :
11978 fi
11979
11980 fi
11981
11982 #
11983 # If we found libintl, then check in it for bind_textdomain_codeset();
11984 # we'll prefer libc if neither have bind_textdomain_codeset(),
11985 # and both have dgettext and ngettext
11986 #
11987 if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
11988 glib_save_LIBS="$LIBS"
11989 LIBS="$LIBS -lintl $libintl_extra_libs"
11990 unset ac_cv_func_bind_textdomain_codeset
11991 for ac_func in bind_textdomain_codeset
11992 do :
11993 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
11994 if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
11995 cat >>confdefs.h <<_ACEOF
11996 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
11997 _ACEOF
11998
11999 fi
12000 done
12001
12002 LIBS="$glib_save_LIBS"
12003
12004 if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
12005 gt_cv_func_dgettext_libc=no
12006 else
12007 if test "$gt_cv_func_dgettext_libc" = "yes" \
12008 && test "$gt_cv_func_ngettext_libc" = "yes"; then
12009 gt_cv_func_dgettext_libintl=no
12010 fi
12011 fi
12012 fi
12013 fi
12014
12015 if test "$gt_cv_func_dgettext_libc" = "yes" \
12016 || test "$gt_cv_func_dgettext_libintl" = "yes"; then
12017 gt_cv_have_gettext=yes
12018 fi
12019
12020 if test "$gt_cv_func_dgettext_libintl" = "yes"; then
12021 INTLLIBS="-lintl $libintl_extra_libs"
12022 fi
12023
12024 if test "$gt_cv_have_gettext" = "yes"; then
12025
12026 $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
12027
12028 # Extract the first word of "msgfmt", so it can be a program name with args.
12029 set dummy msgfmt; ac_word=$2
12030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12031 $as_echo_n "checking for $ac_word... " >&6; }
12032 if ${ac_cv_path_MSGFMT+:} false; then :
12033 $as_echo_n "(cached) " >&6
12034 else
12035 case "$MSGFMT" in
12036 /*)
12037 ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
12038 ;;
12039 *)
12040 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12041 for ac_dir in $PATH; do
12042 test -z "$ac_dir" && ac_dir=.
12043 if test -f $ac_dir/$ac_word; then
12044 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
12045 ac_cv_path_MSGFMT="$ac_dir/$ac_word"
12046 break
12047 fi
12048 fi
12049 done
12050 IFS="$ac_save_ifs"
12051 test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
12052 ;;
12053 esac
12054 fi
12055 MSGFMT="$ac_cv_path_MSGFMT"
12056 if test "$MSGFMT" != "no"; then
12057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
12058 $as_echo "$MSGFMT" >&6; }
12059 else
12060 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12061 $as_echo "no" >&6; }
12062 fi
12063 if test "$MSGFMT" != "no"; then
12064 glib_save_LIBS="$LIBS"
12065 LIBS="$LIBS $INTLLIBS"
12066 for ac_func in dcgettext
12067 do :
12068 ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext"
12069 if test "x$ac_cv_func_dcgettext" = xyes; then :
12070 cat >>confdefs.h <<_ACEOF
12071 #define HAVE_DCGETTEXT 1
12072 _ACEOF
12073
12074 fi
12075 done
12076
12077 MSGFMT_OPTS=
12078 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5
12079 $as_echo_n "checking if msgfmt accepts -c... " >&6; }
12080 cat >conftest.foo <<_ACEOF
12081
12082 msgid ""
12083 msgstr ""
12084 "Content-Type: text/plain; charset=UTF-8\n"
12085 "Project-Id-Version: test 1.0\n"
12086 "PO-Revision-Date: 2007-02-15 12:01+0100\n"
12087 "Last-Translator: test <foo@bar.xx>\n"
12088 "Language-Team: C <LL@li.org>\n"
12089 "MIME-Version: 1.0\n"
12090 "Content-Transfer-Encoding: 8bit\n"
12091
12092 _ACEOF
12093 if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5
12094 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5
12095 ac_status=$?
12096 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12097 test $ac_status = 0; }; then
12098 MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12099 $as_echo "yes" >&6; }
12100 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12101 $as_echo "no" >&6; }
12102 echo "$as_me: failed input was:" >&5
12103 sed 's/^/| /' conftest.foo >&5
12104 fi
12105
12106 # Extract the first word of "gmsgfmt", so it can be a program name with args.
12107 set dummy gmsgfmt; ac_word=$2
12108 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12109 $as_echo_n "checking for $ac_word... " >&6; }
12110 if ${ac_cv_path_GMSGFMT+:} false; then :
12111 $as_echo_n "(cached) " >&6
12112 else
12113 case $GMSGFMT in
12114 [\\/]* | ?:[\\/]*)
12115 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
12116 ;;
12117 *)
12118 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12119 for as_dir in $PATH
12120 do
12121 IFS=$as_save_IFS
12122 test -z "$as_dir" && as_dir=.
12123 for ac_exec_ext in '' $ac_executable_extensions; do
12124 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12125 ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
12126 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12127 break 2
12128 fi
12129 done
12130 done
12131 IFS=$as_save_IFS
12132
12133 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
12134 ;;
12135 esac
12136 fi
12137 GMSGFMT=$ac_cv_path_GMSGFMT
12138 if test -n "$GMSGFMT"; then
12139 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
12140 $as_echo "$GMSGFMT" >&6; }
12141 else
12142 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12143 $as_echo "no" >&6; }
12144 fi
12145
12146
12147 # Extract the first word of "xgettext", so it can be a program name with args.
12148 set dummy xgettext; ac_word=$2
12149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12150 $as_echo_n "checking for $ac_word... " >&6; }
12151 if ${ac_cv_path_XGETTEXT+:} false; then :
12152 $as_echo_n "(cached) " >&6
12153 else
12154 case "$XGETTEXT" in
12155 /*)
12156 ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
12157 ;;
12158 *)
12159 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12160 for ac_dir in $PATH; do
12161 test -z "$ac_dir" && ac_dir=.
12162 if test -f $ac_dir/$ac_word; then
12163 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
12164 ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
12165 break
12166 fi
12167 fi
12168 done
12169 IFS="$ac_save_ifs"
12170 test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
12171 ;;
12172 esac
12173 fi
12174 XGETTEXT="$ac_cv_path_XGETTEXT"
12175 if test "$XGETTEXT" != ":"; then
12176 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
12177 $as_echo "$XGETTEXT" >&6; }
12178 else
12179 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12180 $as_echo "no" >&6; }
12181 fi
12182
12183 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12184 /* end confdefs.h. */
12185
12186 int
12187 main ()
12188 {
12189 extern int _nl_msg_cat_cntr;
12190 return _nl_msg_cat_cntr
12191 ;
12192 return 0;
12193 }
12194 _ACEOF
12195 if ac_fn_c_try_link "$LINENO"; then :
12196 CATOBJEXT=.gmo
12197 DATADIRNAME=share
12198 else
12199 case $host in
12200 *-*-solaris*)
12201 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
12202 if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
12203 CATOBJEXT=.gmo
12204 DATADIRNAME=share
12205 else
12206 CATOBJEXT=.mo
12207 DATADIRNAME=lib
12208 fi
12209
12210 ;;
12211 *-*-openbsd*)
12212 CATOBJEXT=.mo
12213 DATADIRNAME=share
12214 ;;
12215 *)
12216 CATOBJEXT=.mo
12217 DATADIRNAME=lib
12218 ;;
12219 esac
12220 fi
12221 rm -f core conftest.err conftest.$ac_objext \
12222 conftest$ac_exeext conftest.$ac_ext
12223 LIBS="$glib_save_LIBS"
12224 INSTOBJEXT=.mo
12225 else
12226 gt_cv_have_gettext=no
12227 fi
12228 fi
12229
12230 fi
12231
12232
12233
12234 if test "$gt_cv_have_gettext" = "yes" ; then
12235
12236 $as_echo "#define ENABLE_NLS 1" >>confdefs.h
12237
12238 fi
12239
12240 if test "$XGETTEXT" != ":"; then
12241 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
12242 : ;
12243 else
12244 { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5
12245 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; }
12246 XGETTEXT=":"
12247 fi
12248 fi
12249
12250 # We need to process the po/ directory.
12251 POSUB=po
12252
12253 ac_config_commands="$ac_config_commands default-1"
12254
12255
12256 for lang in $ALL_LINGUAS; do
12257 GMOFILES="$GMOFILES $lang.gmo"
12258 POFILES="$POFILES $lang.po"
12259 done
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273 if test "$gt_cv_have_gettext" = "yes"; then
12274 if test "x$ALL_LINGUAS" = "x"; then
12275 LINGUAS=
12276 else
12277 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5
12278 $as_echo_n "checking for catalogs to be installed... " >&6; }
12279 NEW_LINGUAS=
12280 for presentlang in $ALL_LINGUAS; do
12281 useit=no
12282 if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
12283 desiredlanguages="$LINGUAS"
12284 else
12285 desiredlanguages="$ALL_LINGUAS"
12286 fi
12287 for desiredlang in $desiredlanguages; do
12288 # Use the presentlang catalog if desiredlang is
12289 # a. equal to presentlang, or
12290 # b. a variant of presentlang (because in this case,
12291 # presentlang can be used as a fallback for messages
12292 # which are not translated in the desiredlang catalog).
12293 case "$desiredlang" in
12294 "$presentlang"*) useit=yes;;
12295 esac
12296 done
12297 if test $useit = yes; then
12298 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
12299 fi
12300 done
12301 LINGUAS=$NEW_LINGUAS
12302 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5
12303 $as_echo "$LINGUAS" >&6; }
12304 fi
12305
12306 if test -n "$LINGUAS"; then
12307 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
12308 fi
12309 fi
12310
12311 MKINSTALLDIRS=
12312 if test -n "$ac_aux_dir"; then
12313 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
12314 fi
12315 if test -z "$MKINSTALLDIRS"; then
12316 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
12317 fi
12318
12319
12320 test -d po || mkdir po
12321 if test "x$srcdir" != "x."; then
12322 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
12323 posrcprefix="$srcdir/"
12324 else
12325 posrcprefix="../$srcdir/"
12326 fi
12327 else
12328 posrcprefix="../"
12329 fi
12330 rm -f po/POTFILES
12331 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
12332 < $srcdir/po/POTFILES.in > po/POTFILES
12333
12334
1160312335 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
1160412336 $as_echo_n "checking whether NLS is requested... " >&6; }
1160512337 # Check whether --enable-nls was given.
1246113193
1246213194 fi
1246313195
13196
13197 # Check whether --with-libvirt was given.
13198 if test "${with_libvirt+set}" = set; then :
13199 withval=$with_libvirt;
13200 fi
13201
13202
13203 if test "x$with_libvirt" != "xno"; then :
13204
1246413205 pkg_failed=no
1246513206 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVIRT" >&5
1246613207 $as_echo_n "checking for LIBVIRT... " >&6; }
1246913210 pkg_cv_LIBVIRT_CFLAGS="$LIBVIRT_CFLAGS"
1247013211 elif test -n "$PKG_CONFIG"; then
1247113212 if test -n "$PKG_CONFIG" && \
12472 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= \$LIBVIRT_REQUIRED\""; } >&5
12473 ($PKG_CONFIG --exists --print-errors "libvirt >= $LIBVIRT_REQUIRED") 2>&5
13213 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt\""; } >&5
13214 ($PKG_CONFIG --exists --print-errors "libvirt") 2>&5
1247413215 ac_status=$?
1247513216 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1247613217 test $ac_status = 0; }; then
12477 pkg_cv_LIBVIRT_CFLAGS=`$PKG_CONFIG --cflags "libvirt >= $LIBVIRT_REQUIRED" 2>/dev/null`
13218 pkg_cv_LIBVIRT_CFLAGS=`$PKG_CONFIG --cflags "libvirt" 2>/dev/null`
1247813219 else
1247913220 pkg_failed=yes
1248013221 fi
1248513226 pkg_cv_LIBVIRT_LIBS="$LIBVIRT_LIBS"
1248613227 elif test -n "$PKG_CONFIG"; then
1248713228 if test -n "$PKG_CONFIG" && \
12488 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= \$LIBVIRT_REQUIRED\""; } >&5
12489 ($PKG_CONFIG --exists --print-errors "libvirt >= $LIBVIRT_REQUIRED") 2>&5
13229 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt\""; } >&5
13230 ($PKG_CONFIG --exists --print-errors "libvirt") 2>&5
1249013231 ac_status=$?
1249113232 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1249213233 test $ac_status = 0; }; then
12493 pkg_cv_LIBVIRT_LIBS=`$PKG_CONFIG --libs "libvirt >= $LIBVIRT_REQUIRED" 2>/dev/null`
13234 pkg_cv_LIBVIRT_LIBS=`$PKG_CONFIG --libs "libvirt" 2>/dev/null`
1249413235 else
1249513236 pkg_failed=yes
1249613237 fi
1251013251 _pkg_short_errors_supported=no
1251113252 fi
1251213253 if test $_pkg_short_errors_supported = yes; then
12513 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libvirt >= $LIBVIRT_REQUIRED" 2>&1`
13254 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libvirt" 2>&1`
1251413255 else
12515 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --print-errors "libvirt >= $LIBVIRT_REQUIRED" 2>&1`
13256 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --print-errors "libvirt" 2>&1`
1251613257 fi
1251713258 # Put the nasty error message in config.log where it belongs
1251813259 echo "$LIBVIRT_PKG_ERRORS" >&5
1251913260
12520 as_fn_error $? "Package requirements (libvirt >= $LIBVIRT_REQUIRED) were not met:
12521
12522 $LIBVIRT_PKG_ERRORS
12523
12524 Consider adjusting the PKG_CONFIG_PATH environment variable if you
12525 installed software in a non-standard prefix.
12526
12527 Alternatively, you may set the environment variables LIBVIRT_CFLAGS
12528 and LIBVIRT_LIBS to avoid the need to call pkg-config.
12529 See the pkg-config man page for more details." "$LINENO" 5
12530
13261 have_libvirt=no
1253113262 elif test $pkg_failed = untried; then
1253213263 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1253313264 $as_echo "no" >&6; }
12534 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12535 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12536 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
12537 is in your PATH or set the PKG_CONFIG environment variable to the full
12538 path to pkg-config.
12539
12540 Alternatively, you may set the environment variables LIBVIRT_CFLAGS
12541 and LIBVIRT_LIBS to avoid the need to call pkg-config.
12542 See the pkg-config man page for more details.
12543
12544 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
12545 See \`config.log' for more details" "$LINENO" 5; }
12546
13265 have_libvirt=no
1254713266 else
1254813267 LIBVIRT_CFLAGS=$pkg_cv_LIBVIRT_CFLAGS
1254913268 LIBVIRT_LIBS=$pkg_cv_LIBVIRT_LIBS
1255013269 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1255113270 $as_echo "yes" >&6; }
12552
12553 fi
13271 have_libvirt=yes
13272 fi
13273 else
13274 have_libvirt=no
13275 fi
13276
13277 if test "x$have_libvirt" = "xyes"; then :
13278
13279 $as_echo "#define HAVE_LIBVIRT 1" >>confdefs.h
13280
13281 else
13282 if test "x$with_libvirt" = "xyes"; then :
13283 as_fn_error $? "libvirt requested but not found" "$LINENO" 5
13284
13285 fi
13286
13287 fi
13288 if test "x$have_libvirt" = "xyes"; then
13289 HAVE_LIBVIRT_TRUE=
13290 HAVE_LIBVIRT_FALSE='#'
13291 else
13292 HAVE_LIBVIRT_TRUE='#'
13293 HAVE_LIBVIRT_FALSE=
13294 fi
13295
1255413296
1255513297 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which gtk+ version to compile against" >&5
1255613298 $as_echo_n "checking which gtk+ version to compile against... " >&6; }
1281113553 pkg_cv_SPICE_GTK_CFLAGS="$SPICE_GTK_CFLAGS"
1281213554 elif test -n "$PKG_CONFIG"; then
1281313555 if test -n "$PKG_CONFIG" && \
12814 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED\""; } >&5
12815 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED") 2>&5
13556 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED
13557 spice-controller\""; } >&5
13558 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED
13559 spice-controller") 2>&5
1281613560 ac_status=$?
1281713561 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1281813562 test $ac_status = 0; }; then
12819 pkg_cv_SPICE_GTK_CFLAGS=`$PKG_CONFIG --cflags "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>/dev/null`
13563 pkg_cv_SPICE_GTK_CFLAGS=`$PKG_CONFIG --cflags "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED
13564 spice-controller" 2>/dev/null`
1282013565 else
1282113566 pkg_failed=yes
1282213567 fi
1282713572 pkg_cv_SPICE_GTK_LIBS="$SPICE_GTK_LIBS"
1282813573 elif test -n "$PKG_CONFIG"; then
1282913574 if test -n "$PKG_CONFIG" && \
12830 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED\""; } >&5
12831 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED") 2>&5
13575 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED
13576 spice-controller\""; } >&5
13577 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED
13578 spice-controller") 2>&5
1283213579 ac_status=$?
1283313580 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1283413581 test $ac_status = 0; }; then
12835 pkg_cv_SPICE_GTK_LIBS=`$PKG_CONFIG --libs "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>/dev/null`
13582 pkg_cv_SPICE_GTK_LIBS=`$PKG_CONFIG --libs "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED
13583 spice-controller" 2>/dev/null`
1283613584 else
1283713585 pkg_failed=yes
1283813586 fi
1285213600 _pkg_short_errors_supported=no
1285313601 fi
1285413602 if test $_pkg_short_errors_supported = yes; then
12855 SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>&1`
13603 SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED
13604 spice-controller" 2>&1`
1285613605 else
12857 SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>&1`
13606 SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED
13607 spice-controller" 2>&1`
1285813608 fi
1285913609 # Put the nasty error message in config.log where it belongs
1286013610 echo "$SPICE_GTK_PKG_ERRORS" >&5
1329214042 fi
1329314043
1329414044
13295 ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile po/Makefile.in plugin/Makefile virt-viewer.spec mingw32-virt-viewer.spec"
14045 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"
1329614046
1329714047 cat >confcache <<\_ACEOF
1329814048 # This file is a shell script that caches the results of configure
1342314173 ac_config_commands="$ac_config_commands po/stamp-it"
1342414174
1342514175
14176 if test -z "${HAVE_LIBVIRT_TRUE}" && test -z "${HAVE_LIBVIRT_FALSE}"; then
14177 as_fn_error $? "conditional \"HAVE_LIBVIRT\" was never defined.
14178 Usually this means the macro was only invoked conditionally." "$LINENO" 5
14179 fi
1342614180 if test -z "${HAVE_GTK_2_TRUE}" && test -z "${HAVE_GTK_2_FALSE}"; then
1342714181 as_fn_error $? "conditional \"HAVE_GTK_2\" was never defined.
1342814182 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1385214606 # report actual input values of CONFIG_FILES etc. instead of their
1385314607 # values after options handling.
1385414608 ac_log="
13855 This file was extended by virt-viewer $as_me 0.4.2, which was
14609 This file was extended by virt-viewer $as_me 0.5.0, which was
1385614610 generated by GNU Autoconf 2.68. Invocation command line was
1385714611
1385814612 CONFIG_FILES = $CONFIG_FILES
1387914633 # Files that config.status was made for.
1388014634 config_files="$ac_config_files"
1388114635 config_headers="$ac_config_headers"
14636 config_links="$ac_config_links"
1388214637 config_commands="$ac_config_commands"
1388314638
1388414639 _ACEOF
1390914664 Configuration headers:
1391014665 $config_headers
1391114666
14667 Configuration links:
14668 $config_links
14669
1391214670 Configuration commands:
1391314671 $config_commands
1391414672
1391814676 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1391914677 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1392014678 ac_cs_version="\\
13921 virt-viewer config.status 0.4.2
14679 virt-viewer config.status 0.5.0
1392214680 configured by $0, generated by GNU Autoconf 2.68,
1392314681 with options \\"\$ac_cs_config\\"
1392414682
1431515073
1431615074
1431715075
15076 GNUmakefile=$GNUmakefile
15077
1431815078
1431915079 _ACEOF
1432015080
1432715087 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
1432815088 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
1432915089 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
15090 "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;;
15091 "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
1433015092 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15093 "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
15094 "data/virt-viewer.nsis") CONFIG_FILES="$CONFIG_FILES data/virt-viewer.nsis" ;;
15095 "icons/Makefile") CONFIG_FILES="$CONFIG_FILES icons/Makefile" ;;
15096 "icons/16x16/Makefile") CONFIG_FILES="$CONFIG_FILES icons/16x16/Makefile" ;;
15097 "icons/22x22/Makefile") CONFIG_FILES="$CONFIG_FILES icons/22x22/Makefile" ;;
15098 "icons/24x24/Makefile") CONFIG_FILES="$CONFIG_FILES icons/24x24/Makefile" ;;
15099 "icons/32x32/Makefile") CONFIG_FILES="$CONFIG_FILES icons/32x32/Makefile" ;;
15100 "icons/48x48/Makefile") CONFIG_FILES="$CONFIG_FILES icons/48x48/Makefile" ;;
15101 "icons/256x256/Makefile") CONFIG_FILES="$CONFIG_FILES icons/256x256/Makefile" ;;
15102 "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
15103 "mingw32-virt-viewer.spec") CONFIG_FILES="$CONFIG_FILES mingw32-virt-viewer.spec" ;;
15104 "plugin/Makefile") CONFIG_FILES="$CONFIG_FILES plugin/Makefile" ;;
15105 "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
1433115106 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
14332 "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
14333 "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
14334 "plugin/Makefile") CONFIG_FILES="$CONFIG_FILES plugin/Makefile" ;;
1433515107 "virt-viewer.spec") CONFIG_FILES="$CONFIG_FILES virt-viewer.spec" ;;
14336 "mingw32-virt-viewer.spec") CONFIG_FILES="$CONFIG_FILES mingw32-virt-viewer.spec" ;;
1433715108 "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;;
1433815109
1433915110 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
1434815119 if $ac_need_defaults; then
1434915120 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
1435015121 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
15122 test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
1435115123 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
1435215124 fi
1435315125
1464515417 fi # test -n "$CONFIG_HEADERS"
1464615418
1464715419
14648 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
15420 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS"
1464915421 shift
1465015422 for ac_tag
1465115423 do
1492215694 }
1492315695 s/.*/./; q'`/stamp-h$_am_stamp_count
1492415696 ;;
14925
15697 :L)
15698 #
15699 # CONFIG_LINK
15700 #
15701
15702 if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
15703 :
15704 else
15705 # Prefer the file from the source tree if names are identical.
15706 if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
15707 ac_source=$srcdir/$ac_source
15708 fi
15709
15710 { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
15711 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
15712
15713 if test ! -r "$ac_source"; then
15714 as_fn_error $? "$ac_source: file not found" "$LINENO" 5
15715 fi
15716 rm -f "$ac_file"
15717
15718 # Try a relative symlink, then a hard link, then a copy.
15719 case $ac_source in
15720 [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
15721 *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
15722 esac
15723 ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
15724 ln "$ac_source" "$ac_file" 2>/dev/null ||
15725 cp -p "$ac_source" "$ac_file" ||
15726 as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
15727 fi
15728 ;;
1492615729 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
1492715730 $as_echo "$as_me: executing $ac_file commands" >&6;}
1492815731 ;;
1565616459 chmod +x "$ofile"
1565716460
1565816461 ;;
16462 "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*)
16463 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
16464 esac ;;
1565916465 "po/stamp-it":C)
1566016466 if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then
1566116467 as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5
00
1 AC_INIT(virt-viewer, 0.4.2)
1 AC_INIT(virt-viewer, 0.5.0)
22 AC_CONFIG_SRCDIR(src/virt-viewer-main.c)
33 AM_CONFIG_HEADER(config.h)
44 dnl Make automake keep quiet about wildcards & other GNUmake-isms
1515 GTK2_REQUIRED="2.12.0"
1616 GTK3_REQUIRED="3.0"
1717 GTK_VNC_REQUIRED="0.4.3"
18 SPICE_GTK_REQUIRED="0.6"
18 SPICE_GTK_REQUIRED="0.9"
1919
2020 AC_PROG_CC
2121 AM_PROG_CC_C_O
2525
2626 AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions])
2727
28 # Autoconf 2.61a.99 and earlier don't support linking a file only
29 # in VPATH builds. But since GNUmakefile is for maintainer use
30 # only, it does not matter if we skip the link with older autoconf.
31 # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
32 # builds, so use a shell variable to bypass this.
33 GNUmakefile=GNUmakefile
34 m4_if(m4_version_compare([2.61a.100],
35 m4_defn([m4_PACKAGE_VERSION])), [1], [],
36 [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
37 [GNUmakefile=$GNUmakefile])])
38
2839 VIRT_VIEWER_COMPILE_WARNINGS(maximum)
2940
3041 GETTEXT_PACKAGE=virt-viewer
3142 AC_SUBST(GETTEXT_PACKAGE)
32 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
33
43 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [GETTEXT package name])
44
45 AM_GLIB_GNU_GETTEXT
3446 IT_PROG_INTLTOOL([0.35.0])
3547
3648
3749 PKG_CHECK_MODULES(GMODULE2, gmodule-export-2.0 >= $GMODULE2_REQUIRED)
3850 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED)
39 PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
51
52 AC_ARG_WITH([libvirt],
53 AS_HELP_STRING([--without-libvirt], [Ignore presence of libvirt and disable it]))
54
55 AS_IF([test "x$with_libvirt" != "xno"],
56 [PKG_CHECK_MODULES(LIBVIRT,
57 [libvirt],
58 [have_libvirt=yes], [have_libvirt=no])],
59 [have_libvirt=no])
60
61 AS_IF([test "x$have_libvirt" = "xyes"],
62 [AC_DEFINE([HAVE_LIBVIRT], 1, [Have libvirt?])],
63 [AS_IF([test "x$with_libvirt" = "xyes"],
64 [AC_MSG_ERROR([libvirt requested but not found])
65 ])
66 ])
67 AM_CONDITIONAL([HAVE_LIBVIRT], [test "x$have_libvirt" = "xyes"])
4068
4169 AC_MSG_CHECKING([which gtk+ version to compile against])
4270 AC_ARG_WITH([gtk],
91119
92120 AS_IF([test "x$with_spice_gtk" != "xno"],
93121 [PKG_CHECK_MODULES(SPICE_GTK,
94 spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED,
122 [spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED
123 spice-controller],
95124 [have_spice_gtk=yes], [have_spice_gtk=no])],
96125 [have_spice_gtk=no])
97126
130159 fi
131160 AM_CONDITIONAL(ENABLE_PLUGIN, [test "x$enable_plugin" = "xyes"])
132161
133 AC_OUTPUT(Makefile
134 src/Makefile
135 man/Makefile
136 po/Makefile.in
137 plugin/Makefile
138 virt-viewer.spec
139 mingw32-virt-viewer.spec)
162 AC_OUTPUT([
163 Makefile
164 data/Makefile
165 data/virt-viewer.nsis
166 icons/Makefile
167 icons/16x16/Makefile
168 icons/22x22/Makefile
169 icons/24x24/Makefile
170 icons/32x32/Makefile
171 icons/48x48/Makefile
172 icons/256x256/Makefile
173 man/Makefile
174 mingw32-virt-viewer.spec
175 plugin/Makefile
176 po/Makefile.in
177 src/Makefile
178 virt-viewer.spec
179 ])
140180
141181 AC_MSG_NOTICE([])
142182 AC_MSG_NOTICE([Configuration summary])
0 NULL=
1
2 EXTRA_DIST = \
3 spice-xpi-client-remote-viewer \
4 virt-viewer.nsis.in \
5 $(NULL)
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 pkgdatadir = $(datadir)/@PACKAGE@
18 pkgincludedir = $(includedir)/@PACKAGE@
19 pkglibdir = $(libdir)/@PACKAGE@
20 pkglibexecdir = $(libexecdir)/@PACKAGE@
21 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22 install_sh_DATA = $(install_sh) -c -m 644
23 install_sh_PROGRAM = $(install_sh) -c
24 install_sh_SCRIPT = $(install_sh) -c
25 INSTALL_HEADER = $(INSTALL_DATA)
26 transform = $(program_transform_name)
27 NORMAL_INSTALL = :
28 PRE_INSTALL = :
29 POST_INSTALL = :
30 NORMAL_UNINSTALL = :
31 PRE_UNINSTALL = :
32 POST_UNINSTALL = :
33 build_triplet = @build@
34 host_triplet = @host@
35 subdir = data
36 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
37 $(srcdir)/virt-viewer.nsis.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES = virt-viewer.nsis
48 CONFIG_CLEAN_VPATH_FILES =
49 AM_V_GEN = $(am__v_GEN_$(V))
50 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
51 am__v_GEN_0 = @echo " GEN " $@;
52 AM_V_at = $(am__v_at_$(V))
53 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
54 am__v_at_0 = @
55 SOURCES =
56 DIST_SOURCES =
57 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
58 ACLOCAL = @ACLOCAL@
59 ALL_LINGUAS = @ALL_LINGUAS@
60 AMTAR = @AMTAR@
61 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
62 AR = @AR@
63 AUTOCONF = @AUTOCONF@
64 AUTOHEADER = @AUTOHEADER@
65 AUTOMAKE = @AUTOMAKE@
66 AWK = @AWK@
67 CATALOGS = @CATALOGS@
68 CATOBJEXT = @CATOBJEXT@
69 CC = @CC@
70 CCDEPMODE = @CCDEPMODE@
71 CFLAGS = @CFLAGS@
72 CPP = @CPP@
73 CPPFLAGS = @CPPFLAGS@
74 CYGPATH_W = @CYGPATH_W@
75 DATADIRNAME = @DATADIRNAME@
76 DEFS = @DEFS@
77 DEPDIR = @DEPDIR@
78 DLLTOOL = @DLLTOOL@
79 DSYMUTIL = @DSYMUTIL@
80 DUMPBIN = @DUMPBIN@
81 ECHO_C = @ECHO_C@
82 ECHO_N = @ECHO_N@
83 ECHO_T = @ECHO_T@
84 EGREP = @EGREP@
85 EXEEXT = @EXEEXT@
86 FGREP = @FGREP@
87 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
88 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
89 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
90 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
91 GMODULE2_LIBS = @GMODULE2_LIBS@
92 GMOFILES = @GMOFILES@
93 GMSGFMT = @GMSGFMT@
94 GREP = @GREP@
95 GTK_API_VERSION = @GTK_API_VERSION@
96 GTK_CFLAGS = @GTK_CFLAGS@
97 GTK_LIBS = @GTK_LIBS@
98 GTK_REQUIRED = @GTK_REQUIRED@
99 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
100 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
101 GTK_VNC_LIBS = @GTK_VNC_LIBS@
102 INSTALL = @INSTALL@
103 INSTALL_DATA = @INSTALL_DATA@
104 INSTALL_PROGRAM = @INSTALL_PROGRAM@
105 INSTALL_SCRIPT = @INSTALL_SCRIPT@
106 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
107 INSTOBJEXT = @INSTOBJEXT@
108 INTLLIBS = @INTLLIBS@
109 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
110 INTLTOOL_MERGE = @INTLTOOL_MERGE@
111 INTLTOOL_PERL = @INTLTOOL_PERL@
112 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
113 LD = @LD@
114 LDFLAGS = @LDFLAGS@
115 LIBOBJS = @LIBOBJS@
116 LIBS = @LIBS@
117 LIBTOOL = @LIBTOOL@
118 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
119 LIBVIRT_LIBS = @LIBVIRT_LIBS@
120 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
121 LIBXML2_LIBS = @LIBXML2_LIBS@
122 LIPO = @LIPO@
123 LN_S = @LN_S@
124 LTLIBOBJS = @LTLIBOBJS@
125 MAKEINFO = @MAKEINFO@
126 MANIFEST_TOOL = @MANIFEST_TOOL@
127 MKDIR_P = @MKDIR_P@
128 MKINSTALLDIRS = @MKINSTALLDIRS@
129 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
130 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
131 MSGFMT = @MSGFMT@
132 MSGFMT_OPTS = @MSGFMT_OPTS@
133 MSGMERGE = @MSGMERGE@
134 NM = @NM@
135 NMEDIT = @NMEDIT@
136 NSPR_CFLAGS = @NSPR_CFLAGS@
137 NSPR_LIBS = @NSPR_LIBS@
138 OBJDUMP = @OBJDUMP@
139 OBJEXT = @OBJEXT@
140 OTOOL = @OTOOL@
141 OTOOL64 = @OTOOL64@
142 PACKAGE = @PACKAGE@
143 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
144 PACKAGE_NAME = @PACKAGE_NAME@
145 PACKAGE_STRING = @PACKAGE_STRING@
146 PACKAGE_TARNAME = @PACKAGE_TARNAME@
147 PACKAGE_URL = @PACKAGE_URL@
148 PACKAGE_VERSION = @PACKAGE_VERSION@
149 PATH_SEPARATOR = @PATH_SEPARATOR@
150 PKG_CONFIG = @PKG_CONFIG@
151 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
152 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
153 POFILES = @POFILES@
154 POSUB = @POSUB@
155 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
156 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
157 RANLIB = @RANLIB@
158 SED = @SED@
159 SET_MAKE = @SET_MAKE@
160 SHELL = @SHELL@
161 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
162 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
163 STRIP = @STRIP@
164 USE_NLS = @USE_NLS@
165 VERSION = @VERSION@
166 WARN_CFLAGS = @WARN_CFLAGS@
167 XGETTEXT = @XGETTEXT@
168 abs_builddir = @abs_builddir@
169 abs_srcdir = @abs_srcdir@
170 abs_top_builddir = @abs_top_builddir@
171 abs_top_srcdir = @abs_top_srcdir@
172 ac_ct_AR = @ac_ct_AR@
173 ac_ct_CC = @ac_ct_CC@
174 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
175 am__include = @am__include@
176 am__leading_dot = @am__leading_dot@
177 am__quote = @am__quote@
178 am__tar = @am__tar@
179 am__untar = @am__untar@
180 bindir = @bindir@
181 build = @build@
182 build_alias = @build_alias@
183 build_cpu = @build_cpu@
184 build_os = @build_os@
185 build_vendor = @build_vendor@
186 builddir = @builddir@
187 datadir = @datadir@
188 datarootdir = @datarootdir@
189 docdir = @docdir@
190 dvidir = @dvidir@
191 exec_prefix = @exec_prefix@
192 host = @host@
193 host_alias = @host_alias@
194 host_cpu = @host_cpu@
195 host_os = @host_os@
196 host_vendor = @host_vendor@
197 htmldir = @htmldir@
198 includedir = @includedir@
199 infodir = @infodir@
200 install_sh = @install_sh@
201 libdir = @libdir@
202 libexecdir = @libexecdir@
203 localedir = @localedir@
204 localstatedir = @localstatedir@
205 mandir = @mandir@
206 mkdir_p = @mkdir_p@
207 oldincludedir = @oldincludedir@
208 pdfdir = @pdfdir@
209 prefix = @prefix@
210 program_transform_name = @program_transform_name@
211 psdir = @psdir@
212 sbindir = @sbindir@
213 sharedstatedir = @sharedstatedir@
214 srcdir = @srcdir@
215 sysconfdir = @sysconfdir@
216 target_alias = @target_alias@
217 top_build_prefix = @top_build_prefix@
218 top_builddir = @top_builddir@
219 top_srcdir = @top_srcdir@
220 NULL =
221 EXTRA_DIST = \
222 spice-xpi-client-remote-viewer \
223 virt-viewer.nsis.in \
224 $(NULL)
225
226 all: all-am
227
228 .SUFFIXES:
229 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
230 @for dep in $?; do \
231 case '$(am__configure_deps)' in \
232 *$$dep*) \
233 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
234 && { if test -f $@; then exit 0; else break; fi; }; \
235 exit 1;; \
236 esac; \
237 done; \
238 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \
239 $(am__cd) $(top_srcdir) && \
240 $(AUTOMAKE) --gnu data/Makefile
241 .PRECIOUS: Makefile
242 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
243 @case '$?' in \
244 *config.status*) \
245 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
246 *) \
247 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
248 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
249 esac;
250
251 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
252 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
253
254 $(top_srcdir)/configure: $(am__configure_deps)
255 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
256 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
257 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
258 $(am__aclocal_m4_deps):
259 virt-viewer.nsis: $(top_builddir)/config.status $(srcdir)/virt-viewer.nsis.in
260 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
261
262 mostlyclean-libtool:
263 -rm -f *.lo
264
265 clean-libtool:
266 -rm -rf .libs _libs
267 tags: TAGS
268 TAGS:
269
270 ctags: CTAGS
271 CTAGS:
272
273
274 distdir: $(DISTFILES)
275 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
276 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
277 list='$(DISTFILES)'; \
278 dist_files=`for file in $$list; do echo $$file; done | \
279 sed -e "s|^$$srcdirstrip/||;t" \
280 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
281 case $$dist_files in \
282 */*) $(MKDIR_P) `echo "$$dist_files" | \
283 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
284 sort -u` ;; \
285 esac; \
286 for file in $$dist_files; do \
287 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
288 if test -d $$d/$$file; then \
289 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
290 if test -d "$(distdir)/$$file"; then \
291 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
292 fi; \
293 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
294 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
295 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
296 fi; \
297 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
298 else \
299 test -f "$(distdir)/$$file" \
300 || cp -p $$d/$$file "$(distdir)/$$file" \
301 || exit 1; \
302 fi; \
303 done
304 check-am: all-am
305 check: check-am
306 all-am: Makefile
307 installdirs:
308 install: install-am
309 install-exec: install-exec-am
310 install-data: install-data-am
311 uninstall: uninstall-am
312
313 install-am: all-am
314 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
315
316 installcheck: installcheck-am
317 install-strip:
318 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
319 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
320 `test -z '$(STRIP)' || \
321 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
322 mostlyclean-generic:
323
324 clean-generic:
325
326 distclean-generic:
327 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
328 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
329
330 maintainer-clean-generic:
331 @echo "This command is intended for maintainers to use"
332 @echo "it deletes files that may require special tools to rebuild."
333 clean: clean-am
334
335 clean-am: clean-generic clean-libtool mostlyclean-am
336
337 distclean: distclean-am
338 -rm -f Makefile
339 distclean-am: clean-am distclean-generic
340
341 dvi: dvi-am
342
343 dvi-am:
344
345 html: html-am
346
347 html-am:
348
349 info: info-am
350
351 info-am:
352
353 install-data-am:
354
355 install-dvi: install-dvi-am
356
357 install-dvi-am:
358
359 install-exec-am:
360
361 install-html: install-html-am
362
363 install-html-am:
364
365 install-info: install-info-am
366
367 install-info-am:
368
369 install-man:
370
371 install-pdf: install-pdf-am
372
373 install-pdf-am:
374
375 install-ps: install-ps-am
376
377 install-ps-am:
378
379 installcheck-am:
380
381 maintainer-clean: maintainer-clean-am
382 -rm -f Makefile
383 maintainer-clean-am: distclean-am maintainer-clean-generic
384
385 mostlyclean: mostlyclean-am
386
387 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
388
389 pdf: pdf-am
390
391 pdf-am:
392
393 ps: ps-am
394
395 ps-am:
396
397 uninstall-am:
398
399 .MAKE: install-am install-strip
400
401 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
402 distclean distclean-generic distclean-libtool distdir dvi \
403 dvi-am html html-am info info-am install install-am \
404 install-data install-data-am install-dvi install-dvi-am \
405 install-exec install-exec-am install-html install-html-am \
406 install-info install-info-am install-man install-pdf \
407 install-pdf-am install-ps install-ps-am install-strip \
408 installcheck installcheck-am installdirs maintainer-clean \
409 maintainer-clean-generic mostlyclean mostlyclean-generic \
410 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
411
412
413 # Tell versions [3.59,3.63) of GNU make to not export all variables.
414 # Otherwise a system limit (for SysV at least) may be exceeded.
415 .NOEXPORT:
0 #!/bin/sh
1
2 logger -t spice "starting remote-viewer --spice-controller $@..."
3 env | logger -t spice
4 exec remote-viewer --spice-controller "$@" 2>&1 | logger -t spice
5 logger -t spice "remote-viewer execution failed"
0 #!Nsis Installer Command Script
1 # @configure_input@
2 # To build an installer from the script you would normally do:
3 #
4 # makensis virt-viewer.nsis
5 #
6 # which will generate the output file 'virt-viewer-@VERSION@.exe' which is a Windows
7 # installer containing your program.
8
9 Name "virt-viewer"
10 OutFile "virt-viewer-@VERSION@.exe"
11 InstallDir "c:\virt-viewer"
12 InstallDirRegKey HKLM SOFTWARE\virt-viewer "Install_Dir"
13
14 ShowInstDetails hide
15 ShowUninstDetails hide
16
17 SetCompressor bzip2
18
19 XPStyle on
20
21 # Page components
22 Page directory
23 Page instfiles
24
25 ComponentText "Select which optional components you want to install."
26
27 DirText "Please select the installation folder."
28
29 Section "virt-viewer"
30 SectionIn RO
31
32 SetOutPath "$INSTDIR\bin"
33 File "@prefix@/bin/gst-discoverer-0.10.exe"
34 File "@prefix@/bin/gst-feedback.exe"
35 File "@prefix@/bin/gst-inspect-0.10.exe"
36 File "@prefix@/bin/gst-inspect.exe"
37 File "@prefix@/bin/gst-launch-0.10.exe"
38 File "@prefix@/bin/gst-launch.exe"
39 File "@prefix@/bin/gst-typefind-0.10.exe"
40 File "@prefix@/bin/gst-typefind.exe"
41 File "@prefix@/bin/gst-xmlinspect-0.10.exe"
42 File "@prefix@/bin/gst-xmlinspect.exe"
43 File "@prefix@/bin/gst-xmllaunch-0.10.exe"
44 File "@prefix@/bin/gst-xmllaunch.exe"
45 File "@prefix@/bin/libatk-1.0-0.dll"
46 File "@prefix@/bin/libcairo-2.dll"
47 File "@prefix@/bin/libcelt051-0.dll"
48 File "@prefix@/bin/libcrypto-10.dll"
49 File "@prefix@/bin/libffi-6.dll"
50 File "@prefix@/bin/libfontconfig-1.dll"
51 File "@prefix@/bin/libfreetype-6.dll"
52 File "@prefix@/bin/libgdk-win32-2.0-0.dll"
53 File "@prefix@/bin/libgdk-win32-2.0-0.dll"
54 File "@prefix@/bin/libgdk_pixbuf-2.0-0.dll"
55 File "@prefix@/bin/libgdk_pixbuf-2.0-0.dll"
56 File "@prefix@/bin/libgio-2.0-0.dll"
57 File "@prefix@/bin/libglib-2.0-0.dll"
58 File "@prefix@/bin/libgmodule-2.0-0.dll"
59 File "@prefix@/bin/libgobject-2.0-0.dll"
60 File "@prefix@/bin/libgstapp-0.10-0.dll"
61 File "@prefix@/bin/libgstaudio-0.10-0.dll"
62 File "@prefix@/bin/libgstbase-0.10-0.dll"
63 File "@prefix@/bin/libgstcontroller-0.10-0.dll"
64 File "@prefix@/bin/libgstfft-0.10-0.dll"
65 File "@prefix@/bin/libgstinterfaces-0.10-0.dll"
66 File "@prefix@/bin/libgstpbutils-0.10-0.dll"
67 File "@prefix@/bin/libgstreamer-0.10-0.dll"
68 File "@prefix@/bin/libgstvideo-0.10-0.dll"
69 File "@prefix@/bin/libgthread-2.0-0.dll"
70 File "@prefix@/bin/libgtk-win32-2.0-0.dll"
71 File "@prefix@/bin/iconv.dll"
72 File "@prefix@/bin/libintl-8.dll"
73 File "@prefix@/bin/libjpeg-62.dll"
74 File "@prefix@/bin/liborc-0.4-0.dll"
75 File "@prefix@/bin/liborc-test-0.4-0.dll"
76 File "@prefix@/bin/libpango-1.0-0.dll"
77 File "@prefix@/bin/libpangocairo-1.0-0.dll"
78 File "@prefix@/bin/libpangoft2-1.0-0.dll"
79 File "@prefix@/bin/libpangowin32-1.0-0.dll"
80 File "@prefix@/bin/libpixman-1-0.dll"
81 File "@prefix@/bin/libpng15-15.dll"
82 File "@prefix@/bin/libspice-client-glib-2.0-1.dll"
83 File "@prefix@/bin/libspice-client-gtk-2.0-1.dll"
84 File "@prefix@/bin/libspice-controller-0.dll"
85 File "@prefix@/bin/libssl-10.dll"
86 File "@prefix@/bin/libxml2-2.dll"
87 File "@prefix@/bin/libp11-kit-0.dll"
88 File "@prefix@/bin/libssh2-1.dll"
89 File "@prefix@/bin/libcurl-4.dll"
90 File "@prefix@/bin/libportablexdr-0.dll"
91 File "@prefix@/bin/libidn-11.dll"
92 File "@prefix@/bin/libssp-0.dll"
93 File "@prefix@/bin/libvirt-0.dll"
94 File "@prefix@/bin/libvirt-qemu-0.dll"
95 File "@prefix@/bin/virsh.exe"
96 File "@prefix@/bin/virt-pki-validate"
97 File "@prefix@/bin/virt-xml-validate"
98
99 #gtkvnc
100 File "@prefix@/bin/libgnutls-26.dll"
101 File "@prefix@/bin/libgpg-error-0.dll"
102 File "@prefix@/bin/libgcrypt-11.dll"
103 File "@prefix@/bin/libgvnc-1.0-0.dll"
104 File "@prefix@/bin/libgtk-vnc-1.0-0.dll"
105
106 File "@prefix@/bin/pango-querymodules.exe"
107 File "${DESTDIR}@prefix@/bin/remote-viewer.exe"
108 File "${DESTDIR}@prefix@/bin/virt-viewer.exe"
109 File "@prefix@/bin/zlib1.dll"
110
111 SetOutPath "$INSTDIR\etc"
112 File /r "@prefix@/etc/fonts"
113 File /r "@prefix@/etc/gtk-2.0"
114 File /r "@prefix@/etc/libvirt"
115 CreateDirectory "$INSTDIR\etc\pango"
116
117 CreateDirectory "$INSTDIR\etc\gtk-2.0"
118
119 SetOutPath "$INSTDIR\lib"
120 File /r "@prefix@/lib/gdk-pixbuf-2.0"
121 File /r "@prefix@/lib/gtk-2.0"
122 File /r "@prefix@/lib/pango"
123
124 SetOutPath "$INSTDIR\lib\gstreamer-0.10"
125 File "@prefix@/lib/gstreamer-0.10/libgstapp.dll"
126 File "@prefix@/lib/gstreamer-0.10/libgstaudioconvert.dll"
127 File "@prefix@/lib/gstreamer-0.10/libgstaudiofx.dll"
128 File "@prefix@/lib/gstreamer-0.10/libgstaudiorate.dll"
129 File "@prefix@/lib/gstreamer-0.10/libgstaudioresample.dll"
130 File "@prefix@/lib/gstreamer-0.10/libgstaudiotestsrc.dll"
131 File "@prefix@/lib/gstreamer-0.10/libgstautodetect.dll"
132 File "@prefix@/lib/gstreamer-0.10/libgstcoreelements.dll"
133 File "@prefix@/lib/gstreamer-0.10/libgstdirectsoundsink.dll"
134 File "@prefix@/lib/gstreamer-0.10/libgstdirectsoundsrc.dll"
135
136 SetOutPath "$INSTDIR\share"
137 File /r "@prefix@/share/libvirt"
138
139 # fixme for all languages
140 SetOutPath "$INSTDIR\share\locale\fr"
141 File "@prefix@/share/locale/fr/LC_MESSAGES/libvirt.*"
142 File "${DESTDIR}@prefix@/share/locale/fr/LC_MESSAGES/virt-viewer.*"
143
144 SetOutPath "$INSTDIR\share\virt-viewer\ui"
145 File "${DESTDIR}@prefix@/share/virt-viewer/ui/*.xml"
146
147 SetOutPath "$INSTDIR\share\themes\MS-Windows\gtk-2.0"
148 File "@prefix@/share/themes/MS-Windows/gtk-2.0/gtkrc"
149
150 ReadEnvStr $0 COMSPEC
151 SetOutPath "$INSTDIR"
152 nsExec::ExecToLog '$0 /C bin\pango-querymodules.exe > etc\pango\pango.modules'
153 nsExec::ExecToLog 'echo gtk-theme-name = "MS-Windows" > etc\gtk-2.0\gtkrc'
154
155 SectionEnd
156
157 Section "Start Menu Shortcuts"
158 CreateDirectory "$SMPROGRAMS\virt-viewer"
159 CreateShortCut "$SMPROGRAMS\virt-viewer\Uninstall virt-viewer.lnk" "$INSTDIR\Uninstall virt-viewer.exe" "" "$INSTDIR\Uninstall virt-viewer.exe" 0
160 # CreateShortCut "$SMPROGRAMS\virt-viewer\virt-viewer.exe.lnk" "$INSTDIR\bin\virt-viewer.exe" "" "$INSTDIR\bin\virt-viewer.exe" 0
161 SectionEnd
162
163 Section "Desktop Icons"
164 # CreateShortCut "$DESKTOP\virt-viewer.exe.lnk" "$INSTDIR\bin\virt-viewer.exe" "" "$INSTDIR\bin\virt-viewer.exe" 0
165 SectionEnd
166
167 Section "Uninstall"
168 # Delete /rebootok "$DESKTOP\virt-viewer.exe.lnk"
169 # Delete /rebootok "$SMPROGRAMS\virt-viewer\virt-viewer.exe.lnk"
170 Delete /rebootok "$SMPROGRAMS\virt-viewer\Uninstall virt-viewer.lnk"
171 RMDir "$SMPROGRAMS\virt-viewer"
172
173 RMDir /r "$INSTDIR\lib\pango"
174
175 RMDir /r "$INSTDIR\lib\gtk-2.0"
176
177 Delete /rebootok "$INSTDIR\share\virt-viewer\ui\*.xml"
178 Delete /rebootok "$INSTDIR\share\themes\MS-Windows\gtk-2.0\gtkrc"
179
180 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstdirectsoundsrc.dll"
181 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstdirectsoundsink.dll"
182 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstcoreelements.dll"
183 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstautodetect.dll"
184 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiotestsrc.dll"
185 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudioresample.dll"
186 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiorate.dll"
187 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiofx.dll"
188 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudioconvert.dll"
189 Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstapp.dll"
190 RMDir "$INSTDIR\lib\gstreamer-0.10"
191
192 RMDir /r "$INSTDIR\lib\gdk-pixbuf-2.0"
193
194 RMDir /r "$INSTDIR\etc\pango"
195
196 RMDir /r "$INSTDIR\etc\gtk-2.0"
197
198 RMDir /r "$INSTDIR\etc\fonts"
199
200 Delete /rebootok "$INSTDIR\bin\remote-viewer.exe"
201 Delete /rebootok "$INSTDIR\bin\pango-querymodules.exe"
202 Delete /rebootok "$INSTDIR\bin\libpangoft2-1.0-0.dll"
203 Delete /rebootok "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll"
204 Delete /rebootok "$INSTDIR\bin\libgdk-win32-2.0-0.dll"
205 Delete /rebootok "$INSTDIR\bin\gst-xmllaunch.exe"
206 Delete /rebootok "$INSTDIR\bin\gst-xmllaunch-0.10.exe"
207 Delete /rebootok "$INSTDIR\bin\gst-xmlinspect.exe"
208 Delete /rebootok "$INSTDIR\bin\gst-xmlinspect-0.10.exe"
209 Delete /rebootok "$INSTDIR\bin\gst-typefind.exe"
210 Delete /rebootok "$INSTDIR\bin\gst-typefind-0.10.exe"
211 Delete /rebootok "$INSTDIR\bin\gst-launch.exe"
212 Delete /rebootok "$INSTDIR\bin\gst-launch-0.10.exe"
213 Delete /rebootok "$INSTDIR\bin\gst-inspect.exe"
214 Delete /rebootok "$INSTDIR\bin\gst-inspect-0.10.exe"
215 Delete /rebootok "$INSTDIR\bin\gst-feedback.exe"
216 Delete /rebootok "$INSTDIR\bin\gst-discoverer-0.10.exe"
217 RMDir "$INSTDIR\bin"
218
219 Delete /rebootok "$INSTDIR\bin\libffi-6.dll"
220 Delete /rebootok "$INSTDIR\bin\zlib1.dll"
221 Delete /rebootok "$INSTDIR\bin\libp11-kit-0.dll"
222 Delete /rebootok "$INSTDIR\bin\libxml2-2.dll"
223 Delete /rebootok "$INSTDIR\bin\libssl-10.dll"
224 Delete /rebootok "$INSTDIR\bin\libspice-client-gtk-2.0-1.dll"
225 Delete /rebootok "$INSTDIR\bin\libspice-client-glib-2.0-1.dll"
226 Delete /rebootok "$INSTDIR\bin\libspice-controller-0.dll"
227 Delete /rebootok "$INSTDIR\bin\libpng15-15.dll"
228 Delete /rebootok "$INSTDIR\bin\libpixman-1-0.dll"
229 Delete /rebootok "$INSTDIR\bin\libpangowin32-1.0-0.dll"
230 Delete /rebootok "$INSTDIR\bin\libpangocairo-1.0-0.dll"
231 Delete /rebootok "$INSTDIR\bin\libpango-1.0-0.dll"
232 Delete /rebootok "$INSTDIR\bin\liborc-test-0.4-0.dll"
233 Delete /rebootok "$INSTDIR\bin\liborc-0.4-0.dll"
234 Delete /rebootok "$INSTDIR\bin\libjpeg-62.dll"
235 Delete /rebootok "$INSTDIR\bin\libintl-8.dll"
236 Delete /rebootok "$INSTDIR\bin\iconv.dll"
237 Delete /rebootok "$INSTDIR\bin\libgtk-win32-2.0-0.dll"
238 Delete /rebootok "$INSTDIR\bin\libgthread-2.0-0.dll"
239 Delete /rebootok "$INSTDIR\bin\libgstvideo-0.10-0.dll"
240 Delete /rebootok "$INSTDIR\bin\libgstreamer-0.10-0.dll"
241 Delete /rebootok "$INSTDIR\bin\libgstpbutils-0.10-0.dll"
242 Delete /rebootok "$INSTDIR\bin\libgstinterfaces-0.10-0.dll"
243 Delete /rebootok "$INSTDIR\bin\libgstfft-0.10-0.dll"
244 Delete /rebootok "$INSTDIR\bin\libgstcontroller-0.10-0.dll"
245 Delete /rebootok "$INSTDIR\bin\libgstbase-0.10-0.dll"
246 Delete /rebootok "$INSTDIR\bin\libgstaudio-0.10-0.dll"
247 Delete /rebootok "$INSTDIR\bin\libgstapp-0.10-0.dll"
248 Delete /rebootok "$INSTDIR\bin\libgobject-2.0-0.dll"
249 Delete /rebootok "$INSTDIR\bin\libgmodule-2.0-0.dll"
250 Delete /rebootok "$INSTDIR\bin\libglib-2.0-0.dll"
251 Delete /rebootok "$INSTDIR\bin\libgio-2.0-0.dll"
252 Delete /rebootok "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll"
253 Delete /rebootok "$INSTDIR\bin\libgdk-win32-2.0-0.dll"
254 Delete /rebootok "$INSTDIR\bin\libfreetype-6.dll"
255 Delete /rebootok "$INSTDIR\bin\libfontconfig-1.dll"
256 Delete /rebootok "$INSTDIR\bin\libcrypto-10.dll"
257 Delete /rebootok "$INSTDIR\bin\libcelt051-0.dll"
258 Delete /rebootok "$INSTDIR\bin\libcairo-2.dll"
259 Delete /rebootok "$INSTDIR\bin\libatk-1.0-0.dll"
260 RMDir "$INSTDIR\bin"
261 RMDir "$INSTDIR"
262 SectionEnd
263
264 Section -post
265 WriteUninstaller "$INSTDIR\Uninstall virt-viewer.exe"
266 SectionEnd
0 size = $(notdir $(PWD))
1 icondir = $(datadir)/icons/hicolor/$(size)/apps/
2 icon_DATA = $(PACKAGE).png
3
4 EXTRA_DIST = $(icon_DATA)
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = icons/16x16
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 AM_V_GEN = $(am__v_GEN_$(V))
50 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
51 am__v_GEN_0 = @echo " GEN " $@;
52 AM_V_at = $(am__v_at_$(V))
53 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
54 am__v_at_0 = @
55 SOURCES =
56 DIST_SOURCES =
57 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
58 am__vpath_adj = case $$p in \
59 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
60 *) f=$$p;; \
61 esac;
62 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
63 am__install_max = 40
64 am__nobase_strip_setup = \
65 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
66 am__nobase_strip = \
67 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
68 am__nobase_list = $(am__nobase_strip_setup); \
69 for p in $$list; do echo "$$p $$p"; done | \
70 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
71 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
72 if (++n[$$2] == $(am__install_max)) \
73 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
74 END { for (dir in files) print dir, files[dir] }'
75 am__base_list = \
76 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
77 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
78 am__installdirs = "$(DESTDIR)$(icondir)"
79 DATA = $(icon_DATA)
80 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
81 ACLOCAL = @ACLOCAL@
82 ALL_LINGUAS = @ALL_LINGUAS@
83 AMTAR = @AMTAR@
84 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
85 AR = @AR@
86 AUTOCONF = @AUTOCONF@
87 AUTOHEADER = @AUTOHEADER@
88 AUTOMAKE = @AUTOMAKE@
89 AWK = @AWK@
90 CATALOGS = @CATALOGS@
91 CATOBJEXT = @CATOBJEXT@
92 CC = @CC@
93 CCDEPMODE = @CCDEPMODE@
94 CFLAGS = @CFLAGS@
95 CPP = @CPP@
96 CPPFLAGS = @CPPFLAGS@
97 CYGPATH_W = @CYGPATH_W@
98 DATADIRNAME = @DATADIRNAME@
99 DEFS = @DEFS@
100 DEPDIR = @DEPDIR@
101 DLLTOOL = @DLLTOOL@
102 DSYMUTIL = @DSYMUTIL@
103 DUMPBIN = @DUMPBIN@
104 ECHO_C = @ECHO_C@
105 ECHO_N = @ECHO_N@
106 ECHO_T = @ECHO_T@
107 EGREP = @EGREP@
108 EXEEXT = @EXEEXT@
109 FGREP = @FGREP@
110 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
111 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
112 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
113 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
114 GMODULE2_LIBS = @GMODULE2_LIBS@
115 GMOFILES = @GMOFILES@
116 GMSGFMT = @GMSGFMT@
117 GREP = @GREP@
118 GTK_API_VERSION = @GTK_API_VERSION@
119 GTK_CFLAGS = @GTK_CFLAGS@
120 GTK_LIBS = @GTK_LIBS@
121 GTK_REQUIRED = @GTK_REQUIRED@
122 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
123 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
124 GTK_VNC_LIBS = @GTK_VNC_LIBS@
125 INSTALL = @INSTALL@
126 INSTALL_DATA = @INSTALL_DATA@
127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 INSTALL_SCRIPT = @INSTALL_SCRIPT@
129 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
130 INSTOBJEXT = @INSTOBJEXT@
131 INTLLIBS = @INTLLIBS@
132 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
133 INTLTOOL_MERGE = @INTLTOOL_MERGE@
134 INTLTOOL_PERL = @INTLTOOL_PERL@
135 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
136 LD = @LD@
137 LDFLAGS = @LDFLAGS@
138 LIBOBJS = @LIBOBJS@
139 LIBS = @LIBS@
140 LIBTOOL = @LIBTOOL@
141 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
142 LIBVIRT_LIBS = @LIBVIRT_LIBS@
143 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
144 LIBXML2_LIBS = @LIBXML2_LIBS@
145 LIPO = @LIPO@
146 LN_S = @LN_S@
147 LTLIBOBJS = @LTLIBOBJS@
148 MAKEINFO = @MAKEINFO@
149 MANIFEST_TOOL = @MANIFEST_TOOL@
150 MKDIR_P = @MKDIR_P@
151 MKINSTALLDIRS = @MKINSTALLDIRS@
152 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
153 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
154 MSGFMT = @MSGFMT@
155 MSGFMT_OPTS = @MSGFMT_OPTS@
156 MSGMERGE = @MSGMERGE@
157 NM = @NM@
158 NMEDIT = @NMEDIT@
159 NSPR_CFLAGS = @NSPR_CFLAGS@
160 NSPR_LIBS = @NSPR_LIBS@
161 OBJDUMP = @OBJDUMP@
162 OBJEXT = @OBJEXT@
163 OTOOL = @OTOOL@
164 OTOOL64 = @OTOOL64@
165 PACKAGE = @PACKAGE@
166 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
167 PACKAGE_NAME = @PACKAGE_NAME@
168 PACKAGE_STRING = @PACKAGE_STRING@
169 PACKAGE_TARNAME = @PACKAGE_TARNAME@
170 PACKAGE_URL = @PACKAGE_URL@
171 PACKAGE_VERSION = @PACKAGE_VERSION@
172 PATH_SEPARATOR = @PATH_SEPARATOR@
173 PKG_CONFIG = @PKG_CONFIG@
174 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
175 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
176 POFILES = @POFILES@
177 POSUB = @POSUB@
178 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
179 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
180 RANLIB = @RANLIB@
181 SED = @SED@
182 SET_MAKE = @SET_MAKE@
183 SHELL = @SHELL@
184 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
185 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
186 STRIP = @STRIP@
187 USE_NLS = @USE_NLS@
188 VERSION = @VERSION@
189 WARN_CFLAGS = @WARN_CFLAGS@
190 XGETTEXT = @XGETTEXT@
191 abs_builddir = @abs_builddir@
192 abs_srcdir = @abs_srcdir@
193 abs_top_builddir = @abs_top_builddir@
194 abs_top_srcdir = @abs_top_srcdir@
195 ac_ct_AR = @ac_ct_AR@
196 ac_ct_CC = @ac_ct_CC@
197 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
198 am__include = @am__include@
199 am__leading_dot = @am__leading_dot@
200 am__quote = @am__quote@
201 am__tar = @am__tar@
202 am__untar = @am__untar@
203 bindir = @bindir@
204 build = @build@
205 build_alias = @build_alias@
206 build_cpu = @build_cpu@
207 build_os = @build_os@
208 build_vendor = @build_vendor@
209 builddir = @builddir@
210 datadir = @datadir@
211 datarootdir = @datarootdir@
212 docdir = @docdir@
213 dvidir = @dvidir@
214 exec_prefix = @exec_prefix@
215 host = @host@
216 host_alias = @host_alias@
217 host_cpu = @host_cpu@
218 host_os = @host_os@
219 host_vendor = @host_vendor@
220 htmldir = @htmldir@
221 includedir = @includedir@
222 infodir = @infodir@
223 install_sh = @install_sh@
224 libdir = @libdir@
225 libexecdir = @libexecdir@
226 localedir = @localedir@
227 localstatedir = @localstatedir@
228 mandir = @mandir@
229 mkdir_p = @mkdir_p@
230 oldincludedir = @oldincludedir@
231 pdfdir = @pdfdir@
232 prefix = @prefix@
233 program_transform_name = @program_transform_name@
234 psdir = @psdir@
235 sbindir = @sbindir@
236 sharedstatedir = @sharedstatedir@
237 srcdir = @srcdir@
238 sysconfdir = @sysconfdir@
239 target_alias = @target_alias@
240 top_build_prefix = @top_build_prefix@
241 top_builddir = @top_builddir@
242 top_srcdir = @top_srcdir@
243 size = $(notdir $(PWD))
244 icondir = $(datadir)/icons/hicolor/$(size)/apps/
245 icon_DATA = $(PACKAGE).png
246 EXTRA_DIST = $(icon_DATA)
247 all: all-am
248
249 .SUFFIXES:
250 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
251 @for dep in $?; do \
252 case '$(am__configure_deps)' in \
253 *$$dep*) \
254 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
255 && { if test -f $@; then exit 0; else break; fi; }; \
256 exit 1;; \
257 esac; \
258 done; \
259 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/16x16/Makefile'; \
260 $(am__cd) $(top_srcdir) && \
261 $(AUTOMAKE) --gnu icons/16x16/Makefile
262 .PRECIOUS: Makefile
263 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
264 @case '$?' in \
265 *config.status*) \
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
267 *) \
268 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
269 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
270 esac;
271
272 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
273 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
274
275 $(top_srcdir)/configure: $(am__configure_deps)
276 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
277 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
279 $(am__aclocal_m4_deps):
280
281 mostlyclean-libtool:
282 -rm -f *.lo
283
284 clean-libtool:
285 -rm -rf .libs _libs
286 install-iconDATA: $(icon_DATA)
287 @$(NORMAL_INSTALL)
288 test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)"
289 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
290 for p in $$list; do \
291 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
292 echo "$$d$$p"; \
293 done | $(am__base_list) | \
294 while read files; do \
295 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
296 $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
297 done
298
299 uninstall-iconDATA:
300 @$(NORMAL_UNINSTALL)
301 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
302 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
303 test -n "$$files" || exit 0; \
304 echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \
305 cd "$(DESTDIR)$(icondir)" && rm -f $$files
306 tags: TAGS
307 TAGS:
308
309 ctags: CTAGS
310 CTAGS:
311
312
313 distdir: $(DISTFILES)
314 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
315 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
316 list='$(DISTFILES)'; \
317 dist_files=`for file in $$list; do echo $$file; done | \
318 sed -e "s|^$$srcdirstrip/||;t" \
319 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
320 case $$dist_files in \
321 */*) $(MKDIR_P) `echo "$$dist_files" | \
322 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
323 sort -u` ;; \
324 esac; \
325 for file in $$dist_files; do \
326 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
327 if test -d $$d/$$file; then \
328 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
329 if test -d "$(distdir)/$$file"; then \
330 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
331 fi; \
332 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
333 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
334 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
335 fi; \
336 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
337 else \
338 test -f "$(distdir)/$$file" \
339 || cp -p $$d/$$file "$(distdir)/$$file" \
340 || exit 1; \
341 fi; \
342 done
343 check-am: all-am
344 check: check-am
345 all-am: Makefile $(DATA)
346 installdirs:
347 for dir in "$(DESTDIR)$(icondir)"; do \
348 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
349 done
350 install: install-am
351 install-exec: install-exec-am
352 install-data: install-data-am
353 uninstall: uninstall-am
354
355 install-am: all-am
356 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
357
358 installcheck: installcheck-am
359 install-strip:
360 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
361 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
362 `test -z '$(STRIP)' || \
363 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
364 mostlyclean-generic:
365
366 clean-generic:
367
368 distclean-generic:
369 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
370 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
371
372 maintainer-clean-generic:
373 @echo "This command is intended for maintainers to use"
374 @echo "it deletes files that may require special tools to rebuild."
375 clean: clean-am
376
377 clean-am: clean-generic clean-libtool mostlyclean-am
378
379 distclean: distclean-am
380 -rm -f Makefile
381 distclean-am: clean-am distclean-generic
382
383 dvi: dvi-am
384
385 dvi-am:
386
387 html: html-am
388
389 html-am:
390
391 info: info-am
392
393 info-am:
394
395 install-data-am: install-iconDATA
396
397 install-dvi: install-dvi-am
398
399 install-dvi-am:
400
401 install-exec-am:
402
403 install-html: install-html-am
404
405 install-html-am:
406
407 install-info: install-info-am
408
409 install-info-am:
410
411 install-man:
412
413 install-pdf: install-pdf-am
414
415 install-pdf-am:
416
417 install-ps: install-ps-am
418
419 install-ps-am:
420
421 installcheck-am:
422
423 maintainer-clean: maintainer-clean-am
424 -rm -f Makefile
425 maintainer-clean-am: distclean-am maintainer-clean-generic
426
427 mostlyclean: mostlyclean-am
428
429 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
430
431 pdf: pdf-am
432
433 pdf-am:
434
435 ps: ps-am
436
437 ps-am:
438
439 uninstall-am: uninstall-iconDATA
440
441 .MAKE: install-am install-strip
442
443 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
444 distclean distclean-generic distclean-libtool distdir dvi \
445 dvi-am html html-am info info-am install install-am \
446 install-data install-data-am install-dvi install-dvi-am \
447 install-exec install-exec-am install-html install-html-am \
448 install-iconDATA install-info install-info-am install-man \
449 install-pdf install-pdf-am install-ps install-ps-am \
450 install-strip installcheck installcheck-am installdirs \
451 maintainer-clean maintainer-clean-generic mostlyclean \
452 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
453 uninstall uninstall-am uninstall-iconDATA
454
455
456 # Tell versions [3.59,3.63) of GNU make to not export all variables.
457 # Otherwise a system limit (for SysV at least) may be exceeded.
458 .NOEXPORT:
0 size = $(notdir $(PWD))
1 icondir = $(datadir)/icons/hicolor/$(size)/apps/
2 icon_DATA = $(PACKAGE).png
3
4 EXTRA_DIST = $(icon_DATA)
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = icons/22x22
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 AM_V_GEN = $(am__v_GEN_$(V))
50 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
51 am__v_GEN_0 = @echo " GEN " $@;
52 AM_V_at = $(am__v_at_$(V))
53 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
54 am__v_at_0 = @
55 SOURCES =
56 DIST_SOURCES =
57 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
58 am__vpath_adj = case $$p in \
59 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
60 *) f=$$p;; \
61 esac;
62 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
63 am__install_max = 40
64 am__nobase_strip_setup = \
65 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
66 am__nobase_strip = \
67 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
68 am__nobase_list = $(am__nobase_strip_setup); \
69 for p in $$list; do echo "$$p $$p"; done | \
70 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
71 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
72 if (++n[$$2] == $(am__install_max)) \
73 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
74 END { for (dir in files) print dir, files[dir] }'
75 am__base_list = \
76 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
77 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
78 am__installdirs = "$(DESTDIR)$(icondir)"
79 DATA = $(icon_DATA)
80 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
81 ACLOCAL = @ACLOCAL@
82 ALL_LINGUAS = @ALL_LINGUAS@
83 AMTAR = @AMTAR@
84 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
85 AR = @AR@
86 AUTOCONF = @AUTOCONF@
87 AUTOHEADER = @AUTOHEADER@
88 AUTOMAKE = @AUTOMAKE@
89 AWK = @AWK@
90 CATALOGS = @CATALOGS@
91 CATOBJEXT = @CATOBJEXT@
92 CC = @CC@
93 CCDEPMODE = @CCDEPMODE@
94 CFLAGS = @CFLAGS@
95 CPP = @CPP@
96 CPPFLAGS = @CPPFLAGS@
97 CYGPATH_W = @CYGPATH_W@
98 DATADIRNAME = @DATADIRNAME@
99 DEFS = @DEFS@
100 DEPDIR = @DEPDIR@
101 DLLTOOL = @DLLTOOL@
102 DSYMUTIL = @DSYMUTIL@
103 DUMPBIN = @DUMPBIN@
104 ECHO_C = @ECHO_C@
105 ECHO_N = @ECHO_N@
106 ECHO_T = @ECHO_T@
107 EGREP = @EGREP@
108 EXEEXT = @EXEEXT@
109 FGREP = @FGREP@
110 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
111 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
112 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
113 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
114 GMODULE2_LIBS = @GMODULE2_LIBS@
115 GMOFILES = @GMOFILES@
116 GMSGFMT = @GMSGFMT@
117 GREP = @GREP@
118 GTK_API_VERSION = @GTK_API_VERSION@
119 GTK_CFLAGS = @GTK_CFLAGS@
120 GTK_LIBS = @GTK_LIBS@
121 GTK_REQUIRED = @GTK_REQUIRED@
122 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
123 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
124 GTK_VNC_LIBS = @GTK_VNC_LIBS@
125 INSTALL = @INSTALL@
126 INSTALL_DATA = @INSTALL_DATA@
127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 INSTALL_SCRIPT = @INSTALL_SCRIPT@
129 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
130 INSTOBJEXT = @INSTOBJEXT@
131 INTLLIBS = @INTLLIBS@
132 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
133 INTLTOOL_MERGE = @INTLTOOL_MERGE@
134 INTLTOOL_PERL = @INTLTOOL_PERL@
135 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
136 LD = @LD@
137 LDFLAGS = @LDFLAGS@
138 LIBOBJS = @LIBOBJS@
139 LIBS = @LIBS@
140 LIBTOOL = @LIBTOOL@
141 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
142 LIBVIRT_LIBS = @LIBVIRT_LIBS@
143 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
144 LIBXML2_LIBS = @LIBXML2_LIBS@
145 LIPO = @LIPO@
146 LN_S = @LN_S@
147 LTLIBOBJS = @LTLIBOBJS@
148 MAKEINFO = @MAKEINFO@
149 MANIFEST_TOOL = @MANIFEST_TOOL@
150 MKDIR_P = @MKDIR_P@
151 MKINSTALLDIRS = @MKINSTALLDIRS@
152 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
153 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
154 MSGFMT = @MSGFMT@
155 MSGFMT_OPTS = @MSGFMT_OPTS@
156 MSGMERGE = @MSGMERGE@
157 NM = @NM@
158 NMEDIT = @NMEDIT@
159 NSPR_CFLAGS = @NSPR_CFLAGS@
160 NSPR_LIBS = @NSPR_LIBS@
161 OBJDUMP = @OBJDUMP@
162 OBJEXT = @OBJEXT@
163 OTOOL = @OTOOL@
164 OTOOL64 = @OTOOL64@
165 PACKAGE = @PACKAGE@
166 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
167 PACKAGE_NAME = @PACKAGE_NAME@
168 PACKAGE_STRING = @PACKAGE_STRING@
169 PACKAGE_TARNAME = @PACKAGE_TARNAME@
170 PACKAGE_URL = @PACKAGE_URL@
171 PACKAGE_VERSION = @PACKAGE_VERSION@
172 PATH_SEPARATOR = @PATH_SEPARATOR@
173 PKG_CONFIG = @PKG_CONFIG@
174 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
175 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
176 POFILES = @POFILES@
177 POSUB = @POSUB@
178 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
179 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
180 RANLIB = @RANLIB@
181 SED = @SED@
182 SET_MAKE = @SET_MAKE@
183 SHELL = @SHELL@
184 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
185 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
186 STRIP = @STRIP@
187 USE_NLS = @USE_NLS@
188 VERSION = @VERSION@
189 WARN_CFLAGS = @WARN_CFLAGS@
190 XGETTEXT = @XGETTEXT@
191 abs_builddir = @abs_builddir@
192 abs_srcdir = @abs_srcdir@
193 abs_top_builddir = @abs_top_builddir@
194 abs_top_srcdir = @abs_top_srcdir@
195 ac_ct_AR = @ac_ct_AR@
196 ac_ct_CC = @ac_ct_CC@
197 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
198 am__include = @am__include@
199 am__leading_dot = @am__leading_dot@
200 am__quote = @am__quote@
201 am__tar = @am__tar@
202 am__untar = @am__untar@
203 bindir = @bindir@
204 build = @build@
205 build_alias = @build_alias@
206 build_cpu = @build_cpu@
207 build_os = @build_os@
208 build_vendor = @build_vendor@
209 builddir = @builddir@
210 datadir = @datadir@
211 datarootdir = @datarootdir@
212 docdir = @docdir@
213 dvidir = @dvidir@
214 exec_prefix = @exec_prefix@
215 host = @host@
216 host_alias = @host_alias@
217 host_cpu = @host_cpu@
218 host_os = @host_os@
219 host_vendor = @host_vendor@
220 htmldir = @htmldir@
221 includedir = @includedir@
222 infodir = @infodir@
223 install_sh = @install_sh@
224 libdir = @libdir@
225 libexecdir = @libexecdir@
226 localedir = @localedir@
227 localstatedir = @localstatedir@
228 mandir = @mandir@
229 mkdir_p = @mkdir_p@
230 oldincludedir = @oldincludedir@
231 pdfdir = @pdfdir@
232 prefix = @prefix@
233 program_transform_name = @program_transform_name@
234 psdir = @psdir@
235 sbindir = @sbindir@
236 sharedstatedir = @sharedstatedir@
237 srcdir = @srcdir@
238 sysconfdir = @sysconfdir@
239 target_alias = @target_alias@
240 top_build_prefix = @top_build_prefix@
241 top_builddir = @top_builddir@
242 top_srcdir = @top_srcdir@
243 size = $(notdir $(PWD))
244 icondir = $(datadir)/icons/hicolor/$(size)/apps/
245 icon_DATA = $(PACKAGE).png
246 EXTRA_DIST = $(icon_DATA)
247 all: all-am
248
249 .SUFFIXES:
250 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
251 @for dep in $?; do \
252 case '$(am__configure_deps)' in \
253 *$$dep*) \
254 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
255 && { if test -f $@; then exit 0; else break; fi; }; \
256 exit 1;; \
257 esac; \
258 done; \
259 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/22x22/Makefile'; \
260 $(am__cd) $(top_srcdir) && \
261 $(AUTOMAKE) --gnu icons/22x22/Makefile
262 .PRECIOUS: Makefile
263 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
264 @case '$?' in \
265 *config.status*) \
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
267 *) \
268 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
269 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
270 esac;
271
272 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
273 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
274
275 $(top_srcdir)/configure: $(am__configure_deps)
276 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
277 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
279 $(am__aclocal_m4_deps):
280
281 mostlyclean-libtool:
282 -rm -f *.lo
283
284 clean-libtool:
285 -rm -rf .libs _libs
286 install-iconDATA: $(icon_DATA)
287 @$(NORMAL_INSTALL)
288 test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)"
289 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
290 for p in $$list; do \
291 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
292 echo "$$d$$p"; \
293 done | $(am__base_list) | \
294 while read files; do \
295 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
296 $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
297 done
298
299 uninstall-iconDATA:
300 @$(NORMAL_UNINSTALL)
301 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
302 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
303 test -n "$$files" || exit 0; \
304 echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \
305 cd "$(DESTDIR)$(icondir)" && rm -f $$files
306 tags: TAGS
307 TAGS:
308
309 ctags: CTAGS
310 CTAGS:
311
312
313 distdir: $(DISTFILES)
314 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
315 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
316 list='$(DISTFILES)'; \
317 dist_files=`for file in $$list; do echo $$file; done | \
318 sed -e "s|^$$srcdirstrip/||;t" \
319 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
320 case $$dist_files in \
321 */*) $(MKDIR_P) `echo "$$dist_files" | \
322 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
323 sort -u` ;; \
324 esac; \
325 for file in $$dist_files; do \
326 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
327 if test -d $$d/$$file; then \
328 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
329 if test -d "$(distdir)/$$file"; then \
330 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
331 fi; \
332 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
333 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
334 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
335 fi; \
336 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
337 else \
338 test -f "$(distdir)/$$file" \
339 || cp -p $$d/$$file "$(distdir)/$$file" \
340 || exit 1; \
341 fi; \
342 done
343 check-am: all-am
344 check: check-am
345 all-am: Makefile $(DATA)
346 installdirs:
347 for dir in "$(DESTDIR)$(icondir)"; do \
348 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
349 done
350 install: install-am
351 install-exec: install-exec-am
352 install-data: install-data-am
353 uninstall: uninstall-am
354
355 install-am: all-am
356 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
357
358 installcheck: installcheck-am
359 install-strip:
360 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
361 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
362 `test -z '$(STRIP)' || \
363 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
364 mostlyclean-generic:
365
366 clean-generic:
367
368 distclean-generic:
369 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
370 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
371
372 maintainer-clean-generic:
373 @echo "This command is intended for maintainers to use"
374 @echo "it deletes files that may require special tools to rebuild."
375 clean: clean-am
376
377 clean-am: clean-generic clean-libtool mostlyclean-am
378
379 distclean: distclean-am
380 -rm -f Makefile
381 distclean-am: clean-am distclean-generic
382
383 dvi: dvi-am
384
385 dvi-am:
386
387 html: html-am
388
389 html-am:
390
391 info: info-am
392
393 info-am:
394
395 install-data-am: install-iconDATA
396
397 install-dvi: install-dvi-am
398
399 install-dvi-am:
400
401 install-exec-am:
402
403 install-html: install-html-am
404
405 install-html-am:
406
407 install-info: install-info-am
408
409 install-info-am:
410
411 install-man:
412
413 install-pdf: install-pdf-am
414
415 install-pdf-am:
416
417 install-ps: install-ps-am
418
419 install-ps-am:
420
421 installcheck-am:
422
423 maintainer-clean: maintainer-clean-am
424 -rm -f Makefile
425 maintainer-clean-am: distclean-am maintainer-clean-generic
426
427 mostlyclean: mostlyclean-am
428
429 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
430
431 pdf: pdf-am
432
433 pdf-am:
434
435 ps: ps-am
436
437 ps-am:
438
439 uninstall-am: uninstall-iconDATA
440
441 .MAKE: install-am install-strip
442
443 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
444 distclean distclean-generic distclean-libtool distdir dvi \
445 dvi-am html html-am info info-am install install-am \
446 install-data install-data-am install-dvi install-dvi-am \
447 install-exec install-exec-am install-html install-html-am \
448 install-iconDATA install-info install-info-am install-man \
449 install-pdf install-pdf-am install-ps install-ps-am \
450 install-strip installcheck installcheck-am installdirs \
451 maintainer-clean maintainer-clean-generic mostlyclean \
452 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
453 uninstall uninstall-am uninstall-iconDATA
454
455
456 # Tell versions [3.59,3.63) of GNU make to not export all variables.
457 # Otherwise a system limit (for SysV at least) may be exceeded.
458 .NOEXPORT:
0 size = $(notdir $(PWD))
1 icondir = $(datadir)/icons/hicolor/$(size)/apps/
2 icon_DATA = $(PACKAGE).png
3
4 EXTRA_DIST = $(icon_DATA)
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = icons/24x24
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 AM_V_GEN = $(am__v_GEN_$(V))
50 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
51 am__v_GEN_0 = @echo " GEN " $@;
52 AM_V_at = $(am__v_at_$(V))
53 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
54 am__v_at_0 = @
55 SOURCES =
56 DIST_SOURCES =
57 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
58 am__vpath_adj = case $$p in \
59 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
60 *) f=$$p;; \
61 esac;
62 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
63 am__install_max = 40
64 am__nobase_strip_setup = \
65 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
66 am__nobase_strip = \
67 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
68 am__nobase_list = $(am__nobase_strip_setup); \
69 for p in $$list; do echo "$$p $$p"; done | \
70 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
71 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
72 if (++n[$$2] == $(am__install_max)) \
73 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
74 END { for (dir in files) print dir, files[dir] }'
75 am__base_list = \
76 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
77 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
78 am__installdirs = "$(DESTDIR)$(icondir)"
79 DATA = $(icon_DATA)
80 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
81 ACLOCAL = @ACLOCAL@
82 ALL_LINGUAS = @ALL_LINGUAS@
83 AMTAR = @AMTAR@
84 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
85 AR = @AR@
86 AUTOCONF = @AUTOCONF@
87 AUTOHEADER = @AUTOHEADER@
88 AUTOMAKE = @AUTOMAKE@
89 AWK = @AWK@
90 CATALOGS = @CATALOGS@
91 CATOBJEXT = @CATOBJEXT@
92 CC = @CC@
93 CCDEPMODE = @CCDEPMODE@
94 CFLAGS = @CFLAGS@
95 CPP = @CPP@
96 CPPFLAGS = @CPPFLAGS@
97 CYGPATH_W = @CYGPATH_W@
98 DATADIRNAME = @DATADIRNAME@
99 DEFS = @DEFS@
100 DEPDIR = @DEPDIR@
101 DLLTOOL = @DLLTOOL@
102 DSYMUTIL = @DSYMUTIL@
103 DUMPBIN = @DUMPBIN@
104 ECHO_C = @ECHO_C@
105 ECHO_N = @ECHO_N@
106 ECHO_T = @ECHO_T@
107 EGREP = @EGREP@
108 EXEEXT = @EXEEXT@
109 FGREP = @FGREP@
110 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
111 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
112 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
113 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
114 GMODULE2_LIBS = @GMODULE2_LIBS@
115 GMOFILES = @GMOFILES@
116 GMSGFMT = @GMSGFMT@
117 GREP = @GREP@
118 GTK_API_VERSION = @GTK_API_VERSION@
119 GTK_CFLAGS = @GTK_CFLAGS@
120 GTK_LIBS = @GTK_LIBS@
121 GTK_REQUIRED = @GTK_REQUIRED@
122 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
123 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
124 GTK_VNC_LIBS = @GTK_VNC_LIBS@
125 INSTALL = @INSTALL@
126 INSTALL_DATA = @INSTALL_DATA@
127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 INSTALL_SCRIPT = @INSTALL_SCRIPT@
129 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
130 INSTOBJEXT = @INSTOBJEXT@
131 INTLLIBS = @INTLLIBS@
132 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
133 INTLTOOL_MERGE = @INTLTOOL_MERGE@
134 INTLTOOL_PERL = @INTLTOOL_PERL@
135 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
136 LD = @LD@
137 LDFLAGS = @LDFLAGS@
138 LIBOBJS = @LIBOBJS@
139 LIBS = @LIBS@
140 LIBTOOL = @LIBTOOL@
141 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
142 LIBVIRT_LIBS = @LIBVIRT_LIBS@
143 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
144 LIBXML2_LIBS = @LIBXML2_LIBS@
145 LIPO = @LIPO@
146 LN_S = @LN_S@
147 LTLIBOBJS = @LTLIBOBJS@
148 MAKEINFO = @MAKEINFO@
149 MANIFEST_TOOL = @MANIFEST_TOOL@
150 MKDIR_P = @MKDIR_P@
151 MKINSTALLDIRS = @MKINSTALLDIRS@
152 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
153 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
154 MSGFMT = @MSGFMT@
155 MSGFMT_OPTS = @MSGFMT_OPTS@
156 MSGMERGE = @MSGMERGE@
157 NM = @NM@
158 NMEDIT = @NMEDIT@
159 NSPR_CFLAGS = @NSPR_CFLAGS@
160 NSPR_LIBS = @NSPR_LIBS@
161 OBJDUMP = @OBJDUMP@
162 OBJEXT = @OBJEXT@
163 OTOOL = @OTOOL@
164 OTOOL64 = @OTOOL64@
165 PACKAGE = @PACKAGE@
166 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
167 PACKAGE_NAME = @PACKAGE_NAME@
168 PACKAGE_STRING = @PACKAGE_STRING@
169 PACKAGE_TARNAME = @PACKAGE_TARNAME@
170 PACKAGE_URL = @PACKAGE_URL@
171 PACKAGE_VERSION = @PACKAGE_VERSION@
172 PATH_SEPARATOR = @PATH_SEPARATOR@
173 PKG_CONFIG = @PKG_CONFIG@
174 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
175 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
176 POFILES = @POFILES@
177 POSUB = @POSUB@
178 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
179 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
180 RANLIB = @RANLIB@
181 SED = @SED@
182 SET_MAKE = @SET_MAKE@
183 SHELL = @SHELL@
184 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
185 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
186 STRIP = @STRIP@
187 USE_NLS = @USE_NLS@
188 VERSION = @VERSION@
189 WARN_CFLAGS = @WARN_CFLAGS@
190 XGETTEXT = @XGETTEXT@
191 abs_builddir = @abs_builddir@
192 abs_srcdir = @abs_srcdir@
193 abs_top_builddir = @abs_top_builddir@
194 abs_top_srcdir = @abs_top_srcdir@
195 ac_ct_AR = @ac_ct_AR@
196 ac_ct_CC = @ac_ct_CC@
197 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
198 am__include = @am__include@
199 am__leading_dot = @am__leading_dot@
200 am__quote = @am__quote@
201 am__tar = @am__tar@
202 am__untar = @am__untar@
203 bindir = @bindir@
204 build = @build@
205 build_alias = @build_alias@
206 build_cpu = @build_cpu@
207 build_os = @build_os@
208 build_vendor = @build_vendor@
209 builddir = @builddir@
210 datadir = @datadir@
211 datarootdir = @datarootdir@
212 docdir = @docdir@
213 dvidir = @dvidir@
214 exec_prefix = @exec_prefix@
215 host = @host@
216 host_alias = @host_alias@
217 host_cpu = @host_cpu@
218 host_os = @host_os@
219 host_vendor = @host_vendor@
220 htmldir = @htmldir@
221 includedir = @includedir@
222 infodir = @infodir@
223 install_sh = @install_sh@
224 libdir = @libdir@
225 libexecdir = @libexecdir@
226 localedir = @localedir@
227 localstatedir = @localstatedir@
228 mandir = @mandir@
229 mkdir_p = @mkdir_p@
230 oldincludedir = @oldincludedir@
231 pdfdir = @pdfdir@
232 prefix = @prefix@
233 program_transform_name = @program_transform_name@
234 psdir = @psdir@
235 sbindir = @sbindir@
236 sharedstatedir = @sharedstatedir@
237 srcdir = @srcdir@
238 sysconfdir = @sysconfdir@
239 target_alias = @target_alias@
240 top_build_prefix = @top_build_prefix@
241 top_builddir = @top_builddir@
242 top_srcdir = @top_srcdir@
243 size = $(notdir $(PWD))
244 icondir = $(datadir)/icons/hicolor/$(size)/apps/
245 icon_DATA = $(PACKAGE).png
246 EXTRA_DIST = $(icon_DATA)
247 all: all-am
248
249 .SUFFIXES:
250 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
251 @for dep in $?; do \
252 case '$(am__configure_deps)' in \
253 *$$dep*) \
254 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
255 && { if test -f $@; then exit 0; else break; fi; }; \
256 exit 1;; \
257 esac; \
258 done; \
259 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/24x24/Makefile'; \
260 $(am__cd) $(top_srcdir) && \
261 $(AUTOMAKE) --gnu icons/24x24/Makefile
262 .PRECIOUS: Makefile
263 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
264 @case '$?' in \
265 *config.status*) \
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
267 *) \
268 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
269 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
270 esac;
271
272 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
273 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
274
275 $(top_srcdir)/configure: $(am__configure_deps)
276 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
277 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
279 $(am__aclocal_m4_deps):
280
281 mostlyclean-libtool:
282 -rm -f *.lo
283
284 clean-libtool:
285 -rm -rf .libs _libs
286 install-iconDATA: $(icon_DATA)
287 @$(NORMAL_INSTALL)
288 test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)"
289 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
290 for p in $$list; do \
291 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
292 echo "$$d$$p"; \
293 done | $(am__base_list) | \
294 while read files; do \
295 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
296 $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
297 done
298
299 uninstall-iconDATA:
300 @$(NORMAL_UNINSTALL)
301 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
302 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
303 test -n "$$files" || exit 0; \
304 echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \
305 cd "$(DESTDIR)$(icondir)" && rm -f $$files
306 tags: TAGS
307 TAGS:
308
309 ctags: CTAGS
310 CTAGS:
311
312
313 distdir: $(DISTFILES)
314 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
315 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
316 list='$(DISTFILES)'; \
317 dist_files=`for file in $$list; do echo $$file; done | \
318 sed -e "s|^$$srcdirstrip/||;t" \
319 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
320 case $$dist_files in \
321 */*) $(MKDIR_P) `echo "$$dist_files" | \
322 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
323 sort -u` ;; \
324 esac; \
325 for file in $$dist_files; do \
326 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
327 if test -d $$d/$$file; then \
328 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
329 if test -d "$(distdir)/$$file"; then \
330 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
331 fi; \
332 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
333 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
334 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
335 fi; \
336 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
337 else \
338 test -f "$(distdir)/$$file" \
339 || cp -p $$d/$$file "$(distdir)/$$file" \
340 || exit 1; \
341 fi; \
342 done
343 check-am: all-am
344 check: check-am
345 all-am: Makefile $(DATA)
346 installdirs:
347 for dir in "$(DESTDIR)$(icondir)"; do \
348 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
349 done
350 install: install-am
351 install-exec: install-exec-am
352 install-data: install-data-am
353 uninstall: uninstall-am
354
355 install-am: all-am
356 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
357
358 installcheck: installcheck-am
359 install-strip:
360 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
361 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
362 `test -z '$(STRIP)' || \
363 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
364 mostlyclean-generic:
365
366 clean-generic:
367
368 distclean-generic:
369 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
370 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
371
372 maintainer-clean-generic:
373 @echo "This command is intended for maintainers to use"
374 @echo "it deletes files that may require special tools to rebuild."
375 clean: clean-am
376
377 clean-am: clean-generic clean-libtool mostlyclean-am
378
379 distclean: distclean-am
380 -rm -f Makefile
381 distclean-am: clean-am distclean-generic
382
383 dvi: dvi-am
384
385 dvi-am:
386
387 html: html-am
388
389 html-am:
390
391 info: info-am
392
393 info-am:
394
395 install-data-am: install-iconDATA
396
397 install-dvi: install-dvi-am
398
399 install-dvi-am:
400
401 install-exec-am:
402
403 install-html: install-html-am
404
405 install-html-am:
406
407 install-info: install-info-am
408
409 install-info-am:
410
411 install-man:
412
413 install-pdf: install-pdf-am
414
415 install-pdf-am:
416
417 install-ps: install-ps-am
418
419 install-ps-am:
420
421 installcheck-am:
422
423 maintainer-clean: maintainer-clean-am
424 -rm -f Makefile
425 maintainer-clean-am: distclean-am maintainer-clean-generic
426
427 mostlyclean: mostlyclean-am
428
429 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
430
431 pdf: pdf-am
432
433 pdf-am:
434
435 ps: ps-am
436
437 ps-am:
438
439 uninstall-am: uninstall-iconDATA
440
441 .MAKE: install-am install-strip
442
443 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
444 distclean distclean-generic distclean-libtool distdir dvi \
445 dvi-am html html-am info info-am install install-am \
446 install-data install-data-am install-dvi install-dvi-am \
447 install-exec install-exec-am install-html install-html-am \
448 install-iconDATA install-info install-info-am install-man \
449 install-pdf install-pdf-am install-ps install-ps-am \
450 install-strip installcheck installcheck-am installdirs \
451 maintainer-clean maintainer-clean-generic mostlyclean \
452 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
453 uninstall uninstall-am uninstall-iconDATA
454
455
456 # Tell versions [3.59,3.63) of GNU make to not export all variables.
457 # Otherwise a system limit (for SysV at least) may be exceeded.
458 .NOEXPORT:
0 size = $(notdir $(PWD))
1 icondir = $(datadir)/icons/hicolor/$(size)/apps/
2 icon_DATA = $(PACKAGE).png
3
4 EXTRA_DIST = $(icon_DATA)
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = icons/256x256
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 AM_V_GEN = $(am__v_GEN_$(V))
50 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
51 am__v_GEN_0 = @echo " GEN " $@;
52 AM_V_at = $(am__v_at_$(V))
53 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
54 am__v_at_0 = @
55 SOURCES =
56 DIST_SOURCES =
57 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
58 am__vpath_adj = case $$p in \
59 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
60 *) f=$$p;; \
61 esac;
62 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
63 am__install_max = 40
64 am__nobase_strip_setup = \
65 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
66 am__nobase_strip = \
67 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
68 am__nobase_list = $(am__nobase_strip_setup); \
69 for p in $$list; do echo "$$p $$p"; done | \
70 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
71 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
72 if (++n[$$2] == $(am__install_max)) \
73 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
74 END { for (dir in files) print dir, files[dir] }'
75 am__base_list = \
76 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
77 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
78 am__installdirs = "$(DESTDIR)$(icondir)"
79 DATA = $(icon_DATA)
80 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
81 ACLOCAL = @ACLOCAL@
82 ALL_LINGUAS = @ALL_LINGUAS@
83 AMTAR = @AMTAR@
84 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
85 AR = @AR@
86 AUTOCONF = @AUTOCONF@
87 AUTOHEADER = @AUTOHEADER@
88 AUTOMAKE = @AUTOMAKE@
89 AWK = @AWK@
90 CATALOGS = @CATALOGS@
91 CATOBJEXT = @CATOBJEXT@
92 CC = @CC@
93 CCDEPMODE = @CCDEPMODE@
94 CFLAGS = @CFLAGS@
95 CPP = @CPP@
96 CPPFLAGS = @CPPFLAGS@
97 CYGPATH_W = @CYGPATH_W@
98 DATADIRNAME = @DATADIRNAME@
99 DEFS = @DEFS@
100 DEPDIR = @DEPDIR@
101 DLLTOOL = @DLLTOOL@
102 DSYMUTIL = @DSYMUTIL@
103 DUMPBIN = @DUMPBIN@
104 ECHO_C = @ECHO_C@
105 ECHO_N = @ECHO_N@
106 ECHO_T = @ECHO_T@
107 EGREP = @EGREP@
108 EXEEXT = @EXEEXT@
109 FGREP = @FGREP@
110 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
111 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
112 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
113 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
114 GMODULE2_LIBS = @GMODULE2_LIBS@
115 GMOFILES = @GMOFILES@
116 GMSGFMT = @GMSGFMT@
117 GREP = @GREP@
118 GTK_API_VERSION = @GTK_API_VERSION@
119 GTK_CFLAGS = @GTK_CFLAGS@
120 GTK_LIBS = @GTK_LIBS@
121 GTK_REQUIRED = @GTK_REQUIRED@
122 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
123 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
124 GTK_VNC_LIBS = @GTK_VNC_LIBS@
125 INSTALL = @INSTALL@
126 INSTALL_DATA = @INSTALL_DATA@
127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 INSTALL_SCRIPT = @INSTALL_SCRIPT@
129 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
130 INSTOBJEXT = @INSTOBJEXT@
131 INTLLIBS = @INTLLIBS@
132 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
133 INTLTOOL_MERGE = @INTLTOOL_MERGE@
134 INTLTOOL_PERL = @INTLTOOL_PERL@
135 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
136 LD = @LD@
137 LDFLAGS = @LDFLAGS@
138 LIBOBJS = @LIBOBJS@
139 LIBS = @LIBS@
140 LIBTOOL = @LIBTOOL@
141 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
142 LIBVIRT_LIBS = @LIBVIRT_LIBS@
143 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
144 LIBXML2_LIBS = @LIBXML2_LIBS@
145 LIPO = @LIPO@
146 LN_S = @LN_S@
147 LTLIBOBJS = @LTLIBOBJS@
148 MAKEINFO = @MAKEINFO@
149 MANIFEST_TOOL = @MANIFEST_TOOL@
150 MKDIR_P = @MKDIR_P@
151 MKINSTALLDIRS = @MKINSTALLDIRS@
152 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
153 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
154 MSGFMT = @MSGFMT@
155 MSGFMT_OPTS = @MSGFMT_OPTS@
156 MSGMERGE = @MSGMERGE@
157 NM = @NM@
158 NMEDIT = @NMEDIT@
159 NSPR_CFLAGS = @NSPR_CFLAGS@
160 NSPR_LIBS = @NSPR_LIBS@
161 OBJDUMP = @OBJDUMP@
162 OBJEXT = @OBJEXT@
163 OTOOL = @OTOOL@
164 OTOOL64 = @OTOOL64@
165 PACKAGE = @PACKAGE@
166 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
167 PACKAGE_NAME = @PACKAGE_NAME@
168 PACKAGE_STRING = @PACKAGE_STRING@
169 PACKAGE_TARNAME = @PACKAGE_TARNAME@
170 PACKAGE_URL = @PACKAGE_URL@
171 PACKAGE_VERSION = @PACKAGE_VERSION@
172 PATH_SEPARATOR = @PATH_SEPARATOR@
173 PKG_CONFIG = @PKG_CONFIG@
174 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
175 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
176 POFILES = @POFILES@
177 POSUB = @POSUB@
178 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
179 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
180 RANLIB = @RANLIB@
181 SED = @SED@
182 SET_MAKE = @SET_MAKE@
183 SHELL = @SHELL@
184 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
185 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
186 STRIP = @STRIP@
187 USE_NLS = @USE_NLS@
188 VERSION = @VERSION@
189 WARN_CFLAGS = @WARN_CFLAGS@
190 XGETTEXT = @XGETTEXT@
191 abs_builddir = @abs_builddir@
192 abs_srcdir = @abs_srcdir@
193 abs_top_builddir = @abs_top_builddir@
194 abs_top_srcdir = @abs_top_srcdir@
195 ac_ct_AR = @ac_ct_AR@
196 ac_ct_CC = @ac_ct_CC@
197 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
198 am__include = @am__include@
199 am__leading_dot = @am__leading_dot@
200 am__quote = @am__quote@
201 am__tar = @am__tar@
202 am__untar = @am__untar@
203 bindir = @bindir@
204 build = @build@
205 build_alias = @build_alias@
206 build_cpu = @build_cpu@
207 build_os = @build_os@
208 build_vendor = @build_vendor@
209 builddir = @builddir@
210 datadir = @datadir@
211 datarootdir = @datarootdir@
212 docdir = @docdir@
213 dvidir = @dvidir@
214 exec_prefix = @exec_prefix@
215 host = @host@
216 host_alias = @host_alias@
217 host_cpu = @host_cpu@
218 host_os = @host_os@
219 host_vendor = @host_vendor@
220 htmldir = @htmldir@
221 includedir = @includedir@
222 infodir = @infodir@
223 install_sh = @install_sh@
224 libdir = @libdir@
225 libexecdir = @libexecdir@
226 localedir = @localedir@
227 localstatedir = @localstatedir@
228 mandir = @mandir@
229 mkdir_p = @mkdir_p@
230 oldincludedir = @oldincludedir@
231 pdfdir = @pdfdir@
232 prefix = @prefix@
233 program_transform_name = @program_transform_name@
234 psdir = @psdir@
235 sbindir = @sbindir@
236 sharedstatedir = @sharedstatedir@
237 srcdir = @srcdir@
238 sysconfdir = @sysconfdir@
239 target_alias = @target_alias@
240 top_build_prefix = @top_build_prefix@
241 top_builddir = @top_builddir@
242 top_srcdir = @top_srcdir@
243 size = $(notdir $(PWD))
244 icondir = $(datadir)/icons/hicolor/$(size)/apps/
245 icon_DATA = $(PACKAGE).png
246 EXTRA_DIST = $(icon_DATA)
247 all: all-am
248
249 .SUFFIXES:
250 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
251 @for dep in $?; do \
252 case '$(am__configure_deps)' in \
253 *$$dep*) \
254 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
255 && { if test -f $@; then exit 0; else break; fi; }; \
256 exit 1;; \
257 esac; \
258 done; \
259 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/256x256/Makefile'; \
260 $(am__cd) $(top_srcdir) && \
261 $(AUTOMAKE) --gnu icons/256x256/Makefile
262 .PRECIOUS: Makefile
263 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
264 @case '$?' in \
265 *config.status*) \
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
267 *) \
268 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
269 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
270 esac;
271
272 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
273 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
274
275 $(top_srcdir)/configure: $(am__configure_deps)
276 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
277 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
279 $(am__aclocal_m4_deps):
280
281 mostlyclean-libtool:
282 -rm -f *.lo
283
284 clean-libtool:
285 -rm -rf .libs _libs
286 install-iconDATA: $(icon_DATA)
287 @$(NORMAL_INSTALL)
288 test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)"
289 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
290 for p in $$list; do \
291 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
292 echo "$$d$$p"; \
293 done | $(am__base_list) | \
294 while read files; do \
295 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
296 $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
297 done
298
299 uninstall-iconDATA:
300 @$(NORMAL_UNINSTALL)
301 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
302 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
303 test -n "$$files" || exit 0; \
304 echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \
305 cd "$(DESTDIR)$(icondir)" && rm -f $$files
306 tags: TAGS
307 TAGS:
308
309 ctags: CTAGS
310 CTAGS:
311
312
313 distdir: $(DISTFILES)
314 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
315 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
316 list='$(DISTFILES)'; \
317 dist_files=`for file in $$list; do echo $$file; done | \
318 sed -e "s|^$$srcdirstrip/||;t" \
319 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
320 case $$dist_files in \
321 */*) $(MKDIR_P) `echo "$$dist_files" | \
322 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
323 sort -u` ;; \
324 esac; \
325 for file in $$dist_files; do \
326 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
327 if test -d $$d/$$file; then \
328 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
329 if test -d "$(distdir)/$$file"; then \
330 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
331 fi; \
332 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
333 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
334 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
335 fi; \
336 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
337 else \
338 test -f "$(distdir)/$$file" \
339 || cp -p $$d/$$file "$(distdir)/$$file" \
340 || exit 1; \
341 fi; \
342 done
343 check-am: all-am
344 check: check-am
345 all-am: Makefile $(DATA)
346 installdirs:
347 for dir in "$(DESTDIR)$(icondir)"; do \
348 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
349 done
350 install: install-am
351 install-exec: install-exec-am
352 install-data: install-data-am
353 uninstall: uninstall-am
354
355 install-am: all-am
356 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
357
358 installcheck: installcheck-am
359 install-strip:
360 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
361 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
362 `test -z '$(STRIP)' || \
363 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
364 mostlyclean-generic:
365
366 clean-generic:
367
368 distclean-generic:
369 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
370 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
371
372 maintainer-clean-generic:
373 @echo "This command is intended for maintainers to use"
374 @echo "it deletes files that may require special tools to rebuild."
375 clean: clean-am
376
377 clean-am: clean-generic clean-libtool mostlyclean-am
378
379 distclean: distclean-am
380 -rm -f Makefile
381 distclean-am: clean-am distclean-generic
382
383 dvi: dvi-am
384
385 dvi-am:
386
387 html: html-am
388
389 html-am:
390
391 info: info-am
392
393 info-am:
394
395 install-data-am: install-iconDATA
396
397 install-dvi: install-dvi-am
398
399 install-dvi-am:
400
401 install-exec-am:
402
403 install-html: install-html-am
404
405 install-html-am:
406
407 install-info: install-info-am
408
409 install-info-am:
410
411 install-man:
412
413 install-pdf: install-pdf-am
414
415 install-pdf-am:
416
417 install-ps: install-ps-am
418
419 install-ps-am:
420
421 installcheck-am:
422
423 maintainer-clean: maintainer-clean-am
424 -rm -f Makefile
425 maintainer-clean-am: distclean-am maintainer-clean-generic
426
427 mostlyclean: mostlyclean-am
428
429 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
430
431 pdf: pdf-am
432
433 pdf-am:
434
435 ps: ps-am
436
437 ps-am:
438
439 uninstall-am: uninstall-iconDATA
440
441 .MAKE: install-am install-strip
442
443 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
444 distclean distclean-generic distclean-libtool distdir dvi \
445 dvi-am html html-am info info-am install install-am \
446 install-data install-data-am install-dvi install-dvi-am \
447 install-exec install-exec-am install-html install-html-am \
448 install-iconDATA install-info install-info-am install-man \
449 install-pdf install-pdf-am install-ps install-ps-am \
450 install-strip installcheck installcheck-am installdirs \
451 maintainer-clean maintainer-clean-generic mostlyclean \
452 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
453 uninstall uninstall-am uninstall-iconDATA
454
455
456 # Tell versions [3.59,3.63) of GNU make to not export all variables.
457 # Otherwise a system limit (for SysV at least) may be exceeded.
458 .NOEXPORT:
0 size = $(notdir $(PWD))
1 icondir = $(datadir)/icons/hicolor/$(size)/apps/
2 icon_DATA = $(PACKAGE).png
3
4 EXTRA_DIST = $(icon_DATA)
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = icons/32x32
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 AM_V_GEN = $(am__v_GEN_$(V))
50 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
51 am__v_GEN_0 = @echo " GEN " $@;
52 AM_V_at = $(am__v_at_$(V))
53 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
54 am__v_at_0 = @
55 SOURCES =
56 DIST_SOURCES =
57 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
58 am__vpath_adj = case $$p in \
59 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
60 *) f=$$p;; \
61 esac;
62 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
63 am__install_max = 40
64 am__nobase_strip_setup = \
65 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
66 am__nobase_strip = \
67 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
68 am__nobase_list = $(am__nobase_strip_setup); \
69 for p in $$list; do echo "$$p $$p"; done | \
70 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
71 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
72 if (++n[$$2] == $(am__install_max)) \
73 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
74 END { for (dir in files) print dir, files[dir] }'
75 am__base_list = \
76 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
77 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
78 am__installdirs = "$(DESTDIR)$(icondir)"
79 DATA = $(icon_DATA)
80 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
81 ACLOCAL = @ACLOCAL@
82 ALL_LINGUAS = @ALL_LINGUAS@
83 AMTAR = @AMTAR@
84 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
85 AR = @AR@
86 AUTOCONF = @AUTOCONF@
87 AUTOHEADER = @AUTOHEADER@
88 AUTOMAKE = @AUTOMAKE@
89 AWK = @AWK@
90 CATALOGS = @CATALOGS@
91 CATOBJEXT = @CATOBJEXT@
92 CC = @CC@
93 CCDEPMODE = @CCDEPMODE@
94 CFLAGS = @CFLAGS@
95 CPP = @CPP@
96 CPPFLAGS = @CPPFLAGS@
97 CYGPATH_W = @CYGPATH_W@
98 DATADIRNAME = @DATADIRNAME@
99 DEFS = @DEFS@
100 DEPDIR = @DEPDIR@
101 DLLTOOL = @DLLTOOL@
102 DSYMUTIL = @DSYMUTIL@
103 DUMPBIN = @DUMPBIN@
104 ECHO_C = @ECHO_C@
105 ECHO_N = @ECHO_N@
106 ECHO_T = @ECHO_T@
107 EGREP = @EGREP@
108 EXEEXT = @EXEEXT@
109 FGREP = @FGREP@
110 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
111 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
112 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
113 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
114 GMODULE2_LIBS = @GMODULE2_LIBS@
115 GMOFILES = @GMOFILES@
116 GMSGFMT = @GMSGFMT@
117 GREP = @GREP@
118 GTK_API_VERSION = @GTK_API_VERSION@
119 GTK_CFLAGS = @GTK_CFLAGS@
120 GTK_LIBS = @GTK_LIBS@
121 GTK_REQUIRED = @GTK_REQUIRED@
122 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
123 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
124 GTK_VNC_LIBS = @GTK_VNC_LIBS@
125 INSTALL = @INSTALL@
126 INSTALL_DATA = @INSTALL_DATA@
127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 INSTALL_SCRIPT = @INSTALL_SCRIPT@
129 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
130 INSTOBJEXT = @INSTOBJEXT@
131 INTLLIBS = @INTLLIBS@
132 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
133 INTLTOOL_MERGE = @INTLTOOL_MERGE@
134 INTLTOOL_PERL = @INTLTOOL_PERL@
135 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
136 LD = @LD@
137 LDFLAGS = @LDFLAGS@
138 LIBOBJS = @LIBOBJS@
139 LIBS = @LIBS@
140 LIBTOOL = @LIBTOOL@
141 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
142 LIBVIRT_LIBS = @LIBVIRT_LIBS@
143 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
144 LIBXML2_LIBS = @LIBXML2_LIBS@
145 LIPO = @LIPO@
146 LN_S = @LN_S@
147 LTLIBOBJS = @LTLIBOBJS@
148 MAKEINFO = @MAKEINFO@
149 MANIFEST_TOOL = @MANIFEST_TOOL@
150 MKDIR_P = @MKDIR_P@
151 MKINSTALLDIRS = @MKINSTALLDIRS@
152 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
153 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
154 MSGFMT = @MSGFMT@
155 MSGFMT_OPTS = @MSGFMT_OPTS@
156 MSGMERGE = @MSGMERGE@
157 NM = @NM@
158 NMEDIT = @NMEDIT@
159 NSPR_CFLAGS = @NSPR_CFLAGS@
160 NSPR_LIBS = @NSPR_LIBS@
161 OBJDUMP = @OBJDUMP@
162 OBJEXT = @OBJEXT@
163 OTOOL = @OTOOL@
164 OTOOL64 = @OTOOL64@
165 PACKAGE = @PACKAGE@
166 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
167 PACKAGE_NAME = @PACKAGE_NAME@
168 PACKAGE_STRING = @PACKAGE_STRING@
169 PACKAGE_TARNAME = @PACKAGE_TARNAME@
170 PACKAGE_URL = @PACKAGE_URL@
171 PACKAGE_VERSION = @PACKAGE_VERSION@
172 PATH_SEPARATOR = @PATH_SEPARATOR@
173 PKG_CONFIG = @PKG_CONFIG@
174 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
175 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
176 POFILES = @POFILES@
177 POSUB = @POSUB@
178 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
179 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
180 RANLIB = @RANLIB@
181 SED = @SED@
182 SET_MAKE = @SET_MAKE@
183 SHELL = @SHELL@
184 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
185 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
186 STRIP = @STRIP@
187 USE_NLS = @USE_NLS@
188 VERSION = @VERSION@
189 WARN_CFLAGS = @WARN_CFLAGS@
190 XGETTEXT = @XGETTEXT@
191 abs_builddir = @abs_builddir@
192 abs_srcdir = @abs_srcdir@
193 abs_top_builddir = @abs_top_builddir@
194 abs_top_srcdir = @abs_top_srcdir@
195 ac_ct_AR = @ac_ct_AR@
196 ac_ct_CC = @ac_ct_CC@
197 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
198 am__include = @am__include@
199 am__leading_dot = @am__leading_dot@
200 am__quote = @am__quote@
201 am__tar = @am__tar@
202 am__untar = @am__untar@
203 bindir = @bindir@
204 build = @build@
205 build_alias = @build_alias@
206 build_cpu = @build_cpu@
207 build_os = @build_os@
208 build_vendor = @build_vendor@
209 builddir = @builddir@
210 datadir = @datadir@
211 datarootdir = @datarootdir@
212 docdir = @docdir@
213 dvidir = @dvidir@
214 exec_prefix = @exec_prefix@
215 host = @host@
216 host_alias = @host_alias@
217 host_cpu = @host_cpu@
218 host_os = @host_os@
219 host_vendor = @host_vendor@
220 htmldir = @htmldir@
221 includedir = @includedir@
222 infodir = @infodir@
223 install_sh = @install_sh@
224 libdir = @libdir@
225 libexecdir = @libexecdir@
226 localedir = @localedir@
227 localstatedir = @localstatedir@
228 mandir = @mandir@
229 mkdir_p = @mkdir_p@
230 oldincludedir = @oldincludedir@
231 pdfdir = @pdfdir@
232 prefix = @prefix@
233 program_transform_name = @program_transform_name@
234 psdir = @psdir@
235 sbindir = @sbindir@
236 sharedstatedir = @sharedstatedir@
237 srcdir = @srcdir@
238 sysconfdir = @sysconfdir@
239 target_alias = @target_alias@
240 top_build_prefix = @top_build_prefix@
241 top_builddir = @top_builddir@
242 top_srcdir = @top_srcdir@
243 size = $(notdir $(PWD))
244 icondir = $(datadir)/icons/hicolor/$(size)/apps/
245 icon_DATA = $(PACKAGE).png
246 EXTRA_DIST = $(icon_DATA)
247 all: all-am
248
249 .SUFFIXES:
250 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
251 @for dep in $?; do \
252 case '$(am__configure_deps)' in \
253 *$$dep*) \
254 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
255 && { if test -f $@; then exit 0; else break; fi; }; \
256 exit 1;; \
257 esac; \
258 done; \
259 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/32x32/Makefile'; \
260 $(am__cd) $(top_srcdir) && \
261 $(AUTOMAKE) --gnu icons/32x32/Makefile
262 .PRECIOUS: Makefile
263 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
264 @case '$?' in \
265 *config.status*) \
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
267 *) \
268 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
269 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
270 esac;
271
272 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
273 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
274
275 $(top_srcdir)/configure: $(am__configure_deps)
276 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
277 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
279 $(am__aclocal_m4_deps):
280
281 mostlyclean-libtool:
282 -rm -f *.lo
283
284 clean-libtool:
285 -rm -rf .libs _libs
286 install-iconDATA: $(icon_DATA)
287 @$(NORMAL_INSTALL)
288 test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)"
289 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
290 for p in $$list; do \
291 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
292 echo "$$d$$p"; \
293 done | $(am__base_list) | \
294 while read files; do \
295 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
296 $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
297 done
298
299 uninstall-iconDATA:
300 @$(NORMAL_UNINSTALL)
301 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
302 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
303 test -n "$$files" || exit 0; \
304 echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \
305 cd "$(DESTDIR)$(icondir)" && rm -f $$files
306 tags: TAGS
307 TAGS:
308
309 ctags: CTAGS
310 CTAGS:
311
312
313 distdir: $(DISTFILES)
314 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
315 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
316 list='$(DISTFILES)'; \
317 dist_files=`for file in $$list; do echo $$file; done | \
318 sed -e "s|^$$srcdirstrip/||;t" \
319 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
320 case $$dist_files in \
321 */*) $(MKDIR_P) `echo "$$dist_files" | \
322 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
323 sort -u` ;; \
324 esac; \
325 for file in $$dist_files; do \
326 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
327 if test -d $$d/$$file; then \
328 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
329 if test -d "$(distdir)/$$file"; then \
330 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
331 fi; \
332 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
333 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
334 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
335 fi; \
336 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
337 else \
338 test -f "$(distdir)/$$file" \
339 || cp -p $$d/$$file "$(distdir)/$$file" \
340 || exit 1; \
341 fi; \
342 done
343 check-am: all-am
344 check: check-am
345 all-am: Makefile $(DATA)
346 installdirs:
347 for dir in "$(DESTDIR)$(icondir)"; do \
348 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
349 done
350 install: install-am
351 install-exec: install-exec-am
352 install-data: install-data-am
353 uninstall: uninstall-am
354
355 install-am: all-am
356 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
357
358 installcheck: installcheck-am
359 install-strip:
360 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
361 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
362 `test -z '$(STRIP)' || \
363 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
364 mostlyclean-generic:
365
366 clean-generic:
367
368 distclean-generic:
369 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
370 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
371
372 maintainer-clean-generic:
373 @echo "This command is intended for maintainers to use"
374 @echo "it deletes files that may require special tools to rebuild."
375 clean: clean-am
376
377 clean-am: clean-generic clean-libtool mostlyclean-am
378
379 distclean: distclean-am
380 -rm -f Makefile
381 distclean-am: clean-am distclean-generic
382
383 dvi: dvi-am
384
385 dvi-am:
386
387 html: html-am
388
389 html-am:
390
391 info: info-am
392
393 info-am:
394
395 install-data-am: install-iconDATA
396
397 install-dvi: install-dvi-am
398
399 install-dvi-am:
400
401 install-exec-am:
402
403 install-html: install-html-am
404
405 install-html-am:
406
407 install-info: install-info-am
408
409 install-info-am:
410
411 install-man:
412
413 install-pdf: install-pdf-am
414
415 install-pdf-am:
416
417 install-ps: install-ps-am
418
419 install-ps-am:
420
421 installcheck-am:
422
423 maintainer-clean: maintainer-clean-am
424 -rm -f Makefile
425 maintainer-clean-am: distclean-am maintainer-clean-generic
426
427 mostlyclean: mostlyclean-am
428
429 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
430
431 pdf: pdf-am
432
433 pdf-am:
434
435 ps: ps-am
436
437 ps-am:
438
439 uninstall-am: uninstall-iconDATA
440
441 .MAKE: install-am install-strip
442
443 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
444 distclean distclean-generic distclean-libtool distdir dvi \
445 dvi-am html html-am info info-am install install-am \
446 install-data install-data-am install-dvi install-dvi-am \
447 install-exec install-exec-am install-html install-html-am \
448 install-iconDATA install-info install-info-am install-man \
449 install-pdf install-pdf-am install-ps install-ps-am \
450 install-strip installcheck installcheck-am installdirs \
451 maintainer-clean maintainer-clean-generic mostlyclean \
452 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
453 uninstall uninstall-am uninstall-iconDATA
454
455
456 # Tell versions [3.59,3.63) of GNU make to not export all variables.
457 # Otherwise a system limit (for SysV at least) may be exceeded.
458 .NOEXPORT:
0 size = $(notdir $(PWD))
1 icondir = $(datadir)/icons/hicolor/$(size)/apps/
2 icon_DATA = $(PACKAGE).png
3
4 EXTRA_DIST = $(icon_DATA)
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = icons/48x48
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 AM_V_GEN = $(am__v_GEN_$(V))
50 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
51 am__v_GEN_0 = @echo " GEN " $@;
52 AM_V_at = $(am__v_at_$(V))
53 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
54 am__v_at_0 = @
55 SOURCES =
56 DIST_SOURCES =
57 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
58 am__vpath_adj = case $$p in \
59 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
60 *) f=$$p;; \
61 esac;
62 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
63 am__install_max = 40
64 am__nobase_strip_setup = \
65 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
66 am__nobase_strip = \
67 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
68 am__nobase_list = $(am__nobase_strip_setup); \
69 for p in $$list; do echo "$$p $$p"; done | \
70 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
71 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
72 if (++n[$$2] == $(am__install_max)) \
73 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
74 END { for (dir in files) print dir, files[dir] }'
75 am__base_list = \
76 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
77 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
78 am__installdirs = "$(DESTDIR)$(icondir)"
79 DATA = $(icon_DATA)
80 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
81 ACLOCAL = @ACLOCAL@
82 ALL_LINGUAS = @ALL_LINGUAS@
83 AMTAR = @AMTAR@
84 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
85 AR = @AR@
86 AUTOCONF = @AUTOCONF@
87 AUTOHEADER = @AUTOHEADER@
88 AUTOMAKE = @AUTOMAKE@
89 AWK = @AWK@
90 CATALOGS = @CATALOGS@
91 CATOBJEXT = @CATOBJEXT@
92 CC = @CC@
93 CCDEPMODE = @CCDEPMODE@
94 CFLAGS = @CFLAGS@
95 CPP = @CPP@
96 CPPFLAGS = @CPPFLAGS@
97 CYGPATH_W = @CYGPATH_W@
98 DATADIRNAME = @DATADIRNAME@
99 DEFS = @DEFS@
100 DEPDIR = @DEPDIR@
101 DLLTOOL = @DLLTOOL@
102 DSYMUTIL = @DSYMUTIL@
103 DUMPBIN = @DUMPBIN@
104 ECHO_C = @ECHO_C@
105 ECHO_N = @ECHO_N@
106 ECHO_T = @ECHO_T@
107 EGREP = @EGREP@
108 EXEEXT = @EXEEXT@
109 FGREP = @FGREP@
110 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
111 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
112 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
113 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
114 GMODULE2_LIBS = @GMODULE2_LIBS@
115 GMOFILES = @GMOFILES@
116 GMSGFMT = @GMSGFMT@
117 GREP = @GREP@
118 GTK_API_VERSION = @GTK_API_VERSION@
119 GTK_CFLAGS = @GTK_CFLAGS@
120 GTK_LIBS = @GTK_LIBS@
121 GTK_REQUIRED = @GTK_REQUIRED@
122 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
123 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
124 GTK_VNC_LIBS = @GTK_VNC_LIBS@
125 INSTALL = @INSTALL@
126 INSTALL_DATA = @INSTALL_DATA@
127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 INSTALL_SCRIPT = @INSTALL_SCRIPT@
129 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
130 INSTOBJEXT = @INSTOBJEXT@
131 INTLLIBS = @INTLLIBS@
132 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
133 INTLTOOL_MERGE = @INTLTOOL_MERGE@
134 INTLTOOL_PERL = @INTLTOOL_PERL@
135 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
136 LD = @LD@
137 LDFLAGS = @LDFLAGS@
138 LIBOBJS = @LIBOBJS@
139 LIBS = @LIBS@
140 LIBTOOL = @LIBTOOL@
141 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
142 LIBVIRT_LIBS = @LIBVIRT_LIBS@
143 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
144 LIBXML2_LIBS = @LIBXML2_LIBS@
145 LIPO = @LIPO@
146 LN_S = @LN_S@
147 LTLIBOBJS = @LTLIBOBJS@
148 MAKEINFO = @MAKEINFO@
149 MANIFEST_TOOL = @MANIFEST_TOOL@
150 MKDIR_P = @MKDIR_P@
151 MKINSTALLDIRS = @MKINSTALLDIRS@
152 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
153 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
154 MSGFMT = @MSGFMT@
155 MSGFMT_OPTS = @MSGFMT_OPTS@
156 MSGMERGE = @MSGMERGE@
157 NM = @NM@
158 NMEDIT = @NMEDIT@
159 NSPR_CFLAGS = @NSPR_CFLAGS@
160 NSPR_LIBS = @NSPR_LIBS@
161 OBJDUMP = @OBJDUMP@
162 OBJEXT = @OBJEXT@
163 OTOOL = @OTOOL@
164 OTOOL64 = @OTOOL64@
165 PACKAGE = @PACKAGE@
166 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
167 PACKAGE_NAME = @PACKAGE_NAME@
168 PACKAGE_STRING = @PACKAGE_STRING@
169 PACKAGE_TARNAME = @PACKAGE_TARNAME@
170 PACKAGE_URL = @PACKAGE_URL@
171 PACKAGE_VERSION = @PACKAGE_VERSION@
172 PATH_SEPARATOR = @PATH_SEPARATOR@
173 PKG_CONFIG = @PKG_CONFIG@
174 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
175 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
176 POFILES = @POFILES@
177 POSUB = @POSUB@
178 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
179 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
180 RANLIB = @RANLIB@
181 SED = @SED@
182 SET_MAKE = @SET_MAKE@
183 SHELL = @SHELL@
184 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
185 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
186 STRIP = @STRIP@
187 USE_NLS = @USE_NLS@
188 VERSION = @VERSION@
189 WARN_CFLAGS = @WARN_CFLAGS@
190 XGETTEXT = @XGETTEXT@
191 abs_builddir = @abs_builddir@
192 abs_srcdir = @abs_srcdir@
193 abs_top_builddir = @abs_top_builddir@
194 abs_top_srcdir = @abs_top_srcdir@
195 ac_ct_AR = @ac_ct_AR@
196 ac_ct_CC = @ac_ct_CC@
197 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
198 am__include = @am__include@
199 am__leading_dot = @am__leading_dot@
200 am__quote = @am__quote@
201 am__tar = @am__tar@
202 am__untar = @am__untar@
203 bindir = @bindir@
204 build = @build@
205 build_alias = @build_alias@
206 build_cpu = @build_cpu@
207 build_os = @build_os@
208 build_vendor = @build_vendor@
209 builddir = @builddir@
210 datadir = @datadir@
211 datarootdir = @datarootdir@
212 docdir = @docdir@
213 dvidir = @dvidir@
214 exec_prefix = @exec_prefix@
215 host = @host@
216 host_alias = @host_alias@
217 host_cpu = @host_cpu@
218 host_os = @host_os@
219 host_vendor = @host_vendor@
220 htmldir = @htmldir@
221 includedir = @includedir@
222 infodir = @infodir@
223 install_sh = @install_sh@
224 libdir = @libdir@
225 libexecdir = @libexecdir@
226 localedir = @localedir@
227 localstatedir = @localstatedir@
228 mandir = @mandir@
229 mkdir_p = @mkdir_p@
230 oldincludedir = @oldincludedir@
231 pdfdir = @pdfdir@
232 prefix = @prefix@
233 program_transform_name = @program_transform_name@
234 psdir = @psdir@
235 sbindir = @sbindir@
236 sharedstatedir = @sharedstatedir@
237 srcdir = @srcdir@
238 sysconfdir = @sysconfdir@
239 target_alias = @target_alias@
240 top_build_prefix = @top_build_prefix@
241 top_builddir = @top_builddir@
242 top_srcdir = @top_srcdir@
243 size = $(notdir $(PWD))
244 icondir = $(datadir)/icons/hicolor/$(size)/apps/
245 icon_DATA = $(PACKAGE).png
246 EXTRA_DIST = $(icon_DATA)
247 all: all-am
248
249 .SUFFIXES:
250 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
251 @for dep in $?; do \
252 case '$(am__configure_deps)' in \
253 *$$dep*) \
254 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
255 && { if test -f $@; then exit 0; else break; fi; }; \
256 exit 1;; \
257 esac; \
258 done; \
259 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/48x48/Makefile'; \
260 $(am__cd) $(top_srcdir) && \
261 $(AUTOMAKE) --gnu icons/48x48/Makefile
262 .PRECIOUS: Makefile
263 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
264 @case '$?' in \
265 *config.status*) \
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
267 *) \
268 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
269 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
270 esac;
271
272 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
273 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
274
275 $(top_srcdir)/configure: $(am__configure_deps)
276 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
277 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
279 $(am__aclocal_m4_deps):
280
281 mostlyclean-libtool:
282 -rm -f *.lo
283
284 clean-libtool:
285 -rm -rf .libs _libs
286 install-iconDATA: $(icon_DATA)
287 @$(NORMAL_INSTALL)
288 test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)"
289 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
290 for p in $$list; do \
291 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
292 echo "$$d$$p"; \
293 done | $(am__base_list) | \
294 while read files; do \
295 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
296 $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
297 done
298
299 uninstall-iconDATA:
300 @$(NORMAL_UNINSTALL)
301 @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
302 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
303 test -n "$$files" || exit 0; \
304 echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \
305 cd "$(DESTDIR)$(icondir)" && rm -f $$files
306 tags: TAGS
307 TAGS:
308
309 ctags: CTAGS
310 CTAGS:
311
312
313 distdir: $(DISTFILES)
314 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
315 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
316 list='$(DISTFILES)'; \
317 dist_files=`for file in $$list; do echo $$file; done | \
318 sed -e "s|^$$srcdirstrip/||;t" \
319 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
320 case $$dist_files in \
321 */*) $(MKDIR_P) `echo "$$dist_files" | \
322 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
323 sort -u` ;; \
324 esac; \
325 for file in $$dist_files; do \
326 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
327 if test -d $$d/$$file; then \
328 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
329 if test -d "$(distdir)/$$file"; then \
330 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
331 fi; \
332 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
333 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
334 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
335 fi; \
336 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
337 else \
338 test -f "$(distdir)/$$file" \
339 || cp -p $$d/$$file "$(distdir)/$$file" \
340 || exit 1; \
341 fi; \
342 done
343 check-am: all-am
344 check: check-am
345 all-am: Makefile $(DATA)
346 installdirs:
347 for dir in "$(DESTDIR)$(icondir)"; do \
348 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
349 done
350 install: install-am
351 install-exec: install-exec-am
352 install-data: install-data-am
353 uninstall: uninstall-am
354
355 install-am: all-am
356 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
357
358 installcheck: installcheck-am
359 install-strip:
360 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
361 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
362 `test -z '$(STRIP)' || \
363 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
364 mostlyclean-generic:
365
366 clean-generic:
367
368 distclean-generic:
369 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
370 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
371
372 maintainer-clean-generic:
373 @echo "This command is intended for maintainers to use"
374 @echo "it deletes files that may require special tools to rebuild."
375 clean: clean-am
376
377 clean-am: clean-generic clean-libtool mostlyclean-am
378
379 distclean: distclean-am
380 -rm -f Makefile
381 distclean-am: clean-am distclean-generic
382
383 dvi: dvi-am
384
385 dvi-am:
386
387 html: html-am
388
389 html-am:
390
391 info: info-am
392
393 info-am:
394
395 install-data-am: install-iconDATA
396
397 install-dvi: install-dvi-am
398
399 install-dvi-am:
400
401 install-exec-am:
402
403 install-html: install-html-am
404
405 install-html-am:
406
407 install-info: install-info-am
408
409 install-info-am:
410
411 install-man:
412
413 install-pdf: install-pdf-am
414
415 install-pdf-am:
416
417 install-ps: install-ps-am
418
419 install-ps-am:
420
421 installcheck-am:
422
423 maintainer-clean: maintainer-clean-am
424 -rm -f Makefile
425 maintainer-clean-am: distclean-am maintainer-clean-generic
426
427 mostlyclean: mostlyclean-am
428
429 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
430
431 pdf: pdf-am
432
433 pdf-am:
434
435 ps: ps-am
436
437 ps-am:
438
439 uninstall-am: uninstall-iconDATA
440
441 .MAKE: install-am install-strip
442
443 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
444 distclean distclean-generic distclean-libtool distdir dvi \
445 dvi-am html html-am info info-am install install-am \
446 install-data install-data-am install-dvi install-dvi-am \
447 install-exec install-exec-am install-html install-html-am \
448 install-iconDATA install-info install-info-am install-man \
449 install-pdf install-pdf-am install-ps install-ps-am \
450 install-strip installcheck installcheck-am installdirs \
451 maintainer-clean maintainer-clean-generic mostlyclean \
452 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
453 uninstall uninstall-am uninstall-iconDATA
454
455
456 # Tell versions [3.59,3.63) of GNU make to not export all variables.
457 # Otherwise a system limit (for SysV at least) may be exceeded.
458 .NOEXPORT:
0 SUBDIRS = 16x16 22x22 24x24 32x32 48x48 256x256
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 pkgdatadir = $(datadir)/@PACKAGE@
18 pkgincludedir = $(includedir)/@PACKAGE@
19 pkglibdir = $(libdir)/@PACKAGE@
20 pkglibexecdir = $(libexecdir)/@PACKAGE@
21 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22 install_sh_DATA = $(install_sh) -c -m 644
23 install_sh_PROGRAM = $(install_sh) -c
24 install_sh_SCRIPT = $(install_sh) -c
25 INSTALL_HEADER = $(INSTALL_DATA)
26 transform = $(program_transform_name)
27 NORMAL_INSTALL = :
28 PRE_INSTALL = :
29 POST_INSTALL = :
30 NORMAL_UNINSTALL = :
31 PRE_UNINSTALL = :
32 POST_UNINSTALL = :
33 build_triplet = @build@
34 host_triplet = @host@
35 subdir = icons
36 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
39 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
40 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
41 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
42 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
43 $(ACLOCAL_M4)
44 mkinstalldirs = $(install_sh) -d
45 CONFIG_HEADER = $(top_builddir)/config.h
46 CONFIG_CLEAN_FILES =
47 CONFIG_CLEAN_VPATH_FILES =
48 AM_V_GEN = $(am__v_GEN_$(V))
49 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
50 am__v_GEN_0 = @echo " GEN " $@;
51 AM_V_at = $(am__v_at_$(V))
52 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
53 am__v_at_0 = @
54 SOURCES =
55 DIST_SOURCES =
56 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
57 html-recursive info-recursive install-data-recursive \
58 install-dvi-recursive install-exec-recursive \
59 install-html-recursive install-info-recursive \
60 install-pdf-recursive install-ps-recursive install-recursive \
61 installcheck-recursive installdirs-recursive pdf-recursive \
62 ps-recursive uninstall-recursive
63 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
64 distclean-recursive maintainer-clean-recursive
65 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
66 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
67 distdir
68 ETAGS = etags
69 CTAGS = ctags
70 DIST_SUBDIRS = $(SUBDIRS)
71 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
72 am__relativize = \
73 dir0=`pwd`; \
74 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
75 sed_rest='s,^[^/]*/*,,'; \
76 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
77 sed_butlast='s,/*[^/]*$$,,'; \
78 while test -n "$$dir1"; do \
79 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
80 if test "$$first" != "."; then \
81 if test "$$first" = ".."; then \
82 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
83 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
84 else \
85 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
86 if test "$$first2" = "$$first"; then \
87 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
88 else \
89 dir2="../$$dir2"; \
90 fi; \
91 dir0="$$dir0"/"$$first"; \
92 fi; \
93 fi; \
94 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
95 done; \
96 reldir="$$dir2"
97 ACLOCAL = @ACLOCAL@
98 ALL_LINGUAS = @ALL_LINGUAS@
99 AMTAR = @AMTAR@
100 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
101 AR = @AR@
102 AUTOCONF = @AUTOCONF@
103 AUTOHEADER = @AUTOHEADER@
104 AUTOMAKE = @AUTOMAKE@
105 AWK = @AWK@
106 CATALOGS = @CATALOGS@
107 CATOBJEXT = @CATOBJEXT@
108 CC = @CC@
109 CCDEPMODE = @CCDEPMODE@
110 CFLAGS = @CFLAGS@
111 CPP = @CPP@
112 CPPFLAGS = @CPPFLAGS@
113 CYGPATH_W = @CYGPATH_W@
114 DATADIRNAME = @DATADIRNAME@
115 DEFS = @DEFS@
116 DEPDIR = @DEPDIR@
117 DLLTOOL = @DLLTOOL@
118 DSYMUTIL = @DSYMUTIL@
119 DUMPBIN = @DUMPBIN@
120 ECHO_C = @ECHO_C@
121 ECHO_N = @ECHO_N@
122 ECHO_T = @ECHO_T@
123 EGREP = @EGREP@
124 EXEEXT = @EXEEXT@
125 FGREP = @FGREP@
126 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
127 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
128 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
129 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
130 GMODULE2_LIBS = @GMODULE2_LIBS@
131 GMOFILES = @GMOFILES@
132 GMSGFMT = @GMSGFMT@
133 GREP = @GREP@
134 GTK_API_VERSION = @GTK_API_VERSION@
135 GTK_CFLAGS = @GTK_CFLAGS@
136 GTK_LIBS = @GTK_LIBS@
137 GTK_REQUIRED = @GTK_REQUIRED@
138 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
139 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
140 GTK_VNC_LIBS = @GTK_VNC_LIBS@
141 INSTALL = @INSTALL@
142 INSTALL_DATA = @INSTALL_DATA@
143 INSTALL_PROGRAM = @INSTALL_PROGRAM@
144 INSTALL_SCRIPT = @INSTALL_SCRIPT@
145 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
146 INSTOBJEXT = @INSTOBJEXT@
147 INTLLIBS = @INTLLIBS@
148 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
149 INTLTOOL_MERGE = @INTLTOOL_MERGE@
150 INTLTOOL_PERL = @INTLTOOL_PERL@
151 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
152 LD = @LD@
153 LDFLAGS = @LDFLAGS@
154 LIBOBJS = @LIBOBJS@
155 LIBS = @LIBS@
156 LIBTOOL = @LIBTOOL@
157 LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@
158 LIBVIRT_LIBS = @LIBVIRT_LIBS@
159 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
160 LIBXML2_LIBS = @LIBXML2_LIBS@
161 LIPO = @LIPO@
162 LN_S = @LN_S@
163 LTLIBOBJS = @LTLIBOBJS@
164 MAKEINFO = @MAKEINFO@
165 MANIFEST_TOOL = @MANIFEST_TOOL@
166 MKDIR_P = @MKDIR_P@
167 MKINSTALLDIRS = @MKINSTALLDIRS@
168 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
169 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
170 MSGFMT = @MSGFMT@
171 MSGFMT_OPTS = @MSGFMT_OPTS@
172 MSGMERGE = @MSGMERGE@
173 NM = @NM@
174 NMEDIT = @NMEDIT@
175 NSPR_CFLAGS = @NSPR_CFLAGS@
176 NSPR_LIBS = @NSPR_LIBS@
177 OBJDUMP = @OBJDUMP@
178 OBJEXT = @OBJEXT@
179 OTOOL = @OTOOL@
180 OTOOL64 = @OTOOL64@
181 PACKAGE = @PACKAGE@
182 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
183 PACKAGE_NAME = @PACKAGE_NAME@
184 PACKAGE_STRING = @PACKAGE_STRING@
185 PACKAGE_TARNAME = @PACKAGE_TARNAME@
186 PACKAGE_URL = @PACKAGE_URL@
187 PACKAGE_VERSION = @PACKAGE_VERSION@
188 PATH_SEPARATOR = @PATH_SEPARATOR@
189 PKG_CONFIG = @PKG_CONFIG@
190 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
191 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
192 POFILES = @POFILES@
193 POSUB = @POSUB@
194 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
195 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
196 RANLIB = @RANLIB@
197 SED = @SED@
198 SET_MAKE = @SET_MAKE@
199 SHELL = @SHELL@
200 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
201 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
202 STRIP = @STRIP@
203 USE_NLS = @USE_NLS@
204 VERSION = @VERSION@
205 WARN_CFLAGS = @WARN_CFLAGS@
206 XGETTEXT = @XGETTEXT@
207 abs_builddir = @abs_builddir@
208 abs_srcdir = @abs_srcdir@
209 abs_top_builddir = @abs_top_builddir@
210 abs_top_srcdir = @abs_top_srcdir@
211 ac_ct_AR = @ac_ct_AR@
212 ac_ct_CC = @ac_ct_CC@
213 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
214 am__include = @am__include@
215 am__leading_dot = @am__leading_dot@
216 am__quote = @am__quote@
217 am__tar = @am__tar@
218 am__untar = @am__untar@
219 bindir = @bindir@
220 build = @build@
221 build_alias = @build_alias@
222 build_cpu = @build_cpu@
223 build_os = @build_os@
224 build_vendor = @build_vendor@
225 builddir = @builddir@
226 datadir = @datadir@
227 datarootdir = @datarootdir@
228 docdir = @docdir@
229 dvidir = @dvidir@
230 exec_prefix = @exec_prefix@
231 host = @host@
232 host_alias = @host_alias@
233 host_cpu = @host_cpu@
234 host_os = @host_os@
235 host_vendor = @host_vendor@
236 htmldir = @htmldir@
237 includedir = @includedir@
238 infodir = @infodir@
239 install_sh = @install_sh@
240 libdir = @libdir@
241 libexecdir = @libexecdir@
242 localedir = @localedir@
243 localstatedir = @localstatedir@
244 mandir = @mandir@
245 mkdir_p = @mkdir_p@
246 oldincludedir = @oldincludedir@
247 pdfdir = @pdfdir@
248 prefix = @prefix@
249 program_transform_name = @program_transform_name@
250 psdir = @psdir@
251 sbindir = @sbindir@
252 sharedstatedir = @sharedstatedir@
253 srcdir = @srcdir@
254 sysconfdir = @sysconfdir@
255 target_alias = @target_alias@
256 top_build_prefix = @top_build_prefix@
257 top_builddir = @top_builddir@
258 top_srcdir = @top_srcdir@
259 SUBDIRS = 16x16 22x22 24x24 32x32 48x48 256x256
260 all: all-recursive
261
262 .SUFFIXES:
263 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
264 @for dep in $?; do \
265 case '$(am__configure_deps)' in \
266 *$$dep*) \
267 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
268 && { if test -f $@; then exit 0; else break; fi; }; \
269 exit 1;; \
270 esac; \
271 done; \
272 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/Makefile'; \
273 $(am__cd) $(top_srcdir) && \
274 $(AUTOMAKE) --gnu icons/Makefile
275 .PRECIOUS: Makefile
276 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
277 @case '$?' in \
278 *config.status*) \
279 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
280 *) \
281 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
282 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
283 esac;
284
285 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
286 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
287
288 $(top_srcdir)/configure: $(am__configure_deps)
289 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
290 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
291 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
292 $(am__aclocal_m4_deps):
293
294 mostlyclean-libtool:
295 -rm -f *.lo
296
297 clean-libtool:
298 -rm -rf .libs _libs
299
300 # This directory's subdirectories are mostly independent; you can cd
301 # into them and run `make' without going through this Makefile.
302 # To change the values of `make' variables: instead of editing Makefiles,
303 # (1) if the variable is set in `config.status', edit `config.status'
304 # (which will cause the Makefiles to be regenerated when you run `make');
305 # (2) otherwise, pass the desired values on the `make' command line.
306 $(RECURSIVE_TARGETS):
307 @fail= failcom='exit 1'; \
308 for f in x $$MAKEFLAGS; do \
309 case $$f in \
310 *=* | --[!k]*);; \
311 *k*) failcom='fail=yes';; \
312 esac; \
313 done; \
314 dot_seen=no; \
315 target=`echo $@ | sed s/-recursive//`; \
316 list='$(SUBDIRS)'; for subdir in $$list; do \
317 echo "Making $$target in $$subdir"; \
318 if test "$$subdir" = "."; then \
319 dot_seen=yes; \
320 local_target="$$target-am"; \
321 else \
322 local_target="$$target"; \
323 fi; \
324 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
325 || eval $$failcom; \
326 done; \
327 if test "$$dot_seen" = "no"; then \
328 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
329 fi; test -z "$$fail"
330
331 $(RECURSIVE_CLEAN_TARGETS):
332 @fail= failcom='exit 1'; \
333 for f in x $$MAKEFLAGS; do \
334 case $$f in \
335 *=* | --[!k]*);; \
336 *k*) failcom='fail=yes';; \
337 esac; \
338 done; \
339 dot_seen=no; \
340 case "$@" in \
341 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
342 *) list='$(SUBDIRS)' ;; \
343 esac; \
344 rev=''; for subdir in $$list; do \
345 if test "$$subdir" = "."; then :; else \
346 rev="$$subdir $$rev"; \
347 fi; \
348 done; \
349 rev="$$rev ."; \
350 target=`echo $@ | sed s/-recursive//`; \
351 for subdir in $$rev; do \
352 echo "Making $$target in $$subdir"; \
353 if test "$$subdir" = "."; then \
354 local_target="$$target-am"; \
355 else \
356 local_target="$$target"; \
357 fi; \
358 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
359 || eval $$failcom; \
360 done && test -z "$$fail"
361 tags-recursive:
362 list='$(SUBDIRS)'; for subdir in $$list; do \
363 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
364 done
365 ctags-recursive:
366 list='$(SUBDIRS)'; for subdir in $$list; do \
367 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
368 done
369
370 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
371 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
372 unique=`for i in $$list; do \
373 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
374 done | \
375 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
376 END { if (nonempty) { for (i in files) print i; }; }'`; \
377 mkid -fID $$unique
378 tags: TAGS
379
380 TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
381 $(TAGS_FILES) $(LISP)
382 set x; \
383 here=`pwd`; \
384 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
385 include_option=--etags-include; \
386 empty_fix=.; \
387 else \
388 include_option=--include; \
389 empty_fix=; \
390 fi; \
391 list='$(SUBDIRS)'; for subdir in $$list; do \
392 if test "$$subdir" = .; then :; else \
393 test ! -f $$subdir/TAGS || \
394 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
395 fi; \
396 done; \
397 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
398 unique=`for i in $$list; do \
399 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
400 done | \
401 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
402 END { if (nonempty) { for (i in files) print i; }; }'`; \
403 shift; \
404 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
405 test -n "$$unique" || unique=$$empty_fix; \
406 if test $$# -gt 0; then \
407 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
408 "$$@" $$unique; \
409 else \
410 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
411 $$unique; \
412 fi; \
413 fi
414 ctags: CTAGS
415 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
416 $(TAGS_FILES) $(LISP)
417 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
418 unique=`for i in $$list; do \
419 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
420 done | \
421 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
422 END { if (nonempty) { for (i in files) print i; }; }'`; \
423 test -z "$(CTAGS_ARGS)$$unique" \
424 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
425 $$unique
426
427 GTAGS:
428 here=`$(am__cd) $(top_builddir) && pwd` \
429 && $(am__cd) $(top_srcdir) \
430 && gtags -i $(GTAGS_ARGS) "$$here"
431
432 distclean-tags:
433 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
434
435 distdir: $(DISTFILES)
436 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
437 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
438 list='$(DISTFILES)'; \
439 dist_files=`for file in $$list; do echo $$file; done | \
440 sed -e "s|^$$srcdirstrip/||;t" \
441 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
442 case $$dist_files in \
443 */*) $(MKDIR_P) `echo "$$dist_files" | \
444 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
445 sort -u` ;; \
446 esac; \
447 for file in $$dist_files; do \
448 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
449 if test -d $$d/$$file; then \
450 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
451 if test -d "$(distdir)/$$file"; then \
452 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
453 fi; \
454 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
455 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
456 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
457 fi; \
458 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
459 else \
460 test -f "$(distdir)/$$file" \
461 || cp -p $$d/$$file "$(distdir)/$$file" \
462 || exit 1; \
463 fi; \
464 done
465 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
466 if test "$$subdir" = .; then :; else \
467 test -d "$(distdir)/$$subdir" \
468 || $(MKDIR_P) "$(distdir)/$$subdir" \
469 || exit 1; \
470 fi; \
471 done
472 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
473 if test "$$subdir" = .; then :; else \
474 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
475 $(am__relativize); \
476 new_distdir=$$reldir; \
477 dir1=$$subdir; dir2="$(top_distdir)"; \
478 $(am__relativize); \
479 new_top_distdir=$$reldir; \
480 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
481 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
482 ($(am__cd) $$subdir && \
483 $(MAKE) $(AM_MAKEFLAGS) \
484 top_distdir="$$new_top_distdir" \
485 distdir="$$new_distdir" \
486 am__remove_distdir=: \
487 am__skip_length_check=: \
488 am__skip_mode_fix=: \
489 distdir) \
490 || exit 1; \
491 fi; \
492 done
493 check-am: all-am
494 check: check-recursive
495 all-am: Makefile
496 installdirs: installdirs-recursive
497 installdirs-am:
498 install: install-recursive
499 install-exec: install-exec-recursive
500 install-data: install-data-recursive
501 uninstall: uninstall-recursive
502
503 install-am: all-am
504 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
505
506 installcheck: installcheck-recursive
507 install-strip:
508 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
509 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
510 `test -z '$(STRIP)' || \
511 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
512 mostlyclean-generic:
513
514 clean-generic:
515
516 distclean-generic:
517 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
518 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
519
520 maintainer-clean-generic:
521 @echo "This command is intended for maintainers to use"
522 @echo "it deletes files that may require special tools to rebuild."
523 clean: clean-recursive
524
525 clean-am: clean-generic clean-libtool mostlyclean-am
526
527 distclean: distclean-recursive
528 -rm -f Makefile
529 distclean-am: clean-am distclean-generic distclean-tags
530
531 dvi: dvi-recursive
532
533 dvi-am:
534
535 html: html-recursive
536
537 html-am:
538
539 info: info-recursive
540
541 info-am:
542
543 install-data-am:
544
545 install-dvi: install-dvi-recursive
546
547 install-dvi-am:
548
549 install-exec-am:
550
551 install-html: install-html-recursive
552
553 install-html-am:
554
555 install-info: install-info-recursive
556
557 install-info-am:
558
559 install-man:
560
561 install-pdf: install-pdf-recursive
562
563 install-pdf-am:
564
565 install-ps: install-ps-recursive
566
567 install-ps-am:
568
569 installcheck-am:
570
571 maintainer-clean: maintainer-clean-recursive
572 -rm -f Makefile
573 maintainer-clean-am: distclean-am maintainer-clean-generic
574
575 mostlyclean: mostlyclean-recursive
576
577 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
578
579 pdf: pdf-recursive
580
581 pdf-am:
582
583 ps: ps-recursive
584
585 ps-am:
586
587 uninstall-am:
588
589 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
590 install-am install-strip tags-recursive
591
592 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
593 all all-am check check-am clean clean-generic clean-libtool \
594 ctags ctags-recursive distclean distclean-generic \
595 distclean-libtool distclean-tags distdir dvi dvi-am html \
596 html-am info info-am install install-am install-data \
597 install-data-am install-dvi install-dvi-am install-exec \
598 install-exec-am install-html install-html-am install-info \
599 install-info-am install-man install-pdf install-pdf-am \
600 install-ps install-ps-am install-strip installcheck \
601 installcheck-am installdirs installdirs-am maintainer-clean \
602 maintainer-clean-generic mostlyclean mostlyclean-generic \
603 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
604 uninstall uninstall-am
605
606
607 # Tell versions [3.59,3.63) of GNU make to not export all variables.
608 # Otherwise a system limit (for SysV at least) may be exceeded.
609 .NOEXPORT:
0 # -*-Makefile-*-
1 # This Makefile fragment tries to be general-purpose enough to be
2 # used by many projects via the gnulib maintainer-makefile module.
3
4 ## Copyright (C) 2001-2011 Free Software Foundation, Inc.
5 ##
6 ## This program is free software: you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation, either version 3 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 # This is reported not to work with make-3.79.1
20 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
21 ME := maint.mk
22
23 # Diagnostic for continued use of deprecated variable.
24 # Remove in 2013
25 ifneq ($(build_aux),)
26 $(error "$(ME): \
27 set $$(_build-aux) relative to $$(srcdir) instead of $$(build_aux)")
28 endif
29
30 # Do not save the original name or timestamp in the .tar.gz file.
31 # Use --rsyncable if available.
32 gzip_rsyncable := \
33 $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \
34 && printf %s --rsyncable)
35 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
36
37 GIT = git
38 VC = $(GIT)
39
40 VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
41
42 # You can override this variable in cfg.mk to set your own regexp
43 # matching files to ignore.
44 VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
45
46 # This is to preprocess robustly the output of $(VC_LIST), so that even
47 # when $(srcdir) is a pathological name like "....", the leading sed command
48 # removes only the intended prefix.
49 _dot_escaped_srcdir = $(subst .,\.,$(srcdir))
50
51 # Post-process $(VC_LIST) output, prepending $(srcdir)/, but only
52 # when $(srcdir) is not ".".
53 ifeq ($(srcdir),.)
54 _prepend_srcdir_prefix =
55 else
56 _prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|'
57 endif
58
59 # In order to be able to consistently filter "."-relative names,
60 # (i.e., with no $(srcdir) prefix), this definition is careful to
61 # remove any $(srcdir) prefix, and to restore what it removes.
62 _sc_excl = \
63 $(if $(exclude_file_name_regexp--$@),$(exclude_file_name_regexp--$@),^$$)
64 VC_LIST_EXCEPT = \
65 $(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \
66 | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
67 else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
68 | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
69 $(_prepend_srcdir_prefix)
70
71 ifeq ($(origin prev_version_file), undefined)
72 prev_version_file = $(srcdir)/.prev-version
73 endif
74
75 PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null)
76 VERSION_REGEXP = $(subst .,\.,$(VERSION))
77 PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
78
79 ifeq ($(VC),$(GIT))
80 this-vc-tag = v$(VERSION)
81 this-vc-tag-regexp = v$(VERSION_REGEXP)
82 else
83 tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
84 tag-this-version = $(subst .,_,$(VERSION))
85 this-vc-tag = $(tag-package)-$(tag-this-version)
86 this-vc-tag-regexp = $(this-vc-tag)
87 endif
88 my_distdir = $(PACKAGE)-$(VERSION)
89
90 # Old releases are stored here.
91 release_archive_dir ?= ../release
92
93 # Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
94 # Use alpha.gnu.org for alpha and beta releases.
95 # Use ftp.gnu.org for stable releases.
96 gnu_ftp_host-alpha = alpha.gnu.org
97 gnu_ftp_host-beta = alpha.gnu.org
98 gnu_ftp_host-stable = ftp.gnu.org
99 gnu_rel_host ?= $(gnu_ftp_host-$(RELEASE_TYPE))
100
101 ifeq ($(gnu_rel_host),ftp.gnu.org)
102 url_dir_list ?= http://ftpmirror.gnu.org/$(PACKAGE)
103 else
104 url_dir_list ?= ftp://$(gnu_rel_host)/gnu/$(PACKAGE)
105 endif
106
107 # Override this in cfg.mk if you are using a different format in your
108 # NEWS file.
109 today = $(shell date +%Y-%m-%d)
110
111 # Select which lines of NEWS are searched for $(news-check-regexp).
112 # This is a sed line number spec. The default says that we search
113 # lines 1..10 of NEWS for $(news-check-regexp).
114 # If you want to search only line 3 or only lines 20-22, use "3" or "20,22".
115 news-check-lines-spec ?= 1,10
116 news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
117
118 # Prevent programs like 'sort' from considering distinct strings to be equal.
119 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
120 export LC_ALL = C
121
122 ## --------------- ##
123 ## Sanity checks. ##
124 ## --------------- ##
125
126 _cfg_mk := $(shell test -f $(srcdir)/cfg.mk && echo '$(srcdir)/cfg.mk')
127
128 # Collect the names of rules starting with `sc_'.
129 syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
130 $(srcdir)/$(ME) $(_cfg_mk)))
131 .PHONY: $(syntax-check-rules)
132
133 ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
134 local-checks-available += $(syntax-check-rules)
135 else
136 local-checks-available += no-vc-detected
137 no-vc-detected:
138 @echo "No version control files detected; skipping syntax check"
139 endif
140 .PHONY: $(local-checks-available)
141
142 # Arrange to print the name of each syntax-checking rule just before running it.
143 $(syntax-check-rules): %: %.m
144 sc_m_rules_ = $(patsubst %, %.m, $(syntax-check-rules))
145 .PHONY: $(sc_m_rules_)
146 $(sc_m_rules_):
147 @echo $(patsubst sc_%.m, %, $@)
148 @date +%s.%N > .sc-start-$(basename $@)
149
150 # Compute and print the elapsed time for each syntax-check rule.
151 sc_z_rules_ = $(patsubst %, %.z, $(syntax-check-rules))
152 .PHONY: $(sc_z_rules_)
153 $(sc_z_rules_): %.z: %
154 @end=$$(date +%s.%N); \
155 start=$$(cat .sc-start-$*); \
156 rm -f .sc-start-$*; \
157 awk -v s=$$start -v e=$$end \
158 'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null
159
160 # The patsubst here is to replace each sc_% rule with its sc_%.z wrapper
161 # that computes and prints elapsed time.
162 local-check := \
163 $(patsubst sc_%, sc_%.z, \
164 $(filter-out $(local-checks-to-skip), $(local-checks-available)))
165
166 syntax-check: $(local-check)
167
168 # _sc_search_regexp
169 #
170 # This macro searches for a given construct in the selected files and
171 # then takes some action.
172 #
173 # Parameters (shell variables):
174 #
175 # prohibit | require
176 #
177 # Regular expression (ERE) denoting either a forbidden construct
178 # or a required construct. Those arguments are exclusive.
179 #
180 # in_vc_files | in_files
181 #
182 # grep-E-style regexp denoting the files to check. If no files
183 # are specified the default are all the files that are under
184 # version control.
185 #
186 # containing | non_containing
187 #
188 # Select the files (non) containing strings matching this regexp.
189 # If both arguments are specified then CONTAINING takes
190 # precedence.
191 #
192 # with_grep_options
193 #
194 # Extra options for grep.
195 #
196 # ignore_case
197 #
198 # Ignore case.
199 #
200 # halt
201 #
202 # Message to display before to halting execution.
203 #
204 # Finally, you may exempt files based on an ERE matching file names.
205 # For example, to exempt from the sc_space_tab check all files with the
206 # .diff suffix, set this Make variable:
207 #
208 # exclude_file_name_regexp--sc_space_tab = \.diff$
209 #
210 # Note that while this functionality is mostly inherited via VC_LIST_EXCEPT,
211 # when filtering by name via in_files, we explicitly filter out matching
212 # names here as well.
213
214 # By default, _sc_search_regexp does not ignore case.
215 export ignore_case =
216 _ignore_case = $$(test -n "$$ignore_case" && printf %s -i || :)
217
218 define _sc_say_and_exit
219 dummy=; : so we do not need a semicolon before each use; \
220 { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; };
221 endef
222
223 # _sc_search_regexp used to be named _prohibit_regexp. However,
224 # upgrading to the new definition and leaving the old name undefined
225 # would usually convert each custom rule using $(_prohibit_regexp)
226 # (usually defined in cfg.mk) into a no-op. This definition ensures
227 # that people know right away if they're still using the old name.
228 # FIXME: remove in 2012.
229 _prohibit_regexp = \
230 $(error '*** you need to s/_prohibit_regexp/_sc_search_regexp/, and adapt')
231
232 define _sc_search_regexp
233 dummy=; : so we do not need a semicolon before each use; \
234 \
235 : Check arguments; \
236 test -n "$$prohibit" && test -n "$$require" \
237 && { msg='Cannot specify both prohibit and require' \
238 $(_sc_say_and_exit) } || :; \
239 test -z "$$prohibit" && test -z "$$require" \
240 && { msg='Should specify either prohibit or require' \
241 $(_sc_say_and_exit) } || :; \
242 test -n "$$in_vc_files" && test -n "$$in_files" \
243 && { msg='Cannot specify both in_vc_files and in_files' \
244 $(_sc_say_and_exit) } || :; \
245 test "x$$halt" != x \
246 || { msg='halt not defined' $(_sc_say_and_exit) }; \
247 \
248 : Filter by file name; \
249 if test -n "$$in_files"; then \
250 files=$$(find $(srcdir) | grep -E "$$in_files" \
251 | grep -Ev '$(exclude_file_name_regexp--$@)'); \
252 else \
253 files=$$($(VC_LIST_EXCEPT)); \
254 if test -n "$$in_vc_files"; then \
255 files=$$(echo "$$files" | grep -E "$$in_vc_files"); \
256 fi; \
257 fi; \
258 \
259 : Filter by content; \
260 test -n "$$files" && test -n "$$containing" \
261 && { files=$$(grep -l "$$containing" $$files); } || :; \
262 test -n "$$files" && test -n "$$non_containing" \
263 && { files=$$(grep -vl "$$non_containing" $$files); } || :; \
264 \
265 : Check for the construct; \
266 if test -n "$$files"; then \
267 if test -n "$$prohibit"; then \
268 grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
269 && { msg="$$halt" $(_sc_say_and_exit) } || :; \
270 else \
271 grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
272 | grep . \
273 && { msg="$$halt" $(_sc_say_and_exit) } || :; \
274 fi \
275 else :; \
276 fi || :;
277 endef
278
279 sc_avoid_if_before_free:
280 @$(srcdir)/$(_build-aux)/useless-if-before-free \
281 $(useless_free_options) \
282 $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \
283 { echo '$(ME): found useless "if" before "free" above' 1>&2; \
284 exit 1; } || :
285
286 sc_cast_of_argument_to_free:
287 @prohibit='\<free *\( *\(' halt='don'\''t cast free argument' \
288 $(_sc_search_regexp)
289
290 sc_cast_of_x_alloc_return_value:
291 @prohibit='\*\) *x(m|c|re)alloc\>' \
292 halt='don'\''t cast x*alloc return value' \
293 $(_sc_search_regexp)
294
295 sc_cast_of_alloca_return_value:
296 @prohibit='\*\) *alloca\>' \
297 halt='don'\''t cast alloca return value' \
298 $(_sc_search_regexp)
299
300 sc_space_tab:
301 @prohibit='[ ] ' \
302 halt='found SPACE-TAB sequence; remove the SPACE' \
303 $(_sc_search_regexp)
304
305 # Don't use *scanf or the old ato* functions in `real' code.
306 # They provide no error checking mechanism.
307 # Instead, use strto* functions.
308 sc_prohibit_atoi_atof:
309 @prohibit='\<([fs]?scanf|ato([filq]|ll)) *\(' \
310 halt='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \
311 $(_sc_search_regexp)
312
313 # Use STREQ rather than comparing strcmp == 0, or != 0.
314 sc_prohibit_strcmp:
315 @grep -nE '! *str''cmp *\(|\<str''cmp *\(.+\) *[!=]=' \
316 $$($(VC_LIST_EXCEPT)) \
317 | grep -vE ':# *define STRN?EQ\(' && \
318 { echo '$(ME): replace str''cmp calls above with STREQ/STRNEQ' \
319 1>&2; exit 1; } || :
320
321 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)
322 # Convert all uses automatically, via these two commands:
323 # git grep -l '\<exit *(1)' \
324 # | grep -vEf .x-sc_prohibit_magic_number_exit \
325 # | xargs --no-run-if-empty \
326 # perl -pi -e 's/(^|[^.])\b(exit ?)\(1\)/$1$2(EXIT_FAILURE)/'
327 # git grep -l '\<exit *(0)' \
328 # | grep -vEf .x-sc_prohibit_magic_number_exit \
329 # | xargs --no-run-if-empty \
330 # perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
331 sc_prohibit_magic_number_exit:
332 @prohibit='(^|[^.])\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,' \
333 halt='use EXIT_* values rather than magic number' \
334 $(_sc_search_regexp)
335
336 # Using EXIT_SUCCESS as the first argument to error is misleading,
337 # since when that parameter is 0, error does not exit. Use `0' instead.
338 sc_error_exit_success:
339 @prohibit='error *\(EXIT_SUCCESS,' \
340 in_vc_files='\.[chly]$$' \
341 halt='found error (EXIT_SUCCESS' \
342 $(_sc_search_regexp)
343
344 # `FATAL:' should be fully upper-cased in error messages
345 # `WARNING:' should be fully upper-cased, or fully lower-cased
346 sc_error_message_warn_fatal:
347 @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
348 | grep -E '"Warning|"Fatal|"fatal' && \
349 { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \
350 exit 1; } || :
351
352 # Error messages should not start with a capital letter
353 sc_error_message_uppercase:
354 @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
355 | grep -E '"[A-Z]' \
356 | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \
357 { echo '$(ME): found capitalized error message' 1>&2; \
358 exit 1; } || :
359
360 # Error messages should not end with a period
361 sc_error_message_period:
362 @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
363 | grep -E '[^."]\."' && \
364 { echo '$(ME): found error message ending in period' 1>&2; \
365 exit 1; } || :
366
367 sc_file_system:
368 @prohibit=file''system \
369 ignore_case=1 \
370 halt='found use of "file''system"; spell it "file system"' \
371 $(_sc_search_regexp)
372
373 # Don't use cpp tests of this symbol. All code assumes config.h is included.
374 sc_prohibit_have_config_h:
375 @prohibit='^# *if.*HAVE''_CONFIG_H' \
376 halt='found use of HAVE''_CONFIG_H; remove' \
377 $(_sc_search_regexp)
378
379 # Nearly all .c files must include <config.h>. However, we also permit this
380 # via inclusion of a package-specific header, if cfg.mk specified one.
381 # config_h_header must be suitable for grep -E.
382 config_h_header ?= <config\.h>
383 sc_require_config_h:
384 @require='^# *include $(config_h_header)' \
385 in_vc_files='\.c$$' \
386 halt='the above files do not include <config.h>' \
387 $(_sc_search_regexp)
388
389 # You must include <config.h> before including any other header file.
390 # This can possibly be via a package-specific header, if given by cfg.mk.
391 sc_require_config_h_first:
392 @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
393 fail=0; \
394 for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
395 grep '^# *include\>' $$i | sed 1q \
396 | grep -E '^# *include $(config_h_header)' > /dev/null \
397 || { echo $$i; fail=1; }; \
398 done; \
399 test $$fail = 1 && \
400 { echo '$(ME): the above files include some other header' \
401 'before <config.h>' 1>&2; exit 1; } || :; \
402 else :; \
403 fi
404
405 sc_prohibit_HAVE_MBRTOWC:
406 @prohibit='\bHAVE_MBRTOWC\b' \
407 halt="do not use $$prohibit; it is always defined" \
408 $(_sc_search_regexp)
409
410 # To use this "command" macro, you must first define two shell variables:
411 # h: the header name, with no enclosing <> or ""
412 # re: a regular expression that matches IFF something provided by $h is used.
413 define _sc_header_without_use
414 dummy=; : so we do not need a semicolon before each use; \
415 h_esc=`echo '[<"]'"$$h"'[">]'|sed 's/\./\\\\./g'`; \
416 if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
417 files=$$(grep -l '^# *include '"$$h_esc" \
418 $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
419 grep -LE "$$re" $$files | grep . && \
420 { echo "$(ME): the above files include $$h but don't use it" \
421 1>&2; exit 1; } || :; \
422 else :; \
423 fi
424 endef
425
426 # Prohibit the inclusion of assert.h without an actual use of assert.
427 sc_prohibit_assert_without_use:
428 @h='assert.h' re='\<assert *\(' $(_sc_header_without_use)
429
430 # Prohibit the inclusion of close-stream.h without an actual use.
431 sc_prohibit_close_stream_without_use:
432 @h='close-stream.h' re='\<close_stream *\(' $(_sc_header_without_use)
433
434 # Prohibit the inclusion of getopt.h without an actual use.
435 sc_prohibit_getopt_without_use:
436 @h='getopt.h' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
437
438 # Don't include quotearg.h unless you use one of its functions.
439 sc_prohibit_quotearg_without_use:
440 @h='quotearg.h' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use)
441
442 # Don't include quote.h unless you use one of its functions.
443 sc_prohibit_quote_without_use:
444 @h='quote.h' re='\<quote(_n)? *\(' $(_sc_header_without_use)
445
446 # Don't include this header unless you use one of its functions.
447 sc_prohibit_long_options_without_use:
448 @h='long-options.h' re='\<parse_long_options *\(' \
449 $(_sc_header_without_use)
450
451 # Don't include this header unless you use one of its functions.
452 sc_prohibit_inttostr_without_use:
453 @h='inttostr.h' re='\<(off|[iu]max|uint)tostr *\(' \
454 $(_sc_header_without_use)
455
456 # Don't include this header unless you use one of its functions.
457 sc_prohibit_ignore_value_without_use:
458 @h='ignore-value.h' re='\<ignore_(value|ptr) *\(' \
459 $(_sc_header_without_use)
460
461 # Don't include this header unless you use one of its functions.
462 sc_prohibit_error_without_use:
463 @h='error.h' \
464 re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
465 $(_sc_header_without_use)
466
467 # Don't include xalloc.h unless you use one of its functions.
468 # Consider these symbols:
469 # perl -lne '/^# *define (\w+)\(/ and print $1' lib/xalloc.h|grep -v '^__';
470 # perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/xalloc.h
471 # Divide into two sets on case, and filter each through this:
472 # | sort | perl -MRegexp::Assemble -le \
473 # 'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g'
474 # Note this was produced by the above:
475 # _xa1 = \
476 #x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup)
477 # But we can do better, in at least two ways:
478 # 1) take advantage of two "dup"-suffixed strings:
479 # x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup)
480 # 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable
481 # "char|[cmz]"
482 # x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
483 _xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
484 _xa2 = X([CZ]|N?M)ALLOC
485 sc_prohibit_xalloc_without_use:
486 @h='xalloc.h' \
487 re='\<($(_xa1)|$(_xa2)) *\('\
488 $(_sc_header_without_use)
489
490 # Extract function names:
491 # perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/hash.h
492 _hash_re = \
493 clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning
494 _hash_fn = \<($(_hash_re)) *\(
495 _hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
496 sc_prohibit_hash_without_use:
497 @h='hash.h' \
498 re='$(_hash_fn)|$(_hash_struct)'\
499 $(_sc_header_without_use)
500
501 sc_prohibit_cloexec_without_use:
502 @h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \
503 $(_sc_header_without_use)
504
505 sc_prohibit_posixver_without_use:
506 @h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
507
508 sc_prohibit_same_without_use:
509 @h='same.h' re='\<same_name *\(' $(_sc_header_without_use)
510
511 sc_prohibit_hash_pjw_without_use:
512 @h='hash-pjw.h' \
513 re='\<hash_pjw *\(' \
514 $(_sc_header_without_use)
515
516 sc_prohibit_safe_read_without_use:
517 @h='safe-read.h' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
518 $(_sc_header_without_use)
519
520 sc_prohibit_argmatch_without_use:
521 @h='argmatch.h' \
522 re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
523 $(_sc_header_without_use)
524
525 sc_prohibit_canonicalize_without_use:
526 @h='canonicalize.h' \
527 re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode)' \
528 $(_sc_header_without_use)
529
530 sc_prohibit_root_dev_ino_without_use:
531 @h='root-dev-ino.h' \
532 re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
533 $(_sc_header_without_use)
534
535 sc_prohibit_openat_without_use:
536 @h='openat.h' \
537 re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat)\>' \
538 $(_sc_header_without_use)
539
540 # Prohibit the inclusion of c-ctype.h without an actual use.
541 ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
542 |isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
543 sc_prohibit_c_ctype_without_use:
544 @h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \
545 $(_sc_header_without_use)
546
547 _empty =
548 _sp = $(_empty) $(_empty)
549 # The following list was generated by running:
550 # man signal.h|col -b|perl -ne '/bsd_signal.*;/.../sigwaitinfo.*;/ and print' \
551 # | perl -lne '/^\s+(?:int|void).*?(\w+).*/ and print $1' | fmt
552 _sig_functions = \
553 bsd_signal kill killpg pthread_kill pthread_sigmask raise sigaction \
554 sigaddset sigaltstack sigdelset sigemptyset sigfillset sighold sigignore \
555 siginterrupt sigismember signal sigpause sigpending sigprocmask sigqueue \
556 sigrelse sigset sigsuspend sigtimedwait sigwait sigwaitinfo
557 _sig_function_re = $(subst $(_sp),|,$(strip $(_sig_functions)))
558 # The following were extracted from "man signal.h" manually.
559 _sig_types_and_consts = \
560 MINSIGSTKSZ SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK \
561 SA_RESETHAND SA_RESTART SA_SIGINFO SIGEV_NONE SIGEV_SIGNAL \
562 SIGEV_THREAD SIGSTKSZ SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SS_DISABLE \
563 SS_ONSTACK mcontext_t pid_t sig_atomic_t sigevent siginfo_t sigset_t \
564 sigstack sigval stack_t ucontext_t
565 # generated via this:
566 # perl -lne '/^#ifdef (SIG\w+)/ and print $1' lib/sig2str.c|sort -u|fmt -70
567 _sig_names = \
568 SIGABRT SIGALRM SIGALRM1 SIGBUS SIGCANCEL SIGCHLD SIGCLD SIGCONT \
569 SIGDANGER SIGDIL SIGEMT SIGFPE SIGFREEZE SIGGRANT SIGHUP SIGILL \
570 SIGINFO SIGINT SIGIO SIGIOT SIGKAP SIGKILL SIGKILLTHR SIGLOST SIGLWP \
571 SIGMIGRATE SIGMSG SIGPHONE SIGPIPE SIGPOLL SIGPRE SIGPROF SIGPWR \
572 SIGQUIT SIGRETRACT SIGSAK SIGSEGV SIGSOUND SIGSTKFLT SIGSTOP SIGSYS \
573 SIGTERM SIGTHAW SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 \
574 SIGUSR2 SIGVIRT SIGVTALRM SIGWAITING SIGWINCH SIGWIND SIGWINDOW \
575 SIGXCPU SIGXFSZ
576 _sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names) $(_sig_types_and_consts)))
577
578 # Prohibit the inclusion of signal.h without an actual use.
579 sc_prohibit_signal_without_use:
580 @h='signal.h' \
581 re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \
582 $(_sc_header_without_use)
583
584 # Don't include stdio--.h unless you use one of its functions.
585 sc_prohibit_stdio--_without_use:
586 @h='stdio--.h' re='\<((f(re)?|p)open|tmpfile) *\(' \
587 $(_sc_header_without_use)
588
589 # Don't include stdio-safer.h unless you use one of its functions.
590 sc_prohibit_stdio-safer_without_use:
591 @h='stdio-safer.h' re='\<((f(re)?|p)open|tmpfile)_safer *\(' \
592 $(_sc_header_without_use)
593
594 # Prohibit the inclusion of strings.h without a sensible use.
595 # Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
596 sc_prohibit_strings_without_use:
597 @h='strings.h' \
598 re='\<(strn?casecmp|ffs(ll)?)\>' \
599 $(_sc_header_without_use)
600
601 # Get the list of symbol names with this:
602 # perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt
603 _intprops_names = \
604 TYPE_IS_INTEGER TYPE_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT \
605 TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM \
606 INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND \
607 INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW \
608 INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW \
609 INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW \
610 INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \
611 INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW \
612 INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW
613 _intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names)))
614 # Prohibit the inclusion of intprops.h without an actual use.
615 sc_prohibit_intprops_without_use:
616 @h='intprops.h' \
617 re='\<($(_intprops_syms_re)) *\(' \
618 $(_sc_header_without_use)
619
620 _stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
621 # Prohibit the inclusion of stddef.h without an actual use.
622 sc_prohibit_stddef_without_use:
623 @h='stddef.h' \
624 re='\<($(_stddef_syms_re))\>' \
625 $(_sc_header_without_use)
626
627 _de1 = dirfd|(close|(fd)?open|read|rewind|seek|tell)dir(64)?(_r)?
628 _de2 = (versionsort|struct dirent|getdirentries|alphasort|scandir(at)?)(64)?
629 _de3 = MAXNAMLEN|DIR|ino_t|d_ino|d_fileno|d_namlen
630 _dirent_syms_re = $(_de1)|$(_de2)|$(_de3)
631 # Prohibit the inclusion of dirent.h without an actual use.
632 sc_prohibit_dirent_without_use:
633 @h='dirent.h' \
634 re='\<($(_dirent_syms_re))\>' \
635 $(_sc_header_without_use)
636
637 # Prohibit the inclusion of verify.h without an actual use.
638 sc_prohibit_verify_without_use:
639 @h='verify.h' \
640 re='\<(verify(true|expr)?|static_assert) *\(' \
641 $(_sc_header_without_use)
642
643 # Don't include xfreopen.h unless you use one of its functions.
644 sc_prohibit_xfreopen_without_use:
645 @h='xfreopen.h' re='\<xfreopen *\(' $(_sc_header_without_use)
646
647 sc_obsolete_symbols:
648 @prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
649 halt='do not use HAVE''_FCNTL_H or O'_NDELAY \
650 $(_sc_search_regexp)
651
652 # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
653
654 # Each nonempty ChangeLog line must start with a year number, or a TAB.
655 sc_changelog:
656 @prohibit='^[^12 ]' \
657 in_vc_files='^ChangeLog$$' \
658 halt='found unexpected prefix in a ChangeLog' \
659 $(_sc_search_regexp)
660
661 # Ensure that each .c file containing a "main" function also
662 # calls set_program_name.
663 sc_program_name:
664 @require='set_program_name *\(m?argv\[0\]\);' \
665 in_vc_files='\.c$$' \
666 containing='\<main *(' \
667 halt='the above files do not call set_program_name' \
668 $(_sc_search_regexp)
669
670 # Ensure that each .c file containing a "main" function also
671 # calls bindtextdomain.
672 sc_bindtextdomain:
673 @require='bindtextdomain *\(' \
674 in_vc_files='\.c$$' \
675 containing='\<main *(' \
676 halt='the above files do not call bindtextdomain' \
677 $(_sc_search_regexp)
678
679 # Require that the final line of each test-lib.sh-using test be this one:
680 # Exit $fail
681 # Note: this test requires GNU grep's --label= option.
682 Exit_witness_file ?= tests/test-lib.sh
683 Exit_base := $(notdir $(Exit_witness_file))
684 sc_require_test_exit_idiom:
685 @if test -f $(srcdir)/$(Exit_witness_file); then \
686 die=0; \
687 for i in $$(grep -l -F 'srcdir/$(Exit_base)' \
688 $$($(VC_LIST) tests)); do \
689 tail -n1 $$i | grep '^Exit .' > /dev/null \
690 && : || { die=1; echo $$i; } \
691 done; \
692 test $$die = 1 && \
693 { echo 1>&2 '$(ME): the final line in each of the above is not:'; \
694 echo 1>&2 'Exit something'; \
695 exit 1; } || :; \
696 fi
697
698 sc_trailing_blank:
699 @prohibit='[ ]$$' \
700 halt='found trailing blank(s)' \
701 $(_sc_search_regexp)
702
703 # Match lines like the following, but where there is only one space
704 # between the options and the description:
705 # -D, --all-repeated[=delimit-method] print all duplicate lines\n
706 longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
707 sc_two_space_separator_in_usage:
708 @prohibit='^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
709 halt='help2man requires at least two spaces between an option and its description'\
710 $(_sc_search_regexp)
711
712 # A regexp matching function names like "error" that may be used
713 # to emit translatable messages.
714 _gl_translatable_diag_func_re ?= error
715
716 # Look for diagnostics that aren't marked for translation.
717 # This won't find any for which error's format string is on a separate line.
718 sc_unmarked_diagnostics:
719 @grep -nE \
720 '\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \
721 $$($(VC_LIST_EXCEPT)) \
722 | grep -Ev '(_|ngettext ?)\(' && \
723 { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
724 exit 1; } || :
725
726 # Avoid useless parentheses like those in this example:
727 # #if defined (SYMBOL) || defined (SYM2)
728 sc_useless_cpp_parens:
729 @prohibit='^# *if .*defined *\(' \
730 halt='found useless parentheses in cpp directive' \
731 $(_sc_search_regexp)
732
733 # List headers for which HAVE_HEADER_H is always true, assuming you are
734 # using the appropriate gnulib module. CAUTION: for each "unnecessary"
735 # #if HAVE_HEADER_H that you remove, be sure that your project explicitly
736 # requires the gnulib module that guarantees the usability of that header.
737 gl_assured_headers_ = \
738 cd $(gnulib_dir)/lib && echo *.in.h|sed 's/\.in\.h//g'
739
740 # Convert the list of names to upper case, and replace each space with "|".
741 az_ = abcdefghijklmnopqrstuvwxyz
742 AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ
743 gl_header_upper_case_or_ = \
744 $$($(gl_assured_headers_) \
745 | tr $(az_)/.- $(AZ_)___ \
746 | tr -s ' ' '|' \
747 )
748 sc_prohibit_always_true_header_tests:
749 @or=$(gl_header_upper_case_or_); \
750 re="HAVE_($$or)_H"; \
751 prohibit='\<'"$$re"'\>' \
752 halt=$$(printf '%s\n' \
753 'do not test the above HAVE_<header>_H symbol(s);' \
754 ' with the corresponding gnulib module, they are always true') \
755 $(_sc_search_regexp)
756
757 # ==================================================================
758 gl_other_headers_ ?= \
759 intprops.h \
760 openat.h \
761 stat-macros.h
762
763 # Perl -lne code to extract "significant" cpp-defined symbols from a
764 # gnulib header file, eliminating a few common false-positives.
765 # The exempted names below are defined only conditionally in gnulib,
766 # and hence sometimes must/may be defined in application code.
767 gl_extract_significant_defines_ = \
768 /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\
769 && $$2 !~ /(?:rpl_|_used_without_)/\
770 && $$1 !~ /^(?:NSIG|ENODATA)$$/\
771 && $$1 !~ /^(?:SA_RESETHAND|SA_RESTART)$$/\
772 and print $$1
773
774 # Create a list of regular expressions matching the names
775 # of macros that are guaranteed to be defined by parts of gnulib.
776 define def_sym_regex
777 gen_h=$(gl_generated_headers_); \
778 (cd $(gnulib_dir)/lib; \
779 for f in *.in.h $(gl_other_headers_); do \
780 test -f $$f \
781 && perl -lne '$(gl_extract_significant_defines_)' $$f; \
782 done; \
783 ) | sort -u \
784 | sed 's/^/^ *# *(define|undef) */;s/$$/\\>/'
785 endef
786
787 # Don't define macros that we already get from gnulib header files.
788 sc_prohibit_always-defined_macros:
789 @if test -d $(gnulib_dir); then \
790 case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \
791 echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
792 esac; \
793 $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT)) \
794 && { echo '$(ME): define the above via some gnulib .h file' \
795 1>&2; exit 1; } || :; \
796 fi
797 # ==================================================================
798
799 # Prohibit checked in backup files.
800 sc_prohibit_backup_files:
801 @$(VC_LIST) | grep '~$$' && \
802 { echo '$(ME): found version controlled backup file' 1>&2; \
803 exit 1; } || :
804
805 # Require the latest GPL.
806 sc_GPL_version:
807 @prohibit='either ''version [^3]' \
808 halt='GPL vN, N!=3' \
809 $(_sc_search_regexp)
810
811 # Require the latest GFDL. Two regexp, since some .texi files end up
812 # line wrapping between 'Free Documentation License,' and 'Version'.
813 _GFDL_regexp = (Free ''Documentation.*Version 1\.[^3]|Version 1\.[^3] or any)
814 sc_GFDL_version:
815 @prohibit='$(_GFDL_regexp)' \
816 halt='GFDL vN, N!=3' \
817 $(_sc_search_regexp)
818
819 # Don't use Texinfo's @acronym{}.
820 # http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html
821 texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$
822 sc_texinfo_acronym:
823 @prohibit='@acronym\{' \
824 in_vc_files='$(texinfo_suffix_re_)' \
825 halt='found use of Texinfo @acronym{}' \
826 $(_sc_search_regexp)
827
828 cvs_keywords = \
829 Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
830
831 sc_prohibit_cvs_keyword:
832 @prohibit='\$$($(cvs_keywords))\$$' \
833 halt='do not use CVS keyword expansion' \
834 $(_sc_search_regexp)
835
836 # This Perl code is slightly obfuscated. Not only is each "$" doubled
837 # because it's in a Makefile, but the $$c's are comments; we cannot
838 # use "#" due to the way the script ends up concatenated onto one line.
839 # It would be much more concise, and would produce better output (including
840 # counts) if written as:
841 # perl -ln -0777 -e '/\n(\n+)$/ and print "$ARGV: ".length $1' ...
842 # but that would be far less efficient, reading the entire contents
843 # of each file, rather than just the last two bytes of each.
844 # In addition, while the code below detects both blank lines and a missing
845 # newline at EOF, the above detects only the former.
846 #
847 # This is a perl script that is expected to be the single-quoted argument
848 # to a command-line "-le". The remaining arguments are file names.
849 # Print the name of each file that ends in exactly one newline byte.
850 # I.e., warn if there are blank lines (2 or more newlines), or if the
851 # last byte is not a newline. However, currently we don't complain
852 # about any file that contains exactly one byte.
853 # Exit nonzero if at least one such file is found, otherwise, exit 0.
854 # Warn about, but otherwise ignore open failure. Ignore seek/read failure.
855 #
856 # Use this if you want to remove trailing empty lines from selected files:
857 # perl -pi -0777 -e 's/\n\n+$/\n/' files...
858 #
859 require_exactly_one_NL_at_EOF_ = \
860 foreach my $$f (@ARGV) \
861 { \
862 open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \
863 my $$p = sysseek (F, -2, 2); \
864 my $$c = "seek failure probably means file has < 2 bytes; ignore"; \
865 my $$last_two_bytes; \
866 defined $$p and $$p = sysread F, $$last_two_bytes, 2; \
867 close F; \
868 $$c = "ignore read failure"; \
869 $$p && ($$last_two_bytes eq "\n\n" \
870 || substr ($$last_two_bytes,1) ne "\n") \
871 and (print $$f), $$fail=1; \
872 } \
873 END { exit defined $$fail }
874 sc_prohibit_empty_lines_at_EOF:
875 @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
876 || { echo '$(ME): empty line(s) or no newline at EOF' \
877 1>&2; exit 1; } || :
878
879 # Make sure we don't use st_blocks. Use ST_NBLOCKS instead.
880 # This is a bit of a kludge, since it prevents use of the string
881 # even in comments, but for now it does the job with no false positives.
882 sc_prohibit_stat_st_blocks:
883 @prohibit='[.>]st_blocks' \
884 halt='do not use st_blocks; use ST_NBLOCKS' \
885 $(_sc_search_regexp)
886
887 # Make sure we don't define any S_IS* macros in src/*.c files.
888 # They're already defined via gnulib's sys/stat.h replacement.
889 sc_prohibit_S_IS_definition:
890 @prohibit='^ *# *define *S_IS' \
891 halt='do not define S_IS* macros; include <sys/stat.h>' \
892 $(_sc_search_regexp)
893
894 # Perl block to convert a match to FILE_NAME:LINENO:TEST,
895 # that is shared by two definitions below.
896 perl_filename_lineno_text_ = \
897 -e ' {' \
898 -e ' $$n = ($$` =~ tr/\n/\n/ + 1);' \
899 -e ' ($$v = $$&) =~ s/\n/\\n/g;' \
900 -e ' print "$$ARGV:$$n:$$v\n";' \
901 -e ' }'
902
903 prohibit_doubled_word_RE_ ?= \
904 /\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims
905 prohibit_doubled_word_ = \
906 -e 'while ($(prohibit_doubled_word_RE_))' \
907 $(perl_filename_lineno_text_)
908
909 # Define this to a regular expression that matches
910 # any filename:dd:match lines you want to ignore.
911 # The default is to ignore no matches.
912 ignore_doubled_word_match_RE_ ?= ^$$
913
914 sc_prohibit_doubled_word:
915 @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \
916 | grep -vE '$(ignore_doubled_word_match_RE_)' \
917 | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || :
918
919 # A regular expression matching undesirable combinations of words like
920 # "can not"; this matches them even when the two words appear on different
921 # lines, but not when there is an intervening delimiter like "#" or "*".
922 prohibit_undesirable_word_seq_RE_ ?= \
923 /\bcan\s+not\b/gims
924 prohibit_undesirable_word_seq_ = \
925 -e 'while ($(prohibit_undesirable_word_seq_RE_))' \
926 $(perl_filename_lineno_text_)
927 # Define this to a regular expression that matches
928 # any filename:dd:match lines you want to ignore.
929 # The default is to ignore no matches.
930 ignore_undesirable_word_sequence_RE_ ?= ^$$
931
932 sc_prohibit_undesirable_word_seq:
933 @perl -n -0777 $(prohibit_undesirable_word_seq_) \
934 $$($(VC_LIST_EXCEPT)) \
935 | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \
936 && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || :
937
938 _ptm1 = use "test C1 && test C2", not "test C1 -''a C2"
939 _ptm2 = use "test C1 || test C2", not "test C1 -''o C2"
940 # Using test's -a and -o operators is not portable.
941 # We prefer test over [, since the latter is spelled [[ in configure.ac.
942 sc_prohibit_test_minus_ao:
943 @prohibit='(\<test| \[+) .+ -[ao] ' \
944 halt='$(_ptm1); $(_ptm2)' \
945 $(_sc_search_regexp)
946
947 # Avoid a test bashism.
948 sc_prohibit_test_double_equal:
949 @prohibit='(\<test| \[+) .+ == ' \
950 containing='#! */bin/[a-z]*sh' \
951 halt='use "test x = x", not "test x =''= x"' \
952 $(_sc_search_regexp)
953
954 # Each program that uses proper_name_utf8 must link with one of the
955 # ICONV libraries. Otherwise, some ICONV library must appear in LDADD.
956 # The perl -0777 invocation below extracts the possibly-multi-line
957 # definition of LDADD from the appropriate Makefile.am and exits 0
958 # when it contains "ICONV".
959 sc_proper_name_utf8_requires_ICONV:
960 @progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
961 if test "x$$progs" != x; then \
962 fail=0; \
963 for p in $$progs; do \
964 dir=$$(dirname "$$p"); \
965 perl -0777 \
966 -ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)' \
967 $$dir/Makefile.am && continue; \
968 base=$$(basename "$$p" .c); \
969 grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
970 || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
971 done; \
972 test $$fail = 1 && \
973 { echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
974 exit 1; } || :; \
975 fi
976
977 # Warn about "c0nst struct Foo const foo[]",
978 # but not about "char const *const foo" or "#define const const".
979 sc_redundant_const:
980 @prohibit='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
981 halt='redundant "const" in declarations' \
982 $(_sc_search_regexp)
983
984 sc_const_long_option:
985 @grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \
986 | grep -Ev 'const struct option|struct option const' && { \
987 echo 1>&2 '$(ME): add "const" to the above declarations'; \
988 exit 1; } || :
989
990 NEWS_hash = \
991 $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
992 $(srcdir)/NEWS \
993 | perl -0777 -pe \
994 's/^Copyright.+?Free\sSoftware\sFoundation,\sInc\.\n//ms' \
995 | md5sum - \
996 | sed 's/ .*//')
997
998 # Ensure that we don't accidentally insert an entry into an old NEWS block.
999 sc_immutable_NEWS:
1000 @if test -f $(srcdir)/NEWS; then \
1001 test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
1002 { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \
1003 fi
1004
1005 # Update the hash stored above. Do this after each release and
1006 # for any corrections to old entries.
1007 update-NEWS-hash: NEWS
1008 perl -pi -e 's/^(old_NEWS_hash[ \t]+:?=[ \t]+).*/$${1}'"$(NEWS_hash)/" \
1009 $(srcdir)/cfg.mk
1010
1011 # Ensure that we use only the standard $(VAR) notation,
1012 # not @...@ in Makefile.am, now that we can rely on automake
1013 # to emit a definition for each substituted variable.
1014 # However, there is still one case in which @VAR@ use is not just
1015 # legitimate, but actually required: when augmenting an automake-defined
1016 # variable with a prefix. For example, gettext uses this:
1017 # MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
1018 # otherwise, makeinfo would put German or French (current locale)
1019 # navigation hints in the otherwise-English documentation.
1020 #
1021 # Allow the package to add exceptions via a hook in cfg.mk;
1022 # for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by
1023 # setting this to ' && !/PRAGMA_SYSTEM_HEADER/'.
1024 _makefile_at_at_check_exceptions ?=
1025 sc_makefile_at_at_check:
1026 @perl -ne '/\@[A-Z_0-9]+\@/' \
1027 -e ' && !/([A-Z_0-9]+)\s+=.*\@\1\@$$/' \
1028 -e ''$(_makefile_at_at_check_exceptions) \
1029 -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \
1030 $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
1031 && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
1032
1033 news-check: NEWS
1034 if sed -n $(news-check-lines-spec)p $(srcdir)/NEWS \
1035 | grep -E $(news-check-regexp) >/dev/null; then \
1036 :; \
1037 else \
1038 echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \
1039 exit 1; \
1040 fi
1041
1042 sc_makefile_TAB_only_indentation:
1043 @prohibit='^ [ ]{8}' \
1044 in_vc_files='akefile|\.mk$$' \
1045 halt='found TAB-8-space indentation' \
1046 $(_sc_search_regexp)
1047
1048 sc_m4_quote_check:
1049 @prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \
1050 in_vc_files='(^configure\.ac|\.m4)$$' \
1051 halt='quote the first arg to AC_DEF*' \
1052 $(_sc_search_regexp)
1053
1054 fix_po_file_diag = \
1055 'you have changed the set of files with translatable diagnostics;\n\
1056 apply the above patch\n'
1057
1058 # Verify that all source files using _() are listed in po/POTFILES.in.
1059 po_file ?= $(srcdir)/po/POTFILES.in
1060 generated_files ?= $(srcdir)/lib/*.[ch]
1061 sc_po_check:
1062 @if test -f $(po_file); then \
1063 grep -E -v '^(#|$$)' $(po_file) \
1064 | grep -v '^src/false\.c$$' | sort > $@-1; \
1065 files=; \
1066 for file in $$($(VC_LIST_EXCEPT)) $(generated_files); do \
1067 test -r $$file || continue; \
1068 case $$file in \
1069 *.m4|*.mk) continue ;; \
1070 *.?|*.??) ;; \
1071 *.xml) ;; \
1072 *) continue;; \
1073 esac; \
1074 case $$file in \
1075 *.[ch]) \
1076 base=`expr " $$file" : ' \(.*\)\..'`; \
1077 { test -f $$base.l || test -f $$base.y; } && continue;; \
1078 esac; \
1079 files="$$files $$file"; \
1080 done; \
1081 grep -E -l '(\b(N?_|gettext *)\([^)"]*("|$$))|(<interface>)' $$files \
1082 | sed 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \
1083 diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \
1084 || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \
1085 rm -f $@-1 $@-2; \
1086 fi
1087
1088 # Sometimes it is useful to change the PATH environment variable
1089 # in Makefiles. When doing so, it's better not to use the Unix-centric
1090 # path separator of `:', but rather the automake-provided `$(PATH_SEPARATOR)'.
1091 msg = '$(ME): Do not use `:'\'' above; use $$(PATH_SEPARATOR) instead'
1092 sc_makefile_path_separator_check:
1093 @prohibit='PATH[=].*:' \
1094 in_vc_files='akefile|\.mk$$' \
1095 halt=$(msg) \
1096 $(_sc_search_regexp)
1097
1098 # Check that `make alpha' will not fail at the end of the process,
1099 # i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release)
1100 # and is read-only.
1101 writable-files:
1102 if test -d $(release_archive_dir); then \
1103 for file in $(DIST_ARCHIVES); do \
1104 for p in ./ $(release_archive_dir)/; do \
1105 test -e $$p$$file || continue; \
1106 test -w $$p$$file \
1107 || { echo ERROR: $$p$$file is not writable; fail=1; }; \
1108 done; \
1109 done; \
1110 test "$$fail" && exit 1 || : ; \
1111 else :; \
1112 fi
1113
1114 v_etc_file = $(gnulib_dir)/lib/version-etc.c
1115 sample-test = tests/sample-test
1116 texi = doc/$(PACKAGE).texi
1117 # Make sure that the copyright date in $(v_etc_file) is up to date.
1118 # Do the same for the $(sample-test) and the main doc/.texi file.
1119 sc_copyright_check:
1120 @require='enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' \
1121 in_files=$(v_etc_file) \
1122 halt='out of date copyright in $(v_etc_file); update it' \
1123 $(_sc_search_regexp)
1124 @require='# Copyright \(C\) '$$(date +%Y)' Free' \
1125 in_vc_files=$(sample-test) \
1126 halt='out of date copyright in $(sample-test); update it' \
1127 $(_sc_search_regexp)
1128 @require='Copyright @copyright\{\} .*'$$(date +%Y)' Free' \
1129 in_vc_files=$(texi) \
1130 halt='out of date copyright in $(texi); update it' \
1131 $(_sc_search_regexp)
1132
1133 # If tests/help-version exists and seems to be new enough, assume that its
1134 # use of init.sh and path_prepend_ is correct, and ensure that every other
1135 # use of init.sh is identical.
1136 # This is useful because help-version cross-checks prog --version
1137 # with $(VERSION), which verifies that its path_prepend_ invocation
1138 # sets PATH correctly. This is an inexpensive way to ensure that
1139 # the other init.sh-using tests also get it right.
1140 _hv_file ?= $(srcdir)/tests/help-version
1141 _hv_regex_weak ?= ^ *\. .*/init\.sh"
1142 # Fix syntax-highlighters "
1143 _hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
1144 sc_cross_check_PATH_usage_in_tests:
1145 @if test -f $(_hv_file); then \
1146 grep -l 'VERSION mismatch' $(_hv_file) >/dev/null \
1147 || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2; \
1148 exit 0; }; \
1149 grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \
1150 || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
1151 exit 1; }; \
1152 good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file)); \
1153 grep -LFx "$$good" \
1154 $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT))) \
1155 | grep . && \
1156 { echo "$(ME): the above files use path_prepend_ inconsistently" \
1157 1>&2; exit 1; } || :; \
1158 fi
1159
1160 # #if HAVE_... will evaluate to false for any non numeric string.
1161 # That would be flagged by using -Wundef, however gnulib currently
1162 # tests many undefined macros, and so we can't enable that option.
1163 # So at least preclude common boolean strings as macro values.
1164 sc_Wundef_boolean:
1165 @prohibit='^#define.*(yes|no|true|false)$$' \
1166 in_files='$(CONFIG_INCLUDE)' \
1167 halt='Use 0 or 1 for macro values' \
1168 $(_sc_search_regexp)
1169
1170 # Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might
1171 # not be constant, or might overflow a stack. In general, use PATH_MAX as
1172 # a limit, not an array or alloca size.
1173 sc_prohibit_path_max_allocation:
1174 @prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX' \
1175 halt='Avoid stack allocations of size PATH_MAX' \
1176 $(_sc_search_regexp)
1177
1178 sc_vulnerable_makefile_CVE-2009-4029:
1179 @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \
1180 in_files=$$(find $(srcdir) -name Makefile.in) \
1181 halt=$$(printf '%s\n' \
1182 'the above files are vulnerable; beware of running' \
1183 ' "make dist*" rules, and upgrade to fixed automake' \
1184 ' see http://bugzilla.redhat.com/542609 for details') \
1185 $(_sc_search_regexp)
1186
1187 vc-diff-check:
1188 (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
1189 if test -s vc-diffs; then \
1190 cat vc-diffs; \
1191 echo "Some files are locally modified:" 1>&2; \
1192 exit 1; \
1193 else \
1194 rm vc-diffs; \
1195 fi
1196
1197 rel-files = $(DIST_ARCHIVES)
1198
1199 gnulib_dir ?= $(srcdir)/gnulib
1200 gnulib-version = $$(cd $(gnulib_dir) && git describe)
1201 bootstrap-tools ?= autoconf,automake,gnulib
1202
1203 # If it's not already specified, derive the GPG key ID from
1204 # the signed tag we've just applied to mark this release.
1205 gpg_key_ID ?= \
1206 $$(git cat-file tag v$(VERSION) > .ann-sig \
1207 && gpgv .ann-sig - < /dev/null 2>&1 \
1208 | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig)
1209
1210 translation_project_ ?= coordinator@translationproject.org
1211
1212 # Make info-gnu the default only for a stable release.
1213 ifeq ($(RELEASE_TYPE),stable)
1214 announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT)
1215 announcement_mail_headers_ ?= \
1216 To: info-gnu@gnu.org \
1217 Cc: $(announcement_Cc_) \
1218 Mail-Followup-To: $(PACKAGE_BUGREPORT)
1219 else
1220 announcement_Cc_ ?= $(translation_project_)
1221 announcement_mail_headers_ ?= \
1222 To: $(PACKAGE_BUGREPORT) \
1223 Cc: $(announcement_Cc_)
1224 endif
1225
1226 announcement: NEWS ChangeLog $(rel-files)
1227 @$(srcdir)/$(_build-aux)/announce-gen \
1228 --mail-headers='$(announcement_mail_headers_)' \
1229 --release-type=$(RELEASE_TYPE) \
1230 --package=$(PACKAGE) \
1231 --prev=$(PREV_VERSION) \
1232 --curr=$(VERSION) \
1233 --gpg-key-id=$(gpg_key_ID) \
1234 --news=$(srcdir)/NEWS \
1235 --bootstrap-tools=$(bootstrap-tools) \
1236 --gnulib-version=$(gnulib-version) \
1237 --no-print-checksums \
1238 $(addprefix --url-dir=, $(url_dir_list))
1239
1240 ## ---------------- ##
1241 ## Updating files. ##
1242 ## ---------------- ##
1243
1244 ftp-gnu = ftp://ftp.gnu.org/gnu
1245 www-gnu = http://www.gnu.org
1246
1247 upload_dest_dir_ ?= $(PACKAGE)
1248 emit_upload_commands:
1249 @echo =====================================
1250 @echo =====================================
1251 @echo "$(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\"
1252 @echo " --to $(gnu_rel_host):$(upload_dest_dir_) \\"
1253 @echo " $(rel-files)"
1254 @echo '# send the ~/announce-$(my_distdir) e-mail'
1255 @echo =====================================
1256 @echo =====================================
1257
1258 define emit-commit-log
1259 printf '%s\n' 'maint: post-release administrivia' '' \
1260 '* NEWS: Add header line for next release.' \
1261 '* .prev-version: Record previous version.' \
1262 '* cfg.mk (old_NEWS_hash): Auto-update.'
1263 endef
1264
1265 .PHONY: no-submodule-changes
1266 no-submodule-changes:
1267 if test -d $(srcdir)/.git; then \
1268 diff=$$(cd $(srcdir) && git submodule -q foreach \
1269 git diff-index --name-only HEAD) \
1270 || exit 1; \
1271 case $$diff in '') ;; \
1272 *) echo '$(ME): submodule files are locally modified:'; \
1273 echo "$$diff"; exit 1;; esac; \
1274 else \
1275 : ; \
1276 fi
1277
1278 submodule-checks ?= no-submodule-changes public-submodule-commit
1279
1280 # Ensure that each sub-module commit we're using is public.
1281 # Without this, it is too easy to tag and release code that
1282 # cannot be built from a fresh clone.
1283 .PHONY: public-submodule-commit
1284 public-submodule-commit:
1285 $(AM_V_GEN)if test -d $(srcdir)/.git; then \
1286 cd $(srcdir) && \
1287 git submodule --quiet foreach test '$$(git rev-parse $$sha1)' \
1288 = '$$(git merge-base origin $$sha1)' \
1289 || { echo '$(ME): found non-public submodule commit' >&2; \
1290 exit 1; }; \
1291 else \
1292 : ; \
1293 fi
1294 # This rule has a high enough utility/cost ratio that it should be a
1295 # dependent of "check" by default. However, some of us do occasionally
1296 # commit a temporary change that deliberately points to a non-public
1297 # submodule commit, and want to be able to use rules like "make check".
1298 # In that case, run e.g., "make check gl_public_submodule_commit="
1299 # to disable this test.
1300 gl_public_submodule_commit ?= public-submodule-commit
1301 check: $(gl_public_submodule_commit)
1302
1303 .PHONY: alpha beta stable
1304 ALL_RECURSIVE_TARGETS += alpha beta stable
1305 alpha beta stable: $(local-check) writable-files $(submodule-checks)
1306 test $@ = stable \
1307 && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
1308 || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
1309 || :
1310 $(MAKE) vc-diff-check
1311 $(MAKE) news-check
1312 $(MAKE) distcheck
1313 $(MAKE) dist XZ_OPT=-9ev
1314 $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
1315 $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
1316
1317 # Override this in cfg.mk if you follow different procedures.
1318 release-prep-hook ?= release-prep
1319
1320 gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
1321 .PHONY: release-prep
1322 release-prep:
1323 case $$RELEASE_TYPE in alpha|beta|stable) ;; \
1324 *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac
1325 $(MAKE) --no-print-directory -s announcement > ~/announce-$(my_distdir)
1326 if test -d $(release_archive_dir); then \
1327 ln $(rel-files) $(release_archive_dir); \
1328 chmod a-w $(rel-files); \
1329 fi
1330 echo $(VERSION) > $(prev_version_file)
1331 $(MAKE) update-NEWS-hash
1332 perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' NEWS
1333 $(emit-commit-log) > .ci-msg
1334 $(VC) commit -F .ci-msg -a
1335 rm .ci-msg
1336
1337 # Override this with e.g., -s $(srcdir)/some_other_name.texi
1338 # if the default $(PACKAGE)-derived name doesn't apply.
1339 gendocs_options_ ?=
1340
1341 .PHONY: web-manual
1342 web-manual:
1343 @test -z "$(manual_title)" \
1344 && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
1345 @cd '$(srcdir)/doc'; \
1346 $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \
1347 -o '$(abs_builddir)/doc/manual' \
1348 --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
1349 "$(PACKAGE_NAME) - $(manual_title)"
1350 @echo " *** Upload the doc/manual directory to web-cvs."
1351
1352 # Code Coverage
1353
1354 init-coverage:
1355 $(MAKE) $(AM_MAKEFLAGS) clean
1356 lcov --directory . --zerocounters
1357
1358 COVERAGE_CCOPTS ?= "-g --coverage"
1359 COVERAGE_OUT ?= doc/coverage
1360
1361 build-coverage:
1362 $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS)
1363 $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) check
1364 mkdir -p $(COVERAGE_OUT)
1365 lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \
1366 --capture
1367
1368 gen-coverage:
1369 genhtml --output-directory $(COVERAGE_OUT) \
1370 $(COVERAGE_OUT)/$(PACKAGE).info \
1371 --highlight --frames --legend \
1372 --title "$(PACKAGE_NAME)"
1373
1374 coverage: init-coverage build-coverage gen-coverage
1375
1376 # Update gettext files.
1377 PACKAGE ?= $(shell basename $(PWD))
1378 PO_DOMAIN ?= $(PACKAGE)
1379 POURL = http://translationproject.org/latest/$(PO_DOMAIN)/
1380 PODIR ?= po
1381 refresh-po:
1382 rm -f $(PODIR)/*.po && \
1383 echo "$(ME): getting translations into po (please ignore the robots.txt ERROR 404)..." && \
1384 wget --no-verbose --directory-prefix $(PODIR) --no-directories --recursive --level 1 --accept .po --accept .po.1 $(POURL) && \
1385 echo 'en@boldquot' > $(PODIR)/LINGUAS && \
1386 echo 'en@quot' >> $(PODIR)/LINGUAS && \
1387 ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> $(PODIR)/LINGUAS
1388
1389 # Running indent once is not idempotent, but running it twice is.
1390 INDENT_SOURCES ?= $(C_SOURCES)
1391 .PHONY: indent
1392 indent:
1393 indent $(INDENT_SOURCES)
1394 indent $(INDENT_SOURCES)
1395
1396 # If you want to set UPDATE_COPYRIGHT_* environment variables,
1397 # put the assignments in this variable.
1398 update-copyright-env ?=
1399
1400 # Run this rule once per year (usually early in January)
1401 # to update all FSF copyright year lists in your project.
1402 # If you have an additional project-specific rule,
1403 # add it in cfg.mk along with a line 'update-copyright: prereq'.
1404 # By default, exclude all variants of COPYING; you can also
1405 # add exemptions (such as ChangeLog..* for rotated change logs)
1406 # in the file .x-update-copyright.
1407 .PHONY: update-copyright
1408 update-copyright:
1409 grep -l -w Copyright \
1410 $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \
1411 | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@
1412
1413 # This tight_scope test is skipped with a warning if $(_gl_TS_headers) is not
1414 # overridden and $(_gl_TS_dir)/Makefile.am does not mention noinst_HEADERS.
1415
1416 # NOTE: to override any _gl_TS_* default value, you must
1417 # define the variable(s) using "export" in cfg.mk.
1418 _gl_TS_dir ?= src
1419
1420 ALL_RECURSIVE_TARGETS += sc_tight_scope
1421 sc_tight_scope: tight-scope.mk
1422 @fail=0; \
1423 if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \
1424 > /dev/null \
1425 && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
1426 > /dev/null 2>&1; then \
1427 echo '$(ME): skipping $@'; \
1428 else \
1429 $(MAKE) -s -C $(_gl_TS_dir) \
1430 -f Makefile \
1431 -f $(abs_top_srcdir)/cfg.mk \
1432 -f $(abs_top_builddir)/$< \
1433 _gl_tight_scope \
1434 || fail=1; \
1435 fi; \
1436 rm -f $<; \
1437 exit $$fail
1438
1439 tight-scope.mk: $(ME)
1440 @rm -f $@ $@-t
1441 @perl -ne '/^# TS-start/.../^# TS-end/ and print' $(ME) > $@-t
1442 @chmod a=r $@-t && mv $@-t $@
1443
1444 ifeq (a,b)
1445 # TS-start
1446
1447 # Most functions should have static scope.
1448 # Any that don't must be marked with `extern', but `main'
1449 # and `usage' are exceptions: they're always extern, but
1450 # do not need to be marked. Symbols matching `__.*' are
1451 # reserved by the compiler, so are automatically excluded below.
1452 _gl_TS_unmarked_extern_functions ?= main usage
1453 _gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\S+) *\(/
1454
1455 # If your project uses a macro like "XTERN", then put
1456 # the following in cfg.mk to override this default:
1457 # export _gl_TS_extern = extern|XTERN
1458 _gl_TS_extern ?= extern
1459
1460 # The second nm|grep checks for file-scope variables with `extern' scope.
1461 # Without gnulib's progname module, you might put program_name here.
1462 # Symbols matching `__.*' are reserved by the compiler,
1463 # so are automatically excluded below.
1464 _gl_TS_unmarked_extern_vars ?=
1465
1466 # NOTE: the _match variables are perl expressions -- not mere regular
1467 # expressions -- so that you can extend them to match other patterns
1468 # and easily extract matched variable names.
1469 # For example, if your project declares some global variables via
1470 # a macro like this: GLOBAL(type, var_name, initializer), then you
1471 # can override this definition to automatically extract those names:
1472 # export _gl_TS_var_match = \
1473 # /^(?:$(_gl_TS_extern)) .*?\**(\w+)(\[.*?\])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/
1474 _gl_TS_var_match ?= /^(?:$(_gl_TS_extern)) .*?(\w+)(\[.*?\])?;/
1475
1476 # The names of object files in (or relative to) $(_gl_TS_dir).
1477 _gl_TS_obj_files ?= *.$(OBJEXT)
1478
1479 # Files in which to search for the one-line style extern declarations.
1480 # $(_gl_TS_dir)-relative.
1481 _gl_TS_headers ?= $(noinst_HEADERS)
1482
1483 .PHONY: _gl_tight_scope
1484 _gl_tight_scope: $(bin_PROGRAMS)
1485 t=exceptions-$$$$; \
1486 trap 's=$$?; rm -f $$t; exit $$s' 0; \
1487 for sig in 1 2 3 13 15; do \
1488 eval "trap 'v=`expr $$sig + 128`; (exit $$v); exit $$v' $$sig"; \
1489 done; \
1490 src=`for f in $(SOURCES); do \
1491 test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
1492 hdr=`for f in $(_gl_TS_headers); do \
1493 test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
1494 ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_functions); \
1495 grep -h -A1 '^extern .*[^;]$$' $$src \
1496 | grep -vE '^(extern |--)' | sed 's/ .*//'; \
1497 perl -lne \
1498 '$(_gl_TS_function_match) and print "^$$1\$$"' $$hdr; \
1499 ) | sort -u > $$t; \
1500 nm -e $(_gl_TS_obj_files) | sed -n 's/.* T //p'|grep -Ev -f $$t \
1501 && { echo the above functions should have static scope >&2; \
1502 exit 1; } || : ; \
1503 ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars); \
1504 perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' $$hdr *.h \
1505 ) | sort -u > $$t; \
1506 nm -e $(_gl_TS_obj_files) | sed -n 's/.* [BCDGRS] //p' \
1507 | sort -u | grep -Ev -f $$t \
1508 && { echo the above variables should have static scope >&2; \
1509 exit 1; } || :
1510 # TS-end
1511 endif
0 NULL =
01
1 man_MANS = virt-viewer.1
2 man_MANS = \
3 remote-viewer.1 \
4 virt-viewer.1 \
5 $(NULL)
26
3 EXTRA_DIST = virt-viewer.pod
7 EXTRA_DIST = \
8 remote-viewer.pod \
9 virt-viewer.pod \
10 $(NULL)
11
412 DISTCLEANFILES = $(man_MANS)
513
614 %.1: %.pod
8888 AUTOHEADER = @AUTOHEADER@
8989 AUTOMAKE = @AUTOMAKE@
9090 AWK = @AWK@
91 CATALOGS = @CATALOGS@
92 CATOBJEXT = @CATOBJEXT@
9193 CC = @CC@
9294 CCDEPMODE = @CCDEPMODE@
9395 CFLAGS = @CFLAGS@
111113 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
112114 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
113115 GMODULE2_LIBS = @GMODULE2_LIBS@
116 GMOFILES = @GMOFILES@
114117 GMSGFMT = @GMSGFMT@
115118 GREP = @GREP@
116119 GTK_API_VERSION = @GTK_API_VERSION@
125128 INSTALL_PROGRAM = @INSTALL_PROGRAM@
126129 INSTALL_SCRIPT = @INSTALL_SCRIPT@
127130 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
131 INSTOBJEXT = @INSTOBJEXT@
132 INTLLIBS = @INTLLIBS@
128133 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
129134 INTLTOOL_MERGE = @INTLTOOL_MERGE@
130135 INTLTOOL_PERL = @INTLTOOL_PERL@
144149 MAKEINFO = @MAKEINFO@
145150 MANIFEST_TOOL = @MANIFEST_TOOL@
146151 MKDIR_P = @MKDIR_P@
152 MKINSTALLDIRS = @MKINSTALLDIRS@
147153 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
148154 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
149155 MSGFMT = @MSGFMT@
156 MSGFMT_OPTS = @MSGFMT_OPTS@
150157 MSGMERGE = @MSGMERGE@
151158 NM = @NM@
152159 NMEDIT = @NMEDIT@
167174 PKG_CONFIG = @PKG_CONFIG@
168175 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
169176 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
177 POFILES = @POFILES@
178 POSUB = @POSUB@
179 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
180 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
170181 RANLIB = @RANLIB@
171182 SED = @SED@
172183 SET_MAKE = @SET_MAKE@
230241 top_build_prefix = @top_build_prefix@
231242 top_builddir = @top_builddir@
232243 top_srcdir = @top_srcdir@
233 man_MANS = virt-viewer.1
234 EXTRA_DIST = virt-viewer.pod
244 NULL =
245 man_MANS = \
246 remote-viewer.1 \
247 virt-viewer.1 \
248 $(NULL)
249
250 EXTRA_DIST = \
251 remote-viewer.pod \
252 virt-viewer.pod \
253 $(NULL)
254
235255 DISTCLEANFILES = $(man_MANS)
236256 all: all-am
237257
0
1 =head1 NAME
2
3 remote-viewer - a simple remote desktop client
4
5 =head1 SYNOPSIS
6
7 B<remote-viewer> [OPTIONS] URI
8
9 =head1 DESCRIPTION
10
11 B<remote-viewer> is a simple remote display client. The supported
12 protocols are SPICE and VNC.
13
14 =head1 OPTIONS
15
16 The following options are accepted when running C<remote-viewer>:
17
18 =over 4
19
20 =item -h, --help
21
22 Display command line help summary
23
24 =item -V, --version
25
26 Display program version number
27
28 =item -v, --verbose
29
30 Display information about the connection
31
32 =item -z PCT, --zoom=PCT
33
34 Zoom level of the display window in percentage. Range 10-200.
35
36 =item -f, --fullscreen
37
38 Start with the window maximised to fullscreen
39
40 =item --spice-controller
41
42 Use the SPICE controller to initialize the connection with the SPICE
43 server. This option is used by the SPICE browser addons to allow web
44 page to start a client.
45
46 =item --debug
47
48 Print debugging information
49
50 =back
51
52 =head1 EXAMPLES
53
54 To connect to SPICE server on host "makai" with port 5900
55
56 remote-viewer spice://makai:5900
57
58 To connect to VNC server on host "tsingy" with port 5900
59
60 remote-viewer vnc://tsingy:5900
61
62 =head1 BUGS
63
64 Report bugs to the mailing list C<http://www.redhat.com/mailman/listinfo/virt-tools-list>
65
66 =head1 COPYRIGHT
67
68 Copyright (C) 2012 Red Hat, Inc., and various contributors.
69 This is free software. You may redistribute copies of it under the terms of the GNU General
70 Public License C<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent
71 permitted by law.
72
73 =head1 SEE ALSO
74
75 C<virt-viewer(1)>, the project website C<http://virt-manager.org>
76
77 =cut
9696
9797 =head1 BUGS
9898
99 Report bugs to the mailing list C<http://www.redhat.com/mailman/listinfo/et-mgmt-tools>
99 Report bugs to the mailing list C<http://www.redhat.com/mailman/listinfo/virt-tools-list>
100100
101101 =head1 COPYRIGHT
102102
103 Copyright (C) 2007-2008 Red Hat, Inc, and various contributors.
103 Copyright (C) 2007-2008 Red Hat, Inc., and various contributors.
104104 This is free software. You may redistribute copies of it under the terms of the GNU General
105105 Public License C<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent
106106 permitted by law.
110110 C<virsh(1)>, C<virt-manager(1)>, the project website C<http://virt-manager.org>
111111
112112 =cut
113
6868 %files -f virt-viewer.lang
6969 %defattr(-,root,root)
7070 %{_mingw32_bindir}/virt-viewer.exe
71 %{_mingw32_bindir}/remote-viewer.exe
7172
7273 %dir %{_mingw32_datadir}/virt-viewer/
7374 %dir %{_mingw32_datadir}/virt-viewer/ui/
7475 %{_mingw32_datadir}/virt-viewer/ui/virt-viewer.xml
7576 %{_mingw32_datadir}/virt-viewer/ui/virt-viewer-about.xml
7677 %{_mingw32_datadir}/virt-viewer/ui/virt-viewer-auth.xml
78 %{_mingw32_datadir}/icons/hicolor/*/apps/*
7779
7880 %{_mingw32_mandir}/man1/virt-viewer.1*
81 %{_mingw32_mandir}/man1/remote-viewer.1*
7982
8083 %changelog
1010 virt-viewer-plugin.c virt-viewer-plugin.h \
1111 npshell.c npunix.c
1212 virt_viewer_plugin_la_LIBADD = \
13 @FIREFOX_PLUGIN_LIBS@ \
14 @GTKVNC_LIBS@ \
15 @GTK2_LIBS@ \
16 @LIBXML2_LIBS@ \
17 @LIBGLADE2_LIBS@ \
18 @LIBVIRT_LIBS@
13 $(FIREFOX_PLUGIN_LIBS) \
14 $(GTK_VNC_LIBS) \
15 $(GTK_LIBS) \
16 $(LIBXML2_LIBS) \
17 $(LIBVIRT_LIBS)
1918 virt_viewer_plugin_la_LDFLAGS = \
2019 -module -avoid-version
2120 virt_viewer_plugin_la_CFLAGS = \
2221 -DPLUGIN=1 -DENABLE_DEBUG=1 \
23 @FIREFOX_PLUGIN_CFLAGS@ \
24 @GTKVNC_CFLAGS@ \
25 @GTK2_CFLAGS@ \
26 @LIBXML2_CFLAGS@ \
27 @LIBGLADE2_CFLAGS@ \
28 @LIBVIRT_CFLAGS@ \
22 $(FIREFOX_PLUGIN_CFLAGS) \
23 $(GTK_VNC_CFLAGS) \
24 $(GTK_CFLAGS) \
25 $(LIBXML2_CFLAGS) \
26 $(LIBVIRT_CFLAGS) \
2927 -DGLADE_DIR="\"$(gladedir)\"" \
3028 -I$(top_srcdir)/src
3129
6969 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
7070 am__installdirs = "$(DESTDIR)$(plugindir)"
7171 LTLIBRARIES = $(plugin_LTLIBRARIES)
72 virt_viewer_plugin_la_DEPENDENCIES =
72 am__DEPENDENCIES_1 =
73 @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_DEPENDENCIES = \
74 @ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \
75 @ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \
76 @ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \
77 @ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1) \
78 @ENABLE_PLUGIN_TRUE@ $(am__DEPENDENCIES_1)
7379 am__virt_viewer_plugin_la_SOURCES_DIST = ../src/virt-viewer-util.c \
7480 ../src/virt-viewer-util.h ../src/virt-viewer-auth.c \
7581 ../src/virt-viewer-auth.h ../src/virt-viewer.c \
134140 AUTOHEADER = @AUTOHEADER@
135141 AUTOMAKE = @AUTOMAKE@
136142 AWK = @AWK@
143 CATALOGS = @CATALOGS@
144 CATOBJEXT = @CATOBJEXT@
137145 CC = @CC@
138146 CCDEPMODE = @CCDEPMODE@
139147 CFLAGS = @CFLAGS@
157165 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
158166 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
159167 GMODULE2_LIBS = @GMODULE2_LIBS@
168 GMOFILES = @GMOFILES@
160169 GMSGFMT = @GMSGFMT@
161170 GREP = @GREP@
162171 GTK_API_VERSION = @GTK_API_VERSION@
171180 INSTALL_PROGRAM = @INSTALL_PROGRAM@
172181 INSTALL_SCRIPT = @INSTALL_SCRIPT@
173182 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
183 INSTOBJEXT = @INSTOBJEXT@
184 INTLLIBS = @INTLLIBS@
174185 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
175186 INTLTOOL_MERGE = @INTLTOOL_MERGE@
176187 INTLTOOL_PERL = @INTLTOOL_PERL@
190201 MAKEINFO = @MAKEINFO@
191202 MANIFEST_TOOL = @MANIFEST_TOOL@
192203 MKDIR_P = @MKDIR_P@
204 MKINSTALLDIRS = @MKINSTALLDIRS@
193205 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
194206 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
195207 MSGFMT = @MSGFMT@
208 MSGFMT_OPTS = @MSGFMT_OPTS@
196209 MSGMERGE = @MSGMERGE@
197210 NM = @NM@
198211 NMEDIT = @NMEDIT@
213226 PKG_CONFIG = @PKG_CONFIG@
214227 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
215228 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
229 POFILES = @POFILES@
230 POSUB = @POSUB@
231 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
232 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
216233 RANLIB = @RANLIB@
217234 SED = @SED@
218235 SET_MAKE = @SET_MAKE@
287304 @ENABLE_PLUGIN_TRUE@ npshell.c npunix.c
288305
289306 @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_LIBADD = \
290 @ENABLE_PLUGIN_TRUE@ @FIREFOX_PLUGIN_LIBS@ \
291 @ENABLE_PLUGIN_TRUE@ @GTKVNC_LIBS@ \
292 @ENABLE_PLUGIN_TRUE@ @GTK2_LIBS@ \
293 @ENABLE_PLUGIN_TRUE@ @LIBXML2_LIBS@ \
294 @ENABLE_PLUGIN_TRUE@ @LIBGLADE2_LIBS@ \
295 @ENABLE_PLUGIN_TRUE@ @LIBVIRT_LIBS@
307 @ENABLE_PLUGIN_TRUE@ $(FIREFOX_PLUGIN_LIBS) \
308 @ENABLE_PLUGIN_TRUE@ $(GTK_VNC_LIBS) \
309 @ENABLE_PLUGIN_TRUE@ $(GTK_LIBS) \
310 @ENABLE_PLUGIN_TRUE@ $(LIBXML2_LIBS) \
311 @ENABLE_PLUGIN_TRUE@ $(LIBVIRT_LIBS)
296312
297313 @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_LDFLAGS = \
298314 @ENABLE_PLUGIN_TRUE@ -module -avoid-version
299315
300316 @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_CFLAGS = \
301317 @ENABLE_PLUGIN_TRUE@ -DPLUGIN=1 -DENABLE_DEBUG=1 \
302 @ENABLE_PLUGIN_TRUE@ @FIREFOX_PLUGIN_CFLAGS@ \
303 @ENABLE_PLUGIN_TRUE@ @GTKVNC_CFLAGS@ \
304 @ENABLE_PLUGIN_TRUE@ @GTK2_CFLAGS@ \
305 @ENABLE_PLUGIN_TRUE@ @LIBXML2_CFLAGS@ \
306 @ENABLE_PLUGIN_TRUE@ @LIBGLADE2_CFLAGS@ \
307 @ENABLE_PLUGIN_TRUE@ @LIBVIRT_CFLAGS@ \
318 @ENABLE_PLUGIN_TRUE@ $(FIREFOX_PLUGIN_CFLAGS) \
319 @ENABLE_PLUGIN_TRUE@ $(GTK_VNC_CFLAGS) \
320 @ENABLE_PLUGIN_TRUE@ $(GTK_CFLAGS) \
321 @ENABLE_PLUGIN_TRUE@ $(LIBXML2_CFLAGS) \
322 @ENABLE_PLUGIN_TRUE@ $(LIBVIRT_CFLAGS) \
308323 @ENABLE_PLUGIN_TRUE@ -DGLADE_DIR="\"$(gladedir)\"" \
309324 @ENABLE_PLUGIN_TRUE@ -I$(top_srcdir)/src
310325
4545 * This file defines a "shell" plugin that plugin developers can use
4646 * as the basis for a real plugin. This shell just provides empty
4747 * implementations of all functions that the plugin can implement
48 * that will be called by Netscape (the NPP_xxx methods defined in
49 * npapi.h).
48 * that will be called by Netscape (the NPP_xxx methods defined in
49 * npapi.h).
5050 *
5151 * dp Suresh <dp@netscape.com>
5252 * updated 5/1998 <pollmann@netscape.com>
5858 /*
5959 The contents of this file are subject to the Mozilla Public License
6060
61 Version 1.1 (the "License"); you may not use this file except in compliance
61 Version 1.1 (the "License"); you may not use this file except in compliance
6262 with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
6363
64 Software distributed under the License is distributed on an "AS IS" basis,
65 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
64 Software distributed under the License is distributed on an "AS IS" basis,
65 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
6666 the specific language governing rights and limitations under the License.
6767
6868 The Original Code is stub code that defines the binary interface to a Mozilla
146146 debug ("NPP_Shutdown");
147147 }
148148
149 NPError
149 NPError
150150 NPP_New(NPMIMEType pluginType G_GNUC_UNUSED,
151151 NPP instance,
152152 uint16 mode,
219219 return NPERR_NO_ERROR;
220220 }
221221
222 NPError
222 NPError
223223 NPP_Destroy(NPP instance, NPSavedData** save G_GNUC_UNUSED)
224224 {
225225 PluginInstance* This;
234234 if (This != NULL)
235235 {
236236 (void) VirtViewerDestroyWindow (instance);
237 if (This->uri) free (This->uri);
238 if (This->name) free (This->name);
237 free (This->uri);
238 free (This->name);
239239 NPN_MemFree(instance->pdata);
240240 instance->pdata = NULL;
241241 }
244244 }
245245
246246
247 NPError
247 NPError
248248 NPP_SetWindow(NPP instance, NPWindow* window)
249249 {
250250 debug ("NPP_SetWindow");
252252 return VirtViewerXSetWindow(instance, window);
253253 }
254254
255 int32
255 int32
256256 NPP_WriteReady(NPP instance, NPStream *stream)
257257 {
258258 /*printf("NPP_WriteReady()\n");*/
266266 return -1L; /* don't accept any bytes in NPP_Write() */
267267 }
268268
269 int32
269 int32
270270 NPP_Write(NPP instance, NPStream *stream,
271271 int32 offset G_GNUC_UNUSED, int32 len G_GNUC_UNUSED,
272272 void *buffer G_GNUC_UNUSED)
281281 return -1L; /* don't accept any bytes in NPP_Write() */
282282 }
283283
284 NPError
284 NPError
285285 NPP_DestroyStream(NPP instance, NPStream *stream G_GNUC_UNUSED,
286286 NPError reason G_GNUC_UNUSED)
287287 {
297297 return NPERR_NO_ERROR;
298298 }
299299
300 void
300 void
301301 NPP_StreamAsFile(NPP instance G_GNUC_UNUSED, NPStream *stream G_GNUC_UNUSED,
302302 const char* fname G_GNUC_UNUSED)
303303 {
322322 }
323323
324324
325 void
325 void
326326 NPP_Print(NPP instance, NPPrint* printInfo)
327327 {
328328 /*printf("NPP_Print()\n");*/
333333 /***** Insert NPP_Print code here *****\
334334 PluginInstance* This = (PluginInstance*) instance->pdata;
335335 \**************************************/
336
336
337337 if (printInfo->mode == NP_FULL) {
338338 /*
339339 * PLUGIN DEVELOPERS:
358358 NPBool printOne =
359359 printInfo->print.fullPrint.printOne;
360360 \**************************************/
361
361
362362 /* Do the default*/
363363 printInfo->print.fullPrint.pluginPrinted = FALSE;
364364 }
261261 * Wrapper functions : Netscape Navigator -> plugin
262262 *
263263 * These functions let the plugin developer just create the APIs
264 * as documented and defined in npapi.h, without needing to
264 * as documented and defined in npapi.h, without needing to
265265 * install those functions in the function table or worry about
266266 * setting up globals for 68K plugins.
267267 *
274274 NPError ret;
275275 PLUGINDEBUGSTR("New");
276276 ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
277 return ret;
277 return ret;
278278 }
279279
280280 static NPError
343343 static void
344344 Private_URLNotify(NPP instance, const char* url,
345345 NPReason reason, void* notifyData)
346
347346 {
348347 PLUGINDEBUGSTR("URLNotify");
349348 NPP_URLNotify(instance, url, reason, notifyData);
352351 static NPError
353352 Private_GetValue(void *instance, NPPVariable variable, void *result)
354353 {
355 NPError rv = NPP_GetValue(instance, variable, result);
356 return rv;
354 NPError rv = NPP_GetValue(instance, variable, result);
355 return rv;
357356 }
358357
359358 static void
376375 }
377376 #endif
378377
379 static int16
378 static int16
380379 Private_HandleEvent(NPP instance, void* event)
381380 {
382381 return NPP_HandleEvent(instance, event);
383382 }
384383
385 /***********************************************************************
384 /***********************************************************************
386385 *
387386 * These functions are located automagically by netscape.
388387 *
435434 NPError err = NPERR_NO_ERROR;
436435
437436 PLUGINDEBUGSTR("NP_Initialize");
438
437
439438 /* validate input parameters */
440439
441440 if ((nsTable == NULL) || (pluginFuncs == NULL))
442441 err = NPERR_INVALID_FUNCTABLE_ERROR;
443
442
444443 /*
445444 * Check the major version passed in Netscape's function table.
446445 * We won't load if the major version is newer than what we expect.
455454 err = NPERR_INCOMPATIBLE_VERSION_ERROR;
456455 if (nsTable->size < sizeof(NPNetscapeFuncs))
457456 err = NPERR_INVALID_FUNCTABLE_ERROR;
458 if (pluginFuncs->size < sizeof(NPPluginFuncs))
457 if (pluginFuncs->size < sizeof(NPPluginFuncs))
459458 err = NPERR_INVALID_FUNCTABLE_ERROR;
460459 }
461
462
460
463461 if (err == NPERR_NO_ERROR) {
464462 /*
465463 * Copy all the fields of Netscape function table into our
518516
519517 err = NPP_Initialize();
520518 }
521
519
522520 return err;
523521 }
524522
11 VIRT-VIEWER-PLUGIN
22
33 By Richard W.M. Jones <rjones@redhat.com>
4 Copyright (C) 2008 Red Hat Inc.
4 Copyright (C) 2008-2012 Red Hat, Inc.
55
66 Largely based on DiamondX (http://multimedia.cx/diamondx/), which itself
77 is based on Mozilla sources.
8282 /* Make the VNC widget. */
8383 if (This->uri && This->name) {
8484 debug ("calling viewer_start uri=%s name=%s direct=%d waitvm=%d reconnect=%d container=%p",
85 This->uri, This->name, This->direct, This->waitvm, This->reconnect, This->container);
85 This->uri, This->name, This->direct, This->waitvm, This->reconnect, This->container);
8686 r = viewer_start (This->uri, This->name, This->direct, This->waitvm, This->reconnect, 1, This->debug, This->container);
8787 if (r != 0)
8888 fprintf (stderr, "viewer_start returned %d != 0\n", r);
11 VIRT_VIEWER-PLUGIN
22
33 By Richard W.M. Jones <rjones@redhat.com>
4 Copyright (C) 2008 Red Hat Inc.
4 Copyright (C) 2008-2012 Red Hat, Inc.
55
66 Largely based on DiamondX (http://multimedia.cx/diamondx/), which itself
77 is based on Mozilla sources.
3838 #include <npapi.h>
3939 #include <gtk/gtk.h>
4040 #include <X11/Xlib.h>
41 #include "viewer.h"
41 #include "virt-viewer-app.h"
4242
4343 #define PLUGIN_NAME "Virt-viewer browser plugin"
4444 #define MIME_TYPES_HANDLED "application/x-virt-viewer:virt-viewer:Virt viewer"
7676 fflush (stderr);
7777 }
7878 #else
79 static void debug (const char *msg G_GNUC_UNUSED, ...) { }
79 #define debug(msg...)
8080 #endif
8181
8282 #endif /* VIRT_VIEWER_PLUGIN_H */
0 src/remote-viewer-main.c
1 src/remote-viewer.c
02 src/virt-viewer-about.xml
13 src/virt-viewer-app.c
2 src/virt-viewer-auth.c
34 src/virt-viewer-auth.xml
4 src/virt-viewer-display-spice.c
5 src/virt-viewer-display-vnc.c
6 src/virt-viewer-display.c
7 src/virt-viewer-events.c
85 src/virt-viewer-main.c
9 src/virt-viewer-notebook.c
106 src/virt-viewer-session-spice.c
117 src/virt-viewer-session-vnc.c
12 src/virt-viewer-session.c
13 src/virt-viewer-util.c
148 src/virt-viewer-window.c
159 src/virt-viewer.c
1610 src/virt-viewer.xml
0 bin_PROGRAMS = virt-viewer
0 NULL =
1 # we are forced to use a shared library,
2 # because libtool reordred .a after .la libs, and it fails to link
3 noinst_LTLIBRARIES = libvirt-viewer.la
4 bin_PROGRAMS =
15
26 builderxmldir = $(pkgdatadir)/ui
3 builderxml_DATA = \
4 virt-viewer.xml \
5 virt-viewer-about.xml \
6 virt-viewer-auth.xml
7 builderxml_DATA = \
8 virt-viewer.xml \
9 virt-viewer-about.xml \
10 virt-viewer-auth.xml \
11 $(NULL)
712
813 EXTRA_DIST = $(builderxml_DATA)
914
10 virt_viewer_SOURCES = \
11 virt-viewer-main.c \
12 virt-viewer.h virt-viewer.c \
13 virt-viewer-util.h virt-viewer-util.c \
14 virt-viewer-auth.h virt-viewer-auth.c \
15 virt-viewer-events.h virt-viewer-events.c \
16 virt-viewer-app.h virt-viewer-app.c \
17 virt-viewer-session.h virt-viewer-session.c \
18 virt-viewer-display.h virt-viewer-display.c \
19 virt-viewer-notebook.h virt-viewer-notebook.c \
20 virt-viewer-window.h virt-viewer-window.c \
21 view/autoDrawer.c \
22 view/autoDrawer.h \
23 view/drawer.c \
24 view/drawer.h \
25 view/ovBox.c \
26 view/ovBox.h
15 if HAVE_LIBVIRT
16 bin_PROGRAMS += virt-viewer
17 virt_viewer_SOURCES = \
18 virt-viewer-events.h virt-viewer-events.c \
19 virt-viewer.h virt-viewer.c \
20 virt-viewer-main.c \
21 $(NULL)
22 virt_viewer_LDADD = libvirt-viewer.la
23 virt_viewer_LDFLAGS = \
24 $(LIBVIRT_LIBS) \
25 $(GMODULE2_LIBS) \
26 $(NULL)
27 virt_viewer_CFLAGS = $(AM_CFLAGS) $(LIBVIRT_CFLAGS)
28 endif
29
30 bin_PROGRAMS += remote-viewer
31 remote_viewer_SOURCES = \
32 remote-viewer.h remote-viewer.c \
33 remote-viewer-main.c \
34 $(NULL)
35 remote_viewer_LDADD = libvirt-viewer.la
36 remote_viewer_LDFLAGS = \
37 $(GMODULE2_LIBS) \
38 $(NULL)
39
40 libvirt_viewer_la_SOURCES = \
41 virt-viewer-util.h virt-viewer-util.c \
42 virt-viewer-auth.h virt-viewer-auth.c \
43 virt-viewer-app.h virt-viewer-app.c \
44 virt-viewer-session.h virt-viewer-session.c \
45 virt-viewer-display.h virt-viewer-display.c \
46 virt-viewer-notebook.h virt-viewer-notebook.c \
47 virt-viewer-window.h virt-viewer-window.c \
48 view/autoDrawer.c \
49 view/autoDrawer.h \
50 view/drawer.c \
51 view/drawer.h \
52 view/ovBox.c \
53 view/ovBox.h \
54 $(NULL)
55 libvirt_viewer_la_LIBADD = \
56 $(GMODULE2_LIBS) \
57 $(GTK_LIBS) \
58 $(LIBXML2_LIBS) \
59 $(NULL)
2760
2861 if HAVE_GTK_VNC
29 virt_viewer_SOURCES += \
30 virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
31 virt-viewer-display-vnc.h virt-viewer-display-vnc.c
62 libvirt_viewer_la_SOURCES += \
63 virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
64 virt-viewer-display-vnc.h virt-viewer-display-vnc.c \
65 $(NULL)
66 libvirt_viewer_la_LIBADD += $(GTK_VNC_LIBS)
3267 endif
3368
3469 if HAVE_SPICE_GTK
35 virt_viewer_SOURCES += \
36 virt-viewer-session-spice.h virt-viewer-session-spice.c \
37 virt-viewer-display-spice.h virt-viewer-display-spice.c
70 libvirt_viewer_la_SOURCES += \
71 virt-viewer-session-spice.h virt-viewer-session-spice.c \
72 virt-viewer-display-spice.h virt-viewer-display-spice.c \
73 $(NULL)
74 libvirt_viewer_la_LIBADD += $(SPICE_GTK_LIBS)
3875 endif
3976
40 virt_viewer_LDADD = \
41 @GTK_VNC_LIBS@ \
42 @SPICE_GTK_LIBS@ \
43 @GMODULE2_LIBS@ \
44 @GTK_LIBS@ \
45 @LIBXML2_LIBS@ \
46 @LIBVIRT_LIBS@
47
48 virt_viewer_CFLAGS = \
49 @GTK_VNC_CFLAGS@ \
50 @SPICE_GTK_CFLAGS@ \
51 @GMODULE2_CFLAGS@ \
52 @GTK_CFLAGS@ \
53 @LIBXML2_CFLAGS@ \
54 @LIBVIRT_CFLAGS@ \
55 @WARN_CFLAGS@ \
56 -DLOCALE_DIR=\""$(datadir)/locale"\"
77 AM_CFLAGS = \
78 $(GMODULE2_CFLAGS) \
79 $(GTK_CFLAGS) \
80 $(GTK_VNC_CFLAGS) \
81 $(LIBXML2_CFLAGS) \
82 $(SPICE_GTK_CFLAGS) \
83 $(WARN_CFLAGS) \
84 -DLOCALE_DIR=\""$(datadir)/locale"\" \
85 $(NULL)
1313 # PARTICULAR PURPOSE.
1414
1515 @SET_MAKE@
16
1617
1718
1819 VPATH = @srcdir@
3435 POST_UNINSTALL = :
3536 build_triplet = @build@
3637 host_triplet = @host@
37 bin_PROGRAMS = virt-viewer$(EXEEXT)
38 @HAVE_GTK_VNC_TRUE@am__append_1 = \
39 @HAVE_GTK_VNC_TRUE@ virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
40 @HAVE_GTK_VNC_TRUE@ virt-viewer-display-vnc.h virt-viewer-display-vnc.c
41
42 @HAVE_SPICE_GTK_TRUE@am__append_2 = \
43 @HAVE_SPICE_GTK_TRUE@ virt-viewer-session-spice.h virt-viewer-session-spice.c \
44 @HAVE_SPICE_GTK_TRUE@ virt-viewer-display-spice.h virt-viewer-display-spice.c
45
38 bin_PROGRAMS = $(am__EXEEXT_1) remote-viewer$(EXEEXT)
39 @HAVE_LIBVIRT_TRUE@am__append_1 = virt-viewer
40 @HAVE_GTK_VNC_TRUE@am__append_2 = \
41 @HAVE_GTK_VNC_TRUE@ virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
42 @HAVE_GTK_VNC_TRUE@ virt-viewer-display-vnc.h virt-viewer-display-vnc.c \
43 @HAVE_GTK_VNC_TRUE@ $(NULL)
44
45 @HAVE_GTK_VNC_TRUE@am__append_3 = $(GTK_VNC_LIBS)
46 @HAVE_SPICE_GTK_TRUE@am__append_4 = \
47 @HAVE_SPICE_GTK_TRUE@ virt-viewer-session-spice.h virt-viewer-session-spice.c \
48 @HAVE_SPICE_GTK_TRUE@ virt-viewer-display-spice.h virt-viewer-display-spice.c \
49 @HAVE_SPICE_GTK_TRUE@ $(NULL)
50
51 @HAVE_SPICE_GTK_TRUE@am__append_5 = $(SPICE_GTK_LIBS)
4652 subdir = src
4753 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
4854 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
5662 CONFIG_HEADER = $(top_builddir)/config.h
5763 CONFIG_CLEAN_FILES =
5864 CONFIG_CLEAN_VPATH_FILES =
59 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)"
60 PROGRAMS = $(bin_PROGRAMS)
61 am__virt_viewer_SOURCES_DIST = virt-viewer-main.c virt-viewer.h \
62 virt-viewer.c virt-viewer-util.h virt-viewer-util.c \
63 virt-viewer-auth.h virt-viewer-auth.c virt-viewer-events.h \
64 virt-viewer-events.c virt-viewer-app.h virt-viewer-app.c \
65 virt-viewer-session.h virt-viewer-session.c \
66 virt-viewer-display.h virt-viewer-display.c \
67 virt-viewer-notebook.h virt-viewer-notebook.c \
68 virt-viewer-window.h virt-viewer-window.c view/autoDrawer.c \
69 view/autoDrawer.h view/drawer.c view/drawer.h view/ovBox.c \
70 view/ovBox.h virt-viewer-session-vnc.h \
71 virt-viewer-session-vnc.c virt-viewer-display-vnc.h \
72 virt-viewer-display-vnc.c virt-viewer-session-spice.h \
73 virt-viewer-session-spice.c virt-viewer-display-spice.h \
74 virt-viewer-display-spice.c
75 @HAVE_GTK_VNC_TRUE@am__objects_1 = virt_viewer-virt-viewer-session-vnc.$(OBJEXT) \
76 @HAVE_GTK_VNC_TRUE@ virt_viewer-virt-viewer-display-vnc.$(OBJEXT)
77 @HAVE_SPICE_GTK_TRUE@am__objects_2 = virt_viewer-virt-viewer-session-spice.$(OBJEXT) \
78 @HAVE_SPICE_GTK_TRUE@ virt_viewer-virt-viewer-display-spice.$(OBJEXT)
79 am_virt_viewer_OBJECTS = virt_viewer-virt-viewer-main.$(OBJEXT) \
80 virt_viewer-virt-viewer.$(OBJEXT) \
81 virt_viewer-virt-viewer-util.$(OBJEXT) \
82 virt_viewer-virt-viewer-auth.$(OBJEXT) \
83 virt_viewer-virt-viewer-events.$(OBJEXT) \
84 virt_viewer-virt-viewer-app.$(OBJEXT) \
85 virt_viewer-virt-viewer-session.$(OBJEXT) \
86 virt_viewer-virt-viewer-display.$(OBJEXT) \
87 virt_viewer-virt-viewer-notebook.$(OBJEXT) \
88 virt_viewer-virt-viewer-window.$(OBJEXT) \
89 virt_viewer-autoDrawer.$(OBJEXT) virt_viewer-drawer.$(OBJEXT) \
90 virt_viewer-ovBox.$(OBJEXT) $(am__objects_1) $(am__objects_2)
91 virt_viewer_OBJECTS = $(am_virt_viewer_OBJECTS)
92 virt_viewer_DEPENDENCIES =
65 LTLIBRARIES = $(noinst_LTLIBRARIES)
66 am__DEPENDENCIES_1 =
67 @HAVE_GTK_VNC_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
68 @HAVE_SPICE_GTK_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1)
69 libvirt_viewer_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
70 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
71 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
72 $(am__DEPENDENCIES_3)
73 am__libvirt_viewer_la_SOURCES_DIST = virt-viewer-util.h \
74 virt-viewer-util.c virt-viewer-auth.h virt-viewer-auth.c \
75 virt-viewer-app.h virt-viewer-app.c virt-viewer-session.h \
76 virt-viewer-session.c virt-viewer-display.h \
77 virt-viewer-display.c virt-viewer-notebook.h \
78 virt-viewer-notebook.c virt-viewer-window.h \
79 virt-viewer-window.c view/autoDrawer.c view/autoDrawer.h \
80 view/drawer.c view/drawer.h view/ovBox.c view/ovBox.h \
81 virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
82 virt-viewer-display-vnc.h virt-viewer-display-vnc.c \
83 virt-viewer-session-spice.h virt-viewer-session-spice.c \
84 virt-viewer-display-spice.h virt-viewer-display-spice.c
85 am__objects_1 =
86 @HAVE_GTK_VNC_TRUE@am__objects_2 = virt-viewer-session-vnc.lo \
87 @HAVE_GTK_VNC_TRUE@ virt-viewer-display-vnc.lo $(am__objects_1)
88 @HAVE_SPICE_GTK_TRUE@am__objects_3 = virt-viewer-session-spice.lo \
89 @HAVE_SPICE_GTK_TRUE@ virt-viewer-display-spice.lo \
90 @HAVE_SPICE_GTK_TRUE@ $(am__objects_1)
91 am_libvirt_viewer_la_OBJECTS = virt-viewer-util.lo virt-viewer-auth.lo \
92 virt-viewer-app.lo virt-viewer-session.lo \
93 virt-viewer-display.lo virt-viewer-notebook.lo \
94 virt-viewer-window.lo autoDrawer.lo drawer.lo ovBox.lo \
95 $(am__objects_1) $(am__objects_2) $(am__objects_3)
96 libvirt_viewer_la_OBJECTS = $(am_libvirt_viewer_la_OBJECTS)
9397 AM_V_lt = $(am__v_lt_$(V))
9498 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
9599 am__v_lt_0 = --silent
100 @HAVE_LIBVIRT_TRUE@am__EXEEXT_1 = virt-viewer$(EXEEXT)
101 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)"
102 PROGRAMS = $(bin_PROGRAMS)
103 am_remote_viewer_OBJECTS = remote-viewer.$(OBJEXT) \
104 remote-viewer-main.$(OBJEXT) $(am__objects_1)
105 remote_viewer_OBJECTS = $(am_remote_viewer_OBJECTS)
106 remote_viewer_DEPENDENCIES = libvirt-viewer.la
107 remote_viewer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
108 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
109 $(remote_viewer_LDFLAGS) $(LDFLAGS) -o $@
110 am__virt_viewer_SOURCES_DIST = virt-viewer-events.h \
111 virt-viewer-events.c virt-viewer.h virt-viewer.c \
112 virt-viewer-main.c
113 @HAVE_LIBVIRT_TRUE@am_virt_viewer_OBJECTS = \
114 @HAVE_LIBVIRT_TRUE@ virt_viewer-virt-viewer-events.$(OBJEXT) \
115 @HAVE_LIBVIRT_TRUE@ virt_viewer-virt-viewer.$(OBJEXT) \
116 @HAVE_LIBVIRT_TRUE@ virt_viewer-virt-viewer-main.$(OBJEXT) \
117 @HAVE_LIBVIRT_TRUE@ $(am__objects_1)
118 virt_viewer_OBJECTS = $(am_virt_viewer_OBJECTS)
119 @HAVE_LIBVIRT_TRUE@virt_viewer_DEPENDENCIES = libvirt-viewer.la
96120 virt_viewer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
97121 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(virt_viewer_CFLAGS) \
98 $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
122 $(CFLAGS) $(virt_viewer_LDFLAGS) $(LDFLAGS) -o $@
99123 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
100124 depcomp = $(SHELL) $(top_srcdir)/depcomp
101125 am__depfiles_maybe = depfiles
122146 AM_V_GEN = $(am__v_GEN_$(V))
123147 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
124148 am__v_GEN_0 = @echo " GEN " $@;
125 SOURCES = $(virt_viewer_SOURCES)
126 DIST_SOURCES = $(am__virt_viewer_SOURCES_DIST)
149 SOURCES = $(libvirt_viewer_la_SOURCES) $(remote_viewer_SOURCES) \
150 $(virt_viewer_SOURCES)
151 DIST_SOURCES = $(am__libvirt_viewer_la_SOURCES_DIST) \
152 $(remote_viewer_SOURCES) $(am__virt_viewer_SOURCES_DIST)
127153 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
128154 am__vpath_adj = case $$p in \
129155 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
158184 AUTOHEADER = @AUTOHEADER@
159185 AUTOMAKE = @AUTOMAKE@
160186 AWK = @AWK@
187 CATALOGS = @CATALOGS@
188 CATOBJEXT = @CATOBJEXT@
161189 CC = @CC@
162190 CCDEPMODE = @CCDEPMODE@
163191 CFLAGS = @CFLAGS@
181209 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
182210 GMODULE2_CFLAGS = @GMODULE2_CFLAGS@
183211 GMODULE2_LIBS = @GMODULE2_LIBS@
212 GMOFILES = @GMOFILES@
184213 GMSGFMT = @GMSGFMT@
185214 GREP = @GREP@
186215 GTK_API_VERSION = @GTK_API_VERSION@
195224 INSTALL_PROGRAM = @INSTALL_PROGRAM@
196225 INSTALL_SCRIPT = @INSTALL_SCRIPT@
197226 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
227 INSTOBJEXT = @INSTOBJEXT@
228 INTLLIBS = @INTLLIBS@
198229 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
199230 INTLTOOL_MERGE = @INTLTOOL_MERGE@
200231 INTLTOOL_PERL = @INTLTOOL_PERL@
214245 MAKEINFO = @MAKEINFO@
215246 MANIFEST_TOOL = @MANIFEST_TOOL@
216247 MKDIR_P = @MKDIR_P@
248 MKINSTALLDIRS = @MKINSTALLDIRS@
217249 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
218250 MOZILLA_PLUGIN_LIBS = @MOZILLA_PLUGIN_LIBS@
219251 MSGFMT = @MSGFMT@
252 MSGFMT_OPTS = @MSGFMT_OPTS@
220253 MSGMERGE = @MSGMERGE@
221254 NM = @NM@
222255 NMEDIT = @NMEDIT@
237270 PKG_CONFIG = @PKG_CONFIG@
238271 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
239272 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
273 POFILES = @POFILES@
274 POSUB = @POSUB@
275 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
276 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
240277 RANLIB = @RANLIB@
241278 SED = @SED@
242279 SET_MAKE = @SET_MAKE@
300337 top_build_prefix = @top_build_prefix@
301338 top_builddir = @top_builddir@
302339 top_srcdir = @top_srcdir@
340 NULL =
341 # we are forced to use a shared library,
342 # because libtool reordred .a after .la libs, and it fails to link
343 noinst_LTLIBRARIES = libvirt-viewer.la
303344 builderxmldir = $(pkgdatadir)/ui
304345 builderxml_DATA = \
305 virt-viewer.xml \
306 virt-viewer-about.xml \
307 virt-viewer-auth.xml
346 virt-viewer.xml \
347 virt-viewer-about.xml \
348 virt-viewer-auth.xml \
349 $(NULL)
308350
309351 EXTRA_DIST = $(builderxml_DATA)
310 virt_viewer_SOURCES = virt-viewer-main.c virt-viewer.h virt-viewer.c \
311 virt-viewer-util.h virt-viewer-util.c virt-viewer-auth.h \
312 virt-viewer-auth.c virt-viewer-events.h virt-viewer-events.c \
313 virt-viewer-app.h virt-viewer-app.c virt-viewer-session.h \
314 virt-viewer-session.c virt-viewer-display.h \
315 virt-viewer-display.c virt-viewer-notebook.h \
316 virt-viewer-notebook.c virt-viewer-window.h \
317 virt-viewer-window.c view/autoDrawer.c view/autoDrawer.h \
318 view/drawer.c view/drawer.h view/ovBox.c view/ovBox.h \
319 $(am__append_1) $(am__append_2)
320 virt_viewer_LDADD = \
321 @GTK_VNC_LIBS@ \
322 @SPICE_GTK_LIBS@ \
323 @GMODULE2_LIBS@ \
324 @GTK_LIBS@ \
325 @LIBXML2_LIBS@ \
326 @LIBVIRT_LIBS@
327
328 virt_viewer_CFLAGS = \
329 @GTK_VNC_CFLAGS@ \
330 @SPICE_GTK_CFLAGS@ \
331 @GMODULE2_CFLAGS@ \
332 @GTK_CFLAGS@ \
333 @LIBXML2_CFLAGS@ \
334 @LIBVIRT_CFLAGS@ \
335 @WARN_CFLAGS@ \
336 -DLOCALE_DIR=\""$(datadir)/locale"\"
352 @HAVE_LIBVIRT_TRUE@virt_viewer_SOURCES = \
353 @HAVE_LIBVIRT_TRUE@ virt-viewer-events.h virt-viewer-events.c \
354 @HAVE_LIBVIRT_TRUE@ virt-viewer.h virt-viewer.c \
355 @HAVE_LIBVIRT_TRUE@ virt-viewer-main.c \
356 @HAVE_LIBVIRT_TRUE@ $(NULL)
357
358 @HAVE_LIBVIRT_TRUE@virt_viewer_LDADD = libvirt-viewer.la
359 @HAVE_LIBVIRT_TRUE@virt_viewer_LDFLAGS = \
360 @HAVE_LIBVIRT_TRUE@ $(LIBVIRT_LIBS) \
361 @HAVE_LIBVIRT_TRUE@ $(GMODULE2_LIBS) \
362 @HAVE_LIBVIRT_TRUE@ $(NULL)
363
364 @HAVE_LIBVIRT_TRUE@virt_viewer_CFLAGS = $(AM_CFLAGS) $(LIBVIRT_CFLAGS)
365 remote_viewer_SOURCES = \
366 remote-viewer.h remote-viewer.c \
367 remote-viewer-main.c \
368 $(NULL)
369
370 remote_viewer_LDADD = libvirt-viewer.la
371 remote_viewer_LDFLAGS = \
372 $(GMODULE2_LIBS) \
373 $(NULL)
374
375 libvirt_viewer_la_SOURCES = virt-viewer-util.h virt-viewer-util.c \
376 virt-viewer-auth.h virt-viewer-auth.c virt-viewer-app.h \
377 virt-viewer-app.c virt-viewer-session.h virt-viewer-session.c \
378 virt-viewer-display.h virt-viewer-display.c \
379 virt-viewer-notebook.h virt-viewer-notebook.c \
380 virt-viewer-window.h virt-viewer-window.c view/autoDrawer.c \
381 view/autoDrawer.h view/drawer.c view/drawer.h view/ovBox.c \
382 view/ovBox.h $(NULL) $(am__append_2) $(am__append_4)
383 libvirt_viewer_la_LIBADD = $(GMODULE2_LIBS) $(GTK_LIBS) \
384 $(LIBXML2_LIBS) $(NULL) $(am__append_3) $(am__append_5)
385 AM_CFLAGS = \
386 $(GMODULE2_CFLAGS) \
387 $(GTK_CFLAGS) \
388 $(GTK_VNC_CFLAGS) \
389 $(LIBXML2_CFLAGS) \
390 $(SPICE_GTK_CFLAGS) \
391 $(WARN_CFLAGS) \
392 -DLOCALE_DIR=\""$(datadir)/locale"\" \
393 $(NULL)
337394
338395 all: all-am
339396
369426 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
370427 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
371428 $(am__aclocal_m4_deps):
429
430 clean-noinstLTLIBRARIES:
431 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
432 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
433 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
434 test "$$dir" != "$$p" || dir=.; \
435 echo "rm -f \"$${dir}/so_locations\""; \
436 rm -f "$${dir}/so_locations"; \
437 done
438 libvirt-viewer.la: $(libvirt_viewer_la_OBJECTS) $(libvirt_viewer_la_DEPENDENCIES)
439 $(AM_V_CCLD)$(LINK) $(libvirt_viewer_la_OBJECTS) $(libvirt_viewer_la_LIBADD) $(LIBS)
372440 install-binPROGRAMS: $(bin_PROGRAMS)
373441 @$(NORMAL_INSTALL)
374442 test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
412480 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
413481 echo " rm -f" $$list; \
414482 rm -f $$list
483 remote-viewer$(EXEEXT): $(remote_viewer_OBJECTS) $(remote_viewer_DEPENDENCIES)
484 @rm -f remote-viewer$(EXEEXT)
485 $(AM_V_CCLD)$(remote_viewer_LINK) $(remote_viewer_OBJECTS) $(remote_viewer_LDADD) $(LIBS)
415486 virt-viewer$(EXEEXT): $(virt_viewer_OBJECTS) $(virt_viewer_DEPENDENCIES)
416487 @rm -f virt-viewer$(EXEEXT)
417488 $(AM_V_CCLD)$(virt_viewer_LINK) $(virt_viewer_OBJECTS) $(virt_viewer_LDADD) $(LIBS)
422493 distclean-compile:
423494 -rm -f *.tab.c
424495
425 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-autoDrawer.Po@am__quote@
426 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-drawer.Po@am__quote@
427 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-ovBox.Po@am__quote@
428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-app.Po@am__quote@
429 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-auth.Po@am__quote@
430 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po@am__quote@
431 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po@am__quote@
432 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display.Po@am__quote@
496 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/autoDrawer.Plo@am__quote@
497 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drawer.Plo@am__quote@
498 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ovBox.Plo@am__quote@
499 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-viewer-main.Po@am__quote@
500 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-viewer.Po@am__quote@
501 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-app.Plo@am__quote@
502 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-auth.Plo@am__quote@
503 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-display-spice.Plo@am__quote@
504 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-display-vnc.Plo@am__quote@
505 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-display.Plo@am__quote@
506 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-notebook.Plo@am__quote@
507 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-session-spice.Plo@am__quote@
508 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-session-vnc.Plo@am__quote@
509 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-session.Plo@am__quote@
510 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-util.Plo@am__quote@
511 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt-viewer-window.Plo@am__quote@
433512 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-events.Po@am__quote@
434513 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-main.Po@am__quote@
435 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-notebook.Po@am__quote@
436 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po@am__quote@
437 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po@am__quote@
438 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session.Po@am__quote@
439 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-util.Po@am__quote@
440 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-window.Po@am__quote@
441514 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer.Po@am__quote@
442515
443516 .c.o:
464537 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
465538 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
466539
540 autoDrawer.lo: view/autoDrawer.c
541 @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
542 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/autoDrawer.Tpo $(DEPDIR)/autoDrawer.Plo
543 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
544 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='autoDrawer.lo' libtool=yes @AMDEPBACKSLASH@
545 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
546 @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
547
548 drawer.lo: view/drawer.c
549 @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
550 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/drawer.Tpo $(DEPDIR)/drawer.Plo
551 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
552 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='drawer.lo' libtool=yes @AMDEPBACKSLASH@
553 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
554 @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
555
556 ovBox.lo: view/ovBox.c
557 @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
558 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ovBox.Tpo $(DEPDIR)/ovBox.Plo
559 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
560 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='ovBox.lo' libtool=yes @AMDEPBACKSLASH@
561 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
562 @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
563
564 virt_viewer-virt-viewer-events.o: virt-viewer-events.c
565 @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
566 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po
567 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
568 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.o' libtool=no @AMDEPBACKSLASH@
569 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
570 @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
571
572 virt_viewer-virt-viewer-events.obj: virt-viewer-events.c
573 @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`
574 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po
575 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
576 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.obj' libtool=no @AMDEPBACKSLASH@
577 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
578 @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`
579
580 virt_viewer-virt-viewer.o: virt-viewer.c
581 @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
582 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po
583 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
584 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.o' libtool=no @AMDEPBACKSLASH@
585 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
586 @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
587
588 virt_viewer-virt-viewer.obj: virt-viewer.c
589 @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`
590 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po
591 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
592 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.obj' libtool=no @AMDEPBACKSLASH@
593 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
594 @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`
595
467596 virt_viewer-virt-viewer-main.o: virt-viewer-main.c
468597 @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
469598 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-main.Tpo $(DEPDIR)/virt_viewer-virt-viewer-main.Po
479608 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-main.c' object='virt_viewer-virt-viewer-main.obj' libtool=no @AMDEPBACKSLASH@
480609 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
481610 @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`
482
483 virt_viewer-virt-viewer.o: virt-viewer.c
484 @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
485 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po
486 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
487 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.o' libtool=no @AMDEPBACKSLASH@
488 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
489 @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
490
491 virt_viewer-virt-viewer.obj: virt-viewer.c
492 @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`
493 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po
494 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
495 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.obj' libtool=no @AMDEPBACKSLASH@
496 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
497 @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`
498
499 virt_viewer-virt-viewer-util.o: virt-viewer-util.c
500 @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
501 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo $(DEPDIR)/virt_viewer-virt-viewer-util.Po
502 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
503 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-util.c' object='virt_viewer-virt-viewer-util.o' libtool=no @AMDEPBACKSLASH@
504 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
505 @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
506
507 virt_viewer-virt-viewer-util.obj: virt-viewer-util.c
508 @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`
509 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo $(DEPDIR)/virt_viewer-virt-viewer-util.Po
510 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
511 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-util.c' object='virt_viewer-virt-viewer-util.obj' libtool=no @AMDEPBACKSLASH@
512 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
513 @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`
514
515 virt_viewer-virt-viewer-auth.o: virt-viewer-auth.c
516 @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
517 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo $(DEPDIR)/virt_viewer-virt-viewer-auth.Po
518 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
519 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-auth.c' object='virt_viewer-virt-viewer-auth.o' libtool=no @AMDEPBACKSLASH@
520 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
521 @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
522
523 virt_viewer-virt-viewer-auth.obj: virt-viewer-auth.c
524 @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`
525 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo $(DEPDIR)/virt_viewer-virt-viewer-auth.Po
526 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
527 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-auth.c' object='virt_viewer-virt-viewer-auth.obj' libtool=no @AMDEPBACKSLASH@
528 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
529 @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`
530
531 virt_viewer-virt-viewer-events.o: virt-viewer-events.c
532 @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
533 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po
534 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
535 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.o' libtool=no @AMDEPBACKSLASH@
536 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
537 @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
538
539 virt_viewer-virt-viewer-events.obj: virt-viewer-events.c
540 @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`
541 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po
542 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
543 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.obj' libtool=no @AMDEPBACKSLASH@
544 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
545 @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`
546
547 virt_viewer-virt-viewer-app.o: virt-viewer-app.c
548 @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
549 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-app.Tpo $(DEPDIR)/virt_viewer-virt-viewer-app.Po
550 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
551 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-app.c' object='virt_viewer-virt-viewer-app.o' libtool=no @AMDEPBACKSLASH@
552 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
553 @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
554
555 virt_viewer-virt-viewer-app.obj: virt-viewer-app.c
556 @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`
557 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-app.Tpo $(DEPDIR)/virt_viewer-virt-viewer-app.Po
558 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
559 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-app.c' object='virt_viewer-virt-viewer-app.obj' libtool=no @AMDEPBACKSLASH@
560 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
561 @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`
562
563 virt_viewer-virt-viewer-session.o: virt-viewer-session.c
564 @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
565 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session.Po
566 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
567 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session.c' object='virt_viewer-virt-viewer-session.o' libtool=no @AMDEPBACKSLASH@
568 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
569 @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
570
571 virt_viewer-virt-viewer-session.obj: virt-viewer-session.c
572 @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`
573 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session.Po
574 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
575 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session.c' object='virt_viewer-virt-viewer-session.obj' libtool=no @AMDEPBACKSLASH@
576 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
577 @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`
578
579 virt_viewer-virt-viewer-display.o: virt-viewer-display.c
580 @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
581 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display.Po
582 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
583 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display.c' object='virt_viewer-virt-viewer-display.o' libtool=no @AMDEPBACKSLASH@
584 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
585 @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
586
587 virt_viewer-virt-viewer-display.obj: virt-viewer-display.c
588 @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`
589 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display.Po
590 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
591 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display.c' object='virt_viewer-virt-viewer-display.obj' libtool=no @AMDEPBACKSLASH@
592 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
593 @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`
594
595 virt_viewer-virt-viewer-notebook.o: virt-viewer-notebook.c
596 @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
597 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-notebook.Tpo $(DEPDIR)/virt_viewer-virt-viewer-notebook.Po
598 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
599 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-notebook.c' object='virt_viewer-virt-viewer-notebook.o' libtool=no @AMDEPBACKSLASH@
600 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
601 @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
602
603 virt_viewer-virt-viewer-notebook.obj: virt-viewer-notebook.c
604 @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`
605 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-notebook.Tpo $(DEPDIR)/virt_viewer-virt-viewer-notebook.Po
606 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
607 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-notebook.c' object='virt_viewer-virt-viewer-notebook.obj' libtool=no @AMDEPBACKSLASH@
608 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
609 @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`
610
611 virt_viewer-virt-viewer-window.o: virt-viewer-window.c
612 @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
613 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-window.Tpo $(DEPDIR)/virt_viewer-virt-viewer-window.Po
614 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
615 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-window.c' object='virt_viewer-virt-viewer-window.o' libtool=no @AMDEPBACKSLASH@
616 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
617 @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
618
619 virt_viewer-virt-viewer-window.obj: virt-viewer-window.c
620 @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`
621 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-window.Tpo $(DEPDIR)/virt_viewer-virt-viewer-window.Po
622 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
623 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-window.c' object='virt_viewer-virt-viewer-window.obj' libtool=no @AMDEPBACKSLASH@
624 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
625 @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`
626
627 virt_viewer-autoDrawer.o: view/autoDrawer.c
628 @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
629 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-autoDrawer.Tpo $(DEPDIR)/virt_viewer-autoDrawer.Po
630 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
631 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='virt_viewer-autoDrawer.o' libtool=no @AMDEPBACKSLASH@
632 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
633 @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
634
635 virt_viewer-autoDrawer.obj: view/autoDrawer.c
636 @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`
637 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-autoDrawer.Tpo $(DEPDIR)/virt_viewer-autoDrawer.Po
638 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
639 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='virt_viewer-autoDrawer.obj' libtool=no @AMDEPBACKSLASH@
640 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
641 @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`
642
643 virt_viewer-drawer.o: view/drawer.c
644 @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
645 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-drawer.Tpo $(DEPDIR)/virt_viewer-drawer.Po
646 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
647 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='virt_viewer-drawer.o' libtool=no @AMDEPBACKSLASH@
648 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
649 @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
650
651 virt_viewer-drawer.obj: view/drawer.c
652 @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`
653 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-drawer.Tpo $(DEPDIR)/virt_viewer-drawer.Po
654 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
655 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='virt_viewer-drawer.obj' libtool=no @AMDEPBACKSLASH@
656 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
657 @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`
658
659 virt_viewer-ovBox.o: view/ovBox.c
660 @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
661 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-ovBox.Tpo $(DEPDIR)/virt_viewer-ovBox.Po
662 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
663 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='virt_viewer-ovBox.o' libtool=no @AMDEPBACKSLASH@
664 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
665 @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
666
667 virt_viewer-ovBox.obj: view/ovBox.c
668 @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`
669 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-ovBox.Tpo $(DEPDIR)/virt_viewer-ovBox.Po
670 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
671 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='virt_viewer-ovBox.obj' libtool=no @AMDEPBACKSLASH@
672 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
673 @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`
674
675 virt_viewer-virt-viewer-session-vnc.o: virt-viewer-session-vnc.c
676 @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
677 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po
678 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
679 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-vnc.c' object='virt_viewer-virt-viewer-session-vnc.o' libtool=no @AMDEPBACKSLASH@
680 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
681 @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
682
683 virt_viewer-virt-viewer-session-vnc.obj: virt-viewer-session-vnc.c
684 @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`
685 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po
686 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
687 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-vnc.c' object='virt_viewer-virt-viewer-session-vnc.obj' libtool=no @AMDEPBACKSLASH@
688 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
689 @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`
690
691 virt_viewer-virt-viewer-display-vnc.o: virt-viewer-display-vnc.c
692 @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
693 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po
694 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
695 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-vnc.c' object='virt_viewer-virt-viewer-display-vnc.o' libtool=no @AMDEPBACKSLASH@
696 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
697 @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
698
699 virt_viewer-virt-viewer-display-vnc.obj: virt-viewer-display-vnc.c
700 @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`
701 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po
702 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
703 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-vnc.c' object='virt_viewer-virt-viewer-display-vnc.obj' libtool=no @AMDEPBACKSLASH@
704 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
705 @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`
706
707 virt_viewer-virt-viewer-session-spice.o: virt-viewer-session-spice.c
708 @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
709 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po
710 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
711 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-spice.c' object='virt_viewer-virt-viewer-session-spice.o' libtool=no @AMDEPBACKSLASH@
712 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
713 @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
714
715 virt_viewer-virt-viewer-session-spice.obj: virt-viewer-session-spice.c
716 @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`
717 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po
718 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
719 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-spice.c' object='virt_viewer-virt-viewer-session-spice.obj' libtool=no @AMDEPBACKSLASH@
720 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
721 @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`
722
723 virt_viewer-virt-viewer-display-spice.o: virt-viewer-display-spice.c
724 @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
725 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po
726 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
727 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-spice.c' object='virt_viewer-virt-viewer-display-spice.o' libtool=no @AMDEPBACKSLASH@
728 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
729 @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
730
731 virt_viewer-virt-viewer-display-spice.obj: virt-viewer-display-spice.c
732 @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`
733 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po
734 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
735 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-spice.c' object='virt_viewer-virt-viewer-display-spice.obj' libtool=no @AMDEPBACKSLASH@
736 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
737 @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`
738611
739612 mostlyclean-libtool:
740613 -rm -f *.lo
846719 done
847720 check-am: all-am
848721 check: check-am
849 all-am: Makefile $(PROGRAMS) $(DATA)
722 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA)
850723 installdirs:
851724 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)"; do \
852725 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
878751 @echo "it deletes files that may require special tools to rebuild."
879752 clean: clean-am
880753
881 clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
754 clean-am: clean-binPROGRAMS clean-generic clean-libtool \
755 clean-noinstLTLIBRARIES mostlyclean-am
882756
883757 distclean: distclean-am
884758 -rm -rf ./$(DEPDIR)
949823 .MAKE: install-am install-strip
950824
951825 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
952 clean-generic clean-libtool ctags distclean distclean-compile \
953 distclean-generic distclean-libtool distclean-tags distdir dvi \
954 dvi-am html html-am info info-am install install-am \
955 install-binPROGRAMS install-builderxmlDATA install-data \
956 install-data-am install-dvi install-dvi-am install-exec \
957 install-exec-am install-html install-html-am install-info \
958 install-info-am install-man install-pdf install-pdf-am \
959 install-ps install-ps-am install-strip installcheck \
960 installcheck-am installdirs maintainer-clean \
961 maintainer-clean-generic mostlyclean mostlyclean-compile \
962 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
963 tags uninstall uninstall-am uninstall-binPROGRAMS \
964 uninstall-builderxmlDATA
826 clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \
827 distclean distclean-compile distclean-generic \
828 distclean-libtool distclean-tags distdir dvi dvi-am html \
829 html-am info info-am install install-am install-binPROGRAMS \
830 install-builderxmlDATA install-data install-data-am \
831 install-dvi install-dvi-am install-exec install-exec-am \
832 install-html install-html-am install-info install-info-am \
833 install-man install-pdf install-pdf-am install-ps \
834 install-ps-am install-strip installcheck installcheck-am \
835 installdirs maintainer-clean maintainer-clean-generic \
836 mostlyclean mostlyclean-compile mostlyclean-generic \
837 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
838 uninstall-am uninstall-binPROGRAMS uninstall-builderxmlDATA
965839
966840
967841 # Tell versions [3.59,3.63) of GNU make to not export all variables.
0 /*
1 * Remote Viewer: A spice/vnc client based on virt-viewer
2 *
3 * Copyright (C) 2011-2012 Red Hat, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Marc-André Lureau <marcandre.lureau@redhat.com>
20 */
21
22 #include <config.h>
23 #include <locale.h>
24 #include <gtk/gtk.h>
25 #include <glib/gi18n.h>
26 #include <stdlib.h>
27
28 #ifdef HAVE_GTK_VNC
29 #include <vncdisplay.h>
30 #endif
31 #ifdef HAVE_SPICE_GTK
32 #include <spice-option.h>
33 #endif
34
35 #include "remote-viewer.h"
36 #include "virt-viewer-app.h"
37
38 static void
39 remote_viewer_version(void)
40 {
41 g_print(_("remote-viewer version %s\n"), VERSION);
42 exit(EXIT_SUCCESS);
43 }
44
45 int
46 main(int argc, char **argv)
47 {
48 GOptionContext *context;
49 GError *error = NULL;
50 int ret = 1;
51 int zoom = 100;
52 gchar **args = NULL;
53 gboolean verbose = FALSE;
54 gboolean debug = FALSE;
55 gboolean direct = FALSE;
56 gboolean fullscreen = FALSE;
57 RemoteViewer *viewer = NULL;
58 #if HAVE_SPICE_GTK
59 gboolean controller = FALSE;
60 #endif
61 VirtViewerApp *app;
62 const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options");
63 const GOptionEntry options [] = {
64 { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
65 remote_viewer_version, N_("Display version information"), NULL },
66 { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
67 N_("Display verbose information"), NULL },
68 { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct,
69 N_("Direct connection with no automatic tunnels"), NULL },
70 { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom,
71 N_("Zoom level of window, in percentage"), "ZOOM" },
72 { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug,
73 N_("Display debugging information"), NULL },
74 { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen,
75 N_("Open in full screen mode"), NULL },
76 #if HAVE_SPICE_GTK
77 { "spice-controller", '\0', 0, G_OPTION_ARG_NONE, &controller,
78 N_("Open connection using Spice controller communication"), NULL },
79 #endif
80 { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
81 NULL, "URI" },
82 { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
83 };
84
85 setlocale(LC_ALL, "");
86 bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
87 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
88 textdomain(GETTEXT_PACKAGE);
89
90 /* Setup command line options */
91 context = g_option_context_new (_("- Remote viewer client"));
92 g_option_context_add_main_entries (context, options, NULL);
93 g_option_context_add_group (context, gtk_get_option_group (TRUE));
94 #ifdef HAVE_GTK_VNC
95 g_option_context_add_group (context, vnc_display_get_option_group ());
96 #endif
97 #ifdef HAVE_SPICE_GTK
98 g_option_context_add_group (context, spice_get_option_group ());
99 #endif
100 g_option_context_parse (context, &argc, &argv, &error);
101 if (error) {
102 g_printerr("%s\n%s\n",
103 error->message,
104 gettext(help_msg));
105 g_error_free(error);
106 goto cleanup;
107 }
108
109 g_option_context_free(context);
110
111 if ((!args || (g_strv_length(args) != 1))
112 #if HAVE_SPICE_GTK
113 && !controller
114 #endif
115 ) {
116 g_printerr(_("\nUsage: %s [OPTIONS] URI\n\n%s\n\n"), argv[0], help_msg);
117 goto cleanup;
118 }
119
120 if (zoom < 10 || zoom > 200) {
121 g_printerr(_("Zoom level must be within 10-200\n"));
122 goto cleanup;
123 }
124
125 gtk_window_set_default_icon_name("virt-viewer");
126
127 virt_viewer_app_set_debug(debug);
128
129 #if HAVE_SPICE_GTK
130 if (controller) {
131 viewer = remote_viewer_new_with_controller(verbose);
132 g_object_set(viewer, "guest-name", "defined by Spice controller", NULL);
133 } else {
134 #endif
135 viewer = remote_viewer_new(args[0], verbose);
136 g_object_set(viewer, "guest-name", args[0], NULL);
137 #if HAVE_SPICE_GTK
138 }
139 #endif
140 if (viewer == NULL)
141 goto cleanup;
142
143 app = VIRT_VIEWER_APP(viewer);
144 g_object_set(app, "fullscreen", fullscreen, NULL);
145 virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom);
146 virt_viewer_app_set_direct(app, direct);
147
148 if (!virt_viewer_app_start(app))
149 goto cleanup;
150
151 gtk_main();
152
153 ret = 0;
154
155 cleanup:
156 if (viewer)
157 g_object_unref(viewer);
158 g_strfreev(args);
159
160 return ret;
161 }
162
163 /*
164 * Local variables:
165 * c-indent-level: 4
166 * c-basic-offset: 4
167 * indent-tabs-mode: nil
168 * End:
169 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Marc-André Lureau <marcandre.lureau@redhat.com>
22 */
23
24 #include <config.h>
25 #include <gtk/gtk.h>
26 #include <glib/gprintf.h>
27 #include <glib/gi18n.h>
28
29 #ifdef HAVE_SPICE_GTK
30 #include <spice-controller/spice-controller.h>
31 #endif
32
33 #ifdef HAVE_SPICE_GTK
34 #include "virt-viewer-session-spice.h"
35 #endif
36 #include "virt-viewer-app.h"
37 #include "remote-viewer.h"
38
39 struct _RemoteViewerPrivate {
40 #ifdef HAVE_SPICE_GTK
41 SpiceCtrlController *controller;
42 #endif
43 GtkWidget *controller_menu;
44 };
45
46 G_DEFINE_TYPE (RemoteViewer, remote_viewer, VIRT_VIEWER_TYPE_APP)
47 #define GET_PRIVATE(o) \
48 (G_TYPE_INSTANCE_GET_PRIVATE ((o), REMOTE_VIEWER_TYPE, RemoteViewerPrivate))
49
50 #if HAVE_SPICE_GTK
51 enum {
52 PROP_0,
53 PROP_CONTROLLER,
54 };
55 #endif
56
57 static gboolean remote_viewer_start(VirtViewerApp *self);
58 #if HAVE_SPICE_GTK
59 static int remote_viewer_activate(VirtViewerApp *self);
60 #endif
61 static void remote_viewer_window_added(VirtViewerApp *self, VirtViewerWindow *win);
62
63 #if HAVE_SPICE_GTK
64 static void
65 remote_viewer_get_property (GObject *object, guint property_id,
66 GValue *value, GParamSpec *pspec)
67 {
68 RemoteViewer *self = REMOTE_VIEWER(object);
69 RemoteViewerPrivate *priv = self->priv;
70
71 switch (property_id) {
72 case PROP_CONTROLLER:
73 g_value_set_object(value, priv->controller);
74 break;
75 default:
76 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
77 }
78 }
79
80 static void
81 remote_viewer_set_property (GObject *object, guint property_id,
82 const GValue *value, GParamSpec *pspec)
83 {
84 RemoteViewer *self = REMOTE_VIEWER(object);
85 RemoteViewerPrivate *priv = self->priv;
86
87 switch (property_id) {
88 case PROP_CONTROLLER:
89 g_return_if_fail(priv->controller == NULL);
90 priv->controller = g_value_dup_object(value);
91 break;
92 default:
93 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
94 }
95 }
96
97 static void
98 remote_viewer_dispose (GObject *object)
99 {
100 RemoteViewer *self = REMOTE_VIEWER(object);
101 RemoteViewerPrivate *priv = self->priv;
102
103 if (priv->controller) {
104 g_object_unref(priv->controller);
105 priv->controller = NULL;
106 }
107
108 G_OBJECT_CLASS(remote_viewer_parent_class)->dispose (object);
109 }
110 #endif
111
112
113 static void
114 remote_viewer_class_init (RemoteViewerClass *klass)
115 {
116 #if HAVE_SPICE_GTK
117 GObjectClass *object_class = G_OBJECT_CLASS (klass);
118 #endif
119 VirtViewerAppClass *app_class = VIRT_VIEWER_APP_CLASS (klass);
120
121 g_type_class_add_private (klass, sizeof (RemoteViewerPrivate));
122
123 #if HAVE_SPICE_GTK
124 object_class->get_property = remote_viewer_get_property;
125 object_class->set_property = remote_viewer_set_property;
126 object_class->dispose = remote_viewer_dispose;
127 #endif
128
129 app_class->start = remote_viewer_start;
130 #if HAVE_SPICE_GTK
131 app_class->activate = remote_viewer_activate;
132 #endif
133 app_class->window_added = remote_viewer_window_added;
134
135 #if HAVE_SPICE_GTK
136 g_object_class_install_property(object_class,
137 PROP_CONTROLLER,
138 g_param_spec_object("controller",
139 "Controller",
140 "Spice controller",
141 SPICE_CTRL_TYPE_CONTROLLER,
142 G_PARAM_READWRITE |
143 G_PARAM_CONSTRUCT_ONLY |
144 G_PARAM_STATIC_STRINGS));
145 #endif
146 }
147
148 static void
149 remote_viewer_init(RemoteViewer *self)
150 {
151 self->priv = GET_PRIVATE(self);
152 }
153
154 RemoteViewer *
155 remote_viewer_new(const gchar *uri, gboolean verbose)
156 {
157 return g_object_new(REMOTE_VIEWER_TYPE,
158 "guri", uri,
159 "verbose", verbose,
160 NULL);
161 }
162
163 #if HAVE_SPICE_GTK
164 RemoteViewer *
165 remote_viewer_new_with_controller(gboolean verbose)
166 {
167 RemoteViewer *self;
168 SpiceCtrlController *ctrl = spice_ctrl_controller_new();
169
170 self = g_object_new(REMOTE_VIEWER_TYPE,
171 "controller", ctrl,
172 "verbose", verbose,
173 NULL);
174 g_object_unref(ctrl);
175
176 return self;
177 }
178
179 static void
180 spice_ctrl_do_connect(SpiceCtrlController *ctrl G_GNUC_UNUSED,
181 VirtViewerApp *self)
182 {
183 if (virt_viewer_app_initial_connect(self) < 0) {
184 virt_viewer_app_simple_message_dialog(self, _("Failed to initiate connection"));
185 }
186 }
187
188 static void
189 spice_ctrl_show(SpiceCtrlController *ctrl G_GNUC_UNUSED, RemoteViewer *self)
190 {
191 virt_viewer_app_show_display(VIRT_VIEWER_APP(self));
192 }
193
194 static void
195 spice_ctrl_hide(SpiceCtrlController *ctrl G_GNUC_UNUSED, RemoteViewer *self)
196 {
197 virt_viewer_app_show_status(VIRT_VIEWER_APP(self), _("Display disabled by controller"));
198 }
199
200 static void
201 spice_menuitem_activate_cb(GtkMenuItem *mi, RemoteViewer *self)
202 {
203 SpiceCtrlMenuItem *menuitem = g_object_get_data(G_OBJECT(mi), "spice-menuitem");
204
205 g_return_if_fail(menuitem != NULL);
206 if (gtk_menu_item_get_submenu(mi))
207 return;
208
209 spice_ctrl_controller_menu_item_click_msg(self->priv->controller, menuitem->id);
210 }
211
212 static GtkWidget *
213 ctrlmenu_to_gtkmenu (RemoteViewer *self, SpiceCtrlMenu *ctrlmenu)
214 {
215 GList *l;
216 GtkWidget *menu = gtk_menu_new();
217 guint n = 0;
218
219 for (l = ctrlmenu->items; l != NULL; l = l->next) {
220 SpiceCtrlMenuItem *menuitem = l->data;
221 GtkWidget *item;
222 char *s;
223 if (menuitem->text == NULL) {
224 g_warn_if_reached();
225 continue;
226 }
227
228 for (s = menuitem->text; *s; s++)
229 if (*s == '&')
230 *s = '_';
231
232 if (g_str_equal(menuitem->text, "-")){
233 item = gtk_separator_menu_item_new();
234 } else {
235 item = gtk_menu_item_new_with_mnemonic(menuitem->text);
236 }
237
238 g_object_set_data_full(G_OBJECT(item), "spice-menuitem",
239 g_object_ref(menuitem), g_object_unref);
240 g_signal_connect(item, "activate", G_CALLBACK(spice_menuitem_activate_cb), self);
241 gtk_menu_attach(GTK_MENU (menu), item, 0, 1, n, n + 1);
242 n += 1;
243
244 if (menuitem->submenu) {
245 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item),
246 ctrlmenu_to_gtkmenu(self, menuitem->submenu));
247 }
248 }
249
250 if (n == 0) {
251 g_object_ref_sink(menu);
252 g_object_unref(menu);
253 menu = NULL;
254 }
255
256 gtk_widget_show_all(menu);
257 return menu;
258 }
259
260 static void
261 spice_menu_set_visible(gpointer key G_GNUC_UNUSED,
262 gpointer value,
263 gpointer user_data)
264 {
265 gboolean visible = GPOINTER_TO_INT(user_data);
266 GtkWidget *menu = g_object_get_data(value, "spice-menu");
267
268 gtk_widget_set_visible(menu, visible);
269 }
270
271 static void
272 remote_viewer_window_spice_menu_set_visible(RemoteViewer *self,
273 gboolean visible)
274 {
275 GHashTable *windows = virt_viewer_app_get_windows(VIRT_VIEWER_APP(self));
276
277 g_hash_table_foreach(windows, spice_menu_set_visible, GINT_TO_POINTER(visible));
278 }
279
280 static void
281 spice_menu_update(gpointer key G_GNUC_UNUSED,
282 gpointer value,
283 gpointer user_data)
284 {
285 RemoteViewer *self = REMOTE_VIEWER(user_data);
286 GtkWidget *menuitem = g_object_get_data(value, "spice-menu");
287 SpiceCtrlMenu *menu;
288
289 g_object_get(self->priv->controller, "menu", &menu, NULL);
290 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), ctrlmenu_to_gtkmenu(self, menu));
291 g_object_unref(menu);
292 }
293
294 static void
295 spice_ctrl_menu_updated(RemoteViewer *self,
296 SpiceCtrlMenu *menu)
297 {
298 GHashTable *windows = virt_viewer_app_get_windows(VIRT_VIEWER_APP(self));
299 RemoteViewerPrivate *priv = self->priv;
300 gboolean visible;
301
302 DEBUG_LOG("Spice controller menu updated");
303
304 if (priv->controller_menu != NULL) {
305 g_object_unref (priv->controller_menu);
306 priv->controller_menu = NULL;
307 }
308
309 if (menu && g_list_length(menu->items) > 0) {
310 priv->controller_menu = ctrlmenu_to_gtkmenu(self, menu);
311 g_hash_table_foreach(windows, spice_menu_update, self);
312 }
313
314 visible = priv->controller_menu != NULL;
315
316 remote_viewer_window_spice_menu_set_visible(self, visible);
317 }
318
319 static SpiceSession *
320 remote_viewer_get_spice_session(RemoteViewer *self)
321 {
322 VirtViewerSession *vsession = NULL;
323 SpiceSession *session = NULL;
324
325 g_object_get(self, "session", &vsession, NULL);
326 g_return_val_if_fail(vsession != NULL, NULL);
327
328 g_object_get(vsession, "spice-session", &session, NULL);
329
330 g_object_unref(vsession);
331
332 return session;
333 }
334
335 #ifndef G_VALUE_INIT /* see bug https://bugzilla.gnome.org/show_bug.cgi?id=654793 */
336 #define G_VALUE_INIT { 0, { { 0 } } }
337 #endif
338
339 static void
340 spice_ctrl_notified(SpiceCtrlController *ctrl,
341 GParamSpec *pspec,
342 RemoteViewer *self)
343 {
344 SpiceSession *session = remote_viewer_get_spice_session(self);
345 GValue value = G_VALUE_INIT;
346 VirtViewerApp *app = VIRT_VIEWER_APP(self);
347
348 g_return_if_fail(session != NULL);
349
350 g_value_init(&value, pspec->value_type);
351 g_object_get_property(G_OBJECT(ctrl), pspec->name, &value);
352
353 if (g_str_equal(pspec->name, "host") ||
354 g_str_equal(pspec->name, "port") ||
355 g_str_equal(pspec->name, "password") ||
356 g_str_equal(pspec->name, "ca-file")) {
357 g_object_set_property(G_OBJECT(session), pspec->name, &value);
358 } else if (g_str_equal(pspec->name, "sport")) {
359 g_object_set_property(G_OBJECT(session), "tls-port", &value);
360 } else if (g_str_equal(pspec->name, "tls-ciphers")) {
361 g_object_set_property(G_OBJECT(session), "ciphers", &value);
362 } else if (g_str_equal(pspec->name, "host-subject")) {
363 g_object_set_property(G_OBJECT(session), "cert-subject", &value);
364 } else if (g_str_equal(pspec->name, "title")) {
365 g_object_set_property(G_OBJECT(app), "title", &value);
366 } else if (g_str_equal(pspec->name, "display-flags")) {
367 guint flags = g_value_get_uint(&value);
368 gboolean fullscreen = flags & CONTROLLER_SET_FULL_SCREEN;
369 gboolean auto_res = flags & CONTROLLER_AUTO_DISPLAY_RES;
370 g_object_set(G_OBJECT(self), "fullscreen", fullscreen, NULL);
371 g_debug("unimplemented resize-guest %d", auto_res);
372 /* g_object_set(G_OBJECT(self), "resize-guest", auto_res, NULL); */
373 } else if (g_str_equal(pspec->name, "menu")) {
374 spice_ctrl_menu_updated(self, g_value_get_object(&value));
375 } else {
376 gchar *content = g_strdup_value_contents(&value);
377
378 g_debug("unimplemented property: %s=%s", pspec->name, content);
379 g_free(content);
380 }
381
382 g_object_unref(session);
383 g_value_unset(&value);
384 }
385
386 static void
387 spice_ctrl_listen_async_cb(GObject *object,
388 GAsyncResult *res,
389 gpointer user_data)
390 {
391 GError *error = NULL;
392
393 spice_ctrl_controller_listen_finish(SPICE_CTRL_CONTROLLER(object), res, &error);
394
395 if (error != NULL) {
396 virt_viewer_app_simple_message_dialog(VIRT_VIEWER_APP(user_data),
397 _("Controller connection failed: %s"),
398 error->message);
399 g_clear_error(&error);
400 exit(EXIT_FAILURE); /* TODO: make start async? */
401 }
402 }
403
404
405 static int
406 remote_viewer_activate(VirtViewerApp *app)
407 {
408 g_return_val_if_fail(REMOTE_VIEWER_IS(app), -1);
409 RemoteViewer *self = REMOTE_VIEWER(app);
410 int ret = -1;
411
412 if (self->priv->controller) {
413 SpiceSession *session = remote_viewer_get_spice_session(self);
414 ret = spice_session_connect(session);
415 g_object_unref(session);
416 } else {
417 ret = VIRT_VIEWER_APP_CLASS(remote_viewer_parent_class)->activate(app);
418 }
419
420 return ret;
421 }
422 #endif
423
424 static void
425 remote_viewer_window_added(VirtViewerApp *self G_GNUC_UNUSED,
426 VirtViewerWindow *win)
427 {
428 GtkMenuShell *shell = GTK_MENU_SHELL(gtk_builder_get_object(virt_viewer_window_get_builder(win), "top-menu"));
429 GtkWidget *spice = gtk_menu_item_new_with_label("Spice");
430
431 gtk_menu_shell_append(shell, spice);
432 g_object_set_data(G_OBJECT(win), "spice-menu", spice);
433 }
434
435 static gboolean
436 remote_viewer_start(VirtViewerApp *app)
437 {
438 g_return_val_if_fail(REMOTE_VIEWER_IS(app), FALSE);
439
440 #if HAVE_SPICE_GTK
441 RemoteViewer *self = REMOTE_VIEWER(app);
442 RemoteViewerPrivate *priv = self->priv;
443 #endif
444 gboolean ret = FALSE;
445 gchar *guri = NULL;
446 gchar *type = NULL;
447
448 #if HAVE_SPICE_GTK
449 if (priv->controller) {
450 if (virt_viewer_app_create_session(app, "spice") < 0) {
451 virt_viewer_app_simple_message_dialog(app, _("Couldn't create a Spice session"));
452 goto cleanup;
453 }
454
455 g_signal_connect(priv->controller, "notify", G_CALLBACK(spice_ctrl_notified), self);
456 g_signal_connect(priv->controller, "do_connect", G_CALLBACK(spice_ctrl_do_connect), self);
457 g_signal_connect(priv->controller, "show", G_CALLBACK(spice_ctrl_show), self);
458 g_signal_connect(priv->controller, "hide", G_CALLBACK(spice_ctrl_hide), self);
459
460 spice_ctrl_controller_listen(priv->controller, NULL, spice_ctrl_listen_async_cb, self);
461 virt_viewer_app_show_status(VIRT_VIEWER_APP(self), _("Setting up Spice session..."));
462 } else {
463 #endif
464 g_object_get(app, "guri", &guri, NULL);
465 g_return_val_if_fail(guri != NULL, FALSE);
466
467 DEBUG_LOG("Opening display to %s", guri);
468 g_object_set(app, "title", guri, NULL);
469
470 if (virt_viewer_util_extract_host(guri, &type, NULL, NULL, NULL, NULL) < 0) {
471 virt_viewer_app_simple_message_dialog(app, _("Cannot determine the connection type from URI"));
472 goto cleanup;
473 }
474
475 if (virt_viewer_app_create_session(app, type) < 0) {
476 virt_viewer_app_simple_message_dialog(app, _("Couldn't create a session for this type: %s"), type);
477 goto cleanup;
478 }
479
480 if (virt_viewer_app_initial_connect(app) < 0) {
481 virt_viewer_app_simple_message_dialog(app, _("Failed to initiate connection"));
482 goto cleanup;
483 }
484 #if HAVE_SPICE_GTK
485 }
486 #endif
487
488 ret = VIRT_VIEWER_APP_CLASS(remote_viewer_parent_class)->start(app);
489
490 cleanup:
491 g_free(guri);
492 g_free(type);
493 return ret;
494 }
495
496 /*
497 * Local variables:
498 * c-indent-level: 4
499 * c-basic-offset: 4
500 * indent-tabs-mode: nil
501 * End:
502 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #ifndef REMOTE_VIEWER_H
23 #define REMOTE_VIEWER_H
24
25 #include <glib-object.h>
26 #include "virt-viewer-app.h"
27
28 G_BEGIN_DECLS
29
30 #define REMOTE_VIEWER_TYPE remote_viewer_get_type()
31 #define REMOTE_VIEWER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), REMOTE_VIEWER_TYPE, RemoteViewer))
32 #define REMOTE_VIEWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), REMOTE_VIEWER_TYPE, RemoteViewerClass))
33 #define REMOTE_VIEWER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), REMOTE_VIEWER_TYPE))
34 #define REMOTE_VIEWER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), REMOTE_VIEWER_TYPE))
35 #define REMOTE_VIEWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REMOTE_VIEWER_TYPE, RemoteViewerClass))
36
37 typedef struct _RemoteViewerPrivate RemoteViewerPrivate;
38
39 typedef struct {
40 VirtViewerApp parent;
41 RemoteViewerPrivate *priv;
42 } RemoteViewer;
43
44 typedef struct {
45 VirtViewerAppClass parent_class;
46 } RemoteViewerClass;
47
48 GType remote_viewer_get_type (void);
49
50 RemoteViewer* remote_viewer_new(const gchar *uri, gboolean verbose);
51 RemoteViewer* remote_viewer_new_with_controller(gboolean verbose);
52
53 G_END_DECLS
54
55 #endif /* REMOTE_VIEWER_H */
56 /*
57 * Local variables:
58 * c-indent-level: 4
59 * c-basic-offset: 4
60 * indent-tabs-mode: nil
61 * End:
62 */
2828 * moused-over and auto-closes when the mouse leaves.
2929 */
3030
31 #include <config.h>
3132
3233 #include "autoDrawer.h"
3334
256257 }
257258 #else
258259 if (window->group && window->group->grabs) {
259 grabbed = GTK_WIDGET(window->group->grabs->data);
260 grabbed = GTK_WIDGET(window->group->grabs->data);
260261 }
261262 #endif
262263 if (!grabbed) {
439440
440441 static void
441442 ViewAutoDrawerOnHierarchyChanged(ViewAutoDrawer *that, // IN
442 GtkWidget *oldToplevel) // IN
443 GtkWidget *oldToplevel) // IN
443444 {
444445 GtkWidget *newToplevel = gtk_widget_get_toplevel(GTK_WIDGET(that));
445446
652653
653654 ovBoxClass->set_over = ViewAutoDrawerSetOver;
654655
655 g_type_class_add_private(objectClass, sizeof(ViewAutoDrawerPrivate));
656 g_type_class_add_private(klass, sizeof(ViewAutoDrawerPrivate));
656657 }
657658
658659
688689 sizeof (ViewAutoDrawer),
689690 0, /* n_preallocs */
690691 (GInstanceInitFunc)ViewAutoDrawerInit,
691 NULL,
692 NULL,
692693 };
693694
694695 type = g_type_register_static(VIEW_TYPE_DRAWER, "ViewAutoDrawer", &info, 0);
2727 * sliding smoothly, at constant speed, over another one.
2828 */
2929
30 #include <config.h>
3031
3132 #include "drawer.h"
3233
138139
139140 objectClass->finalize = ViewDrawerFinalize;
140141
141 g_type_class_add_private(objectClass, sizeof(ViewDrawerPrivate));
142 g_type_class_add_private(klass, sizeof(ViewDrawerPrivate));
142143 }
143144
144145
174175 sizeof (ViewDrawer),
175176 0, /* n_preallocs */
176177 (GInstanceInitFunc)ViewDrawerInit,
177 NULL
178 NULL
178179 };
179180
180181 type = g_type_register_static(VIEW_TYPE_OV_BOX, "ViewDrawer", &info, 0);
7171 * --hpreg
7272 */
7373
74 #include <config.h>
7475
7576 #include "ovBox.h"
7677
7778 #if ! GTK_CHECK_VERSION(3, 0, 0)
78 #define gtk_widget_set_realized(widget, val) \
79 #define gtk_widget_set_realized(widget, val) \
7980 GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED)
80 #define gtk_widget_get_realized(widget) \
81 #define gtk_widget_get_realized(widget) \
8182 GTK_WIDGET_REALIZED(widget)
8283 #endif
8384
705706 static void
706707 ViewOvBoxClassInit(ViewOvBoxClass *klass) // IN
707708 {
708 GObjectClass *objectClass;
709709 GtkWidgetClass *widgetClass;
710710
711 objectClass = G_OBJECT_CLASS(klass);
712711 widgetClass = GTK_WIDGET_CLASS(klass);
713712
714713 widgetClass->map = ViewOvBoxMap;
728727
729728 parentClass = g_type_class_peek_parent(klass);
730729
731 g_type_class_add_private(objectClass, sizeof(ViewOvBoxPrivate));
730 g_type_class_add_private(klass, sizeof(ViewOvBoxPrivate));
732731 }
733732
734733
764763 sizeof (ViewOvBox),
765764 0, /* n_preallocs */
766765 (GInstanceInitFunc)ViewOvBoxInit,
767 NULL,
766 NULL,
768767 };
769768
770769 type = g_type_register_static(GTK_TYPE_BOX, "ViewOvBox", &info, 0);
0 <?xml version="1.0"?>
0 <?xml version="1.0" encoding="UTF-8"?>
11 <interface>
22 <!-- interface-requires gtk+ 2.12 -->
3 <!-- interface-naming-policy toplevel-contextual -->
43 <object class="GtkAboutDialog" id="about">
4 <property name="can_focus">False</property>
55 <property name="border_width">5</property>
66 <property name="title" translatable="yes">About Glade</property>
77 <property name="resizable">False</property>
8 <property name="modal">True</property>
89 <property name="window_position">center-on-parent</property>
10 <property name="destroy_with_parent">True</property>
911 <property name="type_hint">dialog</property>
12 <property name="skip_taskbar_hint">True</property>
13 <property name="skip_pager_hint">True</property>
1014 <property name="program_name">Virtual Machine Viewer</property>
11 <property name="copyright" translatable="yes">Copyright 2007-2011 Daniel P. Berrange
12 Copyright 2007-2011 Red Hat, Inc.</property>
15 <property name="copyright" translatable="yes">Copyright (C) 2007-2012 Daniel P. Berrange
16 Copyright (C) 2007-2012 Red Hat, Inc.</property>
1317 <property name="comments" translatable="yes">A remote desktop client built with GTK-VNC, SPICE-GTK and libvirt</property>
1418 <property name="website">http://virt-manager.org/</property>
1519 <property name="website_label" translatable="yes">virt-manager.org</property>
3135 Marc-André Lureau
3236 </property>
3337 <property name="translator_credits" translatable="yes">The Fedora Translation Team</property>
34 <signal name="response" handler="virt_viewer_app_about_close"/>
35 <signal name="delete_event" handler="virt_viewer_app_about_delete"/>
38 <property name="logo_icon_name">virt-viewer</property>
39 <signal name="delete-event" handler="virt_viewer_app_about_delete" swapped="no"/>
40 <signal name="response" handler="virt_viewer_app_about_close" swapped="no"/>
3641 <child internal-child="vbox">
37 <object class="GtkVBox" id="dialog-vbox1">
42 <object class="GtkBox" id="dialog-vbox1">
3843 <property name="visible">True</property>
44 <property name="can_focus">False</property>
45 <property name="orientation">vertical</property>
3946 <property name="spacing">2</property>
40 <child>
41 <placeholder/>
42 </child>
4347 <child internal-child="action_area">
44 <object class="GtkHButtonBox" id="dialog-action_area1">
48 <object class="GtkButtonBox" id="dialog-action_area1">
4549 <property name="visible">True</property>
50 <property name="can_focus">False</property>
4651 <property name="layout_style">end</property>
4752 </object>
4853 <packing>
4954 <property name="expand">False</property>
55 <property name="fill">True</property>
5056 <property name="pack_type">end</property>
5157 <property name="position">0</property>
5258 </packing>
59 </child>
60 <child>
61 <placeholder/>
5362 </child>
5463 </object>
5564 </child>
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
6969
7070 /* Internal methods */
7171 static void virt_viewer_app_connected(VirtViewerSession *session,
72 VirtViewerApp *self);
72 VirtViewerApp *self);
7373 static void virt_viewer_app_initialized(VirtViewerSession *session,
74 VirtViewerApp *self);
74 VirtViewerApp *self);
7575 static void virt_viewer_app_disconnected(VirtViewerSession *session,
76 VirtViewerApp *self);
76 VirtViewerApp *self);
7777 static void virt_viewer_app_auth_refused(VirtViewerSession *session,
78 const char *msg,
79 VirtViewerApp *self);
78 const char *msg,
79 VirtViewerApp *self);
8080 static void virt_viewer_app_auth_failed(VirtViewerSession *session,
81 const char *msg,
82 VirtViewerApp *self);
81 const char *msg,
82 VirtViewerApp *self);
83 static void virt_viewer_app_usb_failed(VirtViewerSession *session,
84 const char *msg,
85 VirtViewerApp *self);
8386
8487 static void virt_viewer_app_server_cut_text(VirtViewerSession *session,
85 const gchar *text,
86 VirtViewerApp *self);
88 const gchar *text,
89 VirtViewerApp *self);
8790 static void virt_viewer_app_bell(VirtViewerSession *session,
88 VirtViewerApp *self);
91 VirtViewerApp *self);
92
93 static void virt_viewer_app_cancelled(VirtViewerSession *session,
94 VirtViewerApp *self);
8995
9096 static void virt_viewer_app_channel_open(VirtViewerSession *session,
91 VirtViewerSessionChannel *channel,
92 VirtViewerApp *self);
97 VirtViewerSessionChannel *channel,
98 VirtViewerApp *self);
9399 static void virt_viewer_app_update_pretty_address(VirtViewerApp *self);
94100 static void virt_viewer_app_set_fullscreen(VirtViewerApp *self, gboolean fullscreen);
95101 static void virt_viewer_app_update_menu_displays(VirtViewerApp *self);
96102
97103
98104 struct _VirtViewerAppPrivate {
99 VirtViewerWindow *main_window;
100 GtkWidget *main_notebook;
101 GtkWidget *container;
102 GHashTable *windows;
103 gchar *clipboard;
104
105 gboolean direct;
106 gboolean verbose;
107 gboolean authretry;
108 gboolean started;
109 gboolean fullscreen;
110
111 VirtViewerSession *session;
112 gboolean active;
113 gboolean connected;
114 guint reconnect_poll; /* source id */
115 char *unixsock;
116 char *ghost;
117 char *gport;
118 char *host; /* ssh */
119 int port;/* ssh */
120 char *user; /* ssh */
121 char *transport;
122 char *pretty_address;
123 gchar *guest_name;
124 gboolean grabbed;
125 char *title;
105 VirtViewerWindow *main_window;
106 GtkWidget *main_notebook;
107 GtkWidget *container;
108 GHashTable *windows;
109 gchar *clipboard;
110
111 gboolean direct;
112 gboolean verbose;
113 gboolean authretry;
114 gboolean started;
115 gboolean fullscreen;
116 gboolean attach;
117
118 VirtViewerSession *session;
119 gboolean active;
120 gboolean connected;
121 gboolean cancelled;
122 guint reconnect_poll; /* source id */
123 char *unixsock;
124 char *guri; /* prefered over ghost:gport */
125 char *ghost;
126 char *gport;
127 char *gtlsport;
128 char *host; /* ssh */
129 int port;/* ssh */
130 char *user; /* ssh */
131 char *transport;
132 char *pretty_address;
133 gchar *guest_name;
134 gboolean grabbed;
135 char *title;
126136 };
127137
128138
129139 G_DEFINE_ABSTRACT_TYPE(VirtViewerApp, virt_viewer_app, G_TYPE_OBJECT)
130 #define GET_PRIVATE(o) \
131 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_APP, VirtViewerAppPrivate))
140 #define GET_PRIVATE(o) \
141 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_APP, VirtViewerAppPrivate))
132142
133143 enum {
134 PROP_0,
135 PROP_VERBOSE,
136 PROP_CONTAINER,
137 PROP_SESSION,
138 PROP_GUEST_NAME,
139 PROP_FULLSCREEN,
140 PROP_TITLE,
144 PROP_0,
145 PROP_VERBOSE,
146 PROP_CONTAINER,
147 PROP_SESSION,
148 PROP_GUEST_NAME,
149 PROP_GURI,
150 PROP_FULLSCREEN,
151 PROP_TITLE,
141152 };
153
154 enum {
155 SIGNAL_WINDOW_ADDED,
156 SIGNAL_WINDOW_REMOVED,
157 SIGNAL_LAST,
158 };
159
160 static guint signals[SIGNAL_LAST];
142161
143162 void
144163 virt_viewer_app_set_debug(gboolean debug)
145164 {
146 doDebug = debug;
165 doDebug = debug;
147166 }
148167
149168 void
150169 virt_viewer_app_simple_message_dialog(VirtViewerApp *self,
151 const char *fmt, ...)
152 {
153 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
154 GtkWindow *window = GTK_WINDOW(virt_viewer_window_get_window(self->priv->main_window));
155 GtkWidget *dialog;
156 char *msg;
157 va_list vargs;
158
159 va_start(vargs, fmt);
160
161 msg = g_strdup_vprintf(fmt, vargs);
162
163 va_end(vargs);
164
165 dialog = gtk_message_dialog_new(window,
166 GTK_DIALOG_MODAL |
167 GTK_DIALOG_DESTROY_WITH_PARENT,
168 GTK_MESSAGE_ERROR,
169 GTK_BUTTONS_OK,
170 "%s",
171 msg);
172
173 gtk_dialog_run(GTK_DIALOG(dialog));
174
175 gtk_widget_destroy(dialog);
176
177 g_free(msg);
170 const char *fmt, ...)
171 {
172 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
173 GtkWindow *window = GTK_WINDOW(virt_viewer_window_get_window(self->priv->main_window));
174 GtkWidget *dialog;
175 char *msg;
176 va_list vargs;
177
178 va_start(vargs, fmt);
179
180 msg = g_strdup_vprintf(fmt, vargs);
181
182 va_end(vargs);
183
184 dialog = gtk_message_dialog_new(window,
185 GTK_DIALOG_MODAL |
186 GTK_DIALOG_DESTROY_WITH_PARENT,
187 GTK_MESSAGE_ERROR,
188 GTK_BUTTONS_OK,
189 "%s",
190 msg);
191
192 gtk_dialog_run(GTK_DIALOG(dialog));
193
194 gtk_widget_destroy(dialog);
195
196 g_free(msg);
178197 }
179198
180199 void
181200 virt_viewer_app_quit(VirtViewerApp *self)
182201 {
183 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
184 VirtViewerAppPrivate *priv = self->priv;
185
186 if (priv->session)
187 virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
188 gtk_main_quit();
202 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
203 VirtViewerAppPrivate *priv = self->priv;
204
205 if (priv->session)
206 virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
207 gtk_main_quit();
189208 }
190209
191210 static void count_window_visible(gpointer key G_GNUC_UNUSED,
192 gpointer value,
193 gpointer user_data)
194 {
195 GtkWindow *win = virt_viewer_window_get_window(VIRT_VIEWER_WINDOW(value));
196 guint *n = (guint*)user_data;
197
198 if (gtk_widget_get_visible(GTK_WIDGET(win)))
199 *n += 1;
211 gpointer value,
212 gpointer user_data)
213 {
214 GtkWindow *win = virt_viewer_window_get_window(VIRT_VIEWER_WINDOW(value));
215 guint *n = (guint*)user_data;
216
217 if (gtk_widget_get_visible(GTK_WIDGET(win)))
218 *n += 1;
200219 }
201220
202221 static guint
203222 virt_viewer_app_get_n_windows_visible(VirtViewerApp *self)
204223 {
205 guint n = 0;
206 g_hash_table_foreach(self->priv->windows, count_window_visible, &n);
207 return n;
224 guint n = 0;
225 g_hash_table_foreach(self->priv->windows, count_window_visible, &n);
226 return n;
208227 }
209228
210229 static guint
211230 virt_viewer_app_get_n_windows(VirtViewerApp *self)
212231 {
213 return g_hash_table_size(self->priv->windows);
232 return g_hash_table_size(self->priv->windows);
214233 }
215234
216235 gboolean
217236 virt_viewer_app_window_set_visible(VirtViewerApp *self,
218 VirtViewerWindow *vwin,
219 gboolean visible)
220 {
221 GtkWidget *window;
222 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
223 g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(vwin), FALSE);
224
225 window = GTK_WIDGET(virt_viewer_window_get_window(vwin));
226 if (visible) {
227 gtk_widget_show(window);
228 return TRUE;
229 } else {
230 if (virt_viewer_app_get_n_windows_visible(self) > 1) {
231 gtk_widget_hide(window);
232 return FALSE;
233 } else if (virt_viewer_app_get_n_windows(self) > 1) {
234 GtkWidget *dialog =
235 gtk_message_dialog_new (GTK_WINDOW(window),
236 GTK_DIALOG_DESTROY_WITH_PARENT,
237 GTK_MESSAGE_QUESTION,
238 GTK_BUTTONS_OK_CANCEL,
239 _("This is the last visible display. Do you want to quit?"));
240 gint result = gtk_dialog_run (GTK_DIALOG (dialog));
241 switch (result) {
242 case GTK_RESPONSE_OK:
243 virt_viewer_app_quit(self);
244 break;
245 default:
246 break;
247 }
248 gtk_widget_destroy(dialog);
249 return FALSE;
250 } else {
251 virt_viewer_app_quit(self);
252 return FALSE;
253 }
254 }
255
256 g_warn_if_reached();
257 return FALSE;
237 VirtViewerWindow *vwin,
238 gboolean visible)
239 {
240 GtkWidget *window;
241 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
242 g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(vwin), FALSE);
243
244 window = GTK_WIDGET(virt_viewer_window_get_window(vwin));
245 if (visible) {
246 gtk_widget_show(window);
247 return TRUE;
248 } else {
249 if (virt_viewer_app_get_n_windows_visible(self) > 1) {
250 gtk_widget_hide(window);
251 return FALSE;
252 } else if (virt_viewer_app_get_n_windows(self) > 1) {
253 GtkWidget *dialog =
254 gtk_message_dialog_new (GTK_WINDOW(window),
255 GTK_DIALOG_DESTROY_WITH_PARENT,
256 GTK_MESSAGE_QUESTION,
257 GTK_BUTTONS_OK_CANCEL,
258 _("This is the last visible display. Do you want to quit?"));
259 gint result = gtk_dialog_run (GTK_DIALOG (dialog));
260 switch (result) {
261 case GTK_RESPONSE_OK:
262 virt_viewer_app_quit(self);
263 break;
264 default:
265 break;
266 }
267 gtk_widget_destroy(dialog);
268 return FALSE;
269 } else {
270 virt_viewer_app_quit(self);
271 return FALSE;
272 }
273 }
274
275 g_warn_if_reached();
276 return FALSE;
258277 }
259278
260279 G_MODULE_EXPORT void
261280 virt_viewer_app_about_close(GtkWidget *dialog,
262 VirtViewerApp *self G_GNUC_UNUSED)
263 {
264 gtk_widget_hide(dialog);
265 gtk_widget_destroy(dialog);
281 VirtViewerApp *self G_GNUC_UNUSED)
282 {
283 gtk_widget_hide(dialog);
284 gtk_widget_destroy(dialog);
266285 }
267286
268287 G_MODULE_EXPORT void
269288 virt_viewer_app_about_delete(GtkWidget *dialog,
270 void *dummy G_GNUC_UNUSED,
271 VirtViewerApp *self G_GNUC_UNUSED)
272 {
273 gtk_widget_hide(dialog);
274 gtk_widget_destroy(dialog);
289 void *dummy G_GNUC_UNUSED,
290 VirtViewerApp *self G_GNUC_UNUSED)
291 {
292 gtk_widget_hide(dialog);
293 gtk_widget_destroy(dialog);
275294 }
276295
277296 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
279298 static int
280299 virt_viewer_app_open_tunnel(const char **cmd)
281300 {
282 int fd[2];
283 pid_t pid;
284
285 if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) < 0)
286 return -1;
287
288 pid = fork();
289 if (pid == -1) {
290 close(fd[0]);
291 close(fd[1]);
292 return -1;
293 }
294
295 if (pid == 0) { /* child */
296 close(fd[0]);
297 close(0);
298 close(1);
299 if (dup(fd[1]) < 0)
300 _exit(1);
301 if (dup(fd[1]) < 0)
302 _exit(1);
303 close(fd[1]);
304 execvp("ssh", (char *const*)cmd);
305 _exit(1);
306 }
307 close(fd[1]);
308 return fd[0];
301 int fd[2];
302 pid_t pid;
303
304 if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) < 0)
305 return -1;
306
307 pid = fork();
308 if (pid == -1) {
309 close(fd[0]);
310 close(fd[1]);
311 return -1;
312 }
313
314 if (pid == 0) { /* child */
315 close(fd[0]);
316 close(0);
317 close(1);
318 if (dup(fd[1]) < 0)
319 _exit(1);
320 if (dup(fd[1]) < 0)
321 _exit(1);
322 close(fd[1]);
323 execvp("ssh", (char *const*)cmd);
324 _exit(1);
325 }
326 close(fd[1]);
327 return fd[0];
309328 }
310329
311330
312331 static int
313332 virt_viewer_app_open_tunnel_ssh(const char *sshhost,
314 int sshport,
315 const char *sshuser,
316 const char *host,
317 const char *port,
318 const char *unixsock)
319 {
320 const char *cmd[10];
321 char portstr[50];
322 int n = 0;
323
324 cmd[n++] = "ssh";
325 if (sshport) {
326 cmd[n++] = "-p";
327 sprintf(portstr, "%d", sshport);
328 cmd[n++] = portstr;
329 }
330 if (sshuser) {
331 cmd[n++] = "-l";
332 cmd[n++] = sshuser;
333 }
334 cmd[n++] = sshhost;
335 cmd[n++] = "nc";
336 if (port) {
337 cmd[n++] = host;
338 cmd[n++] = port;
339 } else {
340 cmd[n++] = "-U";
341 cmd[n++] = unixsock;
342 }
343 cmd[n++] = NULL;
344
345 return virt_viewer_app_open_tunnel(cmd);
333 int sshport,
334 const char *sshuser,
335 const char *host,
336 const char *port,
337 const char *unixsock)
338 {
339 const char *cmd[10];
340 char portstr[50];
341 int n = 0;
342
343 cmd[n++] = "ssh";
344 if (sshport) {
345 cmd[n++] = "-p";
346 sprintf(portstr, "%d", sshport);
347 cmd[n++] = portstr;
348 }
349 if (sshuser) {
350 cmd[n++] = "-l";
351 cmd[n++] = sshuser;
352 }
353 cmd[n++] = sshhost;
354 cmd[n++] = "nc";
355 if (port) {
356 cmd[n++] = host;
357 cmd[n++] = port;
358 } else {
359 cmd[n++] = "-U";
360 cmd[n++] = unixsock;
361 }
362 cmd[n++] = NULL;
363
364 return virt_viewer_app_open_tunnel(cmd);
346365 }
347366
348367 static int
349368 virt_viewer_app_open_unix_sock(const char *unixsock)
350369 {
351 struct sockaddr_un addr;
352 int fd;
353
354 memset(&addr, 0, sizeof addr);
355 addr.sun_family = AF_UNIX;
356 strcpy(addr.sun_path, unixsock);
357
358 if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
359 return -1;
360
361 if (connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {
362 close(fd);
363 return -1;
364 }
365
366 return fd;
370 struct sockaddr_un addr;
371 int fd;
372
373 memset(&addr, 0, sizeof addr);
374 addr.sun_family = AF_UNIX;
375 strcpy(addr.sun_path, unixsock);
376
377 if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
378 return -1;
379
380 if (connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {
381 close(fd);
382 return -1;
383 }
384
385 return fd;
367386 }
368387
369388 #endif /* defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) */
370389
371390 void
372391 virt_viewer_app_trace(VirtViewerApp *self,
373 const char *fmt, ...)
374 {
375 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
376 va_list ap;
377 VirtViewerAppPrivate *priv = self->priv;
378
379 if (doDebug) {
380 va_start(ap, fmt);
381 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fmt, ap);
382 va_end(ap);
383 }
384
385 if (priv->verbose) {
386 va_start(ap, fmt);
387 g_vprintf(fmt, ap);
388 va_end(ap);
389 }
392 const char *fmt, ...)
393 {
394 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
395 va_list ap;
396 VirtViewerAppPrivate *priv = self->priv;
397
398 if (doDebug) {
399 va_start(ap, fmt);
400 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fmt, ap);
401 va_end(ap);
402 }
403
404 if (priv->verbose) {
405 va_start(ap, fmt);
406 g_vprintf(fmt, ap);
407 va_end(ap);
408 }
390409 }
391410
392411 static void
393412 virt_viewer_app_set_window_subtitle(VirtViewerApp *app,
394 VirtViewerWindow *window,
395 int nth)
396 {
397 gchar *subtitle = app->priv->title ? g_strdup_printf("%s (%d)", app->priv->title, nth + 1) : NULL;
398 g_object_set(window, "subtitle", subtitle, NULL);
399 g_free(subtitle);
413 VirtViewerWindow *window,
414 int nth)
415 {
416 gchar *subtitle = NULL;
417
418 if (app->priv->title != NULL) {
419 gchar *d = strstr(app->priv->title, "%d");
420 if (d != NULL) {
421 *d = '\0';
422 subtitle = g_strdup_printf("%s%d%s", app->priv->title, nth + 1, d + 2);
423 *d = '%';
424 } else
425 subtitle = g_strdup_printf("%s (%d)", app->priv->title, nth + 1);
426 }
427
428 g_object_set(window, "subtitle", subtitle, NULL);
429 g_free(subtitle);
400430 }
401431
402432 static void
403433 set_title(gpointer key,
404 gpointer value,
405 gpointer user_data)
406 {
407 gint *nth = key;
408 VirtViewerApp *app = user_data;
409 VirtViewerWindow *window = value;
410 virt_viewer_app_set_window_subtitle(app, window, *nth);
434 gpointer value,
435 gpointer user_data)
436 {
437 gint *nth = key;
438 VirtViewerApp *app = user_data;
439 VirtViewerWindow *window = value;
440 virt_viewer_app_set_window_subtitle(app, window, *nth);
411441 }
412442
413443 static void
414444 virt_viewer_app_set_all_window_subtitles(VirtViewerApp *app)
415445 {
416 virt_viewer_app_set_window_subtitle(app, app->priv->main_window, 0);
417 g_hash_table_foreach(app->priv->windows, set_title, app);
446 virt_viewer_app_set_window_subtitle(app, app->priv->main_window, 0);
447 g_hash_table_foreach(app->priv->windows, set_title, app);
418448 }
419449
420450 static void update_title(gpointer key G_GNUC_UNUSED,
421 gpointer value,
422 gpointer user_data G_GNUC_UNUSED)
423 {
424 virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(value));
451 gpointer value,
452 gpointer user_data G_GNUC_UNUSED)
453 {
454 virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(value));
425455 }
426456
427457 static void
428458 virt_viewer_app_update_title(VirtViewerApp *self)
429459 {
430 g_hash_table_foreach(self->priv->windows, update_title, NULL);
460 g_hash_table_foreach(self->priv->windows, update_title, NULL);
461 }
462
463 static void set_usb_options_sensitive(gpointer key G_GNUC_UNUSED,
464 gpointer value,
465 gpointer user_data)
466 {
467 virt_viewer_window_set_usb_options_sensitive(
468 VIRT_VIEWER_WINDOW(value), GPOINTER_TO_INT(user_data));
469 }
470
471 static void
472 virt_viewer_app_set_usb_options_sensitive(VirtViewerApp *self, gboolean sensitive)
473 {
474 g_hash_table_foreach(self->priv->windows, set_usb_options_sensitive,
475 GINT_TO_POINTER(sensitive));
431476 }
432477
433478 static VirtViewerWindow *
434479 virt_viewer_app_get_nth_window(VirtViewerApp *self, gint nth)
435480 {
436 return g_hash_table_lookup(self->priv->windows, &nth);
481 return g_hash_table_lookup(self->priv->windows, &nth);
437482 }
438483
439484 static gboolean
440485 virt_viewer_app_remove_nth_window(VirtViewerApp *self, gint nth)
441486 {
442 gboolean removed;
443
444 g_return_val_if_fail(nth != 0, FALSE);
445 removed = g_hash_table_remove(self->priv->windows, &nth);
446 g_warn_if_fail(removed);
447
448 return removed;
487 VirtViewerWindow *win;
488 gboolean removed;
489
490 g_return_val_if_fail(nth != 0, FALSE);
491
492 win = virt_viewer_app_get_nth_window(self, nth);
493 g_return_val_if_fail(win != NULL, FALSE);
494
495 removed = g_hash_table_steal(self->priv->windows, &nth);
496 g_warn_if_fail(removed);
497
498 if (removed)
499 g_signal_emit(self, signals[SIGNAL_WINDOW_REMOVED], 0, win);
500
501 g_object_unref(win);
502
503 return removed;
449504 }
450505
451506 static void
452507 virt_viewer_app_set_nth_window(VirtViewerApp *self, gint nth, VirtViewerWindow *win)
453508 {
454 gint *key;
455
456 g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL);
457 key = g_malloc(sizeof(gint));
458 *key = nth;
459 g_hash_table_insert(self->priv->windows, key, win);
460 virt_viewer_app_set_window_subtitle(self, win, nth);
509 gint *key;
510
511 g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL);
512 key = g_malloc(sizeof(gint));
513 *key = nth;
514 g_hash_table_insert(self->priv->windows, key, win);
515 virt_viewer_app_set_window_subtitle(self, win, nth);
516
517 g_signal_emit(self, signals[SIGNAL_WINDOW_ADDED], 0, win);
461518 }
462519
463520 static void
464521 viewer_window_visible_cb(GtkWidget *widget G_GNUC_UNUSED,
465 gpointer user_data)
466 {
467 virt_viewer_app_update_menu_displays(VIRT_VIEWER_APP(user_data));
522 gpointer user_data)
523 {
524 virt_viewer_app_update_menu_displays(VIRT_VIEWER_APP(user_data));
468525 }
469526
470527
471528 static VirtViewerWindow*
472529 virt_viewer_app_window_new(VirtViewerApp *self, GtkWidget *container, gint nth)
473530 {
474 VirtViewerWindow* window;
475 GtkWindow *w;
476
477 window = g_object_new(VIRT_VIEWER_TYPE_WINDOW,
478 "app", self,
479 "container", container,
480 NULL);
481 if (self->priv->main_window)
482 virt_viewer_window_set_zoom_level(window, virt_viewer_window_get_zoom_level(self->priv->main_window));
483 virt_viewer_app_set_nth_window(self, nth, window);
484 w = virt_viewer_window_get_window(window);
485
486 /* this will set new window to fullscreen if necessary */
487 virt_viewer_app_set_fullscreen(self, self->priv->fullscreen);
488 g_signal_connect(w, "hide", G_CALLBACK(viewer_window_visible_cb), self);
489 g_signal_connect(w, "show", G_CALLBACK(viewer_window_visible_cb), self);
490 return window;
531 VirtViewerWindow* window;
532 GtkWindow *w;
533
534 window = g_object_new(VIRT_VIEWER_TYPE_WINDOW,
535 "app", self,
536 "container", container,
537 NULL);
538 if (self->priv->main_window)
539 virt_viewer_window_set_zoom_level(window, virt_viewer_window_get_zoom_level(self->priv->main_window));
540 virt_viewer_app_set_nth_window(self, nth, window);
541 w = virt_viewer_window_get_window(window);
542
543 /* this will set new window to fullscreen if necessary */
544 virt_viewer_app_set_fullscreen(self, self->priv->fullscreen);
545 g_signal_connect(w, "hide", G_CALLBACK(viewer_window_visible_cb), self);
546 g_signal_connect(w, "show", G_CALLBACK(viewer_window_visible_cb), self);
547 return window;
491548 }
492549
493550 static void
494551 display_show_hint(VirtViewerDisplay *display,
495 GParamSpec *pspec G_GNUC_UNUSED,
496 VirtViewerWindow *win)
497 {
498 VirtViewerApp *self;
499 VirtViewerNotebook *nb = virt_viewer_window_get_notebook(win);
500 GtkWindow *w = virt_viewer_window_get_window(win);
501 gint nth, hint;
502
503 g_object_get(win,
504 "app", &self,
505 NULL);
506 g_object_get(display,
507 "nth-display", &nth,
508 "show-hint", &hint,
509 NULL);
510
511 if (hint == VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE) {
512 if (win != self->priv->main_window &&
513 g_getenv("VIRT_VIEWER_HIDE"))
514 gtk_widget_hide(GTK_WIDGET(w));
515 virt_viewer_notebook_show_status(nb, _("Waiting for display %d..."), nth + 1);
516 } else {
517 virt_viewer_notebook_show_display(nb);
518 gtk_widget_show(GTK_WIDGET(w));
519 gtk_window_present(w);
520 }
521
522 g_object_unref(self);
552 GParamSpec *pspec G_GNUC_UNUSED,
553 VirtViewerWindow *win)
554 {
555 VirtViewerApp *self;
556 VirtViewerNotebook *nb = virt_viewer_window_get_notebook(win);
557 GtkWindow *w = virt_viewer_window_get_window(win);
558 gint nth, hint;
559
560 g_object_get(win,
561 "app", &self,
562 NULL);
563 g_object_get(display,
564 "nth-display", &nth,
565 "show-hint", &hint,
566 NULL);
567
568 if (hint == VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE) {
569 if (win != self->priv->main_window &&
570 g_getenv("VIRT_VIEWER_HIDE"))
571 gtk_widget_hide(GTK_WIDGET(w));
572 virt_viewer_notebook_show_status(nb, _("Waiting for display %d..."), nth + 1);
573 } else {
574 virt_viewer_notebook_show_display(nb);
575 gtk_widget_show(GTK_WIDGET(w));
576 gtk_window_present(w);
577 }
578
579 g_object_unref(self);
523580 }
524581
525582 static void
526583 virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED,
527 VirtViewerDisplay *display,
528 VirtViewerApp *self)
529 {
530 VirtViewerAppPrivate *priv = self->priv;
531 VirtViewerWindow *window;
532 gint nth;
533
534 g_object_get(display, "nth-display", &nth, NULL);
535 if (nth == 0) {
536 window = priv->main_window;
537 } else {
538 if (priv->container) {
539 g_warning("multi-head not yet supported within container");
540 return;
541 }
542
543 g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL);
544 window = virt_viewer_app_window_new(self, NULL, nth);
545 }
546
547 virt_viewer_window_set_display(window, display);
548 g_signal_connect(display, "notify::show-hint",
549 G_CALLBACK(display_show_hint), window);
550 g_object_notify(G_OBJECT(display), "show-hint"); /* call display_show_hint */
584 VirtViewerDisplay *display,
585 VirtViewerApp *self)
586 {
587 VirtViewerAppPrivate *priv = self->priv;
588 VirtViewerWindow *window;
589 gint nth;
590
591 g_object_get(display, "nth-display", &nth, NULL);
592 if (nth == 0) {
593 window = priv->main_window;
594 } else {
595 if (priv->container) {
596 g_warning("multi-head not yet supported within container");
597 return;
598 }
599
600 g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL);
601 window = virt_viewer_app_window_new(self, NULL, nth);
602 }
603
604 virt_viewer_window_set_display(window, display);
605 g_signal_connect(display, "notify::show-hint",
606 G_CALLBACK(display_show_hint), window);
607 g_object_notify(G_OBJECT(display), "show-hint"); /* call display_show_hint */
551608 }
552609
553610
554611 static void
555612 virt_viewer_app_display_removed(VirtViewerSession *session G_GNUC_UNUSED,
556 VirtViewerDisplay *display,
557 VirtViewerApp *self)
558 {
559 VirtViewerWindow *win = NULL;
560 gint nth;
561
562 gtk_widget_hide(GTK_WIDGET(display));
563 g_object_get(display, "nth-display", &nth, NULL);
564 win = virt_viewer_app_get_nth_window(self, nth);
565 virt_viewer_window_set_display(win, NULL);
566
567 if (nth != 0)
568 virt_viewer_app_remove_nth_window(self, nth);
613 VirtViewerDisplay *display,
614 VirtViewerApp *self)
615 {
616 VirtViewerWindow *win = NULL;
617 gint nth;
618
619 gtk_widget_hide(GTK_WIDGET(display));
620 g_object_get(display, "nth-display", &nth, NULL);
621 win = virt_viewer_app_get_nth_window(self, nth);
622 virt_viewer_window_set_display(win, NULL);
623
624 if (nth != 0)
625 virt_viewer_app_remove_nth_window(self, nth);
569626 }
570627
571628 int
572629 virt_viewer_app_create_session(VirtViewerApp *self, const gchar *type)
573630 {
574 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1);
575 VirtViewerAppPrivate *priv = self->priv;
576 g_return_val_if_fail(priv->session == NULL, -1);
631 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1);
632 VirtViewerAppPrivate *priv = self->priv;
633 g_return_val_if_fail(priv->session == NULL, -1);
577634
578635 #ifdef HAVE_GTK_VNC
579 if (g_strcasecmp(type, "vnc") == 0) {
580 virt_viewer_app_trace(self, "Guest %s has a %s display\n",
581 priv->guest_name, type);
582 priv->session = virt_viewer_session_vnc_new();
583 } else
636 if (g_ascii_strcasecmp(type, "vnc") == 0) {
637 GtkWindow *window = virt_viewer_window_get_window(priv->main_window);
638 virt_viewer_app_trace(self, "Guest %s has a %s display\n",
639 priv->guest_name, type);
640 priv->session = virt_viewer_session_vnc_new(window);
641 } else
584642 #endif
585643 #ifdef HAVE_SPICE_GTK
586 if (g_strcasecmp(type, "spice") == 0) {
587 virt_viewer_app_trace(self, "Guest %s has a %s display\n",
588 priv->guest_name, type);
589 priv->session = virt_viewer_session_spice_new();
590 } else
644 if (g_ascii_strcasecmp(type, "spice") == 0) {
645 GtkWindow *window = virt_viewer_window_get_window(priv->main_window);
646 virt_viewer_app_trace(self, "Guest %s has a %s display\n",
647 priv->guest_name, type);
648 priv->session = virt_viewer_session_spice_new(window);
649 } else
591650 #endif
592 {
593 virt_viewer_app_trace(self, "Guest %s has unsupported %s display type\n",
594 priv->guest_name, type);
595 virt_viewer_app_simple_message_dialog(self, _("Unknown graphic type for the guest %s"),
596 priv->guest_name);
597 return -1;
598 }
599
600 g_signal_connect(priv->session, "session-initialized",
601 G_CALLBACK(virt_viewer_app_initialized), self);
602 g_signal_connect(priv->session, "session-connected",
603 G_CALLBACK(virt_viewer_app_connected), self);
604 g_signal_connect(priv->session, "session-disconnected",
605 G_CALLBACK(virt_viewer_app_disconnected), self);
606 g_signal_connect(priv->session, "session-channel-open",
607 G_CALLBACK(virt_viewer_app_channel_open), self);
608 g_signal_connect(priv->session, "session-auth-refused",
609 G_CALLBACK(virt_viewer_app_auth_refused), self);
610 g_signal_connect(priv->session, "session-auth-failed",
611 G_CALLBACK(virt_viewer_app_auth_failed), self);
612 g_signal_connect(priv->session, "session-display-added",
613 G_CALLBACK(virt_viewer_app_display_added), self);
614 g_signal_connect(priv->session, "session-display-removed",
615 G_CALLBACK(virt_viewer_app_display_removed), self);
616
617 g_signal_connect(priv->session, "session-cut-text",
618 G_CALLBACK(virt_viewer_app_server_cut_text), self);
619 g_signal_connect(priv->session, "session-bell",
620 G_CALLBACK(virt_viewer_app_bell), self);
621
622 return 0;
623 }
651 {
652 virt_viewer_app_trace(self, "Guest %s has unsupported %s display type\n",
653 priv->guest_name, type);
654 virt_viewer_app_simple_message_dialog(self, _("Unknown graphic type for the guest %s"),
655 priv->guest_name);
656 return -1;
657 }
658
659 g_signal_connect(priv->session, "session-initialized",
660 G_CALLBACK(virt_viewer_app_initialized), self);
661 g_signal_connect(priv->session, "session-connected",
662 G_CALLBACK(virt_viewer_app_connected), self);
663 g_signal_connect(priv->session, "session-disconnected",
664 G_CALLBACK(virt_viewer_app_disconnected), self);
665 g_signal_connect(priv->session, "session-channel-open",
666 G_CALLBACK(virt_viewer_app_channel_open), self);
667 g_signal_connect(priv->session, "session-auth-refused",
668 G_CALLBACK(virt_viewer_app_auth_refused), self);
669 g_signal_connect(priv->session, "session-auth-failed",
670 G_CALLBACK(virt_viewer_app_auth_failed), self);
671 g_signal_connect(priv->session, "session-usb-failed",
672 G_CALLBACK(virt_viewer_app_usb_failed), self);
673 g_signal_connect(priv->session, "session-display-added",
674 G_CALLBACK(virt_viewer_app_display_added), self);
675 g_signal_connect(priv->session, "session-display-removed",
676 G_CALLBACK(virt_viewer_app_display_removed), self);
677
678 g_signal_connect(priv->session, "session-cut-text",
679 G_CALLBACK(virt_viewer_app_server_cut_text), self);
680 g_signal_connect(priv->session, "session-bell",
681 G_CALLBACK(virt_viewer_app_bell), self);
682 g_signal_connect(priv->session, "session-cancelled",
683 G_CALLBACK(virt_viewer_app_cancelled), self);
684
685 return 0;
686 }
687
688 static gboolean
689 virt_viewer_app_default_open_connection(VirtViewerApp *self G_GNUC_UNUSED, int *fd)
690 {
691 *fd = -1;
692 return TRUE;
693 }
694
695
696 static int
697 virt_viewer_app_open_connection(VirtViewerApp *self, int *fd)
698 {
699 VirtViewerAppClass *klass;
700
701 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1);
702 klass = VIRT_VIEWER_APP_GET_CLASS(self);
703
704 return klass->open_connection(self, fd);
705 }
706
624707
625708 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
626709 static void
627710 virt_viewer_app_channel_open(VirtViewerSession *session,
628 VirtViewerSessionChannel *channel,
629 VirtViewerApp *self)
630 {
631 VirtViewerAppPrivate *priv;
632 int fd = -1;
633
634 g_return_if_fail(self != NULL);
635
636 priv = self->priv;
637 if (priv->transport && g_strcasecmp(priv->transport, "ssh") == 0 &&
638 !priv->direct) {
639 if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port, priv->user,
640 priv->ghost, priv->gport, NULL)) < 0)
641 virt_viewer_app_simple_message_dialog(self, _("Connect to ssh failed."));
642 } else {
643 virt_viewer_app_simple_message_dialog(self, _("Can't connect to channel, SSH only supported."));
644 }
645
646 if (fd >= 0)
647 virt_viewer_session_channel_open_fd(session, channel, fd);
711 VirtViewerSessionChannel *channel,
712 VirtViewerApp *self)
713 {
714 VirtViewerAppPrivate *priv;
715 int fd = -1;
716
717 g_return_if_fail(self != NULL);
718
719 if (!virt_viewer_app_open_connection(self, &fd))
720 return;
721
722 DEBUG_LOG("After open connection callback fd=%d", fd);
723
724 priv = self->priv;
725 if (priv->transport && g_ascii_strcasecmp(priv->transport, "ssh") == 0 &&
726 !priv->direct && fd == -1) {
727 if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port, priv->user,
728 priv->ghost, priv->gport, NULL)) < 0)
729 virt_viewer_app_simple_message_dialog(self, _("Connect to ssh failed."));
730 } else if (fd == -1) {
731 virt_viewer_app_simple_message_dialog(self, _("Can't connect to channel, SSH only supported."));
732 }
733
734 if (fd >= 0)
735 virt_viewer_session_channel_open_fd(session, channel, fd);
648736 }
649737 #else
650738 static void
651739 virt_viewer_app_channel_open(VirtViewerSession *session G_GNUC_UNUSED,
652 VirtViewerSessionChannel *channel G_GNUC_UNUSED,
653 VirtViewerApp *self)
654 {
655 virt_viewer_app_simple_message_dialog(self, _("Connect to channel unsupported."));
740 VirtViewerSessionChannel *channel G_GNUC_UNUSED,
741 VirtViewerApp *self)
742 {
743 virt_viewer_app_simple_message_dialog(self, _("Connect to channel unsupported."));
656744 }
657745 #endif
746
747 static int
748 virt_viewer_app_default_activate(VirtViewerApp *self)
749 {
750 VirtViewerAppPrivate *priv = self->priv;
751 int fd = -1;
752
753 if (!virt_viewer_app_open_connection(self, &fd))
754 return -1;
755
756 DEBUG_LOG("After open connection callback fd=%d", fd);
757
758 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
759 if (priv->transport &&
760 g_ascii_strcasecmp(priv->transport, "ssh") == 0 &&
761 !priv->direct &&
762 fd == -1) {
763 gchar *p = NULL;
764
765 if (priv->gport) {
766 virt_viewer_app_trace(self, "Opening indirect TCP connection to display at %s:%s\n",
767 priv->ghost, priv->gport);
768 } else {
769 virt_viewer_app_trace(self, "Opening indirect UNIX connection to display at %s\n",
770 priv->unixsock);
771 }
772 if (priv->port)
773 p = g_strdup_printf(":%d", priv->port);
774
775 virt_viewer_app_trace(self, "Setting up SSH tunnel via %s%s%s%s\n",
776 priv->user ? priv->user : "",
777 priv->user ? "@" : "",
778 priv->host, p ? p : "");
779 g_free(p);
780
781 if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port,
782 priv->user, priv->ghost,
783 priv->gport, priv->unixsock)) < 0)
784 return -1;
785 } else if (priv->unixsock && fd == -1) {
786 virt_viewer_app_trace(self, "Opening direct UNIX connection to display at %s",
787 priv->unixsock);
788 if ((fd = virt_viewer_app_open_unix_sock(priv->unixsock)) < 0)
789 return -1;
790 }
791 #endif
792
793 if (fd >= 0) {
794 return virt_viewer_session_open_fd(VIRT_VIEWER_SESSION(priv->session), fd);
795 } else if (priv->guri) {
796 virt_viewer_app_trace(self, "Opening connection to display at %s\n", priv->guri);
797 return virt_viewer_session_open_uri(VIRT_VIEWER_SESSION(priv->session), priv->guri);
798 } else {
799 virt_viewer_app_trace(self, "Opening direct TCP connection to display at %s:%s:%s\n",
800 priv->ghost, priv->gport, priv->gtlsport ? priv->gtlsport : "-1");
801 return virt_viewer_session_open_host(VIRT_VIEWER_SESSION(priv->session),
802 priv->ghost, priv->gport, priv->gtlsport);
803 }
804
805 return -1;
806 }
658807
659808 int
660809 virt_viewer_app_activate(VirtViewerApp *self)
661810 {
662 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1);
663 VirtViewerAppPrivate *priv = self->priv;
664 int fd = -1;
665 int ret = -1;
666
667 if (priv->active)
668 goto cleanup;
669
670 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
671 if (priv->transport &&
672 g_strcasecmp(priv->transport, "ssh") == 0 &&
673 !priv->direct) {
674 gchar *p = NULL;
675
676 if (priv->gport) {
677 virt_viewer_app_trace(self, "Opening indirect TCP connection to display at %s:%s\n",
678 priv->ghost, priv->gport);
679 } else {
680 virt_viewer_app_trace(self, "Opening indirect UNIX connection to display at %s\n",
681 priv->unixsock);
682 }
683 if (priv->port)
684 p = g_strdup_printf(":%d", priv->port);
685
686 virt_viewer_app_trace(self, "Setting up SSH tunnel via %s%s%s%s\n",
687 priv->user ? priv->user : "",
688 priv->user ? "@" : "",
689 priv->host, p ? p : "");
690 g_free(p);
691
692 if ((fd = virt_viewer_app_open_tunnel_ssh(priv->host, priv->port,
693 priv->user, priv->ghost,
694 priv->gport, priv->unixsock)) < 0)
695 return -1;
696 } else if (priv->unixsock) {
697 virt_viewer_app_trace(self, "Opening direct UNIX connection to display at %s",
698 priv->unixsock);
699 if ((fd = virt_viewer_app_open_unix_sock(priv->unixsock)) < 0)
700 return -1;
701 }
702 #endif
703
704 if (fd >= 0) {
705 ret = virt_viewer_session_open_fd(VIRT_VIEWER_SESSION(priv->session), fd);
706 } else {
707 virt_viewer_app_trace(self, "Opening direct TCP connection to display at %s:%s\n",
708 priv->ghost, priv->gport);
709 ret = virt_viewer_session_open_host(VIRT_VIEWER_SESSION(priv->session),
710 priv->ghost, priv->gport);
711 }
712
713 virt_viewer_app_show_status(self, _("Connecting to graphic server"));
714
715 priv->connected = FALSE;
716 priv->active = TRUE;
717 priv->grabbed = FALSE;
718 virt_viewer_app_update_title(self);
719
720 cleanup:
721 return ret;
811 VirtViewerAppPrivate *priv;
812 int ret;
813
814 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1);
815
816 priv = self->priv;
817 if (priv->active)
818 return -1;
819
820 ret = VIRT_VIEWER_APP_GET_CLASS(self)->activate(self);
821
822 if (ret != -1) {
823 virt_viewer_app_show_status(self, _("Connecting to graphic server"));
824 priv->connected = FALSE;
825 priv->cancelled = FALSE;
826 priv->active = TRUE;
827 priv->grabbed = FALSE;
828 virt_viewer_app_update_title(self);
829 }
830
831 return ret;
722832 }
723833
724834 /* text was actually requested */
725835 static void
726836 virt_viewer_app_clipboard_copy(GtkClipboard *clipboard G_GNUC_UNUSED,
727 GtkSelectionData *data,
728 guint info G_GNUC_UNUSED,
729 VirtViewerApp *self)
730 {
731 VirtViewerAppPrivate *priv = self->priv;
732
733 gtk_selection_data_set_text(data, priv->clipboard, -1);
837 GtkSelectionData *data,
838 guint info G_GNUC_UNUSED,
839 VirtViewerApp *self)
840 {
841 VirtViewerAppPrivate *priv = self->priv;
842
843 gtk_selection_data_set_text(data, priv->clipboard, -1);
734844 }
735845
736846 static void
737847 virt_viewer_app_server_cut_text(VirtViewerSession *session G_GNUC_UNUSED,
738 const gchar *text,
739 VirtViewerApp *self)
740 {
741 GtkClipboard *cb;
742 gsize a, b;
743 VirtViewerAppPrivate *priv = self->priv;
744 GtkTargetEntry targets[] = {
745 {g_strdup("UTF8_STRING"), 0, 0},
746 {g_strdup("COMPOUND_TEXT"), 0, 0},
747 {g_strdup("TEXT"), 0, 0},
748 {g_strdup("STRING"), 0, 0},
749 };
750
751 if (!text)
752 return;
753
754 g_free (priv->clipboard);
755 priv->clipboard = g_convert (text, -1, "utf-8", "iso8859-1", &a, &b, NULL);
756
757 if (priv->clipboard) {
758 cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
759
760 gtk_clipboard_set_with_owner (cb,
761 targets,
762 G_N_ELEMENTS(targets),
763 (GtkClipboardGetFunc)virt_viewer_app_clipboard_copy,
764 NULL,
765 G_OBJECT (self));
766 }
848 const gchar *text,
849 VirtViewerApp *self)
850 {
851 GtkClipboard *cb;
852 gsize a, b;
853 VirtViewerAppPrivate *priv = self->priv;
854 GtkTargetEntry targets[] = {
855 {g_strdup("UTF8_STRING"), 0, 0},
856 {g_strdup("COMPOUND_TEXT"), 0, 0},
857 {g_strdup("TEXT"), 0, 0},
858 {g_strdup("STRING"), 0, 0},
859 };
860
861 if (!text)
862 return;
863
864 g_free (priv->clipboard);
865 priv->clipboard = g_convert (text, -1, "utf-8", "iso8859-1", &a, &b, NULL);
866
867 if (priv->clipboard) {
868 cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
869
870 gtk_clipboard_set_with_owner (cb,
871 targets,
872 G_N_ELEMENTS(targets),
873 (GtkClipboardGetFunc)virt_viewer_app_clipboard_copy,
874 NULL,
875 G_OBJECT (self));
876 }
767877 }
768878
769879
770880 static void virt_viewer_app_bell(VirtViewerSession *session G_GNUC_UNUSED,
771 VirtViewerApp *self)
772 {
773 VirtViewerAppPrivate *priv = self->priv;
774
775 gdk_window_beep(gtk_widget_get_window(GTK_WIDGET(virt_viewer_window_get_window(priv->main_window))));
881 VirtViewerApp *self)
882 {
883 VirtViewerAppPrivate *priv = self->priv;
884
885 gdk_window_beep(gtk_widget_get_window(GTK_WIDGET(virt_viewer_window_get_window(priv->main_window))));
776886 }
777887
778888
779889 static int
780890 virt_viewer_app_default_initial_connect(VirtViewerApp *self)
781891 {
782 return virt_viewer_app_activate(self);
892 return virt_viewer_app_activate(self);
783893 }
784894
785895 int
786896 virt_viewer_app_initial_connect(VirtViewerApp *self)
787897 {
788 VirtViewerAppClass *klass;
789
790 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1);
791 klass = VIRT_VIEWER_APP_GET_CLASS(self);
792
793 return klass->initial_connect(self);
898 VirtViewerAppClass *klass;
899
900 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), -1);
901 klass = VIRT_VIEWER_APP_GET_CLASS(self);
902
903 return klass->initial_connect(self);
794904 }
795905
796906 static gboolean
797907 virt_viewer_app_retryauth(gpointer opaque)
798908 {
799 VirtViewerApp *self = opaque;
800
801 virt_viewer_app_initial_connect(self);
802
803 return FALSE;
909 VirtViewerApp *self = opaque;
910
911 virt_viewer_app_initial_connect(self);
912
913 return FALSE;
804914 }
805915
806916 static gboolean
807917 virt_viewer_app_connect_timer(void *opaque)
808918 {
809 VirtViewerApp *self = opaque;
810 VirtViewerAppPrivate *priv = self->priv;
811
812 DEBUG_LOG("Connect timer fired");
813
814 if (!priv->active &&
815 virt_viewer_app_initial_connect(self) < 0)
816 gtk_main_quit();
817
818 if (priv->active) {
819 priv->reconnect_poll = 0;
820 return FALSE;
821 }
822
823 return TRUE;
919 VirtViewerApp *self = opaque;
920 VirtViewerAppPrivate *priv = self->priv;
921
922 DEBUG_LOG("Connect timer fired");
923
924 if (!priv->active &&
925 virt_viewer_app_initial_connect(self) < 0)
926 gtk_main_quit();
927
928 if (priv->active) {
929 priv->reconnect_poll = 0;
930 return FALSE;
931 }
932
933 return TRUE;
824934 }
825935
826936 void
827937 virt_viewer_app_start_reconnect_poll(VirtViewerApp *self)
828938 {
829 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
830 VirtViewerAppPrivate *priv = self->priv;
831
832 if (priv->reconnect_poll != 0)
833 return;
834
835 priv->reconnect_poll = g_timeout_add(500, virt_viewer_app_connect_timer, self);
939 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
940 VirtViewerAppPrivate *priv = self->priv;
941
942 if (priv->reconnect_poll != 0)
943 return;
944
945 priv->reconnect_poll = g_timeout_add(500, virt_viewer_app_connect_timer, self);
836946 }
837947
838948 static void
839949 virt_viewer_app_default_deactivated(VirtViewerApp *self)
840950 {
841 VirtViewerAppPrivate *priv = self->priv;
842
843 virt_viewer_app_show_status(self, _("Guest domain has shutdown"));
844 virt_viewer_app_trace(self, "Guest %s display has disconnected, shutting down",
845 priv->guest_name);
846 gtk_main_quit();
951 VirtViewerAppPrivate *priv = self->priv;
952
953 virt_viewer_app_show_status(self, _("Guest domain has shutdown"));
954 virt_viewer_app_trace(self, "Guest %s display has disconnected, shutting down",
955 priv->guest_name);
956 gtk_main_quit();
847957 }
848958
849959 static void
850960 virt_viewer_app_deactivated(VirtViewerApp *self)
851961 {
852 VirtViewerAppClass *klass;
853 klass = VIRT_VIEWER_APP_GET_CLASS(self);
854
855 klass->deactivated(self);
962 VirtViewerAppClass *klass;
963 klass = VIRT_VIEWER_APP_GET_CLASS(self);
964
965 klass->deactivated(self);
856966 }
857967
858968 static void
859969 virt_viewer_app_deactivate(VirtViewerApp *self)
860970 {
861 VirtViewerAppPrivate *priv = self->priv;
862
863 if (!priv->active)
864 return;
865
866 if (priv->session)
867 virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
868
869 priv->connected = FALSE;
870 priv->active = FALSE;
971 VirtViewerAppPrivate *priv = self->priv;
972
973 if (!priv->active)
974 return;
975
976 if (priv->session)
977 virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
978
979 priv->connected = FALSE;
980 priv->active = FALSE;
871981 #if 0
872 g_free(priv->pretty_address);
873 priv->pretty_address = NULL;
982 g_free(priv->pretty_address);
983 priv->pretty_address = NULL;
874984 #endif
875 priv->grabbed = FALSE;
876 virt_viewer_app_update_title(self);
877
878 if (priv->authretry) {
879 priv->authretry = FALSE;
880 g_idle_add(virt_viewer_app_retryauth, self);
881 } else
882 virt_viewer_app_deactivated(self);
985 priv->grabbed = FALSE;
986 virt_viewer_app_update_title(self);
987
988 if (priv->authretry) {
989 priv->authretry = FALSE;
990 g_idle_add(virt_viewer_app_retryauth, self);
991 } else
992 virt_viewer_app_deactivated(self);
883993
884994 }
885995
886996 static void
887997 virt_viewer_app_connected(VirtViewerSession *session G_GNUC_UNUSED,
888 VirtViewerApp *self)
889 {
890 VirtViewerAppPrivate *priv = self->priv;
891
892 priv->connected = TRUE;
893 virt_viewer_app_show_status(self, _("Connected to graphic server"));
998 VirtViewerApp *self)
999 {
1000 VirtViewerAppPrivate *priv = self->priv;
1001
1002 priv->connected = TRUE;
1003 virt_viewer_app_show_status(self, _("Connected to graphic server"));
8941004 }
8951005
8961006
8971007
8981008 static void
8991009 virt_viewer_app_initialized(VirtViewerSession *session G_GNUC_UNUSED,
900 VirtViewerApp *self)
901 {
902 virt_viewer_app_update_title(self);
1010 VirtViewerApp *self)
1011 {
1012 gboolean has_usb = virt_viewer_session_has_usb(self->priv->session);
1013
1014 virt_viewer_app_update_title(self);
1015 virt_viewer_app_set_usb_options_sensitive(self, has_usb);
9031016 }
9041017
9051018 static void
9061019 virt_viewer_app_disconnected(VirtViewerSession *session G_GNUC_UNUSED,
907 VirtViewerApp *self)
908 {
909 VirtViewerAppPrivate *priv = self->priv;
910
911 if (!priv->connected) {
912 virt_viewer_app_simple_message_dialog(self,
913 _("Unable to connect to the graphic server %s"),
914 priv->pretty_address);
915 }
916 virt_viewer_app_deactivate(self);
1020 VirtViewerApp *self)
1021 {
1022 VirtViewerAppPrivate *priv = self->priv;
1023
1024 if (!priv->connected && !priv->cancelled) {
1025 virt_viewer_app_simple_message_dialog(self,
1026 _("Unable to connect to the graphic server %s"),
1027 priv->pretty_address);
1028 }
1029 virt_viewer_app_set_usb_options_sensitive(self, FALSE);
1030 virt_viewer_app_deactivate(self);
1031 }
1032
1033 static void virt_viewer_app_cancelled(VirtViewerSession *session,
1034 VirtViewerApp *self)
1035 {
1036 VirtViewerAppPrivate *priv = self->priv;
1037 priv->cancelled = TRUE;
1038 virt_viewer_app_disconnected(session, self);
9171039 }
9181040
9191041
9201042 static void virt_viewer_app_auth_refused(VirtViewerSession *session G_GNUC_UNUSED,
921 const char *msg,
922 VirtViewerApp *self)
923 {
924 GtkWidget *dialog;
925 int ret;
926 VirtViewerAppPrivate *priv = self->priv;
927
928 dialog = gtk_message_dialog_new(virt_viewer_window_get_window(priv->main_window),
929 GTK_DIALOG_MODAL |
930 GTK_DIALOG_DESTROY_WITH_PARENT,
931 GTK_MESSAGE_ERROR,
932 GTK_BUTTONS_YES_NO,
933 _("Unable to authenticate with remote desktop server at %s: %s\n"
934 "Retry connection again?"),
935 priv->pretty_address, msg);
936
937 ret = gtk_dialog_run(GTK_DIALOG(dialog));
938
939 gtk_widget_destroy(dialog);
940
941 if (ret == GTK_RESPONSE_YES)
942 priv->authretry = TRUE;
943 else
944 priv->authretry = FALSE;
1043 const char *msg,
1044 VirtViewerApp *self)
1045 {
1046 GtkWidget *dialog;
1047 int ret;
1048 VirtViewerAppPrivate *priv = self->priv;
1049
1050 dialog = gtk_message_dialog_new(virt_viewer_window_get_window(priv->main_window),
1051 GTK_DIALOG_MODAL |
1052 GTK_DIALOG_DESTROY_WITH_PARENT,
1053 GTK_MESSAGE_ERROR,
1054 GTK_BUTTONS_YES_NO,
1055 _("Unable to authenticate with remote desktop server at %s: %s\n"
1056 "Retry connection again?"),
1057 priv->pretty_address, msg);
1058
1059 ret = gtk_dialog_run(GTK_DIALOG(dialog));
1060
1061 gtk_widget_destroy(dialog);
1062
1063 if (ret == GTK_RESPONSE_YES)
1064 priv->authretry = TRUE;
1065 else
1066 priv->authretry = FALSE;
9451067 }
9461068
9471069
9481070 static void virt_viewer_app_auth_failed(VirtViewerSession *session G_GNUC_UNUSED,
949 const char *msg,
950 VirtViewerApp *self)
951 {
952 VirtViewerAppPrivate *priv = self->priv;
953
954 virt_viewer_app_simple_message_dialog(self,
955 _("Unable to authenticate with remote desktop server at %s"),
956 priv->pretty_address, msg);
1071 const char *msg,
1072 VirtViewerApp *self)
1073 {
1074 virt_viewer_app_simple_message_dialog(self,
1075 _("Unable to authenticate with remote desktop server: %s"),
1076 msg);
1077 }
1078
1079 static void virt_viewer_app_usb_failed(VirtViewerSession *session G_GNUC_UNUSED,
1080 const gchar *msg,
1081 VirtViewerApp *self)
1082 {
1083 virt_viewer_app_simple_message_dialog(self, _("USB redirection error: %s"), msg);
9571084 }
9581085
9591086 static void
9601087 virt_viewer_app_get_property (GObject *object, guint property_id,
961 GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
962 {
963 g_return_if_fail(VIRT_VIEWER_IS_APP(object));
964 VirtViewerApp *self = VIRT_VIEWER_APP(object);
965 VirtViewerAppPrivate *priv = self->priv;
966
967 switch (property_id) {
968 case PROP_VERBOSE:
969 g_value_set_boolean(value, priv->verbose);
970 break;
971
972 case PROP_CONTAINER:
973 g_value_set_object(value, priv->container);
974 break;
975
976 case PROP_SESSION:
977 g_value_set_object(value, priv->session);
978 break;
979
980 case PROP_GUEST_NAME:
981 g_value_set_string(value, priv->guest_name);
982 break;
983
984 case PROP_FULLSCREEN:
985 g_value_set_boolean(value, priv->fullscreen);
986 break;
987
988 case PROP_TITLE:
989 g_value_set_string(value, priv->title);
990 break;
991
992 default:
993 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
994 }
1088 GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
1089 {
1090 g_return_if_fail(VIRT_VIEWER_IS_APP(object));
1091 VirtViewerApp *self = VIRT_VIEWER_APP(object);
1092 VirtViewerAppPrivate *priv = self->priv;
1093
1094 switch (property_id) {
1095 case PROP_VERBOSE:
1096 g_value_set_boolean(value, priv->verbose);
1097 break;
1098
1099 case PROP_CONTAINER:
1100 g_value_set_object(value, priv->container);
1101 break;
1102
1103 case PROP_SESSION:
1104 g_value_set_object(value, priv->session);
1105 break;
1106
1107 case PROP_GUEST_NAME:
1108 g_value_set_string(value, priv->guest_name);
1109 break;
1110
1111 case PROP_GURI:
1112 g_value_set_string(value, priv->guri);
1113 break;
1114
1115 case PROP_FULLSCREEN:
1116 g_value_set_boolean(value, priv->fullscreen);
1117 break;
1118
1119 case PROP_TITLE:
1120 g_value_set_string(value, priv->title);
1121 break;
1122
1123 default:
1124 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1125 }
9951126 }
9961127
9971128 static void
9981129 virt_viewer_app_set_property (GObject *object, guint property_id,
999 const GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
1000 {
1001 g_return_if_fail(VIRT_VIEWER_IS_APP(object));
1002 VirtViewerApp *self = VIRT_VIEWER_APP(object);
1003 VirtViewerAppPrivate *priv = self->priv;
1004
1005 switch (property_id) {
1006 case PROP_VERBOSE:
1007 priv->verbose = g_value_get_boolean(value);
1008 break;
1009
1010 case PROP_CONTAINER:
1011 g_return_if_fail(priv->container == NULL);
1012 priv->container = g_value_dup_object(value);
1013 break;
1014
1015 case PROP_GUEST_NAME:
1016 g_free(priv->guest_name);
1017 priv->guest_name = g_value_dup_string(value);
1018 break;
1019
1020 case PROP_FULLSCREEN:
1021 virt_viewer_app_set_fullscreen(self, g_value_get_boolean(value));
1022 break;
1023
1024 case PROP_TITLE:
1025 g_free(priv->title);
1026 priv->title = g_value_dup_string(value);
1027 virt_viewer_app_set_all_window_subtitles(self);
1028 break;
1029
1030 default:
1031 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1032 }
1130 const GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
1131 {
1132 g_return_if_fail(VIRT_VIEWER_IS_APP(object));
1133 VirtViewerApp *self = VIRT_VIEWER_APP(object);
1134 VirtViewerAppPrivate *priv = self->priv;
1135
1136 switch (property_id) {
1137 case PROP_VERBOSE:
1138 priv->verbose = g_value_get_boolean(value);
1139 break;
1140
1141 case PROP_CONTAINER:
1142 g_return_if_fail(priv->container == NULL);
1143 priv->container = g_value_dup_object(value);
1144 break;
1145
1146 case PROP_GUEST_NAME:
1147 g_free(priv->guest_name);
1148 priv->guest_name = g_value_dup_string(value);
1149 break;
1150
1151 case PROP_GURI:
1152 g_free(priv->guri);
1153 priv->guri = g_value_dup_string(value);
1154 virt_viewer_app_update_pretty_address(self);
1155 break;
1156
1157 case PROP_FULLSCREEN:
1158 virt_viewer_app_set_fullscreen(self, g_value_get_boolean(value));
1159 break;
1160
1161 case PROP_TITLE:
1162 g_free(priv->title);
1163 priv->title = g_value_dup_string(value);
1164 virt_viewer_app_set_all_window_subtitles(self);
1165 break;
1166
1167 default:
1168 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1169 }
10331170 }
10341171
10351172 static void
10361173 virt_viewer_app_dispose (GObject *object)
10371174 {
1038 VirtViewerApp *self = VIRT_VIEWER_APP(object);
1039 VirtViewerAppPrivate *priv = self->priv;
1040
1041 if (priv->windows) {
1042 g_hash_table_unref(priv->windows);
1043 priv->windows = NULL;
1044 }
1045
1046 if (priv->main_window) {
1047 g_object_unref(priv->main_window);
1048 priv->main_window = NULL;
1049 }
1050
1051 if (priv->container) {
1052 g_object_unref(priv->container);
1053 priv->container = NULL;
1054 }
1055 g_free(priv->title);
1056
1057 virt_viewer_app_free_connect_info(self);
1058
1059 G_OBJECT_CLASS (virt_viewer_app_parent_class)->dispose (object);
1175 VirtViewerApp *self = VIRT_VIEWER_APP(object);
1176 VirtViewerAppPrivate *priv = self->priv;
1177
1178 if (priv->windows) {
1179 g_hash_table_unref(priv->windows);
1180 priv->windows = NULL;
1181 }
1182
1183 if (priv->main_window) {
1184 g_object_unref(priv->main_window);
1185 priv->main_window = NULL;
1186 }
1187
1188 if (priv->container) {
1189 g_object_unref(priv->container);
1190 priv->container = NULL;
1191 }
1192 g_free(priv->title);
1193
1194 virt_viewer_app_free_connect_info(self);
1195
1196 G_OBJECT_CLASS (virt_viewer_app_parent_class)->dispose (object);
10601197 }
10611198
10621199 static gboolean
10631200 virt_viewer_app_default_start(VirtViewerApp *self)
10641201 {
1065 VirtViewerAppPrivate *priv;
1066 GtkWindow *win;
1067 priv = self->priv;
1068
1069 win = virt_viewer_window_get_window(priv->main_window);
1070 if (win)
1071 gtk_widget_show(GTK_WIDGET(win));
1072 else {
1073 gtk_box_pack_end(GTK_BOX(priv->container), priv->main_notebook, TRUE, TRUE, 0);
1074 gtk_widget_show(GTK_WIDGET(priv->main_notebook));
1075 }
1076
1077 return TRUE;
1202 VirtViewerAppPrivate *priv;
1203 GtkWindow *win;
1204 priv = self->priv;
1205
1206 win = virt_viewer_window_get_window(priv->main_window);
1207 if (win)
1208 gtk_widget_show(GTK_WIDGET(win));
1209 else {
1210 gtk_box_pack_end(GTK_BOX(priv->container), priv->main_notebook, TRUE, TRUE, 0);
1211 gtk_widget_show(GTK_WIDGET(priv->main_notebook));
1212 }
1213
1214 return TRUE;
10781215 }
10791216
10801217 gboolean virt_viewer_app_start(VirtViewerApp *self)
10811218 {
1082 VirtViewerAppClass *klass;
1083
1084 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
1085 klass = VIRT_VIEWER_APP_GET_CLASS(self);
1086
1087 g_return_val_if_fail(!self->priv->started, TRUE);
1088
1089 self->priv->started = klass->start(self);
1090 return self->priv->started;
1219 VirtViewerAppClass *klass;
1220
1221 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
1222 klass = VIRT_VIEWER_APP_GET_CLASS(self);
1223
1224 g_return_val_if_fail(!self->priv->started, TRUE);
1225
1226 self->priv->started = klass->start(self);
1227 return self->priv->started;
10911228 }
10921229
10931230 static void
10941231 virt_viewer_app_init (VirtViewerApp *self)
10951232 {
1096 self->priv = GET_PRIVATE(self);
1097 self->priv->windows = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, g_object_unref);
1233 self->priv = GET_PRIVATE(self);
1234 self->priv->windows = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, g_object_unref);
10981235 }
10991236
11001237 static GObject *
11011238 virt_viewer_app_constructor (GType gtype,
1102 guint n_properties,
1103 GObjectConstructParam *properties)
1104 {
1105 GObject *obj;
1106 VirtViewerApp *self;
1107 VirtViewerAppPrivate *priv;
1108
1109 obj = G_OBJECT_CLASS (virt_viewer_app_parent_class)->constructor (gtype, n_properties, properties);
1110 self = VIRT_VIEWER_APP(obj);
1111 priv = self->priv;
1112
1113 priv->main_window = virt_viewer_app_window_new(self, priv->container, 0);
1114 priv->main_notebook = GTK_WIDGET(virt_viewer_window_get_notebook(priv->main_window));
1115
1116 return obj;
1239 guint n_properties,
1240 GObjectConstructParam *properties)
1241 {
1242 GObject *obj;
1243 VirtViewerApp *self;
1244 VirtViewerAppPrivate *priv;
1245
1246 obj = G_OBJECT_CLASS (virt_viewer_app_parent_class)->constructor (gtype, n_properties, properties);
1247 self = VIRT_VIEWER_APP(obj);
1248 priv = self->priv;
1249
1250 priv->main_window = virt_viewer_app_window_new(self, priv->container, 0);
1251 priv->main_notebook = GTK_WIDGET(virt_viewer_window_get_notebook(priv->main_window));
1252
1253 return obj;
11171254 }
11181255
11191256 static void
11201257 virt_viewer_app_class_init (VirtViewerAppClass *klass)
11211258 {
1122 GObjectClass *object_class = G_OBJECT_CLASS (klass);
1123
1124 g_type_class_add_private (klass, sizeof (VirtViewerAppPrivate));
1125
1126 object_class->constructor = virt_viewer_app_constructor;
1127 object_class->get_property = virt_viewer_app_get_property;
1128 object_class->set_property = virt_viewer_app_set_property;
1129 object_class->dispose = virt_viewer_app_dispose;
1130
1131 klass->start = virt_viewer_app_default_start;
1132 klass->initial_connect = virt_viewer_app_default_initial_connect;
1133 klass->deactivated = virt_viewer_app_default_deactivated;
1134
1135 g_object_class_install_property(object_class,
1136 PROP_VERBOSE,
1137 g_param_spec_boolean("verbose",
1138 "Verbose",
1139 "Verbose trace",
1140 FALSE,
1141 G_PARAM_READABLE |
1142 G_PARAM_WRITABLE |
1143 G_PARAM_STATIC_STRINGS));
1144
1145 g_object_class_install_property(object_class,
1146 PROP_CONTAINER,
1147 g_param_spec_object("container",
1148 "Container",
1149 "Widget container",
1150 GTK_TYPE_WIDGET,
1151 G_PARAM_READABLE |
1152 G_PARAM_WRITABLE |
1153 G_PARAM_CONSTRUCT_ONLY |
1154 G_PARAM_STATIC_STRINGS));
1155
1156 g_object_class_install_property(object_class,
1157 PROP_SESSION,
1158 g_param_spec_object("session",
1159 "Session",
1160 "ViewerSession",
1161 VIRT_VIEWER_TYPE_SESSION,
1162 G_PARAM_READABLE |
1163 G_PARAM_STATIC_STRINGS));
1164
1165 g_object_class_install_property(object_class,
1166 PROP_GUEST_NAME,
1167 g_param_spec_string("guest-name",
1168 "Guest name",
1169 "Guest name",
1170 "",
1171 G_PARAM_READABLE |
1172 G_PARAM_WRITABLE |
1173 G_PARAM_STATIC_STRINGS));
1174
1175 g_object_class_install_property(object_class,
1176 PROP_FULLSCREEN,
1177 g_param_spec_boolean("fullscreen",
1178 "Fullscreen",
1179 "Fullscreen",
1180 FALSE,
1181 G_PARAM_READABLE |
1182 G_PARAM_WRITABLE |
1183 G_PARAM_STATIC_STRINGS));
1184 g_object_class_install_property(object_class,
1185 PROP_TITLE,
1186 g_param_spec_string("title",
1187 "Title",
1188 "Title",
1189 "",
1190 G_PARAM_READABLE |
1191 G_PARAM_WRITABLE |
1192 G_PARAM_STATIC_STRINGS));
1193
1259 GObjectClass *object_class = G_OBJECT_CLASS (klass);
1260
1261 g_type_class_add_private (klass, sizeof (VirtViewerAppPrivate));
1262
1263 object_class->constructor = virt_viewer_app_constructor;
1264 object_class->get_property = virt_viewer_app_get_property;
1265 object_class->set_property = virt_viewer_app_set_property;
1266 object_class->dispose = virt_viewer_app_dispose;
1267
1268 klass->start = virt_viewer_app_default_start;
1269 klass->initial_connect = virt_viewer_app_default_initial_connect;
1270 klass->activate = virt_viewer_app_default_activate;
1271 klass->deactivated = virt_viewer_app_default_deactivated;
1272 klass->open_connection = virt_viewer_app_default_open_connection;
1273
1274 g_object_class_install_property(object_class,
1275 PROP_VERBOSE,
1276 g_param_spec_boolean("verbose",
1277 "Verbose",
1278 "Verbose trace",
1279 FALSE,
1280 G_PARAM_READABLE |
1281 G_PARAM_WRITABLE |
1282 G_PARAM_STATIC_STRINGS));
1283
1284 g_object_class_install_property(object_class,
1285 PROP_CONTAINER,
1286 g_param_spec_object("container",
1287 "Container",
1288 "Widget container",
1289 GTK_TYPE_WIDGET,
1290 G_PARAM_READABLE |
1291 G_PARAM_WRITABLE |
1292 G_PARAM_CONSTRUCT_ONLY |
1293 G_PARAM_STATIC_STRINGS));
1294
1295 g_object_class_install_property(object_class,
1296 PROP_SESSION,
1297 g_param_spec_object("session",
1298 "Session",
1299 "ViewerSession",
1300 VIRT_VIEWER_TYPE_SESSION,
1301 G_PARAM_READABLE |
1302 G_PARAM_STATIC_STRINGS));
1303
1304 g_object_class_install_property(object_class,
1305 PROP_GUEST_NAME,
1306 g_param_spec_string("guest-name",
1307 "Guest name",
1308 "Guest name",
1309 "",
1310 G_PARAM_READABLE |
1311 G_PARAM_WRITABLE |
1312 G_PARAM_STATIC_STRINGS));
1313
1314 g_object_class_install_property(object_class,
1315 PROP_GURI,
1316 g_param_spec_string("guri",
1317 "guri",
1318 "Remote graphical URI",
1319 "",
1320 G_PARAM_READABLE |
1321 G_PARAM_WRITABLE |
1322 G_PARAM_CONSTRUCT_ONLY |
1323 G_PARAM_STATIC_STRINGS));
1324
1325 g_object_class_install_property(object_class,
1326 PROP_FULLSCREEN,
1327 g_param_spec_boolean("fullscreen",
1328 "Fullscreen",
1329 "Fullscreen",
1330 FALSE,
1331 G_PARAM_READABLE |
1332 G_PARAM_WRITABLE |
1333 G_PARAM_STATIC_STRINGS));
1334 g_object_class_install_property(object_class,
1335 PROP_TITLE,
1336 g_param_spec_string("title",
1337 "Title",
1338 "Title",
1339 "",
1340 G_PARAM_READABLE |
1341 G_PARAM_WRITABLE |
1342 G_PARAM_STATIC_STRINGS));
1343
1344 signals[SIGNAL_WINDOW_ADDED] =
1345 g_signal_new("window-added",
1346 G_OBJECT_CLASS_TYPE(object_class),
1347 G_SIGNAL_RUN_LAST,
1348 G_STRUCT_OFFSET(VirtViewerAppClass, window_added),
1349 NULL, NULL,
1350 g_cclosure_marshal_VOID__OBJECT,
1351 G_TYPE_NONE,
1352 1,
1353 G_TYPE_OBJECT);
1354
1355 signals[SIGNAL_WINDOW_REMOVED] =
1356 g_signal_new("window-removed",
1357 G_OBJECT_CLASS_TYPE(object_class),
1358 G_SIGNAL_RUN_LAST,
1359 G_STRUCT_OFFSET(VirtViewerAppClass, window_removed),
1360 NULL, NULL,
1361 g_cclosure_marshal_VOID__OBJECT,
1362 G_TYPE_NONE,
1363 1,
1364 G_TYPE_OBJECT);
11941365 }
11951366
11961367 void
11971368 virt_viewer_app_set_direct(VirtViewerApp *self, gboolean direct)
11981369 {
1199 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1200
1201 self->priv->direct = direct;
1370 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1371
1372 self->priv->direct = direct;
1373 }
1374
1375 void
1376 virt_viewer_app_set_attach(VirtViewerApp *self, gboolean attach)
1377 {
1378 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1379
1380 self->priv->attach = attach;
1381 }
1382
1383 gboolean
1384 virt_viewer_app_get_attach(VirtViewerApp *self)
1385 {
1386 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
1387
1388 return self->priv->attach;
12021389 }
12031390
12041391 gboolean
12051392 virt_viewer_app_is_active(VirtViewerApp *self)
12061393 {
1207 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
1208
1209 return self->priv->active;
1394 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
1395
1396 return self->priv->active;
12101397 }
12111398
12121399 gboolean
12131400 virt_viewer_app_has_session(VirtViewerApp *self)
12141401 {
1215 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
1216
1217 return self->priv->session != NULL;
1402 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
1403
1404 return self->priv->session != NULL;
12181405 }
12191406
12201407 static void
12211408 virt_viewer_app_update_pretty_address(VirtViewerApp *self)
12221409 {
1223 VirtViewerAppPrivate *priv;
1224
1225 priv = self->priv;
1226 g_free(priv->pretty_address);
1227 if (priv->gport)
1228 priv->pretty_address = g_strdup_printf("%s:%s", priv->ghost, priv->gport);
1229 else
1230 priv->pretty_address = g_strdup_printf("%s:%s", priv->host, priv->unixsock);
1410 VirtViewerAppPrivate *priv;
1411
1412 priv = self->priv;
1413 g_free(priv->pretty_address);
1414 if (priv->guri)
1415 priv->pretty_address = g_strdup(priv->guri);
1416 else if (priv->gport)
1417 priv->pretty_address = g_strdup_printf("%s:%s", priv->ghost, priv->gport);
1418 else
1419 priv->pretty_address = g_strdup_printf("%s:%s", priv->host, priv->unixsock);
12311420 }
12321421
12331422 typedef struct {
1234 gboolean fullscreen;
1235 gboolean move;
1423 gboolean fullscreen;
1424 gboolean move;
12361425 } FullscreenOptions;
12371426
12381427 static void fullscreen_cb(gpointer key,
1239 gpointer value,
1240 gpointer user_data)
1241 {
1242 gint nth = *(gint*)key;
1243 FullscreenOptions *options = (FullscreenOptions *)user_data;
1244 VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(value);
1245
1246 DEBUG_LOG("fullscreen display %d: %d", nth, options->fullscreen);
1247 if (options->fullscreen) {
1248 GdkScreen *screen = gdk_screen_get_default ();
1249 GdkRectangle mon;
1250
1251 if (nth >= gdk_screen_get_n_monitors(screen)) {
1252 DEBUG_LOG("skipping display %d", nth);
1253 return;
1254 }
1255 gdk_screen_get_monitor_geometry(screen, nth, &mon);
1256 virt_viewer_window_enter_fullscreen(vwin, options->move, mon.x, mon.y);
1257 } else
1258 virt_viewer_window_leave_fullscreen(vwin);
1428 gpointer value,
1429 gpointer user_data)
1430 {
1431 gint nth = *(gint*)key;
1432 FullscreenOptions *options = (FullscreenOptions *)user_data;
1433 VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(value);
1434
1435 DEBUG_LOG("fullscreen display %d: %d", nth, options->fullscreen);
1436 if (options->fullscreen) {
1437 GdkScreen *screen = gdk_screen_get_default ();
1438 GdkRectangle mon;
1439
1440 if (nth >= gdk_screen_get_n_monitors(screen)) {
1441 DEBUG_LOG("skipping display %d", nth);
1442 return;
1443 }
1444 gdk_screen_get_monitor_geometry(screen, nth, &mon);
1445 virt_viewer_window_enter_fullscreen(vwin, options->move, mon.x, mon.y);
1446 } else
1447 virt_viewer_window_leave_fullscreen(vwin);
12591448 }
12601449
12611450 static void
12621451 virt_viewer_app_set_fullscreen(VirtViewerApp *self, gboolean fullscreen)
12631452 {
1264 VirtViewerAppPrivate *priv = self->priv;
1265 FullscreenOptions options = {
1266 .fullscreen = fullscreen,
1267 .move = virt_viewer_app_get_n_windows_visible(self) > 1,
1268 };
1269
1270 /* we iterate unconditionnaly, even if it was set before to update new windows */
1271 priv->fullscreen = fullscreen;
1272 g_hash_table_foreach(priv->windows, fullscreen_cb, &options);
1453 VirtViewerAppPrivate *priv = self->priv;
1454 FullscreenOptions options = {
1455 .fullscreen = fullscreen,
1456 .move = virt_viewer_app_get_n_windows_visible(self) > 1,
1457 };
1458
1459 /* we iterate unconditionnaly, even if it was set before to update new windows */
1460 priv->fullscreen = fullscreen;
1461 g_hash_table_foreach(priv->windows, fullscreen_cb, &options);
12731462 }
12741463
12751464 static void
12761465 menu_display_visible_toggled_cb(GtkCheckMenuItem *checkmenuitem,
1277 VirtViewerWindow *vwin)
1278 {
1279 VirtViewerApp *self;
1280 gboolean visible;
1281 static gboolean reentering = FALSE;
1282
1283 if (reentering) /* do not reenter if I switch you back */
1284 return;
1285
1286 reentering = TRUE;
1287 g_object_get(vwin, "app", &self, NULL);
1288 visible = virt_viewer_app_window_set_visible(self, vwin,
1289 gtk_check_menu_item_get_active(checkmenuitem));
1290 gtk_check_menu_item_set_active(checkmenuitem, /* will be toggled again */ !visible);
1291 g_object_unref(self);
1292 reentering = FALSE;
1466 VirtViewerWindow *vwin)
1467 {
1468 VirtViewerApp *self;
1469 gboolean visible;
1470 static gboolean reentering = FALSE;
1471
1472 if (reentering) /* do not reenter if I switch you back */
1473 return;
1474
1475 reentering = TRUE;
1476 g_object_get(vwin, "app", &self, NULL);
1477 visible = virt_viewer_app_window_set_visible(self, vwin,
1478 gtk_check_menu_item_get_active(checkmenuitem));
1479 gtk_check_menu_item_set_active(checkmenuitem, /* will be toggled again */ !visible);
1480 g_object_unref(self);
1481 reentering = FALSE;
12931482 }
12941483
12951484 static gint
12961485 update_menu_displays_sort(gconstpointer a, gconstpointer b)
12971486 {
1298 const int *ai = a;
1299 const int *bi = b;
1300
1301 if (*ai > *bi)
1302 return 1;
1303 else if (*ai < *bi)
1304 return -1;
1305 else
1306 return 0;
1487 const int *ai = a;
1488 const int *bi = b;
1489
1490 if (*ai > *bi)
1491 return 1;
1492 else if (*ai < *bi)
1493 return -1;
1494 else
1495 return 0;
13071496 }
13081497
13091498 static void
13101499 window_update_menu_displays_cb(gpointer key G_GNUC_UNUSED,
1311 gpointer value,
1312 gpointer user_data)
1313 {
1314 VirtViewerApp *self = VIRT_VIEWER_APP(user_data);
1315 VirtViewerWindow *window = VIRT_VIEWER_WINDOW(value);
1316 GtkMenuShell *submenu = GTK_MENU_SHELL(gtk_menu_new());
1317 GtkMenuItem *menu = virt_viewer_window_get_menu_displays(window);
1318 GList *keys = g_hash_table_get_keys(self->priv->windows);
1319 GList *tmp;
1320
1321 keys = g_list_sort(keys, update_menu_displays_sort);
1322
1323 tmp = keys;
1324 while (tmp) {
1325 int *nth = tmp->data;
1326 VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(g_hash_table_lookup(self->priv->windows, nth));
1327 GtkWidget *item;
1328 gboolean visible;
1329
1330 item = gtk_check_menu_item_new_with_label(g_strdup_printf("Display %d", *nth));
1331 visible = gtk_widget_get_visible(GTK_WIDGET(virt_viewer_window_get_window(vwin)));
1332 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), visible);
1333 g_signal_connect(G_OBJECT(item),
1334 "toggled", G_CALLBACK(menu_display_visible_toggled_cb), vwin);
1335 gtk_menu_shell_append(submenu, item);
1336 tmp = tmp->next;
1337 }
1338
1339 gtk_widget_show_all(GTK_WIDGET(submenu));
1340 gtk_menu_item_set_submenu(menu, GTK_WIDGET(submenu));
1341 g_list_free(keys);
1500 gpointer value,
1501 gpointer user_data)
1502 {
1503 VirtViewerApp *self = VIRT_VIEWER_APP(user_data);
1504 VirtViewerWindow *window = VIRT_VIEWER_WINDOW(value);
1505 GtkMenuShell *submenu = GTK_MENU_SHELL(gtk_menu_new());
1506 GtkMenuItem *menu = virt_viewer_window_get_menu_displays(window);
1507 GList *keys = g_hash_table_get_keys(self->priv->windows);
1508 GList *tmp;
1509
1510 keys = g_list_sort(keys, update_menu_displays_sort);
1511
1512 tmp = keys;
1513 while (tmp) {
1514 int *nth = tmp->data;
1515 VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(g_hash_table_lookup(self->priv->windows, nth));
1516 GtkWidget *item;
1517 gboolean visible;
1518
1519 item = gtk_check_menu_item_new_with_label(g_strdup_printf("Display %d", *nth));
1520 visible = gtk_widget_get_visible(GTK_WIDGET(virt_viewer_window_get_window(vwin)));
1521 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), visible);
1522 g_signal_connect(G_OBJECT(item),
1523 "toggled", G_CALLBACK(menu_display_visible_toggled_cb), vwin);
1524 gtk_menu_shell_append(submenu, item);
1525 tmp = tmp->next;
1526 }
1527
1528 gtk_widget_show_all(GTK_WIDGET(submenu));
1529 gtk_menu_item_set_submenu(menu, GTK_WIDGET(submenu));
1530 g_list_free(keys);
13421531 }
13431532
13441533 static void
13451534 virt_viewer_app_update_menu_displays(VirtViewerApp *self)
13461535 {
1347 g_hash_table_foreach(self->priv->windows, window_update_menu_displays_cb, self);
1536 g_hash_table_foreach(self->priv->windows, window_update_menu_displays_cb, self);
13481537 }
13491538
13501539 void
13511540 virt_viewer_app_set_connect_info(VirtViewerApp *self,
1352 const gchar *host,
1353 const gchar *ghost,
1354 const gchar *gport,
1355 const gchar *transport,
1356 const gchar *unixsock,
1357 const gchar *user,
1358 gint port)
1359 {
1360 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1361 VirtViewerAppPrivate *priv = self->priv;
1362
1363 DEBUG_LOG("Set connect info: %s,%s,%s,%s,%s,%s,%d",
1364 host, ghost, gport, transport, unixsock, user, port);
1365
1366 g_free(priv->host);
1367 g_free(priv->ghost);
1368 g_free(priv->gport);
1369 g_free(priv->transport);
1370 g_free(priv->unixsock);
1371 g_free(priv->user);
1372
1373 priv->host = g_strdup(host);
1374 priv->ghost = g_strdup(ghost);
1375 priv->gport = g_strdup(gport);
1376 priv->transport = g_strdup(transport);
1377 priv->unixsock = g_strdup(unixsock);
1378 priv->user = g_strdup(user);
1379 priv->port = port;
1380
1381 virt_viewer_app_update_pretty_address(self);
1541 const gchar *host,
1542 const gchar *ghost,
1543 const gchar *gport,
1544 const gchar *gtlsport,
1545 const gchar *transport,
1546 const gchar *unixsock,
1547 const gchar *user,
1548 gint port,
1549 const gchar *guri)
1550 {
1551 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1552 VirtViewerAppPrivate *priv = self->priv;
1553
1554 DEBUG_LOG("Set connect info: %s,%s,%s,%s,%s,%s,%s,%d",
1555 host, ghost, gport, gtlsport ? gtlsport : "-1", transport, unixsock, user, port);
1556
1557 g_free(priv->host);
1558 g_free(priv->ghost);
1559 g_free(priv->gport);
1560 g_free(priv->gtlsport);
1561 g_free(priv->transport);
1562 g_free(priv->unixsock);
1563 g_free(priv->user);
1564 g_free(priv->guri);
1565
1566 priv->host = g_strdup(host);
1567 priv->ghost = g_strdup(ghost);
1568 priv->gport = g_strdup(gport);
1569 priv->gtlsport = gtlsport ? g_strdup(gtlsport) : NULL;
1570 priv->transport = g_strdup(transport);
1571 priv->unixsock = g_strdup(unixsock);
1572 priv->user = g_strdup(user);
1573 priv->guri = g_strdup(guri);
1574 priv->port = port;
1575
1576 virt_viewer_app_update_pretty_address(self);
13821577 }
13831578
13841579 void
13851580 virt_viewer_app_free_connect_info(VirtViewerApp *self)
13861581 {
1387 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1388
1389 virt_viewer_app_set_connect_info(self, NULL, NULL, NULL, NULL, NULL, NULL, 0);
1582 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1583
1584 virt_viewer_app_set_connect_info(self, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL);
13901585 }
13911586
13921587 VirtViewerWindow*
13931588 virt_viewer_app_get_main_window(VirtViewerApp *self)
13941589 {
1395 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL);
1396
1397 return self->priv->main_window;
1590 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL);
1591
1592 return self->priv->main_window;
13981593 }
13991594
14001595 static void
14011596 show_status_cb(gpointer key G_GNUC_UNUSED,
1402 gpointer value,
1403 gpointer user_data)
1404 {
1405 VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value));
1406 gchar *text = (gchar*)user_data;
1407
1408 virt_viewer_notebook_show_status(nb, text);
1597 gpointer value,
1598 gpointer user_data)
1599 {
1600 VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value));
1601 gchar *text = (gchar*)user_data;
1602
1603 virt_viewer_notebook_show_status(nb, text);
14091604 }
14101605
14111606 void
14121607 virt_viewer_app_show_status(VirtViewerApp *self, const gchar *fmt, ...)
14131608 {
1414 va_list args;
1415 gchar *text;
1416
1417 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1418
1419 va_start(args, fmt);
1420 text = g_strdup_vprintf(fmt, args);
1421 va_end(args);
1422
1423 g_hash_table_foreach(self->priv->windows, show_status_cb, text);
1424 g_free(text);
1609 va_list args;
1610 gchar *text;
1611
1612 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1613 g_return_if_fail(fmt != NULL);
1614
1615 va_start(args, fmt);
1616 text = g_strdup_vprintf(fmt, args);
1617 va_end(args);
1618
1619 g_hash_table_foreach(self->priv->windows, show_status_cb, text);
1620 g_free(text);
14251621 }
14261622
14271623 static void
14281624 show_display_cb(gpointer key G_GNUC_UNUSED,
1429 gpointer value,
1430 gpointer user_data G_GNUC_UNUSED)
1431 {
1432 VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value));
1433
1434 virt_viewer_notebook_show_display(nb);
1625 gpointer value,
1626 gpointer user_data G_GNUC_UNUSED)
1627 {
1628 VirtViewerNotebook *nb = virt_viewer_window_get_notebook(VIRT_VIEWER_WINDOW(value));
1629
1630 virt_viewer_notebook_show_display(nb);
14351631 }
14361632
14371633 void
14381634 virt_viewer_app_show_display(VirtViewerApp *self)
14391635 {
1440 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1441 g_hash_table_foreach(self->priv->windows, show_display_cb, self);
1636 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1637 g_hash_table_foreach(self->priv->windows, show_display_cb, self);
1638 }
1639
1640 GHashTable*
1641 virt_viewer_app_get_windows(VirtViewerApp *self)
1642 {
1643 g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL);
1644 return self->priv->windows;
1645 }
1646
1647 void virt_viewer_app_usb_device_selection(VirtViewerApp *self,
1648 GtkWindow *parent)
1649 {
1650 g_return_if_fail(VIRT_VIEWER_IS_APP(self));
1651 g_return_if_fail(self->priv->session != NULL);
1652
1653 virt_viewer_session_usb_device_selection(self->priv->session, parent);
14421654 }
14431655
14441656 /*
14451657 * Local variables:
1446 * c-indent-level: 8
1447 * c-basic-offset: 8
1448 * tab-width: 8
1449 * indent-tabs-mode: t
1658 * c-indent-level: 4
1659 * c-basic-offset: 4
1660 * indent-tabs-mode: nil
14501661 * End:
14511662 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007 Red Hat,
3 * Copyright (C) 2007-2012 Red Hat, Inc.
44 *
55 * This program is free software; you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
3838 typedef struct _VirtViewerAppPrivate VirtViewerAppPrivate;
3939
4040 typedef struct {
41 GObject parent;
42 VirtViewerAppPrivate *priv;
41 GObject parent;
42 VirtViewerAppPrivate *priv;
4343 } VirtViewerApp;
4444
4545 typedef struct {
46 GObjectClass parent_class;
46 GObjectClass parent_class;
4747
48 gboolean (*start) (VirtViewerApp *self);
49 int (*initial_connect) (VirtViewerApp *self);
50 void (*deactivated) (VirtViewerApp *self);
48 /* signals */
49 void (*window_added) (VirtViewerApp *self, VirtViewerWindow *window);
50 void (*window_removed) (VirtViewerApp *self, VirtViewerWindow *window);
51
52 /*< private >*/
53 gboolean (*start) (VirtViewerApp *self);
54 int (*initial_connect) (VirtViewerApp *self);
55 int (*activate) (VirtViewerApp *self);
56 void (*deactivated) (VirtViewerApp *self);
57 gboolean (*open_connection)(VirtViewerApp *self, int *fd);
5158 } VirtViewerAppClass;
5259
5360 GType virt_viewer_app_get_type (void);
6673 void virt_viewer_app_start_reconnect_poll(VirtViewerApp *self);
6774 void virt_viewer_app_set_zoom_level(VirtViewerApp *self, gint zoom_level);
6875 void virt_viewer_app_set_direct(VirtViewerApp *self, gboolean direct);
76 void virt_viewer_app_set_attach(VirtViewerApp *self, gboolean attach);
77 gboolean virt_viewer_app_get_attach(VirtViewerApp *self);
6978 gboolean virt_viewer_app_has_session(VirtViewerApp *self);
7079 void virt_viewer_app_set_connect_info(VirtViewerApp *self,
7180 const gchar *host,
7281 const gchar *ghost,
7382 const gchar *gport,
83 const gchar *gtlsport,
7484 const gchar *transport,
7585 const gchar *unixsock,
7686 const gchar *user,
77 gint port);
87 gint port,
88 const gchar *guri);
7889 gboolean virt_viewer_app_window_set_visible(VirtViewerApp *self, VirtViewerWindow *window, gboolean visible);
7990 void virt_viewer_app_show_status(VirtViewerApp *self, const gchar *fmt, ...);
8091 void virt_viewer_app_show_display(VirtViewerApp *self);
92 GHashTable* virt_viewer_app_get_windows(VirtViewerApp *self);
93
94 void virt_viewer_app_usb_device_selection(VirtViewerApp *self,
95 GtkWindow *parent);
8196
8297 G_END_DECLS
8398
8499 #endif /* VIRT_VIEWER_APP_H */
100 /*
101 * Local variables:
102 * c-indent-level: 4
103 * c-basic-offset: 4
104 * indent-tabs-mode: nil
105 * End:
106 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
3 * Copyright (C) 2007-2012 Red Hat, Inc.
44 *
55 * This program is free software; you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
3232
3333
3434 int
35 virt_viewer_auth_collect_credentials(const char *type,
36 const char *address,
37 char **username,
38 char **password)
35 virt_viewer_auth_collect_credentials(GtkWindow *window,
36 const char *type,
37 const char *address,
38 char **username,
39 char **password)
3940 {
40 GtkWidget *dialog = NULL;
41 GtkBuilder *creds = virt_viewer_util_load_ui("virt-viewer-auth.xml");
42 GtkWidget *credUsername;
43 GtkWidget *credPassword;
44 GtkWidget *promptUsername;
45 GtkWidget *promptPassword;
46 GtkWidget *labelMessage;
47 int response;
48 char *message;
41 GtkWidget *dialog = NULL;
42 GtkBuilder *creds = virt_viewer_util_load_ui("virt-viewer-auth.xml");
43 GtkWidget *credUsername;
44 GtkWidget *credPassword;
45 GtkWidget *promptUsername;
46 GtkWidget *promptPassword;
47 GtkWidget *labelMessage;
48 int response;
49 char *message;
4950
50 dialog = GTK_WIDGET(gtk_builder_get_object(creds, "auth"));
51 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
51 dialog = GTK_WIDGET(gtk_builder_get_object(creds, "auth"));
52 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
53 gtk_window_set_transient_for(GTK_WINDOW(dialog), window);
5254
53 labelMessage = GTK_WIDGET(gtk_builder_get_object(creds, "message"));
54 credUsername = GTK_WIDGET(gtk_builder_get_object(creds, "cred-username"));
55 promptUsername = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-username"));
56 credPassword = GTK_WIDGET(gtk_builder_get_object(creds, "cred-password"));
57 promptPassword = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-password"));
55 labelMessage = GTK_WIDGET(gtk_builder_get_object(creds, "message"));
56 credUsername = GTK_WIDGET(gtk_builder_get_object(creds, "cred-username"));
57 promptUsername = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-username"));
58 credPassword = GTK_WIDGET(gtk_builder_get_object(creds, "cred-password"));
59 promptPassword = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-password"));
5860
59 gtk_widget_set_sensitive(credUsername, username != NULL);
60 gtk_widget_set_sensitive(promptUsername, username != NULL);
61 gtk_widget_set_sensitive(credPassword, password != NULL);
62 gtk_widget_set_sensitive(promptPassword, password != NULL);
61 gtk_widget_set_sensitive(credUsername, username != NULL);
62 gtk_widget_set_sensitive(promptUsername, username != NULL);
63 gtk_widget_set_sensitive(credPassword, password != NULL);
64 gtk_widget_set_sensitive(promptPassword, password != NULL);
6365
64 if (address) {
65 message = g_strdup_printf("Authentication is required for the %s connection to:\n\n"
66 "<b>%s</b>\n\n",
67 type,
68 address);
69 } else {
70 message = g_strdup_printf("Authentication is required for the %s connection:\n",
71 type);
72 }
66 if (address) {
67 message = g_strdup_printf("Authentication is required for the %s connection to:\n\n"
68 "<b>%s</b>\n\n",
69 type,
70 address);
71 } else {
72 message = g_strdup_printf("Authentication is required for the %s connection:\n",
73 type);
74 }
7375
74 gtk_label_set_markup(GTK_LABEL(labelMessage), message);
75 g_free(message);
76 gtk_label_set_markup(GTK_LABEL(labelMessage), message);
77 g_free(message);
7678
77 gtk_widget_show_all(dialog);
78 response = gtk_dialog_run(GTK_DIALOG(dialog));
79 gtk_widget_hide(dialog);
79 gtk_widget_show_all(dialog);
80 response = gtk_dialog_run(GTK_DIALOG(dialog));
81 gtk_widget_hide(dialog);
8082
81 if (response == GTK_RESPONSE_OK) {
82 if (username)
83 *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(credUsername)));
84 if (password)
85 *password = g_strdup(gtk_entry_get_text(GTK_ENTRY(credPassword)));
86 }
83 if (response == GTK_RESPONSE_OK) {
84 if (username)
85 *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(credUsername)));
86 if (password)
87 *password = g_strdup(gtk_entry_get_text(GTK_ENTRY(credPassword)));
88 }
8789
88 gtk_widget_destroy(GTK_WIDGET(dialog));
90 gtk_widget_destroy(GTK_WIDGET(dialog));
8991
90 return response == GTK_RESPONSE_OK ? 0 : -1;
92 return response == GTK_RESPONSE_OK ? 0 : -1;
9193 }
9294
9395 #ifdef HAVE_GTK_VNC
9496 void
95 virt_viewer_auth_vnc_credentials(GtkWidget *vnc,
96 GValueArray *credList,
97 char **vncAddress)
97 virt_viewer_auth_vnc_credentials(GtkWindow *window,
98 GtkWidget *vnc,
99 GValueArray *credList,
100 char *vncAddress)
98101 {
99 char *username = NULL, *password = NULL;
100 gboolean wantPassword = FALSE, wantUsername = FALSE;
101 int i;
102 char *username = NULL, *password = NULL;
103 gboolean wantPassword = FALSE, wantUsername = FALSE;
104 int i;
102105
103 DEBUG_LOG("Got VNC credential request for %d credential(s)", credList->n_values);
106 DEBUG_LOG("Got VNC credential request for %d credential(s)", credList->n_values);
104107
105 for (i = 0 ; i < credList->n_values ; i++) {
106 GValue *cred = g_value_array_get_nth(credList, i);
107 switch (g_value_get_enum(cred)) {
108 case VNC_DISPLAY_CREDENTIAL_USERNAME:
109 wantUsername = TRUE;
110 break;
111 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
112 wantPassword = TRUE;
113 break;
114 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
115 break;
116 default:
117 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
118 vnc_display_close(VNC_DISPLAY(vnc));
119 goto cleanup;
120 }
108 for (i = 0 ; i < credList->n_values ; i++) {
109 GValue *cred = g_value_array_get_nth(credList, i);
110 switch (g_value_get_enum(cred)) {
111 case VNC_DISPLAY_CREDENTIAL_USERNAME:
112 wantUsername = TRUE;
113 break;
114 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
115 wantPassword = TRUE;
116 break;
117 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
118 break;
119 default:
120 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
121 vnc_display_close(VNC_DISPLAY(vnc));
122 goto cleanup;
121123 }
124 }
122125
123 if (wantUsername || wantPassword) {
124 int ret = virt_viewer_auth_collect_credentials("VNC", vncAddress ? *vncAddress : NULL,
125 wantUsername ? &username : NULL,
126 wantPassword ? &password : NULL);
126 if (wantUsername || wantPassword) {
127 int ret = virt_viewer_auth_collect_credentials(window,
128 "VNC", vncAddress,
129 wantUsername ? &username : NULL,
130 wantPassword ? &password : NULL);
127131
128 if (ret < 0) {
129 vnc_display_close(VNC_DISPLAY(vnc));
130 goto cleanup;
131 }
132 if (ret < 0) {
133 vnc_display_close(VNC_DISPLAY(vnc));
134 goto cleanup;
132135 }
136 }
133137
134 for (i = 0 ; i < credList->n_values ; i++) {
135 GValue *cred = g_value_array_get_nth(credList, i);
136 switch (g_value_get_enum(cred)) {
137 case VNC_DISPLAY_CREDENTIAL_USERNAME:
138 if (!username ||
139 vnc_display_set_credential(VNC_DISPLAY(vnc),
140 g_value_get_enum(cred),
141 username)) {
142 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
143 vnc_display_close(VNC_DISPLAY(vnc));
144 }
145 break;
146 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
147 if (!password ||
148 vnc_display_set_credential(VNC_DISPLAY(vnc),
149 g_value_get_enum(cred),
150 password)) {
151 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
152 vnc_display_close(VNC_DISPLAY(vnc));
153 }
154 break;
155 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
156 if (vnc_display_set_credential(VNC_DISPLAY(vnc),
157 g_value_get_enum(cred),
158 "libvirt")) {
159 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
160 vnc_display_close(VNC_DISPLAY(vnc));
161 }
162 break;
163 default:
164 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
165 vnc_display_close(VNC_DISPLAY(vnc));
166 }
138 for (i = 0 ; i < credList->n_values ; i++) {
139 GValue *cred = g_value_array_get_nth(credList, i);
140 switch (g_value_get_enum(cred)) {
141 case VNC_DISPLAY_CREDENTIAL_USERNAME:
142 if (!username ||
143 vnc_display_set_credential(VNC_DISPLAY(vnc),
144 g_value_get_enum(cred),
145 username)) {
146 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
147 vnc_display_close(VNC_DISPLAY(vnc));
148 }
149 break;
150 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
151 if (!password ||
152 vnc_display_set_credential(VNC_DISPLAY(vnc),
153 g_value_get_enum(cred),
154 password)) {
155 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
156 vnc_display_close(VNC_DISPLAY(vnc));
157 }
158 break;
159 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
160 if (vnc_display_set_credential(VNC_DISPLAY(vnc),
161 g_value_get_enum(cred),
162 "libvirt")) {
163 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
164 vnc_display_close(VNC_DISPLAY(vnc));
165 }
166 break;
167 default:
168 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
169 vnc_display_close(VNC_DISPLAY(vnc));
167170 }
171 }
168172
169173 cleanup:
170 g_free(username);
171 g_free(password);
174 g_free(username);
175 g_free(password);
172176 }
173177 #endif
174178
175
176 int
177 virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
178 unsigned int ncred,
179 void *cbdata)
180 {
181 char **username = NULL, **password = NULL;
182 const char *uri = cbdata;
183 int i;
184 int ret = -1;
185
186 DEBUG_LOG("Got libvirt credential request for %d credential(s)", ncred);
187
188 for (i = 0 ; i < ncred ; i++) {
189 switch (cred[i].type) {
190 case VIR_CRED_USERNAME:
191 case VIR_CRED_AUTHNAME:
192 username = &cred[i].result;
193 break;
194 case VIR_CRED_PASSPHRASE:
195 password = &cred[i].result;
196 break;
197 default:
198 DEBUG_LOG("Unsupported libvirt credential %d", cred[i].type);
199 return -1;
200 }
201 }
202
203 if (username || password) {
204 ret = virt_viewer_auth_collect_credentials("libvirt", uri,
205 username, password);
206 if (ret < 0)
207 goto cleanup;
208 } else {
209 ret = 0;
210 }
211
212 for (i = 0 ; i < ncred ; i++) {
213 switch (cred[i].type) {
214 case VIR_CRED_AUTHNAME:
215 case VIR_CRED_USERNAME:
216 case VIR_CRED_PASSPHRASE:
217 if (cred[i].result)
218 cred[i].resultlen = strlen(cred[i].result);
219 else
220 cred[i].resultlen = 0;
221 DEBUG_LOG("Got '%s' %d %d", cred[i].result, cred[i].resultlen, cred[i].type);
222 break;
223 }
224 }
225
226 cleanup:
227 DEBUG_LOG("Return %d", ret);
228 return ret;
229 }
230
231
232
233
234179 /*
235180 * Local variables:
236 * c-indent-level: 8
237 * c-basic-offset: 8
238 * tab-width: 8
181 * c-indent-level: 4
182 * c-basic-offset: 4
183 * indent-tabs-mode: nil
239184 * End:
240185 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
3 * Copyright (C) 2007-2012 Red Hat, Inc.
44 *
55 * This program is free software; you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
2222 #ifndef VIRT_VIEWER_AUTH_H
2323 #define VIRT_VIEWER_AUTH_H
2424
25 #include "config.h"
26
27 #ifdef HAVE_LIBVIRT
2528 #include <libvirt/libvirt.h>
29 #endif
2630
2731 #include "virt-viewer-util.h"
2832
29 void virt_viewer_auth_vnc_credentials(GtkWidget *vnc,
30 GValueArray *credList,
31 char **message);
33 void virt_viewer_auth_vnc_credentials(GtkWindow *window,
34 GtkWidget *vnc,
35 GValueArray *credList,
36 char *vncAddress);
3237
33 int virt_viewer_auth_collect_credentials(const char *type,
34 const char *address,
35 char **username,
36 char **password);
37
38 int virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
39 unsigned int ncred,
40 void *cbdata);
38 int virt_viewer_auth_collect_credentials(GtkWindow *window,
39 const char *type,
40 const char *address,
41 char **username,
42 char **password);
4143
4244 #endif
45 /*
46 * Local variables:
47 * c-indent-level: 4
48 * c-basic-offset: 4
49 * indent-tabs-mode: nil
50 * End:
51 */
0 <?xml version="1.0"?>
0 <?xml version="1.0" encoding="UTF-8"?>
11 <interface>
22 <!-- interface-requires gtk+ 2.12 -->
3 <!-- interface-naming-policy toplevel-contextual -->
43 <object class="GtkDialog" id="auth">
4 <property name="can_focus">False</property>
55 <property name="border_width">5</property>
66 <property name="title" translatable="yes">Authentication required</property>
7 <property name="modal">True</property>
78 <property name="window_position">center-on-parent</property>
9 <property name="destroy_with_parent">True</property>
810 <property name="type_hint">dialog</property>
11 <property name="skip_taskbar_hint">True</property>
12 <property name="skip_pager_hint">True</property>
913 <child internal-child="vbox">
10 <object class="GtkVBox" id="dialog-vbox1">
14 <object class="GtkBox" id="dialog-vbox1">
1115 <property name="visible">True</property>
16 <property name="can_focus">False</property>
17 <property name="orientation">vertical</property>
1218 <property name="spacing">2</property>
19 <child internal-child="action_area">
20 <object class="GtkButtonBox" id="dialog-action_area1">
21 <property name="visible">True</property>
22 <property name="can_focus">False</property>
23 <property name="layout_style">end</property>
24 <child>
25 <object class="GtkButton" id="button-cancel">
26 <property name="label">gtk-cancel</property>
27 <property name="visible">True</property>
28 <property name="can_focus">True</property>
29 <property name="receives_default">True</property>
30 <property name="use_action_appearance">False</property>
31 <property name="use_stock">True</property>
32 </object>
33 <packing>
34 <property name="expand">False</property>
35 <property name="fill">False</property>
36 <property name="position">0</property>
37 </packing>
38 </child>
39 <child>
40 <object class="GtkButton" id="button-ok">
41 <property name="label">gtk-ok</property>
42 <property name="visible">True</property>
43 <property name="can_focus">True</property>
44 <property name="can_default">True</property>
45 <property name="has_default">True</property>
46 <property name="receives_default">True</property>
47 <property name="use_action_appearance">False</property>
48 <property name="use_stock">True</property>
49 </object>
50 <packing>
51 <property name="expand">False</property>
52 <property name="fill">False</property>
53 <property name="position">3</property>
54 </packing>
55 </child>
56 </object>
57 <packing>
58 <property name="expand">False</property>
59 <property name="fill">True</property>
60 <property name="pack_type">end</property>
61 <property name="position">0</property>
62 </packing>
63 </child>
1364 <child>
1465 <object class="GtkLabel" id="message">
1566 <property name="visible">True</property>
67 <property name="can_focus">False</property>
1668 <property name="xalign">0</property>
1769 <property name="yalign">0</property>
1870 <property name="label" translatable="yes">label</property>
1971 <property name="use_markup">True</property>
2072 </object>
2173 <packing>
74 <property name="expand">False</property>
75 <property name="fill">True</property>
2276 <property name="position">1</property>
2377 </packing>
2478 </child>
2579 <child>
2680 <object class="GtkTable" id="table1">
2781 <property name="visible">True</property>
82 <property name="can_focus">False</property>
2883 <property name="n_rows">2</property>
2984 <property name="n_columns">2</property>
3085 <property name="column_spacing">6</property>
3287 <child>
3388 <object class="GtkLabel" id="prompt-password">
3489 <property name="visible">True</property>
90 <property name="can_focus">False</property>
3591 <property name="xalign">1</property>
3692 <property name="label" translatable="yes">Password:</property>
3793 </object>
4399 <child>
44100 <object class="GtkLabel" id="prompt-username">
45101 <property name="visible">True</property>
102 <property name="can_focus">False</property>
46103 <property name="xalign">1</property>
47104 <property name="label" translatable="yes">Username:</property>
48105 </object>
62119 <property name="visible">True</property>
63120 <property name="can_focus">True</property>
64121 <property name="visibility">False</property>
122 <property name="activates_default">True</property>
65123 </object>
66124 <packing>
67125 <property name="left_attach">1</property>
72130 </child>
73131 </object>
74132 <packing>
133 <property name="expand">False</property>
134 <property name="fill">True</property>
75135 <property name="position">2</property>
76 </packing>
77 </child>
78 <child internal-child="action_area">
79 <object class="GtkHButtonBox" id="dialog-action_area1">
80 <property name="visible">True</property>
81 <property name="layout_style">end</property>
82 <child>
83 <object class="GtkButton" id="button-cancel">
84 <property name="label">gtk-cancel</property>
85 <property name="visible">True</property>
86 <property name="can_focus">True</property>
87 <property name="receives_default">True</property>
88 <property name="use_stock">True</property>
89 </object>
90 <packing>
91 <property name="expand">False</property>
92 <property name="fill">False</property>
93 <property name="position">0</property>
94 </packing>
95 </child>
96 <child>
97 <object class="GtkButton" id="button-ok">
98 <property name="label">gtk-ok</property>
99 <property name="visible">True</property>
100 <property name="can_focus">True</property>
101 <property name="can_default">True</property>
102 <property name="has_default">True</property>
103 <property name="receives_default">True</property>
104 <property name="use_stock">True</property>
105 </object>
106 <packing>
107 <property name="expand">False</property>
108 <property name="fill">False</property>
109 <property name="position">3</property>
110 </packing>
111 </child>
112 </object>
113 <packing>
114 <property name="expand">False</property>
115 <property name="pack_type">end</property>
116 <property name="position">0</property>
117136 </packing>
118137 </child>
119138 </object>
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2009 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2121 * Author: Daniel P. Berrange <berrange@redhat.com>
2222 */
2323
24 #include <config.h>
25
2426 #include <spice-audio.h>
2527
2628 #include <glib/gi18n.h>
3234 G_DEFINE_TYPE (VirtViewerDisplaySpice, virt_viewer_display_spice, VIRT_VIEWER_TYPE_DISPLAY)
3335
3436 struct _VirtViewerDisplaySpicePrivate {
35 SpiceChannel *channel;
36 SpiceDisplay *display;
37 SpiceChannel *channel;
38 SpiceDisplay *display;
3739 };
3840
3941 #define VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpicePrivate))
4042
4143 static void virt_viewer_display_spice_send_keys(VirtViewerDisplay *display,
42 const guint *keyvals,
43 int nkeyvals);
44 const guint *keyvals,
45 int nkeyvals);
4446 static GdkPixbuf *virt_viewer_display_spice_get_pixbuf(VirtViewerDisplay *display);
4547
4648 static void
4749 virt_viewer_display_spice_finalize(GObject *obj)
4850 {
49 VirtViewerDisplaySpice *spice = VIRT_VIEWER_DISPLAY_SPICE(obj);
50
51 g_object_unref(spice->priv->display);
52 g_object_unref(spice->priv->channel);
53
54 G_OBJECT_CLASS(virt_viewer_display_spice_parent_class)->finalize(obj);
51 VirtViewerDisplaySpice *spice = VIRT_VIEWER_DISPLAY_SPICE(obj);
52
53 g_object_unref(spice->priv->display);
54 g_object_unref(spice->priv->channel);
55
56 G_OBJECT_CLASS(virt_viewer_display_spice_parent_class)->finalize(obj);
5557 }
5658
5759 static void
5860 virt_viewer_display_spice_class_init(VirtViewerDisplaySpiceClass *klass)
5961 {
60 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
61 GObjectClass *oclass = G_OBJECT_CLASS(klass);
62
63 oclass->finalize = virt_viewer_display_spice_finalize;
64
65 dclass->send_keys = virt_viewer_display_spice_send_keys;
66 dclass->get_pixbuf = virt_viewer_display_spice_get_pixbuf;
67
68 g_type_class_add_private(oclass, sizeof(VirtViewerDisplaySpicePrivate));
62 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
63 GObjectClass *oclass = G_OBJECT_CLASS(klass);
64
65 oclass->finalize = virt_viewer_display_spice_finalize;
66
67 dclass->send_keys = virt_viewer_display_spice_send_keys;
68 dclass->get_pixbuf = virt_viewer_display_spice_get_pixbuf;
69
70 g_type_class_add_private(klass, sizeof(VirtViewerDisplaySpicePrivate));
6971 }
7072
7173 static void
7274 virt_viewer_display_spice_init(VirtViewerDisplaySpice *self G_GNUC_UNUSED)
7375 {
74 self->priv = VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(self);
76 self->priv = VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(self);
7577 }
7678
7779 static void
7880 virt_viewer_display_spice_send_keys(VirtViewerDisplay *display,
79 const guint *keyvals,
80 int nkeyvals)
81 {
82 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
83
84 g_return_if_fail(self != NULL);
85 g_return_if_fail(self->priv->display != NULL);
86
87 spice_display_send_keys(self->priv->display, keyvals, nkeyvals, SPICE_DISPLAY_KEY_EVENT_CLICK);
81 const guint *keyvals,
82 int nkeyvals)
83 {
84 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
85
86 g_return_if_fail(self != NULL);
87 g_return_if_fail(self->priv->display != NULL);
88
89 spice_display_send_keys(self->priv->display, keyvals, nkeyvals, SPICE_DISPLAY_KEY_EVENT_CLICK);
8890 }
8991
9092 static GdkPixbuf *
9193 virt_viewer_display_spice_get_pixbuf(VirtViewerDisplay *display)
9294 {
93 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
94
95 g_return_val_if_fail(self != NULL, NULL);
96 g_return_val_if_fail(self->priv->display != NULL, NULL);
97
98 return spice_display_get_pixbuf(self->priv->display);
95 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
96
97 g_return_val_if_fail(self != NULL, NULL);
98 g_return_val_if_fail(self->priv->display != NULL, NULL);
99
100 return spice_display_get_pixbuf(self->priv->display);
99101 }
100102
101103 static void
102104 display_mark(SpiceChannel *channel G_GNUC_UNUSED,
103 gint mark,
104 VirtViewerDisplay *display)
105 {
106 DEBUG_LOG("display mark %d", mark);
107
108 virt_viewer_display_set_show_hint(display, mark);
105 gint mark,
106 VirtViewerDisplay *display)
107 {
108 DEBUG_LOG("display mark %d", mark);
109
110 virt_viewer_display_set_show_hint(display, mark);
109111 }
110112
111113 static void
112114 primary_create(SpiceChannel *channel G_GNUC_UNUSED,
113 gint format G_GNUC_UNUSED,
114 gint width,
115 gint height,
116 gint stride G_GNUC_UNUSED,
117 gint shmid G_GNUC_UNUSED,
118 gpointer imgdata G_GNUC_UNUSED,
119 VirtViewerDisplay *display)
120 {
121 DEBUG_LOG("spice desktop resize %dx%d", width, height);
122
123 virt_viewer_display_set_desktop_size(display, width, height);
115 gint format G_GNUC_UNUSED,
116 gint width,
117 gint height,
118 gint stride G_GNUC_UNUSED,
119 gint shmid G_GNUC_UNUSED,
120 gpointer imgdata G_GNUC_UNUSED,
121 VirtViewerDisplay *display)
122 {
123 DEBUG_LOG("spice desktop resize %dx%d", width, height);
124
125 virt_viewer_display_set_desktop_size(display, width, height);
124126 }
125127
126128
127129 static void
128130 virt_viewer_display_spice_keyboard_grab(SpiceDisplay *display G_GNUC_UNUSED,
129 int grabbed,
130 VirtViewerDisplaySpice *self)
131 {
132 if (grabbed)
133 g_signal_emit_by_name(self, "display-keyboard-grab");
134 else
135 g_signal_emit_by_name(self, "display-keyboard-ungrab");
131 int grabbed,
132 VirtViewerDisplaySpice *self)
133 {
134 if (grabbed)
135 g_signal_emit_by_name(self, "display-keyboard-grab");
136 else
137 g_signal_emit_by_name(self, "display-keyboard-ungrab");
136138 }
137139
138140
139141 static void
140142 virt_viewer_display_spice_mouse_grab(SpiceDisplay *display G_GNUC_UNUSED,
141 int grabbed,
142 VirtViewerDisplaySpice *self)
143 {
144 if (grabbed)
145 g_signal_emit_by_name(self, "display-pointer-grab");
146 else
147 g_signal_emit_by_name(self, "display-pointer-ungrab");
143 int grabbed,
144 VirtViewerDisplaySpice *self)
145 {
146 if (grabbed)
147 g_signal_emit_by_name(self, "display-pointer-grab");
148 else
149 g_signal_emit_by_name(self, "display-pointer-ungrab");
150 }
151
152
153 static void
154 virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
155 GtkAllocation *allocation,
156 gpointer data G_GNUC_UNUSED)
157 {
158 gdouble dw = allocation->width, dh = allocation->height;
159 guint zoom = 100;
160 guint channelid;
161
162 if (virt_viewer_display_get_auto_resize(VIRT_VIEWER_DISPLAY(self)) == FALSE)
163 return;
164
165 if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) {
166 zoom = virt_viewer_display_get_zoom_level(VIRT_VIEWER_DISPLAY(self));
167
168 dw /= ((double)zoom / 100.0);
169 dh /= ((double)zoom / 100.0);
170 }
171
172 g_object_get(self->priv->channel, "channel-id", &channelid, NULL);
173
174 SpiceMainChannel *main_channel = virt_viewer_session_spice_get_main_channel(
175 VIRT_VIEWER_SESSION_SPICE(virt_viewer_display_get_session(VIRT_VIEWER_DISPLAY(self))));
176 spice_main_set_display(main_channel,
177 channelid,
178 0, 0, dw, dh);
148179 }
149180
150181
151182 GtkWidget *
152 virt_viewer_display_spice_new(SpiceChannel *channel,
153 SpiceDisplay *display)
154 {
155 VirtViewerDisplaySpice *self;
156 gint channelid;
157
158 g_return_val_if_fail(SPICE_IS_DISPLAY_CHANNEL(channel), NULL);
159 g_return_val_if_fail(SPICE_IS_DISPLAY(display), NULL);
160
161 g_object_get(channel, "channel-id", &channelid, NULL);
162
163 self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_SPICE,
164 "nth-display", channelid,
165 NULL);
166 self->priv->channel = g_object_ref(channel);
167 self->priv->display = g_object_ref(display);
168
169 g_signal_connect(channel, "display-primary-create",
170 G_CALLBACK(primary_create), self);
171 g_signal_connect(channel, "display-mark",
172 G_CALLBACK(display_mark), self);
173
174 gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(self->priv->display));
175 gtk_widget_show(GTK_WIDGET(self->priv->display));
176 g_object_set(self->priv->display,
177 "grab-keyboard", TRUE,
178 "grab-mouse", TRUE,
179 "resize-guest", FALSE,
180 "scaling", TRUE,
181 "auto-clipboard", TRUE,
182 NULL);
183
184 g_signal_connect(self->priv->display,
185 "keyboard-grab",
186 G_CALLBACK(virt_viewer_display_spice_keyboard_grab), self);
187 g_signal_connect(self->priv->display,
188 "mouse-grab",
189 G_CALLBACK(virt_viewer_display_spice_mouse_grab), self);
190
191 return GTK_WIDGET(self);
183 virt_viewer_display_spice_new(VirtViewerSessionSpice *session,
184 SpiceChannel *channel,
185 SpiceDisplay *display)
186 {
187 VirtViewerDisplaySpice *self;
188 gint channelid;
189
190 g_return_val_if_fail(SPICE_IS_DISPLAY_CHANNEL(channel), NULL);
191 g_return_val_if_fail(SPICE_IS_DISPLAY(display), NULL);
192
193 g_object_get(channel, "channel-id", &channelid, NULL);
194
195 self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_SPICE,
196 "session", session,
197 "nth-display", channelid,
198 NULL);
199 self->priv->channel = g_object_ref(channel);
200 self->priv->display = g_object_ref(display);
201
202 g_signal_connect(channel, "display-primary-create",
203 G_CALLBACK(primary_create), self);
204 g_signal_connect(channel, "display-mark",
205 G_CALLBACK(display_mark), self);
206
207 gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(self->priv->display));
208 gtk_widget_show(GTK_WIDGET(self->priv->display));
209 g_object_set(self->priv->display,
210 "grab-keyboard", TRUE,
211 "grab-mouse", TRUE,
212 "resize-guest", FALSE,
213 "scaling", TRUE,
214 NULL);
215
216 g_signal_connect(self->priv->display,
217 "keyboard-grab",
218 G_CALLBACK(virt_viewer_display_spice_keyboard_grab), self);
219 g_signal_connect(self->priv->display,
220 "mouse-grab",
221 G_CALLBACK(virt_viewer_display_spice_mouse_grab), self);
222 g_signal_connect(self,
223 "size-allocate",
224 G_CALLBACK(virt_viewer_display_spice_size_allocate), self);
225
226
227 return GTK_WIDGET(self);
192228 }
193229
194230 /*
195231 * Local variables:
196 * c-indent-level: 8
197 * c-basic-offset: 8
198 * tab-width: 8
199 * indent-tabs-mode: t
232 * c-indent-level: 4
233 * c-basic-offset: 4
234 * indent-tabs-mode: nil
200235 * End:
201236 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2828 #include <spice-audio.h>
2929
3030 #include "virt-viewer-display.h"
31 #include "virt-viewer-session-spice.h"
3132
3233 G_BEGIN_DECLS
3334
3435 #define VIRT_VIEWER_TYPE_DISPLAY_SPICE virt_viewer_display_spice_get_type()
3536
36 #define VIRT_VIEWER_DISPLAY_SPICE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpice))
37 #define VIRT_VIEWER_DISPLAY_SPICE(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpice))
3839
39 #define VIRT_VIEWER_DISPLAY_SPICE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
40 #define VIRT_VIEWER_DISPLAY_SPICE_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
4142
42 #define VIRT_VIEWER_IS_DISPLAY_SPICE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
43 #define VIRT_VIEWER_IS_DISPLAY_SPICE(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
4445
45 #define VIRT_VIEWER_IS_DISPLAY_SPICE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
46 #define VIRT_VIEWER_IS_DISPLAY_SPICE_CLASS(klass) \
47 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
4748
48 #define VIRT_VIEWER_DISPLAY_SPICE_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
49 #define VIRT_VIEWER_DISPLAY_SPICE_GET_CLASS(obj) \
50 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
5051
5152 typedef struct _VirtViewerDisplaySpice VirtViewerDisplaySpice;
5253 typedef struct _VirtViewerDisplaySpiceClass VirtViewerDisplaySpiceClass;
5354 typedef struct _VirtViewerDisplaySpicePrivate VirtViewerDisplaySpicePrivate;
5455
5556 struct _VirtViewerDisplaySpice {
56 VirtViewerDisplay parent;
57 VirtViewerDisplay parent;
5758
58 VirtViewerDisplaySpicePrivate *priv;
59 VirtViewerDisplaySpicePrivate *priv;
5960 };
6061
6162 struct _VirtViewerDisplaySpiceClass {
62 VirtViewerDisplayClass parent_class;
63 VirtViewerDisplayClass parent_class;
6364 };
6465
6566 GType virt_viewer_display_spice_get_type(void);
6667
67 GtkWidget* virt_viewer_display_spice_new(SpiceChannel *channel,
68 SpiceDisplay *display);
68 GtkWidget* virt_viewer_display_spice_new(VirtViewerSessionSpice *session,
69 SpiceChannel *channel,
70 SpiceDisplay *display);
6971
7072 G_END_DECLS
7173
7274 #endif /* _VIRT_VIEWER_DISPLAY_SPICE_H */
73
7475 /*
7576 * Local variables:
76 * c-indent-level: 8
77 * c-basic-offset: 8
78 * tab-width: 8
77 * c-indent-level: 4
78 * c-basic-offset: 4
79 * indent-tabs-mode: nil
7980 * End:
8081 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2121 * Author: Daniel P. Berrange <berrange@redhat.com>
2222 */
2323
24 #include <config.h>
25
2426 #include "virt-viewer-auth.h"
2527 #include "virt-viewer-display-vnc.h"
2628
2931 G_DEFINE_TYPE(VirtViewerDisplayVnc, virt_viewer_display_vnc, VIRT_VIEWER_TYPE_DISPLAY)
3032
3133 struct _VirtViewerDisplayVncPrivate {
32 VncDisplay *vnc;
34 VncDisplay *vnc;
3335 };
3436
3537 #define VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncPrivate))
4042 static void
4143 virt_viewer_display_vnc_finalize(GObject *obj)
4244 {
43 VirtViewerDisplayVnc *vnc = VIRT_VIEWER_DISPLAY_VNC(obj);
45 VirtViewerDisplayVnc *vnc = VIRT_VIEWER_DISPLAY_VNC(obj);
4446
45 g_object_unref(vnc->priv->vnc);
47 g_object_unref(vnc->priv->vnc);
4648
47 G_OBJECT_CLASS(virt_viewer_display_vnc_parent_class)->finalize(obj);
49 G_OBJECT_CLASS(virt_viewer_display_vnc_parent_class)->finalize(obj);
4850 }
4951
5052
5153 static void
5254 virt_viewer_display_vnc_class_init(VirtViewerDisplayVncClass *klass)
5355 {
54 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
55 GObjectClass *oclass = G_OBJECT_CLASS(klass);
56 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
57 GObjectClass *oclass = G_OBJECT_CLASS(klass);
5658
57 oclass->finalize = virt_viewer_display_vnc_finalize;
59 oclass->finalize = virt_viewer_display_vnc_finalize;
5860
59 dclass->send_keys = virt_viewer_display_vnc_send_keys;
60 dclass->get_pixbuf = virt_viewer_display_vnc_get_pixbuf;
61 dclass->send_keys = virt_viewer_display_vnc_send_keys;
62 dclass->get_pixbuf = virt_viewer_display_vnc_get_pixbuf;
6163
62 g_type_class_add_private(oclass, sizeof(VirtViewerDisplayVncPrivate));
64 g_type_class_add_private(klass, sizeof(VirtViewerDisplayVncPrivate));
6365 }
6466
6567 static void
6668 virt_viewer_display_vnc_init(VirtViewerDisplayVnc *self G_GNUC_UNUSED)
6769 {
68 self->priv = VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(self);
70 self->priv = VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(self);
6971 }
7072
7173
7274 static void
7375 virt_viewer_display_vnc_mouse_grab(VncDisplay *vnc G_GNUC_UNUSED,
74 VirtViewerDisplay *display)
76 VirtViewerDisplay *display)
7577 {
76 g_signal_emit_by_name(display, "display-pointer-grab");
78 g_signal_emit_by_name(display, "display-pointer-grab");
7779 }
7880
7981
8082 static void
8183 virt_viewer_display_vnc_mouse_ungrab(VncDisplay *vnc G_GNUC_UNUSED,
82 VirtViewerDisplay *display)
84 VirtViewerDisplay *display)
8385 {
84 g_signal_emit_by_name(display, "display-pointer-ungrab");
86 g_signal_emit_by_name(display, "display-pointer-ungrab");
8587 }
8688
8789 static void
8890 virt_viewer_display_vnc_key_grab(VncDisplay *vnc G_GNUC_UNUSED,
89 VirtViewerDisplay *display)
91 VirtViewerDisplay *display)
9092 {
91 g_signal_emit_by_name(display, "display-keyboard-grab");
93 g_signal_emit_by_name(display, "display-keyboard-grab");
9294 }
9395
9496 static void
9597 virt_viewer_display_vnc_key_ungrab(VncDisplay *vnc G_GNUC_UNUSED,
96 VirtViewerDisplay *display)
98 VirtViewerDisplay *display)
9799 {
98 g_signal_emit_by_name(display, "display-keyboard-ungrab");
100 g_signal_emit_by_name(display, "display-keyboard-ungrab");
99101 }
100102
101103 static void
102104 virt_viewer_display_vnc_send_keys(VirtViewerDisplay* display,
103 const guint *keyvals,
104 int nkeyvals)
105 const guint *keyvals,
106 int nkeyvals)
105107 {
106 VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display);
108 VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display);
107109
108 g_return_if_fail(self != NULL);
109 g_return_if_fail(keyvals != NULL);
110 g_return_if_fail(self->priv->vnc != NULL);
110 g_return_if_fail(self != NULL);
111 g_return_if_fail(keyvals != NULL);
112 g_return_if_fail(self->priv->vnc != NULL);
111113
112 vnc_display_send_keys(self->priv->vnc, keyvals, nkeyvals);
114 vnc_display_send_keys(self->priv->vnc, keyvals, nkeyvals);
113115 }
114116
115117
116118 static GdkPixbuf *
117119 virt_viewer_display_vnc_get_pixbuf(VirtViewerDisplay* display)
118120 {
119 VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display);
121 VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display);
120122
121 g_return_val_if_fail(self != NULL, NULL);
122 g_return_val_if_fail(self->priv->vnc != NULL, NULL);
123 g_return_val_if_fail(self != NULL, NULL);
124 g_return_val_if_fail(self->priv->vnc != NULL, NULL);
123125
124 return vnc_display_get_pixbuf(self->priv->vnc);
126 return vnc_display_get_pixbuf(self->priv->vnc);
125127 }
126128
127129
133135 */
134136 static void
135137 virt_viewer_display_vnc_resize_desktop(VncDisplay *vnc G_GNUC_UNUSED,
136 int width, int height,
137 VirtViewerDisplay *display)
138 int width, int height,
139 VirtViewerDisplay *display)
138140 {
139 DEBUG_LOG("desktop resize %dx%d", width, height);
141 DEBUG_LOG("desktop resize %dx%d", width, height);
140142
141 virt_viewer_display_set_desktop_size(display, width, height);
143 virt_viewer_display_set_desktop_size(display, width, height);
142144 }
143145
144146
145147 GtkWidget *
146148 virt_viewer_display_vnc_new(VncDisplay *vnc)
147149 {
148 VirtViewerDisplayVnc *display;
150 VirtViewerDisplayVnc *display;
149151
150 display = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_VNC, NULL);
152 display = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_VNC, NULL);
151153
152 g_object_ref(vnc);
153 g_object_ref(vnc); /* Because gtk_container_add steals the first ref */
154 display->priv->vnc = vnc;
154 g_object_ref(vnc);
155 g_object_ref(vnc); /* Because gtk_container_add steals the first ref */
156 display->priv->vnc = vnc;
155157
156 gtk_container_add(GTK_CONTAINER(display), GTK_WIDGET(display->priv->vnc));
157 vnc_display_set_keyboard_grab(display->priv->vnc, TRUE);
158 vnc_display_set_pointer_grab(display->priv->vnc, TRUE);
158 gtk_container_add(GTK_CONTAINER(display), GTK_WIDGET(display->priv->vnc));
159 vnc_display_set_keyboard_grab(display->priv->vnc, TRUE);
160 vnc_display_set_pointer_grab(display->priv->vnc, TRUE);
159161
160 /*
161 * In auto-resize mode we have things setup so that we always
162 * automatically resize the top level window to be exactly the
163 * same size as the VNC desktop, except when it won't fit on
164 * the local screen, at which point we let it scale down.
165 * The upshot is, we always want scaling enabled.
166 * We disable force_size because we want to allow user to
167 * manually size the widget smaller too
168 */
169 vnc_display_set_force_size(display->priv->vnc, FALSE);
170 vnc_display_set_scaling(display->priv->vnc, TRUE);
162 /*
163 * In auto-resize mode we have things setup so that we always
164 * automatically resize the top level window to be exactly the
165 * same size as the VNC desktop, except when it won't fit on
166 * the local screen, at which point we let it scale down.
167 * The upshot is, we always want scaling enabled.
168 * We disable force_size because we want to allow user to
169 * manually size the widget smaller too
170 */
171 vnc_display_set_force_size(display->priv->vnc, FALSE);
172 vnc_display_set_scaling(display->priv->vnc, TRUE);
171173
172 /* When VNC desktop resizes, we have to resize the containing widget */
173 g_signal_connect(display->priv->vnc, "vnc-desktop-resize",
174 G_CALLBACK(virt_viewer_display_vnc_resize_desktop), display);
174 /* When VNC desktop resizes, we have to resize the containing widget */
175 g_signal_connect(display->priv->vnc, "vnc-desktop-resize",
176 G_CALLBACK(virt_viewer_display_vnc_resize_desktop), display);
175177
176 g_signal_connect(display->priv->vnc, "vnc-pointer-grab",
177 G_CALLBACK(virt_viewer_display_vnc_mouse_grab), display);
178 g_signal_connect(display->priv->vnc, "vnc-pointer-ungrab",
179 G_CALLBACK(virt_viewer_display_vnc_mouse_ungrab), display);
180 g_signal_connect(display->priv->vnc, "vnc-keyboard-grab",
181 G_CALLBACK(virt_viewer_display_vnc_key_grab), display);
182 g_signal_connect(display->priv->vnc, "vnc-keyboard-ungrab",
183 G_CALLBACK(virt_viewer_display_vnc_key_ungrab), display);
178 g_signal_connect(display->priv->vnc, "vnc-pointer-grab",
179 G_CALLBACK(virt_viewer_display_vnc_mouse_grab), display);
180 g_signal_connect(display->priv->vnc, "vnc-pointer-ungrab",
181 G_CALLBACK(virt_viewer_display_vnc_mouse_ungrab), display);
182 g_signal_connect(display->priv->vnc, "vnc-keyboard-grab",
183 G_CALLBACK(virt_viewer_display_vnc_key_grab), display);
184 g_signal_connect(display->priv->vnc, "vnc-keyboard-ungrab",
185 G_CALLBACK(virt_viewer_display_vnc_key_ungrab), display);
184186
185 return GTK_WIDGET(display);
187 return GTK_WIDGET(display);
186188 }
187
188
189
190189
191190 /*
192191 * Local variables:
193 * c-indent-level: 8
194 * c-basic-offset: 8
195 * tab-width: 8
192 * c-indent-level: 4
193 * c-basic-offset: 4
194 * indent-tabs-mode: nil
196195 * End:
197196 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3232
3333 #define VIRT_VIEWER_TYPE_DISPLAY_VNC virt_viewer_display_vnc_get_type()
3434
35 #define VIRT_VIEWER_DISPLAY_VNC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVnc))
35 #define VIRT_VIEWER_DISPLAY_VNC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVnc))
3737
38 #define VIRT_VIEWER_DISPLAY_VNC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass))
38 #define VIRT_VIEWER_DISPLAY_VNC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass))
4040
41 #define VIRT_VIEWER_IS_DISPLAY_VNC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC))
41 #define VIRT_VIEWER_IS_DISPLAY_VNC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC))
4343
44 #define VIRT_VIEWER_IS_DISPLAY_VNC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC))
44 #define VIRT_VIEWER_IS_DISPLAY_VNC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC))
4646
47 #define VIRT_VIEWER_DISPLAY_VNC_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass))
47 #define VIRT_VIEWER_DISPLAY_VNC_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass))
4949
5050 typedef struct _VirtViewerDisplayVnc VirtViewerDisplayVnc;
5151 typedef struct _VirtViewerDisplayVncClass VirtViewerDisplayVncClass;
5252 typedef struct _VirtViewerDisplayVncPrivate VirtViewerDisplayVncPrivate;
5353
5454 struct _VirtViewerDisplayVnc {
55 VirtViewerDisplay parent;
55 VirtViewerDisplay parent;
5656
57 VirtViewerDisplayVncPrivate *priv;
57 VirtViewerDisplayVncPrivate *priv;
5858 };
5959
6060 struct _VirtViewerDisplayVncClass {
61 VirtViewerDisplayClass parent_class;
61 VirtViewerDisplayClass parent_class;
6262 };
6363
6464 GType virt_viewer_display_vnc_get_type(void);
6868 G_END_DECLS
6969
7070 #endif /* _VIRT_VIEWER_DISPLAY_VNC_H */
71
7271 /*
7372 * Local variables:
74 * c-indent-level: 8
75 * c-basic-offset: 8
76 * tab-width: 8
73 * c-indent-level: 4
74 * c-basic-offset: 4
75 * indent-tabs-mode: nil
7776 * End:
7877 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2525
2626 #include <locale.h>
2727
28 #include "virt-viewer-session.h"
2829 #include "virt-viewer-display.h"
2930 #include "virt-viewer-util.h"
3031
3233
3334 struct _VirtViewerDisplayPrivate
3435 {
35 gboolean dirty;
36 guint desktopWidth;
37 guint desktopHeight;
38 guint zoom_level;
39 gboolean zoom;
40 gint nth_display;
41 gint show_hint;
36 gboolean dirty;
37 guint desktopWidth;
38 guint desktopHeight;
39 guint zoom_level;
40 gboolean zoom;
41 gint nth_display;
42 gint show_hint;
43 VirtViewerSession *session;
44 gboolean auto_resize;
4245 };
4346
4447 static void virt_viewer_display_size_request(GtkWidget *widget,
45 GtkRequisition *requisition);
48 GtkRequisition *requisition);
4649 #if GTK_CHECK_VERSION(3, 0, 0)
4750 static void virt_viewer_display_get_preferred_width(GtkWidget *widget,
48 int *minwidth,
49 int *defwidth);
51 int *minwidth,
52 int *defwidth);
5053 static void virt_viewer_display_get_preferred_height(GtkWidget *widget,
51 int *minheight,
52 int *defheight);
54 int *minheight,
55 int *defheight);
5356 #endif
5457 static void virt_viewer_display_size_allocate(GtkWidget *widget,
55 GtkAllocation *allocation);
58 GtkAllocation *allocation);
5659 static void virt_viewer_display_set_property(GObject *object,
57 guint prop_id,
58 const GValue *value,
59 GParamSpec *pspec);
60 guint prop_id,
61 const GValue *value,
62 GParamSpec *pspec);
6063 static void virt_viewer_display_get_property(GObject *object,
61 guint prop_id,
62 GValue *value,
63 GParamSpec *pspec);
64 guint prop_id,
65 GValue *value,
66 GParamSpec *pspec);
67 static void virt_viewer_display_grab_focus(GtkWidget *widget);
6468
6569 G_DEFINE_ABSTRACT_TYPE(VirtViewerDisplay, virt_viewer_display, GTK_TYPE_BIN)
6670
6771 enum {
68 PROP_0,
69
70 PROP_DESKTOP_WIDTH,
71 PROP_DESKTOP_HEIGHT,
72 PROP_NTH_DISPLAY,
73 PROP_ZOOM,
74 PROP_ZOOM_LEVEL,
75 PROP_SHOW_HINT,
72 PROP_0,
73
74 PROP_DESKTOP_WIDTH,
75 PROP_DESKTOP_HEIGHT,
76 PROP_NTH_DISPLAY,
77 PROP_ZOOM,
78 PROP_ZOOM_LEVEL,
79 PROP_SHOW_HINT,
80 PROP_SESSION,
7681 };
7782
7883 static void
7984 virt_viewer_display_class_init(VirtViewerDisplayClass *class)
8085 {
81 GObjectClass *object_class = G_OBJECT_CLASS(class);
82 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class);
83
84 object_class->set_property = virt_viewer_display_set_property;
85 object_class->get_property = virt_viewer_display_get_property;
86 GObjectClass *object_class = G_OBJECT_CLASS(class);
87 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class);
88
89 object_class->set_property = virt_viewer_display_set_property;
90 object_class->get_property = virt_viewer_display_get_property;
8691
8792 #if GTK_CHECK_VERSION(3, 0, 0)
88 widget_class->get_preferred_width = virt_viewer_display_get_preferred_width;
89 widget_class->get_preferred_height = virt_viewer_display_get_preferred_height;
93 widget_class->get_preferred_width = virt_viewer_display_get_preferred_width;
94 widget_class->get_preferred_height = virt_viewer_display_get_preferred_height;
9095 #else
91 widget_class->size_request = virt_viewer_display_size_request;
96 widget_class->size_request = virt_viewer_display_size_request;
9297 #endif
93 widget_class->size_allocate = virt_viewer_display_size_allocate;
94
95 g_object_class_install_property(object_class,
96 PROP_DESKTOP_WIDTH,
97 g_param_spec_int("desktop-width",
98 "Width",
99 "Desktop width",
100 100,
101 G_MAXINT32,
102 100,
103 G_PARAM_READWRITE));
104
105 g_object_class_install_property(object_class,
106 PROP_DESKTOP_HEIGHT,
107 g_param_spec_int("desktop-height",
108 "Height",
109 "Desktop height",
110 100,
111 G_MAXINT32,
112 100,
113 G_PARAM_READWRITE));
114
115 g_object_class_install_property(object_class,
116 PROP_ZOOM,
117 g_param_spec_boolean("zoom",
118 "Zoom",
119 "Zoom",
120 TRUE,
121 G_PARAM_READWRITE));
122
123 g_object_class_install_property(object_class,
124 PROP_ZOOM_LEVEL,
125 g_param_spec_int("zoom-level",
126 "Zoom",
127 "Zoom level",
128 10,
129 400,
130 100,
131 G_PARAM_READWRITE));
132
133 g_object_class_install_property(object_class,
134 PROP_NTH_DISPLAY,
135 g_param_spec_int("nth-display",
136 "Nth display",
137 "Nth display",
138 0,
139 G_MAXINT32,
140 0,
141 G_PARAM_READWRITE |
142 G_PARAM_CONSTRUCT_ONLY));
143
144 g_object_class_install_property(object_class,
145 PROP_SHOW_HINT,
146 g_param_spec_int("show-hint",
147 "Show hint",
148 "Show state hint",
149 0,
150 G_MAXINT32,
151 0,
152 G_PARAM_READABLE));
153
154
155 g_signal_new("display-pointer-grab",
156 G_OBJECT_CLASS_TYPE(object_class),
157 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
158 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_grab),
159 NULL,
160 NULL,
161 g_cclosure_marshal_VOID__VOID,
162 G_TYPE_NONE,
163 0);
164
165 g_signal_new("display-pointer-ungrab",
166 G_OBJECT_CLASS_TYPE(object_class),
167 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
168 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_ungrab),
169 NULL,
170 NULL,
171 g_cclosure_marshal_VOID__VOID,
172 G_TYPE_NONE,
173 0);
174
175 g_signal_new("display-keyboard-grab",
176 G_OBJECT_CLASS_TYPE(object_class),
177 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
178 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_grab),
179 NULL,
180 NULL,
181 g_cclosure_marshal_VOID__VOID,
182 G_TYPE_NONE,
183 0);
184
185 g_signal_new("display-keyboard-ungrab",
186 G_OBJECT_CLASS_TYPE(object_class),
187 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
188 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_ungrab),
189 NULL,
190 NULL,
191 g_cclosure_marshal_VOID__VOID,
192 G_TYPE_NONE,
193 0);
194
195 g_signal_new("display-desktop-resize",
196 G_OBJECT_CLASS_TYPE(object_class),
197 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
198 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_desktop_resize),
199 NULL,
200 NULL,
201 g_cclosure_marshal_VOID__VOID,
202 G_TYPE_NONE,
203 0);
204
205 g_type_class_add_private(object_class, sizeof(VirtViewerDisplayPrivate));
98 widget_class->size_allocate = virt_viewer_display_size_allocate;
99 widget_class->grab_focus = virt_viewer_display_grab_focus;
100
101 g_object_class_install_property(object_class,
102 PROP_DESKTOP_WIDTH,
103 g_param_spec_int("desktop-width",
104 "Width",
105 "Desktop width",
106 100,
107 G_MAXINT32,
108 100,
109 G_PARAM_READWRITE));
110
111 g_object_class_install_property(object_class,
112 PROP_DESKTOP_HEIGHT,
113 g_param_spec_int("desktop-height",
114 "Height",
115 "Desktop height",
116 100,
117 G_MAXINT32,
118 100,
119 G_PARAM_READWRITE));
120
121 g_object_class_install_property(object_class,
122 PROP_ZOOM,
123 g_param_spec_boolean("zoom",
124 "Zoom",
125 "Zoom",
126 TRUE,
127 G_PARAM_READWRITE));
128
129 g_object_class_install_property(object_class,
130 PROP_ZOOM_LEVEL,
131 g_param_spec_int("zoom-level",
132 "Zoom",
133 "Zoom level",
134 10,
135 400,
136 100,
137 G_PARAM_READWRITE));
138
139 g_object_class_install_property(object_class,
140 PROP_NTH_DISPLAY,
141 g_param_spec_int("nth-display",
142 "Nth display",
143 "Nth display",
144 0,
145 G_MAXINT32,
146 0,
147 G_PARAM_READWRITE |
148 G_PARAM_CONSTRUCT_ONLY));
149
150 g_object_class_install_property(object_class,
151 PROP_SHOW_HINT,
152 g_param_spec_int("show-hint",
153 "Show hint",
154 "Show state hint",
155 0,
156 G_MAXINT32,
157 0,
158 G_PARAM_READABLE));
159
160 g_object_class_install_property(object_class,
161 PROP_SESSION,
162 g_param_spec_object("session",
163 "Session",
164 "VirtSession",
165 VIRT_VIEWER_TYPE_SESSION,
166 G_PARAM_READWRITE |
167 G_PARAM_CONSTRUCT_ONLY));
168
169
170 g_signal_new("display-pointer-grab",
171 G_OBJECT_CLASS_TYPE(object_class),
172 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
173 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_grab),
174 NULL,
175 NULL,
176 g_cclosure_marshal_VOID__VOID,
177 G_TYPE_NONE,
178 0);
179
180 g_signal_new("display-pointer-ungrab",
181 G_OBJECT_CLASS_TYPE(object_class),
182 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
183 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_ungrab),
184 NULL,
185 NULL,
186 g_cclosure_marshal_VOID__VOID,
187 G_TYPE_NONE,
188 0);
189
190 g_signal_new("display-keyboard-grab",
191 G_OBJECT_CLASS_TYPE(object_class),
192 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
193 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_grab),
194 NULL,
195 NULL,
196 g_cclosure_marshal_VOID__VOID,
197 G_TYPE_NONE,
198 0);
199
200 g_signal_new("display-keyboard-ungrab",
201 G_OBJECT_CLASS_TYPE(object_class),
202 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
203 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_ungrab),
204 NULL,
205 NULL,
206 g_cclosure_marshal_VOID__VOID,
207 G_TYPE_NONE,
208 0);
209
210 g_signal_new("display-desktop-resize",
211 G_OBJECT_CLASS_TYPE(object_class),
212 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
213 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_desktop_resize),
214 NULL,
215 NULL,
216 g_cclosure_marshal_VOID__VOID,
217 G_TYPE_NONE,
218 0);
219
220 g_type_class_add_private(class, sizeof(VirtViewerDisplayPrivate));
206221 }
207222
208223 static void
209224 virt_viewer_display_init(VirtViewerDisplay *display)
210225 {
211 gtk_widget_set_has_window(GTK_WIDGET(display), FALSE);
212 gtk_widget_set_redraw_on_allocate(GTK_WIDGET(display), FALSE);
213
214 display->priv = VIRT_VIEWER_DISPLAY_GET_PRIVATE(display);
215
216 display->priv->desktopWidth = 100;
217 display->priv->desktopHeight = 100;
218 display->priv->zoom_level = 100;
219 display->priv->zoom = TRUE;
220 display->priv->dirty = TRUE;
226 gtk_widget_set_has_window(GTK_WIDGET(display), FALSE);
227 gtk_widget_set_redraw_on_allocate(GTK_WIDGET(display), FALSE);
228
229 display->priv = VIRT_VIEWER_DISPLAY_GET_PRIVATE(display);
230
231 display->priv->desktopWidth = 100;
232 display->priv->desktopHeight = 100;
233 display->priv->zoom_level = 100;
234 display->priv->zoom = TRUE;
235 display->priv->dirty = TRUE;
236 display->priv->auto_resize = TRUE;
221237 }
222238
223239 GtkWidget*
224240 virt_viewer_display_new(void)
225241 {
226 return g_object_new(VIRT_VIEWER_TYPE_DISPLAY, NULL);
242 return g_object_new(VIRT_VIEWER_TYPE_DISPLAY, NULL);
227243 }
228244
229245 static void
230246 virt_viewer_display_set_property(GObject *object,
231 guint prop_id,
232 const GValue *value,
233 GParamSpec *pspec)
234 {
235 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object);
236 VirtViewerDisplayPrivate *priv = display->priv;
237
238 switch (prop_id) {
239 case PROP_DESKTOP_WIDTH:
240 virt_viewer_display_set_desktop_size(display,
241 g_value_get_int(value),
242 priv->desktopHeight);
243 break;
244 case PROP_DESKTOP_HEIGHT:
245 virt_viewer_display_set_desktop_size(display,
246 priv->desktopWidth,
247 g_value_get_int(value));
248 break;
249 case PROP_NTH_DISPLAY:
250 priv->nth_display = g_value_get_int(value);
251 break;
252 default:
253 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
254 break;
255 }
247 guint prop_id,
248 const GValue *value,
249 GParamSpec *pspec)
250 {
251 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object);
252 VirtViewerDisplayPrivate *priv = display->priv;
253
254 switch (prop_id) {
255 case PROP_DESKTOP_WIDTH:
256 virt_viewer_display_set_desktop_size(display,
257 g_value_get_int(value),
258 priv->desktopHeight);
259 break;
260 case PROP_DESKTOP_HEIGHT:
261 virt_viewer_display_set_desktop_size(display,
262 priv->desktopWidth,
263 g_value_get_int(value));
264 break;
265 case PROP_NTH_DISPLAY:
266 priv->nth_display = g_value_get_int(value);
267 break;
268 case PROP_SESSION:
269 g_warn_if_fail(priv->session == NULL);
270 priv->session = g_value_dup_object(value);
271 break;
272
273 default:
274 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
275 break;
276 }
256277 }
257278
258279 static void
259280 virt_viewer_display_get_property(GObject *object,
260 guint prop_id,
261 GValue *value,
262 GParamSpec *pspec)
263 {
264 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object);
265 VirtViewerDisplayPrivate *priv = display->priv;
266
267 switch (prop_id) {
268 case PROP_DESKTOP_WIDTH:
269 g_value_set_int(value, priv->desktopWidth);
270 break;
271 case PROP_DESKTOP_HEIGHT:
272 g_value_set_int(value, priv->desktopHeight);
273 break;
274 case PROP_NTH_DISPLAY:
275 g_value_set_int(value, priv->nth_display);
276 break;
277 case PROP_SHOW_HINT:
278 g_value_set_int(value, priv->show_hint);
279 break;
280
281 default:
282 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
283 break;
284 }
281 guint prop_id,
282 GValue *value,
283 GParamSpec *pspec)
284 {
285 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object);
286 VirtViewerDisplayPrivate *priv = display->priv;
287
288 switch (prop_id) {
289 case PROP_DESKTOP_WIDTH:
290 g_value_set_int(value, priv->desktopWidth);
291 break;
292 case PROP_DESKTOP_HEIGHT:
293 g_value_set_int(value, priv->desktopHeight);
294 break;
295 case PROP_NTH_DISPLAY:
296 g_value_set_int(value, priv->nth_display);
297 break;
298 case PROP_SHOW_HINT:
299 g_value_set_int(value, priv->show_hint);
300 break;
301 case PROP_SESSION:
302 g_value_set_object(value, virt_viewer_display_get_session(display));
303 break;
304
305 default:
306 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
307 break;
308 }
309 }
310
311
312 static void
313 virt_viewer_display_grab_focus(GtkWidget *widget)
314 {
315 GtkBin *bin = GTK_BIN(widget);
316
317 gtk_widget_grab_focus(gtk_bin_get_child(bin));
285318 }
286319
287320
288321 static gboolean
289322 virt_viewer_display_idle(gpointer opaque)
290323 {
291 VirtViewerDisplay *display = opaque;
292 VirtViewerDisplayPrivate *priv = display->priv;
293 if (!priv->dirty)
294 gtk_widget_queue_resize_no_redraw(GTK_WIDGET(display));
295 return FALSE;
324 VirtViewerDisplay *display = opaque;
325 VirtViewerDisplayPrivate *priv = display->priv;
326 if (!priv->dirty)
327 gtk_widget_queue_resize_no_redraw(GTK_WIDGET(display));
328 return FALSE;
296329 }
297330
298331
299332 static void
300333 virt_viewer_display_size_request(GtkWidget *widget,
301 GtkRequisition *requisition)
302 {
303 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget);
304 VirtViewerDisplayPrivate *priv = display->priv;
305 int border_width = gtk_container_get_border_width(GTK_CONTAINER(widget));
306
307 requisition->width = border_width * 2;
308 requisition->height = border_width * 2;
309
310 if (priv->dirty) {
311 if (priv->zoom)
312 requisition->width += priv->desktopWidth * priv->zoom_level / 100;
313 else
314 requisition->width += priv->desktopWidth;
315 } else {
316 requisition->width += 50;
317 }
318 if (priv->dirty) {
319 if (priv->zoom)
320 requisition->height += priv->desktopHeight * priv->zoom_level / 100;
321 else
322 requisition->height += priv->desktopHeight;
323 } else {
324 requisition->height += 50;
325 }
326
327 DEBUG_LOG("Display size request %dx%d (desktop %dx%d)",
328 requisition->width, requisition->height,
329 priv->desktopWidth, priv->desktopHeight);
334 GtkRequisition *requisition)
335 {
336 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget);
337 VirtViewerDisplayPrivate *priv = display->priv;
338 int border_width = gtk_container_get_border_width(GTK_CONTAINER(widget));
339
340 requisition->width = border_width * 2;
341 requisition->height = border_width * 2;
342
343 if (priv->dirty) {
344 if (priv->zoom)
345 requisition->width += priv->desktopWidth * priv->zoom_level / 100;
346 else
347 requisition->width += priv->desktopWidth;
348 } else {
349 requisition->width += 50;
350 }
351 if (priv->dirty) {
352 if (priv->zoom)
353 requisition->height += priv->desktopHeight * priv->zoom_level / 100;
354 else
355 requisition->height += priv->desktopHeight;
356 } else {
357 requisition->height += 50;
358 }
359
360 DEBUG_LOG("Display size request %dx%d (desktop %dx%d)",
361 requisition->width, requisition->height,
362 priv->desktopWidth, priv->desktopHeight);
330363 }
331364
332365
333366 #if GTK_CHECK_VERSION(3, 0, 0)
334367 static void virt_viewer_display_get_preferred_width(GtkWidget *widget,
335 int *minwidth,
336 int *defwidth)
337 {
338 GtkRequisition req;
339
340 virt_viewer_display_size_request(widget, &req);
341
342 *minwidth = *defwidth = req.width;
368 int *minwidth,
369 int *defwidth)
370 {
371 GtkRequisition req;
372
373 virt_viewer_display_size_request(widget, &req);
374
375 *minwidth = *defwidth = req.width;
343376 }
344377
345378
346379 static void virt_viewer_display_get_preferred_height(GtkWidget *widget,
347 int *minheight,
348 int *defheight)
349 {
350 GtkRequisition req;
351
352 virt_viewer_display_size_request(widget, &req);
353
354 *minheight = *defheight = req.height;
380 int *minheight,
381 int *defheight)
382 {
383 GtkRequisition req;
384
385 virt_viewer_display_size_request(widget, &req);
386
387 *minheight = *defheight = req.height;
355388 }
356389 #endif
357390
358391
359392 static void
360393 virt_viewer_display_size_allocate(GtkWidget *widget,
361 GtkAllocation *allocation)
362 {
363 GtkBin *bin = GTK_BIN(widget);
364 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget);
365 VirtViewerDisplayPrivate *priv = display->priv;
366 GtkAllocation child_allocation;
367 gint width, height;
368 gint border_width;
369 double desktopAspect;
370 double actualAspect;
371 GtkWidget *child = gtk_bin_get_child(bin);
372
373 DEBUG_LOG("Allocated %dx%d", allocation->width, allocation->height);
374 gtk_widget_set_allocation(widget, allocation);
375
376 desktopAspect = (double)priv->desktopWidth / (double)priv->desktopHeight;
377
378 if (child && gtk_widget_get_visible(child)) {
379 border_width = gtk_container_get_border_width(GTK_CONTAINER(display));
380
381 width = MAX(1, allocation->width - 2 * border_width);
382 height = MAX(1, allocation->height - 2 * border_width);
383 actualAspect = (double)width / (double)height;
384
385 if (actualAspect > desktopAspect) {
386 child_allocation.width = height * desktopAspect;
387 child_allocation.height = height;
388 } else {
389 child_allocation.width = width;
390 child_allocation.height = width / desktopAspect;
391 }
392
393 child_allocation.x = 0.5 * (width - child_allocation.width) + allocation->x + border_width;
394 child_allocation.y = 0.5 * (height - child_allocation.height) + allocation->y + border_width;
395
396 DEBUG_LOG("Child allocate %dx%d", child_allocation.width, child_allocation.height);
397 gtk_widget_size_allocate(child, &child_allocation);
398 }
399
400
401 /* This unsets the size request, so that the user can
402 * manually resize the window smaller again
403 */
404 if (priv->dirty) {
405 g_idle_add(virt_viewer_display_idle, widget);
406 priv->dirty = FALSE;
407 }
394 GtkAllocation *allocation)
395 {
396 GtkBin *bin = GTK_BIN(widget);
397 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget);
398 VirtViewerDisplayPrivate *priv = display->priv;
399 GtkAllocation child_allocation;
400 gint width, height;
401 gint border_width;
402 double desktopAspect;
403 double actualAspect;
404 GtkWidget *child = gtk_bin_get_child(bin);
405
406 DEBUG_LOG("Allocated %dx%d", allocation->width, allocation->height);
407 gtk_widget_set_allocation(widget, allocation);
408
409 desktopAspect = (double)priv->desktopWidth / (double)priv->desktopHeight;
410
411 if (child && gtk_widget_get_visible(child)) {
412 border_width = gtk_container_get_border_width(GTK_CONTAINER(display));
413
414 width = MAX(1, allocation->width - 2 * border_width);
415 height = MAX(1, allocation->height - 2 * border_width);
416 actualAspect = (double)width / (double)height;
417
418 if (actualAspect > desktopAspect) {
419 child_allocation.width = height * desktopAspect;
420 child_allocation.height = height;
421 } else {
422 child_allocation.width = width;
423 child_allocation.height = width / desktopAspect;
424 }
425
426 child_allocation.x = 0.5 * (width - child_allocation.width) + allocation->x + border_width;
427 child_allocation.y = 0.5 * (height - child_allocation.height) + allocation->y + border_width;
428
429 DEBUG_LOG("Child allocate %dx%d", child_allocation.width, child_allocation.height);
430 gtk_widget_size_allocate(child, &child_allocation);
431 }
432
433
434 /* This unsets the size request, so that the user can
435 * manually resize the window smaller again
436 */
437 if (priv->dirty) {
438 g_idle_add(virt_viewer_display_idle, widget);
439 priv->dirty = FALSE;
440 }
408441 }
409442
410443
411444 void virt_viewer_display_set_desktop_size(VirtViewerDisplay *display,
412 guint width,
413 guint height)
414 {
415 VirtViewerDisplayPrivate *priv = display->priv;
416
417 if (width == priv->desktopWidth && height == priv->desktopHeight)
418 return;
419
420 priv->desktopWidth = width;
421 priv->desktopHeight = height;
422 priv->dirty = TRUE;
423
424 gtk_widget_queue_resize(GTK_WIDGET(display));
425 g_signal_emit_by_name(display, "display-desktop-resize");
445 guint width,
446 guint height)
447 {
448 VirtViewerDisplayPrivate *priv = display->priv;
449
450 if (width == priv->desktopWidth && height == priv->desktopHeight)
451 return;
452
453 priv->desktopWidth = width;
454 priv->desktopHeight = height;
455 priv->dirty = TRUE;
456
457 gtk_widget_queue_resize(GTK_WIDGET(display));
458 g_signal_emit_by_name(display, "display-desktop-resize");
426459 }
427460
428461
429462 void virt_viewer_display_get_desktop_size(VirtViewerDisplay *display,
430 guint *width,
431 guint *height)
432 {
433 VirtViewerDisplayPrivate *priv = display->priv;
434
435 *width = priv->desktopWidth;
436 *height = priv->desktopHeight;
463 guint *width,
464 guint *height)
465 {
466 VirtViewerDisplayPrivate *priv = display->priv;
467
468 *width = priv->desktopWidth;
469 *height = priv->desktopHeight;
437470 }
438471
439472
440473 void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display,
441 guint zoom)
442 {
443 VirtViewerDisplayPrivate *priv = display->priv;
444 GtkWidget *child = gtk_bin_get_child(GTK_BIN(display));
445
446 if (zoom < 10)
447 zoom = 10;
448 if (zoom > 400)
449 zoom = 400;
450 priv->zoom_level = zoom;
451
452 if (child && gtk_widget_get_visible(child)) {
453 priv->dirty = TRUE;
454 gtk_widget_queue_resize(GTK_WIDGET(display));
455 }
474 guint zoom)
475 {
476 VirtViewerDisplayPrivate *priv = display->priv;
477 GtkWidget *child = gtk_bin_get_child(GTK_BIN(display));
478
479 if (zoom < 10)
480 zoom = 10;
481 if (zoom > 400)
482 zoom = 400;
483 priv->zoom_level = zoom;
484
485 if (child && gtk_widget_get_visible(child)) {
486 priv->dirty = TRUE;
487 gtk_widget_queue_resize(GTK_WIDGET(display));
488 }
489 }
490
491
492 guint virt_viewer_display_get_zoom_level(VirtViewerDisplay *display)
493 {
494 VirtViewerDisplayPrivate *priv = display->priv;
495 return priv->zoom_level;
456496 }
457497
458498
459499 void virt_viewer_display_set_zoom(VirtViewerDisplay *display,
460 gboolean zoom)
461 {
462 VirtViewerDisplayPrivate *priv = display->priv;
463 GtkWidget *child = gtk_bin_get_child(GTK_BIN(display));
464
465 priv->zoom = zoom;
466 if (child && gtk_widget_get_visible(child)) {
467 priv->dirty = TRUE;
468 gtk_widget_queue_resize(GTK_WIDGET(display));
469 }
470 }
500 gboolean zoom)
501 {
502 VirtViewerDisplayPrivate *priv = display->priv;
503 GtkWidget *child = gtk_bin_get_child(GTK_BIN(display));
504
505 priv->zoom = zoom;
506 if (child && gtk_widget_get_visible(child)) {
507 priv->dirty = TRUE;
508 gtk_widget_queue_resize(GTK_WIDGET(display));
509 }
510 }
511
512
513 gboolean virt_viewer_display_get_zoom(VirtViewerDisplay *display)
514 {
515 VirtViewerDisplayPrivate *priv = display->priv;
516 return priv->zoom;
517 }
518
471519
472520 void virt_viewer_display_send_keys(VirtViewerDisplay *display,
473 const guint *keyvals, int nkeyvals)
474 {
475 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(display));
476
477 VIRT_VIEWER_DISPLAY_GET_CLASS(display)->send_keys(display, keyvals, nkeyvals);
521 const guint *keyvals, int nkeyvals)
522 {
523 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(display));
524
525 VIRT_VIEWER_DISPLAY_GET_CLASS(display)->send_keys(display, keyvals, nkeyvals);
478526 }
479527
480528 GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay *display)
481529 {
482 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(display), NULL);
483
484 return VIRT_VIEWER_DISPLAY_GET_CLASS(display)->get_pixbuf(display);
530 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(display), NULL);
531
532 return VIRT_VIEWER_DISPLAY_GET_CLASS(display)->get_pixbuf(display);
485533 }
486534
487535 void virt_viewer_display_set_show_hint(VirtViewerDisplay *self, gint hint)
488536 {
489 VirtViewerDisplayPrivate *priv;
490 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self));
491
492 priv = self->priv;
493 if (priv->show_hint == hint)
494 return;
495
496 priv->show_hint = hint;
497 g_object_notify(G_OBJECT(self), "show-hint");
537 VirtViewerDisplayPrivate *priv;
538 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self));
539
540 priv = self->priv;
541 if (priv->show_hint == hint)
542 return;
543
544 priv->show_hint = hint;
545 g_object_notify(G_OBJECT(self), "show-hint");
546 }
547
548 VirtViewerSession* virt_viewer_display_get_session(VirtViewerDisplay *self)
549 {
550 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), NULL);
551
552 return self->priv->session;
553 }
554
555 void virt_viewer_display_set_auto_resize(VirtViewerDisplay *self, gboolean auto_resize)
556 {
557 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self));
558
559 self->priv->auto_resize = auto_resize;
560 }
561
562 gboolean virt_viewer_display_get_auto_resize(VirtViewerDisplay *self)
563 {
564 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), FALSE);
565
566 return self->priv->auto_resize;
498567 }
499568
500569 /*
501570 * Local variables:
502 * c-indent-level: 8
503 * c-basic-offset: 8
504 * tab-width: 8
571 * c-indent-level: 4
572 * c-basic-offset: 4
573 * indent-tabs-mode: nil
505574 * End:
506575 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2929
3030 #define VIRT_VIEWER_TYPE_DISPLAY virt_viewer_display_get_type()
3131
32 #define VIRT_VIEWER_DISPLAY(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplay))
32 #define VIRT_VIEWER_DISPLAY(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplay))
3434
35 #define VIRT_VIEWER_DISPLAY_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
35 #define VIRT_VIEWER_DISPLAY_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
3737
3838 #define VIRT_VIEWER_IS_DISPLAY(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY))
39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY))
4040
4141 #define VIRT_VIEWER_IS_DISPLAY_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY))
42 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY))
4343
44 #define VIRT_VIEWER_DISPLAY_GET_CLASS(obj) \
45 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
44 #define VIRT_VIEWER_DISPLAY_GET_CLASS(obj) \
45 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
46
47 typedef struct _VirtViewerSession VirtViewerSession;
48 typedef struct _VirtViewerSessionClass VirtViewerSessionClass;
4649
4750 typedef struct _VirtViewerDisplay VirtViewerDisplay;
4851 typedef struct _VirtViewerDisplayClass VirtViewerDisplayClass;
5154 typedef struct _VirtViewerDisplayChannel VirtViewerDisplayChannel;
5255
5356 enum {
54 VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE = 0,
55 VIRT_VIEWER_DISPLAY_SHOW_HINT_READY,
57 VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE = 0,
58 VIRT_VIEWER_DISPLAY_SHOW_HINT_READY,
5659 };
5760
5861 /* perhaps this become an interface, and be pushed in gtkvnc and spice? */
5962 struct _VirtViewerDisplay {
60 GtkBin parent;
63 GtkBin parent;
6164
62 VirtViewerDisplayPrivate *priv;
65 VirtViewerDisplayPrivate *priv;
6366 };
6467
6568 struct _VirtViewerDisplayClass {
66 GtkBinClass parent_class;
69 GtkBinClass parent_class;
6770
68 /* virtual methods */
69 void (*send_keys)(VirtViewerDisplay* display,
70 const guint *keyvals, int nkeyvals);
71 GdkPixbuf *(*get_pixbuf)(VirtViewerDisplay* display);
71 /* virtual methods */
72 void (*send_keys)(VirtViewerDisplay* display,
73 const guint *keyvals, int nkeyvals);
74 GdkPixbuf *(*get_pixbuf)(VirtViewerDisplay* display);
7275
73 /* signals */
74 void (*display_pointer_grab)(VirtViewerDisplay *display);
75 void (*display_pointer_ungrab)(VirtViewerDisplay *display);
76 void (*display_keyboard_grab)(VirtViewerDisplay *display);
77 void (*display_keyboard_ungrab)(VirtViewerDisplay *display);
76 /* signals */
77 void (*display_pointer_grab)(VirtViewerDisplay *display);
78 void (*display_pointer_ungrab)(VirtViewerDisplay *display);
79 void (*display_keyboard_grab)(VirtViewerDisplay *display);
80 void (*display_keyboard_ungrab)(VirtViewerDisplay *display);
7881
79 void (*display_desktop_resize)(VirtViewerDisplay *display);
82 void (*display_desktop_resize)(VirtViewerDisplay *display);
8083 };
8184
8285 GType virt_viewer_display_get_type(void);
8487 GtkWidget *virt_viewer_display_new(void);
8588
8689 void virt_viewer_display_set_desktop_size(VirtViewerDisplay *display,
87 guint width,
88 guint height);
90 guint width,
91 guint height);
8992
9093 void virt_viewer_display_get_desktop_size(VirtViewerDisplay *display,
91 guint *width,
92 guint *height);
94 guint *width,
95 guint *height);
9396
9497 void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display,
95 guint zoom);
98 guint zoom);
99 guint virt_viewer_display_get_zoom_level(VirtViewerDisplay *display);
96100 void virt_viewer_display_set_zoom(VirtViewerDisplay *display,
97 gboolean zoom);
101 gboolean zoom);
102 gboolean virt_viewer_display_get_zoom(VirtViewerDisplay *display);
98103
99104 void virt_viewer_display_send_keys(VirtViewerDisplay *display,
100 const guint *keyvals, int nkeyvals);
105 const guint *keyvals, int nkeyvals);
101106 GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay *display);
102107 void virt_viewer_display_set_show_hint(VirtViewerDisplay *display, gint hint);
103
108 VirtViewerSession* virt_viewer_display_get_session(VirtViewerDisplay *display);
109 void virt_viewer_display_set_auto_resize(VirtViewerDisplay *display, gboolean auto_resize);
110 gboolean virt_viewer_display_get_auto_resize(VirtViewerDisplay *display);
104111 G_END_DECLS
105112
106113 #endif /* _VIRT_VIEWER_DISPLAY_H */
107114 /*
108115 * Local variables:
109 * c-indent-level: 8
110 * c-basic-offset: 8
111 * tab-width: 8
116 * c-indent-level: 4
117 * c-basic-offset: 4
118 * indent-tabs-mode: nil
112119 * End:
113120 */
00 /*
11 * events.c: event loop integration
22 *
3 * Copyright (C) 2008-2009 Daniel P. Berrange
3 * Copyright (C) 2008-2012 Daniel P. Berrange
44 *
55 * This library is free software; you can redistribute it and/or
66 * modify it under the terms of the GNU Lesser General Public
1919 * Author: Daniel P. Berrange <berrange@redhat.com>
2020 */
2121
22 #include <config.h>
2223
2324 #include <stdio.h>
2425 #include <string.h>
4748
4849 static gboolean
4950 virt_viewer_events_dispatch_handle(GIOChannel *source G_GNUC_UNUSED,
50 GIOCondition condition,
51 gpointer opaque)
51 GIOCondition condition,
52 gpointer opaque)
5253 {
5354 struct virt_viewer_events_handle *data = opaque;
5455 int events = 0;
7273
7374 static
7475 int virt_viewer_events_add_handle(int fd,
75 int events,
76 virEventHandleCallback cb,
77 void *opaque,
78 virFreeCallback ff)
76 int events,
77 virEventHandleCallback cb,
78 void *opaque,
79 virFreeCallback ff)
7980 {
8081 struct virt_viewer_events_handle *data;
8182 GIOCondition cond = 0;
122123
123124 static void
124125 virt_viewer_events_update_handle(int watch,
125 int events)
126 int events)
126127 {
127128 struct virt_viewer_events_handle *data = virt_viewer_events_find_handle(watch);
128129
226227
227228 static int
228229 virt_viewer_events_add_timeout(int interval,
229 virEventTimeoutCallback cb,
230 void *opaque,
231 virFreeCallback ff)
230 virEventTimeoutCallback cb,
231 void *opaque,
232 virFreeCallback ff)
232233 {
233234 struct virt_viewer_events_timeout *data;
234235
268269
269270 static void
270271 virt_viewer_events_update_timeout(int timer,
271 int interval)
272 int interval)
272273 {
273274 struct virt_viewer_events_timeout *data = virt_viewer_events_find_timeout(timer);
274275
345346 virt_viewer_events_remove_timeout);
346347 }
347348
349 /*
350 * Local variables:
351 * c-indent-level: 4
352 * c-basic-offset: 4
353 * indent-tabs-mode: nil
354 * End:
355 */
00 /*
11 * events.h: event loop integration
22 *
3 * Copyright (C) 2008-2009 Daniel P. Berrange
3 * Copyright (C) 2008-2012 Daniel P. Berrange
44 *
55 * This library is free software; you can redistribute it and/or
66 * modify it under the terms of the GNU Lesser General Public
2727 void virt_viewer_events_register(void);
2828
2929 #endif
30 /*
31 * Local variables:
32 * c-indent-level: 4
33 * c-basic-offset: 4
34 * indent-tabs-mode: nil
35 * End:
36 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007 Red Hat,
3 * Copyright (C) 2007-2012 Red Hat, Inc.
44 *
55 * This program is free software; you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
2424 #include <gtk/gtk.h>
2525 #include <glib/gi18n.h>
2626 #include <stdlib.h>
27
2827 #ifdef HAVE_GTK_VNC
2928 #include <vncdisplay.h>
3029 #endif
31
30 #ifdef HAVE_SPICE_GTK
31 #include <spice-option.h>
32 #endif
3233 #include "virt-viewer.h"
3334
3435 static void virt_viewer_version(void)
3536 {
36 g_print(_("%s version %s\n"), PACKAGE, VERSION);
37 g_print(_("%s version %s\n"), PACKAGE, VERSION);
3738
38 exit(0);
39 exit(EXIT_SUCCESS);
3940 }
4041
4142
4243 int main(int argc, char **argv)
4344 {
44 GOptionContext *context;
45 GError *error = NULL;
46 int ret = 1;
47 char *uri = NULL;
48 int zoom = 100;
49 gchar **args = NULL;
50 gboolean verbose = FALSE;
51 gboolean debug = FALSE;
52 gboolean direct = FALSE;
53 gboolean waitvm = FALSE;
54 gboolean reconnect = FALSE;
55 gboolean fullscreen = FALSE;
56 VirtViewer *viewer = NULL;
57 const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options");
58 const GOptionEntry options [] = {
59 { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
60 virt_viewer_version, N_("display version information"), NULL },
61 { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
62 N_("display verbose information"), NULL },
63 { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct,
64 N_("direct connection with no automatic tunnels"), NULL },
65 { "connect", 'c', 0, G_OPTION_ARG_STRING, &uri,
66 N_("connect to hypervisor"), "URI"},
67 { "wait", 'w', 0, G_OPTION_ARG_NONE, &waitvm,
68 N_("wait for domain to start"), NULL },
69 { "reconnect", 'r', 0, G_OPTION_ARG_NONE, &reconnect,
70 N_("reconnect to domain upon restart"), NULL },
71 { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom,
72 N_("Zoom level of window, in percentage"), "ZOOM" },
73 { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug,
74 N_("display debugging information"), NULL },
75 { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen,
76 N_("Open in full screen mode"), NULL },
77 { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
78 NULL, "DOMAIN-NAME|ID|UUID" },
79 { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
80 };
45 GOptionContext *context;
46 GError *error = NULL;
47 int ret = 1;
48 char *uri = NULL;
49 int zoom = 100;
50 gchar **args = NULL;
51 gboolean verbose = FALSE;
52 gboolean debug = FALSE;
53 gboolean direct = FALSE;
54 gboolean attach = FALSE;
55 gboolean waitvm = FALSE;
56 gboolean reconnect = FALSE;
57 gboolean fullscreen = FALSE;
58 VirtViewer *viewer = NULL;
59 const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options");
60 const GOptionEntry options [] = {
61 { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
62 virt_viewer_version, N_("Display version information"), NULL },
63 { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
64 N_("Display verbose information"), NULL },
65 { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct,
66 N_("Direct connection with no automatic tunnels"), NULL },
67 { "attach", 'a', 0, G_OPTION_ARG_NONE, &attach,
68 N_("Attach to the local display using libvirt"), NULL },
69 { "connect", 'c', 0, G_OPTION_ARG_STRING, &uri,
70 N_("Connect to hypervisor"), "URI"},
71 { "wait", 'w', 0, G_OPTION_ARG_NONE, &waitvm,
72 N_("Wait for domain to start"), NULL },
73 { "reconnect", 'r', 0, G_OPTION_ARG_NONE, &reconnect,
74 N_("Reconnect to domain upon restart"), NULL },
75 { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom,
76 N_("Zoom level of window, in percentage"), "ZOOM" },
77 { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug,
78 N_("Display debugging information"), NULL },
79 { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen,
80 N_("Open in full screen mode"), NULL },
81 { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
82 NULL, "DOMAIN-NAME|ID|UUID" },
83 { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
84 };
8185
82 setlocale(LC_ALL, "");
83 bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
84 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
85 textdomain(GETTEXT_PACKAGE);
86 setlocale(LC_ALL, "");
87 bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
88 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
89 textdomain(GETTEXT_PACKAGE);
8690
87 g_set_application_name(_("Virt Viewer"));
91 g_set_application_name(_("Virt Viewer"));
8892
89 /* Setup command line options */
90 context = g_option_context_new (_("- Virtual machine graphical console"));
91 g_option_context_add_main_entries (context, options, NULL);
92 g_option_context_add_group (context, gtk_get_option_group (TRUE));
93 /* Setup command line options */
94 context = g_option_context_new (_("- Virtual machine graphical console"));
95 g_option_context_add_main_entries (context, options, NULL);
96 g_option_context_add_group (context, gtk_get_option_group (TRUE));
9397 #ifdef HAVE_GTK_VNC
94 g_option_context_add_group (context, vnc_display_get_option_group ());
98 g_option_context_add_group (context, vnc_display_get_option_group ());
9599 #endif
96 g_option_context_parse (context, &argc, &argv, &error);
97 if (error) {
98 g_printerr("%s\n%s\n",
99 error->message,
100 gettext(help_msg));
101 g_error_free(error);
102 goto cleanup;
103 }
100 #ifdef HAVE_SPICE_GTK
101 g_option_context_add_group (context, spice_get_option_group ());
102 #endif
103 g_option_context_parse (context, &argc, &argv, &error);
104 if (error) {
105 g_printerr("%s\n%s\n",
106 error->message,
107 gettext(help_msg));
108 g_error_free(error);
109 goto cleanup;
110 }
104111
105 g_option_context_free(context);
112 g_option_context_free(context);
106113
107 if (!args || (g_strv_length(args) != 1)) {
108 g_printerr(_("\nUsage: %s [OPTIONS] DOMAIN-NAME|ID|UUID\n\n%s\n\n"), argv[0], help_msg);
109 goto cleanup;
110 }
114 if (!args || (g_strv_length(args) != 1)) {
115 g_printerr(_("\nUsage: %s [OPTIONS] DOMAIN-NAME|ID|UUID\n\n%s\n\n"), argv[0], help_msg);
116 goto cleanup;
117 }
111118
112 if (zoom < 10 || zoom > 200) {
113 g_printerr(_("Zoom level must be within 10-200\n"));
114 goto cleanup;
115 }
119 if (zoom < 10 || zoom > 200) {
120 g_printerr(_("Zoom level must be within 10-200\n"));
121 goto cleanup;
122 }
116123
117 virt_viewer_app_set_debug(debug);
124 gtk_window_set_default_icon_name("virt-viewer");
118125
119 viewer = virt_viewer_new(uri, args[0], zoom, direct, waitvm, reconnect, verbose, NULL);
120 if (viewer == NULL)
121 goto cleanup;
126 virt_viewer_app_set_debug(debug);
122127
123 g_object_set(viewer, "fullscreen", fullscreen, NULL);
124 if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer)))
125 goto cleanup;
128 viewer = virt_viewer_new(uri, args[0], zoom, direct, attach, waitvm, reconnect, verbose, NULL);
129 if (viewer == NULL)
130 goto cleanup;
126131
127 gtk_main();
132 g_object_set(viewer, "fullscreen", fullscreen, NULL);
133 if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer)))
134 goto cleanup;
128135
129 ret = 0;
136 gtk_main();
130137
131 cleanup:
132 if (viewer)
133 g_object_unref(viewer);
134 g_free(uri);
135 g_strfreev(args);
138 ret = 0;
136139
137 return ret;
140 cleanup:
141 if (viewer)
142 g_object_unref(viewer);
143 g_free(uri);
144 g_strfreev(args);
145
146 return ret;
138147 }
139148
140149 /*
141150 * Local variables:
142 * c-indent-level: 8
143 * c-basic-offset: 8
144 * tab-width: 8
145 * indent-tabs-mode: t
151 * c-indent-level: 4
152 * c-basic-offset: 4
153 * indent-tabs-mode: nil
146154 * End:
147155 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2020 *
2121 * Author: Daniel P. Berrange <berrange@redhat.com>
2222 */
23
24 #include <config.h>
25
2326 #include "virt-viewer-notebook.h"
2427 #include "virt-viewer-util.h"
2528
2629 G_DEFINE_TYPE (VirtViewerNotebook, virt_viewer_notebook, GTK_TYPE_NOTEBOOK)
2730
28 #define GET_PRIVATE(o) \
29 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookPrivate))
31 #define GET_PRIVATE(o) \
32 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookPrivate))
3033
3134 struct _VirtViewerNotebookPrivate {
32 GtkWidget *status;
35 GtkWidget *status;
3336 };
3437
3538 static void
3639 virt_viewer_notebook_get_property (GObject *object, guint property_id,
37 GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
40 GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
3841 {
39 switch (property_id) {
40 default:
41 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
42 }
42 switch (property_id) {
43 default:
44 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
45 }
4346 }
4447
4548 static void
4649 virt_viewer_notebook_set_property (GObject *object, guint property_id,
47 const GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
50 const GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
4851 {
49 switch (property_id) {
50 default:
51 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
52 }
52 switch (property_id) {
53 default:
54 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
55 }
5356 }
5457
5558 static void
5659 virt_viewer_notebook_dispose (GObject *object)
5760 {
58 G_OBJECT_CLASS (virt_viewer_notebook_parent_class)->dispose (object);
61 G_OBJECT_CLASS (virt_viewer_notebook_parent_class)->dispose (object);
5962 }
6063
6164 static void
6265 virt_viewer_notebook_class_init (VirtViewerNotebookClass *klass)
6366 {
64 GObjectClass *object_class = G_OBJECT_CLASS (klass);
67 GObjectClass *object_class = G_OBJECT_CLASS (klass);
6568
66 g_type_class_add_private (klass, sizeof (VirtViewerNotebookPrivate));
69 g_type_class_add_private (klass, sizeof (VirtViewerNotebookPrivate));
6770
68 object_class->get_property = virt_viewer_notebook_get_property;
69 object_class->set_property = virt_viewer_notebook_set_property;
70 object_class->dispose = virt_viewer_notebook_dispose;
71 object_class->get_property = virt_viewer_notebook_get_property;
72 object_class->set_property = virt_viewer_notebook_set_property;
73 object_class->dispose = virt_viewer_notebook_dispose;
7174 }
7275
7376 static void
7477 virt_viewer_notebook_init (VirtViewerNotebook *self)
7578 {
76 VirtViewerNotebookPrivate *priv;
77 GdkColor color;
79 VirtViewerNotebookPrivate *priv;
80 GdkColor color;
7881
79 self->priv = GET_PRIVATE(self);
80 priv = self->priv;
82 self->priv = GET_PRIVATE(self);
83 priv = self->priv;
8184
82 priv->status = gtk_label_new("");
83 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(self), FALSE);
84 gtk_notebook_set_show_border(GTK_NOTEBOOK(self), FALSE);
85 gtk_notebook_append_page(GTK_NOTEBOOK(self), priv->status, NULL);
86 gdk_color_parse("white", &color);
87 gtk_widget_modify_fg(priv->status, GTK_STATE_NORMAL, &color);
85 priv->status = gtk_label_new("");
86 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(self), FALSE);
87 gtk_notebook_set_show_border(GTK_NOTEBOOK(self), FALSE);
88 gtk_notebook_append_page(GTK_NOTEBOOK(self), priv->status, NULL);
89 gdk_color_parse("white", &color);
90 gtk_widget_modify_fg(priv->status, GTK_STATE_NORMAL, &color);
8891 }
8992
9093 void
9194 virt_viewer_notebook_show_status_va(VirtViewerNotebook *self, const gchar *fmt, va_list args)
9295 {
93 VirtViewerNotebookPrivate *priv;
94 gchar *text;
96 VirtViewerNotebookPrivate *priv;
97 gchar *text;
9598
96 DEBUG_LOG("notebook show status %p", self);
97 g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self));
99 DEBUG_LOG("notebook show status %p", self);
100 g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self));
98101
99 text = g_strdup_vprintf(fmt, args);
100 priv = self->priv;
101 gtk_label_set_text(GTK_LABEL(priv->status), text);
102 gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 0);
103 gtk_widget_show_all(GTK_WIDGET(self));
104 g_free(text);
102 text = g_strdup_vprintf(fmt, args);
103 priv = self->priv;
104 gtk_label_set_text(GTK_LABEL(priv->status), text);
105 gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 0);
106 gtk_widget_show_all(GTK_WIDGET(self));
107 g_free(text);
105108 }
106109
107110 void
108111 virt_viewer_notebook_show_status(VirtViewerNotebook *self, const gchar *fmt, ...)
109112 {
110 va_list args;
113 va_list args;
111114
112 g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self));
115 g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self));
113116
114 va_start(args, fmt);
115 virt_viewer_notebook_show_status_va(self, fmt, args);
116 va_end(args);
117 va_start(args, fmt);
118 virt_viewer_notebook_show_status_va(self, fmt, args);
119 va_end(args);
117120 }
118121
119122 void
120123 virt_viewer_notebook_show_display(VirtViewerNotebook *self)
121124 {
122 GtkWidget *display;
125 GtkWidget *display;
123126
124 DEBUG_LOG("notebook show display %p", self);
125 g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self));
127 DEBUG_LOG("notebook show display %p", self);
128 g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self));
126129
127 display = gtk_notebook_get_nth_page(GTK_NOTEBOOK(self), 1);
128 g_warn_if_fail(display != NULL);
130 display = gtk_notebook_get_nth_page(GTK_NOTEBOOK(self), 1);
131 g_warn_if_fail(display != NULL);
132 gtk_widget_grab_focus(display);
129133
130 gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 1);
131 gtk_widget_show_all(GTK_WIDGET(self));
134 gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 1);
135 gtk_widget_show_all(GTK_WIDGET(self));
132136 }
133137
134138 VirtViewerNotebook*
135139 virt_viewer_notebook_new (void)
136140 {
137 return g_object_new (VIRT_VIEWER_TYPE_NOTEBOOK, NULL);
141 return g_object_new (VIRT_VIEWER_TYPE_NOTEBOOK, NULL);
138142 }
139143
140144 /*
141145 * Local variables:
142 * c-indent-level: 8
143 * c-basic-offset: 8
144 * tab-width: 8
145 * indent-tabs-mode: t
146 * c-indent-level: 4
147 * c-basic-offset: 4
148 * indent-tabs-mode: nil
146149 * End:
147150 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3030
3131 #define VIRT_VIEWER_TYPE_NOTEBOOK virt_viewer_notebook_get_type()
3232
33 #define VIRT_VIEWER_NOTEBOOK(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebook))
33 #define VIRT_VIEWER_NOTEBOOK(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebook))
3535
36 #define VIRT_VIEWER_NOTEBOOK_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass))
36 #define VIRT_VIEWER_NOTEBOOK_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass))
3838
39 #define VIRT_VIEWER_IS_NOTEBOOK(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_NOTEBOOK))
39 #define VIRT_VIEWER_IS_NOTEBOOK(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_NOTEBOOK))
4141
42 #define VIRT_VIEWER_IS_NOTEBOOK_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_NOTEBOOK))
42 #define VIRT_VIEWER_IS_NOTEBOOK_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_NOTEBOOK))
4444
45 #define VIRT_VIEWER_NOTEBOOK_GET_CLASS(obj) \
46 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass))
45 #define VIRT_VIEWER_NOTEBOOK_GET_CLASS(obj) \
46 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_NOTEBOOK, VirtViewerNotebookClass))
4747
4848 typedef struct _VirtViewerNotebookPrivate VirtViewerNotebookPrivate;
4949
5050 typedef struct {
51 GtkNotebook parent;
52 VirtViewerNotebookPrivate *priv;
51 GtkNotebook parent;
52 VirtViewerNotebookPrivate *priv;
5353 } VirtViewerNotebook;
5454
5555 typedef struct {
56 GtkNotebookClass parent_class;
56 GtkNotebookClass parent_class;
5757 } VirtViewerNotebookClass;
5858
5959 GType virt_viewer_notebook_get_type (void);
6666 G_END_DECLS
6767
6868 #endif /* _VIRT_VIEWER_NOTEBOOK */
69
7069 /*
7170 * Local variables:
72 * c-indent-level: 8
73 * c-basic-offset: 8
74 * tab-width: 8
75 * indent-tabs-mode: t
71 * c-indent-level: 4
72 * c-basic-offset: 4
73 * indent-tabs-mode: nil
7674 * End:
7775 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2121 * Author: Daniel P. Berrange <berrange@redhat.com>
2222 */
2323
24 #include <config.h>
25
2426 #include <spice-audio.h>
25
2627 #include <glib/gi18n.h>
2728
29 #include <spice-option.h>
30 #include <usb-device-widget.h>
2831 #include "virt-viewer-util.h"
2932 #include "virt-viewer-session-spice.h"
3033 #include "virt-viewer-display-spice.h"
3437
3538
3639 struct _VirtViewerSessionSpicePrivate {
37 SpiceSession *session;
38 SpiceAudio *audio;
40 GtkWindow *main_window;
41 SpiceSession *session;
42 SpiceGtkSession *gtk_session;
43 SpiceMainChannel *main_channel;
44 SpiceAudio *audio;
3945 };
4046
4147 #define VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpicePrivate))
48
49 enum {
50 PROP_0,
51 PROP_SPICE_SESSION,
52 };
53
4254
4355 static void virt_viewer_session_spice_close(VirtViewerSession *session);
4456 static gboolean virt_viewer_session_spice_open_fd(VirtViewerSession *session, int fd);
45 static gboolean virt_viewer_session_spice_open_host(VirtViewerSession *session, char *host, char *port);
57 static gboolean virt_viewer_session_spice_open_host(VirtViewerSession *session, const gchar *host, const gchar *port, const gchar *tlsport);
58 static gboolean virt_viewer_session_spice_open_uri(VirtViewerSession *session, const gchar *uri);
4659 static gboolean virt_viewer_session_spice_channel_open_fd(VirtViewerSession *session, VirtViewerSessionChannel *channel, int fd);
60 static gboolean virt_viewer_session_spice_has_usb(VirtViewerSession *session);
61 static void virt_viewer_session_spice_usb_device_selection(VirtViewerSession *session, GtkWindow *parent);
4762 static void virt_viewer_session_spice_channel_new(SpiceSession *s,
48 SpiceChannel *channel,
49 VirtViewerSession *session);
63 SpiceChannel *channel,
64 VirtViewerSession *session);
5065 static void virt_viewer_session_spice_channel_destroy(SpiceSession *s,
51 SpiceChannel *channel,
52 VirtViewerSession *session);
53
54
55 static void
56 virt_viewer_session_spice_finalize(GObject *obj)
57 {
58 VirtViewerSessionSpice *spice = VIRT_VIEWER_SESSION_SPICE(obj);
59
60 if (spice->priv->session) {
61 spice_session_disconnect(spice->priv->session);
62 g_object_unref(spice->priv->session);
63 }
64 if (spice->priv->audio)
65 g_object_unref(spice->priv->audio);
66
67 G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->finalize(obj);
66 SpiceChannel *channel,
67 VirtViewerSession *session);
68
69
70 static void
71 virt_viewer_session_spice_get_property(GObject *object, guint property_id,
72 GValue *value, GParamSpec *pspec)
73 {
74 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(object);
75 VirtViewerSessionSpicePrivate *priv = self->priv;
76
77 switch (property_id) {
78 case PROP_SPICE_SESSION:
79 g_value_set_object(value, priv->session);
80 break;
81 default:
82 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
83 }
84 }
85
86 static void
87 virt_viewer_session_spice_set_property(GObject *object, guint property_id,
88 const GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
89 {
90 switch (property_id) {
91 default:
92 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
93 }
94 }
95
96 static void
97 virt_viewer_session_spice_dispose(GObject *obj)
98 {
99 VirtViewerSessionSpice *spice = VIRT_VIEWER_SESSION_SPICE(obj);
100
101 if (spice->priv->session) {
102 spice_session_disconnect(spice->priv->session);
103 g_object_unref(spice->priv->session);
104 }
105 if (spice->priv->audio)
106 g_object_unref(spice->priv->audio);
107 if (spice->priv->main_channel)
108 g_object_unref(spice->priv->main_channel);
109 if (spice->priv->main_window)
110 g_object_unref(spice->priv->main_window);
111
112 G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->finalize(obj);
68113 }
69114
70115
71116 static void
72117 virt_viewer_session_spice_class_init(VirtViewerSessionSpiceClass *klass)
73118 {
74 VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass);
75 GObjectClass *oclass = G_OBJECT_CLASS(klass);
76
77 oclass->finalize = virt_viewer_session_spice_finalize;
78
79 dclass->close = virt_viewer_session_spice_close;
80 dclass->open_fd = virt_viewer_session_spice_open_fd;
81 dclass->open_host = virt_viewer_session_spice_open_host;
82 dclass->channel_open_fd = virt_viewer_session_spice_channel_open_fd;
83
84 g_type_class_add_private(oclass, sizeof(VirtViewerSessionSpicePrivate));
119 VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass);
120 GObjectClass *oclass = G_OBJECT_CLASS(klass);
121
122 oclass->get_property = virt_viewer_session_spice_get_property;
123 oclass->set_property = virt_viewer_session_spice_set_property;
124 oclass->dispose = virt_viewer_session_spice_dispose;
125
126 dclass->close = virt_viewer_session_spice_close;
127 dclass->open_fd = virt_viewer_session_spice_open_fd;
128 dclass->open_host = virt_viewer_session_spice_open_host;
129 dclass->open_uri = virt_viewer_session_spice_open_uri;
130 dclass->channel_open_fd = virt_viewer_session_spice_channel_open_fd;
131 dclass->has_usb = virt_viewer_session_spice_has_usb;
132 dclass->usb_device_selection = virt_viewer_session_spice_usb_device_selection;
133
134 g_type_class_add_private(klass, sizeof(VirtViewerSessionSpicePrivate));
135
136 g_object_class_install_property(oclass,
137 PROP_SPICE_SESSION,
138 g_param_spec_object("spice-session",
139 "Spice session",
140 "Spice session",
141 SPICE_TYPE_SESSION,
142 G_PARAM_READABLE |
143 G_PARAM_STATIC_STRINGS));
85144 }
86145
87146 static void
88147 virt_viewer_session_spice_init(VirtViewerSessionSpice *self G_GNUC_UNUSED)
89148 {
90 self->priv = VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(self);
149 self->priv = VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(self);
150 }
151
152 static void
153 usb_connect_failed(GObject *object G_GNUC_UNUSED,
154 SpiceUsbDevice *device G_GNUC_UNUSED,
155 GError *error, VirtViewerSessionSpice *self)
156 {
157 if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
158 return;
159
160 g_signal_emit_by_name(self, "session-usb-failed", error->message);
161 }
162
163 static void
164 create_spice_session(VirtViewerSessionSpice *self)
165 {
166 SpiceUsbDeviceManager *manager;
167
168 g_return_if_fail(self != NULL);
169 g_return_if_fail(self->priv->session == NULL);
170
171 self->priv->session = spice_session_new();
172 spice_set_session_option(self->priv->session);
173
174 self->priv->gtk_session = spice_gtk_session_get(self->priv->session);
175 g_object_set(self->priv->gtk_session, "auto-clipboard", TRUE, NULL);
176
177 g_signal_connect(self->priv->session, "channel-new",
178 G_CALLBACK(virt_viewer_session_spice_channel_new), self);
179 g_signal_connect(self->priv->session, "channel-destroy",
180 G_CALLBACK(virt_viewer_session_spice_channel_destroy), self);
181
182 manager = spice_usb_device_manager_get(self->priv->session, NULL);
183 if (manager)
184 g_signal_connect(manager, "auto-connect-failed",
185 G_CALLBACK(usb_connect_failed), self);
186
187 g_object_bind_property(self, "auto-usbredir",
188 self->priv->gtk_session, "auto-usbredir",
189 G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
91190 }
92191
93192 static void
94193 virt_viewer_session_spice_close(VirtViewerSession *session)
95194 {
96 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
97
98 g_return_if_fail(self != NULL);
99
100 virt_viewer_session_clear_displays(session);
101
102 if (self->priv->session) {
103 spice_session_disconnect(self->priv->session);
104 g_object_unref(self->priv->session);
105
106 if (self->priv->audio)
107 g_object_unref(self->priv->audio);
108 self->priv->audio = NULL;
109 }
110
111 self->priv->session = spice_session_new();
112 g_signal_connect(self->priv->session, "channel-new",
113 G_CALLBACK(virt_viewer_session_spice_channel_new), self);
114 g_signal_connect(self->priv->session, "channel-destroy",
115 G_CALLBACK(virt_viewer_session_spice_channel_destroy), self);
116
195 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
196
197 g_return_if_fail(self != NULL);
198
199 virt_viewer_session_clear_displays(session);
200
201 if (self->priv->session) {
202 spice_session_disconnect(self->priv->session);
203 g_object_unref(self->priv->session);
204 self->priv->session = NULL;
205 self->priv->gtk_session = NULL;
206
207 if (self->priv->audio)
208 g_object_unref(self->priv->audio);
209 self->priv->audio = NULL;
210 }
211
212 /* FIXME: version 0.7 of spice-gtk allows reuse of session */
213 create_spice_session(self);
117214 }
118215
119216 static gboolean
120217 virt_viewer_session_spice_open_host(VirtViewerSession *session,
121 char *host,
122 char *port)
123 {
124 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
125
126 g_return_val_if_fail(self != NULL, FALSE);
127 g_return_val_if_fail(self->priv->session != NULL, FALSE);
128
129 g_object_set(self->priv->session,
130 "host", host,
131 "port", port,
132 NULL);
133
134 return spice_session_connect(self->priv->session);
218 const gchar *host,
219 const gchar *port,
220 const gchar *tlsport)
221 {
222 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
223
224 g_return_val_if_fail(self != NULL, FALSE);
225 g_return_val_if_fail(self->priv->session != NULL, FALSE);
226
227 g_object_set(self->priv->session,
228 "host", host,
229 "port", port,
230 "tls-port", tlsport,
231 NULL);
232
233 return spice_session_connect(self->priv->session);
234 }
235
236 static gboolean
237 virt_viewer_session_spice_open_uri(VirtViewerSession *session,
238 const gchar *uri)
239 {
240 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
241
242 g_return_val_if_fail(self != NULL, FALSE);
243 g_return_val_if_fail(self->priv->session != NULL, FALSE);
244
245 g_object_set(self->priv->session, "uri", uri, NULL);
246
247 return spice_session_connect(self->priv->session);
135248 }
136249
137250 static gboolean
138251 virt_viewer_session_spice_open_fd(VirtViewerSession *session,
139 int fd)
140 {
141 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
142
143 g_return_val_if_fail(self != NULL, FALSE);
144
145 return spice_session_open_fd(self->priv->session, fd);
252 int fd)
253 {
254 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
255
256 g_return_val_if_fail(self != NULL, FALSE);
257
258 return spice_session_open_fd(self->priv->session, fd);
146259 }
147260
148261 static gboolean
149262 virt_viewer_session_spice_channel_open_fd(VirtViewerSession *session,
150 VirtViewerSessionChannel *channel,
151 int fd)
152 {
153 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
154
155 g_return_val_if_fail(self != NULL, FALSE);
156
157 return spice_channel_open_fd(SPICE_CHANNEL(channel), fd);
263 VirtViewerSessionChannel *channel,
264 int fd)
265 {
266 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
267
268 g_return_val_if_fail(self != NULL, FALSE);
269
270 return spice_channel_open_fd(SPICE_CHANNEL(channel), fd);
158271 }
159272
160273 static void
161274 virt_viewer_session_spice_channel_open_fd_request(SpiceChannel *channel,
162 gint tls G_GNUC_UNUSED,
163 VirtViewerSession *session)
164 {
165 g_signal_emit_by_name(session, "session-channel-open", channel);
275 gint tls G_GNUC_UNUSED,
276 VirtViewerSession *session)
277 {
278 g_signal_emit_by_name(session, "session-channel-open", channel);
166279 }
167280
168281 static void
169282 virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED,
170 SpiceChannelEvent event,
171 VirtViewerSession *session)
172 {
173 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
174 char *password = NULL;
175
176 g_return_if_fail(self != NULL);
177
178 switch (event) {
179 case SPICE_CHANNEL_OPENED:
180 DEBUG_LOG("main channel: opened");
181 break;
182 case SPICE_CHANNEL_CLOSED:
183 DEBUG_LOG("main channel: closed");
184 g_signal_emit_by_name(session, "session-disconnected");
185 break;
186 case SPICE_CHANNEL_ERROR_CONNECT:
187 DEBUG_LOG("main channel: failed to connect");
188 g_signal_emit_by_name(session, "session-disconnected");
189 break;
190 case SPICE_CHANNEL_ERROR_AUTH:
191 DEBUG_LOG("main channel: auth failure (wrong password?)");
192 int ret = virt_viewer_auth_collect_credentials("SPICE",
193 NULL,
194 NULL, &password);
195 if (ret < 0) {
196 g_signal_emit_by_name(session, "session-auth-refused",
197 _("Unable to collect credentials"));
198 } else {
199 g_object_set(self->priv->session, "password", password, NULL);
200 spice_session_connect(self->priv->session);
201 }
202 break;
203 default:
204 g_message("unhandled spice main channel event: %d", event);
205 g_signal_emit_by_name(session, "session-disconnected");
206 break;
207 }
208
209 g_free(password);
210 }
211
283 SpiceChannelEvent event,
284 VirtViewerSession *session)
285 {
286 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
287 gchar *password = NULL;
288
289 g_return_if_fail(self != NULL);
290
291 switch (event) {
292 case SPICE_CHANNEL_OPENED:
293 DEBUG_LOG("main channel: opened");
294 break;
295 case SPICE_CHANNEL_CLOSED:
296 DEBUG_LOG("main channel: closed");
297 g_signal_emit_by_name(session, "session-disconnected");
298 break;
299 case SPICE_CHANNEL_ERROR_CONNECT:
300 DEBUG_LOG("main channel: failed to connect");
301 g_signal_emit_by_name(session, "session-disconnected");
302 break;
303 case SPICE_CHANNEL_ERROR_AUTH:
304 DEBUG_LOG("main channel: auth failure (wrong password?)");
305 int ret = virt_viewer_auth_collect_credentials(self->priv->main_window,
306 "SPICE",
307 NULL,
308 NULL, &password);
309 if (ret < 0) {
310 g_signal_emit_by_name(session, "session-cancelled");
311 } else {
312 g_object_set(self->priv->session, "password", password, NULL);
313 spice_session_connect(self->priv->session);
314 }
315 break;
316 default:
317 g_message("unhandled spice main channel event: %d", event);
318 g_signal_emit_by_name(session, "session-disconnected");
319 break;
320 }
321
322 g_free(password);
323 }
324
325 static gboolean
326 virt_viewer_session_spice_has_usb(VirtViewerSession *session)
327 {
328 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
329 VirtViewerSessionSpicePrivate *priv = self->priv;
330
331 return spice_usb_device_manager_get(priv->session, NULL) &&
332 spice_session_has_channel_type(priv->session,
333 SPICE_CHANNEL_USBREDIR);
334 }
335
336 static void
337 virt_viewer_session_spice_usb_device_selection(VirtViewerSession *session,
338 GtkWindow *parent)
339 {
340 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
341 VirtViewerSessionSpicePrivate *priv = self->priv;
342 GtkWidget *dialog, *area, *usb_device_widget;
343
344 /* Create the widgets */
345 dialog = gtk_dialog_new_with_buttons(
346 _("Select USB devices for redirection"), parent,
347 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
348 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
349 NULL);
350 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
351 area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
352
353 usb_device_widget = spice_usb_device_widget_new(priv->session,
354 "%s %s");
355 g_signal_connect(usb_device_widget, "connect-failed",
356 G_CALLBACK(usb_connect_failed), self);
357 gtk_box_pack_start(GTK_BOX(area), usb_device_widget, TRUE, TRUE, 5);
358
359 /* show and run */
360 gtk_widget_show_all(dialog);
361 gtk_dialog_run(GTK_DIALOG(dialog));
362 gtk_widget_destroy(dialog);
363 }
212364
213365 static void
214366 virt_viewer_session_spice_channel_new(SpiceSession *s,
215 SpiceChannel *channel,
216 VirtViewerSession *session)
217 {
218 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
219 int id;
220
221 g_return_if_fail(self != NULL);
222
223 g_signal_connect(channel, "open-fd",
224 G_CALLBACK(virt_viewer_session_spice_channel_open_fd_request), self);
225
226 g_object_get(channel, "channel-id", &id, NULL);
227
228 if (SPICE_IS_MAIN_CHANNEL(channel)) {
229 g_signal_connect(channel, "channel-event",
230 G_CALLBACK(virt_viewer_session_spice_main_channel_event), self);
231 }
232
233 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
234 GtkWidget *display;
235
236 g_signal_emit_by_name(session, "session-connected");
237
238 DEBUG_LOG("new session channel (#%d)", id);
239 display = virt_viewer_display_spice_new(channel,
240 spice_display_new(s, id));
241
242 virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session),
243 VIRT_VIEWER_DISPLAY(display));
244
245 g_signal_emit_by_name(session, "session-initialized");
246 }
247
248 if (SPICE_IS_INPUTS_CHANNEL(channel)) {
249 DEBUG_LOG("new inputs channel");
250 }
251
252 if (SPICE_IS_PLAYBACK_CHANNEL(channel)) {
253 DEBUG_LOG("new audio channel");
254 if (self->priv->audio != NULL)
255 return;
256 self->priv->audio = spice_audio_new(s, NULL, NULL);
257 }
367 SpiceChannel *channel,
368 VirtViewerSession *session)
369 {
370 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
371 int id;
372
373 g_return_if_fail(self != NULL);
374
375 g_signal_connect(channel, "open-fd",
376 G_CALLBACK(virt_viewer_session_spice_channel_open_fd_request), self);
377
378 g_object_get(channel, "channel-id", &id, NULL);
379
380 if (SPICE_IS_MAIN_CHANNEL(channel)) {
381 if (self->priv->main_channel != NULL) {
382 /* FIXME: use telepathy-glib g_signal_connect_object to automatically disconnect.. */
383 g_signal_handlers_disconnect_by_func(self->priv->main_channel,
384 virt_viewer_session_spice_main_channel_event, self);
385 g_object_unref(self->priv->main_channel);
386 }
387
388 g_signal_connect(channel, "channel-event",
389 G_CALLBACK(virt_viewer_session_spice_main_channel_event), self);
390 self->priv->main_channel = g_object_ref(channel);
391 }
392
393 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
394 GtkWidget *display;
395
396 g_signal_emit_by_name(session, "session-connected");
397
398 DEBUG_LOG("new session channel (#%d)", id);
399 display = virt_viewer_display_spice_new(self,
400 channel,
401 spice_display_new(s, id));
402
403 virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session),
404 VIRT_VIEWER_DISPLAY(display));
405
406 g_signal_emit_by_name(session, "session-initialized");
407 }
408
409 if (SPICE_IS_INPUTS_CHANNEL(channel)) {
410 DEBUG_LOG("new inputs channel");
411 }
412
413 if (SPICE_IS_PLAYBACK_CHANNEL(channel)) {
414 DEBUG_LOG("new audio channel");
415 if (self->priv->audio != NULL)
416 return;
417 self->priv->audio = spice_audio_new(s, NULL, NULL);
418 }
258419 }
259420
260421 static void
261422 virt_viewer_session_spice_channel_destroy(G_GNUC_UNUSED SpiceSession *s,
262 SpiceChannel *channel,
263 VirtViewerSession *session)
264 {
265 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
266 int id;
267
268 g_return_if_fail(self != NULL);
269
270 g_object_get(channel, "channel-id", &id, NULL);
271 if (SPICE_IS_MAIN_CHANNEL(channel)) {
272 DEBUG_LOG("zap main channel");
273 }
274
275 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
276 DEBUG_LOG("zap session channel (#%d)", id);
277 }
278
279 if (SPICE_IS_PLAYBACK_CHANNEL(channel) && self->priv->audio) {
280 DEBUG_LOG("zap audio channel");
281 g_object_unref(self->priv->audio);
282 self->priv->audio = NULL;
283 }
423 SpiceChannel *channel,
424 VirtViewerSession *session)
425 {
426 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
427 int id;
428
429 g_return_if_fail(self != NULL);
430
431 g_object_get(channel, "channel-id", &id, NULL);
432 if (SPICE_IS_MAIN_CHANNEL(channel)) {
433 DEBUG_LOG("zap main channel");
434 if (channel == SPICE_CHANNEL(self->priv->main_channel)) {
435 g_object_unref(self->priv->main_channel);
436 self->priv->main_channel = NULL;
437 }
438 }
439
440 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
441 DEBUG_LOG("zap session channel (#%d)", id);
442 }
443
444 if (SPICE_IS_PLAYBACK_CHANNEL(channel) && self->priv->audio) {
445 DEBUG_LOG("zap audio channel");
446 g_object_unref(self->priv->audio);
447 self->priv->audio = NULL;
448 }
284449 }
285450
286451 VirtViewerSession *
287 virt_viewer_session_spice_new(void)
288 {
289 VirtViewerSessionSpice *self;
290
291 self = g_object_new(VIRT_VIEWER_TYPE_SESSION_SPICE, NULL);
292
293 self->priv->session = spice_session_new();
294 g_signal_connect(self->priv->session, "channel-new",
295 G_CALLBACK(virt_viewer_session_spice_channel_new), self);
296 g_signal_connect(self->priv->session, "channel-destroy",
297 G_CALLBACK(virt_viewer_session_spice_channel_destroy), self);
298
299 return VIRT_VIEWER_SESSION(self);
452 virt_viewer_session_spice_new(GtkWindow *main_window)
453 {
454 VirtViewerSessionSpice *self;
455
456 self = g_object_new(VIRT_VIEWER_TYPE_SESSION_SPICE, NULL);
457
458 create_spice_session(self);
459 self->priv->main_window = g_object_ref(main_window);
460
461 return VIRT_VIEWER_SESSION(self);
462 }
463
464 SpiceMainChannel*
465 virt_viewer_session_spice_get_main_channel(VirtViewerSessionSpice *self)
466 {
467 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION_SPICE(self), NULL);
468
469 return self->priv->main_channel;
300470 }
301471
302472 /*
303473 * Local variables:
304 * c-indent-level: 8
305 * c-basic-offset: 8
306 * tab-width: 8
307 * indent-tabs-mode: t
474 * c-indent-level: 4
475 * c-basic-offset: 4
476 * indent-tabs-mode: nil
308477 * End:
309478 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3333
3434 #define VIRT_VIEWER_TYPE_SESSION_SPICE virt_viewer_session_spice_get_type()
3535
36 #define VIRT_VIEWER_SESSION_SPICE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpice))
36 #define VIRT_VIEWER_SESSION_SPICE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpice))
3838
39 #define VIRT_VIEWER_SESSION_SPICE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass))
39 #define VIRT_VIEWER_SESSION_SPICE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass))
4141
42 #define VIRT_VIEWER_IS_SESSION_SPICE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE))
42 #define VIRT_VIEWER_IS_SESSION_SPICE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE))
4444
45 #define VIRT_VIEWER_IS_SESSION_SPICE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE))
45 #define VIRT_VIEWER_IS_SESSION_SPICE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE))
4747
48 #define VIRT_VIEWER_SESSION_SPICE_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass))
48 #define VIRT_VIEWER_SESSION_SPICE_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass))
5050
5151 typedef struct _VirtViewerSessionSpice VirtViewerSessionSpice;
5252 typedef struct _VirtViewerSessionSpiceClass VirtViewerSessionSpiceClass;
5353 typedef struct _VirtViewerSessionSpicePrivate VirtViewerSessionSpicePrivate;
5454
5555 struct _VirtViewerSessionSpice {
56 VirtViewerSession parent;
56 VirtViewerSession parent;
5757
58 VirtViewerSessionSpicePrivate *priv;
58 VirtViewerSessionSpicePrivate *priv;
5959 };
6060
6161 struct _VirtViewerSessionSpiceClass {
62 VirtViewerSessionClass parent_class;
62 VirtViewerSessionClass parent_class;
6363 };
6464
6565 GType virt_viewer_session_spice_get_type(void);
6666
67 VirtViewerSession* virt_viewer_session_spice_new(void);
67 VirtViewerSession* virt_viewer_session_spice_new(GtkWindow *main_window);
68 SpiceMainChannel* virt_viewer_session_spice_get_main_channel(VirtViewerSessionSpice *self);
6869
6970 G_END_DECLS
7071
7172 #endif /* _VIRT_VIEWER_SESSION_SPICE_H */
72
7373 /*
7474 * Local variables:
75 * c-indent-level: 8
76 * c-basic-offset: 8
77 * tab-width: 8
75 * c-indent-level: 4
76 * c-basic-offset: 4
77 * indent-tabs-mode: nil
7878 * End:
7979 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
2121 * Author: Daniel P. Berrange <berrange@redhat.com>
2222 */
2323
24 #include <config.h>
25
2426 #include "virt-viewer-auth.h"
2527 #include "virt-viewer-session-vnc.h"
2628 #include "virt-viewer-display-vnc.h"
2729
2830 #include <glib/gi18n.h>
31 #include <libxml/uri.h>
2932
3033 G_DEFINE_TYPE(VirtViewerSessionVnc, virt_viewer_session_vnc, VIRT_VIEWER_TYPE_SESSION)
3134
3235 struct _VirtViewerSessionVncPrivate {
33 /* XXX we should really just have a VncConnection */
34 VncDisplay *vnc;
36 GtkWindow *main_window;
37 /* XXX we should really just have a VncConnection */
38 VncDisplay *vnc;
3539 };
3640
3741 #define VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncPrivate))
3842
3943 static void virt_viewer_session_vnc_close(VirtViewerSession* session);
4044 static gboolean virt_viewer_session_vnc_open_fd(VirtViewerSession* session, int fd);
41 static gboolean virt_viewer_session_vnc_open_host(VirtViewerSession* session, char *host, char *port);
45 static gboolean virt_viewer_session_vnc_open_host(VirtViewerSession* session, const gchar *host, const gchar *port, const gchar *tlsport);
46 static gboolean virt_viewer_session_vnc_open_uri(VirtViewerSession* session, const gchar *uri);
4247 static gboolean virt_viewer_session_vnc_channel_open_fd(VirtViewerSession* session,
43 VirtViewerSessionChannel* channel, int fd);
48 VirtViewerSessionChannel* channel, int fd);
4449
4550
4651 static void
4752 virt_viewer_session_vnc_finalize(GObject *obj)
4853 {
49 VirtViewerSessionVnc *vnc = VIRT_VIEWER_SESSION_VNC(obj);
50
51 if (vnc->priv->vnc) {
52 vnc_display_close(vnc->priv->vnc);
53 g_object_unref(vnc->priv->vnc);
54 }
55
56 G_OBJECT_CLASS(virt_viewer_session_vnc_parent_class)->finalize(obj);
54 VirtViewerSessionVnc *vnc = VIRT_VIEWER_SESSION_VNC(obj);
55
56 if (vnc->priv->vnc) {
57 vnc_display_close(vnc->priv->vnc);
58 g_object_unref(vnc->priv->vnc);
59 }
60 if (vnc->priv->main_window)
61 g_object_unref(vnc->priv->main_window);
62
63 G_OBJECT_CLASS(virt_viewer_session_vnc_parent_class)->finalize(obj);
5764 }
5865
5966
6067 static void
6168 virt_viewer_session_vnc_class_init(VirtViewerSessionVncClass *klass)
6269 {
63 VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass);
64 GObjectClass *oclass = G_OBJECT_CLASS(klass);
65
66 oclass->finalize = virt_viewer_session_vnc_finalize;
67
68 dclass->close = virt_viewer_session_vnc_close;
69 dclass->open_fd = virt_viewer_session_vnc_open_fd;
70 dclass->open_host = virt_viewer_session_vnc_open_host;
71 dclass->channel_open_fd = virt_viewer_session_vnc_channel_open_fd;
72
73 g_type_class_add_private(oclass, sizeof(VirtViewerSessionVncPrivate));
70 VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass);
71 GObjectClass *oclass = G_OBJECT_CLASS(klass);
72
73 oclass->finalize = virt_viewer_session_vnc_finalize;
74
75 dclass->close = virt_viewer_session_vnc_close;
76 dclass->open_fd = virt_viewer_session_vnc_open_fd;
77 dclass->open_host = virt_viewer_session_vnc_open_host;
78 dclass->open_uri = virt_viewer_session_vnc_open_uri;
79 dclass->channel_open_fd = virt_viewer_session_vnc_channel_open_fd;
80
81 g_type_class_add_private(klass, sizeof(VirtViewerSessionVncPrivate));
7482 }
7583
7684 static void
7785 virt_viewer_session_vnc_init(VirtViewerSessionVnc *self G_GNUC_UNUSED)
7886 {
79 self->priv = VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(self);
87 self->priv = VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(self);
8088 }
8189
8290 static void
8391 virt_viewer_session_vnc_connected(VncDisplay *vnc G_GNUC_UNUSED,
84 VirtViewerSessionVnc *session)
85 {
86 GtkWidget *display = virt_viewer_display_vnc_new(session->priv->vnc);
87 g_signal_emit_by_name(session, "session-connected");
88 virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(display),
89 VIRT_VIEWER_DISPLAY_SHOW_HINT_READY);
90 virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session),
91 VIRT_VIEWER_DISPLAY(display));
92 VirtViewerSessionVnc *session)
93 {
94 GtkWidget *display = virt_viewer_display_vnc_new(session->priv->vnc);
95 g_signal_emit_by_name(session, "session-connected");
96 virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(display),
97 VIRT_VIEWER_DISPLAY_SHOW_HINT_READY);
98 virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session),
99 VIRT_VIEWER_DISPLAY(display));
92100 }
93101
94102 static void
95103 virt_viewer_session_vnc_disconnected(VncDisplay *vnc G_GNUC_UNUSED,
96 VirtViewerSessionVnc *session)
97 {
98 g_signal_emit_by_name(session, "session-disconnected");
99 /* TODO perhaps? */
100 /* virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(session->priv->vnc), */
101 /* VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE); */
104 VirtViewerSessionVnc *session)
105 {
106 g_signal_emit_by_name(session, "session-disconnected");
107 /* TODO perhaps? */
108 /* virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(session->priv->vnc), */
109 /* VIRT_VIEWER_DISPLAY_SHOW_HINT_HIDE); */
102110 }
103111
104112 static void
105113 virt_viewer_session_vnc_initialized(VncDisplay *vnc G_GNUC_UNUSED,
106 VirtViewerSessionVnc *session)
107 {
108 g_signal_emit_by_name(session, "session-initialized");
114 VirtViewerSessionVnc *session)
115 {
116 g_signal_emit_by_name(session, "session-initialized");
109117 }
110118
111119 static void
112120 virt_viewer_session_vnc_cut_text(VncDisplay *vnc G_GNUC_UNUSED,
113 const char *text,
114 VirtViewerSession *session)
115 {
116 g_signal_emit_by_name(session, "session-cut-text", text);
121 const gchar *text,
122 VirtViewerSession *session)
123 {
124 g_signal_emit_by_name(session, "session-cut-text", text);
117125 }
118126
119127 static void
120128 virt_viewer_session_vnc_bell(VncDisplay *vnc G_GNUC_UNUSED,
121 VirtViewerSession *session)
122 {
123 g_signal_emit_by_name(session, "session-bell");
129 VirtViewerSession *session)
130 {
131 g_signal_emit_by_name(session, "session-bell");
124132 }
125133
126134 static void
127135 virt_viewer_session_vnc_auth_unsupported(VncDisplay *vnc G_GNUC_UNUSED,
128 unsigned int authType,
129 VirtViewerSession *session)
130 {
131 char *msg = g_strdup_printf(_("Unsupported authentication type %d"),
132 authType);
133 g_signal_emit_by_name(session, "session-auth-failed", msg);
134 g_free(msg);
136 unsigned int authType,
137 VirtViewerSession *session)
138 {
139 gchar *msg = g_strdup_printf(_("Unsupported authentication type %d"),
140 authType);
141 g_signal_emit_by_name(session, "session-auth-failed", msg);
142 g_free(msg);
135143 }
136144
137145 static void
138146 virt_viewer_session_vnc_auth_failure(VncDisplay *vnc G_GNUC_UNUSED,
139 const char *reason,
140 VirtViewerSession *session)
141 {
142
143 g_signal_emit_by_name(session, "session-auth-refused", reason);
147 const gchar *reason,
148 VirtViewerSession *session)
149 {
150
151 g_signal_emit_by_name(session, "session-auth-refused", reason);
144152 }
145153
146154
147155
148156 static gboolean
149157 virt_viewer_session_vnc_open_fd(VirtViewerSession* session,
150 int fd)
151 {
152 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
153
154 g_return_val_if_fail(self != NULL, FALSE);
155 g_return_val_if_fail(self->priv->vnc != NULL, FALSE);
156
157 return vnc_display_open_fd(self->priv->vnc, fd);
158 int fd)
159 {
160 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
161
162 g_return_val_if_fail(self != NULL, FALSE);
163 g_return_val_if_fail(self->priv->vnc != NULL, FALSE);
164
165 return vnc_display_open_fd(self->priv->vnc, fd);
158166 }
159167
160168 static gboolean
161169 virt_viewer_session_vnc_channel_open_fd(VirtViewerSession* session G_GNUC_UNUSED,
162 VirtViewerSessionChannel* channel G_GNUC_UNUSED,
163 int fd G_GNUC_UNUSED)
164 {
165 g_warning("channel_open_fd is not supported by VNC");
166 return FALSE;
170 VirtViewerSessionChannel* channel G_GNUC_UNUSED,
171 int fd G_GNUC_UNUSED)
172 {
173 g_warning("channel_open_fd is not supported by VNC");
174 return FALSE;
167175 }
168176
169177 static gboolean
170178 virt_viewer_session_vnc_open_host(VirtViewerSession* session,
171 char *host,
172 char *port)
173 {
174 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
175
176 g_return_val_if_fail(self != NULL, FALSE);
177 g_return_val_if_fail(self->priv->vnc != NULL, FALSE);
178
179 return vnc_display_open_host(self->priv->vnc, host, port);
180 }
179 const gchar *host,
180 const gchar *port,
181 const gchar *tlsport G_GNUC_UNUSED)
182 {
183 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
184
185 g_return_val_if_fail(self != NULL, FALSE);
186 g_return_val_if_fail(self->priv->vnc != NULL, FALSE);
187
188 return vnc_display_open_host(self->priv->vnc, host, port);
189 }
190
191 static gboolean
192 virt_viewer_session_vnc_open_uri(VirtViewerSession* session,
193 const gchar *uristr)
194 {
195 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
196 xmlURIPtr uri = NULL;
197 gchar *portstr;
198 gboolean ret;
199
200 g_return_val_if_fail(self != NULL, FALSE);
201 g_return_val_if_fail(self->priv->vnc != NULL, FALSE);
202
203 if (!(uri = xmlParseURI(uristr)))
204 return FALSE;
205
206 portstr = g_strdup_printf("%d", uri->port);
207
208 ret = vnc_display_open_host(self->priv->vnc, uri->server, portstr);
209 g_free(portstr);
210 xmlFreeURI(uri);
211 return ret;
212 }
213
214
215 static void
216 virt_viewer_session_vnc_auth_credential(GtkWidget *src,
217 GValueArray *credList,
218 VirtViewerSession *session)
219 {
220 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
221
222 virt_viewer_auth_vnc_credentials(self->priv->main_window,
223 src,
224 credList,
225 NULL);
226 }
227
181228
182229 static void
183230 virt_viewer_session_vnc_close(VirtViewerSession* session)
184231 {
185 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
186
187 g_return_if_fail(self != NULL);
188
189 if (self->priv->vnc != NULL) {
190 virt_viewer_session_clear_displays(session);
191 vnc_display_close(self->priv->vnc);
192 g_object_unref(self->priv->vnc);
193 }
194
195 self->priv->vnc = VNC_DISPLAY(vnc_display_new());
196
197 g_signal_connect(self->priv->vnc, "vnc-connected",
198 G_CALLBACK(virt_viewer_session_vnc_connected), session);
199 g_signal_connect(self->priv->vnc, "vnc-initialized",
200 G_CALLBACK(virt_viewer_session_vnc_initialized), session);
201 g_signal_connect(self->priv->vnc, "vnc-disconnected",
202 G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
203
204 g_signal_connect(self->priv->vnc, "vnc-bell",
205 G_CALLBACK(virt_viewer_session_vnc_bell), session);
206 g_signal_connect(self->priv->vnc, "vnc-auth-failure",
207 G_CALLBACK(virt_viewer_session_vnc_auth_failure), session);
208 g_signal_connect(self->priv->vnc, "vnc-auth-unsupported",
209 G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session);
210 g_signal_connect(self->priv->vnc, "vnc-server-cut-text",
211 G_CALLBACK(virt_viewer_session_vnc_cut_text), session);
212
213 g_signal_connect(self->priv->vnc, "vnc-auth-credential",
214 G_CALLBACK(virt_viewer_auth_vnc_credentials), NULL);
215
216 }
232 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
233
234 g_return_if_fail(self != NULL);
235
236 if (self->priv->vnc != NULL) {
237 virt_viewer_session_clear_displays(session);
238 vnc_display_close(self->priv->vnc);
239 g_object_unref(self->priv->vnc);
240 }
241
242 self->priv->vnc = VNC_DISPLAY(vnc_display_new());
243
244 g_signal_connect(self->priv->vnc, "vnc-connected",
245 G_CALLBACK(virt_viewer_session_vnc_connected), session);
246 g_signal_connect(self->priv->vnc, "vnc-initialized",
247 G_CALLBACK(virt_viewer_session_vnc_initialized), session);
248 g_signal_connect(self->priv->vnc, "vnc-disconnected",
249 G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
250
251 g_signal_connect(self->priv->vnc, "vnc-bell",
252 G_CALLBACK(virt_viewer_session_vnc_bell), session);
253 g_signal_connect(self->priv->vnc, "vnc-auth-failure",
254 G_CALLBACK(virt_viewer_session_vnc_auth_failure), session);
255 g_signal_connect(self->priv->vnc, "vnc-auth-unsupported",
256 G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session);
257 g_signal_connect(self->priv->vnc, "vnc-server-cut-text",
258 G_CALLBACK(virt_viewer_session_vnc_cut_text), session);
259
260 g_signal_connect(self->priv->vnc, "vnc-auth-credential",
261 G_CALLBACK(virt_viewer_session_vnc_auth_credential), session);
262
263 }
217264
218265 VirtViewerSession *
219 virt_viewer_session_vnc_new(void)
220 {
221 VirtViewerSessionVnc *session;
222
223 session = g_object_new(VIRT_VIEWER_TYPE_SESSION_VNC, NULL);
224
225 session->priv->vnc = VNC_DISPLAY(vnc_display_new());
226
227 g_signal_connect(session->priv->vnc, "vnc-connected",
228 G_CALLBACK(virt_viewer_session_vnc_connected), session);
229 g_signal_connect(session->priv->vnc, "vnc-initialized",
230 G_CALLBACK(virt_viewer_session_vnc_initialized), session);
231 g_signal_connect(session->priv->vnc, "vnc-disconnected",
232 G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
233
234 g_signal_connect(session->priv->vnc, "vnc-bell",
235 G_CALLBACK(virt_viewer_session_vnc_bell), session);
236 g_signal_connect(session->priv->vnc, "vnc-auth-failure",
237 G_CALLBACK(virt_viewer_session_vnc_auth_failure), session);
238 g_signal_connect(session->priv->vnc, "vnc-auth-unsupported",
239 G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session);
240 g_signal_connect(session->priv->vnc, "vnc-server-cut-text",
241 G_CALLBACK(virt_viewer_session_vnc_cut_text), session);
242
243 g_signal_connect(session->priv->vnc, "vnc-auth-credential",
244 G_CALLBACK(virt_viewer_auth_vnc_credentials), NULL);
245
246 return VIRT_VIEWER_SESSION(session);
247 }
248
249
250
266 virt_viewer_session_vnc_new(GtkWindow *main_window)
267 {
268 VirtViewerSessionVnc *session;
269
270 session = g_object_new(VIRT_VIEWER_TYPE_SESSION_VNC, NULL);
271
272 session->priv->vnc = VNC_DISPLAY(vnc_display_new());
273 session->priv->main_window = g_object_ref(main_window);
274
275 g_signal_connect(session->priv->vnc, "vnc-connected",
276 G_CALLBACK(virt_viewer_session_vnc_connected), session);
277 g_signal_connect(session->priv->vnc, "vnc-initialized",
278 G_CALLBACK(virt_viewer_session_vnc_initialized), session);
279 g_signal_connect(session->priv->vnc, "vnc-disconnected",
280 G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
281
282 g_signal_connect(session->priv->vnc, "vnc-bell",
283 G_CALLBACK(virt_viewer_session_vnc_bell), session);
284 g_signal_connect(session->priv->vnc, "vnc-auth-failure",
285 G_CALLBACK(virt_viewer_session_vnc_auth_failure), session);
286 g_signal_connect(session->priv->vnc, "vnc-auth-unsupported",
287 G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session);
288 g_signal_connect(session->priv->vnc, "vnc-server-cut-text",
289 G_CALLBACK(virt_viewer_session_vnc_cut_text), session);
290
291 g_signal_connect(session->priv->vnc, "vnc-auth-credential",
292 G_CALLBACK(virt_viewer_session_vnc_auth_credential), session);
293
294 return VIRT_VIEWER_SESSION(session);
295 }
251296
252297 /*
253298 * Local variables:
254 * c-indent-level: 8
255 * c-basic-offset: 8
256 * tab-width: 8
299 * c-indent-level: 4
300 * c-basic-offset: 4
301 * indent-tabs-mode: nil
257302 * End:
258303 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3232
3333 #define VIRT_VIEWER_TYPE_SESSION_VNC virt_viewer_session_vnc_get_type()
3434
35 #define VIRT_VIEWER_SESSION_VNC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVnc))
35 #define VIRT_VIEWER_SESSION_VNC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVnc))
3737
38 #define VIRT_VIEWER_SESSION_VNC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass))
38 #define VIRT_VIEWER_SESSION_VNC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass))
4040
41 #define VIRT_VIEWER_IS_SESSION_VNC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_VNC))
41 #define VIRT_VIEWER_IS_SESSION_VNC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_VNC))
4343
44 #define VIRT_VIEWER_IS_SESSION_VNC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_VNC))
44 #define VIRT_VIEWER_IS_SESSION_VNC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_VNC))
4646
47 #define VIRT_VIEWER_SESSION_VNC_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass))
47 #define VIRT_VIEWER_SESSION_VNC_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass))
4949
5050 typedef struct _VirtViewerSessionVnc VirtViewerSessionVnc;
5151 typedef struct _VirtViewerSessionVncClass VirtViewerSessionVncClass;
5252 typedef struct _VirtViewerSessionVncPrivate VirtViewerSessionVncPrivate;
5353
5454 struct _VirtViewerSessionVnc {
55 VirtViewerSession parent;
55 VirtViewerSession parent;
5656
57 VirtViewerSessionVncPrivate *priv;
57 VirtViewerSessionVncPrivate *priv;
5858 };
5959
6060 struct _VirtViewerSessionVncClass {
61 VirtViewerSessionClass parent_class;
61 VirtViewerSessionClass parent_class;
6262 };
6363
6464 GType virt_viewer_session_vnc_get_type(void);
6565
66 VirtViewerSession *virt_viewer_session_vnc_new(void);
66 VirtViewerSession *virt_viewer_session_vnc_new(GtkWindow *main_window);
6767
6868 G_END_DECLS
6969
7070 #endif /* _VIRT_VIEWER_SESSION_VNC_H */
71
7271 /*
7372 * Local variables:
74 * c-indent-level: 8
75 * c-basic-offset: 8
76 * tab-width: 8
73 * c-indent-level: 4
74 * c-basic-offset: 4
75 * indent-tabs-mode: nil
7776 * End:
7877 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3333
3434 struct _VirtViewerSessionPrivate
3535 {
36 GList *displays;
36 GList *displays;
37
38 gboolean auto_usbredir;
3739 };
3840
3941 G_DEFINE_ABSTRACT_TYPE(VirtViewerSession, virt_viewer_session, G_TYPE_OBJECT)
4042
43 enum {
44 PROP_0,
45
46 PROP_AUTO_USBREDIR,
47 };
48
4149 static void
4250 virt_viewer_session_finalize(GObject *obj)
4351 {
44 VirtViewerSession *session = VIRT_VIEWER_SESSION(obj);
45 GList *tmp = session->priv->displays;
46
47 while (tmp) {
48 g_object_unref(tmp->data);
49 tmp = tmp->next;
50 }
51 g_list_free(session->priv->displays);
52
53 G_OBJECT_CLASS(virt_viewer_session_parent_class)->finalize(obj);
52 VirtViewerSession *session = VIRT_VIEWER_SESSION(obj);
53 GList *tmp = session->priv->displays;
54
55 while (tmp) {
56 g_object_unref(tmp->data);
57 tmp = tmp->next;
58 }
59 g_list_free(session->priv->displays);
60
61 G_OBJECT_CLASS(virt_viewer_session_parent_class)->finalize(obj);
62 }
63
64 static void
65 virt_viewer_session_set_property(GObject *object,
66 guint prop_id,
67 const GValue *value,
68 GParamSpec *pspec)
69 {
70 VirtViewerSession *self = VIRT_VIEWER_SESSION(object);
71
72 switch (prop_id) {
73 case PROP_AUTO_USBREDIR:
74 virt_viewer_session_set_auto_usbredir(self, g_value_get_boolean(value));
75 break;
76 default:
77 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
78 break;
79 }
80 }
81
82 static void
83 virt_viewer_session_get_property(GObject *object,
84 guint prop_id,
85 GValue *value,
86 GParamSpec *pspec)
87 {
88 VirtViewerSession *self = VIRT_VIEWER_SESSION(object);
89
90 switch (prop_id) {
91 case PROP_AUTO_USBREDIR:
92 g_value_set_boolean(value, virt_viewer_session_get_auto_usbredir(self));
93 break;
94 default:
95 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
96 break;
97 }
5498 }
5599
56100 static void
57101 virt_viewer_session_class_init(VirtViewerSessionClass *class)
58102 {
59 GObjectClass *object_class = G_OBJECT_CLASS(class);
60
61 object_class->finalize = virt_viewer_session_finalize;
62
63 g_signal_new("session-connected",
64 G_OBJECT_CLASS_TYPE(object_class),
65 G_SIGNAL_RUN_FIRST,
66 G_STRUCT_OFFSET(VirtViewerSessionClass, session_connected),
67 NULL, NULL,
68 g_cclosure_marshal_VOID__VOID,
69 G_TYPE_NONE,
70 0);
71
72 g_signal_new("session-initialized",
73 G_OBJECT_CLASS_TYPE(object_class),
74 G_SIGNAL_RUN_FIRST,
75 G_STRUCT_OFFSET(VirtViewerSessionClass, session_initialized),
76 NULL, NULL,
77 g_cclosure_marshal_VOID__VOID,
78 G_TYPE_NONE,
79 0);
80
81 g_signal_new("session-disconnected",
82 G_OBJECT_CLASS_TYPE(object_class),
83 G_SIGNAL_RUN_FIRST,
84 G_STRUCT_OFFSET(VirtViewerSessionClass, session_disconnected),
85 NULL, NULL,
86 g_cclosure_marshal_VOID__VOID,
87 G_TYPE_NONE,
88 0);
89
90 g_signal_new("session-channel-open",
91 G_OBJECT_CLASS_TYPE(object_class),
92 G_SIGNAL_RUN_FIRST,
93 G_STRUCT_OFFSET(VirtViewerSessionClass, session_channel_open),
94 NULL, NULL,
95 g_cclosure_marshal_VOID__OBJECT,
96 G_TYPE_NONE,
97 1,
98 G_TYPE_OBJECT);
99
100 g_signal_new("session-auth-refused",
101 G_OBJECT_CLASS_TYPE(object_class),
102 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
103 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_refused),
104 NULL,
105 NULL,
106 g_cclosure_marshal_VOID__STRING,
107 G_TYPE_NONE,
108 1,
109 G_TYPE_STRING);
110
111 g_signal_new("session-auth-failed",
112 G_OBJECT_CLASS_TYPE(object_class),
113 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
114 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_failed),
115 NULL,
116 NULL,
117 g_cclosure_marshal_VOID__STRING,
118 G_TYPE_NONE,
119 1,
120 G_TYPE_STRING);
121
122
123 g_signal_new("session-display-added",
124 G_OBJECT_CLASS_TYPE(object_class),
125 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
126 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_added),
127 NULL,
128 NULL,
129 g_cclosure_marshal_VOID__OBJECT,
130 G_TYPE_NONE,
131 1,
132 VIRT_VIEWER_TYPE_DISPLAY);
133
134 g_signal_new("session-display-removed",
135 G_OBJECT_CLASS_TYPE(object_class),
136 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
137 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_removed),
138 NULL,
139 NULL,
140 g_cclosure_marshal_VOID__OBJECT,
141 G_TYPE_NONE,
142 1,
143 VIRT_VIEWER_TYPE_DISPLAY);
144
145 g_signal_new("session-cut-text",
146 G_OBJECT_CLASS_TYPE(object_class),
147 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
148 G_STRUCT_OFFSET(VirtViewerSessionClass, session_cut_text),
149 NULL,
150 NULL,
151 g_cclosure_marshal_VOID__STRING,
152 G_TYPE_NONE,
153 1,
154 G_TYPE_STRING);
155
156 g_signal_new("session-bell",
157 G_OBJECT_CLASS_TYPE(object_class),
158 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
159 G_STRUCT_OFFSET(VirtViewerSessionClass, session_bell),
160 NULL,
161 NULL,
162 g_cclosure_marshal_VOID__VOID,
163 G_TYPE_NONE,
164 0);
165
166 g_type_class_add_private(object_class, sizeof(VirtViewerSessionPrivate));
103 GObjectClass *object_class = G_OBJECT_CLASS(class);
104
105 object_class->set_property = virt_viewer_session_set_property;
106 object_class->get_property = virt_viewer_session_get_property;
107 object_class->finalize = virt_viewer_session_finalize;
108
109 g_object_class_install_property(object_class,
110 PROP_AUTO_USBREDIR,
111 g_param_spec_boolean("auto-usbredir",
112 "USB redirection",
113 "USB redirection",
114 TRUE,
115 G_PARAM_READWRITE |
116 G_PARAM_CONSTRUCT |
117 G_PARAM_STATIC_STRINGS));
118
119 g_signal_new("session-connected",
120 G_OBJECT_CLASS_TYPE(object_class),
121 G_SIGNAL_RUN_FIRST,
122 G_STRUCT_OFFSET(VirtViewerSessionClass, session_connected),
123 NULL, NULL,
124 g_cclosure_marshal_VOID__VOID,
125 G_TYPE_NONE,
126 0);
127
128 g_signal_new("session-initialized",
129 G_OBJECT_CLASS_TYPE(object_class),
130 G_SIGNAL_RUN_FIRST,
131 G_STRUCT_OFFSET(VirtViewerSessionClass, session_initialized),
132 NULL, NULL,
133 g_cclosure_marshal_VOID__VOID,
134 G_TYPE_NONE,
135 0);
136
137 g_signal_new("session-disconnected",
138 G_OBJECT_CLASS_TYPE(object_class),
139 G_SIGNAL_RUN_FIRST,
140 G_STRUCT_OFFSET(VirtViewerSessionClass, session_disconnected),
141 NULL, NULL,
142 g_cclosure_marshal_VOID__VOID,
143 G_TYPE_NONE,
144 0);
145
146 g_signal_new("session-channel-open",
147 G_OBJECT_CLASS_TYPE(object_class),
148 G_SIGNAL_RUN_FIRST,
149 G_STRUCT_OFFSET(VirtViewerSessionClass, session_channel_open),
150 NULL, NULL,
151 g_cclosure_marshal_VOID__OBJECT,
152 G_TYPE_NONE,
153 1,
154 G_TYPE_OBJECT);
155
156 g_signal_new("session-auth-refused",
157 G_OBJECT_CLASS_TYPE(object_class),
158 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
159 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_refused),
160 NULL,
161 NULL,
162 g_cclosure_marshal_VOID__STRING,
163 G_TYPE_NONE,
164 1,
165 G_TYPE_STRING);
166
167 g_signal_new("session-auth-failed",
168 G_OBJECT_CLASS_TYPE(object_class),
169 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
170 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_failed),
171 NULL,
172 NULL,
173 g_cclosure_marshal_VOID__STRING,
174 G_TYPE_NONE,
175 1,
176 G_TYPE_STRING);
177
178 g_signal_new("session-usb-failed",
179 G_OBJECT_CLASS_TYPE(object_class),
180 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
181 G_STRUCT_OFFSET(VirtViewerSessionClass, session_usb_failed),
182 NULL,
183 NULL,
184 g_cclosure_marshal_VOID__STRING,
185 G_TYPE_NONE,
186 1,
187 G_TYPE_STRING);
188
189 g_signal_new("session-display-added",
190 G_OBJECT_CLASS_TYPE(object_class),
191 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
192 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_added),
193 NULL,
194 NULL,
195 g_cclosure_marshal_VOID__OBJECT,
196 G_TYPE_NONE,
197 1,
198 VIRT_VIEWER_TYPE_DISPLAY);
199
200 g_signal_new("session-display-removed",
201 G_OBJECT_CLASS_TYPE(object_class),
202 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
203 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_removed),
204 NULL,
205 NULL,
206 g_cclosure_marshal_VOID__OBJECT,
207 G_TYPE_NONE,
208 1,
209 VIRT_VIEWER_TYPE_DISPLAY);
210
211 g_signal_new("session-cut-text",
212 G_OBJECT_CLASS_TYPE(object_class),
213 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
214 G_STRUCT_OFFSET(VirtViewerSessionClass, session_cut_text),
215 NULL,
216 NULL,
217 g_cclosure_marshal_VOID__STRING,
218 G_TYPE_NONE,
219 1,
220 G_TYPE_STRING);
221
222 g_signal_new("session-bell",
223 G_OBJECT_CLASS_TYPE(object_class),
224 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
225 G_STRUCT_OFFSET(VirtViewerSessionClass, session_bell),
226 NULL,
227 NULL,
228 g_cclosure_marshal_VOID__VOID,
229 G_TYPE_NONE,
230 0);
231
232 g_signal_new("session-cancelled",
233 G_OBJECT_CLASS_TYPE(object_class),
234 G_SIGNAL_RUN_FIRST,
235 G_STRUCT_OFFSET(VirtViewerSessionClass, session_cancelled),
236 NULL, NULL,
237 g_cclosure_marshal_VOID__VOID,
238 G_TYPE_NONE,
239 0);
240
241 g_type_class_add_private(class, sizeof(VirtViewerSessionPrivate));
167242 }
168243
169244 static void
170245 virt_viewer_session_init(VirtViewerSession *session)
171246 {
172 session->priv = VIRT_VIEWER_SESSION_GET_PRIVATE(session);
247 session->priv = VIRT_VIEWER_SESSION_GET_PRIVATE(session);
173248 }
174249
175250 GtkWidget*
176251 virt_viewer_session_new(void)
177252 {
178 return g_object_new(VIRT_VIEWER_TYPE_SESSION, NULL);
253 return g_object_new(VIRT_VIEWER_TYPE_SESSION, NULL);
179254 }
180255
181256
182257 void virt_viewer_session_add_display(VirtViewerSession *session,
183 VirtViewerDisplay *display)
184 {
185 session->priv->displays = g_list_append(session->priv->displays, display);
186 g_object_ref(display);
187 g_signal_emit_by_name(session, "session-display-added", display);
258 VirtViewerDisplay *display)
259 {
260 session->priv->displays = g_list_append(session->priv->displays, display);
261 g_object_ref(display);
262 g_signal_emit_by_name(session, "session-display-added", display);
188263 }
189264
190265
191266 void virt_viewer_session_remove_display(VirtViewerSession *session,
192 VirtViewerDisplay *display)
193 {
194 if (!g_list_find(session->priv->displays, display))
195 return;
196
197 session->priv->displays = g_list_remove(session->priv->displays, display);
198 g_signal_emit_by_name(session, "session-display-removed", display);
199 g_object_unref(display);
267 VirtViewerDisplay *display)
268 {
269 if (!g_list_find(session->priv->displays, display))
270 return;
271
272 session->priv->displays = g_list_remove(session->priv->displays, display);
273 g_signal_emit_by_name(session, "session-display-removed", display);
274 g_object_unref(display);
200275 }
201276
202277 void virt_viewer_session_clear_displays(VirtViewerSession *session)
203278 {
204 GList *tmp = session->priv->displays;
205
206 while (tmp) {
207 g_signal_emit_by_name(session, "session-display-removed", tmp->data);
208 g_object_unref(tmp->data);
209 tmp = tmp->next;
210 }
211 g_list_free(session->priv->displays);
212 session->priv->displays = NULL;
279 GList *tmp = session->priv->displays;
280
281 while (tmp) {
282 g_signal_emit_by_name(session, "session-display-removed", tmp->data);
283 g_object_unref(tmp->data);
284 tmp = tmp->next;
285 }
286 g_list_free(session->priv->displays);
287 session->priv->displays = NULL;
213288 }
214289
215290
216291
217292 void virt_viewer_session_close(VirtViewerSession *session)
218293 {
219 g_return_if_fail(VIRT_VIEWER_IS_SESSION(session));
220
221 VIRT_VIEWER_SESSION_GET_CLASS(session)->close(session);
294 g_return_if_fail(VIRT_VIEWER_IS_SESSION(session));
295
296 VIRT_VIEWER_SESSION_GET_CLASS(session)->close(session);
222297 }
223298
224299 gboolean virt_viewer_session_open_fd(VirtViewerSession *session, int fd)
225300 {
226 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
227
228 return VIRT_VIEWER_SESSION_GET_CLASS(session)->open_fd(session, fd);
229 }
230
231 gboolean virt_viewer_session_open_host(VirtViewerSession *session, char *host, char *port)
232 {
233 VirtViewerSessionClass *klass;
234
235 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
236
237 klass = VIRT_VIEWER_SESSION_GET_CLASS(session);
238 return klass->open_host(session, host, port);
301 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
302
303 return VIRT_VIEWER_SESSION_GET_CLASS(session)->open_fd(session, fd);
304 }
305
306 gboolean virt_viewer_session_open_host(VirtViewerSession *session, const gchar *host, const gchar *port, const gchar *tlsport)
307 {
308 VirtViewerSessionClass *klass;
309
310 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
311
312 klass = VIRT_VIEWER_SESSION_GET_CLASS(session);
313 return klass->open_host(session, host, port, tlsport);
314 }
315
316 gboolean virt_viewer_session_open_uri(VirtViewerSession *session, const gchar *uri)
317 {
318 VirtViewerSessionClass *klass;
319
320 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
321
322 klass = VIRT_VIEWER_SESSION_GET_CLASS(session);
323 g_return_val_if_fail(klass->open_uri != NULL, FALSE);
324
325 return klass->open_uri(session, uri);
239326 }
240327
241328 gboolean virt_viewer_session_channel_open_fd(VirtViewerSession *session,
242 VirtViewerSessionChannel *channel, int fd)
243 {
244 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
245
246 return VIRT_VIEWER_SESSION_GET_CLASS(session)->channel_open_fd(session, channel, fd);
329 VirtViewerSessionChannel *channel, int fd)
330 {
331 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
332
333 return VIRT_VIEWER_SESSION_GET_CLASS(session)->channel_open_fd(session, channel, fd);
334 }
335
336 void virt_viewer_session_set_auto_usbredir(VirtViewerSession *self, gboolean auto_usbredir)
337 {
338 g_return_if_fail(VIRT_VIEWER_IS_SESSION(self));
339
340 if (self->priv->auto_usbredir == auto_usbredir)
341 return;
342
343 self->priv->auto_usbredir = auto_usbredir;
344 g_object_notify(G_OBJECT(self), "auto-usbredir");
345 }
346
347 gboolean virt_viewer_session_get_auto_usbredir(VirtViewerSession *self)
348 {
349 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(self), FALSE);
350
351 return self->priv->auto_usbredir;
352 }
353
354 gboolean virt_viewer_session_has_usb(VirtViewerSession *self)
355 {
356 VirtViewerSessionClass *klass;
357
358 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(self), FALSE);
359
360 klass = VIRT_VIEWER_SESSION_GET_CLASS(self);
361 if (klass->has_usb == NULL)
362 return FALSE;
363
364 return klass->has_usb(self);
365 }
366
367 void virt_viewer_session_usb_device_selection(VirtViewerSession *self,
368 GtkWindow *parent)
369 {
370 VirtViewerSessionClass *klass;
371
372 g_return_if_fail(VIRT_VIEWER_IS_SESSION(self));
373
374 klass = VIRT_VIEWER_SESSION_GET_CLASS(self);
375 g_return_if_fail(klass->usb_device_selection != NULL);
376
377 klass->usb_device_selection(self, parent);
247378 }
248379
249380 /*
250381 * Local variables:
251 * c-indent-level: 8
252 * c-basic-offset: 8
253 * tab-width: 8
382 * c-indent-level: 4
383 * c-basic-offset: 4
384 * indent-tabs-mode: nil
254385 * End:
255386 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3131
3232 #define VIRT_VIEWER_TYPE_SESSION virt_viewer_session_get_type()
3333
34 #define VIRT_VIEWER_SESSION(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSession))
34 #define VIRT_VIEWER_SESSION(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSession))
3636
37 #define VIRT_VIEWER_SESSION_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass))
37 #define VIRT_VIEWER_SESSION_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass))
3939
4040 #define VIRT_VIEWER_IS_SESSION(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION))
41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION))
4242
4343 #define VIRT_VIEWER_IS_SESSION_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION))
44 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION))
4545
46 #define VIRT_VIEWER_SESSION_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass))
46 #define VIRT_VIEWER_SESSION_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass))
4848
49 typedef struct _VirtViewerSession VirtViewerSession;
50 typedef struct _VirtViewerSessionClass VirtViewerSessionClass;
5149 typedef struct _VirtViewerSessionPrivate VirtViewerSessionPrivate;
5250
5351 typedef struct _VirtViewerSessionChannel VirtViewerSessionChannel;
5553
5654 /* perhaps this become an interface, and be pushed in gtkvnc and spice? */
5755 struct _VirtViewerSession {
58 GObject parent;
56 GObject parent;
5957
60 VirtViewerSessionPrivate *priv;
58 VirtViewerSessionPrivate *priv;
6159 };
6260
6361 struct _VirtViewerSessionClass {
64 GObjectClass parent_class;
62 GObjectClass parent_class;
6563
66 /* virtual methods */
67 void (* close) (VirtViewerSession* session);
68 gboolean (* open_fd) (VirtViewerSession* session, int fd);
69 gboolean (* open_host) (VirtViewerSession* session, char *host, char *port);
70 gboolean (* channel_open_fd) (VirtViewerSession* session, VirtViewerSessionChannel *channel, int fd);
64 /* virtual methods */
65 void (* close) (VirtViewerSession* session);
66 gboolean (* open_fd) (VirtViewerSession* session, int fd);
67 gboolean (* open_host) (VirtViewerSession* session, const gchar *host, const gchar *port, const gchar *tlsport);
68 gboolean (* open_uri) (VirtViewerSession* session, const gchar *uri);
69 gboolean (* channel_open_fd) (VirtViewerSession* session, VirtViewerSessionChannel *channel, int fd);
70 gboolean (* has_usb) (VirtViewerSession* session);
71 void (* usb_device_selection) (VirtViewerSession* session, GtkWindow *parent);
7172
72 /* signals */
73 void (*session_connected)(VirtViewerSession *session);
74 void (*session_initialized)(VirtViewerSession *session);
75 void (*session_disconnected)(VirtViewerSession *session);
76 void (*session_auth_refused)(VirtViewerSession *session, const char *msg);
77 void (*session_auth_failed)(VirtViewerSession *session, const char *msg);
73 /* signals */
74 void (*session_connected)(VirtViewerSession *session);
75 void (*session_initialized)(VirtViewerSession *session);
76 void (*session_disconnected)(VirtViewerSession *session);
77 void (*session_auth_refused)(VirtViewerSession *session, const gchar *msg);
78 void (*session_auth_failed)(VirtViewerSession *session, const gchar *msg);
79 void (*session_usb_failed)(VirtViewerSession *session, const gchar *msg);
7880
79 void (*session_channel_open)(VirtViewerSession *session, VirtViewerSessionChannel *channel);
81 void (*session_channel_open)(VirtViewerSession *session, VirtViewerSessionChannel *channel);
8082
81 void (*session_display_added)(VirtViewerSession *session,
82 VirtViewerDisplay *display);
83 void (*session_display_removed)(VirtViewerSession *session,
84 VirtViewerDisplay *display);
83 void (*session_display_added)(VirtViewerSession *session,
84 VirtViewerDisplay *display);
85 void (*session_display_removed)(VirtViewerSession *session,
86 VirtViewerDisplay *display);
8587
86 void (*session_cut_text)(VirtViewerSession *session, const char *str);
87 void (*session_bell)(VirtViewerSession *session);
88 void (*session_cut_text)(VirtViewerSession *session, const gchar *str);
89 void (*session_bell)(VirtViewerSession *session);
90 void (*session_cancelled)(VirtViewerSession *session);
8891 };
8992
9093 GType virt_viewer_session_get_type(void);
9295 GtkWidget *virt_viewer_session_new(void);
9396
9497 void virt_viewer_session_add_display(VirtViewerSession *session,
95 VirtViewerDisplay *display);
98 VirtViewerDisplay *display);
9699 void virt_viewer_session_remove_display(VirtViewerSession *session,
97 VirtViewerDisplay *display);
100 VirtViewerDisplay *display);
98101 void virt_viewer_session_clear_displays(VirtViewerSession *session);
99102
100103 void virt_viewer_session_close(VirtViewerSession* session);
101104 gboolean virt_viewer_session_open_fd(VirtViewerSession* session, int fd);
102 gboolean virt_viewer_session_open_host(VirtViewerSession* session, char *host, char *port);
105 gboolean virt_viewer_session_open_host(VirtViewerSession* session, const gchar *host, const gchar *port, const gchar *tlsport);
103106 GObject* virt_viewer_session_get(VirtViewerSession* session);
104107 gboolean virt_viewer_session_channel_open_fd(VirtViewerSession* session,
105 VirtViewerSessionChannel* channel, int fd);
108 VirtViewerSessionChannel* channel, int fd);
109 gboolean virt_viewer_session_open_uri(VirtViewerSession *session, const gchar *uri);
110
111 void virt_viewer_session_set_auto_usbredir(VirtViewerSession* session, gboolean auto_usbredir);
112 gboolean virt_viewer_session_get_auto_usbredir(VirtViewerSession* session);
113
114 gboolean virt_viewer_session_has_usb(VirtViewerSession *self);
115 void virt_viewer_session_usb_device_selection(VirtViewerSession *self,
116 GtkWindow *parent);
106117
107118 G_END_DECLS
108119
109120 #endif /* _VIRT_VIEWER_SESSION_H */
121
110122 /*
111123 * Local variables:
112 * c-indent-level: 8
113 * c-basic-offset: 8
114 * tab-width: 8
124 * c-indent-level: 4
125 * c-basic-offset: 4
126 * indent-tabs-mode: nil
115127 * End:
116128 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 *
66 * This program is free software; you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
3333
3434 GtkBuilder *virt_viewer_util_load_ui(const char *name)
3535 {
36 struct stat sb;
37 GtkBuilder *builder;
38 GError *error = NULL;
36 struct stat sb;
37 GtkBuilder *builder;
38 GError *error = NULL;
3939
40 builder = gtk_builder_new();
41 if (stat(name, &sb) >= 0) {
42 gtk_builder_add_from_file(builder, name, &error);
43 } else {
44 const gchar * const * dirs = g_get_system_data_dirs();
45 g_return_val_if_fail(dirs != NULL, NULL);
40 builder = gtk_builder_new();
41 if (stat(name, &sb) >= 0) {
42 gtk_builder_add_from_file(builder, name, &error);
43 } else {
44 const gchar * const * dirs = g_get_system_data_dirs();
45 g_return_val_if_fail(dirs != NULL, NULL);
4646
47 while (dirs[0] != NULL) {
48 gchar *path = g_build_filename(dirs[0], PACKAGE, "ui", name, NULL);
49 if (gtk_builder_add_from_file(builder, path, NULL) != 0) {
50 g_free(path);
51 break;
52 }
53 g_free(path);
54 dirs++;
55 }
56 if (dirs[0] == NULL)
57 goto failed;
58 }
47 while (dirs[0] != NULL) {
48 gchar *path = g_build_filename(dirs[0], PACKAGE, "ui", name, NULL);
49 if (gtk_builder_add_from_file(builder, path, NULL) != 0) {
50 g_free(path);
51 break;
52 }
53 g_free(path);
54 dirs++;
55 }
56 if (dirs[0] == NULL)
57 goto failed;
58 }
5959
60 if (error) {
61 g_error("Cannot load UI description %s: %s", name,
62 error->message);
63 g_clear_error(&error);
64 goto failed;
65 }
60 if (error) {
61 g_error("Cannot load UI description %s: %s", name,
62 error->message);
63 g_clear_error(&error);
64 goto failed;
65 }
6666
67 return builder;
68 failed:
69 g_error("failed to find UI description file");
70 g_object_unref(builder);
71 return NULL;
67 return builder;
68 failed:
69 g_error("failed to find UI description file");
70 g_object_unref(builder);
71 return NULL;
7272 }
7373
7474 int
7979 char **user,
8080 int *port)
8181 {
82 xmlURIPtr uri;
83 char *offset;
82 xmlURIPtr uri;
83 char *offset;
8484
85 if (uristr == NULL ||
86 !g_strcasecmp(uristr, "xen"))
87 uristr = "xen:///";
85 if (uristr == NULL ||
86 !g_ascii_strcasecmp(uristr, "xen"))
87 uristr = "xen:///";
8888
89 uri = xmlParseURI(uristr);
90 g_return_val_if_fail(uri != NULL, 1);
89 uri = xmlParseURI(uristr);
90 g_return_val_if_fail(uri != NULL, 1);
9191
92 if (host) {
93 if (!uri || !uri->server)
94 *host = g_strdup("localhost");
95 else
96 *host = g_strdup(uri->server);
97 }
92 if (host) {
93 if (!uri || !uri->server)
94 *host = g_strdup("localhost");
95 else
96 *host = g_strdup(uri->server);
97 }
9898
99 if (user) {
100 if (uri->user)
101 *user = g_strdup(uri->user);
102 else
103 *user = NULL;
104 }
99 if (user) {
100 if (uri->user)
101 *user = g_strdup(uri->user);
102 else
103 *user = NULL;
104 }
105105
106 if (port)
107 *port = uri->port;
106 if (port)
107 *port = uri->port;
108108
109 offset = strchr(uri->scheme, '+');
109 offset = strchr(uri->scheme, '+');
110110
111 if (transport) {
112 if (offset)
113 *transport = g_strdup(offset+1);
114 else
115 *transport = NULL;
116 }
111 if (transport) {
112 if (offset)
113 *transport = g_strdup(offset+1);
114 else
115 *transport = NULL;
116 }
117117
118 if (scheme) {
119 if (offset)
120 *scheme = g_strndup(uri->scheme, offset - uri->scheme);
121 else
122 *scheme = g_strdup(uri->scheme);
123 }
118 if (scheme) {
119 if (offset)
120 *scheme = g_strndup(uri->scheme, offset - uri->scheme);
121 else
122 *scheme = g_strdup(uri->scheme);
123 }
124124
125 xmlFreeURI(uri);
126 return 0;
125 xmlFreeURI(uri);
126 return 0;
127127 }
128128
129129 /*
130130 * Local variables:
131 * c-indent-level: 8
132 * c-basic-offset: 8
133 * tab-width: 8
131 * c-indent-level: 4
132 * c-basic-offset: 4
133 * indent-tabs-mode: nil
134134 * End:
135135 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 *
66 * This program is free software; you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
4040 int *port);
4141
4242 #endif
43
44 /*
45 * Local variables:
46 * c-indent-level: 4
47 * c-basic-offset: 4
48 * indent-tabs-mode: nil
49 * End:
50 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
5050 void virt_viewer_window_menu_view_resize(GtkWidget *menu, VirtViewerWindow *self);
5151 void virt_viewer_window_menu_send(GtkWidget *menu, VirtViewerWindow *self);
5252 void virt_viewer_window_menu_file_screenshot(GtkWidget *menu, VirtViewerWindow *self);
53 void virt_viewer_window_menu_file_usb_device_selection(GtkWidget *menu, VirtViewerWindow *self);
5354
5455 /* Internal methods */
5556 static void virt_viewer_window_enable_modifiers(VirtViewerWindow *self);
5960
6061 G_DEFINE_TYPE (VirtViewerWindow, virt_viewer_window, G_TYPE_OBJECT)
6162
62 #define GET_PRIVATE(o) \
63 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowPrivate))
63 #define GET_PRIVATE(o) \
64 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowPrivate))
6465
6566 enum {
66 PROP_0,
67 PROP_WINDOW,
68 PROP_DISPLAY,
69 PROP_SUBTITLE,
70 PROP_CONTAINER,
71 PROP_APP,
67 PROP_0,
68 PROP_WINDOW,
69 PROP_DISPLAY,
70 PROP_SUBTITLE,
71 PROP_CONTAINER,
72 PROP_APP,
7273 };
7374
7475 enum menuNums {
75 FILE_MENU,
76 VIEW_MENU,
77 SEND_KEY_MENU,
78 HELP_MENU,
79 LAST_MENU // sentinel
76 FILE_MENU,
77 VIEW_MENU,
78 SEND_KEY_MENU,
79 HELP_MENU,
80 LAST_MENU // sentinel
8081 };
8182
8283 struct _VirtViewerWindowPrivate {
83 VirtViewerApp *app;
84 GtkContainer *container; /* if any, then there is no window */
85
86 GtkBuilder *builder;
87 GtkWidget *window;
88 GtkWidget *layout;
89 GtkWidget *toolbar;
90 VirtViewerNotebook *notebook;
91 VirtViewerDisplay *display;
92
93 gboolean accel_enabled;
94 GValue accel_setting;
95 GSList *accel_list;
96 int accel_menu_sig[LAST_MENU];
97 gboolean grabbed;
98 gboolean before_saved;
99 GdkRectangle before_fullscreen;
100
101 gint zoomlevel;
102 gboolean auto_resize;
103 gboolean fullscreen;
104 gchar *subtitle;
84 VirtViewerApp *app;
85 GtkContainer *container; /* if any, then there is no window */
86
87 GtkBuilder *builder;
88 GtkWidget *window;
89 GtkWidget *layout;
90 GtkWidget *toolbar;
91 VirtViewerNotebook *notebook;
92 VirtViewerDisplay *display;
93
94 gboolean accel_enabled;
95 GValue accel_setting;
96 GSList *accel_list;
97 int accel_menu_sig[LAST_MENU];
98 gboolean grabbed;
99 gboolean before_saved;
100 GdkRectangle before_fullscreen;
101
102 gint zoomlevel;
103 gboolean auto_resize;
104 gboolean fullscreen;
105 gchar *subtitle;
105106 };
106107
107108 #if GTK_CHECK_VERSION(3, 0, 0)
126127
127128 static void
128129 virt_viewer_window_get_property (GObject *object, guint property_id,
129 GValue *value, GParamSpec *pspec)
130 {
131 VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv;
132
133 switch (property_id) {
134 case PROP_SUBTITLE:
135 g_value_set_string(value, priv->subtitle);
136 break;
137
138 case PROP_WINDOW:
139 g_value_set_object(value, priv->window);
140 break;
141
142 case PROP_DISPLAY:
143 g_value_set_object(value, priv->display);
144 break;
145
146 case PROP_CONTAINER:
147 g_value_set_object(value, priv->container);
148 break;
149
150 case PROP_APP:
151 g_value_set_object(value, priv->app);
152 break;
153
154 default:
155 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
156 }
130 GValue *value, GParamSpec *pspec)
131 {
132 VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv;
133
134 switch (property_id) {
135 case PROP_SUBTITLE:
136 g_value_set_string(value, priv->subtitle);
137 break;
138
139 case PROP_WINDOW:
140 g_value_set_object(value, priv->window);
141 break;
142
143 case PROP_DISPLAY:
144 g_value_set_object(value, priv->display);
145 break;
146
147 case PROP_CONTAINER:
148 g_value_set_object(value, priv->container);
149 break;
150
151 case PROP_APP:
152 g_value_set_object(value, priv->app);
153 break;
154
155 default:
156 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
157 }
157158 }
158159
159160 static void
160161 virt_viewer_window_set_property (GObject *object, guint property_id,
161 const GValue *value, GParamSpec *pspec)
162 {
163 VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv;
164
165 switch (property_id) {
166 case PROP_SUBTITLE:
167 g_free(priv->subtitle);
168 priv->subtitle = g_value_dup_string(value);
169 virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(object));
170 break;
171
172 case PROP_CONTAINER:
173 g_return_if_fail(priv->container == NULL);
174 priv->container = g_value_dup_object(value);
175 break;
176
177 case PROP_APP:
178 g_return_if_fail(priv->app == NULL);
179 priv->app = g_value_dup_object(value);
180 break;
181
182 default:
183 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
184 }
162 const GValue *value, GParamSpec *pspec)
163 {
164 VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv;
165
166 switch (property_id) {
167 case PROP_SUBTITLE:
168 g_free(priv->subtitle);
169 priv->subtitle = g_value_dup_string(value);
170 virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(object));
171 break;
172
173 case PROP_CONTAINER:
174 g_return_if_fail(priv->container == NULL);
175 priv->container = g_value_dup_object(value);
176 break;
177
178 case PROP_APP:
179 g_return_if_fail(priv->app == NULL);
180 priv->app = g_value_dup_object(value);
181 break;
182
183 default:
184 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
185 }
185186 }
186187
187188 static void
188189 virt_viewer_window_dispose (GObject *object)
189190 {
190 VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv;
191 G_OBJECT_CLASS (virt_viewer_window_parent_class)->dispose (object);
192
193 if (priv->display) {
194 g_object_unref(priv->display);
195 priv->display = NULL;
196 }
197
198 if (priv->app) {
199 g_object_unref(priv->app);
200 priv->app = NULL;
201 }
202
203 g_free(priv->subtitle);
204 priv->subtitle = NULL;
191 VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv;
192 G_OBJECT_CLASS (virt_viewer_window_parent_class)->dispose (object);
193
194 if (priv->display) {
195 g_object_unref(priv->display);
196 priv->display = NULL;
197 }
198
199 if (priv->app) {
200 g_object_unref(priv->app);
201 priv->app = NULL;
202 }
203
204 g_free(priv->subtitle);
205 priv->subtitle = NULL;
205206 }
206207
207208 static void
208209 virt_viewer_window_class_init (VirtViewerWindowClass *klass)
209210 {
210 GObjectClass *object_class = G_OBJECT_CLASS (klass);
211
212 g_type_class_add_private (klass, sizeof (VirtViewerWindowPrivate));
213
214 object_class->get_property = virt_viewer_window_get_property;
215 object_class->set_property = virt_viewer_window_set_property;
216 object_class->dispose = virt_viewer_window_dispose;
217
218 g_object_class_install_property(object_class,
219 PROP_SUBTITLE,
220 g_param_spec_string("subtitle",
221 "Subtitle",
222 "Window subtitle",
223 "",
224 G_PARAM_READABLE |
225 G_PARAM_WRITABLE |
226 G_PARAM_STATIC_STRINGS));
227
228 g_object_class_install_property(object_class,
229 PROP_WINDOW,
230 g_param_spec_object("window",
231 "Window",
232 "GtkWindow",
233 GTK_TYPE_WIDGET,
234 G_PARAM_READABLE |
235 G_PARAM_STATIC_STRINGS));
236
237 g_object_class_install_property(object_class,
238 PROP_DISPLAY,
239 g_param_spec_object("display",
240 "Display",
241 "VirtDisplay",
242 VIRT_VIEWER_TYPE_DISPLAY,
243 G_PARAM_READABLE |
244 G_PARAM_STATIC_STRINGS));
245
246 g_object_class_install_property(object_class,
247 PROP_CONTAINER,
248 g_param_spec_object("container",
249 "Container",
250 "Container widget",
251 VIRT_VIEWER_TYPE_DISPLAY,
252 G_PARAM_READABLE |
253 G_PARAM_WRITABLE |
254 G_PARAM_CONSTRUCT_ONLY |
255 G_PARAM_STATIC_STRINGS));
256
257 g_object_class_install_property(object_class,
258 PROP_APP,
259 g_param_spec_object("app",
260 "App",
261 "VirtViewerApp",
262 VIRT_VIEWER_TYPE_APP,
263 G_PARAM_READABLE |
264 G_PARAM_WRITABLE |
265 G_PARAM_CONSTRUCT_ONLY |
266 G_PARAM_STATIC_STRINGS));
211 GObjectClass *object_class = G_OBJECT_CLASS (klass);
212
213 g_type_class_add_private (klass, sizeof (VirtViewerWindowPrivate));
214
215 object_class->get_property = virt_viewer_window_get_property;
216 object_class->set_property = virt_viewer_window_set_property;
217 object_class->dispose = virt_viewer_window_dispose;
218
219 g_object_class_install_property(object_class,
220 PROP_SUBTITLE,
221 g_param_spec_string("subtitle",
222 "Subtitle",
223 "Window subtitle",
224 "",
225 G_PARAM_READABLE |
226 G_PARAM_WRITABLE |
227 G_PARAM_STATIC_STRINGS));
228
229 g_object_class_install_property(object_class,
230 PROP_WINDOW,
231 g_param_spec_object("window",
232 "Window",
233 "GtkWindow",
234 GTK_TYPE_WIDGET,
235 G_PARAM_READABLE |
236 G_PARAM_STATIC_STRINGS));
237
238 g_object_class_install_property(object_class,
239 PROP_DISPLAY,
240 g_param_spec_object("display",
241 "Display",
242 "VirtDisplay",
243 VIRT_VIEWER_TYPE_DISPLAY,
244 G_PARAM_READABLE |
245 G_PARAM_STATIC_STRINGS));
246
247 g_object_class_install_property(object_class,
248 PROP_CONTAINER,
249 g_param_spec_object("container",
250 "Container",
251 "Container widget",
252 VIRT_VIEWER_TYPE_DISPLAY,
253 G_PARAM_READABLE |
254 G_PARAM_WRITABLE |
255 G_PARAM_CONSTRUCT_ONLY |
256 G_PARAM_STATIC_STRINGS));
257
258 g_object_class_install_property(object_class,
259 PROP_APP,
260 g_param_spec_object("app",
261 "App",
262 "VirtViewerApp",
263 VIRT_VIEWER_TYPE_APP,
264 G_PARAM_READABLE |
265 G_PARAM_WRITABLE |
266 G_PARAM_CONSTRUCT_ONLY |
267 G_PARAM_STATIC_STRINGS));
267268 }
268269
269270 static void
270271 virt_viewer_window_init (VirtViewerWindow *self)
271272 {
272 VirtViewerWindowPrivate *priv;
273 GtkWidget *vbox;
274 GtkWidget *menu;
275 GdkColor color;
276 GSList *accels;
277
278 self->priv = GET_PRIVATE(self);
279 priv = self->priv;
280
281 priv->auto_resize = TRUE;
282 g_value_init(&priv->accel_setting, G_TYPE_STRING);
283
284 priv->notebook = virt_viewer_notebook_new();
285 priv->builder = virt_viewer_util_load_ui("virt-viewer.xml");
286
287 menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-view-resize"));
288 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
289
290 gtk_builder_connect_signals(priv->builder, self);
291
292 vbox = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer-box"));
293 virt_viewer_window_toolbar_setup(self);
294
295 gtk_box_pack_end(GTK_BOX(vbox), priv->layout, TRUE, TRUE, 0);
296 gdk_color_parse("black", &color);
297 gtk_widget_modify_bg(priv->layout, GTK_STATE_NORMAL, &color);
298
299 priv->window = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer"));
300
301 virt_viewer_window_update_title(self);
302 gtk_window_set_resizable(GTK_WINDOW(priv->window), TRUE);
273 VirtViewerWindowPrivate *priv;
274 GtkWidget *vbox;
275 GtkWidget *menu;
276 GdkColor color;
277 GSList *accels;
278
279 self->priv = GET_PRIVATE(self);
280 priv = self->priv;
281
282 priv->auto_resize = TRUE;
283 g_value_init(&priv->accel_setting, G_TYPE_STRING);
284
285 priv->notebook = virt_viewer_notebook_new();
286 priv->builder = virt_viewer_util_load_ui("virt-viewer.xml");
287
288 menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-view-resize"));
289 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
290
291 gtk_builder_connect_signals(priv->builder, self);
292
293 vbox = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer-box"));
294 virt_viewer_window_toolbar_setup(self);
295
296 gtk_box_pack_end(GTK_BOX(vbox), priv->layout, TRUE, TRUE, 0);
297 gdk_color_parse("black", &color);
298 gtk_widget_modify_bg(priv->layout, GTK_STATE_NORMAL, &color);
299
300 priv->window = GTK_WIDGET(gtk_builder_get_object(priv->builder, "viewer"));
301
302 virt_viewer_window_update_title(self);
303 gtk_window_set_resizable(GTK_WINDOW(priv->window), TRUE);
303304 #if GTK_CHECK_VERSION(3, 0, 0)
304 gtk_window_set_has_resize_grip(GTK_WINDOW(priv->window), FALSE);
305 gtk_window_set_has_resize_grip(GTK_WINDOW(priv->window), FALSE);
305306 #endif
306 priv->accel_enabled = TRUE;
307
308 accels = gtk_accel_groups_from_object(G_OBJECT(priv->window));
309 for ( ; accels ; accels = accels->next) {
310 priv->accel_list = g_slist_append(priv->accel_list, accels->data);
311 g_object_ref(G_OBJECT(accels->data));
312 }
313
314 priv->zoomlevel = 100;
307 priv->accel_enabled = TRUE;
308
309 accels = gtk_accel_groups_from_object(G_OBJECT(priv->window));
310 for ( ; accels ; accels = accels->next) {
311 priv->accel_list = g_slist_append(priv->accel_list, accels->data);
312 g_object_ref(G_OBJECT(accels->data));
313 }
314
315 priv->zoomlevel = 100;
315316 }
316317
317318 static void
318319 virt_viewer_window_desktop_resize(VirtViewerDisplay *display G_GNUC_UNUSED,
319 VirtViewerWindow *self)
320 {
321 VirtViewerWindowPrivate *priv = self->priv;
322 if (priv->auto_resize && priv->window && !priv->fullscreen)
323 virt_viewer_window_resize(self);
320 VirtViewerWindow *self)
321 {
322 VirtViewerWindowPrivate *priv = self->priv;
323 if (priv->auto_resize && priv->window && !priv->fullscreen)
324 virt_viewer_window_resize(self);
324325 }
325326
326327
327328 G_MODULE_EXPORT void
328329 virt_viewer_window_menu_view_zoom_out(GtkWidget *menu G_GNUC_UNUSED,
329 VirtViewerWindow *self)
330 {
331 VirtViewerWindowPrivate *priv = self->priv;
332
333 if (priv->zoomlevel > 10)
334 priv->zoomlevel -= 10;
335
336 if (!priv->display)
337 return;
338
339 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
340 if (priv->display)
341 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
330 VirtViewerWindow *self)
331 {
332 VirtViewerWindowPrivate *priv = self->priv;
333
334 if (priv->zoomlevel > 10)
335 priv->zoomlevel -= 10;
336
337 if (!priv->display)
338 return;
339
340 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
341 if (priv->display)
342 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
342343 }
343344
344345 G_MODULE_EXPORT void
345346 virt_viewer_window_menu_view_zoom_in(GtkWidget *menu G_GNUC_UNUSED,
346 VirtViewerWindow *self)
347 {
348 VirtViewerWindowPrivate *priv = self->priv;
349
350 if (priv->zoomlevel < 400)
351 priv->zoomlevel += 10;
352
353 if (!priv->display)
354 return;
355
356 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
357 if (priv->display)
358 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
347 VirtViewerWindow *self)
348 {
349 VirtViewerWindowPrivate *priv = self->priv;
350
351 if (priv->zoomlevel < 400)
352 priv->zoomlevel += 10;
353
354 if (!priv->display)
355 return;
356
357 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
358 if (priv->display)
359 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
359360 }
360361
361362 G_MODULE_EXPORT void
362363 virt_viewer_window_menu_view_zoom_reset(GtkWidget *menu G_GNUC_UNUSED,
363 VirtViewerWindow *self)
364 {
365 VirtViewerWindowPrivate *priv = self->priv;
366 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
367 priv->zoomlevel = 100;
368
369 if (priv->display)
370 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
364 VirtViewerWindow *self)
365 {
366 VirtViewerWindowPrivate *priv = self->priv;
367 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
368 priv->zoomlevel = 100;
369
370 if (priv->display)
371 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
371372 }
372373
373374 /*
379380 static void
380381 virt_viewer_window_resize(VirtViewerWindow *self)
381382 {
382 GdkRectangle fullscreen;
383 GdkScreen *screen;
384 int width, height;
385 double desktopAspect;
386 double screenAspect;
387 guint desktopWidth;
388 guint desktopHeight;
389 VirtViewerWindowPrivate *priv = self->priv;
390
391 DEBUG_LOG("Preparing main window resize");
392 if (!priv->display) {
393 DEBUG_LOG("Skipping inactive resize");
394 return;
395 }
396
397 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
398
399 virt_viewer_display_get_desktop_size(VIRT_VIEWER_DISPLAY(priv->display),
400 &desktopWidth, &desktopHeight);
401
402 screen = gtk_widget_get_screen(priv->window);
403 gdk_screen_get_monitor_geometry(screen,
404 gdk_screen_get_monitor_at_window
405 (screen, gtk_widget_get_window(priv->window)),
406 &fullscreen);
407
408 desktopAspect = (double)desktopWidth / (double)desktopHeight;
409 screenAspect = (double)(fullscreen.width - 128) / (double)(fullscreen.height - 128);
410
411 if ((desktopWidth > (fullscreen.width - 128)) ||
412 (desktopHeight > (fullscreen.height - 128))) {
413 /* Doesn't fit native res, so go as large as possible
414 maintaining aspect ratio */
415 if (screenAspect > desktopAspect) {
416 width = desktopHeight * desktopAspect;
417 height = desktopHeight;
418 } else {
419 width = desktopWidth;
420 height = desktopWidth / desktopAspect;
421 }
422 } else {
423 width = desktopWidth;
424 height = desktopHeight;
425 }
426
427 DEBUG_LOG("Decided todo %dx%d (desktop is %dx%d, fullscreen is %dx%d",
428 width, height, desktopWidth, desktopHeight,
429 fullscreen.width, fullscreen.height);
430
431 virt_viewer_display_set_desktop_size(VIRT_VIEWER_DISPLAY(priv->display),
432 width, height);
383 GdkRectangle fullscreen;
384 GdkScreen *screen;
385 int width, height;
386 double desktopAspect;
387 double screenAspect;
388 guint desktopWidth;
389 guint desktopHeight;
390 VirtViewerWindowPrivate *priv = self->priv;
391
392 DEBUG_LOG("Preparing main window resize");
393 if (!priv->display) {
394 DEBUG_LOG("Skipping inactive resize");
395 return;
396 }
397
398 gtk_window_resize(GTK_WINDOW(priv->window), 1, 1);
399
400 virt_viewer_display_get_desktop_size(VIRT_VIEWER_DISPLAY(priv->display),
401 &desktopWidth, &desktopHeight);
402
403 screen = gtk_widget_get_screen(priv->window);
404 gdk_screen_get_monitor_geometry(screen,
405 gdk_screen_get_monitor_at_window
406 (screen, gtk_widget_get_window(priv->window)),
407 &fullscreen);
408
409 desktopAspect = (double)desktopWidth / (double)desktopHeight;
410 screenAspect = (double)(fullscreen.width - 128) / (double)(fullscreen.height - 128);
411
412 if ((desktopWidth > (fullscreen.width - 128)) ||
413 (desktopHeight > (fullscreen.height - 128))) {
414 /* Doesn't fit native res, so go as large as possible
415 maintaining aspect ratio */
416 if (screenAspect > desktopAspect) {
417 width = desktopHeight * desktopAspect;
418 height = desktopHeight;
419 } else {
420 width = desktopWidth;
421 height = desktopWidth / desktopAspect;
422 }
423 } else {
424 width = desktopWidth;
425 height = desktopHeight;
426 }
427
428 DEBUG_LOG("Decided todo %dx%d (desktop is %dx%d, fullscreen is %dx%d",
429 width, height, desktopWidth, desktopHeight,
430 fullscreen.width, fullscreen.height);
431
432 virt_viewer_display_set_desktop_size(VIRT_VIEWER_DISPLAY(priv->display),
433 width, height);
433434 }
434435
435436 void
436437 virt_viewer_window_leave_fullscreen(VirtViewerWindow *self)
437438 {
438 VirtViewerWindowPrivate *priv = self->priv;
439 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu"));
440 GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen"));
441
442 if (!priv->fullscreen)
443 return;
444
445 gtk_check_menu_item_set_active(check, FALSE);
446 priv->fullscreen = FALSE;
447 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE);
448 gtk_widget_show(menu);
449 gtk_widget_hide(priv->toolbar);
439 VirtViewerWindowPrivate *priv = self->priv;
440 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu"));
441 GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen"));
442
443 if (!priv->fullscreen)
444 return;
445
446 gtk_check_menu_item_set_active(check, FALSE);
447 priv->fullscreen = FALSE;
448 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE);
449 gtk_widget_show(menu);
450 gtk_widget_hide(priv->toolbar);
450451 #ifdef G_OS_WIN32
451 gtk_widget_set_size_request(GTK_WIDGET(priv->window), -1, -1);
452 gtk_widget_set_size_request(GTK_WIDGET(priv->window), -1, -1);
452453 #endif
453 gtk_window_unfullscreen(GTK_WINDOW(priv->window));
454
455 if (priv->before_saved) {
456 gtk_window_move(GTK_WINDOW(priv->window),
457 priv->before_fullscreen.x,
458 priv->before_fullscreen.y);
459 gtk_window_resize(GTK_WINDOW(priv->window),
460 priv->before_fullscreen.width,
461 priv->before_fullscreen.height);
462 priv->before_saved = FALSE;
463 }
454 gtk_window_unfullscreen(GTK_WINDOW(priv->window));
455
456 if (priv->before_saved) {
457 gtk_window_move(GTK_WINDOW(priv->window),
458 priv->before_fullscreen.x,
459 priv->before_fullscreen.y);
460 gtk_window_resize(GTK_WINDOW(priv->window),
461 priv->before_fullscreen.width,
462 priv->before_fullscreen.height);
463 priv->before_saved = FALSE;
464 }
464465 }
465466
466467 void
467468 virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gboolean move, gint x, gint y)
468469 {
469 VirtViewerWindowPrivate *priv = self->priv;
470 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu"));
471 GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen"));
472
473 if (!priv->before_saved) {
474 gtk_window_get_position(GTK_WINDOW(priv->window),
475 &priv->before_fullscreen.x,
476 &priv->before_fullscreen.y);
477 gtk_window_get_size(GTK_WINDOW(priv->window),
478 &priv->before_fullscreen.width,
479 &priv->before_fullscreen.height);
480 priv->before_saved = TRUE;
481 }
482
483 if (!priv->fullscreen) {
484 gtk_check_menu_item_set_active(check, TRUE);
485 priv->fullscreen = TRUE;
486 gtk_widget_hide(menu);
487 gtk_widget_show(priv->toolbar);
488 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), TRUE);
489 ViewAutoDrawer_Close(VIEW_AUTODRAWER(priv->layout));
490 }
491
492 if (move)
493 gtk_window_move(GTK_WINDOW(priv->window), x, y);
494
495 gtk_window_fullscreen(GTK_WINDOW(priv->window));
470 VirtViewerWindowPrivate *priv = self->priv;
471 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "top-menu"));
472 GtkCheckMenuItem *check = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(priv->builder, "menu-view-fullscreen"));
473
474 if (!priv->before_saved) {
475 gtk_window_get_position(GTK_WINDOW(priv->window),
476 &priv->before_fullscreen.x,
477 &priv->before_fullscreen.y);
478 gtk_window_get_size(GTK_WINDOW(priv->window),
479 &priv->before_fullscreen.width,
480 &priv->before_fullscreen.height);
481 priv->before_saved = TRUE;
482 }
483
484 if (!priv->fullscreen) {
485 gtk_check_menu_item_set_active(check, TRUE);
486 priv->fullscreen = TRUE;
487 gtk_widget_hide(menu);
488 gtk_widget_show(priv->toolbar);
489 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), TRUE);
490 ViewAutoDrawer_Close(VIEW_AUTODRAWER(priv->layout));
491 }
492
493 if (move)
494 gtk_window_move(GTK_WINDOW(priv->window), x, y);
495
496 gtk_window_fullscreen(GTK_WINDOW(priv->window));
496497 #ifdef G_OS_WIN32
497 /* on windows, fullscreen doesn't always hide the taskbar
498 See https://bugzilla.gnome.org/show_bug.cgi?id=652049 */
499 gtk_widget_set_size_request(GTK_WIDGET(priv->window),
500 gdk_screen_width(),
501 gdk_screen_height());
498 /* on windows, fullscreen doesn't always hide the taskbar
499 See https://bugzilla.gnome.org/show_bug.cgi?id=652049 */
500 gtk_widget_set_size_request(GTK_WIDGET(priv->window),
501 gdk_screen_width(),
502 gdk_screen_height());
502503 #endif
503504 }
504505
505506 #define MAX_KEY_COMBO 3
506 struct keyComboDef {
507 guint keys[MAX_KEY_COMBO];
508 guint nkeys;
509 const char *label;
507 struct keyComboDef {
508 guint keys[MAX_KEY_COMBO];
509 guint nkeys;
510 const char *label;
510511 };
511512
512513 static const struct keyComboDef keyCombos[] = {
513 { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"},
514 { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"},
515 { {}, 0, "" },
516 { { GDK_Control_L, GDK_Alt_L, GDK_F1 }, 3, "Ctrl+Alt+F_1"},
517 { { GDK_Control_L, GDK_Alt_L, GDK_F2 }, 3, "Ctrl+Alt+F_2"},
518 { { GDK_Control_L, GDK_Alt_L, GDK_F3 }, 3, "Ctrl+Alt+F_3"},
519 { { GDK_Control_L, GDK_Alt_L, GDK_F4 }, 3, "Ctrl+Alt+F_4"},
520 { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_5"},
521 { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F_6"},
522 { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F_7"},
523 { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F_8"},
524 { { GDK_Control_L, GDK_Alt_L, GDK_F9 }, 3, "Ctrl+Alt+F_9"},
525 { { GDK_Control_L, GDK_Alt_L, GDK_F10 }, 3, "Ctrl+Alt+F1_0"},
526 { { GDK_Control_L, GDK_Alt_L, GDK_F11 }, 3, "Ctrl+Alt+F11"},
527 { { GDK_Control_L, GDK_Alt_L, GDK_F12 }, 3, "Ctrl+Alt+F12"},
528 { {}, 0, "" },
529 { { GDK_Print }, 1, "_PrintScreen"},
514 { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"},
515 { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"},
516 { {}, 0, "" },
517 { { GDK_Control_L, GDK_Alt_L, GDK_F1 }, 3, "Ctrl+Alt+F_1"},
518 { { GDK_Control_L, GDK_Alt_L, GDK_F2 }, 3, "Ctrl+Alt+F_2"},
519 { { GDK_Control_L, GDK_Alt_L, GDK_F3 }, 3, "Ctrl+Alt+F_3"},
520 { { GDK_Control_L, GDK_Alt_L, GDK_F4 }, 3, "Ctrl+Alt+F_4"},
521 { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_5"},
522 { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F_6"},
523 { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F_7"},
524 { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F_8"},
525 { { GDK_Control_L, GDK_Alt_L, GDK_F9 }, 3, "Ctrl+Alt+F_9"},
526 { { GDK_Control_L, GDK_Alt_L, GDK_F10 }, 3, "Ctrl+Alt+F1_0"},
527 { { GDK_Control_L, GDK_Alt_L, GDK_F11 }, 3, "Ctrl+Alt+F11"},
528 { { GDK_Control_L, GDK_Alt_L, GDK_F12 }, 3, "Ctrl+Alt+F12"},
529 { {}, 0, "" },
530 { { GDK_Print }, 1, "_PrintScreen"},
530531 };
531532
532533 G_MODULE_EXPORT void
533534 virt_viewer_window_menu_send(GtkWidget *menu G_GNUC_UNUSED,
534 VirtViewerWindow *self)
535 {
536 int i;
537 GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu));
538 const char *text = gtk_label_get_label(GTK_LABEL(label));
539 VirtViewerWindowPrivate *priv = self->priv;
540
541 for (i = 0 ; i < G_N_ELEMENTS(keyCombos) ; i++) {
542 if (!strcmp(text, keyCombos[i].label)) {
543 DEBUG_LOG("Sending key combo %s", gtk_label_get_text(GTK_LABEL(label)));
544 virt_viewer_display_send_keys(VIRT_VIEWER_DISPLAY(priv->display),
545 keyCombos[i].keys,
546 keyCombos[i].nkeys);
547 return;
548 }
549 }
550 DEBUG_LOG("Failed to find key combo %s", gtk_label_get_text(GTK_LABEL(label)));
535 VirtViewerWindow *self)
536 {
537 int i;
538 GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu));
539 const char *text = gtk_label_get_label(GTK_LABEL(label));
540 VirtViewerWindowPrivate *priv = self->priv;
541
542 for (i = 0 ; i < G_N_ELEMENTS(keyCombos) ; i++) {
543 if (!strcmp(text, keyCombos[i].label)) {
544 DEBUG_LOG("Sending key combo %s", gtk_label_get_text(GTK_LABEL(label)));
545 virt_viewer_display_send_keys(VIRT_VIEWER_DISPLAY(priv->display),
546 keyCombos[i].keys,
547 keyCombos[i].nkeys);
548 return;
549 }
550 }
551 DEBUG_LOG("Failed to find key combo %s", gtk_label_get_text(GTK_LABEL(label)));
551552 }
552553
553554 static gboolean
554555 virt_viewer_window_ignore_accel(GtkWidget *menu G_GNUC_UNUSED,
555 VirtViewerWindow *self G_GNUC_UNUSED)
556 {
557 /* ignore accelerator */
558 return TRUE;
556 VirtViewerWindow *self G_GNUC_UNUSED)
557 {
558 /* ignore accelerator */
559 return TRUE;
559560 }
560561
561562 static const char * const menuNames[LAST_MENU] = {
562 "menu-file", "menu-view", "menu-send", "menu-help"
563 "menu-file", "menu-view", "menu-send", "menu-help"
563564 };
564565
565566 void
566567 virt_viewer_window_disable_modifiers(VirtViewerWindow *self)
567568 {
568 GtkSettings *settings = gtk_settings_get_default();
569 VirtViewerWindowPrivate *priv = self->priv;
570 GValue empty;
571 GSList *accels;
572 int i;
573
574 if (!priv->window)
575 return;
576
577 if (!priv->accel_enabled)
578 return;
579
580 /* This stops F10 activating menu bar */
581 memset(&empty, 0, sizeof empty);
582 g_value_init(&empty, G_TYPE_STRING);
583 g_object_get_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting);
584 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &empty);
585
586 /* This stops global accelerators like Ctrl+Q == Quit */
587 for (accels = priv->accel_list ; accels ; accels = accels->next) {
588 gtk_window_remove_accel_group(GTK_WINDOW(priv->window), accels->data);
589 }
590
591 /* This stops menu bar shortcuts like Alt+F == File */
592 for (i = 0 ; i < LAST_MENU ; i++) {
593 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i]));
594 priv->accel_menu_sig[i] =
595 g_signal_connect(menu, "mnemonic-activate",
596 G_CALLBACK(virt_viewer_window_ignore_accel), self);
597 }
598
599 priv->accel_enabled = FALSE;
569 GtkSettings *settings = gtk_settings_get_default();
570 VirtViewerWindowPrivate *priv = self->priv;
571 GValue empty;
572 GSList *accels;
573 int i;
574
575 if (!priv->window)
576 return;
577
578 if (!priv->accel_enabled)
579 return;
580
581 /* This stops F10 activating menu bar */
582 memset(&empty, 0, sizeof empty);
583 g_value_init(&empty, G_TYPE_STRING);
584 g_object_get_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting);
585 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &empty);
586
587 /* This stops global accelerators like Ctrl+Q == Quit */
588 for (accels = priv->accel_list ; accels ; accels = accels->next) {
589 gtk_window_remove_accel_group(GTK_WINDOW(priv->window), accels->data);
590 }
591
592 /* This stops menu bar shortcuts like Alt+F == File */
593 for (i = 0 ; i < LAST_MENU ; i++) {
594 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i]));
595 priv->accel_menu_sig[i] =
596 g_signal_connect(menu, "mnemonic-activate",
597 G_CALLBACK(virt_viewer_window_ignore_accel), self);
598 }
599
600 priv->accel_enabled = FALSE;
600601 }
601602
602603 void
603604 virt_viewer_window_enable_modifiers(VirtViewerWindow *self)
604605 {
605 GtkSettings *settings = gtk_settings_get_default();
606 VirtViewerWindowPrivate *priv = self->priv;
607 GSList *accels;
608 int i;
609
610 if (!priv->window)
611 return;
612
613 if (priv->accel_enabled)
614 return;
615
616 /* This allows F10 activating menu bar */
617 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting);
618
619 /* This allows global accelerators like Ctrl+Q == Quit */
620 for (accels = priv->accel_list ; accels ; accels = accels->next) {
621 gtk_window_add_accel_group(GTK_WINDOW(priv->window), accels->data);
622 }
623
624 /* This allows menu bar shortcuts like Alt+F == File */
625 for (i = 0 ; i < LAST_MENU ; i++) {
626 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i]));
627 g_signal_handler_disconnect(menu, priv->accel_menu_sig[i]);
628 }
629
630 priv->accel_enabled = TRUE;
606 GtkSettings *settings = gtk_settings_get_default();
607 VirtViewerWindowPrivate *priv = self->priv;
608 GSList *accels;
609 int i;
610
611 if (!priv->window)
612 return;
613
614 if (priv->accel_enabled)
615 return;
616
617 /* This allows F10 activating menu bar */
618 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &priv->accel_setting);
619
620 /* This allows global accelerators like Ctrl+Q == Quit */
621 for (accels = priv->accel_list ; accels ; accels = accels->next) {
622 gtk_window_add_accel_group(GTK_WINDOW(priv->window), accels->data);
623 }
624
625 /* This allows menu bar shortcuts like Alt+F == File */
626 for (i = 0 ; i < LAST_MENU ; i++) {
627 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, menuNames[i]));
628 g_signal_handler_disconnect(menu, priv->accel_menu_sig[i]);
629 }
630
631 priv->accel_enabled = TRUE;
631632 }
632633
633634
634635 G_MODULE_EXPORT gboolean
635636 virt_viewer_window_delete(GtkWidget *src G_GNUC_UNUSED,
636 void *dummy G_GNUC_UNUSED,
637 VirtViewerWindow *self)
638 {
639 virt_viewer_app_window_set_visible(self->priv->app, self, FALSE);
640 return TRUE;
637 void *dummy G_GNUC_UNUSED,
638 VirtViewerWindow *self)
639 {
640 virt_viewer_app_window_set_visible(self->priv->app, self, FALSE);
641 return TRUE;
641642 }
642643
643644
644645 G_MODULE_EXPORT void
645646 virt_viewer_window_menu_file_quit(GtkWidget *src G_GNUC_UNUSED,
646 VirtViewerWindow *self)
647 {
648 virt_viewer_app_quit(self->priv->app);
647 VirtViewerWindow *self)
648 {
649 virt_viewer_app_quit(self->priv->app);
649650 }
650651
651652
652653 static void
653654 virt_viewer_window_toolbar_leave_fullscreen(GtkWidget *button G_GNUC_UNUSED,
654 VirtViewerWindow *self)
655 {
656 g_object_set(self->priv->app, "fullscreen", FALSE, NULL);
655 VirtViewerWindow *self)
656 {
657 g_object_set(self->priv->app, "fullscreen", FALSE, NULL);
657658 }
658659
659660
660661 G_MODULE_EXPORT void
661662 virt_viewer_window_menu_view_fullscreen(GtkWidget *menu,
662 VirtViewerWindow *self)
663 {
664 gboolean fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu));
665
666 g_object_set(self->priv->app, "fullscreen", fullscreen, NULL);
663 VirtViewerWindow *self)
664 {
665 gboolean fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu));
666
667 g_object_set(self->priv->app, "fullscreen", fullscreen, NULL);
667668 }
668669
669670 G_MODULE_EXPORT void
670671 virt_viewer_window_menu_view_resize(GtkWidget *menu,
671 VirtViewerWindow *self)
672 {
673 VirtViewerWindowPrivate *priv = self->priv;
674
675 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) {
676 priv->auto_resize = TRUE;
677 if (!priv->fullscreen)
678 virt_viewer_window_resize(self);
679 } else {
680 priv->auto_resize = FALSE;
681 }
672 VirtViewerWindow *self)
673 {
674 VirtViewerWindowPrivate *priv = self->priv;
675
676 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) {
677 priv->auto_resize = TRUE;
678 if (!priv->fullscreen)
679 virt_viewer_window_resize(self);
680 } else {
681 priv->auto_resize = FALSE;
682 }
683
684 virt_viewer_display_set_auto_resize(priv->display, priv->auto_resize);
682685 }
683686
684687 static void
685688 virt_viewer_window_save_screenshot(VirtViewerWindow *self,
686 const char *file)
687 {
688 VirtViewerWindowPrivate *priv = self->priv;
689 GdkPixbuf *pix = virt_viewer_display_get_pixbuf(VIRT_VIEWER_DISPLAY(priv->display));
690
691 gdk_pixbuf_save(pix, file, "png", NULL,
692 "tEXt::Generator App", PACKAGE, NULL);
693 gdk_pixbuf_unref(pix);
689 const char *file)
690 {
691 VirtViewerWindowPrivate *priv = self->priv;
692 GdkPixbuf *pix = virt_viewer_display_get_pixbuf(VIRT_VIEWER_DISPLAY(priv->display));
693
694 gdk_pixbuf_save(pix, file, "png", NULL,
695 "tEXt::Generator App", PACKAGE, NULL);
696 g_object_unref(pix);
694697 }
695698
696699 G_MODULE_EXPORT void
697700 virt_viewer_window_menu_file_screenshot(GtkWidget *menu G_GNUC_UNUSED,
698 VirtViewerWindow *self)
699 {
700 GtkWidget *dialog;
701 VirtViewerWindowPrivate *priv = self->priv;
702
703 g_return_if_fail(priv->display != NULL);
704
705 dialog = gtk_file_chooser_dialog_new ("Save screenshot",
706 NULL,
707 GTK_FILE_CHOOSER_ACTION_SAVE,
708 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
709 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
710 NULL);
711 gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
712
713 //gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving);
714 //gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Screenshot");
715
716 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
717 char *filename;
718
719 filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
720 virt_viewer_window_save_screenshot(self, filename);
721 g_free (filename);
722 }
723
724 gtk_widget_destroy (dialog);
701 VirtViewerWindow *self)
702 {
703 GtkWidget *dialog;
704 VirtViewerWindowPrivate *priv = self->priv;
705
706 g_return_if_fail(priv->display != NULL);
707
708 dialog = gtk_file_chooser_dialog_new("Save screenshot",
709 NULL,
710 GTK_FILE_CHOOSER_ACTION_SAVE,
711 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
712 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
713 NULL);
714 gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER (dialog), TRUE);
715 gtk_window_set_transient_for(GTK_WINDOW(dialog),
716 GTK_WINDOW(self->priv->window));
717
718 //gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving);
719 //gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Screenshot");
720
721 if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
722 char *filename;
723
724 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
725 virt_viewer_window_save_screenshot(self, filename);
726 g_free(filename);
727 }
728
729 gtk_widget_destroy(dialog);
730 }
731
732 G_MODULE_EXPORT void
733 virt_viewer_window_menu_file_usb_device_selection(GtkWidget *menu G_GNUC_UNUSED,
734 VirtViewerWindow *self)
735 {
736 virt_viewer_app_usb_device_selection(self->priv->app,
737 GTK_WINDOW(self->priv->window));
725738 }
726739
727740 G_MODULE_EXPORT void
728741 virt_viewer_window_menu_help_about(GtkWidget *menu G_GNUC_UNUSED,
729 VirtViewerWindow *self)
730 {
731 GtkBuilder *about = virt_viewer_util_load_ui("virt-viewer-about.xml");
732
733 GtkWidget *dialog = GTK_WIDGET(gtk_builder_get_object(about, "about"));
734 gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION);
735
736 gtk_builder_connect_signals(about, self);
737
738 gtk_widget_show_all(dialog);
739
740 g_object_unref(G_OBJECT(about));
742 VirtViewerWindow *self)
743 {
744 GtkBuilder *about = virt_viewer_util_load_ui("virt-viewer-about.xml");
745
746 GtkWidget *dialog = GTK_WIDGET(gtk_builder_get_object(about, "about"));
747 gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION);
748
749 gtk_window_set_transient_for(GTK_WINDOW(dialog),
750 GTK_WINDOW(self->priv->window));
751
752 gtk_builder_connect_signals(about, self);
753
754 gtk_widget_show_all(dialog);
755
756 g_object_unref(G_OBJECT(about));
741757 }
742758
743759
744760 static void
745761 virt_viewer_window_toolbar_setup(VirtViewerWindow *self)
746762 {
747 GtkWidget *button;
748 VirtViewerWindowPrivate *priv = self->priv;
749
750 priv->toolbar = gtk_toolbar_new();
751 gtk_toolbar_set_show_arrow(GTK_TOOLBAR(priv->toolbar), FALSE);
752 gtk_widget_set_no_show_all(priv->toolbar, TRUE);
753 gtk_toolbar_set_style(GTK_TOOLBAR(priv->toolbar), GTK_TOOLBAR_BOTH_HORIZ);
754
755 /* Close connection */
756 button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_CLOSE));
757 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Disconnect"));
758 gtk_widget_show(GTK_WIDGET(button));
759 gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM (button), 0);
760 g_signal_connect(button, "clicked", G_CALLBACK(gtk_main_quit), NULL);
761
762 /* Leave fullscreen */
763 button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_LEAVE_FULLSCREEN));
764 gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), _("Leave fullscreen"));
765 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Leave fullscreen"));
766 gtk_tool_item_set_is_important(GTK_TOOL_ITEM(button), TRUE);
767 gtk_widget_show(GTK_WIDGET(button));
768 gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM(button), 0);
769 g_signal_connect(button, "clicked", G_CALLBACK(virt_viewer_window_toolbar_leave_fullscreen), self);
770
771 priv->layout = ViewAutoDrawer_New();
772
773 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE);
774 ViewOvBox_SetOver(VIEW_OV_BOX(priv->layout), priv->toolbar);
775 ViewOvBox_SetUnder(VIEW_OV_BOX(priv->layout), GTK_WIDGET(priv->notebook));
776 ViewAutoDrawer_SetOffset(VIEW_AUTODRAWER(priv->layout), -1);
777 ViewAutoDrawer_SetFill(VIEW_AUTODRAWER(priv->layout), FALSE);
778 ViewAutoDrawer_SetOverlapPixels(VIEW_AUTODRAWER(priv->layout), 1);
779 ViewAutoDrawer_SetNoOverlapPixels(VIEW_AUTODRAWER(priv->layout), 0);
780 gtk_widget_show(priv->layout);
763 GtkWidget *button;
764 VirtViewerWindowPrivate *priv = self->priv;
765
766 priv->toolbar = gtk_toolbar_new();
767 gtk_toolbar_set_show_arrow(GTK_TOOLBAR(priv->toolbar), FALSE);
768 gtk_widget_set_no_show_all(priv->toolbar, TRUE);
769 gtk_toolbar_set_style(GTK_TOOLBAR(priv->toolbar), GTK_TOOLBAR_BOTH_HORIZ);
770
771 /* Close connection */
772 button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_CLOSE));
773 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Disconnect"));
774 gtk_widget_show(GTK_WIDGET(button));
775 gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM (button), 0);
776 g_signal_connect(button, "clicked", G_CALLBACK(gtk_main_quit), NULL);
777
778 /* Leave fullscreen */
779 button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_LEAVE_FULLSCREEN));
780 gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), _("Leave fullscreen"));
781 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Leave fullscreen"));
782 gtk_tool_item_set_is_important(GTK_TOOL_ITEM(button), TRUE);
783 gtk_widget_show(GTK_WIDGET(button));
784 gtk_toolbar_insert(GTK_TOOLBAR(priv->toolbar), GTK_TOOL_ITEM(button), 0);
785 g_signal_connect(button, "clicked", G_CALLBACK(virt_viewer_window_toolbar_leave_fullscreen), self);
786
787 priv->layout = ViewAutoDrawer_New();
788
789 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE);
790 ViewOvBox_SetOver(VIEW_OV_BOX(priv->layout), priv->toolbar);
791 ViewOvBox_SetUnder(VIEW_OV_BOX(priv->layout), GTK_WIDGET(priv->notebook));
792 ViewAutoDrawer_SetOffset(VIEW_AUTODRAWER(priv->layout), -1);
793 ViewAutoDrawer_SetFill(VIEW_AUTODRAWER(priv->layout), FALSE);
794 ViewAutoDrawer_SetOverlapPixels(VIEW_AUTODRAWER(priv->layout), 1);
795 ViewAutoDrawer_SetNoOverlapPixels(VIEW_AUTODRAWER(priv->layout), 0);
796 gtk_widget_show(priv->layout);
781797 }
782798
783799 VirtViewerNotebook*
784800 virt_viewer_window_get_notebook (VirtViewerWindow *self)
785801 {
786 return VIRT_VIEWER_NOTEBOOK(self->priv->notebook);
802 return VIRT_VIEWER_NOTEBOOK(self->priv->notebook);
787803 }
788804
789805 GtkWindow*
790806 virt_viewer_window_get_window (VirtViewerWindow *self)
791807 {
792 return GTK_WINDOW(self->priv->window);
808 return GTK_WINDOW(self->priv->window);
793809 }
794810
795811 static void
796812 virt_viewer_window_pointer_grab(VirtViewerDisplay *display G_GNUC_UNUSED,
797 VirtViewerWindow *self)
798 {
799 VirtViewerWindowPrivate *priv = self->priv;
800
801 priv->grabbed = TRUE;
802 virt_viewer_window_update_title(self);
813 VirtViewerWindow *self)
814 {
815 VirtViewerWindowPrivate *priv = self->priv;
816
817 priv->grabbed = TRUE;
818 virt_viewer_window_update_title(self);
803819 }
804820
805821 static void
806822 virt_viewer_window_pointer_ungrab(VirtViewerDisplay *display G_GNUC_UNUSED,
807 VirtViewerWindow *self)
808 {
809 VirtViewerWindowPrivate *priv = self->priv;
810
811 priv->grabbed = FALSE;
812 virt_viewer_window_update_title(self);
823 VirtViewerWindow *self)
824 {
825 VirtViewerWindowPrivate *priv = self->priv;
826
827 priv->grabbed = FALSE;
828 virt_viewer_window_update_title(self);
813829 }
814830
815831 static void
816832 virt_viewer_window_keyboard_grab(VirtViewerDisplay *display G_GNUC_UNUSED,
817 VirtViewerWindow *self)
818 {
819 virt_viewer_window_disable_modifiers(self);
833 VirtViewerWindow *self)
834 {
835 virt_viewer_window_disable_modifiers(self);
820836 }
821837
822838 static void
823839 virt_viewer_window_keyboard_ungrab(VirtViewerDisplay *display G_GNUC_UNUSED,
824 VirtViewerWindow *self)
825 {
826 virt_viewer_window_enable_modifiers(self);
840 VirtViewerWindow *self)
841 {
842 virt_viewer_window_enable_modifiers(self);
827843 }
828844
829845 void
830846 virt_viewer_window_update_title(VirtViewerWindow *self)
831847 {
832 VirtViewerWindowPrivate *priv = self->priv;
833 char *title;
834 const char *ungrab = NULL;
835
836 if (priv->grabbed)
837 ungrab = _("(Press Ctrl+Alt to release pointer)");
838
839 if (!ungrab && !priv->subtitle)
840 title = g_strdup(g_get_application_name());
841 else
842 /* translators:
843 * This is "<ungrab (or empty)><space (or empty)><subtitle (or empty)> - <appname>"
844 * Such as: "(Press Ctrl+Alt to release pointer) BigCorpTycoon MOTD - Virt Viewer"
845 */
846 title = g_strdup_printf(_("%s%s%s - %s"),
847 /* translators: <ungrab empty> */
848 ungrab ? ungrab : _(""),
849 /* translators: <space> */
850 ungrab && priv->subtitle ? _(" ") : _(""),
851 priv->subtitle,
852 g_get_application_name());
853
854 gtk_window_set_title(GTK_WINDOW(priv->window), title);
855
856 g_free(title);
848 VirtViewerWindowPrivate *priv = self->priv;
849 char *title;
850 const char *ungrab = NULL;
851
852 if (priv->grabbed)
853 ungrab = _("(Press Ctrl+Alt to release pointer)");
854
855 if (!ungrab && !priv->subtitle)
856 title = g_strdup(g_get_application_name());
857 else
858 /* translators:
859 * This is "<ungrab (or empty)><space (or empty)><subtitle (or empty)> - <appname>"
860 * Such as: "(Press Ctrl+Alt to release pointer) BigCorpTycoon MOTD - Virt Viewer"
861 */
862 title = g_strdup_printf(_("%s%s%s - %s"),
863 /* translators: <ungrab empty> */
864 ungrab ? ungrab : _(""),
865 /* translators: <space> */
866 ungrab && priv->subtitle ? _(" ") : _(""),
867 priv->subtitle,
868 g_get_application_name());
869
870 gtk_window_set_title(GTK_WINDOW(priv->window), title);
871
872 g_free(title);
873 }
874
875 void
876 virt_viewer_window_set_usb_options_sensitive(VirtViewerWindow *self, gboolean sensitive)
877 {
878 VirtViewerWindowPrivate *priv;
879 GtkWidget *menu;
880
881 g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self));
882
883 priv = self->priv;
884 menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-file-usb-device-selection"));
885 gtk_widget_set_sensitive(menu, sensitive);
857886 }
858887
859888 void
860889 virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *display)
861890 {
862 VirtViewerWindowPrivate *priv;
863
864 g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self));
865 g_return_if_fail(display == NULL || VIRT_VIEWER_IS_DISPLAY(display));
866
867 priv = self->priv;
868 if (priv->display) {
869 gtk_notebook_remove_page(GTK_NOTEBOOK(priv->notebook), 1);
870 g_object_unref(priv->display);
871 priv->display = NULL;
872 }
873
874 if (display != NULL) {
875 priv->display = g_object_ref(display);
876
877 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
878
879 gtk_notebook_append_page(GTK_NOTEBOOK(priv->notebook), GTK_WIDGET(display), NULL);
880 gtk_widget_show_all(GTK_WIDGET(display));
881
882 g_signal_connect(display, "display-pointer-grab",
883 G_CALLBACK(virt_viewer_window_pointer_grab), self);
884 g_signal_connect(display, "display-pointer-ungrab",
885 G_CALLBACK(virt_viewer_window_pointer_ungrab), self);
886 g_signal_connect(display, "display-keyboard-grab",
887 G_CALLBACK(virt_viewer_window_keyboard_grab), self);
888 g_signal_connect(display, "display-keyboard-ungrab",
889 G_CALLBACK(virt_viewer_window_keyboard_ungrab), self);
890 g_signal_connect(display, "display-desktop-resize",
891 G_CALLBACK(virt_viewer_window_desktop_resize), self);
892 }
891 VirtViewerWindowPrivate *priv;
892
893 g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self));
894 g_return_if_fail(display == NULL || VIRT_VIEWER_IS_DISPLAY(display));
895
896 priv = self->priv;
897 if (priv->display) {
898 gtk_notebook_remove_page(GTK_NOTEBOOK(priv->notebook), 1);
899 g_object_unref(priv->display);
900 priv->display = NULL;
901 }
902
903 if (display != NULL) {
904 priv->display = g_object_ref(display);
905
906 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), priv->zoomlevel);
907 virt_viewer_display_set_auto_resize(VIRT_VIEWER_DISPLAY(priv->display), priv->auto_resize);
908
909 gtk_notebook_append_page(GTK_NOTEBOOK(priv->notebook), GTK_WIDGET(display), NULL);
910 gtk_widget_show_all(GTK_WIDGET(display));
911
912 g_signal_connect(display, "display-pointer-grab",
913 G_CALLBACK(virt_viewer_window_pointer_grab), self);
914 g_signal_connect(display, "display-pointer-ungrab",
915 G_CALLBACK(virt_viewer_window_pointer_ungrab), self);
916 g_signal_connect(display, "display-keyboard-grab",
917 G_CALLBACK(virt_viewer_window_keyboard_grab), self);
918 g_signal_connect(display, "display-keyboard-ungrab",
919 G_CALLBACK(virt_viewer_window_keyboard_ungrab), self);
920 g_signal_connect(display, "display-desktop-resize",
921 G_CALLBACK(virt_viewer_window_desktop_resize), self);
922 }
893923 }
894924
895925 void
896926 virt_viewer_window_set_zoom_level(VirtViewerWindow *self, gint zoom_level)
897927 {
898 g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self));
899
900 /* FIXME: turn into a dynamic property */
901 self->priv->zoomlevel = zoom_level;
928 g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self));
929
930 /* FIXME: turn into a dynamic property */
931 self->priv->zoomlevel = zoom_level;
902932 }
903933
904934 gint virt_viewer_window_get_zoom_level(VirtViewerWindow *self)
905935 {
906 g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), 100);
907 return self->priv->zoomlevel;
936 g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), 100);
937 return self->priv->zoomlevel;
908938 }
909939
910940 GtkMenuItem*
911941 virt_viewer_window_get_menu_displays(VirtViewerWindow *self)
912942 {
913 g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), NULL);
914 return GTK_MENU_ITEM(gtk_builder_get_object(self->priv->builder, "menu-displays"));
943 g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), NULL);
944
945 return GTK_MENU_ITEM(gtk_builder_get_object(self->priv->builder, "menu-displays"));
946 }
947
948 GtkBuilder*
949 virt_viewer_window_get_builder(VirtViewerWindow *self)
950 {
951 g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(self), NULL);
952
953 return self->priv->builder;
915954 }
916955
917956 /*
918957 * Local variables:
919 * c-indent-level: 8
920 * c-basic-offset: 8
921 * tab-width: 8
922 * indent-tabs-mode: t
958 * c-indent-level: 4
959 * c-basic-offset: 4
960 * indent-tabs-mode: nil
923961 * End:
924962 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3131
3232 #define VIRT_VIEWER_TYPE_WINDOW virt_viewer_window_get_type()
3333
34 #define VIRT_VIEWER_WINDOW(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindow))
34 #define VIRT_VIEWER_WINDOW(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindow))
3636
37 #define VIRT_VIEWER_WINDOW_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass))
37 #define VIRT_VIEWER_WINDOW_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass))
3939
40 #define VIRT_VIEWER_IS_WINDOW(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_WINDOW))
40 #define VIRT_VIEWER_IS_WINDOW(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_WINDOW))
4242
43 #define VIRT_VIEWER_IS_WINDOW_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_WINDOW))
43 #define VIRT_VIEWER_IS_WINDOW_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_WINDOW))
4545
46 #define VIRT_VIEWER_WINDOW_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass))
46 #define VIRT_VIEWER_WINDOW_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_WINDOW, VirtViewerWindowClass))
4848
4949 typedef struct _VirtViewerWindowPrivate VirtViewerWindowPrivate;
5050
5151 typedef struct {
52 GObject parent;
53 VirtViewerWindowPrivate *priv;
52 GObject parent;
53 VirtViewerWindowPrivate *priv;
5454 } VirtViewerWindow;
5555
5656 typedef struct {
57 GObjectClass parent_class;
57 GObjectClass parent_class;
5858 } VirtViewerWindowClass;
5959
6060 GType virt_viewer_window_get_type (void);
6262 GtkWindow* virt_viewer_window_get_window (VirtViewerWindow* window);
6363 VirtViewerNotebook* virt_viewer_window_get_notebook (VirtViewerWindow* window);
6464 void virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *display);
65 void virt_viewer_window_set_usb_options_sensitive(VirtViewerWindow *self, gboolean sensitive);
6566 void virt_viewer_window_update_title(VirtViewerWindow *self);
6667 void virt_viewer_window_set_zoom_level(VirtViewerWindow *self, gint zoom_level);
6768 gint virt_viewer_window_get_zoom_level(VirtViewerWindow *self);
6869 void virt_viewer_window_leave_fullscreen(VirtViewerWindow *self);
6970 void virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gboolean move, gint x, gint y);
7071 GtkMenuItem *virt_viewer_window_get_menu_displays(VirtViewerWindow *self);
72 GtkBuilder* virt_viewer_window_get_builder(VirtViewerWindow *window);
7173
7274 G_END_DECLS
7375
7476 #endif /* _VIRT_VIEWER_WINDOW */
77
7578 /*
7679 * Local variables:
77 * c-indent-level: 8
78 * c-basic-offset: 8
79 * tab-width: 8
80 * indent-tabs-mode: t
80 * c-indent-level: 4
81 * c-basic-offset: 4
82 * indent-tabs-mode: nil
8183 * End:
8284 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
3 * Copyright (C) 2007-2012 Red Hat, Inc.
4 * Copyright (C) 2009-2012 Daniel P. Berrange
55 * Copyright (C) 2010 Marc-André Lureau
66 *
77 * This program is free software; you can redistribute it and/or modify
3939 #include <libxml/xpath.h>
4040 #include <libxml/uri.h>
4141
42 #if defined(HAVE_SOCKETPAIR)
43 #include <sys/socket.h>
44 #endif
45
4246 #include "virt-viewer.h"
4347 #include "virt-viewer-app.h"
4448 #include "virt-viewer-events.h"
4549 #include "virt-viewer-auth.h"
4650
4751 struct _VirtViewerPrivate {
48 char *uri;
49 virConnectPtr conn;
50 char *domkey;
51 gboolean withEvents;
52 gboolean waitvm;
53 gboolean reconnect;
52 char *uri;
53 virConnectPtr conn;
54 virDomainPtr dom;
55 char *domkey;
56 gboolean withEvents;
57 gboolean waitvm;
58 gboolean reconnect;
5459 };
5560
5661 G_DEFINE_TYPE (VirtViewer, virt_viewer, VIRT_VIEWER_TYPE_APP)
57 #define GET_PRIVATE(o) \
58 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE, VirtViewerPrivate))
62 #define GET_PRIVATE(o) \
63 (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIRT_VIEWER_TYPE, VirtViewerPrivate))
5964
6065 static int virt_viewer_initial_connect(VirtViewerApp *self);
66 static gboolean virt_viewer_open_connection(VirtViewerApp *self, int *fd);
6167 static void virt_viewer_deactivated(VirtViewerApp *self);
6268 static gboolean virt_viewer_start(VirtViewerApp *self);
6369
6470 static void
6571 virt_viewer_get_property (GObject *object, guint property_id,
66 GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
67 {
68 switch (property_id) {
69 default:
70 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
71 }
72 GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
73 {
74 switch (property_id) {
75 default:
76 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
77 }
7278 }
7379
7480 static void
7581 virt_viewer_set_property (GObject *object, guint property_id,
76 const GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
77 {
78 switch (property_id) {
79 default:
80 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
81 }
82 const GValue *value G_GNUC_UNUSED, GParamSpec *pspec)
83 {
84 switch (property_id) {
85 default:
86 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
87 }
8288 }
8389
8490 static void
8591 virt_viewer_dispose (GObject *object)
8692 {
87 G_OBJECT_CLASS(virt_viewer_parent_class)->dispose (object);
93 VirtViewer *self = VIRT_VIEWER(object);
94 VirtViewerPrivate *priv = self->priv;
95 if (priv->dom)
96 virDomainFree(priv->dom);
97 if (priv->conn)
98 virConnectClose(priv->conn);
99 G_OBJECT_CLASS(virt_viewer_parent_class)->dispose (object);
88100 }
89101
90102 static void
91103 virt_viewer_class_init (VirtViewerClass *klass)
92104 {
93 GObjectClass *object_class = G_OBJECT_CLASS (klass);
94 VirtViewerAppClass *app_class = VIRT_VIEWER_APP_CLASS (klass);
95
96 g_type_class_add_private (klass, sizeof (VirtViewerPrivate));
97
98 object_class->get_property = virt_viewer_get_property;
99 object_class->set_property = virt_viewer_set_property;
100 object_class->dispose = virt_viewer_dispose;
101
102 app_class->initial_connect = virt_viewer_initial_connect;
103 app_class->deactivated = virt_viewer_deactivated;
104 app_class->start = virt_viewer_start;
105 GObjectClass *object_class = G_OBJECT_CLASS (klass);
106 VirtViewerAppClass *app_class = VIRT_VIEWER_APP_CLASS (klass);
107
108 g_type_class_add_private (klass, sizeof (VirtViewerPrivate));
109
110 object_class->get_property = virt_viewer_get_property;
111 object_class->set_property = virt_viewer_set_property;
112 object_class->dispose = virt_viewer_dispose;
113
114 app_class->initial_connect = virt_viewer_initial_connect;
115 app_class->deactivated = virt_viewer_deactivated;
116 app_class->open_connection = virt_viewer_open_connection;
117 app_class->start = virt_viewer_start;
105118 }
106119
107120 static void
108121 virt_viewer_init(VirtViewer *self)
109122 {
110 self->priv = GET_PRIVATE(self);
123 self->priv = GET_PRIVATE(self);
111124 }
112125
113126 static void
114127 virt_viewer_deactivated(VirtViewerApp *app)
115128 {
116 VirtViewer *self = VIRT_VIEWER(app);
117 VirtViewerPrivate *priv = self->priv;
118
119 if (priv->reconnect) {
120 if (!priv->withEvents) {
121 DEBUG_LOG("No domain events, falling back to polling");
122 virt_viewer_app_start_reconnect_poll(app);
123 }
124
125 virt_viewer_app_show_status(app, _("Waiting for guest domain to re-start"));
126 virt_viewer_app_trace(app, "Guest %s display has disconnected, waiting to reconnect", priv->domkey);
127 } else {
128 VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->deactivated(app);
129 }
129 VirtViewer *self = VIRT_VIEWER(app);
130 VirtViewerPrivate *priv = self->priv;
131
132 if (priv->dom) {
133 virDomainFree(priv->dom);
134 priv->dom = NULL;
135 }
136
137 if (priv->reconnect) {
138 if (!priv->withEvents) {
139 DEBUG_LOG("No domain events, falling back to polling");
140 virt_viewer_app_start_reconnect_poll(app);
141 }
142
143 virt_viewer_app_show_status(app, _("Waiting for guest domain to re-start"));
144 virt_viewer_app_trace(app, "Guest %s display has disconnected, waiting to reconnect", priv->domkey);
145 } else {
146 VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->deactivated(app);
147 }
130148 }
131149
132150 static int
133151 virt_viewer_parse_uuid(const char *name,
134 unsigned char *uuid)
135 {
136 int i;
137
138 const char *cur = name;
139 for (i = 0;i < 16;) {
140 uuid[i] = 0;
141 if (*cur == 0)
142 return -1;
143 if ((*cur == '-') || (*cur == ' ')) {
144 cur++;
145 continue;
146 }
147 if ((*cur >= '0') && (*cur <= '9'))
148 uuid[i] = *cur - '0';
149 else if ((*cur >= 'a') && (*cur <= 'f'))
150 uuid[i] = *cur - 'a' + 10;
151 else if ((*cur >= 'A') && (*cur <= 'F'))
152 uuid[i] = *cur - 'A' + 10;
153 else
154 return -1;
155 uuid[i] *= 16;
156 cur++;
157 if (*cur == 0)
158 return -1;
159 if ((*cur >= '0') && (*cur <= '9'))
160 uuid[i] += *cur - '0';
161 else if ((*cur >= 'a') && (*cur <= 'f'))
162 uuid[i] += *cur - 'a' + 10;
163 else if ((*cur >= 'A') && (*cur <= 'F'))
164 uuid[i] += *cur - 'A' + 10;
165 else
166 return -1;
167 i++;
168 cur++;
169 }
170
171 return 0;
152 unsigned char *uuid)
153 {
154 int i;
155
156 const char *cur = name;
157 for (i = 0;i < 16;) {
158 uuid[i] = 0;
159 if (*cur == 0)
160 return -1;
161 if ((*cur == '-') || (*cur == ' ')) {
162 cur++;
163 continue;
164 }
165 if ((*cur >= '0') && (*cur <= '9'))
166 uuid[i] = *cur - '0';
167 else if ((*cur >= 'a') && (*cur <= 'f'))
168 uuid[i] = *cur - 'a' + 10;
169 else if ((*cur >= 'A') && (*cur <= 'F'))
170 uuid[i] = *cur - 'A' + 10;
171 else
172 return -1;
173 uuid[i] *= 16;
174 cur++;
175 if (*cur == 0)
176 return -1;
177 if ((*cur >= '0') && (*cur <= '9'))
178 uuid[i] += *cur - '0';
179 else if ((*cur >= 'a') && (*cur <= 'f'))
180 uuid[i] += *cur - 'a' + 10;
181 else if ((*cur >= 'A') && (*cur <= 'F'))
182 uuid[i] += *cur - 'A' + 10;
183 else
184 return -1;
185 i++;
186 cur++;
187 }
188
189 return 0;
172190 }
173191
174192
175193 static virDomainPtr
176194 virt_viewer_lookup_domain(VirtViewer *self)
177195 {
178 char *end;
179 VirtViewerPrivate *priv = self->priv;
180 int id = strtol(priv->domkey, &end, 10);
181 virDomainPtr dom = NULL;
182 unsigned char uuid[16];
183
184 if (id >= 0 && end && !*end) {
185 dom = virDomainLookupByID(priv->conn, id);
186 }
187 if (!dom && virt_viewer_parse_uuid(priv->domkey, uuid) == 0) {
188 dom = virDomainLookupByUUID(priv->conn, uuid);
189 }
190 if (!dom) {
191 dom = virDomainLookupByName(priv->conn, priv->domkey);
192 }
193 return dom;
196 char *end;
197 VirtViewerPrivate *priv = self->priv;
198 int id = strtol(priv->domkey, &end, 10);
199 virDomainPtr dom = NULL;
200 unsigned char uuid[16];
201
202 if (id >= 0 && end && !*end) {
203 dom = virDomainLookupByID(priv->conn, id);
204 }
205 if (!dom && virt_viewer_parse_uuid(priv->domkey, uuid) == 0) {
206 dom = virDomainLookupByUUID(priv->conn, uuid);
207 }
208 if (!dom) {
209 dom = virDomainLookupByName(priv->conn, priv->domkey);
210 }
211 return dom;
194212 }
195213
196214 static int
197215 virt_viewer_matches_domain(VirtViewer *self,
198 virDomainPtr dom)
199 {
200 char *end;
201 const char *name;
202 VirtViewerPrivate *priv = self->priv;
203 int id = strtol(priv->domkey, &end, 10);
204 unsigned char wantuuid[16];
205 unsigned char domuuid[16];
206
207 if (id >= 0 && end && !*end) {
208 if (virDomainGetID(dom) == id)
209 return 1;
210 }
211 if (virt_viewer_parse_uuid(priv->domkey, wantuuid) == 0) {
212 virDomainGetUUID(dom, domuuid);
213 if (memcmp(wantuuid, domuuid, VIR_UUID_BUFLEN) == 0)
214 return 1;
215 }
216
217 name = virDomainGetName(dom);
218 if (strcmp(name, priv->domkey) == 0)
219 return 1;
220
221 return 0;
216 virDomainPtr dom)
217 {
218 char *end;
219 const char *name;
220 VirtViewerPrivate *priv = self->priv;
221 int id = strtol(priv->domkey, &end, 10);
222 unsigned char wantuuid[16];
223 unsigned char domuuid[16];
224
225 if (id >= 0 && end && !*end) {
226 if (virDomainGetID(dom) == id)
227 return 1;
228 }
229 if (virt_viewer_parse_uuid(priv->domkey, wantuuid) == 0) {
230 virDomainGetUUID(dom, domuuid);
231 if (memcmp(wantuuid, domuuid, VIR_UUID_BUFLEN) == 0)
232 return 1;
233 }
234
235 name = virDomainGetName(dom);
236 if (strcmp(name, priv->domkey) == 0)
237 return 1;
238
239 return 0;
222240 }
223241
224242 static char *
225243 virt_viewer_extract_xpath_string(const gchar *xmldesc,
226 const gchar *xpath)
227 {
228 xmlDocPtr xml = NULL;
229 xmlParserCtxtPtr pctxt = NULL;
230 xmlXPathContextPtr ctxt = NULL;
231 xmlXPathObjectPtr obj = NULL;
232 char *port = NULL;
233
234 pctxt = xmlNewParserCtxt();
235 if (!pctxt || !pctxt->sax)
236 goto error;
237
238 xml = xmlCtxtReadDoc(pctxt, (const xmlChar *)xmldesc, "domain.xml", NULL,
239 XML_PARSE_NOENT | XML_PARSE_NONET |
240 XML_PARSE_NOWARNING);
241 if (!xml)
242 goto error;
243
244 ctxt = xmlXPathNewContext(xml);
245 if (!ctxt)
246 goto error;
247
248 obj = xmlXPathEval((const xmlChar *)xpath, ctxt);
249 if (!obj || obj->type != XPATH_STRING || !obj->stringval || !obj->stringval[0])
250 goto error;
251 if (!strcmp((const char*)obj->stringval, "-1"))
252 goto error;
253
254 port = g_strdup((const char*)obj->stringval);
255 xmlXPathFreeObject(obj);
256 obj = NULL;
244 const gchar *xpath)
245 {
246 xmlDocPtr xml = NULL;
247 xmlParserCtxtPtr pctxt = NULL;
248 xmlXPathContextPtr ctxt = NULL;
249 xmlXPathObjectPtr obj = NULL;
250 char *port = NULL;
251
252 pctxt = xmlNewParserCtxt();
253 if (!pctxt || !pctxt->sax)
254 goto error;
255
256 xml = xmlCtxtReadDoc(pctxt, (const xmlChar *)xmldesc, "domain.xml", NULL,
257 XML_PARSE_NOENT | XML_PARSE_NONET |
258 XML_PARSE_NOWARNING);
259 if (!xml)
260 goto error;
261
262 ctxt = xmlXPathNewContext(xml);
263 if (!ctxt)
264 goto error;
265
266 obj = xmlXPathEval((const xmlChar *)xpath, ctxt);
267 if (!obj || obj->type != XPATH_STRING || !obj->stringval || !obj->stringval[0])
268 goto error;
269 if (!strcmp((const char*)obj->stringval, "-1"))
270 goto error;
271
272 port = g_strdup((const char*)obj->stringval);
273 xmlXPathFreeObject(obj);
274 obj = NULL;
257275
258276 error:
259 if (obj)
260 xmlXPathFreeObject(obj);
261 if (ctxt)
262 xmlXPathFreeContext(ctxt);
263 if (xml)
264 xmlFreeDoc(xml);
265 if (pctxt)
266 xmlFreeParserCtxt(pctxt);
267 return port;
277 xmlXPathFreeObject(obj);
278 xmlXPathFreeContext(ctxt);
279 xmlFreeDoc(xml);
280 xmlFreeParserCtxt(pctxt);
281 return port;
268282 }
269283
270284 static gboolean
271285 virt_viewer_extract_connect_info(VirtViewer *self,
272 virDomainPtr dom)
273 {
274 char *type = NULL;
275 char *xpath = NULL;
276 gboolean retval = FALSE;
277 char *xmldesc = virDomainGetXMLDesc(dom, 0);
278 VirtViewerPrivate *priv = self->priv;
279 VirtViewerApp *app = VIRT_VIEWER_APP(self);
280 gchar *gport = NULL;
281 gchar *ghost = NULL;
282 gchar *unixsock = NULL;
283 gchar *host = NULL;
284 gchar *transport = NULL;
285 gchar *user = NULL;
286 gint port = 0;
287 gchar *uri = NULL;
288
289 virt_viewer_app_free_connect_info(app);
290
291 if ((type = virt_viewer_extract_xpath_string(xmldesc, "string(/domain/devices/graphics/@type)")) == NULL) {
292 virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic type for the guest %s"),
293 priv->domkey);
294 goto cleanup;
295 }
296
297 if (virt_viewer_app_create_session(app, type) < 0)
298 goto cleanup;
299
300 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@port)", type);
301 if ((gport = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
302 free(xpath);
303 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@socket)", type);
304 if ((unixsock = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
305 virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic address for the guest %s"),
306 priv->domkey);
307 goto cleanup;
308 }
309 } else {
310 free(xpath);
311 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@listen)", type);
312 ghost = virt_viewer_extract_xpath_string(xmldesc, xpath);
313 if (ghost == NULL)
314 ghost = g_strdup("localhost");
315 }
316
317 if (ghost && gport)
318 DEBUG_LOG("Guest graphics address is %s:%s", ghost, gport);
319 else if (unixsock)
320 DEBUG_LOG("Guest graphics address is %s", unixsock);
321
322 uri = virConnectGetURI(priv->conn);
323 if (virt_viewer_util_extract_host(uri, NULL, &host, &transport, &user, &port) < 0) {
324 virt_viewer_app_simple_message_dialog(app, _("Cannot determine the host for the guest %s"),
325 priv->domkey);
326 goto cleanup;
327 }
328
329 /* If the XML listen attribute shows a wildcard address, we need to
330 * throw that away since you obviously can't 'connect(2)' to that
331 * from a remote host. Instead we fallback to the hostname used in
332 * the libvirt URI. This isn't perfect but it is better than nothing
333 */
334 if (ghost &&
335 (strcmp(ghost, "0.0.0.0") == 0 ||
336 strcmp(ghost, "::") == 0)) {
337 DEBUG_LOG("Guest graphics listen '%s' is a wildcard, replacing with '%s'",
338 ghost, host);
339 g_free(ghost);
340 ghost = g_strdup(host);
341 }
342
343 virt_viewer_app_set_connect_info(app, host, ghost, gport, transport, unixsock, user, port);
344
345 retval = TRUE;
286 virDomainPtr dom)
287 {
288 char *type = NULL;
289 char *xpath = NULL;
290 gboolean retval = FALSE;
291 char *xmldesc = virDomainGetXMLDesc(dom, 0);
292 VirtViewerPrivate *priv = self->priv;
293 VirtViewerApp *app = VIRT_VIEWER_APP(self);
294 gchar *gport = NULL;
295 gchar *gtlsport = NULL;
296 gchar *ghost = NULL;
297 gchar *unixsock = NULL;
298 gchar *host = NULL;
299 gchar *transport = NULL;
300 gchar *user = NULL;
301 gint port = 0;
302 gchar *uri = NULL;
303
304 virt_viewer_app_free_connect_info(app);
305
306 if ((type = virt_viewer_extract_xpath_string(xmldesc, "string(/domain/devices/graphics/@type)")) == NULL) {
307 virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic type for the guest %s"),
308 priv->domkey);
309 goto cleanup;
310 }
311
312 if (virt_viewer_app_create_session(app, type) < 0)
313 goto cleanup;
314
315 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@port)", type);
316 if ((gport = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
317 free(xpath);
318 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@socket)", type);
319 if ((unixsock = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
320 virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic address for the guest %s"),
321 priv->domkey);
322 goto cleanup;
323 }
324 } else {
325 if (g_str_equal(type, "spice")) {
326 free(xpath);
327 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@tlsPort)", type);
328 gtlsport = virt_viewer_extract_xpath_string(xmldesc, xpath);
329 }
330
331 free(xpath);
332 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@listen)", type);
333 ghost = virt_viewer_extract_xpath_string(xmldesc, xpath);
334 }
335
336 if (ghost && gport)
337 DEBUG_LOG("Guest graphics address is %s:%s", ghost, gport);
338 else if (unixsock)
339 DEBUG_LOG("Guest graphics address is %s", unixsock);
340
341 uri = virConnectGetURI(priv->conn);
342 if (virt_viewer_util_extract_host(uri, NULL, &host, &transport, &user, &port) < 0) {
343 virt_viewer_app_simple_message_dialog(app, _("Cannot determine the host for the guest %s"),
344 priv->domkey);
345 goto cleanup;
346 }
347
348 /* If the XML listen attribute shows a wildcard address, we need to
349 * throw that away since you obviously can't 'connect(2)' to that
350 * from a remote host. Instead we fallback to the hostname used in
351 * the libvirt URI. This isn't perfect but it is better than nothing
352 */
353 if (!ghost ||
354 (strcmp(ghost, "0.0.0.0") == 0 ||
355 strcmp(ghost, "::") == 0)) {
356 DEBUG_LOG("Guest graphics listen '%s' is NULL or a wildcard, replacing with '%s'",
357 ghost ? ghost : "", host);
358 g_free(ghost);
359 ghost = g_strdup(host);
360 }
361
362 virt_viewer_app_set_connect_info(app, host, ghost, gport, gtlsport,transport, unixsock, user, port, NULL);
363
364 retval = TRUE;
346365
347366 cleanup:
348 g_free(gport);
349 g_free(ghost);
350 g_free(unixsock);
351 g_free(host);
352 g_free(transport);
353 g_free(user);
354 g_free(type);
355 g_free(xpath);
356 g_free(xmldesc);
357 g_free(uri);
358 return retval;
367 g_free(gport);
368 g_free(gtlsport);
369 g_free(ghost);
370 g_free(unixsock);
371 g_free(host);
372 g_free(transport);
373 g_free(user);
374 g_free(type);
375 g_free(xpath);
376 g_free(xmldesc);
377 g_free(uri);
378 return retval;
359379 }
360380
361381 static int
362382 virt_viewer_update_display(VirtViewer *self, virDomainPtr dom)
363383 {
364 VirtViewerPrivate *priv = self->priv;
365 VirtViewerApp *app = VIRT_VIEWER_APP(self);
366
367 virt_viewer_app_trace(app, "Guest %s is running, determining display\n",
368 priv->domkey);
369
370 g_object_set(app, "title", virDomainGetName(dom), NULL);
371
372 if (!virt_viewer_app_has_session(app)) {
373 if (!virt_viewer_extract_connect_info(self, dom))
374 return -1;
375 }
376
377 return 0;
384 VirtViewerPrivate *priv = self->priv;
385 VirtViewerApp *app = VIRT_VIEWER_APP(self);
386
387 if (priv->dom)
388 virDomainFree(priv->dom);
389 priv->dom = dom;
390 virDomainRef(priv->dom);
391
392 virt_viewer_app_trace(app, "Guest %s is running, determining display\n",
393 priv->domkey);
394
395 g_object_set(app, "title", virDomainGetName(dom), NULL);
396
397 if (!virt_viewer_app_has_session(app)) {
398 if (!virt_viewer_extract_connect_info(self, dom))
399 return -1;
400 }
401
402 return 0;
403 }
404
405 static gboolean
406 virt_viewer_open_connection(VirtViewerApp *self G_GNUC_UNUSED, int *fd)
407 {
408 #if defined(HAVE_SOCKETPAIR)
409 VirtViewer *viewer = VIRT_VIEWER(self);
410 VirtViewerPrivate *priv = viewer->priv;
411 int pair[2];
412 #endif
413 *fd = -1;
414 #if defined(HAVE_SOCKETPAIR)
415 if (!priv->dom)
416 return TRUE;
417
418 if (socketpair(PF_UNIX, SOCK_STREAM, 0, pair) < 0)
419 return FALSE;
420
421 if (virDomainOpenGraphics(priv->dom, 0, pair[0],
422 VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) < 0) {
423 virErrorPtr err = virGetLastError();
424 DEBUG_LOG("Error %s", err && err->message ? err->message : "Unknown");
425 close(pair[0]);
426 close(pair[1]);
427 return TRUE;
428 }
429 close(pair[0]);
430 *fd = pair[1];
431 #endif
432 return TRUE;
378433 }
379434
380435 static int
381436 virt_viewer_domain_event(virConnectPtr conn G_GNUC_UNUSED,
382 virDomainPtr dom,
383 int event,
384 int detail G_GNUC_UNUSED,
385 void *opaque)
386 {
387 VirtViewer *self = opaque;
388 VirtViewerApp *app = VIRT_VIEWER_APP(self);
389
390 DEBUG_LOG("Got domain event %d %d", event, detail);
391
392 if (!virt_viewer_matches_domain(self, dom))
393 return 0;
394
395 switch (event) {
396 case VIR_DOMAIN_EVENT_STOPPED:
397 //virt_viewer_deactivate(self);
398 break;
399
400 case VIR_DOMAIN_EVENT_STARTED:
401 virt_viewer_update_display(self, dom);
402 virt_viewer_app_activate(app);
403 break;
404 }
405
406 return 0;
437 virDomainPtr dom,
438 int event,
439 int detail G_GNUC_UNUSED,
440 void *opaque)
441 {
442 VirtViewer *self = opaque;
443 VirtViewerApp *app = VIRT_VIEWER_APP(self);
444
445 DEBUG_LOG("Got domain event %d %d", event, detail);
446
447 if (!virt_viewer_matches_domain(self, dom))
448 return 0;
449
450 switch (event) {
451 case VIR_DOMAIN_EVENT_STOPPED:
452 //virt_viewer_deactivate(self);
453 break;
454
455 case VIR_DOMAIN_EVENT_STARTED:
456 virt_viewer_update_display(self, dom);
457 virt_viewer_app_activate(app);
458 break;
459 }
460
461 return 0;
407462 }
408463
409464 static int
410465 virt_viewer_initial_connect(VirtViewerApp *app)
411466 {
412 virDomainPtr dom = NULL;
413 virDomainInfo info;
414 int ret = -1;
415 VirtViewer *self = VIRT_VIEWER(app);
416 VirtViewerPrivate *priv = self->priv;
417
418 virt_viewer_app_show_status(app, _("Finding guest domain"));
419 dom = virt_viewer_lookup_domain(self);
420 if (!dom) {
421 if (priv->waitvm) {
422 virt_viewer_app_show_status(app, _("Waiting for guest domain to be created"));
423 virt_viewer_app_trace(app, "Guest %s does not yet exist, waiting for it to be created\n",
424 priv->domkey);
425 goto done;
426 } else {
427 virt_viewer_app_simple_message_dialog(app, _("Cannot find guest domain %s"),
428 priv->domkey);
429 DEBUG_LOG("Cannot find guest %s", priv->domkey);
430 goto cleanup;
431 }
432 }
433
434 virt_viewer_app_show_status(app, _("Checking guest domain status"));
435 if (virDomainGetInfo(dom, &info) < 0) {
436 DEBUG_LOG("Cannot get guest state");
437 goto cleanup;
438 }
439
440 if (info.state == VIR_DOMAIN_SHUTOFF) {
441 virt_viewer_app_show_status(app, _("Waiting for guest domain to start"));
442 } else {
443 ret = virt_viewer_update_display(self, dom);
444 if (ret >= 0)
445 ret = VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->initial_connect(app);
446 if (ret < 0) {
447 if (priv->waitvm) {
448 virt_viewer_app_show_status(app, _("Waiting for guest domain to start server"));
449 virt_viewer_app_trace(app, "Guest %s has not activated its display yet, waiting for it to start\n",
450 priv->domkey);
451 } else {
452 DEBUG_LOG("Failed to activate viewer");
453 goto cleanup;
454 }
455 } else if (ret == 0) {
456 DEBUG_LOG("Failed to activate viewer");
457 ret = -1;
458 goto cleanup;
459 }
460 }
467 virDomainPtr dom = NULL;
468 virDomainInfo info;
469 int ret = -1;
470 VirtViewer *self = VIRT_VIEWER(app);
471 VirtViewerPrivate *priv = self->priv;
472
473 virt_viewer_app_show_status(app, _("Finding guest domain"));
474 dom = virt_viewer_lookup_domain(self);
475 if (!dom) {
476 if (priv->waitvm) {
477 virt_viewer_app_show_status(app, _("Waiting for guest domain to be created"));
478 virt_viewer_app_trace(app, "Guest %s does not yet exist, waiting for it to be created\n",
479 priv->domkey);
480 goto done;
481 } else {
482 virt_viewer_app_simple_message_dialog(app, _("Cannot find guest domain %s"),
483 priv->domkey);
484 DEBUG_LOG("Cannot find guest %s", priv->domkey);
485 goto cleanup;
486 }
487 }
488
489 virt_viewer_app_show_status(app, _("Checking guest domain status"));
490 if (virDomainGetInfo(dom, &info) < 0) {
491 DEBUG_LOG("Cannot get guest state");
492 goto cleanup;
493 }
494
495 if (info.state == VIR_DOMAIN_SHUTOFF) {
496 virt_viewer_app_show_status(app, _("Waiting for guest domain to start"));
497 } else {
498 ret = virt_viewer_update_display(self, dom);
499 if (ret >= 0)
500 ret = VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->initial_connect(app);
501 if (ret < 0) {
502 if (priv->waitvm) {
503 virt_viewer_app_show_status(app, _("Waiting for guest domain to start server"));
504 virt_viewer_app_trace(app, "Guest %s has not activated its display yet, waiting for it to start\n",
505 priv->domkey);
506 } else {
507 DEBUG_LOG("Failed to activate viewer");
508 goto cleanup;
509 }
510 } else if (ret == 0) {
511 DEBUG_LOG("Failed to activate viewer");
512 ret = -1;
513 goto cleanup;
514 }
515 }
461516
462517 done:
463 ret = 0;
518 ret = 0;
464519 cleanup:
465 if (dom)
466 virDomainFree(dom);
467 return ret;
520 if (dom)
521 virDomainFree(dom);
522 return ret;
468523 }
469524
470525 static void
471526 virt_viewer_error_func (void *data G_GNUC_UNUSED,
472 virErrorPtr error G_GNUC_UNUSED)
473 {
474 /* nada */
475 }
527 virErrorPtr error G_GNUC_UNUSED)
528 {
529 /* nada */
530 }
531
532
533
534 static int
535 virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
536 unsigned int ncred,
537 void *cbdata)
538 {
539 char **username = NULL, **password = NULL;
540 VirtViewer *app = cbdata;
541 int i;
542 int ret = -1;
543
544 DEBUG_LOG("Got libvirt credential request for %d credential(s)", ncred);
545
546 for (i = 0 ; i < ncred ; i++) {
547 switch (cred[i].type) {
548 case VIR_CRED_USERNAME:
549 case VIR_CRED_AUTHNAME:
550 username = &cred[i].result;
551 break;
552 case VIR_CRED_PASSPHRASE:
553 password = &cred[i].result;
554 break;
555 default:
556 DEBUG_LOG("Unsupported libvirt credential %d", cred[i].type);
557 return -1;
558 }
559 }
560
561 if (username || password) {
562 VirtViewerWindow *vwin = virt_viewer_app_get_main_window(VIRT_VIEWER_APP(app));
563 GtkWindow *win = virt_viewer_window_get_window(vwin);
564 ret = virt_viewer_auth_collect_credentials(win,
565 "libvirt",
566 app->priv->uri,
567 username, password);
568 if (ret < 0)
569 goto cleanup;
570 } else {
571 ret = 0;
572 }
573
574 for (i = 0 ; i < ncred ; i++) {
575 switch (cred[i].type) {
576 case VIR_CRED_AUTHNAME:
577 case VIR_CRED_USERNAME:
578 case VIR_CRED_PASSPHRASE:
579 if (cred[i].result)
580 cred[i].resultlen = strlen(cred[i].result);
581 else
582 cred[i].resultlen = 0;
583 DEBUG_LOG("Got '%s' %d %d", cred[i].result, cred[i].resultlen, cred[i].type);
584 break;
585 }
586 }
587
588 cleanup:
589 DEBUG_LOG("Return %d", ret);
590 return ret;
591 }
592
476593
477594 static gboolean
478595 virt_viewer_start(VirtViewerApp *app)
479596 {
480 VirtViewer *self = VIRT_VIEWER(app);
481 VirtViewerPrivate *priv = self->priv;
482 int cred_types[] =
483 { VIR_CRED_AUTHNAME, VIR_CRED_PASSPHRASE };
484 virConnectAuth auth_libvirt = {
485 .credtype = cred_types,
486 .ncredtype = ARRAY_CARDINALITY(cred_types),
487 .cb = virt_viewer_auth_libvirt_credentials,
488 .cbdata = (void *)priv->uri,
489 };
490
491 virt_viewer_events_register();
492
493 virSetErrorFunc(NULL, virt_viewer_error_func);
494
495 virt_viewer_app_trace(app, "Opening connection to libvirt with URI %s\n",
496 priv->uri ? priv->uri : "<null>");
497 priv->conn = virConnectOpenAuth(priv->uri,
498 //virConnectAuthPtrDefault,
499 &auth_libvirt,
500 VIR_CONNECT_RO);
501 if (!priv->conn) {
502 virt_viewer_app_simple_message_dialog(app, _("Unable to connect to libvirt with URI %s"),
503 priv->uri ? priv->uri : _("[none]"));
504 return FALSE;
505 }
506
507 if (virt_viewer_app_initial_connect(app) < 0)
508 return FALSE;
509
510 if (virConnectDomainEventRegister(priv->conn,
511 virt_viewer_domain_event,
512 self,
513 NULL) < 0)
514 priv->withEvents = FALSE;
515 else
516 priv->withEvents = TRUE;
517
518 if (!priv->withEvents &&
519 !virt_viewer_app_is_active(app)) {
520 DEBUG_LOG("No domain events, falling back to polling");
521 virt_viewer_app_start_reconnect_poll(app);
522 }
523
524 return VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->start(app);
597 VirtViewer *self = VIRT_VIEWER(app);
598 VirtViewerPrivate *priv = self->priv;
599 int cred_types[] =
600 { VIR_CRED_AUTHNAME, VIR_CRED_PASSPHRASE };
601 virConnectAuth auth_libvirt = {
602 .credtype = cred_types,
603 .ncredtype = ARRAY_CARDINALITY(cred_types),
604 .cb = virt_viewer_auth_libvirt_credentials,
605 .cbdata = app,
606 };
607 int oflags = 0;
608
609 if (!virt_viewer_app_get_attach(app))
610 oflags |= VIR_CONNECT_RO;
611
612 virt_viewer_events_register();
613
614 virSetErrorFunc(NULL, virt_viewer_error_func);
615
616 virt_viewer_app_trace(app, "Opening connection to libvirt with URI %s\n",
617 priv->uri ? priv->uri : "<null>");
618 priv->conn = virConnectOpenAuth(priv->uri,
619 //virConnectAuthPtrDefault,
620 &auth_libvirt,
621 oflags);
622 if (!priv->conn) {
623 virt_viewer_app_simple_message_dialog(app, _("Unable to connect to libvirt with URI %s"),
624 priv->uri ? priv->uri : _("[none]"));
625 return FALSE;
626 }
627
628 if (virt_viewer_app_initial_connect(app) < 0)
629 return FALSE;
630
631 if (virConnectDomainEventRegister(priv->conn,
632 virt_viewer_domain_event,
633 self,
634 NULL) < 0)
635 priv->withEvents = FALSE;
636 else
637 priv->withEvents = TRUE;
638
639 if (!priv->withEvents &&
640 !virt_viewer_app_is_active(app)) {
641 DEBUG_LOG("No domain events, falling back to polling");
642 virt_viewer_app_start_reconnect_poll(app);
643 }
644
645 return VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->start(app);
525646 }
526647
527648 VirtViewer *
528649 virt_viewer_new(const char *uri,
529 const char *name,
530 gint zoom,
531 gboolean direct,
532 gboolean waitvm,
533 gboolean reconnect,
534 gboolean verbose,
535 GtkWidget *container)
536 {
537 VirtViewer *self;
538 VirtViewerApp *app;
539 VirtViewerPrivate *priv;
540
541 self = g_object_new(VIRT_VIEWER_TYPE,
542 "container", container,
543 "verbose", verbose,
544 "guest-name", name,
545 NULL);
546 app = VIRT_VIEWER_APP(self);
547 priv = self->priv;
548
549 /* Set initial title based on guest name arg, which can be a ID,
550 * UUID, or NAME string. To be replaced with the real guest name later
551 */
552 g_object_set(app, "title", name, NULL);
553 virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom);
554 virt_viewer_app_set_direct(app, direct);
555
556 /* should probably be properties instead */
557 priv->uri = g_strdup(uri);
558 priv->domkey = g_strdup(name);
559 priv->waitvm = waitvm;
560 priv->reconnect = reconnect;
561
562 return self;
650 const char *name,
651 gint zoom,
652 gboolean direct,
653 gboolean attach,
654 gboolean waitvm,
655 gboolean reconnect,
656 gboolean verbose,
657 GtkWidget *container)
658 {
659 VirtViewer *self;
660 VirtViewerApp *app;
661 VirtViewerPrivate *priv;
662
663 self = g_object_new(VIRT_VIEWER_TYPE,
664 "container", container,
665 "verbose", verbose,
666 "guest-name", name,
667 NULL);
668 app = VIRT_VIEWER_APP(self);
669 priv = self->priv;
670
671 /* Set initial title based on guest name arg, which can be a ID,
672 * UUID, or NAME string. To be replaced with the real guest name later
673 */
674 g_object_set(app, "title", name, NULL);
675 virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom);
676 virt_viewer_app_set_direct(app, direct);
677 virt_viewer_app_set_attach(app, attach);
678
679 /* should probably be properties instead */
680 priv->uri = g_strdup(uri);
681 priv->domkey = g_strdup(name);
682 priv->waitvm = waitvm;
683 priv->reconnect = reconnect;
684
685 return self;
563686 }
564687
565688 /*
566689 * Local variables:
567 * c-indent-level: 8
568 * c-basic-offset: 8
569 * tab-width: 8
570 * indent-tabs-mode: t
690 * c-indent-level: 4
691 * c-basic-offset: 4
692 * indent-tabs-mode: nil
571693 * End:
572694 */
00 /*
11 * Virt Viewer: A virtual machine console viewer
22 *
3 * Copyright (C) 2007 Red Hat,
3 * Copyright (C) 2007-2012 Red Hat, Inc.
44 *
55 * This program is free software; you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
3737 typedef struct _VirtViewerPrivate VirtViewerPrivate;
3838
3939 typedef struct {
40 VirtViewerApp parent;
41 VirtViewerPrivate *priv;
40 VirtViewerApp parent;
41 VirtViewerPrivate *priv;
4242 } VirtViewer;
4343
4444 typedef struct {
45 VirtViewerAppClass parent_class;
45 VirtViewerAppClass parent_class;
4646 } VirtViewerClass;
4747
4848 GType virt_viewer_get_type (void);
4949
5050 VirtViewer *
5151 virt_viewer_new(const char *uri,
52 const char *name,
53 gint zoom,
54 gboolean direct,
55 gboolean waitvm,
56 gboolean reconnect,
57 gboolean verbose,
58 GtkWidget *container);
52 const char *name,
53 gint zoom,
54 gboolean direct,
55 gboolean attach,
56 gboolean waitvm,
57 gboolean reconnect,
58 gboolean verbose,
59 GtkWidget *container);
5960
6061 G_END_DECLS
6162
6263 #endif /* VIRT_VIEWER_H */
64
65 /*
66 * Local variables:
67 * c-indent-level: 4
68 * c-basic-offset: 4
69 * indent-tabs-mode: nil
70 * End:
71 */
3232 <property name="label" translatable="yes">Screenshot</property>
3333 <property name="use_underline">True</property>
3434 <signal name="activate" handler="virt_viewer_window_menu_file_screenshot" swapped="no"/>
35 </object>
36 </child>
37 <child>
38 <object class="GtkMenuItem" id="menu-file-usb-device-selection">
39 <property name="visible">True</property>
40 <property name="sensitive">False</property>
41 <property name="can_focus">False</property>
42 <property name="use_action_appearance">False</property>
43 <property name="label" translatable="yes">USB device selection</property>
44 <property name="use_underline">True</property>
45 <signal name="activate" handler="virt_viewer_window_menu_file_usb_device_selection" swapped="no"/>
3546 </object>
3647 </child>
3748 <child>
1919 %endif
2020
2121 Name: virt-viewer
22 Version: 0.4.2
22 Version: 0.5.0
2323 Release: 1%{?dist}%{?extra_release}
2424 Summary: Virtual Machine Viewer
2525 Group: Applications/System
2828 Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
2929 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3030 Requires: openssh-clients
31 Requires(post): %{_sbindir}/update-alternatives
32 Requires(postun): %{_sbindir}/update-alternatives
3133
3234 %if %{with_gtk3}
3335 BuildRequires: gtk3-devel >= 3.0.0
4345 %endif
4446 %if %{with_spice}
4547 %if %{with_gtk3}
46 BuildRequires: spice-gtk3-devel >= 0.6
48 BuildRequires: spice-gtk3-devel >= 0.9
4749 %else
48 BuildRequires: spice-gtk-devel >= 0.6
50 BuildRequires: spice-gtk-devel >= 0.9
4951 %endif
5052 %endif
5153 BuildRequires: /usr/bin/pod2man
108110 %install
109111 rm -rf $RPM_BUILD_ROOT
110112 %__make install DESTDIR=$RPM_BUILD_ROOT
113 mkdir -p %{buildroot}%{_libexecdir}
114 touch %{buildroot}%{_libexecdir}/spice-xpi-client
115 install -m 0755 data/spice-xpi-client-remote-viewer %{buildroot}%{_libexecdir}/
111116 %if %{_with_plugin}
112117 rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.a
113118 rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.la
117122 %clean
118123 rm -rf $RPM_BUILD_ROOT
119124
125 %post
126 /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
127 %{_sbindir}/update-alternatives --install %{_libexecdir}/spice-xpi-client \
128 spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer 20
129
130 %postun
131 if [ $1 -eq 0 ] ; then
132 /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
133 /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
134 %{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer
135 fi
136
137 %posttrans
138 /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
139
120140 %files -f %{name}.lang
121141 %defattr(-,root,root,-)
122142 %doc README COPYING AUTHORS ChangeLog NEWS
123143 %{_bindir}/%{name}
144 %{_bindir}/remote-viewer
124145 %dir %{_datadir}/%{name}
125146 %dir %{_datadir}/%{name}/ui/
126147 %{_datadir}/%{name}/ui/virt-viewer.xml
127148 %{_datadir}/%{name}/ui/virt-viewer-auth.xml
128149 %{_datadir}/%{name}/ui/virt-viewer-about.xml
129 %{_mandir}/man1/%{name}*
150 %{_datadir}/icons/hicolor/*/apps/*
151 %ghost %{_libexecdir}/spice-xpi-client
152 %{_libexecdir}/spice-xpi-client-remote-viewer
153 %{_mandir}/man1/virt-viewer.1*
154 %{_mandir}/man1/remote-viewer.1*
130155
131156 %if %{_with_plugin}
132157 %files plugin
2828 Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
2929 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3030 Requires: openssh-clients
31 Requires(post): %{_sbindir}/update-alternatives
32 Requires(postun): %{_sbindir}/update-alternatives
3133
3234 %if %{with_gtk3}
3335 BuildRequires: gtk3-devel >= 3.0.0
4345 %endif
4446 %if %{with_spice}
4547 %if %{with_gtk3}
46 BuildRequires: spice-gtk3-devel >= 0.6
48 BuildRequires: spice-gtk3-devel >= 0.9
4749 %else
48 BuildRequires: spice-gtk-devel >= 0.6
50 BuildRequires: spice-gtk-devel >= 0.9
4951 %endif
5052 %endif
5153 BuildRequires: /usr/bin/pod2man
108110 %install
109111 rm -rf $RPM_BUILD_ROOT
110112 %__make install DESTDIR=$RPM_BUILD_ROOT
113 mkdir -p %{buildroot}%{_libexecdir}
114 touch %{buildroot}%{_libexecdir}/spice-xpi-client
115 install -m 0755 data/spice-xpi-client-remote-viewer %{buildroot}%{_libexecdir}/
111116 %if %{_with_plugin}
112117 rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.a
113118 rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.la
117122 %clean
118123 rm -rf $RPM_BUILD_ROOT
119124
125 %post
126 /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
127 %{_sbindir}/update-alternatives --install %{_libexecdir}/spice-xpi-client \
128 spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer 20
129
130 %postun
131 if [ $1 -eq 0 ] ; then
132 /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
133 /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
134 %{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer
135 fi
136
137 %posttrans
138 /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
139
120140 %files -f %{name}.lang
121141 %defattr(-,root,root,-)
122142 %doc README COPYING AUTHORS ChangeLog NEWS
123143 %{_bindir}/%{name}
144 %{_bindir}/remote-viewer
124145 %dir %{_datadir}/%{name}
125146 %dir %{_datadir}/%{name}/ui/
126147 %{_datadir}/%{name}/ui/virt-viewer.xml
127148 %{_datadir}/%{name}/ui/virt-viewer-auth.xml
128149 %{_datadir}/%{name}/ui/virt-viewer-about.xml
129 %{_mandir}/man1/%{name}*
150 %{_datadir}/icons/hicolor/*/apps/*
151 %ghost %{_libexecdir}/spice-xpi-client
152 %{_libexecdir}/spice-xpi-client-remote-viewer
153 %{_mandir}/man1/virt-viewer.1*
154 %{_mandir}/man1/remote-viewer.1*
130155
131156 %if %{_with_plugin}
132157 %files plugin