~ubuntu-branches/ubuntu/dapper/xscreensaver/dapper-updates

« back to all changes in this revision

Viewing changes to utils/grabscreen.h

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Hildebrandt
  • Date: 2005-04-09 00:06:43 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20050409000643-z0abtifbt9s20pcc
Tags: 4.21-3
Patch by Joachim Breitner to check more frequently if DPMS kicked in (closes: #303374, #286664).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* xscreensaver, Copyright (c) 1992, 1993, 1994, 1997
 
1
/* xscreensaver, Copyright (c) 1992, 1993, 1994, 1997, 2001, 2003, 2004, 2005
2
2
 *  Jamie Zawinski <jwz@jwz.org>
3
3
 *
4
4
 * Permission to use, copy, modify, distribute, and sell this software and its
13
13
#ifndef __GRABSCREEN_H__
14
14
#define __GRABSCREEN_H__
15
15
 
16
 
/* This will write a snapshot of the screen image into the given window.
17
 
   Beware that the colormap of the window may also be changed (to match
18
 
   the bits that were drawn.)
19
 
 */
20
 
extern void grab_screen_image (Screen *, Window);
 
16
/* This will write an image onto the given Drawable.
 
17
   The Drawable (arg 3) may be a Window or a Pixmap.
 
18
 
 
19
   The Window must be the top-level window.  The image *may or may not*
 
20
   be written to the window, though it will definitely be written to
 
21
   the drawable.  It's fine for args 2 and 3 to be the same window, or
 
22
   for arg 2 to be a Window, and arg 3 to be a Pixmap.
 
23
 
 
24
   The loaded image might be from a file, or from a screen shot of the
 
25
   desktop, or from the system's video input, depending on user
 
26
   preferences.
 
27
 
 
28
   If it is from a file, then it will be returned in `filename_return'.
 
29
   filename_return may be NULL; also, NULL may be returned (e.g., if
 
30
   it's a screenshot or video capture.)  You are responsible for
 
31
   freeing this string.
 
32
 
 
33
   The size and position of the image is returned in `geometry_return'.
 
34
   The image will generally have been scaled up to fit the window, but
 
35
   if a loaded file had a different aspect ratio than the window, it
 
36
   will have been centered, and the returned coords will describe that.
 
37
 
 
38
   Many colors may be allocated from the window's colormap.
 
39
 */
 
40
extern void load_random_image (Screen *screen,
 
41
                               Window top_level_window,
 
42
                               Drawable target_window_or_pixmap, 
 
43
                               char **filename_return,
 
44
                               XRectangle *geometry_return);
 
45
 
 
46
/* Like the above, but loads the image in the background and runs the
 
47
   given callback once it has been loaded.  Copy `name' if you want
 
48
   to keep it.
 
49
 */
 
50
extern void fork_load_random_image (Screen *screen, Window window,
 
51
                                    Drawable drawable,
 
52
                                    void (*callback) (Screen *, Window,
 
53
                                                      Drawable,
 
54
                                                      const char *name,
 
55
                                                      XRectangle *geometry,
 
56
                                                      void *closure),
 
57
                                    void *closure);
 
58
 
21
59
 
22
60
/* Whether one should use GCSubwindowMode when drawing on this window
23
61
   (assuming a screen image has been grabbed onto it.)  Yes, this is a
24
62
   total kludge. */
25
63
extern Bool use_subwindow_mode_p(Screen *screen, Window window);
26
64
 
 
65
/* Whether the given window is:
 
66
   - the real root window;
 
67
   - the virtual root window;
 
68
   - a direct child of the root window;
 
69
   - a direct child of the window manager's decorations.
 
70
 */
 
71
extern Bool top_level_window_p(Screen *screen, Window window);
 
72
 
 
73
 
 
74
/* Don't call this: this is for the "xscreensaver-getimage" program only. */
 
75
extern void grab_screen_image_internal (Screen *, Window);
 
76
 
 
77
/* Don't use these: this is how "xscreensaver-getimage" and "grabclient.c"
 
78
   pass the file name around. */
 
79
#define XA_XSCREENSAVER_IMAGE_FILENAME "_SCREENSAVER_IMAGE_FILENAME"
 
80
#define XA_XSCREENSAVER_IMAGE_GEOMETRY "_SCREENSAVER_IMAGE_GEOMETRY"
 
81
 
27
82
#endif /* __GRABSCREEN_H__ */