From 75bb13e531654a561dc7baa2f2bc594aa4a8fc52 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 29 May 2011 19:00:44 +0200 Subject: Introduce new theming system This extends current templating system to another dimension, bringing the possibility to have multiple themes generated at once. The purpose is to be able to switch between multiple designs, from PC to mobile, classic vs. flat view, slideshow, etc. For the moment, only the classic theme is available. Rules: * for switching between themes, place a link inside your template manually - it's not a cgg concern, only your theming infrastructure * don't forget to define different file names for index and album pages across different themes * it's recommended to keep default theme named as "index.*" to avoid showing directory listing on webserver Notes: * some TODOs will be fixed when we have new theme using these advanced features (e.g. pictures in album pages) * TODO: introduce tag/block conditional system, allow custom user defines for each theme/page * TODO: deprecate , and in favor of conditionals (these tags belong to theming) --- src/items.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/items.h') diff --git a/src/items.h b/src/items.h index e83961a..cef184c 100644 --- a/src/items.h +++ b/src/items.h @@ -74,14 +74,20 @@ typedef struct { } TIndexItem; typedef struct { - gchar *source_root; /* relative or absolute path of the source root */ - gchar *dest_root; /* relative or absolute path of the output directory */ - gchar *src_dir; /* album source directory */ - gchar *dest_dir; /* album output directory */ - gchar *album_path; /* current path in the gallery hierarchy, starting with '/' */ + gchar *templates_root; /* relative or absolute path of design templates directory */ + gchar *source_root; /* relative or absolute path of the source root */ + gchar *dest_root; /* relative or absolute path of the output directory */ + gchar *src_dir; /* album source directory */ + gchar *dest_dir; /* album output directory */ + gchar *album_path; /* current path in the gallery hierarchy, starting with '/' */ } TPathInfo; +/* + * GET_ITEM_TARGET_FILENAME: get target item filename + */ +#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 */ @@ -102,6 +108,11 @@ int get_album_objects_count (const gchar *filename); */ void get_album_titles (const gchar *filename, gchar **title, gchar **description, gchar **thumbnail); +/* + * get_child_gallery_type: retrieve gallery type from the source XML file + */ +TGalleryType get_child_gallery_type (const gchar *filename); + /* * free_path_info: free allocated pathinfo data */ -- cgit v1.2.3