Commit 866372c5 authored by Christian Hergert's avatar Christian Hergert

signature: improve signal signatures

parent 8b10611b
......@@ -1161,6 +1161,7 @@ girst_parser_object_get_signature (GirstParserObject *self)
{
g_autoptr(GString) str = NULL;
g_autoptr(GString) param_str = NULL;
const gchar *container_c_type = NULL;
g_autofree gchar *formatted = NULL;
GirstParserObject *return_value;
GirstParserObject *params;
......@@ -1173,10 +1174,13 @@ girst_parser_object_get_signature (GirstParserObject *self)
if (!GIRST_IS_FUNCTION (self) &&
!GIRST_IS_CALLBACK (self) &&
!GIRST_IS_CONSTRUCTOR (self) &&
!GIRST_IS_GLIB_SIGNAL (self) &&
!GIRST_IS_VIRTUAL_METHOD (self) &&
!GIRST_IS_METHOD (self))
return NULL;
container_c_type = find_object_c_type (self);
str = g_string_new (NULL);
param_str = g_string_new (NULL);
......@@ -1226,6 +1230,10 @@ girst_parser_object_get_signature (GirstParserObject *self)
g_string_append_printf (str, "%s ", c_identifier);
}
else if (GIRST_IS_GLIB_SIGNAL (self))
{
g_string_append (str, "user_function ");
}
else if (GIRST_IS_VIRTUAL_METHOD (self))
{
const gchar *c_identifier = girst_virtual_method_get_c_identifier (GIRST_VIRTUAL_METHOD (self));
......@@ -1250,7 +1258,11 @@ girst_parser_object_get_signature (GirstParserObject *self)
params = girst_parser_object_first_typed (self, GIRST_TYPE_PARAMETERS);
if (params == NULL)
if (GIRST_IS_GLIB_SIGNAL (self))
{
g_string_append_printf (param_str, "%s *self, ", container_c_type);
}
else if (params == NULL)
{
g_string_append (str, "void");
goto cleanup;
......@@ -1283,6 +1295,9 @@ girst_parser_object_get_signature (GirstParserObject *self)
g_string_append_printf (param_str, "%s %s, ", c_type, name);
}
if (GIRST_IS_GLIB_SIGNAL (self))
g_string_append (param_str, "gpointer user_data, ");
if (param_str->len > 2)
g_string_truncate (param_str, param_str->len - 2);
......
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