diff options
author | Christophe Fergeau <teuf@gnome.org> | 2008-07-29 20:11:37 +0000 |
---|---|---|
committer | Christophe Fergeau <teuf@gnome.org> | 2008-07-29 20:11:37 +0000 |
commit | 924df8a406041b58af100d28a45df8775eab4698 (patch) | |
tree | 891c46cc83b935787bb7939cd91adddb4fb7fd71 /src | |
parent | 89fd72c08236360e279847e89edc8402dfa4a04b (diff) | |
download | libgpod-tmz-924df8a406041b58af100d28a45df8775eab4698.tar.gz libgpod-tmz-924df8a406041b58af100d28a45df8775eab4698.tar.xz libgpod-tmz-924df8a406041b58af100d28a45df8775eab4698.zip |
Some public API work, hide ItdbThumbType as well as ItdbThumbIpod
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2070 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src')
-rw-r--r-- | src/itdb.h | 15 | ||||
-rw-r--r-- | src/itdb_thumb.c | 27 | ||||
-rw-r--r-- | src/itdb_thumb.h | 19 |
3 files changed, 41 insertions, 20 deletions
@@ -478,18 +478,6 @@ struct _Itdb_Chapterdata /* one star is how much (track->rating) */ #define ITDB_RATING_STEP 20 -/* Types of thumbnails in Itdb_Image */ -enum _ItdbThumbDataType { - ITDB_THUMB_TYPE_INVALID, - ITDB_THUMB_TYPE_FILE, - ITDB_THUMB_TYPE_MEMORY, - ITDB_THUMB_TYPE_PIXBUF, - ITDB_THUMB_TYPE_IPOD -}; -typedef enum _ItdbThumbDataType ItdbThumbDataType; - - - struct _Itdb_Artwork { Itdb_Thumb *thumbnail; guint32 id; /* Artwork id used by photoalbums, starts at @@ -1210,6 +1198,9 @@ gpointer itdb_artwork_get_pixbuf (Itdb_Device *device, Itdb_Artwork *artwork, /* itdb_thumb_... */ Itdb_Thumb *itdb_thumb_duplicate (Itdb_Thumb *thumb); +gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *dev, Itdb_Thumb *thumb, + gint width, gint height); +GList *itdb_thumb_to_pixbufs (Itdb_Device *dev, Itdb_Thumb *thumb); void itdb_thumb_free (Itdb_Thumb *thumb); /* itdb_chapterdata_... */ diff --git a/src/itdb_thumb.c b/src/itdb_thumb.c index fe89e94..b55fe6c 100644 --- a/src/itdb_thumb.c +++ b/src/itdb_thumb.c @@ -504,7 +504,7 @@ gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, return pixbuf; } -GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thumb) +static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thumb) { const GList *items; GList *pixbufs = NULL; @@ -524,6 +524,28 @@ GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thumb) return pixbufs; } + +GList *itdb_thumb_to_pixbufs (Itdb_Device *dev, Itdb_Thumb *thumb) +{ + GList *pixbufs = NULL; + GdkPixbuf *pixbuf; + + switch (thumb->data_type) { + case ITDB_THUMB_TYPE_IPOD: + pixbufs = itdb_thumb_ipod_to_pixbufs (dev, (Itdb_Thumb_Ipod *)thumb); + break; + case ITDB_THUMB_TYPE_FILE: + case ITDB_THUMB_TYPE_MEMORY: + case ITDB_THUMB_TYPE_PIXBUF: + pixbuf = itdb_thumb_to_pixbuf_at_size (dev, thumb, -1, -1); + pixbufs = g_list_append (pixbufs, pixbuf); + break; + case ITDB_THUMB_TYPE_INVALID: + g_assert_not_reached (); + } + + return pixbufs; +} #else gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *dev, Itdb_Thumb *thumb, gint width, gint height) @@ -531,7 +553,8 @@ gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *dev, Itdb_Thumb *thumb, return NULL; } -GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thumb) + +GList *itdb_thumb_to_pixbufs (Itdb_Device *dev, Itdb_Thumb *thumb) { return NULL; } diff --git a/src/itdb_thumb.h b/src/itdb_thumb.h index 940128a..55672ff 100644 --- a/src/itdb_thumb.h +++ b/src/itdb_thumb.h @@ -26,6 +26,16 @@ #include "itdb.h" #include "itdb_device.h" +/* Types of thumbnails in Itdb_Image */ +enum _ItdbThumbDataType { + ITDB_THUMB_TYPE_INVALID, + ITDB_THUMB_TYPE_FILE, + ITDB_THUMB_TYPE_MEMORY, + ITDB_THUMB_TYPE_PIXBUF, + ITDB_THUMB_TYPE_IPOD +}; +typedef enum _ItdbThumbDataType ItdbThumbDataType; + /* The Itdb_Thumb structure can represent two slightly different thumbnails: @@ -105,10 +115,7 @@ G_GNUC_INTERNAL const GList *itdb_thumb_ipod_get_thumbs (Itdb_Thumb_Ipod *thumbs G_GNUC_INTERNAL char *itdb_thumb_ipod_get_filename (Itdb_Device *device, Itdb_Thumb_Ipod_Item *thumb); G_GNUC_INTERNAL Itdb_Thumb_Ipod_Item *itdb_thumb_ipod_get_item_by_type (Itdb_Thumb *thumbs, const Itdb_ArtworkFormat *format); -G_GNUC_INTERNAL -gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, - Itdb_Thumb_Ipod_Item *item); -gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *dev, Itdb_Thumb *thumb, - gint width, gint height); -GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thumb); +G_GNUC_INTERNAL gpointer +itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, + Itdb_Thumb_Ipod_Item *item); #endif |