#ifndef CODE_INPUTP_H
#define CODE_INPUTP_H

/*-----------------------------------------------------------------------
 * Xclasses header file
 * ($Id: input_p.h,v 1.5 1999/02/03 17:57:18 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/input.h>
#include <Xclasses/gadget.h>
#include <Xclasses/Xcolors.h>
#include <Xclasses/Ddraw.h>

class ptinput: public gadget, private Ddraw
{
	friend class pinput;
public:
    ptinput() : gadget(), Ddraw(this)
    {};
	~ptinput() {};

	Window _win(void) { return win; };
	GC _gc(void) { return gc; };
	Window _parent(void) { return parent; };
	int _x(void) { return x; };
	int _y(void) { return y; };
	int _width(void) { return width; };
	int _height(void) { return height; };
	int _active(void) { return active; };
};

class pinput
{
	friend class input;

	class input *o;

public:
	class ptinput tgg;

	char taste[20];
	XComposeStatus cs;
	KeySym key;
    char *text;
    int textwidth;
    int maxchars;
    char *data;
    char *cutdata;
    char *start;
    int cpos;
    int spos;
    int blink;
    int l;
    int ak:1,
        notabove:1,
        integer:1,
        invisible:1,
    	free:1;
    
    int mpos,mend,xx;

    pinput();
    ~pinput();

	void taus(int);
	void zeichen_einfuegen(char z);
	void zeichen_loeschen(int n);
	void cutpaste(XEvent *event);

	unsigned int backcol(void)
	{
		return o->locked?tgg.col_background():tgg.col_markbackground();
	};
};

#endif
