Debian Codegraph @

src/byzanzsession.h

raw symbols SCIP
1 /* desktop session recorder
2 * Copyright (C) 2005,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 <glib.h>
19 #include <gtk/gtk.h>
20
21 #include "byzanzencoder.h"
22 #include "byzanzqueue.h"
23 #include "byzanzrecorder.h"
24
25 #ifndef __HAVE_BYZANZ_SESSION_H__
26 #define __HAVE_BYZANZ_SESSION_H__
27
28 typedef struct _ByzanzSession ByzanzSession;
29 typedef struct _ByzanzSessionClass ByzanzSessionClass;
30
31 #define BYZANZ_TYPE_SESSION (byzanz_session_get_type())
32 #define BYZANZ_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BYZANZ_TYPE_SESSION))
33 #define BYZANZ_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BYZANZ_TYPE_SESSION))
34 #define BYZANZ_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BYZANZ_TYPE_SESSION, ByzanzSession))
35 #define BYZANZ_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BYZANZ_TYPE_SESSION, ByzanzSessionClass))
36 #define BYZANZ_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BYZANZ_TYPE_SESSION, ByzanzSessionClass))
37
38 struct _ByzanzSession {
39 GObject object;
40
41 /*< private >*/
42 /* properties */
43 GFile * file; /* file we're saving to */
44 cairo_rectangle_int_t area; /* area of window to record */
45 GdkWindow * window; /* window to record */
46 gboolean record_audio; /* TRUE to record audio */
47 GType encoder_type; /* type of encoder to use */
48 ByzanzQueue * queue; /* queue we use as data cache */
49 GTimeVal start_time; /* when we started writing to queue */
50
51 /* internal objects */
52 GCancellable * cancellable; /* cancellable to use for aborting the session */
53 ByzanzRecorder * recorder; /* the recorder in use */
54 ByzanzEncoder * encoder; /* encoding thread */
55 GError * error; /* NULL or the error we're in */
56 };
57
58 struct _ByzanzSessionClass {
59 GObjectClass object_class;
60 };
61
62 GType byzanz_session_get_type (void) G_GNUC_CONST;
63
64
65 ByzanzSession * byzanz_session_new (GFile * file,
66 GType encoder_type,
67 GdkWindow * window,
68 const cairo_rectangle_int_t * area,
69 gboolean record_cursor,
70 gboolean record_audio);
71 void byzanz_session_start (ByzanzSession * session);
72 void byzanz_session_stop (ByzanzSession * session);
73 void byzanz_session_abort (ByzanzSession * session);
74
75 gboolean byzanz_session_is_recording (ByzanzSession * session);
76 gboolean byzanz_session_is_encoding (ByzanzSession * session);
77 const GError * byzanz_session_get_error (ByzanzSession * session);
78
79
80 #endif /* __HAVE_BYZANZ_SESSION_H__ */