/*
    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_SPLITBAR_H_
#define __GTK_PIX_SPLITBAR_H_

#include <gtk/gtkeventbox.h>

typedef struct _GtkPixSplitbar GtkPixSplitbar;
typedef struct _GtkPixSplitbarClass GtkPixSplitbarClass;

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

GtkType gtk_pix_splitbar_get_type();
#define GTK_TYPE_PIX_SPLITBAR			(gtk_pix_splitbar_get_type ())
#define GTK_PIX_SPLITBAR(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_PIX_SPLITBAR, GtkPixSplitbar))
#define GTK_PIX_SPLITBAR_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PIX_SPLITBAR, GtkPixSplitbarClass))
#define GTK_IS_PIX_SPLITBAR(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_PIX_SPLITBAR))
#define GTK_IS_PIX_SPLITBAR_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PIX_SPLITBAR))

struct _GtkPixSplitbarClass {
	GtkEventBoxClass event_box_class;
	void              (*motion)(GtkPixSplitbar*   pix_splitbar);
};

typedef enum {
	GTK_PIX_SPLITBAR_LEFT,
	GTK_PIX_SPLITBAR_RIGHT,
	GTK_PIX_SPLITBAR_TOP,
	GTK_PIX_SPLITBAR_BOTTOM
} GtkPixSplitbarOrientation;

struct _GtkPixSplitbar {
	GtkEventBox 			event_box;

	/* The pixmap for above the selected value. */
	GdkPixmap*			above_pixmap;
	GdkBitmap*			above_mask;
	GdkPoint			above_size;
	char*				above_file;

	/* The pixmap for below the selected value. */
	GdkPixmap*			below_pixmap;
	GdkBitmap*			below_mask;
	GdkPoint			below_size;
	char*				below_file;

	/* The trough start and extent. */
	GtkPixSplitbarOrientation	orientation;

	/* The underlying adjustment. */
	GtkAdjustment*			adjustment;

	/* The adjustment connection id. */
	guint				connect_id;

	/* Whether we have loaded the images yet... */
	unsigned			loaded_images : 1;

	/* Whether to update in between mouse_press and mouse_release. */
	unsigned			continuous : 1;
};

void       gtk_pix_splitbar_set_adjustment       (GtkPixSplitbar *pix_splitbar,
                                                  GtkAdjustment  *adjustment);

void       gtk_pix_splitbar_set_pixmaps          (GtkPixSplitbar *pix_splitbar,
						  GdkPixmap      *above,
						  GdkBitmap      *above_mask,
						  GdkPixmap      *below,
						  GdkBitmap      *below_mask);
      
void       gtk_pix_splitbar_motion               (GtkPixSplitbar *pix_splitbar);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
