/*
    GDAM - Geoff & Dave's Audio Mixer
    Copyright (C) 1999    Dave Benson, Geoff Matters.

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser 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
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser 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

    Contact:
        daveb@ffem.org <Dave Benson>
        geoff@ugcs.caltech.edu <Geoff Matters>
*/
#ifndef __GTK_PIX_BUTTON_H_
#define __GTK_PIX_BUTTON_H_

#include <gtk/gtkeventbox.h>

typedef struct _GtkPixButton GtkPixButton;
typedef struct _GtkPixButtonClass GtkPixButtonClass;

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

GtkType gtk_pix_button_get_type();
#define GTK_TYPE_PIX_BUTTON			(gtk_pix_button_get_type ())
#define GTK_PIX_BUTTON(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_PIX_BUTTON, GtkPixButton))
#define GTK_PIX_BUTTON_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PIX_BUTTON, GtkPixButtonClass))
#define GTK_IS_PIX_BUTTON(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_PIX_BUTTON))
#define GTK_IS_PIX_BUTTON_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PIX_BUTTON))

struct _GtkPixButtonClass {
	GtkEventBoxClass 		event_box_class;
	void                          (*pressed)(GtkPixButton*   pix_button);
	void                          (*released)(GtkPixButton*   pix_button);
	void                          (*clicked)(GtkPixButton*   pix_button);
	void                          (*toggled)(GtkPixButton*   pix_button);
};

struct _GtkPixButton {
	GtkEventBox 			event_box;
	GtkStateType			state;
	GdkPixmap*			pixmaps[5];
	GdkBitmap*			masks[5];
	GdkPoint			sizes[5];
	char*				xpm_files[5];
	unsigned			loaded_images : 1;

	unsigned			is_toggle : 1;
	/* Allows button display to follow its arg, without swallowing
	 * button events.
	 */
	unsigned			is_display : 1;
};

void gtk_pix_button_set_pixmaps (GtkPixButton    *pix_button,
                                 GdkPixmap       *normal,
                                 GdkBitmap       *normal_mask,
                                 GdkPixmap       *active,
                                 GdkBitmap       *active_mask,
                                 GdkPixmap       *prelight,
                                 GdkBitmap       *prelight_mask,
                                 GdkPixmap       *selected,
                                 GdkBitmap       *selected_mask);

void gtk_pix_button_pressed(GtkPixButton*);
void gtk_pix_button_released(GtkPixButton*);
void gtk_pix_button_clicked(GtkPixButton*);
void gtk_pix_button_toggled(GtkPixButton*);

/*  TODO:  this should probably be removed in favor of a full PixToggleButton.*/
void gtk_pix_button_make_active(GtkPixButton*);
void gtk_pix_button_make_normal(GtkPixButton*);
gboolean gtk_pix_button_get_active(GtkPixButton*);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
