/*
    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_DIAL_H_
#define __GTK_PIX_DIAL_H_

#include <gtk/gtkeventbox.h>

typedef struct _GtkPixDial GtkPixDial;
typedef struct _GtkPixDialClass GtkPixDialClass;

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

GtkType gtk_pix_dial_get_type();
#define GTK_TYPE_PIX_DIAL			(gtk_pix_dial_get_type ())
#define GTK_PIX_DIAL(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_PIX_DIAL, GtkPixDial))
#define GTK_PIX_DIAL_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIAL, GtkPixDialClass))
#define GTK_IS_PIX_DIAL(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_PIX_DIAL))
#define GTK_IS_PIX_DIAL_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PIX_DIAL))

struct _GtkPixDialClass {
	GtkEventBoxClass event_box_class;
	void              (*motion)(GtkPixDial*   pix_dial);
};

struct _GtkPixDial {
	GtkEventBox 			event_box;

	/* The pixmap for below the selected value. */
	GdkPixmap*			pixmap;
	GdkBitmap*			mask;
	int				num_tiles;
	int				wrapcount;
	int				tile_width;
	int				tile_height;
	int				last_image_drawn;
	char*				image_filename;
	int				screen_range;
	gdouble				orig_value;

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

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

	gboolean			is_dragging;
	int				last_drag_x;

	gboolean			images_reversed;
	gboolean			reset_on_release;
	/* graphics snap to even amounts, adjustment value is still
	 * a double */
	gboolean			is_int;
	gboolean			no_mouse;
};


void       gtk_pix_dial_set_adjustment       (GtkPixDial*     dial,
                                              GtkAdjustment*  adjustment);
void       gtk_pix_dial_set_pixmap           (GtkPixDial*     dial,
					      GdkPixmap*      dial_pixmap,
					      GdkBitmap*      dial_pixmap_mask);
      
void       gtk_pix_dial_motion               (GtkPixDial*        dial);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
