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

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.22      frystyk     3: <!-- Changed by: Henrik Frystyk Nielsen, 23-Jun-1996 -->
2.23    ! frystyk     4:   <TITLE>W3C Sample Code Library libwww Icon Management</TITLE>
2.1       frystyk     5: </HEAD>
                      6: <BODY>
2.22      frystyk     7: <H1>
                      8:   Icon Management
                      9: </H1>
2.8       frystyk    10: <PRE>
                     11: /*
2.12      frystyk    12: **     (c) COPYRIGHT MIT 1995.
2.8       frystyk    13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.22      frystyk    16: <P>
                     17: Icons for directory listsings etc. are bound to MIME
                     18: <CODE>content-types</CODE> and <CODE>content-encodings</CODE> as described
                     19: in the <A HREF="HTFormat.html">format manager</A>. These functions bind icon
                     20: URLs to given <CODE>content-type</CODE> or encoding templates. Templates
                     21: containing a slash are taken to be <CODE>content-type</CODE> templates, other
                     22: are <CODE>content-encoding</CODE> templates.
                     23: <P>
                     24: This module is implemented by <A HREF="HTIcons.c">HTIcons.c</A>, and it is
2.23    ! frystyk    25: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Sample Code
2.22      frystyk    26: Library</A>.
2.1       frystyk    27: <PRE>
                     28: #ifndef HTICONS_H
                     29: #define HTICONS_H
2.9       roeber     30: 
2.22      frystyk    31: #include "WWWLib.h"
2.1       frystyk    32: </PRE>
                     33: <PRE>
2.22      frystyk    34: typedef struct _HTIconNode HTIconNode;
2.15      frystyk    35: </PRE>
2.22      frystyk    36: <H2>
                     37:   Add new Icons
                     38: </H2>
                     39: <P>
                     40: All of these functions take an absolute URL and alternate text to use. Add
                     41: an icon the list
                     42: <H3>
                     43:   Generic Icons
                     44: </H3>
                     45: <PRE>extern BOOL HTIcon_add (const char * url, const char * prefix,
                     46:                                char * alt, char * type_templ);
                     47: </PRE>
                     48: <H3>
                     49:   Specific Icons
                     50: </H3>
                     51: <P>
                     52: We also have a special set of icons used to represent well-known things in
                     53: direcctory listings.
                     54: <H4>
                     55:   Unknown Icon
                     56: </H4>
                     57: <P>
                     58: Add a unknown icon representing files that we can't figure out what is and
                     59: hence can`'t come up with a better icon.
                     60: <PRE>extern BOOL HTIcon_addUnknown (const char * url, const char * prefix,
                     61:                                char * alt);
                     62: </PRE>
                     63: <H4>
                     64:   Empty Icon
                     65: </H4>
                     66: <P>
                     67: In order to aligned HTML pages for directory listings in preformatted mode,
                     68: we need an empty (or blank) icon of the same size as the other icons.
                     69: <PRE>extern BOOL HTIcon_addBlank (const char * url, const char * prefix,
                     70:                                char * alt);
                     71: </PRE>
                     72: <H4>
                     73:   Parent Icon
                     74: </H4>
                     75: <P>
                     76: Add an icon representing a level up in a directory listing - the parent
                     77: directory.
                     78: <PRE>extern BOOL HTIcon_addParent (const char * url, const char * prefix,
                     79:                                char * alt);
                     80: </PRE>
                     81: <H4>
                     82:   Directory Icon
                     83: </H4>
                     84: <P>
                     85: This icon represents a directory or a folder
                     86: <PRE>extern BOOL HTIcon_addDir (const char * url, const char * prefix,
                     87:                                char * alt);
                     88: </PRE>
                     89: <H2>
                     90:   Find an Icon
                     91: </H2>
                     92: <P>
                     93: This is a simplified file mode enumeration that can is used in directory
                     94: listings.
2.15      frystyk    95: <PRE>
                     96: typedef  enum _HTFileMode {
                     97:     HT_IS_FILE,                                /* Normal file */
                     98:     HT_IS_DIR,                         /* Directory */
                     99:     HT_IS_BLANK,                       /* Blank Icon */
                    100:     HT_IS_PARENT                       /* Parent Directory */
                    101: } HTFileMode;
2.1       frystyk   102: 
2.3       luotonen  103: 
2.22      frystyk   104: extern HTIconNode * HTIcon_find (HTFileMode    mode,
                    105:                                 HTFormat       content_type,
                    106:                                 HTEncoding     content_encoding);
                    107: </PRE>
                    108: <H2>
                    109:   Icon URL
                    110: </H2>
                    111: <P>
                    112: When you want to add the icon reference into a directory listing, you can
                    113: get the URL of the icon by using this method. Don't free or modify the string
                    114: returned!
                    115: <PRE>extern char * HTIcon_url (HTIconNode * node);
                    116: </PRE>
                    117: <H2>
                    118:   Alternative text
                    119: </H2>
                    120: <P>
                    121: Get the alternative text (if any) for text based clients or if you don't
                    122: want to download the image right away. The string returned must be freed
                    123: by the caller.
                    124: <PRE>extern char * HTIcon_alternative (HTIconNode * node, BOOL brackets);
                    125: </PRE>
                    126: <H2>
                    127:   A Standard Set of Icons
                    128: </H2>
                    129: <P>
                    130: The <A HREF="WWWFile.html">WWWFile</A> interface does not define a default
                    131: set of icons but the Library distribution files comes with a <I>standard</I>
                    132: set of icons that can be used if desired. The Icons can be found in
                    133: <CODE>$(datadir)/www-icons</CODE>.The set covers the types described below
                    134: and they can be set up using the <A HREF="HTInit.html#icons">HTIconInit()
                    135: initialization</A> function in the <A HREF="WWWInit.html">WWWInit startup
                    136: interface</A>
                    137: <P>
2.1       frystyk   138: <UL>
2.22      frystyk   139:   <LI>
                    140:     <CODE>blank.xbm</CODE> for the blank icon
                    141:   <LI>
                    142:     <CODE>directory.xbm</CODE> for directory icon
                    143:   <LI>
                    144:     <CODE>back.xbm</CODE> for parent directory
                    145:   <LI>
                    146:     <CODE>unknown.xbm</CODE> for unknown icon
                    147:   <LI>
                    148:     <CODE>binary.xbm</CODE> for binary files
                    149:   <LI>
                    150:     <CODE>text.xbm</CODE> for ascii files
                    151:   <LI>
                    152:     <CODE>image.xbm</CODE> for image files
                    153:   <LI>
                    154:     <CODE>movie.xbm</CODE> for video files
                    155:   <LI>
                    156:     <CODE>sound.xbm</CODE> for audio files
                    157:   <LI>
                    158:     <CODE>tar.xbm</CODE> for tar and gtar files
                    159:   <LI>
                    160:     <CODE>compressed.xbm</CODE> for compressed and gzipped files
2.1       frystyk   161: </UL>
                    162: <PRE>
                    163: #endif /* HTICONS */
                    164: </PRE>
2.22      frystyk   165: <P>
                    166:   <HR>
2.21      frystyk   167: <ADDRESS>
2.23    ! frystyk   168:   @(#) $Id: HTIcons.html,v 2.22 1996/06/28 16:31:09 frystyk Exp $
2.21      frystyk   169: </ADDRESS>
2.22      frystyk   170: </BODY></HTML>

Webmaster