#ifndef CODE_FONTGROUPP_H
#define CODE_FONTGROUPP_H

/*-----------------------------------------------------------------------
 * Xclasses header file
 * ($Id: fontgroup_p.h,v 1.3 1999/01/24 23:43:04 schmitzj Exp $)
 * 
 * Copyright (C) 1998 Jürgen Schmitz
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *-----------------------------------------------------------------------
 */

#include <Xclasses/Xdisplay.h>
#include <Xclasses/fontgroup.h>
#include <Xclasses/group.h>
#include <Xclasses/rubbergroup.h>
#include <Xclasses/listview.h>
#include <Xclasses/choice.h>
#include <Xclasses/input.h>
#include <Xclasses/dlist.h>
#include <Xclasses/text.h>

#define MAXWGHTS	8
#define MAXSLANTS	6
#define MAXSIZES	80

struct font_name
{
	struct node		base;
	int				wght_c;
	int				slant_c;
	int				size_c;
	int				start_slant;
	char			spc;
	char			wght[MAXWGHTS][15];
	char			*uwght[MAXWGHTS+1];
	char			slant[MAXSLANTS][4];
	char			*uslant[MAXSLANTS+1];
	char			name[50];
	char			vendor[50];
	char			fontname[110];
	char			size[MAXSIZES][5];
};

class pfontgroup
{
	friend class fontgroup;

	class fontgroup *o;

public:

//	rubbergroup	listgr;
	group		listgr;
	group		choicegr;
	choice		spacing;
	listview	names;
	listview	sizes;
	choice		slant;
	choice		wght;
	input		fontname;
	text		fontprev;

	char		fontstr[100];
	char		**fontlist;
	dlist		allfonts;
	int			totalfonts;
	int			font_i;

	short		spacing_sel;		// 0: all, 1: prop, 2: mono

	unsigned int	firstadd:1,
					free:1;

	pfontgroup();
	~pfontgroup();

	void start(void);
	void handle(gadget *,int m=0);
	void addfont(char *);
	void RemoveAll(void);
	void shownames(void);
	void genstring(void);
};

#endif
