1 #ifndef __SP_BUTTON_H__
2 #define __SP_BUTTON_H__
4 /*
5 * Generic button widget
6 *
7 * Author:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 2002 Lauris Kaplinski
11 *
12 * This code is in public domain
13 */
15 #define SP_TYPE_BUTTON (sp_button_get_type ())
16 #define SP_BUTTON(o) (GTK_CHECK_CAST ((o), SP_TYPE_BUTTON, SPButton))
17 #define SP_IS_BUTTON(o) (GTK_CHECK_TYPE ((o), SP_TYPE_BUTTON))
19 #include <gtk/gtkwidget.h>
20 #include <gtk/gtktogglebutton.h>
21 #include <gtk/gtktooltips.h>
23 #include <helper/action.h>
26 typedef enum {
27 SP_BUTTON_TYPE_NORMAL,
28 SP_BUTTON_TYPE_TOGGLE
29 } SPButtonType;
31 struct SPBChoiceData {
32 guchar *px;
33 };
35 struct SPButton {
36 GtkToggleButton widget;
37 SPButtonType type;
38 GtkIconSize lsize;
39 unsigned int psize;
40 SPAction *action;
41 SPAction *doubleclick_action;
42 GtkTooltips *tooltips;
43 };
45 struct SPButtonClass {
46 GtkToggleButtonClass parent_class;
47 };
49 #define SP_BUTTON_IS_DOWN(b) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (b))
51 GType sp_button_get_type (void);
53 GtkWidget *sp_button_new (GtkIconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action, GtkTooltips *tooltips);
55 void sp_button_toggle_set_down (SPButton *button, gboolean down);
57 GtkWidget *sp_button_new_from_data (GtkIconSize size,
58 SPButtonType type,
59 Inkscape::UI::View::View *view,
60 const gchar *name,
61 const gchar *tip,
62 GtkTooltips *tooltips);
66 #endif