diff options
author | Christophe Fergeau <teuf@gnome.org> | 2008-05-30 12:11:37 +0000 |
---|---|---|
committer | Christophe Fergeau <teuf@gnome.org> | 2008-05-30 12:11:37 +0000 |
commit | ed18e3c044be32b86288da3f95529ced3b57ccf4 (patch) | |
tree | da8304a192718407a1cfe0c82c242c52074b89fa /src/itdb_thumb.h | |
parent | 139724536bae43b09cdbe95c4dcadf0bf5bdd751 (diff) | |
download | libgpod-tmz-ed18e3c044be32b86288da3f95529ced3b57ccf4.tar.gz libgpod-tmz-ed18e3c044be32b86288da3f95529ced3b57ccf4.tar.xz libgpod-tmz-ed18e3c044be32b86288da3f95529ced3b57ccf4.zip |
forgot to add these new files
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1993 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/itdb_thumb.h')
-rw-r--r-- | src/itdb_thumb.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/src/itdb_thumb.h b/src/itdb_thumb.h new file mode 100644 index 0000000..db341af --- /dev/null +++ b/src/itdb_thumb.h @@ -0,0 +1,115 @@ +/* +| Copyright (C) 2002-2007 Jorg Schuler <jcsjcs at users sourceforge net> +| 2007 Christophe Fergeau <teuf at gnome org> +| +| The code contained in this file is free software; you can redistribute +| it and/or modify it under the terms of the GNU Lesser General Public +| License as published by the Free Software Foundation; either version +| 2.1 of the License, or (at your option) any later version. +| +| This file 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 +| Lesser General Public License for more details. +| +| You should have received a copy of the GNU Lesser General Public +| License along with this code; if not, write to the Free Software +| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +| +| iTunes and iPod are trademarks of Apple +| +| This product is not supported/written/published by Apple! +*/ +#ifndef __ITDB_THUMB_H__ +#define __ITDB_THUMB_H__ + +#include <gdk-pixbuf/gdk-pixbuf.h> +#include "itdb.h" +#include "itdb_device.h" + +/* The Itdb_Thumb structure can represent two slightly different + thumbnails: + + a) a thumbnail before it's transferred to the iPod. + + offset and size are 0 + + width and height, if unequal 0, will indicate the size on the + iPod. width and height are set the first time a pixbuf is + requested for this thumbnail. + + type is set according to the type this thumbnail represents + + filename point to a 'real' image file OR image_data and + image_data_len are set. + + b) a thumbnail (big or small) stored on a database in the iPod. In + these cases, id corresponds to the ID originally used in the + database, filename points to a .ithmb file on the iPod + */ +struct _Itdb_Thumb { + ItdbThumbDataType data_type; + guint rotation; +}; + +struct _Itdb_Thumb_File { + struct _Itdb_Thumb parent; + gchar *filename; +}; +typedef struct _Itdb_Thumb_File Itdb_Thumb_File; + +struct _Itdb_Thumb_Memory { + struct _Itdb_Thumb parent; + guchar *image_data; /* holds the thumbnail data of + non-transfered thumbnails when + filename == NULL */ + gsize image_data_len; /* length of data */ +}; +typedef struct _Itdb_Thumb_Memory Itdb_Thumb_Memory; + +struct _Itdb_Thumb_Pixbuf { + struct _Itdb_Thumb parent; + GdkPixbuf *pixbuf; +}; +typedef struct _Itdb_Thumb_Pixbuf Itdb_Thumb_Pixbuf; + +struct _Itdb_Thumb_Ipod { + struct _Itdb_Thumb parent; + GList *thumbs; +}; +typedef struct _Itdb_Thumb_Ipod Itdb_Thumb_Ipod; + +struct _Itdb_Thumb_Ipod_Item { + const Itdb_ArtworkFormat *format; + gchar *filename; + guint32 offset; + guint32 size; + gint16 width; + gint16 height; + gint16 horizontal_padding; + gint16 vertical_padding; +}; +typedef struct _Itdb_Thumb_Ipod_Item Itdb_Thumb_Ipod_Item; + +G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_new_from_file (const gchar *filename); +G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_new_from_data (const guchar *data, + gsize len); +G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_new_from_pixbuf (GdkPixbuf *pixbuf); +G_GNUC_INTERNAL Itdb_Thumb_Ipod_Item *itdb_thumb_new_item_from_ipod (const Itdb_ArtworkFormat *format); +G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_ipod_new (); +G_GNUC_INTERNAL void itdb_thumb_set_rotation (Itdb_Thumb *thumb, + guint rotation); +G_GNUC_INTERNAL guint itdb_thumb_get_rotation (Itdb_Thumb *thumb); +G_GNUC_INTERNAL void itdb_thumb_ipod_add (Itdb_Thumb_Ipod *thumbs, + Itdb_Thumb_Ipod_Item *thumb); +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); +#endif |