From 1f9e7dee25dfd002b6b1ab4636faa9a24f74d09f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 4 Jan 2015 19:58:05 +0100 Subject: generators: Use single function for all templates This commit makes use of a common function for all template parsing and page writing. The behaviour is controlled by the "item" argument passed in. This allows us to have a single code that generates code for list of items as well as for a single item. In the future, this can be used for e.g. combining thumbnails and large images on the same page. Other than that this commit also brings several other changes: - further clarification of theming setup XML file - tag has been moved out of the structure into the structure where it functionally belongs. Only whole albums can be protected and the substitute thumbnail is displayed on index pages. - position marker format has been broken out to a constant - added few more FIXMEs to mark places that will change soon - some template variables have been renamed --- src/generators.h | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'src/generators.h') diff --git a/src/generators.h b/src/generators.h index bff6cde..a9b573b 100644 --- a/src/generators.h +++ b/src/generators.h @@ -34,41 +34,25 @@ G_BEGIN_DECLS gboolean generate_image (TGallerySetup *setup, TAlbum *items, TIndexItem *item, - unsigned int item_index, TPathInfo *path_info, gboolean query_update); /* - * write_html_album: process album and index template files + * write_html_page: process template file * * template_src = template file of the album/index * dst = save generated file as * items = array of items in the album/index + * item = when non-NULL, page will be written as a single picture page * */ -gboolean write_html_album (TGallerySetup *setup, - TPathInfo *path_info, - TGalleryDesignTheme *theme, - const gchar *template_src, - const gchar *dst, - TAlbum *items); - -/* - * write_html_image: process single image template file - * - * template_src = template file of the album/index - * dst = save generated file as - * item = data for the current item - * parent_items = array of items in the album, to determine our position and make links to previous/next image - * - */ -gboolean write_html_image (TGallerySetup *setup, - TPathInfo *path_info, - TGalleryDesignTheme *theme, - const gchar *template_src, - const gchar *dst, - TIndexItem *item, - TAlbum *parent_items); +gboolean write_html_page (TGallerySetup *setup, + TPathInfo *path_info, + TGalleryDesignTheme *theme, + const gchar *template_src, + const gchar *dst, + TAlbum *items, + TIndexItem *item); /* * write_auth_passwd_file, write_auth_htaccess_file: setup authentication files for the current album -- cgit v1.2.3