fontcache.h revision 74fe172698ba936102e120dae998c9ebd09cfbdf
9c4e79e1c3fce91054fd3d00750a48f79d123341niq/*-
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * Copyright (c) 1998-1999 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * All rights reserved.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * Copyright (c) 1998-1999 X-TrueType Server Project, All rights
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * reserved.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq *
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * Redistribution and use in source and binary forms, with or without
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * modification, are permitted provided that the following conditions
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * are met:
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * 1. Redistributions of source code must retain the above copyright
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * notice, this list of conditions and the following disclaimer.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * 2. Redistributions in binary form must reproduce the above copyright
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * notice, this list of conditions and the following disclaimer in the
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * documentation and/or other materials provided with the distribution.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq *
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
74a027db9e9476e96b37e22c0b06407e23335e3csf * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * SUCH DAMAGE.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq *
9c4e79e1c3fce91054fd3d00750a48f79d123341niq * Id: fontcache.h,v 1.6 1999/01/31 12:41:32 akiyama Exp $
9c4e79e1c3fce91054fd3d00750a48f79d123341niq */
9c4e79e1c3fce91054fd3d00750a48f79d123341niq/* $XFree86: xc/include/extensions/fontcache.h,v 1.3 2001/08/01 00:44:35 tsi Exp $ */
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq/* THIS IS NOT AN X CONSORTIUM STANDARD */
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#ifndef _EXT_FONTCACHE_H_
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define _EXT_FONTCACHE_H_
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define X_FontCacheQueryVersion 0
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define X_FontCacheGetCacheSettings 1
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define X_FontCacheChangeCacheSettings 2
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define X_FontCacheGetCacheStatistics 3
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define FontCacheNumberEvents 0
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define FontCacheBadProtocol 0
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#define FontCacheCannotAllocMemory 1
1861c6caddf9043aff6d7b1a9e2ffb515be652ffniq#define FontCacheNumberErrors (FontCacheCannotAllocMemory + 1)
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niqtypedef struct {
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton long himark;
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton long lowmark;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long balance;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq} FontCacheSettings, *FontCacheSettingsPtr;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niqstruct cacheinfo {
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long hits;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long misshits;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long purged;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long usage;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq};
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niqtypedef struct {
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long purge_runs;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long purge_stat;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq long balance;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq struct cacheinfo f;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq struct cacheinfo v;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq} FontCacheStatistics, *FontCacheStatisticsPtr;
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#ifndef _FONTCACHE_SERVER_
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#include <X11/Xlib.h>
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq_XFUNCPROTOBEGIN
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niqBool FontCacheQueryVersion(
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#if NeedFunctionPrototypes
9c4e79e1c3fce91054fd3d00750a48f79d123341niq Display* /* dpy */,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq int* /* majorVersion */,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq int* /* minorVersion */
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#endif
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton);
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jortonBool FontCacheQueryExtension(
1861c6caddf9043aff6d7b1a9e2ffb515be652ffniq#if NeedFunctionPrototypes
9c4e79e1c3fce91054fd3d00750a48f79d123341niq Display* /* dpy */,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq int* /* event_base */,
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton int* /* error_base */
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#endif
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton);
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niqStatus FontCacheGetCacheSettings(
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#if NeedFunctionPrototypes
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton Display* /* dpy */,
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton FontCacheSettings* /* cache info */
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#endif
9c4e79e1c3fce91054fd3d00750a48f79d123341niq);
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niqStatus FontCacheChangeCacheSettings(
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#if NeedFunctionPrototypes
9c4e79e1c3fce91054fd3d00750a48f79d123341niq Display* /* dpy */,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq FontCacheSettings* /* cache info */
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#endif
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton);
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jortonStatus FontCacheGetCacheStatistics(
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#if NeedFunctionPrototypes
9c4e79e1c3fce91054fd3d00750a48f79d123341niq Display* /* dpy */,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq FontCacheStatistics* /* cache statistics info */
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton#endif
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton);
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq_XFUNCPROTOEND
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#endif /* !_FONTCACHE_SERVER_ */
9c4e79e1c3fce91054fd3d00750a48f79d123341niq
9c4e79e1c3fce91054fd3d00750a48f79d123341niq#endif /* _EXT_FONTCACHE_H_ */
9c4e79e1c3fce91054fd3d00750a48f79d123341niq