snippets: update ginterface snippet

parent 849714a4
......@@ -215,6 +215,8 @@ camel_str = ''
for t in components:
camel_str += t.capitalize()
>
G_DEFINE_INTERFACE ($<[1]: return camel_str >, $<[1]: return low_str >, ${2:G_TYPE_OBJECT})
/* Default implementation */
static const gchar *
$<[1]: return low_str>_example_method_default ($<[1]: return camel_str > *self)
......@@ -243,36 +245,6 @@ $<[1]: return low_str>_example_method ($<[1]: return camel_str > *self)
{
g_return_val_if_fail ($<[1]: return up_str> (self), NULL);
return $<[1]: return up_str>_GET_INTERFACE (self)->example_method (self);
}
GType
$<[1]: return low_str>_get_type ()
{
static GType $<[1]: return low_str>_type_id = 0;
if (!$<[1]: return low_str>_type_id)
{
static const GTypeInfo g_define_type_info =
{
sizeof ($<[1]: return camel_str >Iface),
(GBaseInitFunc) $<[1]: return low_str>_init,
NULL,
NULL,
NULL,
NULL,
0,
0,
NULL
};
$<[1]: return low_str>_type_id =
g_type_register_static (G_TYPE_INTERFACE,
"$<[1]: return camel_str>",
&g_define_type_info,
0);
}
return $<[1]: return low_str>_type_id;
}]]></text>
<tag>ginterface</tag>
<description>GObject interface</description>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment