static void zak_form_gtk_form_element_dispose (GObject *gobject);
static void zak_form_gtk_form_element_finalize (GObject *gobject);
+static gboolean zak_form_gtk_form_element_get_visible (ZakFormGtkFormElement *element);
+static void zak_form_gtk_form_element_set_visible (ZakFormGtkFormElement *element, gboolean visible);
+
+static gboolean zak_form_gtk_form_element_get_editable (ZakFormGtkFormElement *element);
+static void zak_form_gtk_form_element_set_editable (ZakFormGtkFormElement *element, gboolean visible);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT, ZakFormGtkFormElementPrivate))
typedef struct _ZakFormGtkFormElementPrivate ZakFormGtkFormElementPrivate;
zak_form_gtk_form_element_class_init (ZakFormGtkFormElementClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
+ ZakFormElementClass *parent_class = ZAK_FORM_ELEMENT_CLASS (class);
object_class->set_property = zak_form_gtk_form_element_set_property;
object_class->get_property = zak_form_gtk_form_element_get_property;
object_class->dispose = zak_form_gtk_form_element_dispose;
object_class->finalize = zak_form_gtk_form_element_finalize;
+ parent_class->get_visible = zak_form_gtk_form_element_get_visible;
+ parent_class->set_visible = zak_form_gtk_form_element_set_visible;
+ parent_class->get_editable = zak_form_gtk_form_element_get_editable;
+ parent_class->set_editable = zak_form_gtk_form_element_set_editable;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementPrivate));
g_object_class_install_property (object_class, PROP_WIDGET,
GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
parent_class->finalize (gobject);
}
+
+static gboolean
+zak_form_gtk_form_element_get_visible (ZakFormGtkFormElement *element)
+{
+ ZakFormGtkFormElementPrivate *priv = ZAK_FORM_GTK_FORM_ELEMENT_GET_PRIVATE (element);
+
+ return gtk_widget_get_visible (priv->widget);
+}
+
+static void
+zak_form_gtk_form_element_set_visible (ZakFormGtkFormElement *element, gboolean visible)
+{
+ ZakFormGtkFormElementPrivate *priv = ZAK_FORM_GTK_FORM_ELEMENT_GET_PRIVATE (element);
+
+ gtk_widget_set_visible (priv->widget, visible);
+
+ if (GTK_IS_WIDGET (priv->label))
+ {
+ gtk_widget_set_visible (priv->label, visible);
+ }
+}
+
+static gboolean
+zak_form_gtk_form_element_get_editable (ZakFormGtkFormElement *element)
+{
+ ZakFormGtkFormElementPrivate *priv = ZAK_FORM_GTK_FORM_ELEMENT_GET_PRIVATE (element);
+
+ return gtk_widget_get_sensitive (priv->widget);
+}
+
+static void
+zak_form_gtk_form_element_set_editable (ZakFormGtkFormElement *element, gboolean editable)
+{
+ ZakFormGtkFormElementPrivate *priv = ZAK_FORM_GTK_FORM_ELEMENT_GET_PRIVATE (element);
+
+ gtk_widget_set_sensitive (priv->widget, editable);
+}