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

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

Webmaster