#ifndef CODE_GPOPUPP_H
#define CODE_GPOPUPP_H

/*-----------------------------------------------------------------------
 * Xclasses header file
 * ($Id: gpopup_p.h,v 1.4 1999/11/22 11:39:01 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.
 *-----------------------------------------------------------------------
 */

#define SCHATTEN

#include <Xclasses/gpopup.h>
#include <Xclasses/Xwindows.h>
#include <Xclasses/gadget.h>
#include <Xclasses/button.h>
#include <Xclasses/popup.h>
#ifdef SCHATTEN
#include <Xclasses/Xshadow.h>
#endif
#include <Xclasses/callable.h>

#define TOPBORDER	textheight(this,p->title?p->title:(char*)"Close")
#define	BORDER		2

class pgpopup : public callable
{
	friend class gpopup;

public:
	class gpopup *o;

	int open	:1,
		free	:1;

	gadget		*sub;
	gadget		*closeg;
	Xwindows	swin;
#ifdef SCHATTEN
	Xshadow		swin2;
#endif
	button		closebutton;
	popup		pmenu;

	GC			rubgc;
	char		*title;

	int			mx,my;
	int			wx,wy;
	int			anx,any;
	int			anw,anh;

    pgpopup();
    ~pgpopup();

	void anim(int x1,int y1,int w1,int h1,int x2,int y2,int w2,int h2);
	void theCloser(gadget *,int);
	void draw(int x,int y);
	void IgnoreExcept(void);
	void IgnoreNothing(void);
};

#endif
