From: Andrea Zagli Date: Sun, 19 Jun 2011 11:09:30 +0000 (+0200) Subject: Made public functions to manage properties. X-Git-Tag: 0.4.0~16 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=ad6c8bd9bacdc189fb0551cfa0119d28b2d64bbd;p=libgtkform Made public functions to manage properties. Bugfixes. --- diff --git a/libgtkformui.pc.in b/libgtkformui.pc.in index 371fefe..73fe473 100644 --- a/libgtkformui.pc.in +++ b/libgtkformui.pc.in @@ -7,5 +7,5 @@ Name: @PACKAGE_NAME@ui Description: Class to more easly manage Gtk+ forms binded to db (or not) UI. Version: @PACKAGE_VERSION@ Requires: gtk+-2.0, libgtkform -Libs: -L${libdir} -lgtkform +Libs: -L${libdir} -lgtkformui Cflags: -I${includedir} diff --git a/ui/gtkformdecoder.c b/ui/gtkformdecoder.c index 079326b..2023cf1 100644 --- a/ui/gtkformdecoder.c +++ b/ui/gtkformdecoder.c @@ -170,9 +170,9 @@ gtk_form_decoder_class_init (GtkFormDecoderClass *klass) 0, NULL, NULL, - g_cclosure_marshal_BOOLEAN__FLAGS, - G_TYPE_BOOLEAN, - 1, G_TYPE_INT); + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); /** * GtkFormDecoder::btn_browse_clicked: @@ -373,7 +373,7 @@ gtk_form_decoder_decode (GtkFormDecoder *decoder) } } -static void +void gtk_form_decoder_show_btn_clean (GtkFormDecoder *decoder, gboolean visible) { GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); @@ -383,7 +383,7 @@ gtk_form_decoder_show_btn_clean (GtkFormDecoder *decoder, gboolean visible) gtk_entry_set_icon_sensitive (GTK_ENTRY (priv->txt_decoded), GTK_ENTRY_ICON_SECONDARY, visible); } -static void +void gtk_form_decoder_show_btn_open (GtkFormDecoder *decoder, gboolean visible) { GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); @@ -391,7 +391,7 @@ gtk_form_decoder_show_btn_open (GtkFormDecoder *decoder, gboolean visible) gtk_widget_set_visible (priv->btn_open, visible); } -static void +void gtk_form_decoder_show_btn_browse (GtkFormDecoder *decoder, gboolean visible) { GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); @@ -399,6 +399,30 @@ gtk_form_decoder_show_btn_browse (GtkFormDecoder *decoder, gboolean visible) gtk_widget_set_visible (priv->btn_browse, visible); } +gboolean +gtk_form_decoder_btn_clean_is_visible (GtkFormDecoder *decoder) +{ + GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); + + return gtk_entry_get_icon_stock (GTK_ENTRY (priv->txt_decoded), GTK_ENTRY_ICON_SECONDARY) != NULL; +} + +gboolean +gtk_form_decoder_btn_open_is_visible (GtkFormDecoder *decoder) +{ + GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); + + return gtk_widget_get_visible (priv->btn_open); +} + +gboolean +gtk_form_decoder_btn_browse_is_visible (GtkFormDecoder *decoder) +{ + GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder); + + return gtk_widget_get_visible (priv->btn_browse); +} + /* CALLBACKS */ static void gtk_form_decoder_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) @@ -463,15 +487,15 @@ gtk_form_decoder_get_property (GObject *object, guint property_id, GValue *value break; case PROP_SHOW_CLEAN: - g_value_set_boolean (value, gtk_entry_get_icon_stock (GTK_ENTRY (priv->txt_decoded), GTK_ENTRY_ICON_SECONDARY) != NULL); + g_value_set_boolean (value, gtk_form_decoder_btn_clean_is_visible (decoder)); break; case PROP_SHOW_OPEN: - g_value_set_boolean (value, gtk_widget_get_visible (priv->btn_open)); + g_value_set_boolean (value, gtk_form_decoder_btn_open_is_visible (decoder)); break; case PROP_SHOW_BROWSE: - g_value_set_boolean (value, gtk_widget_get_visible (priv->btn_browse)); + g_value_set_boolean (value, gtk_form_decoder_btn_browse_is_visible (decoder)); break; default: diff --git a/ui/gtkformdecoder.h b/ui/gtkformdecoder.h index 92fb3ef..07a02af 100644 --- a/ui/gtkformdecoder.h +++ b/ui/gtkformdecoder.h @@ -63,6 +63,14 @@ void gtk_form_decoder_set_key (GtkFormDecoder *decoder, const gchar *key); gchar *gtk_form_decoder_get_key (GtkFormDecoder *decoder); gchar *gtk_form_decoder_get_decoded (GtkFormDecoder *decoder); +void gtk_form_decoder_show_btn_clean (GtkFormDecoder *decoder, gboolean visible); +void gtk_form_decoder_show_btn_open (GtkFormDecoder *decoder, gboolean visible); +void gtk_form_decoder_show_btn_browse (GtkFormDecoder *decoder, gboolean visible); + +gboolean gtk_form_decoder_btn_clean_is_visible (GtkFormDecoder *decoder); +gboolean gtk_form_decoder_btn_open_is_visible (GtkFormDecoder *decoder); +gboolean gtk_form_decoder_btn_browse_is_visible (GtkFormDecoder *decoder); + G_END_DECLS