diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2015-01-25 18:23:03 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2015-01-25 18:23:03 +0100 |
| commit | 6fffe1a21d5acaa544f7796241e13ff37e75349f (patch) | |
| tree | 83e0cf3237f11742a89fbc925ac327595b930068 /src/items.h | |
| parent | 7779510229bb478f591cc67c0cb0e2fbb84fdb98 (diff) | |
| download | cataract-6fffe1a21d5acaa544f7796241e13ff37e75349f.tar.xz | |
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 <item> tag arguments. Alternatively, this automatic name matching
can be overriden by <size tagname="..."> 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).
Diffstat (limited to 'src/items.h')
| -rw-r--r-- | src/items.h | 19 |
1 files changed, 10 insertions, 9 deletions
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 <glib.h> #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; @@ -111,15 +112,9 @@ typedef enum { } 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 |
