Annotation of libwww/Library/src/HTIcons.html, revision 2.1
2.1 ! frystyk 1: <HTML>
! 2: <HEAD>
! 3: <TITLE>Icon Management</TITLE>
! 4: </HEAD>
! 5: <BODY>
! 6: <H1>Icon Management</H1>
! 7: <PRE>
! 8: #ifndef HTICONS_H
! 9: #define HTICONS_H
! 10: </PRE>
! 11:
! 12: <H2>Icons</H2>
! 13:
! 14: Icons are bound to MIME content-types and encoding. These functions
! 15: bind icon URLs to given content-type or encoding templates. Templates
! 16: containing a slash are taken to be content-type templates, other are
! 17: encoding templates. <P>
! 18:
! 19: <H2>Controlling globals</H2>
! 20:
! 21: <H3>Show brackets around alternative text</H3>
! 22: By default alternative text is bracketed by square brackets (the
! 23: <CODE>ALT</CODE> tag to <CODE>IMG</CODE> element). Setting the global
! 24: <CODE>HTDirShowBrackets</CODE> to false will turn this feature off.
! 25:
! 26: <PRE>
! 27: typedef struct _HTIconNode {
! 28: char * icon_url;
! 29: char * icon_alt;
! 30: char * type_templ;
! 31: } HTIconNode;
! 32: </PRE>
! 33:
! 34: <PRE>
! 35: extern BOOL HTDirShowBrackets;
! 36: extern HTIconNode * icon_unknown; /* Unknown file type */
! 37: extern HTIconNode * icon_blank; /* Blank icon in heading */
! 38: extern HTIconNode * icon_parent; /* Parent directory icon */
! 39: extern HTIconNode * icon_dir; /* Directory icon */
! 40: </PRE>
! 41:
! 42: <H2>Public functions</H2>
! 43:
! 44: All of these functions take an absolute URL and alternate text to use. <P>
! 45:
! 46: <PRE>
! 47: /* Generates the alt-tag */
! 48: PUBLIC char * HTIcon_alt_string PARAMS((char * alt,
! 49: BOOL brackets));
! 50:
! 51: /*
! 52: * General icon binding. Use this icon if content-type or encoding
! 53: * matches template.
! 54: */
! 55: PUBLIC void HTAddIcon PARAMS((char * url,
! 56: char * alt,
! 57: char * type_templ));
! 58:
! 59: /*
! 60: * Icon for which no other icon can be used.
! 61: */
! 62: PUBLIC void HTAddUnknownIcon PARAMS((char * url,
! 63: char * alt));
! 64:
! 65: /*
! 66: * Invisible icon for the listing header field to make it aligned
! 67: * with the rest of the listing (this doesn't have to be blank).
! 68: */
! 69: PUBLIC void HTAddBlankIcon PARAMS((char * url,
! 70: char * alt));
! 71:
! 72: /*
! 73: * Icon to use for parent directory.
! 74: */
! 75: PUBLIC void HTAddParentIcon PARAMS((char * url,
! 76: char * alt));
! 77:
! 78: /*
! 79: * Icon to use for a directory.
! 80: */
! 81: PUBLIC void HTAddDirIcon PARAMS((char * url,
! 82: char * alt));
! 83:
! 84: /* HTGetIcon()
! 85: ** returns the icon corresponding to content_type or content_encoding.
! 86: */
! 87: PUBLIC HTIconNode * HTGetIcon PARAMS((mode_t mode,
! 88: HTFormat content_type,
! 89: HTFormat content_encoding));
! 90:
! 91: </PRE>
! 92:
! 93:
! 94: <H4>A Predifined Set of Icons</H4>
! 95: The function <CODE>HTStdIconInit(url_prefix)</CODE> can be used to
! 96: initialize a standard icon set:
! 97: <UL>
! 98: <LI> <CODE>blank.xbm</CODE> for the blank icon
! 99: <LI> <CODE>directory.xbm</CODE> for directory icon
! 100: <LI> <CODE>back.xbm</CODE> for parent directory
! 101: <LI> <CODE>unknown.xbm</CODE> for unknown icon
! 102: <LI> <CODE>binary.xbm</CODE> for binary files
! 103: <LI> <CODE>text.xbm</CODE> for ascii files
! 104: <LI> <CODE>image.xbm</CODE> for image files
! 105: <LI> <CODE>movie.xbm</CODE> for video files
! 106: <LI> <CODE>sound.xbm</CODE> for audio files
! 107: <LI> <CODE>tar.xbm</CODE> for tar and gtar files
! 108: <LI> <CODE>compressed.xbm</CODE> for compressed and gzipped files
! 109: </UL>
! 110: <PRE>
! 111: PUBLIC void HTStdIconInit PARAMS((char * url_prefix));
! 112: </PRE>
! 113:
! 114: <PRE>
! 115: #endif /* HTICONS */
! 116: </PRE>
! 117: end
! 118: </BODY>
! 119: </HTML>
! 120:
Webmaster