#ifndef CODE_GROUPP_H
#define CODE_GROUPP_H

/*-----------------------------------------------------------------------
 * Xclasses header file
 * ($Id: group_p.h,v 1.1.1.1 1998/07/16 19:29:28 cvs 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/group.h>

struct sub
{
	union
	{
		class gadget 	*gg;
		class group  	*gp;
		class gadget 	*obj;
	};
	class lefttext		*lt;
	int group:1,
		zu_klein:1,	// R<0
		zu_gross:1, // R>0
		allocated:1,
	    free:1;
	int depth;
};

#define USEWIDTH	1
#define USEHEIGHT	2

class pgroup
{ // kein SAMESIZE !
	friend class group;

	class group *o;

public:
    int realmaxwidth;
    int realmaxheight;
//    int xweight;
//    int yweight;
    int plusleft;
    int plustop;
	int abstand_w;
	int abstand_h;

	int asize;
	int aused;
	int stripes;

	struct sub *subs;			// array 
    class group *shadow;		// ringliste
	class group *shown;

	class group *samesize;

	int shadowwidth;
	int shadowheight;

	int center:1,
		right:1,
		shadowgroup:1,
		horiz:1,
		requester:1,
		req_h:1,
		req_v:1,
		allocated:1,
		maped:1,
		windowmaster:1,
		hasgps:1,
		smallest:1,
		samesizegroup:1,
		before_x_done:1,

		free:1;		
	
	pgroup();
	~pgroup();
	
	void intern_SetLimits(class group *sgp);
	void intern_SetBeforeX(class group *sgp);
	void intern_Position(class group *sgp,int x,int y);			 
	void zurueck(void);
	void ResizeG(int newwidth,int newheight);					 
	void reset(class group *sgp);							 
	void ResizeWH(class group *sgp,int newwidth,int newheight,int flags=0);
	void WAspect(class gadget *);
	void HAspect(class gadget *);
	void plustop_GG(int);							
	void plusleft_GG(int);							
	void plustopf(int newheight);								
	void plusleftf(int newwidth);									
	
	void pClose(class group *);
	void Lock(class group *);
	void Unlock(class group *);
	void Block(int,class group *);
	void Unblock(int,class group *);
	Window CreateAll(Window parent); 	// x,y,width,height gesetzt
	void ResizeAll(class group *);		// x,y,widht,height gesetzt, GG_Move(x,y,w,h)
};

#endif
