Skip to content

Commit

Permalink
Fixed gchar* callbacks param
Browse files Browse the repository at this point in the history
  • Loading branch information
scorninpc committed Jun 1, 2022
1 parent a6533f5 commit 295d321
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/G/GObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,26 +158,35 @@ bool GObject_::connect_callback(gpointer user_data, ...)
// Loop into param_types of GSignalQuery from g_signal_query
for (int i=0; i<param_count; i++) {

// Php::call("var_dump", g_type_name(callback_object->param_types[i]));

switch (G_TYPE_FUNDAMENTAL(callback_object->param_types[i])) {
case G_TYPE_CHAR:
// Php::call("var_dump", "char");
break;

case G_TYPE_UCHAR:
// Php::call("var_dump", "uchar");
break;

case G_TYPE_STRING:
// Php::call("var_dump", "string");
internal_parameters[i+1] = va_arg(ap, char *);
break;

case G_TYPE_BOOLEAN:
// Php::call("var_dump", "boolean");
internal_parameters[i+1] = va_arg(ap, gboolean);
break;

case G_TYPE_INT:
// Php::call("var_dump", "int");
internal_parameters[i+1] = va_arg(ap, gint);
break;

case G_TYPE_OBJECT:
{

// Php::call("var_dump", "object");
gpointer *e = va_arg(ap, gpointer *);

// Create event from callback
Expand All @@ -189,7 +198,7 @@ bool GObject_::connect_callback(gpointer user_data, ...)
break;
}
case G_TYPE_POINTER:
// Php::call("var_dump", "gpointer");
// Php::call("var_dump", "pointer");
break;
case G_TYPE_INTERFACE:
// Php::call("var_dump", "interface");
Expand All @@ -201,7 +210,6 @@ bool GObject_::connect_callback(gpointer user_data, ...)
{
// Php::call("var_dump", "boxed");


GdkEvent *e = va_arg(ap, GdkEvent *);

// Create event from callback
Expand Down

0 comments on commit 295d321

Please sign in to comment.