4
* This file contains some state variables for the capture area frame
5
* and generic functions like setter/getter for state etc.
4
9
* Copyright (C) 1997 Rasca Gmelch, Berlin
10
* Copyright (C) 2004-07 Karl, Frankfurt
6
12
* This program is free software; you can redistribute it and/or modify
7
13
* it under the terms of the GNU General Public License as published by
11
17
* This program is distributed in the hope that it will be useful,
12
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
20
* GNU General Public License for more details.
16
22
* You should have received a copy of the GNU General Public License
18
24
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
28
#include <X11/Intrinsic.h>
26
* return a pointer to the current area enclosed by the frame
31
#ifndef DOXYGEN_SHOULD_SKIP_THIS
32
#define DEBUGFILE "frame.c"
33
#endif // DOXYGEN_SHOULD_SKIP_THIS
35
/** \brief stores the state of the frame lock */
36
static int xvc_frame_lock;
38
/** \brief stores the area enclosed by the frame as an XRectangle */
39
static XRectangle xvc_frame_rectangle;
42
* \brief return a pointer to the current area enclosed by the capture frame
44
* @return a pointer to an XRectangle struct
30
extern XRectangle XVC_frame_rectangle;
32
return (&XVC_frame_rectangle);
47
xvc_get_capture_area (void)
49
return (&xvc_frame_rectangle);
53
* \brief get the state of the frame lock
55
* @return integer state of the frame lock: 1 = locked, 0 = unlocked
40
extern int XVC_frame_lock;
42
return (XVC_frame_lock);
58
xvc_is_frame_locked ()
60
return (xvc_frame_lock);
64
* \brief set the state of the frame lock
66
* @param lock integer state of the frame lock: 0 = unlocked, >0 = locked
69
xvc_set_frame_locked (int lock)
72
xvc_frame_lock = lock;
78
* \brief get the window attributes for the given window
80
* @param win a Window to retrieve the attributes for. Can be a single window,
81
* the root window (if manually selected) or None (in which case we will
82
* select the root window ourselves
83
* @param wa return pointer to the XWindowAttributes struct to write to
86
xvc_get_window_attributes (Window win, XWindowAttributes * wa)
88
#define DEBUGFUNCTION "xvc_get_window_attributes()"
90
Display *display = xvc_frame_get_capture_display ();
93
win = DefaultRootWindow (display);
96
if (!XGetWindowAttributes (display, win, wa)) {
99
snprintf (msg, 256, "%s %s: Can't get window attributes!\n",
100
DEBUGFILE, DEBUGFUNCTION);
103
#undef DEBUGFUNCTTION