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

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

Webmaster