Refactor ag_chart_export_jpg_to_file() as ag_chart_export_to_image()

It is capable of saving in any format (as long as GdkPixbuf supports it)
This commit is contained in:
Gergely Polonkai 2014-10-05 19:36:20 +02:00
parent 96221abec6
commit 52ff709e14

View File

@ -1983,10 +1983,11 @@ ag_chart_get_pixbuf(AgChart *chart,
return pixbuf; return pixbuf;
} }
void static void
ag_chart_export_jpg_to_file(AgChart *chart, ag_chart_export_to_image(AgChart *chart,
GFile *file, GFile *file,
AgDisplayTheme *theme, AgDisplayTheme *theme,
gchar *format,
GError **err) GError **err)
{ {
gchar *jpg; gchar *jpg;
@ -2003,7 +2004,7 @@ ag_chart_export_jpg_to_file(AgChart *chart,
pixbuf, pixbuf,
&jpg, &jpg,
&jpg_length, &jpg_length,
"jpeg", format,
err, err,
NULL NULL
)) { )) {
@ -2029,6 +2030,15 @@ ag_chart_export_jpg_to_file(AgChart *chart,
g_free(jpg); g_free(jpg);
} }
void
ag_chart_export_jpg_to_file(AgChart *chart,
GFile *file,
AgDisplayTheme *theme,
GError **err)
{
ag_chart_export_to_image(chart, file, theme, "jpeg", err);
}
void void
ag_chart_set_note(AgChart *chart, const gchar *note) ag_chart_set_note(AgChart *chart, const gchar *note)
{ {