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

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

Webmaster