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"
24 #include "icon-size.h"
27 typedef enum {
28 SP_BUTTON_TYPE_NORMAL,
29 SP_BUTTON_TYPE_TOGGLE
30 } SPButtonType;
32 struct SPBChoiceData {
33 guchar *px;
34 };
36 struct SPButton {
37 GtkToggleButton widget;
38 SPButtonType type;
39 Inkscape::IconSize lsize;
40 unsigned int psize;
41 SPAction *action;
42 SPAction *doubleclick_action;
43 GtkTooltips *tooltips;
44 };
46 struct SPButtonClass {
47 GtkToggleButtonClass parent_class;
48 };
50 #define SP_BUTTON_IS_DOWN(b) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (b))
52 GType sp_button_get_type (void);
54 GtkWidget *sp_button_new (Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action, GtkTooltips *tooltips);
56 void sp_button_toggle_set_down (SPButton *button, gboolean down);
58 GtkWidget *sp_button_new_from_data (Inkscape::IconSize size,
59 SPButtonType type,
60 Inkscape::UI::View::View *view,
61 const gchar *name,
62 const gchar *tip,
63 GtkTooltips *tooltips);
67 #endif