wsfont.h revision 1.4 1 /* $NetBSD: wsfont.h,v 1.4 1999/04/26 23:41:57 ad Exp $ */
2
3 /*
4 * Copyright (c) 1999 Andy Doran <ad (at) NetBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 */
29
30 #ifndef _WSFONT_H_
31 #define _WSFONT_H_ 1
32
33 /*
34 * wsfont_find() can be called with any of the parameters as 0, meaning we
35 * don't care about that aspect of the font. It returns a cookie which
36 * we can use with the other functions. When more flexibility is required,
37 * wsfont_enum() should be used. The last two parameters to wsfont_lock()
38 * are the bit order and byte order required (WSFONT_L2R or WSFONT_R2L).
39 *
40 * Example:
41 *
42 * struct wsdisplay_font *font;
43 * int cookie;
44 *
45 * if ((cookie = wsfont_find(NULL, 8, 16, 0, 0)) < 0)
46 * panic("unable to get 8x16 font");
47 *
48 * if (wsfont_lock(cookie, &font, WSFONT_L2R, WSFONT_R2L) < 0)
49 * panic("unable to lock font");
50 *
51 * ... do stuff ...
52 *
53 * wsfont_unlock(cookie);
54 */
55 struct wsdisplay_font;
56
57 /* Left to Right, Right to Left */
58 #define WSFONT_L2R (1)
59 #define WSFONT_R2L (2)
60
61 void wsfont_init __P((void));
62 int wsfont_find __P((char *name, int width, int height, int stride));
63 int wsfont_add __P((struct wsdisplay_font *font, int copy));
64 int wsfont_remove __P((int cookie));
65 void wsfont_enum __P((void (*func) __P((char *n, int w, int h, int s))));
66 int wsfont_lock __P((int cookie, struct wsdisplay_font **font, int, int));
67 int wsfont_unlock __P((int cookie));
68 int wsfont_getflg __P((int cookie, int *flg, int *lockcount));
69
70 #endif /* _WSFONT_H_ */
71