Annotation of libwww/Library/src/HTIcons.html, revision 2.13

2.1       frystyk     1: <HTML>
                      2: <HEAD>
                      3: <TITLE>Icon Management</TITLE>
                      4: </HEAD>
                      5: <BODY>
                      6: <H1>Icon Management</H1>
2.8       frystyk     7: 
                      8: <PRE>
                      9: /*
2.12      frystyk    10: **     (c) COPYRIGHT MIT 1995.
2.8       frystyk    11: **     Please first read the full copyright statement in the file COPYRIGH.
                     12: */
                     13: </PRE>
                     14: 
                     15: This module is implemented by <A HREF="HTIcons.c">HTIcons.c</A>, and
                     16: it is a part of the <A
2.13    ! frystyk    17: HREF="http://www.w3.org/hypertext/WWW/Library/">
        !            18: W3C Reference Library</A>.
2.8       frystyk    19: 
2.1       frystyk    20: <PRE>
                     21: #ifndef HTICONS_H
                     22: #define HTICONS_H
2.9       roeber     23: 
2.2       frystyk    24: #include "HTFormat.h"
2.1       frystyk    25: </PRE>
                     26: 
                     27: <H2>Icons</H2>
                     28: 
                     29: Icons are bound to MIME content-types and encoding.  These functions
                     30: bind icon URLs to given content-type or encoding templates.  Templates
                     31: containing a slash are taken to be content-type templates, other are
                     32: encoding templates. <P>
                     33:  
                     34: <H2>Controlling globals</H2>
                     35: 
                     36: <H3>Show brackets around alternative text</H3>
                     37: By default alternative text is bracketed by square brackets (the
                     38: <CODE>ALT</CODE> tag to <CODE>IMG</CODE> element).  Setting the global
                     39: <CODE>HTDirShowBrackets</CODE> to false will turn this feature off.
                     40: 
                     41: <PRE>
                     42: typedef struct _HTIconNode {
                     43:     char *     icon_url;
                     44:     char *     icon_alt;
                     45:     char *     type_templ;
                     46: } HTIconNode;
2.3       luotonen   47: 
                     48: /*
                     49:  * The list element definition to bind a CGI to a filetyp for special
                     50:  * presentation like looking in an archiv (AddHref /cgi-bin/unarch? .zip .tar)
                     51:  */
                     52: typedef struct _HTHrefNode {
                     53:     char *      href_url;
                     54:     char *      type_templ;
                     55: } HTHrefNode;
                     56: 
                     57: 
2.1       frystyk    58: </PRE>
                     59: 
                     60: <PRE>
                     61: extern BOOL HTDirShowBrackets;
                     62: extern HTIconNode * icon_unknown;              /* Unknown file type */
                     63: extern HTIconNode * icon_blank;                        /* Blank icon in heading */
                     64: extern HTIconNode * icon_parent;               /* Parent directory icon */
                     65: extern HTIconNode * icon_dir;                   /* Directory icon */
                     66: </PRE>
                     67: 
                     68: <H2>Public functions</H2>
                     69: 
                     70: All of these functions take an absolute URL and alternate text to use. <P>
                     71: 
                     72: <PRE>
                     73: /* Generates the alt-tag */
2.7       frystyk    74: extern char * HTIcon_alt_string PARAMS((char * alt,
2.1       frystyk    75:                                        BOOL   brackets));
                     76: 
                     77: /*
                     78:  * General icon binding.  Use this icon if content-type or encoding
                     79:  * matches template.
                     80:  */
2.7       frystyk    81: extern void HTAddIcon PARAMS((char *   url,
2.1       frystyk    82:                              char *    alt,
                     83:                              char *    type_templ));
                     84: 
2.3       luotonen   85: 
                     86: /*
                     87:  * Called from HTConfig.c to build the list of all the AddHref's
                     88:  */
2.7       frystyk    89: extern void HTAddHref PARAMS((char *    url,
2.3       luotonen   90:                               char *    type_templ));
                     91: 
                     92: 
2.1       frystyk    93: /*
                     94:  * Icon for which no other icon can be used.
                     95:  */
2.7       frystyk    96: extern void HTAddUnknownIcon PARAMS((char * url,
2.1       frystyk    97:                                     char * alt));
                     98: 
                     99: /*
                    100:  * Invisible icon for the listing header field to make it aligned
                    101:  * with the rest of the listing (this doesn't have to be blank).
                    102:  */
2.7       frystyk   103: extern void HTAddBlankIcon PARAMS((char * url,
2.1       frystyk   104:                                   char * alt));
                    105: 
                    106: /*
                    107:  * Icon to use for parent directory.
                    108:  */
2.7       frystyk   109: extern void HTAddParentIcon PARAMS((char * url,
2.1       frystyk   110:                                    char * alt));
                    111: 
                    112: /*
                    113:  * Icon to use for a directory.
                    114:  */
2.7       frystyk   115: extern void HTAddDirIcon PARAMS((char * url,
2.1       frystyk   116:                                 char * alt));
                    117: 
                    118: /*                                                              HTGetIcon()
                    119: ** returns the icon corresponding to content_type or content_encoding.
                    120: */
2.11      frystyk   121: extern HTIconNode * HTGetIcon PARAMS((mode_t           mode,
                    122:                                      HTFormat          content_type,
                    123:                                      HTEncoding        content_encoding));
2.3       luotonen  124: 
                    125: /*
                    126:  * returns the HrefNode to get the URL for presentation of a file (indexing)
                    127:  */
2.7       frystyk   128: extern HTHrefNode * HTGetHref PARAMS(( char *  filename));
2.3       luotonen  129: 
2.1       frystyk   130: 
                    131: </PRE>
                    132: 
                    133: 
                    134: <H4>A Predifined Set of Icons</H4>
                    135: The function <CODE>HTStdIconInit(url_prefix)</CODE> can be used to
                    136: initialize a standard icon set:
                    137: <UL>
                    138: <LI> <CODE>blank.xbm</CODE> for the blank icon
                    139: <LI> <CODE>directory.xbm</CODE> for directory icon
                    140: <LI> <CODE>back.xbm</CODE> for parent directory
                    141: <LI> <CODE>unknown.xbm</CODE> for unknown icon
                    142: <LI> <CODE>binary.xbm</CODE> for binary files
                    143: <LI> <CODE>text.xbm</CODE> for ascii files
                    144: <LI> <CODE>image.xbm</CODE> for image files
                    145: <LI> <CODE>movie.xbm</CODE> for video files
                    146: <LI> <CODE>sound.xbm</CODE> for audio files
                    147: <LI> <CODE>tar.xbm</CODE> for tar and gtar files
                    148: <LI> <CODE>compressed.xbm</CODE> for compressed and gzipped files
                    149: </UL>
                    150: <PRE>
2.7       frystyk   151: extern void HTStdIconInit PARAMS((CONST char * url_prefix));
2.1       frystyk   152: </PRE>
                    153: 
                    154: <PRE>
                    155: #endif /* HTICONS */
                    156: </PRE>
                    157: end
                    158: </BODY>
                    159: </HTML>
                    160: 

Webmaster