GtkWidget * gimp_throbber_get_image (GimpThrobber *button) { g_return_val_if_fail (GIMP_IS_THROBBER (button), NULL); return button->priv->image; }
void gimp_throbber_set_image (GimpThrobber *button, GtkWidget *image) { g_return_if_fail (GIMP_IS_THROBBER (button)); g_return_if_fail (image == NULL || GTK_IS_IMAGE (image)); if (image != button->priv->image) { if (button->priv->image) { if (gtk_widget_get_parent (button->priv->image)) gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (button->priv->image)), button->priv->image); g_object_unref (button->priv->image); } if (image) g_object_ref_sink (image); button->priv->image = image; gimp_throbber_construct_contents (GTK_TOOL_ITEM (button)); g_object_notify (G_OBJECT (button), "image"); } }
const gchar * gimp_throbber_get_icon_name (GimpThrobber *button) { g_return_val_if_fail (GIMP_IS_THROBBER (button), NULL); return button->priv->icon_name; }
void gimp_throbber_set_icon_name (GimpThrobber *button, const gchar *icon_name) { gchar *old_icon_name; g_return_if_fail (GIMP_IS_THROBBER (button)); old_icon_name = button->priv->icon_name; button->priv->icon_name = g_strdup (icon_name); gimp_throbber_construct_contents (GTK_TOOL_ITEM (button)); g_object_notify (G_OBJECT (button), "icon-name"); g_free (old_icon_name); }
static void gimp_throbber_action_connect_proxy (GtkAction *action, GtkWidget *proxy) { GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy); if (GIMP_IS_THROBBER (proxy)) { GParamSpec *pspec; pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (action), "stock-id"); gimp_throbber_action_sync_property (action, pspec, proxy); g_signal_connect_object (action, "notify::stock-id", G_CALLBACK (gimp_throbber_action_sync_property), proxy, 0); g_signal_connect_object (proxy, "clicked", G_CALLBACK (gtk_action_activate), action, G_CONNECT_SWAPPED); } }