pike.git / src / post_modules / GTK2 / source / support.c

version» Context lines:

pike.git/src/post_modules/GTK2/source/support.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: support.c,v 1.13 2006/08/03 16:49:49 ldillon Exp $ + || $Id: support.c,v 1.14 2006/09/05 14:18:19 ldillon Exp $   */      #include <version.h>   #include <bignum.h>   #include <stdarg.h>      #ifndef INIT_VARIABLES   extern struct program *image_color_program;   extern struct program *image_program;   #endif
pike.git/src/post_modules/GTK2/source/support.c:559:   static int pgtk2_push_string_param(const GValue *a) {    const gchar *t=g_value_get_string(a);    if (t)    PGTK_PUSH_GCHAR(t);    else    push_string(empty_pike_string);    return PUSHED_VALUE;   }      static int pgtk2_push_object_param(const GValue *a) { -  GObject *obj=g_value_get_object(a); +  GObject *obj; +  gpointer *gp; +  if (g_type_is_a(G_VALUE_TYPE(a),G_TYPE_BOXED)) { +  gp=g_value_get_boxed(a); +  if (G_VALUE_HOLDS(a,g_type_from_name("GdkColor"))) { +  push_gdkobject(gp,color); +  } else if (G_VALUE_HOLDS(a,g_type_from_name("GtkTreePath"))) { +  pgtk2_push_gobjectclass(gp,pgtk2_tree_path_program); +  } else if (G_VALUE_HOLDS(a,g_type_from_name("GdkRectangle"))) { +  push_gdkobject(gp,rectangle); +  } else if (G_VALUE_HOLDS(a,g_type_from_name("GdkRegion"))) { +  push_gdkobject(gp,region); +  } +  } else { +  obj=g_value_get_object(a);    if (obj) - /* push_gobject(((void *)g_value_get_object(a))); */ +     push_gobject(obj); -  +  }    return PUSHED_VALUE;   }      static int pgtk2_push_pike_object_param(const GValue *a) {    struct object *o=g_value_get_pointer(a);    if (o)    ref_push_object(o);    return PUSHED_VALUE;   }   
pike.git/src/post_modules/GTK2/source/support.c:638:    CB( G_TYPE_UINT, pgtk2_push_int_param );    CB( G_TYPE_LONG, pgtk2_push_int_param );    CB( G_TYPE_ULONG, pgtk2_push_int_param );    CB( G_TYPE_CHAR, pgtk2_push_int_param );       CB( G_TYPE_NONE, NULL );       CB( G_TYPE_POINTER, pgtk2_push_pike_object_param );       CB( G_TYPE_PARAM, pgtk2_push_gparamspec_param ); +  CB( G_TYPE_BOXED, pgtk2_push_object_param );   /*    CB( GTK_TYPE_SIGNAL, NULL );    CB( GTK_TYPE_INVALID, NULL );    * This might not be exactly what we want */   }      void push_gvalue_r(const GValue *param, GType t) {    int i;    struct push_callback *cb=push_cbtable[t%63];   
pike.git/src/post_modules/GTK2/source/support.c:1253:    register gpointer data1,data2;          if (G_CCLOSURE_SWAP_DATA(closure)) {    data1=closure->data;    data2=g_value_peek_pointer(param_values+0);    } else {    data1=g_value_peek_pointer(param_values+0);    data2=closure->data;    } + /* fprintf(stderr,"marshaller: before: nvals==%d\n",n_params-1); */    callback=(pgtk2_marshal_func)(marshal_data?marshal_data:cc->callback);    callback(data1,data2,n_params-1,param_values+1,return_value); -  + /* fprintf(stderr,"marshaller: after: nvals==%d\n",n_params-1); */   }      int pgtk2_tree_view_row_separator_func(GtkTreeModel *model,    GtkTreeIter *iter,    struct signal_data *d) {    int res;    push_gobject(model);    push_gobjectclass(iter,pgtk2_tree_iter_program);    push_svalue(&d->args);    apply_svalue(&d->cb,3);    res=Pike_sp[-1].u.integer;    pop_stack();    return res;   }