/* Copyright 2001 Pace Micro Technology plc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/****************************************************************************
 * This source file was written by Acorn Computers Limited. It is part of   *
 * the RISCOS library for writing applications in C for RISC OS. It may be  *
 * used freely in the creation of programs for Archimedes. It should be     *
 * used with Acorn's C Compiler Release 3 or later.                         *
 *                                                                          *
 ***************************************************************************/
/*
 * Title: fontlist.h
 * Purpose: Routines to enumerate the fonts on the system into a tree structure
 *
 */

#ifndef __fontlist_h
#define __fontlist_h

/* -------------------------------------------------- */
/* Structures required */
/* -------------------------------------------------- */
typedef struct fontlist_node
{
        char                    name[40];
        struct fontlist_node     *son;
        struct fontlist_node     *brother;
        int                     flag;
} fontlist_node;

/* As an example of a font tree structure, consider
        Corpus.Medium, Corpus.Bold, Selwyn,
        Trinity.Medium, Trinity.Bold, Trinity.Medium.Italic,
        Widget.Medium.Italic.Outline
 This will be stored in the following way: (#'s denote flags which are TRUE)
 --+-->   Corpus   --+--> # Medium
   |                 |
   |                 +--> # Bold
   |
   +--> # Selwyn
   |
   +-->   Trinity  --+--> # Medium   -----> # Italic
   |                 |
   |                 +--> # Bold
   |
   +-->   Widget   --+-->   Medium   -----> # Italic.Outline

[ Brothers are connected vertically downwards, sons to their parents
right-to-left ]
*/

/* -------------------------------------------------- */
/* Globals defined */
/* -------------------------------------------------- */
extern  fontlist_node *font__tree;



/* --------------------------- fontlist_list_all_fonts -----------------------------
 * Description:   Read in the font list into a font tree
 *
 * Parameters:    BOOL system -- TRUE if System font should be included in the list
 * Returns:       a pointer to the start of the font tree
 * Other Info:
 */
fontlist_node *fontlist_list_all_fonts( BOOL system );



/* --------------------------- fontlist_free_font_tree -----------------------------
 * Description:   Free a font tree
 *
 * Parameters:    fontlist_node *font_tree -- the font tree to free
 * Returns:
 * Other Info:
 */
void fontlist_free_font_tree( fontlist_node *font_tree );


#endif


/* end fontlist.h */
