#ifndef CODE_XCLASSES_CONFIG
#define CODE_XCLASSES_CONFIG

/*-----------------------------------------------------------------------
 * Xclasses code file
 * ($Id: xclasses_config.cxx,v 1.3 1998/12/16 17:48:22 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 "types.h"
#include "../include/defaults.h"
#include <Xclasses/config.h>
#include <Xclasses/Xcolors.h>
#include <Xclasses/gadget.h>

char *prgname=NULL;

//-----------------------------------------------------------------
//	    "-*-*-*-*-*-*-10-*-*-*-*-*-*-*",
//	    "-*-*-*-*-*-*-10-*-*-*-*-*-*-*",
//	    "-*-*-*-*-*-*-10-*-*-*-M-*-*-*",
//	    "-*-*-*-*-*-*-8-*-*-*-*-*-*-*",
//  	"-*-*-*-*-*-*-14-*-*-*-*-*-*-*",
//	    "-*-*-*-*-*-*-14-*-*-*-*-*-*-*"},
//-----------------------------------------------------------------
// 		"-*-helvetica-*-r-*-*-12-*-*-*-*-*-*-*",
// 		"-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*",
// 		"-*-courier-medium-r-*-*-14-*-*-*-M-*-*-*",
// 		"-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*",
// 		"-*-helvetica-*-r-*-*-16-*-*-*-*-*-*-*",
// 		"-*-helvetica-*-r-*-*-14-*-*-*-*-*-*-*"},
//-----------------------------------------------------------------
struct defaultstruct defaults=
	{"",
	 {DEFAULTFONT,
		"-*-helvetica-medium-r-*-*-11-*-*-*-*-*-*-*",
		"-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*",
		"-*-courier-medium-r-*-*-12-*-*-*-M-*-*-*",
		"-*-helvetica-medium-r-*-*-8-*-*-*-*-*-*-*",
		"-*-helvetica-bold-r-*-*-17-*-*-*-*-*-*-*",
		"-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*",
		"-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"},
	  0,				// nopopupmove
	  20,80,			// help open, help close
	  1,				// help bubblemode
	  normal,normal,	// scroller/slider emboss type
	  0,				// scroller buttons together
	  700,				// double click (milliseconds)
	  shift,control,	// lv-multikey, lv-multiblockkey
	  middle,			// multibutton
	  0,				// menunewstyle
	  1,				// popupline
	  1,				// popuplight
	  0,				// writeresbase
	  1,				// intlkey
	  1,				// new3D
	  0,				// inputmode
	};
configopts def_o[]={
	{"T80:font_gadget",	defaults.font[FONT_GADGET]},
	{"T80:font_group", 	defaults.font[FONT_GROUP]},
	{"T80:font_fixed", 	defaults.font[FONT_FIXED]},
	{"T80:font_small", 	defaults.font[FONT_SMALL]},
	{"T80:font_big",   	defaults.font[FONT_BIG]},
	{"T80:font_menu",  	defaults.font[FONT_MENU]},
	{"T80:font_help",  	defaults.font[FONT_HELP]},
	{"T40:basecolor",  	defaults.basecolor},
	{"B:nopopupmove",  	(char*)&defaults.nopopupmove},
	{"I:help_wait",    	(char*)&defaults.help_wait},
	{"I:help_shown",   	(char*)&defaults.help_shown},
	{"B:help_bubbles",	(char*)&defaults.help_bubblemode},
	{"Enormal,irix,pOS:scroller_emboss",	(char*)&defaults.scroller_emboss},
	{"Enormal,irix,pOS:slider_emboss",		(char*)&defaults.slider_emboss},
	{"B:scroller_buttonstogether",			(char*)&defaults.scroller_buttonstogether},
	{"I:doubleclickdelay",					(char*)&defaults.dclickdelay},
	{"Eshift,control,alt:listview_multikey",(char*)&defaults.listview_multikey},
	{"Eshift,control,alt:listview_multiblockkey",(char*)&defaults.listview_multiblockkey},
	{"Ebutton2,button3,none:listview_multibutton",(char*)&defaults.listview_multibutton},
	{"B:menunewstyle", 						(char*)&defaults.menunewstyle},
	{"B:popupline", 						(char*)&defaults.popupline},
	{"B:popuplight", 						(char*)&defaults.popuplight},
	{"B:writerunresource",					(char*)&defaults.writeresbase},
	{"B:intlkey",							(char*)&defaults.intlkey},
	{"B:new3D",								(char*)&defaults.new3D},
	{"Eprogram,click,mouse:inputmode",		(char*)&defaults.inputmode},
	{NULL,NULL}};

void read_global_config(Xdisplay *d)
{
	config cfg(LOAD_ALL_XCLASSES_CONFIG);
	defaults.basecolor[0]=0;

	cfg.SetItems(def_o);
	cfg.SetDisplayConfig(d);
	cfg.Read();
	if (baseXcolors && strlen(defaults.basecolor)) baseXcolors->SetBase(defaults.basecolor);
}

#endif
