FSlib.txt revision 1bedbe3f
1Protocol requests 2 3These functions make protocol requests corresponding to their names. 4 5Connection Setup 6 7FSServer * 8FSOpenServer( 9 const char *server); 10 11Creates a connection to the font server specified in the 'server' string. 12 13int 14FSCloseServer( 15 FSServer *svr); 16 17Closes the connection to the font server. 18 19Font Manipulation 20 21Font 22FSOpenBitmapFont( 23 FSServer *svr, 24 fsBitmapFormat hint, 25 fsBitmapFormatMask fmask, 26 char *name, 27 Font *originalid); 28 29Opens the font that matches the given name (which may have '*' and '?' 30as wildcards). The hint contains format information that will probably 31be used in subsequent QueryXBitmaps() requests. The fmask tells which 32bits in the mask are valid. If originalid is non-zero, then the server 33already has the font opened under that ID. 34 35int 36FSCloseFont( 37 FSServer *svr, 38 Font fid); 39 40Closes the font. 41 42char ** 43FSListFonts( 44 FSServer *svr, 45 const char *pattern, 46 int maxNames, 47 int *actualCount); 48 49Returns the full names of the fonts matching pattern. Up to maxNames 50names will be returned. The actual value number be placed in 51actualCount. The return value should be freed with FSFreeFontNames. 52 53int 54FSFreeFontNames( 55 char **list); 56 57Frees the list of font names returned by FSListFonts. 58 59char ** 60FSListFontsWithXInfo( 61 FSServer *svr, 62 const char *pattern, 63 int maxNames, 64 int *actualCount, 65 fsFontHeader ***info, 66 fsPropInfo ***pprops, 67 fsPropOffset ***offsets, 68 unsigned char ***prop_data); 69 70Returns the full names of the fonts matching pattern. Up to maxNames 71names will be returned. The actual value number be placed in 72actualCount, and each font's header and property information will also 73be returned. 74 75int 76FSQueryXInfo( 77 FSServer *svr, 78 Font fid, 79 fsFontHeader *info, 80 fsPropInfo *props, 81 fsPropOffset **offsets, 82 unsigned char **prop_data); 83 84Returns the font's header information. 85 86int 87FSQueryXExtents8( 88 FSServer *svr, 89 Font fid, 90 Bool range_type, 91 unsigned char *str, 92 unsigned long str_len, 93 fsCharInfo **extents); 94 95int 96FSQueryXExtents16( 97 FSServer *svr, 98 Font fid, 99 Bool range_type, 100 fsChar2b *str, 101 unsigned long str_len, 102 fsCharInfo **extents); 103 104Returns the extents of the given characters. If 'range_type' is set, 105the 'str' is considered a range, otherwise its considered a list of 106characters. A NULL str when range_type is set means that all the 107character extents will be returned. 108 109int 110FSQueryXBitmaps8( 111 FSServer *svr, 112 Font fid, 113 fsBitmapFormat format, 114 Bool range_type, 115 unsigned char *str, 116 unsined long str_len, 117 unsigned long **offsets, 118 unsigned char **glyph_data); 119 120int 121FSQueryXBitmaps16( 122 FSServer *svr, 123 Font fid, 124 fsBitmapFormat format, 125 Bool range_type, 126 fsChar2b *str, 127 unsined long str_len, 128 unsigned long **offsets, 129 unsigned char **glyph_data); 130 131Returns the font's bitmaps in the requested format. The other arguments 132are used as in QueryExtents above. 133 134Extensions 135 136char ** 137FSListExtensions( 138 FSServer *svr, 139 int *next); 140 141Lists any extension built into the font server. 142 143Bool 144FSQueryExtension( 145 FSServer *svr, 146 char *name, 147 int *major_opcode, 148 int *first_event, 149 int *first_error); 150 151Returns information on the specified extension. 152 153int 154FSFreeExtensionList( 155 char **list); 156 157Frees the list returned by FSListExtensions(). 158 159 160Helper functions -- these don't map to protocol requests, but 161can make writing a FS client simpler. 162 163Synchronization 164 165FSSync( 166 FSServer *svr, 167 Bool discard); 168 169Flushes the output queue and waits for a reply from the server, 170which will flush the server's output queue. 171 172typedef int (*FSSyncHandler)(FSServer *); 173 174FSSyncHandler 175FSSynchronize( 176 FSServer *svr, 177 int onoff) 178 179Controls whether the server does every request in synchronous form. 180 181FSSyncHandler 182FSSetAfterFunction( 183 FSServer *svr, 184 FSSyncHandler func); 185 186Sets the function that will be called after every request. This 187is usually NULL or FSSync(). 188 189int 190FSFlush( 191 FSServer *svr); 192 193Flushes any queued requests to the font server. 194 195Error Handling 196 197typedef int (* FSErrorHandler)(FSServer *, FSErrorEvent *); 198 199FSErrorHandler 200FSSetErrorHandler( 201 FSErrorHandler handler); 202 203Changes the error handler to 'handler'. A NULL value will reset 204it to use the default. 205 206typedef int (* FSIOErrorHandler)(FSServer *); 207 208FSIOErrorHandler 209FSSetIOErrorHandler( 210 FSIOErrorHandler handler); 211 212Changes the I/O error handler to 'handler'. A NULL value will reset 213it to use the default. 214 215Miscellaneous 216 217long 218FSMaxRequestSize( 219 FSServer *svr); 220 221Returns the largest request size (in 4 byte quantities) that the 222server can handle. 223 224const char * 225FSServerName( 226 const char *server); 227 228Returns the name that FSlib would use to connect to the server. 229Translates a NULL into the value of $FONT_SERVER. 230 231