[Rawstudio-commit] r2214 - in trunk: librawstudio plugins/output-jpegfile plugins/output-pngfile plugins/output-tifffile
Anders Brander
anders at brander.dk
Sun Feb 22 19:45:37 CET 2009
Author: abrander
Date: 2009-02-22 19:45:37 +0100 (Sun, 22 Feb 2009)
New Revision: 2214
Modified:
trunk/librawstudio/rs-output.c
trunk/librawstudio/rs-output.h
trunk/plugins/output-jpegfile/output-jpegfile.c
trunk/plugins/output-pngfile/output-pngfile.c
trunk/plugins/output-tifffile/output-tifffile.c
Log:
Added extension-hint to RSOutputClass.
Modified: trunk/librawstudio/rs-output.c
===================================================================
--- trunk/librawstudio/rs-output.c 2009-02-22 18:41:29 UTC (rev 2213)
+++ trunk/librawstudio/rs-output.c 2009-02-22 18:45:37 UTC (rev 2214)
@@ -28,6 +28,8 @@
static void
rs_output_class_init(RSOutputClass *klass)
{
+ /* Some sane defaults */
+ klass->extension = "";
klass->display_name = "N/A";
}
@@ -62,6 +64,22 @@
}
/**
+ * Get a filename extension as announced by a RSOutput module
+ * @param output A RSOutput
+ * @return A proposed filename extension excluding the ., this should not be freed.
+ */
+const gchar *
+rs_output_get_extension(RSOutput *output)
+{
+ g_assert(RS_IS_OUTPUT(output));
+
+ if (RS_OUTPUT_GET_CLASS(output)->extension)
+ return RS_OUTPUT_GET_CLASS(output)->extension;
+ else
+ return "";
+}
+
+/**
* Actually execute the saver
* @param output A RSOutput
* @param pixbuf A 8 bit pixbuf that should be saved
Modified: trunk/librawstudio/rs-output.h
===================================================================
--- trunk/librawstudio/rs-output.h 2009-02-22 18:41:29 UTC (rev 2213)
+++ trunk/librawstudio/rs-output.h 2009-02-22 18:45:37 UTC (rev 2214)
@@ -79,6 +79,7 @@
struct _RSOutputClass {
GObjectClass parent_class;
+ gchar *extension;
gchar *display_name;
gboolean (*execute8)(RSOutput *output, GdkPixbuf *pixbuf);
};
@@ -94,6 +95,14 @@
rs_output_new(const gchar *identifier);
/**
+ * Get a filename extension as announced by a RSOutput module
+ * @param output A RSOutput
+ * @return A proposed filename extension excluding the ., this should not be freed.
+ */
+const gchar *
+rs_output_get_extension(RSOutput *output);
+
+/**
* Actually execute the saver
* @param output A RSOutput
* @param pixbuf A 8 bit pixbuf that should be saved
Modified: trunk/plugins/output-jpegfile/output-jpegfile.c
===================================================================
--- trunk/plugins/output-jpegfile/output-jpegfile.c 2009-02-22 18:41:29 UTC (rev 2213)
+++ trunk/plugins/output-jpegfile/output-jpegfile.c 2009-02-22 18:45:37 UTC (rev 2214)
@@ -89,6 +89,7 @@
);
output_class->execute8 = execute8;
+ output_class->extension = "jpg";
output_class->display_name = _("JPEG (Joint Photographic Experts Group)");
}
Modified: trunk/plugins/output-pngfile/output-pngfile.c
===================================================================
--- trunk/plugins/output-pngfile/output-pngfile.c 2009-02-22 18:41:29 UTC (rev 2213)
+++ trunk/plugins/output-pngfile/output-pngfile.c 2009-02-22 18:45:37 UTC (rev 2214)
@@ -75,6 +75,7 @@
);
output_class->execute8 = execute8;
+ output_class->extension = "png";
output_class->display_name = _("PNG (Portable Network Graphics)");
}
Modified: trunk/plugins/output-tifffile/output-tifffile.c
===================================================================
--- trunk/plugins/output-tifffile/output-tifffile.c 2009-02-22 18:41:29 UTC (rev 2213)
+++ trunk/plugins/output-tifffile/output-tifffile.c 2009-02-22 18:45:37 UTC (rev 2214)
@@ -81,6 +81,7 @@
);
output_class->execute8 = execute8;
+ output_class->extension = "tif";
output_class->display_name = _("TIFF (Tagged Image File Format)");
}
More information about the Rawstudio-commit
mailing list