#include "config.h"
#include <ctype.h>
#include <math.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <sys/times.h>
#include "afterbase.h"
#include "afterimage.h"
#include "imencdec.h"
Go to the source code of this file.
#define ASXML_ALIGN_BOTTOM (0x01<<3) |
#define ASXML_ALIGN_LEFT (0x01<<0) |
#define ASXML_ALIGN_RIGHT (0x01<<1) |
#define ASXML_ALIGN_TOP (0x01<<2) |
#define HANDLE_SIZED_TAG | ( | ttag | ) | else if( !strcmp(doc->tag, #ttag) ) result = handle_asxml_tag_##ttag( &state, doc, parm, imtmp, width, height ) |
Referenced by build_image_from_xml().
ASImage* build_image_from_xml | ( | ASVisual * | asv, | |
ASImageManager * | imman, | |||
ASFontManager * | fontman, | |||
xml_elem_t * | doc, | |||
xml_elem_t ** | rparm, | |||
ASFlagType | flags, | |||
int | verbose, | |||
Window | display_win | |||
) |
Definition at line 2321 of file asimagexml.c.
References build_image_from_xml(), xml_elem_t::child, commit_xml_image_built(), fetch_asimage(), free(), handle_asxml_tag_background(), handle_asxml_tag_blur(), handle_asxml_tag_color(), handle_asxml_tag_composite(), handle_asxml_tag_gradient(), handle_asxml_tag_if(), handle_asxml_tag_img(), handle_asxml_tag_printf(), handle_asxml_tag_recall(), handle_asxml_tag_release(), handle_asxml_tag_save(), handle_asxml_tag_set(), handle_asxml_tag_solid(), handle_asxml_tag_text(), HANDLE_SIZED_TAG, height, if(), IsCDATA, LOCAL_DEBUG_OUT, mirror, mystrdup, NULL, xml_elem_t::parm, ptr, release_asimage(), REPLACE_STRING, result(), rotate, safe_asimage_destroy(), xml_elem_t::tag, tparm(), translate_tag_size(), xml_elem_delete, and xml_parse_parm.
Referenced by build_image_from_xml(), and compose_asimage_xml_from_doc().
ASImage* commit_xml_image_built | ( | ASImageXMLState * | state, | |
char * | id, | |||
ASImage * | result | |||
) |
Definition at line 436 of file asimagexml.c.
References asxml_var_insert, buf, clone_asimage(), dup_asimage(), free(), ASImageXMLState::imman, NEW_ARRAY, NULL, result(), safe_asimage_destroy(), SCL_DO_ALL, show_progress, show_warning, sprintf(), store_asimage(), and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
ASImage* compose_asimage_xml | ( | ASVisual * | asv, | |
ASImageManager * | imman, | |||
ASFontManager * | fontman, | |||
char * | doc_str, | |||
ASFlagType | flags, | |||
int | verbose, | |||
Window | display_win, | |||
const char * | path | |||
) | [inline] |
Definition at line 319 of file asimagexml.c.
References compose_asimage_xml_from_doc(), NULL, xml_elem_delete, and xml_parse_doc.
ASImage* compose_asimage_xml_at_size | ( | ASVisual * | asv, | |
ASImageManager * | imman, | |||
ASFontManager * | fontman, | |||
char * | doc_str, | |||
ASFlagType | flags, | |||
int | verbose, | |||
Window | display_win, | |||
const char * | path, | |||
int | target_width, | |||
int | target_height | |||
) |
Definition at line 309 of file asimagexml.c.
References compose_asimage_xml_from_doc(), NULL, xml_elem_delete, and xml_parse_doc.
Referenced by load_xml2ASImage().
ASImage* compose_asimage_xml_from_doc | ( | ASVisual * | asv, | |
ASImageManager * | imman, | |||
ASFontManager * | fontman, | |||
xml_elem_t * | doc, | |||
ASFlagType | flags, | |||
int | verbose, | |||
Window | display_win, | |||
const char * | path, | |||
int | target_width, | |||
int | target_height | |||
) |
Definition at line 198 of file asimagexml.c.
References _as_xml_font_manager, _as_xml_image_manager, ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, asxml_var_get, asxml_var_init, asxml_var_insert, ASXMLVAR_TargetHeight, ASXMLVAR_TargetWidth, build_image_from_xml(), xml_elem_t::child, create_generic_fontman(), create_generic_imageman(), destroy_font_manager(), destroy_image_manager(), ASVisual::dpy, False, forget_asimage(), fprintf(), free(), ASImage::height, i, ASImage::imageman, LOCAL_DEBUG_OUT, ASImage::magic, MAX_SEARCH_PATHS, mystrdup, NULL, ptr, safe_asimage_destroy(), scale_asimage(), ASImageManager::search_path, True, ASImage::width, and xml_print.
Referenced by compose_asimage_xml(), and compose_asimage_xml_at_size().
ASFontManager* create_generic_fontman | ( | Display * | dpy, | |
const char * | path | |||
) |
Definition at line 172 of file asimagexml.c.
References ASFONT_PATH_ENVVAR, copy_replace_envvar, create_font_manager(), free(), getenv(), NULL, safemalloc, and strcpy().
Referenced by compose_asimage_xml_from_doc().
ASImageManager* create_generic_imageman | ( | const char * | path | ) |
Definition at line 157 of file asimagexml.c.
References ASIMAGE_PATH_ENVVAR, copy_replace_envvar, create_image_manager(), free(), getenv(), LOCAL_DEBUG_OUT, NULL, SCREEN_GAMMA, ASImageManager::search_path, and show_progress.
Referenced by compose_asimage_xml_from_doc().
static ASImage* handle_asxml_tag_background | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp | |||
) | [static] |
Definition at line 1557 of file asimagexml.c.
References argb, ARGB32_Black, clone_asimage(), LOCAL_DEBUG_OUT, NULL, parse_argb_color, ptr, result(), SCL_DO_ALL, show_progress, and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_bevel | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1664 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, BEVEL_SOLID_INLINE, if(), init_image_layers(), LOCAL_DEBUG_OUT, merge_layers(), NULL, p, parse_argb_color, parse_math, ptr, result(), short, show_progress, and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_blur | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp | |||
) | [static] |
Definition at line 1594 of file asimagexml.c.
References if(), LOCAL_DEBUG_OUT, NULL, ptr, result(), SCL_DO_ALL, SCL_DO_ALPHA, SCL_DO_BLUE, SCL_DO_GREEN, SCL_DO_RED, and str.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_color | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 1040 of file asimagexml.c.
References argb, ARGB32_ALPHA8, ARGB32_Black, ARGB32_BLUE16, ARGB32_BLUE8, ARGB32_GREEN16, ARGB32_GREEN8, ARGB32_RED16, ARGB32_RED8, asxml_var_insert, free(), hue162degrees(), if(), LOCAL_DEBUG_OUT, name, NULL, parse_argb_color, ptr, rgb2hsv(), safemalloc, show_progress, sprintf(), strcpy(), val162percent, and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_color2alpha | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 2026 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, color2alpha_asimage(), if(), LOCAL_DEBUG_OUT, NULL, parse_argb_color, parse_math, ptr, result(), show_progress, and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_composite | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 707 of file asimagexml.c.
References align(), blend_scanlines_name2func(), height, i, if(), LOCAL_DEBUG_OUT, mystrcasecmp, NULL, num, ptr, result(), and strtol().
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_crop | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 2073 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_TOP, ASImageXMLState::asv, if(), LOCAL_DEBUG_OUT, NULL, parse_argb_color, parse_math, ptr, result(), show_progress, tile_asimage(), and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_gradient | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1296 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, c, free(), GRADIENT_BottomLeft2TopRight, GRADIENT_Left2Right, GRADIENT_Top2Bottom, GRADIENT_TopLeft2BottomRight, if(), LOCAL_DEBUG_OUT, make_gradient(), max, NEW_ARRAY, NULL, o, p, parse_argb_color, PI, ptr, result(), safecalloc, SCL_DO_ALL, show_progress, show_warning, and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_hsv | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 2219 of file asimagexml.c.
References ARGB32_BLUE16, ARGB32_GREEN16, ARGB32_RED16, hue162degrees(), if(), LOCAL_DEBUG_OUT, NULL, parse_argb_color, parse_math, ptr, result(), and rgb2hue().
static ASImage* handle_asxml_tag_if | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 1212 of file asimagexml.c.
References xml_elem_t::child, for(), if(), LOCAL_DEBUG_OUT, NULL, parse_math, ptr, and xml_elem_t::tag.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_img | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
int | dst_width, | |||
int | dst_height | |||
) | [static] |
Definition at line 917 of file asimagexml.c.
References AS_THUMBNAIL_PROPORTIONAL, ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, ASVisual::dpy, False, get_asimage(), get_dpy_drawable_size(), get_thumbnail_asimage(), GetRootPixmap(), height, ASImageXMLState::imman, LOCAL_DEBUG_OUT, None, NULL, pixmap2asimage(), ptr, result(), safe_asimage_destroy(), scale_asimage(), ASImageManager::search_path, show_progress, and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_mirror | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1758 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, dir(), LOCAL_DEBUG_OUT, mirror_asimage(), mystrcasecmp, NULL, ptr, result(), show_progress, and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_pad | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 2295 of file asimagexml.c.
References ARGB32_Black, ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, if(), LOCAL_DEBUG_OUT, NULL, pad_asimage(), parse_argb_color, parse_math, ptr, result(), show_progress, top(), and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_pixelize | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1977 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, if(), LOCAL_DEBUG_OUT, NULL, parse_math, pixelize_asimage(), ptr, result(), show_progress, and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_printf | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 1113 of file asimagexml.c.
References False, if(), LOCAL_DEBUG_OUT, NULL, parse_math, ptr, True, and val.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_recall | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 968 of file asimagexml.c.
References fetch_asimage(), get_asimage(), ASImageXMLState::imman, LOCAL_DEBUG_OUT, NULL, ptr, result(), show_progress, show_warning, and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_release | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 1008 of file asimagexml.c.
References ASImageXMLState::imman, LOCAL_DEBUG_OUT, ptr, release_asimage_by_name(), show_progress, and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_rotate | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1797 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, dir(), flip_asimage(), FLIP_UPSIDEDOWN, FLIP_VERTICAL, get_flags, LOCAL_DEBUG_OUT, NULL, PI, ptr, result(), show_progress, and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_save | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp | |||
) | [static] |
Definition at line 1499 of file asimagexml.c.
References ASIM_XML_ENABLE_SAVE, compress(), ASImageXMLState::flags, get_flags, if(), LOCAL_DEBUG_OUT, NULL, ptr, result(), save_asimage_to_file(), show_error, show_progress, show_warning, and ASImageXMLState::verbose.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_scale | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1867 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, if(), LOCAL_DEBUG_OUT, NULL, parse_math, ptr, result(), scale_asimage2(), show_progress, and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_set | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 1165 of file asimagexml.c.
References asxml_var_insert, free(), if(), LOCAL_DEBUG_OUT, NULL, parse_math, ptr, safemalloc, sprintf(), and val.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_slice | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1927 of file asimagexml.c.
References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASImageXMLState::asv, False, if(), LOCAL_DEBUG_OUT, NULL, parse_math, ptr, result(), show_progress, slice_asimage2(), and ASImageXMLState::verbose.
static ASImage* handle_asxml_tag_solid | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 1432 of file asimagexml.c.
References a, ARGB32_White, b, False, g, if(), LOCAL_DEBUG_OUT, NULL, parse_argb_color, ptr, result(), and True.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_text | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm | |||
) | [static] |
Definition at line 540 of file asimagexml.c.
References ARGB32_Black, ARGB32_White, ASA_ASImage, ASCT_Char, ASCT_UTF8, ASF_GuessWho, ASIMAGE_QUALITY_DEFAULT, ASIMAGE_QUALITY_TOP, AST_Plain, ASTA_VERSION_INTERNAL, ASImageXMLState::asv, ASImage::back_color, ASImageLayer::bevel, cdata_str, xml_elem_t::child, ASImageLayer::clip_height, ASImageLayer::clip_width, create_asimage(), draw_fancy_text(), ASImageLayer::dst_x, ASImageLayer::dst_y, fetch_asimage(), fill_asimage(), ASImageXMLState::fontman, get_asfont(), get_asimage(), IC_ALPHA, if(), ASImageLayer::im, ASImageXMLState::imman, init_image_layers(), IsUTF8Locale, LOCAL_DEBUG_OUT, merge_layers(), move_asimage_channel(), NULL, parse_argb_color, ptr, release_asimage(), result(), safe_asimage_destroy(), set_asfont_glyph_spacing(), show_progress, ASImageLayer::solid_color, strtol(), text(), tile_asimage(), type, ASImageXMLState::verbose, and width.
Referenced by build_image_from_xml().
static ASImage* handle_asxml_tag_tile | ( | ASImageXMLState * | state, | |
xml_elem_t * | doc, | |||
xml_elem_t * | parm, | |||
ASImage * | imtmp, | |||
int | width, | |||
int | height | |||
) | [static] |
Definition at line 2125 of file asimagexml.c.
References a, ARGB32_ALPHA8, ARGB32_BLUE8, ARGB32_GREEN8, ARGB32_RED8, ASA_ASImage, ASIMAGE_QUALITY_TOP, ASImageXMLState::asv, b, g, if(), LOCAL_DEBUG_OUT, MAKE_ARGB32, NULL, parse_argb_color, parse_math, ptr, result(), show_progress, tile_asimage(), and ASImageXMLState::verbose.
Bool save_asimage_to_file | ( | const char * | file2bsaved, | |
ASImage * | im, | |||
const char * | strtype, | |||
const char * | compress, | |||
const char * | opacity, | |||
int | delay, | |||
int | replace | |||
) |
Definition at line 329 of file asimagexml.c.
References ASImage2file(), ASIT_Bmp, ASIT_Cur, ASIT_Gif, ASIT_Ico, ASIT_Jpeg, ASIT_Png, ASIT_Pnm, ASIT_Ppm, ASIT_Tiff, ASIT_Xbm, ASIT_Xcf, ASIT_Xpm, EXPORT_ALPHA, EXPORT_APPEND, mystrcasecmp, NULL, params, show_error, TIFF_COMPRESSION_DEFLATE, TIFF_COMPRESSION_JPEG, TIFF_COMPRESSION_NONE, TIFF_COMPRESSION_OJPEG, TIFF_COMPRESSION_PACKBITS, and unlink.
Referenced by handle_asxml_tag_save().
void set_xml_font_manager | ( | ASFontManager * | fontman | ) |
void set_xml_image_manager | ( | ASImageManager * | imman | ) |
Definition at line 403 of file asimagexml.c.
References asimage2pixmap(), ASVisual::dpy, False, None, NULL, p, and PORTABLE_SELECT.
static void translate_tag_size | ( | const char * | width_str, | |
const char * | height_str, | |||
ASImage * | imtmp, | |||
ASImage * | refimg, | |||
int * | width_ret, | |||
int * | height_ret | |||
) | [static] |
Definition at line 474 of file asimagexml.c.
References ASImage::height, height, int, LOCAL_DEBUG_OUT, mystrcasecmp, NULL, parse_math, ASImage::width, and width.
Referenced by build_image_from_xml().
ASFontManager* _as_xml_font_manager = NULL [static] |
Definition at line 143 of file asimagexml.c.
Referenced by compose_asimage_xml_from_doc(), and set_xml_font_manager().
ASImageManager* _as_xml_image_manager = NULL [static] |
Definition at line 142 of file asimagexml.c.
Referenced by compose_asimage_xml_from_doc(), and set_xml_image_manager().
char* cdata_str = XML_CDATA_STR [static] |
Definition at line 63 of file asimagexml.c.