glade-property-label.c 20.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*
 * Copyright (C) 2013 Tristan Van Berkom.
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public 
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Authors:
 *   Tristan Van Berkom <tvb@gnome.org>
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <glib/gi18n-lib.h>

#include "glade.h"
#include "glade-widget.h"
#include "glade-popup.h"
31
#include "glade-editable.h"
32 33 34
#include "glade-property-label.h"

/* GObjectClass */
35
static void      glade_property_label_finalize          (GObject         *object);
36 37 38 39 40 41 42 43 44 45 46 47 48 49
static void      glade_property_label_dispose           (GObject         *object);
static void      glade_property_label_set_real_property (GObject         *object,
							 guint            prop_id,
							 const GValue    *value,
							 GParamSpec      *pspec);
static void      glade_property_label_get_real_property (GObject         *object,
							 guint            prop_id,
							 GValue          *value,
							 GParamSpec      *pspec);

/* GtkWidgetClass */
static gint      glade_property_label_button_press      (GtkWidget       *widget,
							 GdkEventButton  *event);

50 51
/* GladeEditableIface */
static void      glade_property_label_editable_init     (GladeEditableIface *iface);
52

53 54 55 56 57 58
struct _GladePropertyLabelPrivate
{
  GladeProperty *property;

  GtkWidget     *warning;
  GtkWidget     *label;
59
  GtkWidget     *box;
60 61 62 63 64

  gulong         tooltip_id;   /* signal connection id for tooltip changes     */
  gulong         state_id;     /* signal connection id for state changes       */
  gulong         sensitive_id; /* signal connection id for sensitivity changes */
  gulong         enabled_id;   /* signal connection id for property enabled changes */
65

66 67 68
  gchar         *property_name; /* The property name to use when loading by GladeWidget */

  guint          packing : 1;
69 70
  guint          custom_text : 1;
  guint          custom_tooltip : 1;
71
  guint          append_colon : 1;
72 73 74 75
};

enum {
  PROP_0,
76
  PROP_PROPERTY,
77
  PROP_PROPERTY_NAME,
78
  PROP_APPEND_COLON,
79
  PROP_PACKING,
80 81
  PROP_CUSTOM_TEXT,
  PROP_CUSTOM_TOOLTIP,
82 83
};

84 85
static GladeEditableIface *parent_editable_iface;

86
G_DEFINE_TYPE_WITH_CODE (GladePropertyLabel, glade_property_label, GTK_TYPE_EVENT_BOX,
87
                         G_ADD_PRIVATE (GladePropertyLabel)
88 89
			 G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
                                                glade_property_label_editable_init));
90 91 92 93

static void
glade_property_label_init (GladePropertyLabel *label)
{
94
  label->priv = glade_property_label_get_instance_private (label);
95

96
  label->priv->packing = FALSE;
97 98
  label->priv->custom_text = FALSE;
  label->priv->custom_tooltip = FALSE;
99
  label->priv->append_colon = TRUE;
100 101 102 103 104 105 106 107 108 109
  
  gtk_widget_init_template (GTK_WIDGET (label));
}

static void
glade_property_label_class_init (GladePropertyLabelClass *class)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
  
110
  gobject_class->finalize = glade_property_label_finalize;
111 112 113 114 115 116
  gobject_class->dispose = glade_property_label_dispose;
  gobject_class->set_property = glade_property_label_set_real_property;
  gobject_class->get_property = glade_property_label_get_real_property;

  widget_class->button_press_event = glade_property_label_button_press;

117 118
  g_object_class_install_property
    (gobject_class, PROP_PROPERTY,
119
     g_param_spec_object ("property", _("Property"),
120
			  _("The GladeProperty to display a label for"),
121
			  GLADE_TYPE_PROPERTY, G_PARAM_READWRITE));
122

123 124 125
  g_object_class_install_property
      (gobject_class, PROP_PROPERTY_NAME,
       g_param_spec_string ("property-name", _("Property Name"),
126 127 128 129
                            /* To Translators: the property name/id to use to get
                             * the GladeProperty object from the GladeWidget the
                             * property belongs to.
                             */
130 131 132
			    _("The property name to use when loading by widget"),
			    NULL, G_PARAM_READWRITE));

133 134 135 136 137 138
  g_object_class_install_property
      (gobject_class, PROP_APPEND_COLON,
       g_param_spec_boolean ("append-colon", _("Append Colon"),
			     _("Whether to append a colon ':' to the property name"),
			     TRUE, G_PARAM_READWRITE));

139 140 141
  g_object_class_install_property
      (gobject_class, PROP_PACKING,
       g_param_spec_boolean ("packing", _("Packing"),
142 143 144 145 146
                             /* To Translators: packing properties or child properties are
                              * properties introduced by GtkContainer and they are not specific
                              * to the container or child widget but to the relation.
                              * For more information see GtkContainer docs.
                              */
147 148 149
			     _("Whether the property to load is a packing property or not"),
			     FALSE, G_PARAM_READWRITE));

150 151 152 153 154 155 156 157 158 159 160
  g_object_class_install_property
      (gobject_class, PROP_CUSTOM_TEXT,
       g_param_spec_string ("custom-text", _("Custom Text"),
			    _("Custom text to override the property name"),
			    NULL, G_PARAM_READWRITE));

  g_object_class_install_property
      (gobject_class, PROP_CUSTOM_TOOLTIP,
       g_param_spec_string ("custom-tooltip", _("Custom Tooltip"),
			    _("Custom tooltip to override the property description"),
			    NULL, G_PARAM_READWRITE));
161 162 163

  /* Bind to template */
  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/gladeui/glade-property-label.ui");
164 165 166
  gtk_widget_class_bind_template_child_private (widget_class, GladePropertyLabel, box);
  gtk_widget_class_bind_template_child_private (widget_class, GladePropertyLabel, label);
  gtk_widget_class_bind_template_child_private (widget_class, GladePropertyLabel, warning);
167 168 169 170 171 172
}


/***********************************************************
 *                     GObjectClass                        *
 ***********************************************************/
173 174 175 176 177 178 179 180 181 182
static void
glade_property_label_finalize (GObject *object)
{
  GladePropertyLabel *label = GLADE_PROPERTY_LABEL (object);

  g_free (label->priv->property_name);

  G_OBJECT_CLASS (glade_property_label_parent_class)->finalize (object);
}

183 184 185
static void
glade_property_label_dispose (GObject *object)
{
186 187 188
  GladePropertyLabel *label = GLADE_PROPERTY_LABEL (object);

  glade_property_label_set_property (label, NULL);
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205

  G_OBJECT_CLASS (glade_property_label_parent_class)->dispose (object);
}

static void
glade_property_label_set_real_property (GObject         *object,
					guint            prop_id,
					const GValue    *value,
					GParamSpec      *pspec)
{
  GladePropertyLabel *label = GLADE_PROPERTY_LABEL (object);

  switch (prop_id)
    {
    case PROP_PROPERTY:
      glade_property_label_set_property (label, g_value_get_object (value));
      break;
206 207 208
    case PROP_PROPERTY_NAME:
      glade_property_label_set_property_name (label, g_value_get_string (value));
      break;
209 210 211
    case PROP_APPEND_COLON:
      glade_property_label_set_append_colon (label, g_value_get_boolean (value));
      break;
212 213 214
    case PROP_PACKING:
      glade_property_label_set_packing (label, g_value_get_boolean (value));
      break;
215 216 217 218 219 220
    case PROP_CUSTOM_TEXT:
      glade_property_label_set_custom_text (label, g_value_get_string (value));
      break;
    case PROP_CUSTOM_TOOLTIP:
      glade_property_label_set_custom_tooltip (label, g_value_get_string (value));
      break;
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
    }
}

static void
glade_property_label_get_real_property (GObject         *object,
					guint            prop_id,
					GValue          *value,
					GParamSpec      *pspec)
{
  GladePropertyLabel *label = GLADE_PROPERTY_LABEL (object);

  switch (prop_id)
    {
    case PROP_PROPERTY:
      g_value_set_object (value, glade_property_label_get_property (label));
      break;
240 241 242 243 244 245
    case PROP_PROPERTY_NAME:
      g_value_set_string (value, glade_property_label_get_property_name (label));
      break;
    case PROP_PACKING:
      g_value_set_boolean (value, glade_property_label_get_packing (label));
      break;
246 247 248
    case PROP_APPEND_COLON:
      g_value_set_boolean (value, glade_property_label_get_append_colon (label));
      break;
249 250 251 252 253 254
    case PROP_CUSTOM_TEXT:
      g_value_set_string (value, glade_property_label_get_custom_text (label));
      break;
    case PROP_CUSTOM_TOOLTIP:
      g_value_set_string (value, glade_property_label_get_custom_tooltip (label));
      break;
255 256 257 258 259 260
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
    }
}

261
/*******************************************************************************
262
 *                            GladeEditableIface                               *                               
263 264
 *******************************************************************************/
static void
265 266
glade_property_label_load (GladeEditable   *editable,
			   GladeWidget     *widget)
267
{
268
  GladePropertyLabel *label = GLADE_PROPERTY_LABEL (editable);
269 270 271
  GladePropertyLabelPrivate *priv;
  GladeProperty *property;

272 273 274
  /* Chain up to default implementation */
  parent_editable_iface->load (editable, widget);

275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
  g_return_if_fail (label->priv->property_name != NULL);

  priv = label->priv;

  if (widget)
    {
      if (priv->packing)
	property = glade_widget_get_pack_property (widget, priv->property_name);
      else
	property = glade_widget_get_property (widget, priv->property_name);

      glade_property_label_set_property (label, property);
    }
  else
    glade_property_label_set_property (label, NULL);
}

static void
293
glade_property_label_set_show_name (GladeEditable *editable, gboolean show_name)
294
{
295 296 297
}

static void
298
glade_property_label_editable_init (GladeEditableIface *iface)
299 300 301 302 303
{
  parent_editable_iface = g_type_default_interface_peek (GLADE_TYPE_EDITABLE);

  iface->load = glade_property_label_load;
  iface->set_show_name = glade_property_label_set_show_name;
304 305
}

306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
/***********************************************************
 *                     GtkWidgetClass                      *
 ***********************************************************/
static gint
glade_property_label_button_press (GtkWidget       *widget,
				   GdkEventButton  *event)
{
  GladePropertyLabel        *label = GLADE_PROPERTY_LABEL (widget);
  GladePropertyLabelPrivate *priv = label->priv;

  if (priv->property && glade_popup_is_popup_event (event))
    {
      glade_popup_property_pop (priv->property, event);
      return TRUE;
    }

  return FALSE;
}

/***********************************************************
 *                        Callbacks                        *
 ***********************************************************/
static void
glade_property_label_tooltip_cb (GladeProperty      *property,
				 const gchar        *tooltip,
				 const gchar        *insensitive,
				 const gchar        *support,
				 GladePropertyLabel *label)
{
  GladePropertyLabelPrivate *priv = label->priv;
  const gchar *choice_tooltip;

  if (glade_property_get_sensitive (property))
    choice_tooltip = tooltip;
  else
    choice_tooltip = insensitive;

343 344 345
  if (!priv->custom_tooltip)
    gtk_widget_set_tooltip_text (priv->label, choice_tooltip);

346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
  gtk_widget_set_tooltip_text (priv->warning, support);
}

static void
glade_property_label_sensitivity_cb (GladeProperty      *property,
				     GParamSpec         *pspec,
				     GladePropertyLabel *label)
{
  GladePropertyLabelPrivate *priv = label->priv;
  gboolean sensitive;

  sensitive = glade_property_get_enabled (property);
  sensitive = sensitive && glade_property_get_sensitive (priv->property);
  sensitive = sensitive && (glade_property_get_state (priv->property) & GLADE_STATE_SUPPORT_DISABLED) == 0;

361
  gtk_widget_set_sensitive (priv->box, sensitive);
362 363
}

364
static PangoAttrList *
365
get_modified_attribute (void)
366 367 368 369 370 371 372 373
{
  static PangoAttrList *attrs = NULL;

  if (!attrs)
    {
      PangoAttribute *attr;

      attrs = pango_attr_list_new ();
374
      attr  = pango_attr_style_new (PANGO_STYLE_ITALIC);
375 376 377 378 379 380
      pango_attr_list_insert (attrs, attr);
    }

  return attrs;
}

381 382 383 384 385 386 387 388 389 390 391
static void
glade_property_label_state_cb (GladeProperty      *property,
			       GParamSpec         *pspec,
			       GladePropertyLabel *label)
{
  GladePropertyLabelPrivate *priv = label->priv;

  if (!priv->property)
    return;

  /* refresh label */
392
  if ((glade_property_get_state (priv->property) & GLADE_STATE_CHANGED) != 0)
393
    gtk_label_set_attributes (GTK_LABEL (priv->label), get_modified_attribute());
394 395
  else
    gtk_label_set_attributes (GTK_LABEL (priv->label), NULL);
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422

  /* refresh icon */
  if ((glade_property_get_state (priv->property) & GLADE_STATE_UNSUPPORTED) != 0)
    gtk_widget_show (priv->warning);
  else
    gtk_widget_hide (priv->warning);
}

static void
glade_property_label_property_finalized (GladePropertyLabel *label,
					 GladeProperty *where_property_was)
{
  /* Silent disconnect */
  label->priv->property = NULL;
  label->priv->tooltip_id = 0;
  label->priv->state_id = 0;
  label->priv->sensitive_id = 0;
  label->priv->enabled_id = 0;
}

/***********************************************************
 *                            API                          *
 ***********************************************************/
GtkWidget *
glade_property_label_new (void)
{
  return g_object_new (GLADE_TYPE_PROPERTY_LABEL, NULL);
423
}
424

425 426 427 428 429
void
glade_property_label_set_property_name (GladePropertyLabel *label,
					const gchar        *property_name)
{
  GladePropertyLabelPrivate *priv;
430

431
  g_return_if_fail (GLADE_IS_PROPERTY_LABEL (label));
432

433
  priv = label->priv;
434

435 436 437 438
  if (g_strcmp0 (priv->property_name, property_name))
    {
      g_free (priv->property_name);
      priv->property_name = g_strdup (property_name);
439

440 441 442
      g_object_notify (G_OBJECT (label), "property-name");
    }
}
443

444 445 446 447
const gchar *
glade_property_label_get_property_name (GladePropertyLabel *label)
{
  g_return_val_if_fail (GLADE_IS_PROPERTY_LABEL (label), NULL);
448

449 450
  return label->priv->property_name;
}
451

452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477
void
glade_property_label_set_append_colon (GladePropertyLabel *label,
				       gboolean            append_colon)
{
  GladePropertyLabelPrivate *priv;

  g_return_if_fail (GLADE_IS_PROPERTY_LABEL (label));

  priv = label->priv;

  if (priv->append_colon != append_colon)
    {
      priv->append_colon = append_colon;

      g_object_notify (G_OBJECT (label), "append-colon");
    }
}

gboolean
glade_property_label_get_append_colon (GladePropertyLabel *label)
{
  g_return_val_if_fail (GLADE_IS_PROPERTY_LABEL (label), FALSE);

  return label->priv->append_colon;
}

478 479 480 481 482
void
glade_property_label_set_packing (GladePropertyLabel *label,
				  gboolean            packing)
{
  GladePropertyLabelPrivate *priv;
483

484
  g_return_if_fail (GLADE_IS_PROPERTY_LABEL (label));
485

486 487 488 489 490 491 492
  priv = label->priv;

  if (priv->packing != packing)
    {
      priv->packing = packing;

      g_object_notify (G_OBJECT (label), "packing");
493 494 495
    }
}

496 497
gboolean
glade_property_label_get_packing (GladePropertyLabel *label)
498
{
499
  g_return_val_if_fail (GLADE_IS_PROPERTY_LABEL (label), FALSE);
500

501
  return label->priv->packing;
502
}
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609

void
glade_property_label_set_custom_text (GladePropertyLabel *label,
				      const gchar        *custom_text)
{
  GladePropertyLabelPrivate *priv;
  gboolean changed = FALSE;

  g_return_if_fail (GLADE_IS_PROPERTY_LABEL (label));

  priv = label->priv;

  if (custom_text)
    {
      if (!priv->custom_text)
	changed = TRUE;

      priv->custom_text = TRUE;

      gtk_label_set_markup (GTK_LABEL (priv->label), custom_text);
    }
  else
    {
      if (priv->custom_text)
	changed = TRUE;

      priv->custom_text = FALSE;

      if (priv->property)
	  glade_property_label_state_cb (priv->property, NULL, label);
    }

  if (changed)
    g_object_notify (G_OBJECT (label), "custom-text");
}

const gchar *
glade_property_label_get_custom_text (GladePropertyLabel *label)
{
  GladePropertyLabelPrivate *priv;

  g_return_val_if_fail (GLADE_IS_PROPERTY_LABEL (label), NULL);

  priv = label->priv;

  if (priv->custom_text)
    return gtk_label_get_text (GTK_LABEL (priv->label));

  return NULL;
}

void
glade_property_label_set_custom_tooltip (GladePropertyLabel *label,
					 const gchar        *custom_tooltip)
{
  GladePropertyLabelPrivate *priv;
  gboolean changed = FALSE;

  g_return_if_fail (GLADE_IS_PROPERTY_LABEL (label));

  priv = label->priv;

  if (custom_tooltip)
    {
      if (!priv->custom_tooltip)
	changed = TRUE;

      priv->custom_tooltip = TRUE;

      gtk_widget_set_tooltip_text (GTK_WIDGET (priv->label), custom_tooltip);
    }
  else
    {
      if (priv->custom_tooltip)
	changed = TRUE;

      priv->custom_tooltip = FALSE;

      if (priv->property)
	{
	  GladePropertyClass *pclass = glade_property_get_class (priv->property);

	  glade_property_label_tooltip_cb
	    (priv->property, glade_property_class_get_tooltip (pclass),
	     glade_propert_get_insensitive_tooltip (priv->property),
	     glade_property_get_support_warning (priv->property), label);
	}
    }

  if (changed)
    g_object_notify (G_OBJECT (label), "custom-tooltip");
}

const gchar *
glade_property_label_get_custom_tooltip (GladePropertyLabel *label)
{
  GladePropertyLabelPrivate *priv;

  g_return_val_if_fail (GLADE_IS_PROPERTY_LABEL (label), NULL);

  priv = label->priv;

  if (priv->custom_tooltip)
    return gtk_widget_get_tooltip_text (priv->label);

  return NULL;
}
610 611

void
612 613
glade_property_label_set_property (GladePropertyLabel *label,
				   GladeProperty      *property)
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689
{
  GladePropertyLabelPrivate *priv;

  g_return_if_fail (GLADE_IS_PROPERTY_LABEL (label));
  g_return_if_fail (property == NULL || GLADE_IS_PROPERTY (property));

  priv = label->priv;

  if (priv->property != property)
    {

      /* Disconnect last */
      if (priv->property)
	{
	  if (priv->tooltip_id > 0)
	    g_signal_handler_disconnect (priv->property, priv->tooltip_id);
	  if (priv->state_id > 0)
	    g_signal_handler_disconnect (priv->property, priv->state_id);
	  if (priv->sensitive_id > 0)
	    g_signal_handler_disconnect (priv->property, priv->sensitive_id);
	  if (priv->enabled_id > 0)
	    g_signal_handler_disconnect (priv->property, priv->enabled_id);

	  priv->tooltip_id = 0;
	  priv->state_id = 0;
	  priv->sensitive_id = 0;
	  priv->enabled_id = 0;

	  g_object_weak_unref (G_OBJECT (priv->property),
			       (GWeakNotify) glade_property_label_property_finalized, label);
	}

      priv->property = property;

      /* Connect new */
      if (priv->property)
	{
	  GladePropertyClass *pclass = glade_property_get_class (priv->property);

	  priv->tooltip_id =
	    g_signal_connect (G_OBJECT (priv->property),
			      "tooltip-changed",
			      G_CALLBACK (glade_property_label_tooltip_cb),
			      label);
	  priv->sensitive_id =
	    g_signal_connect (G_OBJECT (priv->property),
			      "notify::sensitive",
			      G_CALLBACK (glade_property_label_sensitivity_cb),
			      label);
	  priv->state_id =
	    g_signal_connect (G_OBJECT (priv->property),
			      "notify::state",
			      G_CALLBACK (glade_property_label_state_cb), label);
	  priv->enabled_id =
	    g_signal_connect (G_OBJECT (priv->property),
			      "notify::enabled",
			      G_CALLBACK (glade_property_label_sensitivity_cb),
			      label);

	  g_object_weak_ref (G_OBJECT (priv->property),
			     (GWeakNotify) glade_property_label_property_finalized, label);

	  /* Load initial tooltips
	   */
	  glade_property_label_tooltip_cb
	    (property, glade_property_class_get_tooltip (pclass),
	     glade_propert_get_insensitive_tooltip (property),
	     glade_property_get_support_warning (property), label);

	  /* Load initial sensitive state.
	   */
	  glade_property_label_sensitivity_cb (property, NULL, label);

	  /* Load intial label state
	   */
	  glade_property_label_state_cb (property, NULL, label);
690 691 692

	  if (!priv->custom_text)
	    {
693 694 695 696 697 698 699 700 701 702 703
	      if (priv->append_colon)
		{
		  gchar *text = g_strdup_printf ("%s:", glade_property_class_get_name (pclass));
		  gtk_label_set_text (GTK_LABEL (priv->label), text);
		  g_free (text);
		}
	      else
		{
		  gtk_label_set_text (GTK_LABEL (priv->label),
				      glade_property_class_get_name (pclass));
		}
704
	    }
705 706 707 708 709 710 711 712 713 714 715 716 717
	}

      g_object_notify (G_OBJECT (label), "property");
    }
}

GladeProperty *
glade_property_label_get_property (GladePropertyLabel *label)
{
  g_return_val_if_fail (GLADE_IS_PROPERTY_LABEL (label), NULL);

  return label->priv->property;
}