Debian Codegraph @

src/byzanzrecorder.h

raw symbols SCIP
1 /* desktop session recorder
2 * Copyright (C) 2009 Benjamin Otte <[email protected]>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include <gdk/gdk.h>
19
20 #ifndef __HAVE_BYZANZ_RECORDER_H__
21 #define __HAVE_BYZANZ_RECORDER_H__
22
23 typedef struct _ByzanzRecorder ByzanzRecorder;
24 typedef struct _ByzanzRecorderClass ByzanzRecorderClass;
25
26 /* 25 fps */
27 #define BYZANZ_RECORDER_FRAME_RATE_MS 1000 / 25
28
29 #define BYZANZ_TYPE_RECORDER (byzanz_recorder_get_type())
30 #define BYZANZ_IS_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BYZANZ_TYPE_RECORDER))
31 #define BYZANZ_IS_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BYZANZ_TYPE_RECORDER))
32 #define BYZANZ_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BYZANZ_TYPE_RECORDER, ByzanzRecorder))
33 #define BYZANZ_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BYZANZ_TYPE_RECORDER, ByzanzRecorderClass))
34 #define BYZANZ_RECORDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BYZANZ_TYPE_RECORDER, ByzanzRecorderClass))
35
36 struct _ByzanzRecorder {
37 GObject object;
38
39 GdkWindow * window; /* window we are recording from */
40 cairo_rectangle_int_t area; /* area of window that we record */
41 gboolean recording; /* wether we should be recording now */
42
43 int damage_event_base; /* base event for Damage extension */
44 int damage_error_base; /* base error for Damage extension */
45 int fixes_event_base; /* base event for Fixes extension */
46 int fixes_error_base; /* base error for Fixes extension */
47
48 GSequence * layers; /* sequence of ByzanzLayer, ordered by layer depth */
49
50 guint next_image_source; /* timer that fires when enough time after the last frame has elapsed */
51 };
52
53 struct _ByzanzRecorderClass {
54 GObjectClass object_class;
55
56 void (* image) (ByzanzRecorder * recorder,
57 cairo_surface_t * surface,
58 const cairo_surface_t * region,
59 const GTimeVal * tv);
60 };
61
62 GType byzanz_recorder_get_type (void) G_GNUC_CONST;
63
64 ByzanzRecorder * byzanz_recorder_new (GdkWindow * window,
65 cairo_rectangle_int_t * area);
66
67 void byzanz_recorder_set_recording (ByzanzRecorder * recorder,
68 gboolean recording);
69 gboolean byzanz_recorder_get_recording (ByzanzRecorder * recorder);
70
71 void byzanz_recorder_queue_snapshot (ByzanzRecorder * recorder);
72
73
74 #endif /* __HAVE_BYZANZ_RECORDER_H__ */