~ubuntu-branches/ubuntu/vivid/gtk-vnc/vivid-proposed

« back to all changes in this revision

Viewing changes to tools/gvnccapture.c

  • Committer: Package Import Robot
  • Author(s): Laurent Léonard
  • Date: 2012-07-24 00:49:55 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20120724004955-6711f7ontxvn9yzy
Tags: 0.5.1-1
* [e2591bf] Imported Upstream version 0.5.1
* [a0f6408] Drop patch
  - Allow-Unix-domain-sockets-in-gvncviewer.patch - fixed upstream
* [c031b94] Bump Standards-Version to 3.9.3
* [61e5796] Set build directories for dh_auto_clean
* [7fde78d] Drop patch
  - Look-for-generated-enums-in-srcdir.patch
* [fada5be] Add dh_auto_test override
* [d7567f1] Update symbols
* [6189676] Enable dpkg-buildflags

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
/*
22
 
  =head1 NAME
23
 
 
24
 
  gvnccapture - VNC screenshot capture
25
 
 
26
 
  =head1 SYNOPSIS
27
 
 
28
 
  gvnccapture [OPTION]... [HOST][:DISPLAY] FILENAME
29
 
 
30
 
  =head1 DESCRIPTION
31
 
 
32
 
  Capture a screenshot of the VNC desktop at HOST:DISPLAY saving to the
33
 
  image file FILENAME. If HOST is omitted it defaults to "localhost",
34
 
  if :DISPLAY is omitted, it defaults to ":1". FILENAME must end in a
35
 
  known image format extension (eg ".png", ".jpeg"). Supported options
36
 
  are
37
 
 
38
 
  =over 4
39
 
 
40
 
  =item --help, -?
41
 
 
42
 
  Display command line help information
43
 
 
44
 
  =item --quiet, -q
45
 
 
46
 
  Do not display information on the console when capturing the screenshot,
47
 
  with the exception of any password prompt.
48
 
 
49
 
  =item --debug, -d
50
 
 
51
 
  Display verbose debugging information on the console
52
 
 
53
 
  =back
54
 
 
55
 
  =head1 EXIT STATUS
56
 
 
57
 
  The exit status is 0 upon successful screen capture, otherwise
58
 
  it is a non-zero integer
59
 
 
60
 
  =head1 EXAMPLES
61
 
 
62
 
  # gvnccapture localhost:1 desktop.png
63
 
  Password:
64
 
  Connected to localhost:1
65
 
  Saved display to desktop.png
66
 
 
67
 
  =head1 AUTHORS
68
 
 
69
 
  Daniel P. Berrange <dan@berrange.com>
70
 
 
71
 
  =head1 COPYRIGHT
72
 
 
73
 
  Copyright (C) 2010 Daniel P. Berrange <dan@berrange.com>.
74
 
 
75
 
  License LGPLv2+: GNU Lesser GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
76
 
 
77
 
  This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
78
 
 
79
 
  =head1 SEE ALSO
80
 
 
81
 
  vinagre(1)
82
 
 
83
 
  =cut
 
22
=head1 NAME
 
23
 
 
24
gvnccapture - VNC screenshot capture
 
25
 
 
26
=head1 SYNOPSIS
 
27
 
 
28
gvnccapture [OPTION]... [HOST][:DISPLAY] FILENAME
 
29
 
 
30
=head1 DESCRIPTION
 
31
 
 
32
Capture a screenshot of the VNC desktop at HOST:DISPLAY saving to the
 
33
image file FILENAME. If HOST is omitted it defaults to "localhost",
 
34
if :DISPLAY is omitted, it defaults to ":1". FILENAME must end in a
 
35
known image format extension (eg ".png", ".jpeg"). Supported options
 
36
are
 
37
 
 
38
=over 4
 
39
 
 
40
=item --help, -?
 
41
 
 
42
Display command line help information
 
43
 
 
44
=item --quiet, -q
 
45
 
 
46
Do not display information on the console when capturing the screenshot,
 
47
with the exception of any password prompt.
 
48
 
 
49
=item --debug, -d
 
50
 
 
51
Display verbose debugging information on the console
 
52
 
 
53
=back
 
54
 
 
55
=head1 EXIT STATUS
 
56
 
 
57
The exit status is 0 upon successful screen capture, otherwise
 
58
it is a non-zero integer
 
59
 
 
60
=head1 EXAMPLES
 
61
 
 
62
 # gvnccapture localhost:1 desktop.png
 
63
 Password:
 
64
 Connected to localhost:1
 
65
 Saved display to desktop.png
 
66
 
 
67
=head1 AUTHORS
 
68
 
 
69
Daniel P. Berrange <dan@berrange.com>
 
70
 
 
71
=head1 COPYRIGHT
 
72
 
 
73
Copyright (C) 2010 Daniel P. Berrange <dan@berrange.com>.
 
74
 
 
75
License LGPLv2+: GNU Lesser GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
 
76
 
 
77
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
 
78
 
 
79
=head1 SEE ALSO
 
80
 
 
81
vinagre(1)
 
82
 
 
83
=cut
84
84
*/
85
85
 
86
86
#include <config.h>
257
257
    VncBaseFramebuffer *fb;
258
258
 
259
259
    if (capture->pixbuf) {
260
 
        gdk_pixbuf_unref(capture->pixbuf);
 
260
        g_object_unref(capture->pixbuf);
261
261
        capture->pixbuf = NULL;
262
262
    }
263
263
 
542
542
    vnc_connection_shutdown(capture->conn);
543
543
    g_object_unref(capture->conn);
544
544
    if (capture->pixbuf)
545
 
        gdk_pixbuf_unref(capture->pixbuf);
 
545
        g_object_unref(capture->pixbuf);
546
546
 
547
547
    ret = capture->saved ? 0 : 1;
548
548