[gthumb] thumb loader: allow to create a new loader with the same properties
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] thumb loader: allow to create a new loader with the same properties
- Date: Sat, 19 Jun 2021 18:10:42 +0000 (UTC)
commit 10329e769180687973a3f9768fc307057d293e56
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed May 26 20:54:12 2021 +0200
thumb loader: allow to create a new loader with the same properties
gthumb/gth-image-loader.c | 7 +++++++
gthumb/gth-image-loader.h | 1 +
gthumb/gth-thumb-loader.c | 16 ++++++++++++++++
gthumb/gth-thumb-loader.h | 1 +
4 files changed, 25 insertions(+)
---
diff --git a/gthumb/gth-image-loader.c b/gthumb/gth-image-loader.c
index 2e0b089b..0564d651 100644
--- a/gthumb/gth-image-loader.c
+++ b/gthumb/gth-image-loader.c
@@ -104,6 +104,13 @@ gth_image_loader_set_loader_func (GthImageLoader *self,
}
+GthImageLoaderFunc
+gth_image_loader_get_loader_func (GthImageLoader *self)
+{
+ return self->priv->loader_func;
+}
+
+
void
gth_image_loader_set_preferred_format (GthImageLoader *self,
GthImageFormat preferred_format)
diff --git a/gthumb/gth-image-loader.h b/gthumb/gth-image-loader.h
index 96a367e7..995f48ae 100644
--- a/gthumb/gth-image-loader.h
+++ b/gthumb/gth-image-loader.h
@@ -55,6 +55,7 @@ GthImageLoader * gth_image_loader_new (GthImageLoaderFunc
void gth_image_loader_set_loader_func (GthImageLoader *loader,
GthImageLoaderFunc loader_func,
gpointer loader_data);
+GthImageLoaderFunc gth_image_loader_get_loader_func (GthImageLoader *loader);
void gth_image_loader_set_preferred_format (GthImageLoader *loader,
GthImageFormat preferred_format);
void gth_image_loader_set_out_profile (GthImageLoader *loader,
diff --git a/gthumb/gth-thumb-loader.c b/gthumb/gth-thumb-loader.c
index c9c0a9a0..dd37bc68 100644
--- a/gthumb/gth-thumb-loader.c
+++ b/gthumb/gth-thumb-loader.c
@@ -256,6 +256,22 @@ gth_thumb_loader_new (int requested_size)
}
+GthThumbLoader *
+gth_thumb_loader_copy (GthThumbLoader *self)
+{
+ GthThumbLoader *loader;
+
+ loader = gth_thumb_loader_new (self->priv->requested_size);
+ gth_thumb_loader_set_loader_func (loader, gth_image_loader_get_loader_func (self->priv->tloader));
+ gth_thumb_loader_set_requested_size (loader, self->priv->requested_size);
+ gth_thumb_loader_set_use_cache (loader, self->priv->use_cache);
+ gth_thumb_loader_set_save_thumbnails (loader, self->priv->save_thumbnails);
+ gth_thumb_loader_set_max_file_size (loader, self->priv->max_file_size);
+
+ return loader;
+}
+
+
void
gth_thumb_loader_set_loader_func (GthThumbLoader *self,
GthImageLoaderFunc loader_func)
diff --git a/gthumb/gth-thumb-loader.h b/gthumb/gth-thumb-loader.h
index 544bf2ba..49d448fb 100644
--- a/gthumb/gth-thumb-loader.h
+++ b/gthumb/gth-thumb-loader.h
@@ -54,6 +54,7 @@ struct _GthThumbLoaderClass
GType gth_thumb_loader_get_type (void);
GthThumbLoader * gth_thumb_loader_new (int requested_size);
+GthThumbLoader * gth_thumb_loader_copy (GthThumbLoader *self);
void gth_thumb_loader_set_loader_func (GthThumbLoader *self,
GthImageLoaderFunc loader_func);
void gth_thumb_loader_set_requested_size (GthThumbLoader *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]