diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2018-11-28 18:35:05 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2018-11-28 18:35:05 +0000 |
| commit | 5f56c9ab52a71f63d8c24bfe2f943e1a66176586 (patch) | |
| tree | 05b3e899d5dde26733dc5abb6f4ab2145d0c87ef /src | |
| parent | desktop-widget: Move function to correct header (diff) | |
| download | inkscape-5f56c9ab52a71f63d8c24bfe2f943e1a66176586.tar.gz inkscape-5f56c9ab52a71f63d8c24bfe2f943e1a66176586.zip | |
SPButton: GObject style fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets/button.h | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/widgets/button.h b/src/widgets/button.h index 4aa29b40a..a8fc61bee 100644 --- a/src/widgets/button.h +++ b/src/widgets/button.h @@ -12,14 +12,12 @@ #ifndef SEEN_SP_BUTTON_H #define SEEN_SP_BUTTON_H - -#define SP_TYPE_BUTTON (sp_button_get_type ()) -#define SP_BUTTON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SP_TYPE_BUTTON, SPButton)) -#define SP_IS_BUTTON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SP_TYPE_BUTTON)) - #include <gtk/gtk.h> #include <sigc++/connection.h> +#define SP_TYPE_BUTTON (sp_button_get_type ()) +G_DECLARE_FINAL_TYPE(SPButton, sp_button, SP, BUTTON, GtkToggleButton); + struct SPAction; namespace Inkscape { @@ -39,26 +37,21 @@ struct SPBChoiceData { guchar *px; }; -struct SPButton { - GtkToggleButton widget; - SPButtonType type; - GtkIconSize lsize; - unsigned int psize; - SPAction *action; - SPAction *doubleclick_action; +struct _SPButton { + GtkToggleButton parent_instance; - sigc::connection c_set_active; - sigc::connection c_set_sensitive; -}; + SPButtonType type; + GtkIconSize lsize; + unsigned int psize; + SPAction *action; + SPAction *doubleclick_action; -struct SPButtonClass { - GtkToggleButtonClass parent_class; + sigc::connection c_set_active; + sigc::connection c_set_sensitive; }; #define SP_BUTTON_IS_DOWN(b) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (b)) -GType sp_button_get_type (); - GtkWidget *sp_button_new (GtkIconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action); void sp_button_toggle_set_down (SPButton *button, gboolean down); |
