diff options
Diffstat (limited to 'src/setup.h')
| -rw-r--r-- | src/setup.h | 125 |
1 files changed, 77 insertions, 48 deletions
diff --git a/src/setup.h b/src/setup.h index 3bc3b3f..69e92b6 100644 --- a/src/setup.h +++ b/src/setup.h @@ -23,16 +23,16 @@ G_BEGIN_DECLS -/* Directory names */ -#define DEFAULT_THUMBNAIL_DIR "_thumb" -#define DEFAULT_IMG_BIG_DIR "_big" -#define DEFAULT_IMG_ORIG_DIR "_orig" -#define DEFAULT_THUMBNAIL_NAME_FORMAT "thn_%d_%s" +#define DEFAULT_INDEX_FILENAME "index.html" +#define THUMBNAIL_NAME_FORMAT "%.3d_%s" +#define TARGET_IMAGE_DIR_PREFIX "_" #define SETUP_XML "setup.xml" -#define DEFAULT_INDEX_FILENAME "index.html" +/* forward declaration */ +typedef struct TGalleryDesign TGalleryDesign; + typedef enum { THUMBNAIL_SQUARE_TYPE_NONE, THUMBNAIL_SQUARE_TYPE_SIMPLE @@ -43,67 +43,81 @@ typedef enum { typedef struct { gboolean verbose; gboolean update_mode; - gchar *real_templates_dir; - + gboolean override_nofullsize; gchar *setup_xml_path; - gchar *templates_path; - gchar *template_index; - gchar *template_album; - gchar *template_photo; - gchar **template_files; - gboolean support_files_use_common_root; - gchar *index_file_name; - gchar *thumbnail_dir; - gchar *img_big_dir; - gchar *img_orig_dir; - gchar *thumbnail_name_format; - ThumbnailSquareType squared_thumbnail_type; + TGalleryDesign *design; - gchar *footer; - gchar *meta_author; - gchar *meta_author_email; - gchar *meta_description; - gchar *meta_keywords; - gboolean use_title_as_meta; - - int thumbnail_quality; - unsigned long thumbnail_landscape_width; - unsigned long thumbnail_landscape_height; - unsigned long thumbnail_portrait_width; - unsigned long thumbnail_portrait_height; - unsigned long thumbnail_square_size; - - int preview_quality; - unsigned long preview_landscape_width; - unsigned long preview_landscape_height; - unsigned long preview_portrait_width; - unsigned long preview_portrait_height; + /* design section */ + gchar *design_setup_file; + gboolean supplemental_files_use_common_root; + /* images section */ gchar *border_style; - gboolean nofullsize; - gboolean override_nofullsize; - gboolean preload; gboolean use_iptc_exif; gboolean erase_exif_thumbnail; + gboolean nofullsize; + ThumbnailSquareType squared_thumbnail_type; + /* meta section */ + gchar *meta_author; + gchar *meta_author_email; + gchar *meta_description; + gchar *meta_keywords; + gboolean use_title_as_meta; gchar *site_title; gchar *add_copyright; + gchar *favicon_file; + gchar *favicon_type; + + /* navigation section */ gboolean use_inpage_links; gboolean show_go_up; gboolean show_exif_table; - gchar *favicon_file; - gchar *favicon_type; - + /* feed section */ gboolean feed_enabled; gchar *feed_filename; gchar *feed_title; gchar *feed_base_url; + + /* footer section */ + gchar *footer; } TGallerySetup; +typedef struct { + gchar *name; + int landscape_width; + int landscape_height; + int portrait_width; + int portrait_height; + int square_size; + int quality; + gboolean no_resize; +} TImageSize; + +typedef struct { + gboolean enabled; + gchar *index_template; + gchar *index_filename; + gchar *album_template; + gchar *album_filename; + gchar *album_image_size; + gchar *picture_template; + gchar *picture_filename; + gchar *picture_image_size; + gchar **supplemental_files; +} TGalleryDesignTheme; + +struct TGalleryDesign { + GList *image_sizes; + GList *themes; + gchar **supplemental_files; +}; + + /* * find_setup_xml: try to find setup.xml in standard paths @@ -116,15 +130,30 @@ TGallerySetup * find_setup_xml (); TGallerySetup * parse_setup_xml (const gchar *filename); /* + * parse_design_setup_xml: XML parser for design.xml file + */ +TGalleryDesign * parse_design_setup_xml (const gchar *filename); + +/* + * validate_design_setup: validate design.xml file setup + */ +gboolean validate_design_setup (TGalleryDesign *design); + +/* * free_setup_data: free allocated setup data */ void free_setup_data (TGallerySetup *setup); /* - * find_templates_directory: absolute/relative path checks, trying to find templates directory - * - returned string should be freed + * free_design_setup_data: free allocated design setup data + */ +void free_design_setup_data (TGalleryDesign *design); + +/* + * find_design_directory: try to find design templates directory + * - returned string should be freed */ -gchar * find_templates_directory (TGallerySetup *setup); +gchar * find_design_directory (TGallerySetup *setup); G_END_DECLS |
