#ifndef CODE_SLIDERP_H
#define CODE_SLIDERP_H

/*-----------------------------------------------------------------------
 * Xclasses header file
 * ($Id: slider_p.h,v 1.2 1999/11/20 17:54:14 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/slider.h>

#define XBORDER		0
#define KSIZE		(p->ksize)
#define PKSIZE		(ksize)
#define S_LENGTH	(p->horiz?width-1-RealSize()-XBORDER-RealSize():height-1-RealSize()-XBORDER-RealSize())
#define SP_LENGTH	(horiz?o->width-1-o->RealSize()-XBORDER-o->RealSize():o->height-1-o->RealSize()-XBORDER-o->RealSize())

#define S_X1(p)		(horiz?p+XBORDER+o->RealSize():XBORDER+o->RealSize())
#define S_Y1(p)		(horiz?XBORDER+o->RealSize():p+XBORDER+o->RealSize())
#define S_X2(p)		(horiz?p+PKSIZE+XBORDER+o->RealSize()-XBORDER:o->width-1-o->RealSize()-XBORDER)
#define S_Y2(p)		(horiz?o->height-1-o->RealSize()-XBORDER:p+PKSIZE+XBORDER+o->RealSize()-XBORDER)
#define S_WIDTH(p)	(horiz?PKSIZE:o->width-1-o->RealSize()-XBORDER-o->RealSize())
#define S_HEIGHT(p)	(horiz?o->height-1-o->RealSize()-XBORDER-o->RealSize():PKSIZE)

class pslider
{
	friend class slider;

	class slider *o;

public:

	int p_pos;
	int op_pos;
	int offset;
	int ticker;

	int minval;
	int maxval;
	int position;
	int o_position;
	int ksize;
	int fonth;

	int horiz:1,
		mmove:1,
		mtick:3,
		above:1,
		notext:1,
		free:1;

	embosstype	emboss;

	char 		txt[40];
	callback	tcb;

    pslider();
    ~pslider();

	void knopf(int m=0);
};

#endif
