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

#include <gtk/gtkeventbox.h>

typedef struct _GtkBounceLabel GtkBounceLabel;
typedef struct _GtkBounceLabelClass GtkBounceLabelClass;

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

GtkType gtk_bounce_label_get_type();
#define GTK_TYPE_BOUNCE_LABEL	           (gtk_bounce_label_get_type ())
#define GTK_BOUNCE_LABEL(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_BOUNCE_LABEL, GtkBounceLabel))
#define GTK_BOUNCE_LABEL_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOUNCE_LABEL, GtkBounceLabelClass))
#define GTK_IS_BOUNCE_LABEL(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_BOUNCE_LABEL))
#define GTK_IS_BOUNCE_LABEL_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOUNCE_LABEL))

struct _GtkBounceLabelClass {
	GtkEventBoxClass 		event_box_class;
};

struct _GtkBounceLabel {
	GtkEventBox 			event_box;

	char*				text;
	GdkPoint			centered_position;
	int				max_x_offset;
	GdkFont*			font;

	GdkPixmap*			background;
	GdkPoint			size;

	int				x_offset;
	guint				bounce_timer_id;

	char*				background_file;
	unsigned			loaded_image : 1,
					has_text_size : 1,
					is_bouncing : 1,
					bouncing_right : 1,
					must_unref_font : 1;
};

void       gtk_bounce_label_set_pixmap            (GtkBounceLabel* bounce_label,
						   GdkPixmap*      pixmap,
						   int		   width,
						   int		   height);
void       gtk_bounce_label_set_text              (GtkBounceLabel* button,
                                                   const char*     text);
void       gtk_bounce_label_set_font              (GtkBounceLabel* button,
                                                   GdkFont*        font,
						   gboolean        unref);
gboolean   gtk_bounce_label_set_font_name         (GtkBounceLabel* button,
                                                   const char*     font_name);

void       gtk_bounce_label_start_bouncing        (GtkBounceLabel* button);
void       gtk_bounce_label_stop_bouncing         (GtkBounceLabel* button,
                                                   gboolean        now);
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
