| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifdef HAVE_CONFIG_H |
| 19 |
#include "config.h" |
| 20 |
#endif |
| 21 |
|
| 22 |
#include "byzanzencoderbyzanz.h" |
| 23 |
|
| 24 |
#include <string.h> |
| 25 |
#include <glib/gi18n.h> |
| 26 |
|
| 27 |
#include "byzanzserialize.h" |
| 28 |
|
| 29 |
G_DEFINE_TYPE (ByzanzEncoderByzanz, byzanz_encoder_byzanz, BYZANZ_TYPE_ENCODER) |
| 30 |
|
| 31 |
static gboolean |
| 32 |
byzanz_encoder_byzanz_setup (ByzanzEncoder * encoder, |
| 33 |
GOutputStream * stream, |
| 34 |
guint width, |
| 35 |
guint height, |
| 36 |
GCancellable * cancellable, |
| 37 |
GError ** error) |
| 38 |
{ |
| 39 |
return byzanz_serialize_header (stream, width, height, cancellable, error); |
| 40 |
} |
| 41 |
|
| 42 |
static gboolean |
| 43 |
byzanz_encoder_byzanz_process (ByzanzEncoder * encoder, |
| 44 |
GOutputStream * stream, |
| 45 |
guint64 msecs, |
| 46 |
cairo_surface_t * surface, |
| 47 |
const cairo_region_t * region, |
| 48 |
GCancellable * cancellable, |
| 49 |
GError ** error) |
| 50 |
{ |
| 51 |
return byzanz_serialize (stream, msecs, surface, region, cancellable, error); |
| 52 |
} |
| 53 |
|
| 54 |
static gboolean |
| 55 |
byzanz_encoder_byzanz_close (ByzanzEncoder * encoder, |
| 56 |
GOutputStream * stream, |
| 57 |
guint64 msecs, |
| 58 |
GCancellable * cancellable, |
| 59 |
GError ** error) |
| 60 |
{ |
| 61 |
return byzanz_serialize (stream, msecs, NULL, NULL, cancellable, error); |
| 62 |
} |
| 63 |
|
| 64 |
static void |
| 65 |
byzanz_encoder_byzanz_class_init (ByzanzEncoderByzanzClass *klass) |
| 66 |
{ |
| 67 |
ByzanzEncoderClass *encoder_class = BYZANZ_ENCODER_CLASS (klass); |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
encoder_class->setup = byzanz_encoder_byzanz_setup; |
| 73 |
encoder_class->process = byzanz_encoder_byzanz_process; |
| 74 |
encoder_class->close = byzanz_encoder_byzanz_close; |
| 75 |
|
| 76 |
encoder_class->filter = gtk_file_filter_new (); |
| 77 |
g_object_ref_sink (encoder_class->filter); |
| 78 |
gtk_file_filter_set_name (encoder_class->filter, _("Byzanz debug files")); |
| 79 |
gtk_file_filter_add_mime_type (encoder_class->filter, "application/x-byzanz"); |
| 80 |
gtk_file_filter_add_pattern (encoder_class->filter, "*.byzanz"); |
| 81 |
} |
| 82 |
|
| 83 |
static void |
| 84 |
byzanz_encoder_byzanz_init (ByzanzEncoderByzanz *encoder_byzanz) |
| 85 |
{ |
| 86 |
} |
| 87 |
|