- It seems python does not allow to use 'exec' as a variable.
Renamed 'exec' property so that the constructor in IBus.Component is used.
- It seems the python virtual method is available when the function is
described in header files in case that annotations are needed so
the signal function ibus_factory_create_engine is added newly.
TEST=Linux desktop
Review URL: https://codereview.appspot.com/5649082
* @value: Value of the attribute.
* @start_index: Where attribute starts.
* @end_index: Where attribute ends.
- * @returns: A newly allocated IBusAttribute.
+ * @returns: (transfer none): A newly allocated IBusAttribute.
*
* New an IBusAttribute.
*/
* @underline_type: Type of underline.
* @start_index: Where attribute starts.
* @end_index: Where attribute ends.
- * @returns: A newly allocated #IBusAttribute.
+ * @returns: (transfer none): A newly allocated #IBusAttribute.
*
* New an underline #IBusAttribute.
*/
* @color: Color in RGB.
* @start_index: Where attribute starts.
* @end_index: Where attribute ends.
- * @returns: A newly allocated #IBusAttribute.
+ * @returns: (transfer none): A newly allocated #IBusAttribute.
*
* New an foreground #IBusAttribute.
*/
* @color: Color in RGB.
* @start_index: Where attribute starts.
* @end_index: Where attribute ends.
- * @returns: A newly allocated #IBusAttribute.
+ * @returns: (transfer none): A newly allocated #IBusAttribute.
*
* New an background #IBusAttribute.
*/
PROP_LICENSE,
PROP_AUTHOR,
PROP_HOMEPAGE,
- PROP_EXEC,
+ PROP_COMMAND_LINE,
PROP_TEXTDOMAIN,
};
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/**
- * IBusComponent:exec:
+ * IBusComponent:command-line:
*
* The exec path of component
*/
g_object_class_install_property (gobject_class,
- PROP_EXEC,
- g_param_spec_string ("exec",
- "component exec",
- "The exec path of component",
+ PROP_COMMAND_LINE,
+ g_param_spec_string ("command-line",
+ "component command-line",
+ "The command line of component",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_assert (component->priv->homepage == NULL);
component->priv->homepage = g_value_dup_string (value);
break;
- case PROP_EXEC:
+ case PROP_COMMAND_LINE:
g_assert (component->priv->exec == NULL);
component->priv->exec = g_value_dup_string (value);
break;
case PROP_HOMEPAGE:
g_value_set_string (value, ibus_component_get_homepage (component));
break;
- case PROP_EXEC:
+ case PROP_COMMAND_LINE:
g_value_set_string (value, ibus_component_get_exec (component));
break;
case PROP_TEXTDOMAIN:
const gchar *license,
const gchar *author,
const gchar *homepage,
- const gchar *exec,
+ const gchar *command_line,
const gchar *textdomain)
{
return ibus_component_new_varargs ("name", name,
"license", license,
"author", author,
"homepage", homepage,
- "exec", exec,
+ "command-line", command_line,
"textdomain", textdomain,
NULL);
}
* license: Distribution license of this component.
* author: Author(s) of the component.
* homepage: Homepage of the component.
- * exec: path to component executable.
+ * command_line: path to component executable.
* textdomain: Domain name for dgettext()
*/
struct _IBusComponent {
* @license: Distribution license of this component.
* @author: Author(s) of the component.
* @homepage: Homepage of the component.
- * @exec: path to component executable.
+ * @command_line: path to component executable.
* @textdomain: Domain name for dgettext()
* @returns: A newly allocated IBusComponent.
*
const gchar *license,
const gchar *author,
const gchar *homepage,
- const gchar *exec,
+ const gchar *command_line,
const gchar *textdomain);
/**
* ibus_component_new_varargs() supports the va_list format.
* name property is required. e.g.
* IBusComponent *component = ibus_component_new_varargs ("name", "ibus-foo",
- * "exec", "/usr/libexec/ibus-engine-foo --ibus",
+ * "command_line", "/usr/libexec/ibus-engine-foo --ibus",
* NULL)
*/
IBusComponent *ibus_component_new_varargs (const gchar *first_property_name,
"</node>";
static IBusEngine *
-_ibus_factory_create_engine (IBusFactory *factory,
- const gchar *engine_name)
+ibus_factory_real_create_engine (IBusFactory *factory,
+ const gchar *engine_name)
{
GType engine_type;
gchar *object_path = NULL;
IBUS_SERVICE_CLASS (class)->service_method_call = ibus_factory_service_method_call;
IBUS_SERVICE_CLASS (class)->service_get_property = ibus_factory_service_get_property;
IBUS_SERVICE_CLASS (class)->service_set_property = ibus_factory_service_set_property;
- class->create_engine = _ibus_factory_create_engine;
+ class->create_engine = ibus_factory_real_create_engine;
ibus_service_class_add_interfaces (IBUS_SERVICE_CLASS (class), introspection_xml);
g_hash_table_insert (factory->priv->engine_table, g_strdup (engine_name), (gpointer) engine_type);
}
+
+IBusEngine *
+ibus_factory_create_engine (IBusFactory *factory,
+ const gchar *engine_name)
+{
+ IBusEngine *engine = NULL;
+
+ g_assert (engine_name != NULL);
+
+ g_signal_emit (factory, factory_signals[CREATE_ENGINE],
+ 0, engine_name, &engine);
+
+ return engine;
+}
const gchar *engine_name,
GType engine_type);
+/**
+ * ibus_factory_create_engine:
+ * @factory: An #IBusFactory.
+ * @engine_name: Name of an engine.
+ * @returns: (transfer full): #IBusEngine with @engine_name.
+ *
+ * Create an #IBusEngine with @engine_name.
+ */
+IBusEngine *ibus_factory_create_engine (IBusFactory *factory,
+ const gchar *engine_name);
+
G_END_DECLS
#endif