/*
 *  WindowMaker window manager
 * 
 *  Copyright (c) 1997 Alfredo K. Kojima
 * 
 *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


#ifndef WMTEXTURE_H_
#define WMTEXTURE_H_


/* texture relief */
#define WREL_RAISED	0
#define WREL_SUNKEN	1
#define WREL_FLAT	2
#define WREL_TITLEBAR	3
#define WREL_ICON	4
#define WREL_MENUTITLE	5
#define WREL_MENUENTRY	6

/* texture types */
#define WTEX_SOLID 	0
#define WTEX_GRADIENT	1
# define WTEX_HGRADIENT	2
# define WTEX_VGRADIENT	3
# define WTEX_DGRADIENT	4
#define WTEX_PIXMAP	10


typedef struct {
    short type;			       /* type of texture */
    char subtype;		       /* subtype of the texture */
    char relief;		       /* type of relief of the texture */
    XColor color;		       /* default background color */
    GC gc;			       /* gc for the background color */
} WTexAny;


typedef struct {
    short type;
    char subtype;
    char relief;
    XColor normal;
    GC normal_gc;
    
    GC light_gc;
    GC dim_gc;
    GC dark_gc;

    XColor light;
    XColor dim;
    XColor dark;
} WTexSolid;


typedef struct {
    short type;
    char subtype;
    char relief;
    XColor normal;
    GC normal_gc;

    XColor color1;
    XColor color2;
} WTexGradient;


typedef struct {
    short type;
    char subtype;
    char relief;
    XColor normal;
    GC normal_gc;

    GC light_gc;
    GC dim_gc;
    GC dark_gc;

    XColor light;
    XColor dim;
    XColor dark;

    Pixmap pixmap;
} WTexPixmap;


typedef union {
    WTexAny any;    
    WTexSolid solid;
    WTexGradient gradient;
    WTexPixmap pixmap;
} WTexture;


typedef Pixmap WTexData;


WTexSolid *wTextureMakeSolid();
WTexGradient *wTextureMakeGradient();

void wTextureDestroy();
void wTexturePaint();
void wTextureRender();
void wTextureFreeData(WTexture *texture, WTexData *data);





#endif
