Clean spec file for yocto compliance.
[platform/upstream/ibus.git] / src / ibusproperty.c
1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
2 /* vim:set et sts=4: */
3 /* IBus - The Input Bus
4  * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
5  * Copyright (C) 2008-2010 Red Hat, Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
20  * USA
21  */
22 #include "ibusproperty.h"
23 #include "ibusproplist.h"
24 #include "ibusenumtypes.h"
25
26 enum {
27     LAST_SIGNAL,
28 };
29
30 enum {
31     PROP_0 = 0,
32     PROP_KEY,
33     PROP_ICON,
34     PROP_LABEL,
35     PROP_SYMBOL,
36     PROP_TOOLTIP,
37     PROP_SENSITIVE,
38     PROP_VISIBLE,
39     PROP_PROP_TYPE,
40     PROP_STATE,
41     PROP_SUB_PROPS,
42 };
43
44 /* _IBusPropertyPrivate */
45 struct _IBusPropertyPrivate {
46     gchar    *key;
47     gchar    *icon;
48     IBusText *label;
49     IBusText *symbol;
50     IBusText *tooltip;
51
52     gboolean sensitive;
53     gboolean visible;
54     IBusPropType type;
55     IBusPropState state;
56
57     IBusPropList *sub_props;
58 };
59
60 #define IBUS_PROPERTY_GET_PRIVATE(o)  \
61    (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_PROPERTY, IBusPropertyPrivate))
62
63 /* functions prototype */
64 static void         ibus_property_set_property  (IBusProperty       *prop,
65                                                  guint               prop_id,
66                                                  const GValue       *value,
67                                                  GParamSpec         *pspec);
68 static void         ibus_property_get_property  (IBusProperty       *prop,
69                                                  guint               prop_id,
70                                                  GValue             *value,
71                                                  GParamSpec         *pspec);
72 static void         ibus_property_destroy       (IBusProperty       *prop);
73 static gboolean     ibus_property_serialize     (IBusProperty       *prop,
74                                                  GVariantBuilder    *builder);
75 static gint         ibus_property_deserialize   (IBusProperty       *prop,
76                                                  GVariant           *variant);
77 static gboolean     ibus_property_copy          (IBusProperty       *dest,
78                                                  const IBusProperty *src);
79
80 G_DEFINE_TYPE (IBusProperty, ibus_property, IBUS_TYPE_SERIALIZABLE)
81
82 static void
83 ibus_property_class_init (IBusPropertyClass *class)
84 {
85     GObjectClass *gobject_class = G_OBJECT_CLASS (class);
86     IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class);
87     IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class);
88
89     g_type_class_add_private (class, sizeof (IBusPropertyPrivate));
90
91     gobject_class->set_property = (GObjectSetPropertyFunc) ibus_property_set_property;
92     gobject_class->get_property = (GObjectGetPropertyFunc) ibus_property_get_property;
93
94     object_class->destroy = (IBusObjectDestroyFunc) ibus_property_destroy;
95
96     serializable_class->serialize   = (IBusSerializableSerializeFunc) ibus_property_serialize;
97     serializable_class->deserialize = (IBusSerializableDeserializeFunc) ibus_property_deserialize;
98     serializable_class->copy        = (IBusSerializableCopyFunc) ibus_property_copy;
99
100     /* install properties */
101     /**
102      * IBusPropert:key:
103      *
104      * The key of property
105      */
106     g_object_class_install_property (gobject_class,
107             PROP_KEY,
108             g_param_spec_string ("key",
109                     "key",
110                     "The key of property",
111                     "",
112                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
113
114     /**
115      * IBusPropert:icon:
116      *
117      * The icon of property
118      */
119     g_object_class_install_property (gobject_class,
120             PROP_ICON,
121             g_param_spec_string ("icon",
122                     "icon",
123                     "The icon of property",
124                     "",
125                     G_PARAM_READWRITE));
126
127     /**
128      * IBusPropert:label:
129      *
130      * The label of property
131      */
132     g_object_class_install_property (gobject_class,
133             PROP_LABEL,
134             g_param_spec_object("label",
135                     "label",
136                     "The label of property",
137                     IBUS_TYPE_TEXT,
138                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
139
140     /**
141      * IBusPropert:symbol:
142      *
143      * The symbol of property
144      */
145     g_object_class_install_property (gobject_class,
146             PROP_SYMBOL,
147             g_param_spec_object("symbol",
148                     "symbol",
149                     "The symbol of property",
150                     IBUS_TYPE_TEXT,
151                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
152
153     /**
154      * IBusPropert:tooltip:
155      *
156      * The tooltip of property
157      */
158     g_object_class_install_property (gobject_class,
159             PROP_TOOLTIP,
160             g_param_spec_object("tooltip",
161                     "tooltip",
162                     "The tooltip of property",
163                     IBUS_TYPE_TEXT,
164                     G_PARAM_READWRITE));
165
166     /**
167      * IBusPropert:sensitive:
168      *
169      * The sensitive of property
170      */
171     g_object_class_install_property (gobject_class,
172             PROP_SENSITIVE,
173             g_param_spec_boolean("sensitive",
174                     "sensitive",
175                     "The sensitive of property",
176                     TRUE,
177                     G_PARAM_READWRITE));
178
179     /**
180      * IBusPropert:visible:
181      *
182      * The visible of property
183      */
184     g_object_class_install_property (gobject_class,
185             PROP_VISIBLE,
186             g_param_spec_boolean("visible",
187                     "visible",
188                     "The visible of property",
189                     TRUE,
190                     G_PARAM_READWRITE));
191
192     /**
193      * IBusPropert:type:
194      *
195      * The type of property
196      */
197     g_object_class_install_property (gobject_class,
198             PROP_PROP_TYPE,
199             g_param_spec_enum("prop-type",
200                     "prop-type",
201                     "The type of property",
202                     IBUS_TYPE_PROP_TYPE,
203                     PROP_TYPE_NORMAL,
204                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
205     /**
206      * IBusPropert:state:
207      *
208      * The state of property
209      */
210     g_object_class_install_property (gobject_class,
211             PROP_STATE,
212             g_param_spec_enum("state",
213                     "state",
214                     "The state of property",
215                     IBUS_TYPE_PROP_STATE,
216                     PROP_STATE_UNCHECKED,
217                     G_PARAM_READWRITE));
218
219     /**
220      * IBusPropert:sub-props:
221      *
222      * The sub properties of property
223      */
224     g_object_class_install_property (gobject_class,
225             PROP_SUB_PROPS,
226             g_param_spec_object("sub-props",
227                     "sub properties",
228                     "The sub properties of property",
229                     IBUS_TYPE_PROP_LIST,
230                     G_PARAM_READWRITE));
231 }
232
233 static void
234 ibus_property_init (IBusProperty *prop)
235 {
236     prop->priv = IBUS_PROPERTY_GET_PRIVATE (prop);
237
238     ibus_property_set_label (prop, NULL);
239     ibus_property_set_symbol (prop, NULL);
240     ibus_property_set_tooltip (prop, NULL);
241     ibus_property_set_sub_props (prop, NULL);
242
243 }
244 static void
245 ibus_property_set_property (IBusProperty *prop,
246                             guint         prop_id,
247                             const GValue *value,
248                             GParamSpec   *pspec)
249 {
250     switch (prop_id) {
251     case PROP_KEY:
252         g_assert (prop->priv->key == NULL);
253         prop->priv->key = g_value_dup_string (value);
254         break;
255     case PROP_ICON:
256         ibus_property_set_icon (prop, g_value_get_string (value));
257         break;
258     case PROP_LABEL:
259         ibus_property_set_label (prop, g_value_get_object (value));
260         break;
261     case PROP_SYMBOL:
262         ibus_property_set_symbol (prop, g_value_get_object (value));
263         break;
264     case PROP_TOOLTIP:
265         ibus_property_set_tooltip (prop, g_value_get_object (value));
266         break;
267     case PROP_SENSITIVE:
268         ibus_property_set_sensitive (prop, g_value_get_boolean (value));
269         break;
270     case PROP_VISIBLE:
271         ibus_property_set_visible (prop, g_value_get_boolean (value));
272         break;
273     case PROP_PROP_TYPE:
274         prop->priv->type = g_value_get_enum (value);
275         break;
276     case PROP_STATE:
277         ibus_property_set_state (prop, g_value_get_enum (value));
278         break;
279     case PROP_SUB_PROPS:
280         ibus_property_set_sub_props (prop,
281                 (IBusPropList *)g_value_get_object (value));
282         break;
283     default:
284         G_OBJECT_WARN_INVALID_PROPERTY_ID (prop, prop_id, pspec);
285     }
286 }
287
288 static void
289 ibus_property_get_property (IBusProperty *prop,
290                             guint         prop_id,
291                             GValue       *value,
292                             GParamSpec   *pspec)
293 {
294     switch (prop_id) {
295     case PROP_KEY:
296         g_value_set_string (value, ibus_property_get_key (prop));
297         break;
298     case PROP_ICON:
299         g_value_set_string (value, ibus_property_get_icon (prop));
300         break;
301     case PROP_LABEL:
302         g_value_set_object (value, ibus_property_get_label (prop));
303         break;
304     case PROP_SYMBOL:
305         g_value_set_object (value, ibus_property_get_symbol (prop));
306         break;
307     case PROP_TOOLTIP:
308         g_value_set_object (value, ibus_property_get_tooltip (prop));
309         break;
310     case PROP_SENSITIVE:
311         g_value_set_boolean (value, ibus_property_get_sensitive (prop));
312         break;
313     case PROP_VISIBLE:
314         g_value_set_boolean (value, ibus_property_get_visible (prop));
315         break;
316     case PROP_PROP_TYPE:
317         g_value_set_enum (value, ibus_property_get_prop_type (prop));
318         break;
319     case PROP_STATE:
320         g_value_set_enum (value, ibus_property_get_state (prop));
321         break;
322     case PROP_SUB_PROPS:
323         g_value_set_object (value, ibus_property_get_sub_props (prop));
324         break;
325     default:
326         G_OBJECT_WARN_INVALID_PROPERTY_ID (prop, prop_id, pspec);
327     }
328 }
329
330 static void
331 ibus_property_destroy (IBusProperty *prop)
332 {
333     g_free (prop->priv->key);
334     prop->priv->key = NULL;
335
336     g_free (prop->priv->icon);
337     prop->priv->icon = NULL;
338
339     if (prop->priv->label) {
340         g_object_unref (prop->priv->label);
341         prop->priv->label = NULL;
342     }
343
344     if (prop->priv->symbol) {
345         g_object_unref (prop->priv->symbol);
346         prop->priv->symbol = NULL;
347     }
348
349     if (prop->priv->tooltip) {
350         g_object_unref (prop->priv->tooltip);
351         prop->priv->tooltip = NULL;
352     }
353
354     if (prop->priv->sub_props) {
355         g_object_unref (prop->priv->sub_props);
356         prop->priv->sub_props = NULL;
357     }
358
359     IBUS_OBJECT_CLASS (ibus_property_parent_class)->destroy ((IBusObject *)prop);
360 }
361
362 gboolean
363 ibus_property_serialize (IBusProperty    *prop,
364                          GVariantBuilder *builder)
365 {
366     gboolean retval;
367
368     retval = IBUS_SERIALIZABLE_CLASS (ibus_property_parent_class)->serialize ((IBusSerializable *) prop, builder);
369     g_return_val_if_fail (retval, FALSE);
370
371     g_return_val_if_fail (IBUS_IS_PROPERTY (prop), FALSE);
372
373     g_variant_builder_add (builder, "s", prop->priv->key);
374     g_variant_builder_add (builder, "u", prop->priv->type);
375     g_variant_builder_add (builder, "v",
376             ibus_serializable_serialize ((IBusSerializable *)prop->priv->label));
377     g_variant_builder_add (builder, "s", prop->priv->icon);
378     g_variant_builder_add (builder, "v",
379             ibus_serializable_serialize ((IBusSerializable *)prop->priv->tooltip));
380     g_variant_builder_add (builder, "b", prop->priv->sensitive);
381     g_variant_builder_add (builder, "b", prop->priv->visible);
382     g_variant_builder_add (builder, "u", prop->priv->state);
383     g_variant_builder_add (builder, "v",
384             ibus_serializable_serialize ((IBusSerializable *)prop->priv->sub_props));
385     /* Keep the serialized order for the compatibility when add new members. */
386     g_variant_builder_add (builder, "v",
387             ibus_serializable_serialize ((IBusSerializable *)prop->priv->symbol));
388
389     return TRUE;
390 }
391
392 static gint
393 ibus_property_deserialize (IBusProperty *prop,
394                            GVariant     *variant)
395 {
396     gint retval;
397
398     retval = IBUS_SERIALIZABLE_CLASS (ibus_property_parent_class)->deserialize ((IBusSerializable *) prop, variant);
399     g_return_val_if_fail (retval, 0);
400
401     g_variant_get_child (variant, retval++, "s", &prop->priv->key);
402     g_variant_get_child (variant, retval++, "u", &prop->priv->type);
403
404     GVariant *subvar = g_variant_get_child_value (variant, retval++);
405     prop->priv->label = IBUS_TEXT (ibus_serializable_deserialize (subvar));
406     g_object_ref_sink (prop->priv->label);
407     g_variant_unref (subvar);
408
409     g_variant_get_child (variant, retval++, "s", &prop->priv->icon);
410
411     subvar = g_variant_get_child_value (variant, retval++);
412     prop->priv->tooltip = IBUS_TEXT (ibus_serializable_deserialize (subvar));
413     g_object_ref_sink (prop->priv->tooltip);
414     g_variant_unref (subvar);
415
416     g_variant_get_child (variant, retval++, "b", &prop->priv->sensitive);
417     g_variant_get_child (variant, retval++, "b", &prop->priv->visible);
418     g_variant_get_child (variant, retval++, "u", &prop->priv->state);
419
420     subvar = g_variant_get_child_value (variant, retval++);
421     prop->priv->sub_props = IBUS_PROP_LIST (ibus_serializable_deserialize (subvar));
422     g_object_ref_sink (prop->priv->sub_props);
423     g_variant_unref (subvar);
424
425     /* Keep the serialized order for the compatibility when add new members. */
426     subvar = g_variant_get_child_value (variant, retval++);
427     prop->priv->symbol = IBUS_TEXT (ibus_serializable_deserialize (subvar));
428     g_object_ref_sink (prop->priv->symbol);
429     g_variant_unref (subvar);
430
431     return retval;
432 }
433
434 static gboolean
435 ibus_property_copy (IBusProperty       *dest,
436                     const IBusProperty *src)
437 {
438     gboolean retval;
439
440     retval = IBUS_SERIALIZABLE_CLASS (ibus_property_parent_class)->copy ((IBusSerializable *) dest, (IBusSerializable *) src);
441     g_return_val_if_fail (retval, FALSE);
442
443     g_return_val_if_fail (IBUS_IS_PROPERTY (dest), FALSE);
444     g_return_val_if_fail (IBUS_IS_PROPERTY (src), FALSE);
445
446     dest->priv->key = g_strdup (src->priv->key);
447     dest->priv->icon = g_strdup (src->priv->icon);
448     if (src->priv->label) {
449         dest->priv->label = (IBusText *) ibus_serializable_copy ((IBusSerializable *) src->priv->label);
450     }
451     else
452         dest->priv->label = ibus_text_new_from_static_string ("");
453     if (src->priv->symbol) {
454         dest->priv->symbol = (IBusText *) ibus_serializable_copy ((IBusSerializable *) src->priv->symbol);
455     }
456     else
457         dest->priv->symbol = ibus_text_new_from_static_string ("");
458     if (src->priv->tooltip) {
459         dest->priv->tooltip = (IBusText *) ibus_serializable_copy ((IBusSerializable *) src->priv->tooltip);
460     }
461     else
462         dest->priv->tooltip = ibus_text_new_from_static_string ("");
463
464     dest->priv->sensitive = src->priv->sensitive;
465     dest->priv->visible = src->priv->visible;
466     dest->priv->type = src->priv->type;
467     dest->priv->state = src->priv->state;
468
469     dest->priv->sub_props = (IBusPropList *) ibus_serializable_copy ((IBusSerializable *) src->priv->sub_props);
470
471     return TRUE;
472 }
473
474 IBusProperty *
475 ibus_property_new (const gchar   *key,
476                    IBusPropType   type,
477                    IBusText      *label,
478                    const gchar   *icon,
479                    IBusText      *tooltip,
480                    gboolean       sensitive,
481                    gboolean       visible,
482                    IBusPropState  state,
483                    IBusPropList  *props)
484 {
485     g_return_val_if_fail (key != NULL, NULL);
486     g_return_val_if_fail (type >= PROP_TYPE_NORMAL &&
487                           type <= PROP_TYPE_SEPARATOR,
488                           NULL);
489
490     return ibus_property_new_varargs ("key", key,
491                                       "prop-type", type,
492                                       "label", label,
493                                       "icon", icon,
494                                       "tooltip", tooltip,
495                                       "sensitive", sensitive,
496                                       "visible", visible,
497                                       "state", state,
498                                       "sub-props", props,
499                                       NULL);
500 }
501
502 IBusProperty *
503 ibus_property_new_varargs (const gchar *first_property_name, ...)
504 {
505     va_list var_args;
506     IBusProperty *prop;
507
508     g_assert (first_property_name);
509
510     va_start (var_args, first_property_name);
511     prop = (IBusProperty *) g_object_new_valist (IBUS_TYPE_PROPERTY,
512                                                  first_property_name,
513                                                  var_args);
514     va_end (var_args);
515
516     g_assert (prop->priv->key);
517     g_assert (prop->priv->type >= PROP_TYPE_NORMAL &&
518               prop->priv->type <= PROP_TYPE_SEPARATOR);
519
520     return prop;
521 }
522
523 #define IBUS_PROPERTY_GET_FIELD(field, return_type) \
524 return_type                                                             \
525 ibus_property_get_ ## field (IBusProperty *prop)                        \
526 {                                                                       \
527     return prop->priv->field;                                           \
528 }
529
530 IBUS_PROPERTY_GET_FIELD (key, const gchar *)
531 IBUS_PROPERTY_GET_FIELD (icon, const gchar *)
532 IBUS_PROPERTY_GET_FIELD (label, IBusText *)
533 IBUS_PROPERTY_GET_FIELD (symbol, IBusText *)
534 IBUS_PROPERTY_GET_FIELD (tooltip, IBusText *)
535 IBUS_PROPERTY_GET_FIELD (sensitive, gboolean)
536 IBUS_PROPERTY_GET_FIELD (visible, gboolean)
537 IBUS_PROPERTY_GET_FIELD (state, IBusPropState)
538 IBUS_PROPERTY_GET_FIELD (sub_props, IBusPropList *)
539 #undef IBUS_PROPERTY_GET_FIELD
540
541 /* ibus_property_get_type() exists */
542 IBusPropType
543 ibus_property_get_prop_type (IBusProperty *prop)
544 {
545     g_assert (IBUS_IS_PROPERTY (prop));
546     return prop->priv->type;
547 }
548
549 void
550 ibus_property_set_label (IBusProperty *prop,
551                          IBusText     *label)
552 {
553     g_assert (IBUS_IS_PROPERTY (prop));
554     g_return_if_fail (label == NULL || IBUS_IS_TEXT (label));
555
556     if (prop->priv->label) {
557         g_object_unref (prop->priv->label);
558     }
559
560     if (label == NULL) {
561         prop->priv->label = ibus_text_new_from_static_string ("");
562     }
563     else {
564         prop->priv->label = g_object_ref_sink (label);
565     }
566 }
567
568 void
569 ibus_property_set_symbol (IBusProperty *prop,
570                           IBusText     *symbol)
571 {
572     g_assert (IBUS_IS_PROPERTY (prop));
573     g_return_if_fail (symbol == NULL || IBUS_IS_TEXT (symbol));
574
575     if (prop->priv->symbol) {
576         g_object_unref (prop->priv->symbol);
577     }
578
579     if (symbol == NULL) {
580         prop->priv->symbol = ibus_text_new_from_static_string ("");
581     }
582     else {
583         prop->priv->symbol = g_object_ref_sink (symbol);
584     }
585 }
586
587 void
588 ibus_property_set_icon (IBusProperty *prop,
589                         const gchar  *icon)
590 {
591     g_assert (IBUS_IS_PROPERTY (prop));
592
593     g_free (prop->priv->icon);
594     prop->priv->icon = g_strdup (icon != NULL ? icon : "");
595 }
596
597 void
598 ibus_property_set_tooltip (IBusProperty *prop,
599                            IBusText     *tooltip)
600 {
601     g_assert (IBUS_IS_PROPERTY (prop));
602     g_assert (tooltip == NULL || IBUS_IS_TEXT (tooltip));
603
604     IBusPropertyPrivate *priv = prop->priv;
605
606     if (priv->tooltip) {
607         g_object_unref (priv->tooltip);
608     }
609
610     if (tooltip == NULL) {
611         priv->tooltip = ibus_text_new_from_static_string ("");
612         g_object_ref_sink (priv->tooltip);
613     }
614     else {
615         priv->tooltip = tooltip;
616         g_object_ref_sink (priv->tooltip);
617     }
618 }
619
620 void
621 ibus_property_set_sensitive (IBusProperty *prop,
622                              gboolean      sensitive)
623 {
624     g_assert (IBUS_IS_PROPERTY (prop));
625     prop->priv->sensitive = sensitive;
626 }
627
628 void
629 ibus_property_set_visible (IBusProperty *prop,
630                            gboolean      visible)
631 {
632     g_assert (IBUS_IS_PROPERTY (prop));
633     prop->priv->visible = visible;
634 }
635
636 void
637 ibus_property_set_state (IBusProperty  *prop,
638                          IBusPropState  state)
639 {
640     g_assert (IBUS_IS_PROPERTY (prop));
641     g_assert (state == PROP_STATE_UNCHECKED ||
642               state == PROP_STATE_CHECKED ||
643               state == PROP_STATE_INCONSISTENT);
644
645     prop->priv->state = state;
646 }
647
648 void
649 ibus_property_set_sub_props (IBusProperty *prop,
650                              IBusPropList *prop_list)
651 {
652     g_assert (IBUS_IS_PROPERTY (prop));
653     g_assert (IBUS_IS_PROP_LIST (prop_list) || prop_list == NULL);
654
655     IBusPropertyPrivate *priv = prop->priv;
656
657     if (priv->sub_props) {
658         g_object_unref (priv->sub_props);
659     }
660
661     if (prop_list) {
662         priv->sub_props = prop_list;
663         g_object_ref_sink (prop_list);
664     }
665     else {
666         priv->sub_props = ibus_prop_list_new ();
667         g_object_ref_sink (priv->sub_props);
668     }
669 }
670
671 gboolean
672 ibus_property_update (IBusProperty *prop,
673                       IBusProperty *prop_update)
674 {
675     g_assert (IBUS_IS_PROPERTY (prop));
676     g_assert (IBUS_IS_PROPERTY (prop_update));
677
678     IBusPropertyPrivate *priv = prop->priv;
679     IBusPropertyPrivate *priv_update = prop_update->priv;
680
681     if (g_strcmp0 (priv->key, priv_update->key) != 0) {
682         return ibus_prop_list_update_property (priv->sub_props, prop_update);
683     }
684
685     /* Do not support update prop type */
686     g_assert (priv->type == priv_update->type);
687
688     ibus_property_set_icon (prop, ibus_property_get_icon (prop_update));
689     ibus_property_set_label (prop, ibus_property_get_label (prop_update));
690     ibus_property_set_symbol (prop, ibus_property_get_symbol (prop_update));
691     ibus_property_set_tooltip (prop, ibus_property_get_tooltip (prop_update));
692     ibus_property_set_visible (prop, ibus_property_get_visible (prop_update));
693     ibus_property_set_state (prop, ibus_property_get_state (prop_update));
694     ibus_property_set_sensitive (prop, ibus_property_get_sensitive (prop_update));
695
696     /* Do not support update sub props */
697
698     return TRUE;
699 }
700
701