| OLD | NEW |
| 1 /* vim:set et sts=4: */ | 1 /* vim:set et sts=4: */ |
| 2 /* ibus - The Input Bus | 2 /* ibus - The Input Bus |
| 3 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com> | 3 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com> |
| 4 * Copyright (C) 2008-2010 Red Hat, Inc. | 4 * Copyright (C) 2008-2010 Red Hat, Inc. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 gboolean retval; | 294 gboolean retval; |
| 295 | 295 |
| 296 retval = ibus_proxy_call ((IBusProxy *) config, | 296 retval = ibus_proxy_call ((IBusProxy *) config, |
| 297 "Unset", | 297 "Unset", |
| 298 G_TYPE_STRING, §ion, | 298 G_TYPE_STRING, §ion, |
| 299 G_TYPE_STRING, &name, | 299 G_TYPE_STRING, &name, |
| 300 G_TYPE_INVALID); | 300 G_TYPE_INVALID); |
| 301 g_assert (retval); | 301 g_assert (retval); |
| 302 return TRUE; | 302 return TRUE; |
| 303 } | 303 } |
| 304 |
| 305 gboolean |
| 306 ibus_config_get_unused (IBusConfig *config, |
| 307 GValue *unread, |
| 308 GValue *unwritten) |
| 309 { |
| 310 g_assert (IBUS_IS_CONFIG (config)); |
| 311 g_assert (unread != NULL); |
| 312 g_assert (unwritten != NULL); |
| 313 |
| 314 IBusMessage *reply; |
| 315 IBusError *error; |
| 316 gboolean retval; |
| 317 |
| 318 reply = ibus_proxy_call_with_reply_and_block ((IBusProxy *) config, |
| 319 "GetUnused", |
| 320 -1, |
| 321 &error, |
| 322 G_TYPE_INVALID); |
| 323 if (reply == NULL) { |
| 324 g_warning ("%s: %s", error->name, error->message); |
| 325 ibus_error_free (error); |
| 326 return FALSE; |
| 327 } |
| 328 |
| 329 if ((error = ibus_error_new_from_message (reply)) != NULL) { |
| 330 g_warning ("%s: %s", error->name, error->message); |
| 331 ibus_error_free (error); |
| 332 ibus_message_unref (reply); |
| 333 return FALSE; |
| 334 } |
| 335 |
| 336 retval = ibus_message_get_args (reply, |
| 337 &error, |
| 338 G_TYPE_VALUE, unread, |
| 339 G_TYPE_VALUE, unwritten, |
| 340 G_TYPE_INVALID); |
| 341 ibus_message_unref (reply); |
| 342 if (!retval) { |
| 343 g_warning ("%s: %s", error->name, error->message); |
| 344 return FALSE; |
| 345 } |
| 346 |
| 347 return TRUE; |
| 348 } |
| OLD | NEW |