[gimp/goat-invasion: 117/412] app: add GimpPickable::get_babl_format_with_alpha()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 117/412] app: add GimpPickable::get_babl_format_with_alpha()
- Date: Tue, 3 Apr 2012 09:42:56 +0000 (UTC)
commit 8eddf61766245585121e3f1e5125d671557a8845
Author: Michael Natterer <mitch gimp org>
Date: Sun Mar 18 15:37:12 2012 +0100
app: add GimpPickable::get_babl_format_with_alpha()
app/core/gimpdrawable.c | 15 ++++++++-------
app/core/gimpimagemap.c | 25 ++++++++++++++++++-------
app/core/gimppickable.c | 17 ++++++++++++++++-
app/core/gimppickable.h | 31 +++++++++++++++++--------------
app/core/gimpprojection.c | 19 ++++++++++---------
5 files changed, 69 insertions(+), 38 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 92fcf3b..fd272bf 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -269,13 +269,14 @@ gimp_drawable_init (GimpDrawable *drawable)
static void
gimp_drawable_pickable_iface_init (GimpPickableInterface *iface)
{
- iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_item_get_image;
- iface->get_babl_format = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_babl_format;
- iface->get_image_type = (GimpImageType (*) (GimpPickable *pickable)) gimp_drawable_type;
- iface->get_bytes = (gint (*) (GimpPickable *pickable)) gimp_drawable_bytes;
- iface->get_buffer = (GeglBuffer * (*) (GimpPickable *pickable)) gimp_drawable_get_read_buffer;
- iface->get_tiles = (TileManager * (*) (GimpPickable *pickable)) gimp_drawable_get_tiles;
- iface->get_pixel_at = gimp_drawable_get_pixel_at;
+ iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_item_get_image;
+ iface->get_babl_format = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_babl_format;
+ iface->get_babl_format_with_alpha = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_babl_format_with_alpha;
+ iface->get_image_type = (GimpImageType (*) (GimpPickable *pickable)) gimp_drawable_type;
+ iface->get_bytes = (gint (*) (GimpPickable *pickable)) gimp_drawable_bytes;
+ iface->get_buffer = (GeglBuffer * (*) (GimpPickable *pickable)) gimp_drawable_get_read_buffer;
+ iface->get_tiles = (TileManager * (*) (GimpPickable *pickable)) gimp_drawable_get_tiles;
+ iface->get_pixel_at = gimp_drawable_get_pixel_at;
}
static void
diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c
index ed8ad18..7463459 100644
--- a/app/core/gimpimagemap.c
+++ b/app/core/gimpimagemap.c
@@ -102,6 +102,8 @@ static void gimp_image_map_finalize (GObject *obje
static GimpImage * gimp_image_map_get_image (GimpPickable *pickable);
static const Babl * gimp_image_map_get_babl_format (GimpPickable *pickable);
+static const Babl * gimp_image_map_get_babl_format_with_alpha
+ (GimpPickable *pickable);
static GimpImageType gimp_image_map_get_image_type (GimpPickable *pickable);
static gint gimp_image_map_get_bytes (GimpPickable *pickable);
static GeglBuffer * gimp_image_map_get_buffer (GimpPickable *pickable);
@@ -154,13 +156,14 @@ gimp_image_map_class_init (GimpImageMapClass *klass)
static void
gimp_image_map_pickable_iface_init (GimpPickableInterface *iface)
{
- iface->get_image = gimp_image_map_get_image;
- iface->get_babl_format = gimp_image_map_get_babl_format;
- iface->get_image_type = gimp_image_map_get_image_type;
- iface->get_bytes = gimp_image_map_get_bytes;
- iface->get_buffer = gimp_image_map_get_buffer;
- iface->get_tiles = gimp_image_map_get_tiles;
- iface->get_pixel_at = gimp_image_map_get_pixel_at;
+ iface->get_image = gimp_image_map_get_image;
+ iface->get_babl_format = gimp_image_map_get_babl_format;
+ iface->get_babl_format_with_alpha = gimp_image_map_get_babl_format_with_alpha;
+ iface->get_image_type = gimp_image_map_get_image_type;
+ iface->get_bytes = gimp_image_map_get_bytes;
+ iface->get_buffer = gimp_image_map_get_buffer;
+ iface->get_tiles = gimp_image_map_get_tiles;
+ iface->get_pixel_at = gimp_image_map_get_pixel_at;
}
static void
@@ -272,6 +275,14 @@ gimp_image_map_get_babl_format (GimpPickable *pickable)
return gimp_pickable_get_babl_format (GIMP_PICKABLE (image_map->drawable));
}
+static const Babl *
+gimp_image_map_get_babl_format_with_alpha (GimpPickable *pickable)
+{
+ GimpImageMap *image_map = GIMP_IMAGE_MAP (pickable);
+
+ return gimp_pickable_get_babl_format_with_alpha (GIMP_PICKABLE (image_map->drawable));
+}
+
static GimpImageType
gimp_image_map_get_image_type (GimpPickable *pickable)
{
diff --git a/app/core/gimppickable.c b/app/core/gimppickable.c
index 7f2d051..a43b0b3 100644
--- a/app/core/gimppickable.c
+++ b/app/core/gimppickable.c
@@ -111,7 +111,7 @@ gimp_pickable_get_babl_format (GimpPickable *pickable)
{
GimpPickableInterface *pickable_iface;
- g_return_val_if_fail (GIMP_IS_PICKABLE (pickable), -1);
+ g_return_val_if_fail (GIMP_IS_PICKABLE (pickable), NULL);
pickable_iface = GIMP_PICKABLE_GET_INTERFACE (pickable);
@@ -121,6 +121,21 @@ gimp_pickable_get_babl_format (GimpPickable *pickable)
return NULL;
}
+const Babl *
+gimp_pickable_get_babl_format_with_alpha (GimpPickable *pickable)
+{
+ GimpPickableInterface *pickable_iface;
+
+ g_return_val_if_fail (GIMP_IS_PICKABLE (pickable), NULL);
+
+ pickable_iface = GIMP_PICKABLE_GET_INTERFACE (pickable);
+
+ if (pickable_iface->get_babl_format_with_alpha)
+ return pickable_iface->get_babl_format_with_alpha (pickable);
+
+ return NULL;
+}
+
gint
gimp_pickable_get_bytes (GimpPickable *pickable)
{
diff --git a/app/core/gimppickable.h b/app/core/gimppickable.h
index 195a314..3ab755e 100644
--- a/app/core/gimppickable.h
+++ b/app/core/gimppickable.h
@@ -35,20 +35,21 @@ struct _GimpPickableInterface
GTypeInterface base_iface;
/* virtual functions */
- void (* flush) (GimpPickable *pickable);
- GimpImage * (* get_image) (GimpPickable *pickable);
- const Babl * (* get_babl_format) (GimpPickable *pickable);
- GimpImageType (* get_image_type) (GimpPickable *pickable);
- gint (* get_bytes) (GimpPickable *pickable);
- GeglBuffer * (* get_buffer) (GimpPickable *pickable);
- TileManager * (* get_tiles) (GimpPickable *pickable);
- gboolean (* get_pixel_at) (GimpPickable *pickable,
- gint x,
- gint y,
- guchar *pixel);
- gint (* get_opacity_at) (GimpPickable *pickable,
- gint x,
- gint y);
+ void (* flush) (GimpPickable *pickable);
+ GimpImage * (* get_image) (GimpPickable *pickable);
+ const Babl * (* get_babl_format) (GimpPickable *pickable);
+ const Babl * (* get_babl_format_with_alpha) (GimpPickable *pickable);
+ GimpImageType (* get_image_type) (GimpPickable *pickable);
+ gint (* get_bytes) (GimpPickable *pickable);
+ GeglBuffer * (* get_buffer) (GimpPickable *pickable);
+ TileManager * (* get_tiles) (GimpPickable *pickable);
+ gboolean (* get_pixel_at) (GimpPickable *pickable,
+ gint x,
+ gint y,
+ guchar *pixel);
+ gint (* get_opacity_at) (GimpPickable *pickable,
+ gint x,
+ gint y);
};
@@ -57,6 +58,8 @@ GType gimp_pickable_interface_get_type (void) G_GNUC_CONST;
void gimp_pickable_flush (GimpPickable *pickable);
GimpImage * gimp_pickable_get_image (GimpPickable *pickable);
const Babl * gimp_pickable_get_babl_format (GimpPickable *pickable);
+const Babl * gimp_pickable_get_babl_format_with_alpha
+ (GimpPickable *pickable);
GimpImageType gimp_pickable_get_image_type (GimpPickable *pickable);
gint gimp_pickable_get_bytes (GimpPickable *pickable);
GeglBuffer * gimp_pickable_get_buffer (GimpPickable *pickable);
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 2de3323..6b660f5 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -162,15 +162,16 @@ gimp_projection_init (GimpProjection *proj)
static void
gimp_projection_pickable_iface_init (GimpPickableInterface *iface)
{
- iface->flush = gimp_projection_pickable_flush;
- iface->get_image = gimp_projection_get_image;
- iface->get_babl_format = gimp_projection_get_babl_format;
- iface->get_image_type = gimp_projection_get_image_type;
- iface->get_bytes = gimp_projection_get_bytes;
- iface->get_buffer = gimp_projection_get_buffer;
- iface->get_tiles = gimp_projection_get_tiles;
- iface->get_pixel_at = gimp_projection_get_pixel_at;
- iface->get_opacity_at = gimp_projection_get_opacity_at;
+ iface->flush = gimp_projection_pickable_flush;
+ iface->get_image = gimp_projection_get_image;
+ iface->get_babl_format = gimp_projection_get_babl_format;
+ iface->get_babl_format_with_alpha = gimp_projection_get_babl_format; /* sic */
+ iface->get_image_type = gimp_projection_get_image_type;
+ iface->get_bytes = gimp_projection_get_bytes;
+ iface->get_buffer = gimp_projection_get_buffer;
+ iface->get_tiles = gimp_projection_get_tiles;
+ iface->get_pixel_at = gimp_projection_get_pixel_at;
+ iface->get_opacity_at = gimp_projection_get_opacity_at;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]