diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-05 03:56:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-08 03:01:04 +0800 |
commit | 13f4544dafe211a748b064b86a8af4085d042b2b (patch) | |
tree | 2d7d421306bd37aefc7edbd10b5a0599e961d690 /em-format/e-mail-formatter.h | |
parent | aebf88cc8e3f45f8603a4706877dc59706be4963 (diff) | |
download | gsoc2013-evolution-13f4544dafe211a748b064b86a8af4085d042b2b.tar.gz gsoc2013-evolution-13f4544dafe211a748b064b86a8af4085d042b2b.tar.zst gsoc2013-evolution-13f4544dafe211a748b064b86a8af4085d042b2b.zip |
EMailFormatter: Simplify context allocation.
Replace the create_context() and free_context() class methods with a
"context_size" class member defaulting to sizeof(EMailFormatterContext).
EMailFormatter will use "context_size" to allocate a zero-filled slab of
heap memory. Since EMailFormatterQuote is currently the only thing that
overrides the "context_size" (to append a "qf_flags" member), let's keep
this simple.
Diffstat (limited to 'em-format/e-mail-formatter.h')
-rw-r--r-- | em-format/e-mail-formatter.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/em-format/e-mail-formatter.h b/em-format/e-mail-formatter.h index 9b4e84d262..d7e578f794 100644 --- a/em-format/e-mail-formatter.h +++ b/em-format/e-mail-formatter.h @@ -114,22 +114,20 @@ struct _EMailFormatterClass { /* Colors should apply globally */ GdkColor colors[E_MAIL_FORMATTER_NUM_COLOR_TYPES]; - void (*run) (EMailFormatter *formatter, - EMailFormatterContext *context, - CamelStream *stream, - GCancellable *cancellable); + /* sizeof(EMailFormatterContext) or some derivative struct */ + gsize context_size; - EMailFormatterContext * (*create_context) (EMailFormatter *formatter); - - void (*free_context) (EMailFormatter *formatter, - EMailFormatterContext *context); + void (*run) (EMailFormatter *formatter, + EMailFormatterContext *context, + CamelStream *stream, + GCancellable *cancellable); - void (*set_style) (EMailFormatter *formatter, - GtkStyle *style, - GtkStateType state); + void (*set_style) (EMailFormatter *formatter, + GtkStyle *style, + GtkStateType state); /* Signals */ - void (*need_redraw) (EMailFormatter *formatter); + void (*need_redraw) (EMailFormatter *formatter); }; GType e_mail_formatter_get_type (void); |