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


typedef struct _GdamInputSelector GdamInputSelector;
typedef struct _GdamInputSelectorClass GdamInputSelectorClass;

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

#include "gdamskin.h"
#include <gdam/component/gdaminputdevice.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkclist.h>
#include <gtk/gtktree.h>

GtkType gdam_input_selector_get_type();
#define GDAM_TYPE_INPUT_SELECTOR			(gdam_input_selector_get_type ())
#define GDAM_INPUT_SELECTOR(obj)              (GTK_CHECK_CAST ((obj), GDAM_TYPE_INPUT_SELECTOR, GdamInputSelector))
#define GDAM_INPUT_SELECTOR_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GDAM_TYPE_INPUT_SELECTOR, GdamInputSelectorClass))
#define GDAM_IS_INPUT_SELECTOR(obj)           (GTK_CHECK_TYPE ((obj), GDAM_TYPE_INPUT_SELECTOR))
#define GDAM_IS_INPUT_SELECTOR_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GDAM_TYPE_INPUT_SELECTOR))

struct _GdamInputSelectorClass {
	GdamSkinClass		skin_class;
	void                          (*done_groping)(GdamInputSelector*);
};

struct _GdamInputSelector {
	GdamSkin			skin;
	GtkEntry*			entry;

	GdamInputTrap*			selected_trap;

	/* The clist subscribes to the emission of all
	 * new-trap events (of GdamInputDevices).
	 */
	GtkCList*			clist;
	guint				emission_id;
	GtkTree*			tree;

	GdamInputTrap*			grope;
	guint				grope_emission_id;
};

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
