summaryrefslogtreecommitdiffstats
path: root/lib/gtk2
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-10-03 00:08:18 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-10-03 00:08:18 +0800
commit927200df0bb7f559110dd624d2e52412220447d8 (patch)
tree0381e014d4a6367062c8d36aa5c362781943dd98 /lib/gtk2
parent6f23b8b88dc103021f301a0e889739081547cf94 (diff)
downloadibus-927200df0bb7f559110dd624d2e52412220447d8.tar.gz
ibus-927200df0bb7f559110dd624d2e52412220447d8.tar.xz
ibus-927200df0bb7f559110dd624d2e52412220447d8.zip
Refine coding style.
Diffstat (limited to 'lib/gtk2')
-rw-r--r--lib/gtk2/ibusattribute.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gtk2/ibusattribute.c b/lib/gtk2/ibusattribute.c
index c693d65..f94a93f 100644
--- a/lib/gtk2/ibusattribute.c
+++ b/lib/gtk2/ibusattribute.c
@@ -35,9 +35,11 @@ ibus_attribute_get_type ()
IBusAttribute *
ibus_attribute_new (guint type, guint value, guint start_index, guint end_index)
{
- g_return_val_if_fail (type == IBUS_ATTR_TYPE_UNDERLINE ||
+ g_return_val_if_fail (
+ type == IBUS_ATTR_TYPE_UNDERLINE ||
type == IBUS_ATTR_TYPE_FOREGROUND ||
type == IBUS_ATTR_TYPE_BACKGROUND, NULL);
+
IBusAttribute *attr = g_slice_new (IBusAttribute);
attr->type = type;
attr->value = value;
@@ -63,10 +65,12 @@ ibus_attribute_free (IBusAttribute *attr)
IBusAttribute *
ibus_attr_underline_new (guint underline_type, guint start_index, guint end_index)
{
- g_return_val_if_fail (underline_type == IBUS_ATTR_UNDERLINE_NONE ||
+ g_return_val_if_fail (
+ underline_type == IBUS_ATTR_UNDERLINE_NONE ||
underline_type == IBUS_ATTR_UNDERLINE_SINGLE ||
underline_type == IBUS_ATTR_UNDERLINE_DOUBLE ||
underline_type == IBUS_ATTR_UNDERLINE_LOW, NULL);
+
return ibus_attribute_new (IBUS_ATTR_TYPE_UNDERLINE, underline_type, start_index, end_index);
}