ibus/ibus-771115-property-compatible.patch
2012-01-04 13:32:28 +09:00

164 lines
4.1 KiB
Diff

--- ibus-1.4.0/src/ibusproperty.c.orig 2012-01-04 12:31:08.697335369 +0900
+++ ibus-1.4.0/src/ibusproperty.c 2012-01-04 12:58:07.191725794 +0900
@@ -218,6 +218,17 @@ ibus_property_class_init (IBusPropertyCl
static void
ibus_property_init (IBusProperty *prop)
{
+ prop->key = NULL;
+ prop->type = 0;
+ prop->label = NULL;
+ prop->icon = NULL;
+ prop->tooltip = NULL;
+ prop->sensitive = FALSE;
+ prop->visible = FALSE;
+ prop->state = 0;
+
+ prop->sub_props = NULL;
+
prop->priv = IBUS_PROPERTY_GET_PRIVATE (prop);
ibus_property_set_label (prop, NULL);
@@ -308,6 +319,27 @@ ibus_property_get_property (IBusProperty
static void
ibus_property_destroy (IBusProperty *prop)
{
+ g_free (prop->key);
+ prop->key = NULL;
+
+ g_free (prop->icon);
+ prop->icon = NULL;
+
+ if (prop->label) {
+ g_object_unref (prop->label);
+ prop->label = NULL;
+ }
+
+ if (prop->tooltip) {
+ g_object_unref (prop->tooltip);
+ prop->tooltip = NULL;
+ }
+
+ if (prop->sub_props) {
+ g_object_unref (prop->sub_props);
+ prop->sub_props = NULL;
+ }
+
g_free (prop->priv->key);
prop->priv->key = NULL;
@@ -494,6 +526,17 @@ ibus_property_set_label (IBusProperty *p
g_assert (IBUS_IS_PROPERTY (prop));
g_return_if_fail (label == NULL || IBUS_IS_TEXT (label));
+ if (prop->label) {
+ g_object_unref (prop->label);
+ }
+
+ if (label == NULL) {
+ prop->label = ibus_text_new_from_static_string ("");
+ }
+ else {
+ prop->label = g_object_ref_sink (label);
+ }
+
if (prop->priv->label) {
g_object_unref (prop->priv->label);
}
@@ -512,6 +555,9 @@ ibus_property_set_icon (IBusProperty *pr
{
g_assert (IBUS_IS_PROPERTY (prop));
+ g_free (prop->icon);
+ prop->icon = g_strdup (icon != NULL ? icon : "");
+
g_free (prop->priv->icon);
prop->priv->icon = g_strdup (icon != NULL ? icon : "");
}
@@ -525,6 +571,19 @@ ibus_property_set_tooltip (IBusProperty
IBusPropertyPrivate *priv = prop->priv;
+ if (prop->tooltip) {
+ g_object_unref (prop->tooltip);
+ }
+
+ if (tooltip == NULL) {
+ prop->tooltip = ibus_text_new_from_static_string ("");
+ g_object_ref_sink (prop->tooltip);
+ }
+ else {
+ prop->tooltip = tooltip;
+ g_object_ref_sink (prop->tooltip);
+ }
+
if (priv->tooltip) {
g_object_unref (priv->tooltip);
}
@@ -544,6 +603,7 @@ ibus_property_set_sensitive (IBusPropert
gboolean sensitive)
{
g_assert (IBUS_IS_PROPERTY (prop));
+ prop->sensitive = sensitive;
prop->priv->sensitive = sensitive;
}
@@ -552,6 +612,7 @@ ibus_property_set_visible (IBusProperty
gboolean visible)
{
g_assert (IBUS_IS_PROPERTY (prop));
+ prop->visible = visible;
prop->priv->visible = visible;
}
@@ -564,6 +625,7 @@ ibus_property_set_state (IBusProperty *
state == PROP_STATE_CHECKED ||
state == PROP_STATE_INCONSISTENT);
+ prop->state = state;
prop->priv->state = state;
}
@@ -576,6 +638,19 @@ ibus_property_set_sub_props (IBusPropert
IBusPropertyPrivate *priv = prop->priv;
+ if (prop->sub_props) {
+ g_object_unref (prop->sub_props);
+ }
+
+ if (prop_list) {
+ prop->sub_props = prop_list;
+ g_object_ref_sink (prop_list);
+ }
+ else {
+ prop->sub_props = ibus_prop_list_new ();
+ g_object_ref_sink (prop->sub_props);
+ }
+
if (priv->sub_props) {
g_object_unref (priv->sub_props);
}
--- ibus-1.4.0/src/ibusproperty.h.orig 2012-01-04 12:30:52.189069565 +0900
+++ ibus-1.4.0/src/ibusproperty.h 2012-01-04 12:34:38.101706419 +0900
@@ -140,6 +140,20 @@ typedef struct _IBusPropListClass IBusPr
struct _IBusProperty {
/*< private >*/
IBusSerializable parent;
+
+ /*< public >*/
+ gchar *key;
+ gchar *icon;
+ IBusText *label;
+ IBusText *tooltip;
+
+ gboolean sensitive;
+ gboolean visible;
+ guint type;
+ guint state;
+
+ IBusPropList *sub_props;
+
IBusPropertyPrivate *priv;
gpointer pdummy[7];