/*
 *  Login.app
 * 
 *  Copyright (c) 1997-2000 Per Liden
 * 
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
 *  USA.
 */

#ifndef PREFERENCES_H
#define PREFERENCES_H

#include <X11/Xlib.h>
#include <proplist.h>
#include <wraster.h>

/* File names */
#define FILE_PREFERENCES               "Preferences"
#define FILE_THEME_SETTINGS            "Settings"

/* Justification */
#define JUSTIFICATION_LEFT		0
#define JUSTIFICATION_CENTER		1
#define JUSTIFICATION_RIGHT		2

/* Default values */
#define DEFAULT_WELCOMEMESSAGE		"Welcome to LINUX"
#define DEFAULT_POWEROFFMESSAGE		"System is shutting down..."
#define DEFAULT_RESTARTMESSAGE		"System is rebooting..."
#define DEFAULT_XSERVER			"/usr/X11R6/bin/X"
#define DEFAULT_THEME			"Linux"
#define DEFAULT_DISABLEWELCOMEMESSAGE	NO
#define DEFAULT_DISABLEUSERSHUTDOWN	NO
#define DEFAULT_DISABLEHOSTNAME		NO
#define DEFAULT_DISABLEANIMATIONS	NO
#define DEFAULT_PANELIMAGE		"panel.tiff"
#define DEFAULT_FIELDLABELSIMAGE	"fieldlabels.tiff"
#define DEFAULT_POWERBUTTONUPIMAGE	"powerbuttonup.tiff"
#define DEFAULT_POWERBUTTONDOWNIMAGE	"powerbuttondown.tiff"
#define DEFAULT_RESTARTBUTTONUPIMAGE	"restartbuttonup.tiff"
#define DEFAULT_RESTARTBUTTONDOWNIMAGE	"restartbuttondown.tiff"
#define DEFAULT_ALERTICON		"stop.tiff"
#define DEFAULT_BACKGROUNDCOLOR		"None"  // Used to be #505075
#define DEFAULT_PANELPOSITION_X		0
#define DEFAULT_PANELPOSITION_Y		-100
#define DEFAULT_POWERBUTTONPOSITION_X  	0
#define DEFAULT_POWERBUTTONPOSITION_Y	0
#define DEFAULT_RESTARTBUTTONPOSITION_X 0
#define DEFAULT_RESTARTBUTTONPOSITION_Y	0
#define DEFAULT_MESSAGEPOSITION_X	100
#define DEFAULT_MESSAGEPOSITION_Y	100
#define DEFAULT_MESSAGEJUSTIFICATION	JUSTIFICATION_CENTER
#define DEFAULT_MESSAGECOLOR		"black"
#define DEFAULT_MESSAGEFONT		"-*-utopia-*-*-*-*-18-*-*-*-*-*-*-*"
#define DEFAULT_HOSTNAMEPOSITION_X	100
#define DEFAULT_HOSTNAMEPOSITION_Y	100
#define DEFAULT_HOSTNAMEJUSTIFICATION	JUSTIFICATION_RIGHT
#define DEFAULT_HOSTNAMECOLOR		"grey"
#define DEFAULT_HOSTNAMEFONT		"-*-utopia-*-*-*-*-18-*-*-*-*-*-*-*"
#define DEFAULT_INPUTFONT		"-*-helvetica-medium-r-*-*-18-*-*-*-*-*-*-*"
#define DEFAULT_INPUTFONTCOLOR		"black"
#define DEFAULT_INPUTCURSORHEIGHT	20
#define DEFAULT_INPUTUSERIMAGE		"inputfield.tiff"
#define DEFAULT_INPUTUSERPOSITION_X	156
#define DEFAULT_INPUTUSERPOSITION_Y	120
#define DEFAULT_INPUTPASSWORDIMAGE	"inputfield.tiff"
#define DEFAULT_INPUTPASSWORDPOSITION_X	156
#define DEFAULT_INPUTPASSWORDPOSITION_Y	154


typedef struct {
   /* General preferences */
   char* welcomeMessage;
   char* restartMessage;
   char* powerOffMessage;
   char** xserver;
   char* theme;
   BOOL disableWelcomeMessage;
   BOOL disableUserShutdown;
   BOOL disableHostname;
   BOOL disableAnimations;
   
    /* Theme settings */
   char* panelImage;
   char* fieldLabelsImage;
   char* powerButtonUpImage;
   char* powerButtonDownImage;
   char* restartButtonUpImage;
   char* restartButtonDownImage;
   char* alertIcon;
   char* backgroundColor;
   int panelPosition[2];
   int powerButtonPosition[2];
   int restartButtonPosition[2];
   int messagePosition[2];
   int messageJustification;
   char* messageColor;
   char* messageFont;
   int hostnamePosition[2];
   int hostnameJustification;
   char* hostnameColor;
   char* hostnameFont;
   char* inputFont;
   char* inputFontColor;
   int inputCursorHeight;
   char* inputUserImage;
   int inputUserPosition[2];
   char* inputPasswordImage;
   int inputPasswordPosition[2];
} Preferences;


Preferences* readConfiguration(const char* programPath);
void checkConfiguration(const char* programPath);

#endif
