Debian Codegraph @

xo/lfont.h

raw
1 /* lfont.h -*- C++ -*-
2 $Id: lfont.h,v 1.3 1997/10/18 04:57:35 elf Exp $
3
4 written by Marc Singer
5 10 May 1997
6
7 This file is part of the project XO. See the file README for
8 more information.
9
10 Copyright (C) 1997 Marc Singer
11
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 in a file called COPYING along with this program; if not, write to
24 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
25 02139, USA.
26
27 -----
28
29 Font management. We provide these routines in order to streamline
30 font requests without requiring toolkit window classes from
31 monitoring their font usage.
32
33 */
34
35 #if !defined (__LFONT_H__)
36 # define __LFONT_H__
37
38 /* ----- Includes */
39
40 #include "lhash.h"
41
42 class LDisplay;
43
44 class LFontCache {
45 protected:
46 LDisplay* m_pDisplay;
47 LHashTable m_hashFontName; // szFont->XFontStruct*
48 LHashTable m_hashFontID; // fontID->XFontStruct*
49
50 public:
51 LFontCache () {
52 zero (); }
53 ~LFontCache () {
54 release_this (); }
55 void zero (void) {
56 memset (this, 0, sizeof (*this)); }
57 void init (LDisplay* pDisplay);
58 void release_this (void);
59
60 XFontStruct* find (char* szFont);
61 XFontStruct* find (Font fid);
62 };
63
64
65
66 #endif /* __LFONT_H__ */