[gthumb] cairo_io: renamed the gth_image_saver_* objects
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] cairo_io: renamed the gth_image_saver_* objects
- Date: Sun, 19 Aug 2012 08:37:46 +0000 (UTC)
commit e0ccd3ecd10cc966dba42ad133e3b7104d931565
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Aug 18 11:41:51 2012 +0200
cairo_io: renamed the gth_image_saver_* objects
extensions/cairo_io/Makefile.am | 16 ++--
.../{gth-jpeg-saver.c => gth-image-saver-jpeg.c} | 62 ++++++++--------
extensions/cairo_io/gth-image-saver-jpeg.h | 56 ++++++++++++++
.../{gth-png-saver.c => gth-image-saver-png.c} | 68 +++++++++---------
extensions/cairo_io/gth-image-saver-png.h | 56 ++++++++++++++
.../{gth-tga-saver.c => gth-image-saver-tga.c} | 66 +++++++++---------
extensions/cairo_io/gth-image-saver-tga.h | 56 ++++++++++++++
.../{gth-tiff-saver.c => gth-image-saver-tiff.c} | 76 ++++++++++----------
extensions/cairo_io/gth-image-saver-tiff.h | 56 ++++++++++++++
extensions/cairo_io/gth-jpeg-saver.h | 56 --------------
extensions/cairo_io/gth-png-saver.h | 56 --------------
extensions/cairo_io/gth-tga-saver.h | 56 --------------
extensions/cairo_io/gth-tiff-saver.h | 56 --------------
extensions/cairo_io/main.c | 16 ++--
14 files changed, 376 insertions(+), 376 deletions(-)
---
diff --git a/extensions/cairo_io/Makefile.am b/extensions/cairo_io/Makefile.am
index a1ea433..4278ed0 100644
--- a/extensions/cairo_io/Makefile.am
+++ b/extensions/cairo_io/Makefile.am
@@ -32,12 +32,12 @@ enum-types.c: $(HEADER_FILES)
libcairo_io_la_SOURCES = \
cairo-image-surface-png.c \
cairo-image-surface-png.h \
- gth-png-saver.c \
- gth-png-saver.h \
- gth-tga-saver.c \
- gth-tga-saver.h \
- gth-tiff-saver.c \
- gth-tiff-saver.h \
+ gth-image-saver-png.c \
+ gth-image-saver-png.h \
+ gth-image-saver-tga.c \
+ gth-image-saver-tga.h \
+ gth-image-saver-tiff.c \
+ gth-image-saver-tiff.h \
preferences.c \
main.c
@@ -45,8 +45,8 @@ if ENABLE_JPEG_TOOLS
libcairo_io_la_SOURCES += \
cairo-image-surface-jpeg.c \
cairo-image-surface-jpeg.h \
- gth-jpeg-saver.c \
- gth-jpeg-saver.h
+ gth-image-saver-jpeg.c \
+ gth-image-saver-jpeg.h
endif
if ENABLE_LIBRSVG
diff --git a/extensions/cairo_io/gth-jpeg-saver.c b/extensions/cairo_io/gth-image-saver-jpeg.c
similarity index 88%
rename from extensions/cairo_io/gth-jpeg-saver.c
rename to extensions/cairo_io/gth-image-saver-jpeg.c
index f6d2fe9..5a73df5 100644
--- a/extensions/cairo_io/gth-jpeg-saver.c
+++ b/extensions/cairo_io/gth-image-saver-jpeg.c
@@ -31,14 +31,14 @@
#endif /* HAVE_LIBJPEG */
#include <glib/gi18n.h>
#include <gthumb.h>
-#include "gth-jpeg-saver.h"
+#include "gth-image-saver-jpeg.h"
#include "preferences.h"
-G_DEFINE_TYPE (GthJpegSaver, gth_jpeg_saver, GTH_TYPE_PIXBUF_SAVER)
+G_DEFINE_TYPE (GthImageSaverJpeg, gth_image_saver_jpeg, GTH_TYPE_PIXBUF_SAVER)
-struct _GthJpegSaverPrivate {
+struct _GthImageSaverJpegPrivate {
GtkBuilder *builder;
GSettings *settings;
char *default_ext;
@@ -46,22 +46,22 @@ struct _GthJpegSaverPrivate {
static void
-gth_jpeg_saver_finalize (GObject *object)
+gth_image_saver_jpeg_finalize (GObject *object)
{
- GthJpegSaver *self = GTH_JPEG_SAVER (object);
+ GthImageSaverJpeg *self = GTH_IMAGE_SAVER_JPEG (object);
_g_object_unref (self->priv->settings);
_g_object_unref (self->priv->builder);
g_free (self->priv->default_ext);
- G_OBJECT_CLASS (gth_jpeg_saver_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gth_image_saver_jpeg_parent_class)->finalize (object);
}
static const char *
-gth_jpeg_saver_get_default_ext (GthPixbufSaver *base)
+gth_image_saver_jpeg_get_default_ext (GthPixbufSaver *base)
{
- GthJpegSaver *self = GTH_JPEG_SAVER (base);
+ GthImageSaverJpeg *self = GTH_IMAGE_SAVER_JPEG (base);
if (self->priv->default_ext == NULL)
self->priv->default_ext = g_settings_get_string (self->priv->settings, PREF_JPEG_DEFAULT_EXT);
@@ -71,9 +71,9 @@ gth_jpeg_saver_get_default_ext (GthPixbufSaver *base)
static GtkWidget *
-gth_jpeg_saver_get_control (GthPixbufSaver *base)
+gth_image_saver_jpeg_get_control (GthPixbufSaver *base)
{
- GthJpegSaver *self = GTH_JPEG_SAVER (base);
+ GthImageSaverJpeg *self = GTH_IMAGE_SAVER_JPEG (base);
char **extensions;
int i;
int active_idx;
@@ -111,9 +111,9 @@ gth_jpeg_saver_get_control (GthPixbufSaver *base)
static void
-gth_jpeg_saver_save_options (GthPixbufSaver *base)
+gth_image_saver_jpeg_save_options (GthPixbufSaver *base)
{
- GthJpegSaver *self = GTH_JPEG_SAVER (base);
+ GthImageSaverJpeg *self = GTH_IMAGE_SAVER_JPEG (base);
GtkTreeIter iter;
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (_gtk_builder_get_widget (self->priv->builder, "jpeg_default_extension_combobox")), &iter)) {
@@ -132,8 +132,8 @@ gth_jpeg_saver_save_options (GthPixbufSaver *base)
static gboolean
-gth_jpeg_saver_can_save (GthPixbufSaver *self,
- const char *mime_type)
+gth_image_saver_jpeg_can_save (GthPixbufSaver *self,
+ const char *mime_type)
{
#ifdef HAVE_LIBJPEG
@@ -429,15 +429,15 @@ _gdk_pixbuf_save_as_jpeg (GdkPixbuf *pixbuf,
static gboolean
-gth_jpeg_saver_save_pixbuf (GthPixbufSaver *base,
- GdkPixbuf *pixbuf,
- char **buffer,
- gsize *buffer_size,
- const char *mime_type,
- GError **error)
+gth_image_saver_jpeg_save_pixbuf (GthPixbufSaver *base,
+ GdkPixbuf *pixbuf,
+ char **buffer,
+ gsize *buffer_size,
+ const char *mime_type,
+ GError **error)
{
#ifdef HAVE_LIBJPEG
- GthJpegSaver *self = GTH_JPEG_SAVER (base);
+ GthImageSaverJpeg *self = GTH_IMAGE_SAVER_JPEG (base);
char **option_keys;
char **option_values;
int i = -1;
@@ -504,33 +504,33 @@ gth_jpeg_saver_save_pixbuf (GthPixbufSaver *base,
static void
-gth_jpeg_saver_class_init (GthJpegSaverClass *klass)
+gth_image_saver_jpeg_class_init (GthImageSaverJpegClass *klass)
{
GObjectClass *object_class;
GthPixbufSaverClass *pixbuf_saver_class;
- g_type_class_add_private (klass, sizeof (GthJpegSaverPrivate));
+ g_type_class_add_private (klass, sizeof (GthImageSaverJpegPrivate));
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = gth_jpeg_saver_finalize;
+ object_class->finalize = gth_image_saver_jpeg_finalize;
pixbuf_saver_class = GTH_PIXBUF_SAVER_CLASS (klass);
pixbuf_saver_class->id = "jpeg";
pixbuf_saver_class->display_name = _("JPEG");
pixbuf_saver_class->mime_type = "image/jpeg";
pixbuf_saver_class->extensions = "jpeg jpg";
- pixbuf_saver_class->get_default_ext = gth_jpeg_saver_get_default_ext;
- pixbuf_saver_class->get_control = gth_jpeg_saver_get_control;
- pixbuf_saver_class->save_options = gth_jpeg_saver_save_options;
- pixbuf_saver_class->can_save = gth_jpeg_saver_can_save;
- pixbuf_saver_class->save_pixbuf = gth_jpeg_saver_save_pixbuf;
+ pixbuf_saver_class->get_default_ext = gth_image_saver_jpeg_get_default_ext;
+ pixbuf_saver_class->get_control = gth_image_saver_jpeg_get_control;
+ pixbuf_saver_class->save_options = gth_image_saver_jpeg_save_options;
+ pixbuf_saver_class->can_save = gth_image_saver_jpeg_can_save;
+ pixbuf_saver_class->save_pixbuf = gth_image_saver_jpeg_save_pixbuf;
}
static void
-gth_jpeg_saver_init (GthJpegSaver *self)
+gth_image_saver_jpeg_init (GthImageSaverJpeg *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_JPEG_SAVER, GthJpegSaverPrivate);
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_JPEG, GthImageSaverJpegPrivate);
self->priv->settings = g_settings_new (GTHUMB_PIXBUF_SAVERS_JPEG_SCHEMA);
self->priv->builder = NULL;
self->priv->default_ext = NULL;
diff --git a/extensions/cairo_io/gth-image-saver-jpeg.h b/extensions/cairo_io/gth-image-saver-jpeg.h
new file mode 100644
index 0000000..36c9042
--- /dev/null
+++ b/extensions/cairo_io/gth-image-saver-jpeg.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * GThumb
+ *
+ * Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GTH_IMAGE_SAVER_JPEG_H
+#define GTH_IMAGE_SAVER_JPEG_H
+
+#include <gtk/gtk.h>
+#include <gthumb.h>
+
+G_BEGIN_DECLS
+
+#define GTH_TYPE_IMAGE_SAVER_JPEG (gth_image_saver_jpeg_get_type ())
+#define GTH_IMAGE_SAVER_JPEG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_IMAGE_SAVER_JPEG, GthImageSaverJpeg))
+#define GTH_IMAGE_SAVER_JPEG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_IMAGE_SAVER_JPEG_TYPE, GthImageSaverJpegClass))
+#define GTH_IS_IMAGE_SAVER_JPEG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_IMAGE_SAVER_JPEG))
+#define GTH_IS_IMAGE_SAVER_JPEG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_IMAGE_SAVER_JPEG))
+#define GTH_IMAGE_SAVER_JPEG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTH_TYPE_IMAGE_SAVER_JPEG, GthImageSaverJpegClass))
+
+typedef struct _GthImageSaverJpeg GthImageSaverJpeg;
+typedef struct _GthImageSaverJpegClass GthImageSaverJpegClass;
+typedef struct _GthImageSaverJpegPrivate GthImageSaverJpegPrivate;
+
+struct _GthImageSaverJpeg
+{
+ GthPixbufSaver __parent;
+ GthImageSaverJpegPrivate *priv;
+};
+
+struct _GthImageSaverJpegClass
+{
+ GthPixbufSaverClass __parent_class;
+};
+
+GType gth_image_saver_jpeg_get_type (void);
+
+G_END_DECLS
+
+#endif /* GTH_IMAGE_SAVER_JPEG_H */
diff --git a/extensions/cairo_io/gth-png-saver.c b/extensions/cairo_io/gth-image-saver-png.c
similarity index 63%
rename from extensions/cairo_io/gth-png-saver.c
rename to extensions/cairo_io/gth-image-saver-png.c
index 3c95932..381d079 100644
--- a/extensions/cairo_io/gth-png-saver.c
+++ b/extensions/cairo_io/gth-image-saver-png.c
@@ -22,34 +22,34 @@
#include <config.h>
#include <glib/gi18n.h>
#include <gthumb.h>
-#include "gth-png-saver.h"
+#include "gth-image-saver-png.h"
#include "preferences.h"
-G_DEFINE_TYPE (GthPngSaver, gth_png_saver, GTH_TYPE_PIXBUF_SAVER)
+G_DEFINE_TYPE (GthImageSaverPng, gth_image_saver_png, GTH_TYPE_PIXBUF_SAVER)
-struct _GthPngSaverPrivate {
+struct _GthImageSaverPngPrivate {
GtkBuilder *builder;
GSettings *settings;
};
static void
-gth_png_saver_finalize (GObject *object)
+gth_image_saver_png_finalize (GObject *object)
{
- GthPngSaver *self = GTH_PNG_SAVER (object);
+ GthImageSaverPng *self = GTH_IMAGE_SAVER_PNG (object);
_g_object_unref (self->priv->builder);
_g_object_unref (self->priv->settings);
- G_OBJECT_CLASS (gth_png_saver_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gth_image_saver_png_parent_class)->finalize (object);
}
static GtkWidget *
-gth_png_saver_get_control (GthPixbufSaver *base)
+gth_image_saver_png_get_control (GthPixbufSaver *base)
{
- GthPngSaver *self = GTH_PNG_SAVER (base);
+ GthImageSaverPng *self = GTH_IMAGE_SAVER_PNG (base);
if (self->priv->builder == NULL)
self->priv->builder = _gtk_builder_new_from_file ("png-options.ui", "cairo_io");
@@ -62,37 +62,37 @@ gth_png_saver_get_control (GthPixbufSaver *base)
static void
-gth_png_saver_save_options (GthPixbufSaver *base)
+gth_image_saver_png_save_options (GthPixbufSaver *base)
{
- GthPngSaver *self = GTH_PNG_SAVER (base);
+ GthImageSaverPng *self = GTH_IMAGE_SAVER_PNG (base);
g_settings_set_int (self->priv->settings, PREF_PNG_COMPRESSION_LEVEL, (int) gtk_adjustment_get_value (GTK_ADJUSTMENT (_gtk_builder_get_widget (self->priv->builder, "png_compression_adjustment"))));
}
static gboolean
-gth_png_saver_can_save (GthPixbufSaver *self,
- const char *mime_type)
+gth_image_saver_png_can_save (GthPixbufSaver *self,
+ const char *mime_type)
{
return g_content_type_equals (mime_type, "image/png");
}
static gboolean
-gth_png_saver_save_pixbuf (GthPixbufSaver *base,
- GdkPixbuf *pixbuf,
- char **buffer,
- gsize *buffer_size,
- const char *mime_type,
- GError **error)
+gth_image_saver_png_save_pixbuf (GthPixbufSaver *base,
+ GdkPixbuf *pixbuf,
+ char **buffer,
+ gsize *buffer_size,
+ const char *mime_type,
+ GError **error)
{
- GthPngSaver *self = GTH_PNG_SAVER (base);
- char *pixbuf_type;
- char **option_keys;
- char **option_values;
- int i = -1;
- int i_value;
- gboolean result;
+ GthImageSaverPng *self = GTH_IMAGE_SAVER_PNG (base);
+ char *pixbuf_type;
+ char **option_keys;
+ char **option_values;
+ int i = -1;
+ int i_value;
+ gboolean result;
pixbuf_type = get_pixbuf_type_from_mime_type (mime_type);
@@ -125,15 +125,15 @@ gth_png_saver_save_pixbuf (GthPixbufSaver *base,
static void
-gth_png_saver_class_init (GthPngSaverClass *klass)
+gth_image_saver_png_class_init (GthImageSaverPngClass *klass)
{
GObjectClass *object_class;
GthPixbufSaverClass *pixbuf_saver_class;
- g_type_class_add_private (klass, sizeof (GthPngSaverPrivate));
+ g_type_class_add_private (klass, sizeof (GthImageSaverPngPrivate));
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = gth_png_saver_finalize;
+ object_class->finalize = gth_image_saver_png_finalize;
pixbuf_saver_class = GTH_PIXBUF_SAVER_CLASS (klass);
pixbuf_saver_class->id = "png";
@@ -141,16 +141,16 @@ gth_png_saver_class_init (GthPngSaverClass *klass)
pixbuf_saver_class->mime_type = "image/png";
pixbuf_saver_class->extensions = "png";
pixbuf_saver_class->get_default_ext = NULL;
- pixbuf_saver_class->get_control = gth_png_saver_get_control;
- pixbuf_saver_class->save_options = gth_png_saver_save_options;
- pixbuf_saver_class->can_save = gth_png_saver_can_save;
- pixbuf_saver_class->save_pixbuf = gth_png_saver_save_pixbuf;
+ pixbuf_saver_class->get_control = gth_image_saver_png_get_control;
+ pixbuf_saver_class->save_options = gth_image_saver_png_save_options;
+ pixbuf_saver_class->can_save = gth_image_saver_png_can_save;
+ pixbuf_saver_class->save_pixbuf = gth_image_saver_png_save_pixbuf;
}
static void
-gth_png_saver_init (GthPngSaver *self)
+gth_image_saver_png_init (GthImageSaverPng *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_PNG_SAVER, GthPngSaverPrivate);
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_PNG, GthImageSaverPngPrivate);
self->priv->settings = g_settings_new (GTHUMB_PIXBUF_SAVERS_PNG_SCHEMA);
}
diff --git a/extensions/cairo_io/gth-image-saver-png.h b/extensions/cairo_io/gth-image-saver-png.h
new file mode 100644
index 0000000..3a77353
--- /dev/null
+++ b/extensions/cairo_io/gth-image-saver-png.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * GThumb
+ *
+ * Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GTH_IMAGE_SAVER_PNG_H
+#define GTH_IMAGE_SAVER_PNG_H
+
+#include <gtk/gtk.h>
+#include <gthumb.h>
+
+G_BEGIN_DECLS
+
+#define GTH_TYPE_IMAGE_SAVER_PNG (gth_image_saver_png_get_type ())
+#define GTH_IMAGE_SAVER_PNG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_IMAGE_SAVER_PNG, GthImageSaverPng))
+#define GTH_IMAGE_SAVER_PNG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_IMAGE_SAVER_PNG_TYPE, GthImageSaverPngClass))
+#define GTH_IS_IMAGE_SAVER_PNG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_IMAGE_SAVER_PNG))
+#define GTH_IS_IMAGE_SAVER_PNG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_IMAGE_SAVER_PNG))
+#define GTH_IMAGE_SAVER_PNG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTH_TYPE_IMAGE_SAVER_PNG, GthImageSaverPngClass))
+
+typedef struct _GthImageSaverPng GthImageSaverPng;
+typedef struct _GthImageSaverPngClass GthImageSaverPngClass;
+typedef struct _GthImageSaverPngPrivate GthImageSaverPngPrivate;
+
+struct _GthImageSaverPng
+{
+ GthPixbufSaver __parent;
+ GthImageSaverPngPrivate *priv;
+};
+
+struct _GthImageSaverPngClass
+{
+ GthPixbufSaverClass __parent_class;
+};
+
+GType gth_image_saver_png_get_type (void);
+
+G_END_DECLS
+
+#endif /* GTH_IMAGE_SAVER_PNG_H */
diff --git a/extensions/cairo_io/gth-tga-saver.c b/extensions/cairo_io/gth-image-saver-tga.c
similarity index 83%
rename from extensions/cairo_io/gth-tga-saver.c
rename to extensions/cairo_io/gth-image-saver-tga.c
index dd77f45..a2f31f4 100644
--- a/extensions/cairo_io/gth-tga-saver.c
+++ b/extensions/cairo_io/gth-image-saver-tga.c
@@ -22,34 +22,34 @@
#include <config.h>
#include <glib/gi18n.h>
#include <gthumb.h>
-#include "gth-tga-saver.h"
+#include "gth-image-saver-tga.h"
#include "preferences.h"
-G_DEFINE_TYPE (GthTgaSaver, gth_tga_saver, GTH_TYPE_PIXBUF_SAVER)
+G_DEFINE_TYPE (GthImageSaverTga, gth_image_saver_tga, GTH_TYPE_PIXBUF_SAVER)
-struct _GthTgaSaverPrivate {
+struct _GthImageSaverTgaPrivate {
GtkBuilder *builder;
GSettings *settings;
};
static void
-gth_tga_saver_finalize (GObject *object)
+gth_image_saver_tga_finalize (GObject *object)
{
- GthTgaSaver *self = GTH_TGA_SAVER (object);
+ GthImageSaverTga *self = GTH_IMAGE_SAVER_TGA (object);
_g_object_unref (self->priv->builder);
_g_object_unref (self->priv->settings);
- G_OBJECT_CLASS (gth_tga_saver_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gth_image_saver_tga_parent_class)->finalize (object);
}
static GtkWidget *
-gth_tga_saver_get_control (GthPixbufSaver *base)
+gth_image_saver_tga_get_control (GthPixbufSaver *base)
{
- GthTgaSaver *self = GTH_TGA_SAVER (base);
+ GthImageSaverTga *self = GTH_IMAGE_SAVER_TGA (base);
if (self->priv->builder == NULL)
self->priv->builder = _gtk_builder_new_from_file ("tga-options.ui", "cairo_io");
@@ -62,17 +62,17 @@ gth_tga_saver_get_control (GthPixbufSaver *base)
static void
-gth_tga_saver_save_options (GthPixbufSaver *base)
+gth_image_saver_tga_save_options (GthPixbufSaver *base)
{
- GthTgaSaver *self = GTH_TGA_SAVER (base);
+ GthImageSaverTga *self = GTH_IMAGE_SAVER_TGA (base);
g_settings_set_boolean (self->priv->settings, PREF_TGA_RLE_COMPRESSION, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (_gtk_builder_get_widget (self->priv->builder, "tga_rle_compression_checkbutton"))));
}
static gboolean
-gth_tga_saver_can_save (GthPixbufSaver *self,
- const char *mime_type)
+gth_image_saver_tga_can_save (GthPixbufSaver *self,
+ const char *mime_type)
{
return g_content_type_equals (mime_type, "image/tga") || g_content_type_equals (mime_type, "image/x-tga");
}
@@ -315,19 +315,19 @@ _gdk_pixbuf_save_as_tga (GdkPixbuf *pixbuf,
static gboolean
-gth_tga_saver_save_pixbuf (GthPixbufSaver *base,
- GdkPixbuf *pixbuf,
- char **buffer,
- gsize *buffer_size,
- const char *mime_type,
- GError **error)
+gth_image_saver_tga_save_pixbuf (GthPixbufSaver *base,
+ GdkPixbuf *pixbuf,
+ char **buffer,
+ gsize *buffer_size,
+ const char *mime_type,
+ GError **error)
{
- GthTgaSaver *self = GTH_TGA_SAVER (base);
- char *pixbuf_type;
- char **option_keys;
- char **option_values;
- int i = -1;
- gboolean result;
+ GthImageSaverTga *self = GTH_IMAGE_SAVER_TGA (base);
+ char *pixbuf_type;
+ char **option_keys;
+ char **option_values;
+ int i = -1;
+ gboolean result;
pixbuf_type = get_pixbuf_type_from_mime_type (mime_type);
@@ -358,15 +358,15 @@ gth_tga_saver_save_pixbuf (GthPixbufSaver *base,
static void
-gth_tga_saver_class_init (GthTgaSaverClass *klass)
+gth_image_saver_tga_class_init (GthImageSaverTgaClass *klass)
{
GObjectClass *object_class;
GthPixbufSaverClass *pixbuf_saver_class;
- g_type_class_add_private (klass, sizeof (GthTgaSaverPrivate));
+ g_type_class_add_private (klass, sizeof (GthImageSaverTgaPrivate));
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = gth_tga_saver_finalize;
+ object_class->finalize = gth_image_saver_tga_finalize;
pixbuf_saver_class = GTH_PIXBUF_SAVER_CLASS (klass);
pixbuf_saver_class->id = "tga";
@@ -374,16 +374,16 @@ gth_tga_saver_class_init (GthTgaSaverClass *klass)
pixbuf_saver_class->mime_type = "image/x-tga";
pixbuf_saver_class->extensions = "tga";
pixbuf_saver_class->get_default_ext = NULL;
- pixbuf_saver_class->get_control = gth_tga_saver_get_control;
- pixbuf_saver_class->save_options = gth_tga_saver_save_options;
- pixbuf_saver_class->can_save = gth_tga_saver_can_save;
- pixbuf_saver_class->save_pixbuf = gth_tga_saver_save_pixbuf;
+ pixbuf_saver_class->get_control = gth_image_saver_tga_get_control;
+ pixbuf_saver_class->save_options = gth_image_saver_tga_save_options;
+ pixbuf_saver_class->can_save = gth_image_saver_tga_can_save;
+ pixbuf_saver_class->save_pixbuf = gth_image_saver_tga_save_pixbuf;
}
static void
-gth_tga_saver_init (GthTgaSaver *self)
+gth_image_saver_tga_init (GthImageSaverTga *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TGA_SAVER, GthTgaSaverPrivate);
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_TGA, GthImageSaverTgaPrivate);
self->priv->settings = g_settings_new (GTHUMB_PIXBUF_SAVERS_TGA_SCHEMA);
}
diff --git a/extensions/cairo_io/gth-image-saver-tga.h b/extensions/cairo_io/gth-image-saver-tga.h
new file mode 100644
index 0000000..55d50c3
--- /dev/null
+++ b/extensions/cairo_io/gth-image-saver-tga.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * GThumb
+ *
+ * Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GTH_IMAGE_SAVER_TGA_H
+#define GTH_IMAGE_SAVER_TGA_H
+
+#include <gtk/gtk.h>
+#include <gthumb.h>
+
+G_BEGIN_DECLS
+
+#define GTH_TYPE_IMAGE_SAVER_TGA (gth_image_saver_tga_get_type ())
+#define GTH_IMAGE_SAVER_TGA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_IMAGE_SAVER_TGA, GthImageSaverTga))
+#define GTH_IMAGE_SAVER_TGA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_TYPE_IMAGE_SAVER_TGA, GthImageSaverTgaClass))
+#define GTH_IS_IMAGE_SAVER_TGA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_IMAGE_SAVER_TGA))
+#define GTH_IS_IMAGE_SAVER_TGA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_IMAGE_SAVER_TGA))
+#define GTH_IMAGE_SAVER_TGA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTH_TYPE_IMAGE_SAVER_TGA, GthImageSaverTgaClass))
+
+typedef struct _GthImageSaverTga GthImageSaverTga;
+typedef struct _GthImageSaverTgaClass GthImageSaverTgaClass;
+typedef struct _GthImageSaverTgaPrivate GthImageSaverTgaPrivate;
+
+struct _GthImageSaverTga
+{
+ GthPixbufSaver __parent;
+ GthImageSaverTgaPrivate *priv;
+};
+
+struct _GthImageSaverTgaClass
+{
+ GthPixbufSaverClass __parent_class;
+};
+
+GType gth_image_saver_tga_get_type (void);
+
+G_END_DECLS
+
+#endif /* GTH_IMAGE_SAVER_TGA_H */
diff --git a/extensions/cairo_io/gth-tiff-saver.c b/extensions/cairo_io/gth-image-saver-tiff.c
similarity index 87%
rename from extensions/cairo_io/gth-tiff-saver.c
rename to extensions/cairo_io/gth-image-saver-tiff.c
index 4a2f64e..cd24140 100644
--- a/extensions/cairo_io/gth-tiff-saver.c
+++ b/extensions/cairo_io/gth-image-saver-tiff.c
@@ -26,14 +26,14 @@
#include <glib/gi18n.h>
#include <gthumb.h>
#include "enum-types.h"
-#include "gth-tiff-saver.h"
+#include "gth-image-saver-tiff.h"
#include "preferences.h"
-G_DEFINE_TYPE (GthTiffSaver, gth_tiff_saver, GTH_TYPE_PIXBUF_SAVER)
+G_DEFINE_TYPE (GthImageSaverTiff, gth_image_saver_tiff, GTH_TYPE_PIXBUF_SAVER)
-struct _GthTiffSaverPrivate {
+struct _GthImageSaverTiffPrivate {
GSettings *settings;
GtkBuilder *builder;
char *default_ext;
@@ -41,22 +41,22 @@ struct _GthTiffSaverPrivate {
static void
-gth_tiff_saver_finalize (GObject *object)
+gth_image_saver_tiff_finalize (GObject *object)
{
- GthTiffSaver *self = GTH_TIFF_SAVER (object);
+ GthImageSaverTiff *self = GTH_IMAGE_SAVER_TIFF (object);
_g_object_unref (self->priv->settings);
_g_object_unref (self->priv->builder);
g_free (self->priv->default_ext);
- G_OBJECT_CLASS (gth_tiff_saver_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gth_image_saver_tiff_parent_class)->finalize (object);
}
static const char *
-gth_tiff_saver_get_default_ext (GthPixbufSaver *base)
+gth_image_saver_tiff_get_default_ext (GthPixbufSaver *base)
{
- GthTiffSaver *self = GTH_TIFF_SAVER (base);
+ GthImageSaverTiff *self = GTH_IMAGE_SAVER_TIFF (base);
if (self->priv->default_ext == NULL)
self->priv->default_ext = g_settings_get_string (self->priv->settings, PREF_TIFF_DEFAULT_EXT);
@@ -66,11 +66,11 @@ gth_tiff_saver_get_default_ext (GthPixbufSaver *base)
static GtkWidget *
-gth_tiff_saver_get_control (GthPixbufSaver *base)
+gth_image_saver_tiff_get_control (GthPixbufSaver *base)
{
#ifdef HAVE_LIBTIFF
- GthTiffSaver *self = GTH_TIFF_SAVER (base);
+ GthImageSaverTiff *self = GTH_IMAGE_SAVER_TIFF (base);
char **extensions;
int i;
int active_idx;
@@ -117,18 +117,18 @@ gth_tiff_saver_get_control (GthPixbufSaver *base)
#else /* ! HAVE_LIBTIFF */
- return GTH_PIXBUF_SAVER_CLASS (gth_tiff_saver_parent_class)->get_control (base);
+ return GTH_PIXBUF_SAVER_CLASS (gth_image_saver_tiff_parent_class)->get_control (base);
#endif /* HAVE_LIBTIFF */
}
static void
-gth_tiff_saver_save_options (GthPixbufSaver *base)
+gth_image_saver_tiff_save_options (GthPixbufSaver *base)
{
#ifdef HAVE_LIBTIFF
- GthTiffSaver *self = GTH_TIFF_SAVER (base);
+ GthImageSaverTiff *self = GTH_IMAGE_SAVER_TIFF (base);
GtkTreeIter iter;
GthTiffCompression compression_type;
@@ -157,8 +157,8 @@ gth_tiff_saver_save_options (GthPixbufSaver *base)
static gboolean
-gth_tiff_saver_can_save (GthPixbufSaver *self,
- const char *mime_type)
+gth_image_saver_tiff_can_save (GthPixbufSaver *self,
+ const char *mime_type)
{
#ifdef HAVE_LIBTIFF
@@ -203,7 +203,7 @@ gth_tiff_saver_can_save (GthPixbufSaver *self,
#ifdef HAVE_LIBTIFF
-/* -- gth_tiff_saver_save_pixbuf -- */
+/* -- gth_image_saver_tiff_save_pixbuf -- */
#define TILE_HEIGHT 40 /* FIXME */
@@ -453,20 +453,20 @@ _gdk_pixbuf_save_as_tiff (GdkPixbuf *pixbuf,
static gboolean
-gth_tiff_saver_save_pixbuf (GthPixbufSaver *base,
- GdkPixbuf *pixbuf,
- char **buffer,
- gsize *buffer_size,
- const char *mime_type,
- GError **error)
+gth_image_saver_tiff_save_pixbuf (GthPixbufSaver *base,
+ GdkPixbuf *pixbuf,
+ char **buffer,
+ gsize *buffer_size,
+ const char *mime_type,
+ GError **error)
{
#ifdef HAVE_LIBTIFF
- GthTiffSaver *self = GTH_TIFF_SAVER (base);
- char **option_keys;
- char **option_values;
- int i = -1;
- int i_value;
- gboolean result;
+ GthImageSaverTiff *self = GTH_IMAGE_SAVER_TIFF (base);
+ char **option_keys;
+ char **option_values;
+ int i = -1;
+ int i_value;
+ gboolean result;
option_keys = g_malloc (sizeof (char *) * 4);
option_values = g_malloc (sizeof (char *) * 4);
@@ -522,33 +522,33 @@ gth_tiff_saver_save_pixbuf (GthPixbufSaver *base,
static void
-gth_tiff_saver_class_init (GthTiffSaverClass *klass)
+gth_image_saver_tiff_class_init (GthImageSaverTiffClass *klass)
{
GObjectClass *object_class;
GthPixbufSaverClass *pixbuf_saver_class;
- g_type_class_add_private (klass, sizeof (GthTiffSaverPrivate));
+ g_type_class_add_private (klass, sizeof (GthImageSaverTiffPrivate));
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = gth_tiff_saver_finalize;
+ object_class->finalize = gth_image_saver_tiff_finalize;
pixbuf_saver_class = GTH_PIXBUF_SAVER_CLASS (klass);
pixbuf_saver_class->id = "tiff";
pixbuf_saver_class->display_name = _("TIFF");
pixbuf_saver_class->mime_type = "image/tiff";
pixbuf_saver_class->extensions = "tiff tif";
- pixbuf_saver_class->get_default_ext = gth_tiff_saver_get_default_ext;
- pixbuf_saver_class->get_control = gth_tiff_saver_get_control;
- pixbuf_saver_class->save_options = gth_tiff_saver_save_options;
- pixbuf_saver_class->can_save = gth_tiff_saver_can_save;
- pixbuf_saver_class->save_pixbuf = gth_tiff_saver_save_pixbuf;
+ pixbuf_saver_class->get_default_ext = gth_image_saver_tiff_get_default_ext;
+ pixbuf_saver_class->get_control = gth_image_saver_tiff_get_control;
+ pixbuf_saver_class->save_options = gth_image_saver_tiff_save_options;
+ pixbuf_saver_class->can_save = gth_image_saver_tiff_can_save;
+ pixbuf_saver_class->save_pixbuf = gth_image_saver_tiff_save_pixbuf;
}
static void
-gth_tiff_saver_init (GthTiffSaver *self)
+gth_image_saver_tiff_init (GthImageSaverTiff *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_TIFF_SAVER, GthTiffSaverPrivate);
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_TIFF, GthImageSaverTiffPrivate);
self->priv->settings = g_settings_new (GTHUMB_PIXBUF_SAVERS_TIFF_SCHEMA);
self->priv->builder = NULL;
self->priv->default_ext = NULL;
diff --git a/extensions/cairo_io/gth-image-saver-tiff.h b/extensions/cairo_io/gth-image-saver-tiff.h
new file mode 100644
index 0000000..41e6722
--- /dev/null
+++ b/extensions/cairo_io/gth-image-saver-tiff.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * GThumb
+ *
+ * Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GTH_IMAGE_SAVER_TIFF_H
+#define GTH_IMAGE_SAVER_TIFF_H
+
+#include <gtk/gtk.h>
+#include <gthumb.h>
+
+G_BEGIN_DECLS
+
+#define GTH_TYPE_IMAGE_SAVER_TIFF (gth_image_saver_tiff_get_type ())
+#define GTH_IMAGE_SAVER_TIFF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_IMAGE_SAVER_TIFF, GthImageSaverTiff))
+#define GTH_IMAGE_SAVER_TIFF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_IMAGE_SAVER_TIFF_TYPE, GthImageSaverTiffClass))
+#define GTH_IS_IMAGE_SAVER_TIFF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_IMAGE_SAVER_TIFF))
+#define GTH_IS_IMAGE_SAVER_TIFF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_IMAGE_SAVER_TIFF))
+#define GTH_IMAGE_SAVER_TIFF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTH_TYPE_IMAGE_SAVER_TIFF, GthImageSaverTiffClass))
+
+typedef struct _GthImageSaverTiff GthImageSaverTiff;
+typedef struct _GthImageSaverTiffClass GthImageSaverTiffClass;
+typedef struct _GthImageSaverTiffPrivate GthImageSaverTiffPrivate;
+
+struct _GthImageSaverTiff
+{
+ GthPixbufSaver __parent;
+ GthImageSaverTiffPrivate *priv;
+};
+
+struct _GthImageSaverTiffClass
+{
+ GthPixbufSaverClass __parent_class;
+};
+
+GType gth_image_saver_tiff_get_type (void);
+
+G_END_DECLS
+
+#endif /* GTH_IMAGE_SAVER_TIFF_H */
diff --git a/extensions/cairo_io/main.c b/extensions/cairo_io/main.c
index c71a0ad..86685a8 100644
--- a/extensions/cairo_io/main.c
+++ b/extensions/cairo_io/main.c
@@ -25,10 +25,10 @@
#include "cairo-image-surface-jpeg.h"
#include "cairo-image-surface-png.h"
#include "cairo-image-surface-svg.h"
-#include "gth-jpeg-saver.h"
-#include "gth-png-saver.h"
-#include "gth-tga-saver.h"
-#include "gth-tiff-saver.h"
+#include "gth-image-saver-jpeg.h"
+#include "gth-image-saver-png.h"
+#include "gth-image-saver-tga.h"
+#include "gth-image-saver-tiff.h"
#include "preferences.h"
@@ -41,7 +41,7 @@ gthumb_extension_activate (void)
GTH_IMAGE_FORMAT_CAIRO_SURFACE,
"image/jpeg",
NULL);
- gth_main_register_type ("pixbuf-saver", GTH_TYPE_JPEG_SAVER);
+ gth_main_register_type ("pixbuf-saver", GTH_TYPE_IMAGE_SAVER_JPEG);
#endif
@@ -59,9 +59,9 @@ gthumb_extension_activate (void)
#endif
- gth_main_register_type ("pixbuf-saver", GTH_TYPE_PNG_SAVER);
- gth_main_register_type ("pixbuf-saver", GTH_TYPE_TGA_SAVER);
- gth_main_register_type ("pixbuf-saver", GTH_TYPE_TIFF_SAVER);
+ gth_main_register_type ("pixbuf-saver", GTH_TYPE_IMAGE_SAVER_PNG);
+ gth_main_register_type ("pixbuf-saver", GTH_TYPE_IMAGE_SAVER_TGA);
+ gth_main_register_type ("pixbuf-saver", GTH_TYPE_IMAGE_SAVER_TIFF);
gth_hook_add_callback ("dlg-preferences-construct", 30, G_CALLBACK (ci__dlg_preferences_construct_cb), NULL);
gth_hook_add_callback ("dlg-preferences-apply", 10, G_CALLBACK (ci__dlg_preferences_apply_cb), NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]