From 6fffe1a21d5acaa544f7796241e13ff37e75349f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 25 Jan 2015 18:23:03 +0100 Subject: theming: Make custom image size handling fully flexible This commit brings full flexibility of custom image size definition and usage. When a custom image size is defined, it automatically maps to the album tag arguments. Alternatively, this automatic name matching can be overriden by theme setup tags. This allows us to supply image of different sizes that can be also used in templates. Legacy behaviour of "fullsize" and "preview" image size fallback is retained (though not recommended in new theming setups). --- src/items.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/items.h') diff --git a/src/items.h b/src/items.h index 8c14dda..b465a46 100644 --- a/src/items.h +++ b/src/items.h @@ -20,6 +20,7 @@ #include #include "properties-table.h" +#include "setup.h" G_BEGIN_DECLS @@ -76,8 +77,8 @@ typedef struct { gchar *path; gchar *title; gchar *title_description; - gchar *thumbnail; /* FIXME: port to flexible image sizes */ - gchar *preview; /* FIXME: port to flexible image sizes */ + gchar *thumbnail; /* index pages */ + GHashTable *image_sizes; gboolean force_nofullsize; gboolean force_fullsize; gboolean hidden; @@ -110,16 +111,10 @@ typedef enum { PROP_METADATA_OVERRIDE_FOCAL_LENGTH, } PropertyName; -/* - * GET_ITEM_TARGET_FILENAME: get target item filename - */ -/* FIXME: port to flexible image sizes */ -#define GET_ITEM_TARGET_FILENAME(i) g_path_get_basename ((i->path == NULL && i->preview) ? i->preview : i->path) - /* * parse_album_xml: XML parser for gallery index.xml files */ -TAlbum * parse_album_xml (const gchar *filename, TPathInfo *path_info); +TAlbum * parse_album_xml (TGallerySetup *setup, const gchar *filename, TPathInfo *path_info); /* * free_album_data: free allocated album data @@ -156,6 +151,12 @@ TIndexItem *dup_index_item (TIndexItem *item); */ void free_index_item (TIndexItem *item); +/* + * get_item_target_filename: get target item filename + */ +gchar * get_item_target_filename (TIndexItem *item); + + /* * get_prop_*: retrieve attribute value from properties tables, with item taking priority, using items otherwise or falling back to default if not set anywhere -- cgit v1.2.3