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

version» Context lines:

pike.git/src/post_modules/GTK2/source/support.c:69:    push_text(what);    f_index(2);   #ifdef PIKE_DEBUG    if (TYPEOF(Pike_sp[-1]) == PIKE_T_INT)    Pike_error("Internal indexing error.\n");   #endif   }      int get_color_from_pikecolor(struct object *o, INT_TYPE *r, INT_TYPE *g, INT_TYPE *b) {    struct color_struct *col; -  col=(struct color_struct *)get_storage(o,image_color_program); +  col=get_storage(o,image_color_program);    if (!col)    return 0;    *r=col->rgbl.r/(COLORLMAX/65535);    *g=col->rgbl.g/(COLORLMAX/65535);    *b=col->rgbl.b/(COLORLMAX/65535);    return 1;   }      GdkImage *gdkimage_from_pikeimage(struct object *img, int fast, GObject **pi) {    GdkImage *i;    GdkColormap *col=gdk_colormap_get_system();    GdkVisual *vis=gdk_visual_get_system();    struct image *img_data;    INT_TYPE x,y;       TIMER_INIT("Getting extents");    -  img_data=(struct image*)get_storage(img, image_program); +  img_data=get_storage(img, image_program);       /* 1a: create the actual image... */    x = img_data->xsize;    y = img_data->ysize;          if (x==0 || y==0)    Pike_error("Size of image must be > 0x0\n");    if (pi) {    i = GDK_IMAGE(*pi);
pike.git/src/post_modules/GTK2/source/support.c:155:    2/ use that array to build a pike X-image colormap.    3/ call Image.X.encode_pseudocolor( img, bpp, lpad, depth, colormp )    4/ copy the actual data to the image..    */    if (!colors_allocated) {   #define COLORMAP_SIZE 256    char allocated[COLORMAP_SIZE];    int j,i,r,g,b;    PFTIME("Creating colormap");    colors_allocated=1; -  MEMSET(allocated,0,sizeof(allocated)); +  memset(allocated,0,sizeof(allocated));    for (r=0; r<3; r++) for (g=0; g<4; g++) for (b=0; b<3; b++) {    GdkColor color;    color.red = (guint16)(r * (65535/2.0));    color.green = (guint16)(g * (65535/3.0));    color.blue = (guint16)(b * (65535/2.0));    color.pixel = 0;    if (gdk_color_alloc(col,&color))    if (color.pixel<COLORMAP_SIZE)    allocated[color.pixel]=1;    }
pike.git/src/post_modules/GTK2/source/support.c:196:    f_aggregate(256);    /* now on stack: the array with colors. */    pgtk2_get_image_module();    pgtk2_index_stack("colortable");    /* on stack: array function */    Pike_sp[0]=Pike_sp[-1];    Pike_sp[-1]=Pike_sp[-2];    Pike_sp[-2]=Pike_sp[0];    /* on stack: function array */    PFTIME("Creating colormap obj"); -  apply_svalue(Pike_sp-2,1); +  safe_apply_svalue(Pike_sp-2, 1, 1);    /* on stack: function cmap */    get_all_args("internal",1,"%o",&pike_cmap);    pike_cmap->refs+=100; /* lets keep this one.. :-) */    push_int(8);    push_int(8);    push_int(8);    apply(pike_cmap,"rigid",3);    pop_stack();    apply(pike_cmap,"ordered",0);    pop_stack();
pike.git/src/post_modules/GTK2/source/support.c:234:    default: pad = 32; break;    }    push_int(pad); /* extra padding.. */    }    push_int(i->depth);    add_ref(pike_cmap);    push_object(pike_cmap);    /* on stack: function img bpp linepad depth cmap*/    /* 6 5 4 3 2 1 */    PFTIME("Dithering image"); -  apply_svalue(Pike_sp-6,5); +  safe_apply_svalue(Pike_sp-6, 5, 1);    if (TYPEOF(Pike_sp[-1]) != PIKE_T_STRING) {    gdk_image_destroy((void *)i);    Pike_error("Failed to convert image\n");    }    PFTIME("Converting image"); -  MEMCPY(i->mem,Pike_sp[-1].u.string->str,Pike_sp[-1].u.string->len); +  memcpy(i->mem,Pike_sp[-1].u.string->str,Pike_sp[-1].u.string->len);    pop_stack(); /* string */    pop_stack(); /* function */    }    }    TIMER_END();    return i;   }      int pgtk2_is_object_program(struct program *X);   
pike.git/src/post_modules/GTK2/source/support.c:263:    struct object *o;    if (!obj) {    push_int(0);    return;    }    if (pgtk2_is_object_program(def))    if ((o=g_object_get_data(((void *)obj),"pike_object"))) {    ref_push_object(o);    return;    } -  o=low_clone(def); -  call_c_initializers(o); +  o=fast_clone_object(def);    ((struct object_wrapper *)o->storage)->obj=obj;    pgtk2__init_object(o);       /* Extra ref already added in pgtk2__init_object */    push_object(o);    return;   }         void push_pgdk2object(void *obj, struct program *def, int owned) {    struct object *o;    if (!obj) {    push_int(0);    return;    } -  o=low_clone(def); -  call_c_initializers(o); +  o=fast_clone_object(def);    ((struct object_wrapper *)o->storage)->obj=obj;    ((struct object_wrapper *)o->storage)->owned = owned;    push_object(o);    return;   }      GObject *get_pg2object(struct object *from, struct program *type) {    struct object_wrapper * o;    if (!from)    return NULL; -  o=(struct object_wrapper *)get_storage(from,type); +  o=get_storage(from,type);    if (!o)    return 0;    return o->obj;   }      void *get_pgdk2object(struct object *from, struct program *type) {    void *f;    if (!from)    return NULL;    if (type)    f=get_storage( from, type );    else    f=from->storage; /* Add a warning? */    if (!f)    return 0;    return (void *)((struct object_wrapper *)f)->obj;   }      void pgtk2_destruct(struct object *o) { -  struct object_wrapper *ow= -  (struct object_wrapper *)get_storage(o,pg2_object_program); +  struct object_wrapper *ow=get_storage(o,pg2_object_program);    if (ow) /* This should always be true. But let's add a check anyway. */    ow->obj=NULL;    if (o->refs>1)    destruct(o);    free_object(o); /* ref added in __init_object below. */   }      void pgtk2__init_object(struct object *o) {    GObject *go=get_gobject(o);    if (!go) /* Not a real GObject. Refhandling done elsewhere */
pike.git/src/post_modules/GTK2/source/support.c:342:    void *dest, long *mask, int len) {    struct svalue *s;    if ((s=simple_mapping_string_lookup(map,name))) {    if (TYPEOF(*s) == type) {    switch(type) {    case PIKE_T_STRING:   #ifdef PIKE_DEBUG    if (len!=sizeof(char *))    Pike_fatal("oddities detected\n");   #endif -  MEMCPY(((char **)dest),&s->u.string->str,sizeof(char *)); +  memcpy(dest,&s->u.string->str,sizeof(char *));    break;    case PIKE_T_INT:    if (len==2) {    short i=(short)s->u.integer; -  MEMCPY(((short *)dest),&i,2); +  memcpy(dest,&i,2);    } else if (len==4) -  MEMCPY(((int *)dest),&s->u.integer,len); +  memcpy(dest,&s->u.integer,len);    break;    case PIKE_T_FLOAT:    if (len==sizeof(FLOAT_TYPE)) -  MEMCPY(((FLOAT_TYPE *)dest),&s->u.float_number,len); +  memcpy(dest,&s->u.float_number,len);    else if (len==sizeof(double)) {    double d=s->u.float_number; -  MEMCPY(((double *)dest),&d,len); +  memcpy(dest,&d,len);    }    break;    }    if (mask)    *mask|=madd;    }    }   }      GdkAtom get_gdkatom(struct object *o) {
pike.git/src/post_modules/GTK2/source/support.c:430:   }      void push_atom(GdkAtom a) {    /* this should really be inserted in the GDK.Atom mapping. */    push_pgdk2object((void *)a,pgdk2__atom_program,0);   }      void push_Xpseudo32bitstring(void *f, int nelems) {    if (sizeof(long)!=4) {    long *q=(long *)f; -  int *res=(int *)xalloc(nelems*4),i; +  int *res=xalloc(nelems*4),i;    for (i=0; i<nelems; i++)    res[i]=q[i];    push_string(make_shared_binary_string2((const p_wchar2 *)res,nelems));    xfree(res);    } else {    push_string(make_shared_binary_string2(f,nelems));    }   }      /*   gint pgtk2_buttonfuncwrapper(GObject *obj, struct signal_data *d, void *foo) {    int res;    push_svalue(&d->args); -  apply_svalue(&d->cb, 1); +  safe_apply_svalue(&d->cb, 1, 1);    res=Pike_sp[-1].u.integer;    pop_stack();    return res;   }   */      void push_gdk_event(GdkEvent *e) {    if (e) {    GdkEvent *f=g_malloc(sizeof(GdkEvent));    if (f==NULL) {
pike.git/src/post_modules/GTK2/source/support.c:466:    return;    }    *f=*e;    push_gdkobject(f,event,1);    } else    push_int(0);   }      enum { PUSHED_NOTHING, PUSHED_VALUE, NEED_RETURN, };    - /* - static int pgtk2_push_selection_data_param( GValue *a ) - { -  push_pgdk2object( GTK_VALUE_POINTER(*a), pgtk2_selection_data_program); -  return PUSHED_VALUE; - } - */ -  +    static int pgtk2_push_accel_group_param(const GValue *a) {    g_object_ref(g_value_get_pointer(a));    push_gobjectclass(g_value_get_pointer(a),pgtk2_accel_group_program);    return PUSHED_VALUE;   }      /*   static int pgtk2_push_ctree_node_param(const GValue *a )   {    push_pgdk2object( GTK_VALUE_POINTER(*a), pgtk2_ctree_node_program);    return PUSHED_VALUE;   }   */    - static int pgtk2_push_gdk_drag_context_param(const GValue *a) { -  push_gdkobject(g_value_get_pointer(a),drag_context,0); -  return PUSHED_VALUE; - } -  +    static int pgtk2_push_gdk_event_param(const GValue *a) {    push_gdk_event(g_value_get_boxed(a));    return NEED_RETURN;   }      static int pgtk2_push_gdk_rectangle_param(const GValue *a) {    GdkRectangle *r = (GdkRectangle *) g_value_get_boxed(a); -  push_text("x"); push_int(r->x); -  push_text("y"); push_int(r->y); -  push_text("width"); push_int(r->width); -  push_text("height"); push_int(r->height); +  push_static_text("x"); push_int(r->x); +  push_static_text("y"); push_int(r->y); +  push_static_text("width"); push_int(r->width); +  push_static_text("height"); push_int(r->height);    f_aggregate_mapping(8);    return PUSHED_VALUE;   }      static int pgtk2_push_int_param(const GValue *a) { -  LONGEST retval; +  INT64 retval;    switch (G_VALUE_TYPE(a)) {    case G_TYPE_UINT: -  retval=(LONGEST)g_value_get_uint(a); +  retval=(INT64)g_value_get_uint(a);    break;    case G_TYPE_INT64: -  retval=(LONGEST)g_value_get_int64(a); +  retval=(INT64)g_value_get_int64(a);    break;    case G_TYPE_UINT64: -  retval=(LONGEST)g_value_get_uint64(a); +  retval=(INT64)g_value_get_uint64(a);    break;    case G_TYPE_INT: -  retval=(LONGEST)g_value_get_int(a); +  retval=(INT64)g_value_get_int(a);    break; -  case G_TYPE_ENUM: -  retval=(LONGEST)g_value_get_enum(a); -  break; +     case G_TYPE_FLAGS: -  retval=(LONGEST)g_value_get_flags(a); +  retval=(INT64)g_value_get_flags(a);    break;    case G_TYPE_BOOLEAN: -  retval=(LONGEST)g_value_get_boolean(a); +  retval=(INT64)g_value_get_boolean(a);    break;    case G_TYPE_LONG: -  retval=(LONGEST)g_value_get_long(a); +  retval=(INT64)g_value_get_long(a);    break;    case G_TYPE_CHAR: -  retval=(LONGEST)g_value_get_char(a); + #ifdef HAVE_G_VALUE_GET_SCHAR +  retval=(INT64)g_value_get_schar(a); + #else +  retval=(INT64)g_value_get_char(a); + #endif    break;    default: -  retval=(LONGEST)g_value_get_uint(a); +  retval=(INT64)g_value_get_uint(a);    break;    }    push_int64(retval);    return PUSHED_VALUE;   }    -  + static int pgtk2_push_enum_param(const GValue *a) { +  /* This can't be handled by push_int_param as the type of +  an enumeration is some subclass of G_TYPE_ENUM, rather than +  actually being G_TYPE_ENUM exactly. */ +  push_int64((INT64)g_value_get_enum(a)); +  return PUSHED_VALUE; + } +    static int pgtk2_push_float_param(const GValue *a) {    FLOAT_TYPE retval;    if (G_VALUE_TYPE(a)==G_TYPE_FLOAT)    retval=(FLOAT_TYPE)g_value_get_float(a);    else    retval=(FLOAT_TYPE)g_value_get_double(a);    push_float(retval);    return PUSHED_VALUE;   }   
pike.git/src/post_modules/GTK2/source/support.c:574:      static int pgtk2_push_object_param(const GValue *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,0);    } else if (G_VALUE_HOLDS(a,g_type_from_name("GtkTreePath"))) {    push_pgdk2object(gp,pgtk2_tree_path_program,0); +  } else if (G_VALUE_HOLDS(a,g_type_from_name("GtkTextIter"))) { +  push_pgdk2object(gp,pgtk2_text_iter_program,0); +  } else if (G_VALUE_HOLDS(a,g_type_from_name("GtkSelectionData"))) { +  push_pgdk2object(gp,pgtk2_selection_data_program,0);    } else if (G_VALUE_HOLDS(a,g_type_from_name("GdkRectangle"))) {    push_gdkobject(gp,rectangle,0);    } else if (G_VALUE_HOLDS(a,g_type_from_name("GdkRegion"))) {    push_gdkobject(gp,region,0); -  +  } else { +  /* Don't know how to push this sort of object, so push its name */ +  PGTK_PUSH_GCHAR(G_VALUE_TYPE_NAME(a));    }    } else {    obj=g_value_get_object(a);    if (obj)    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); +  push_int64((INT64)g_value_get_pointer(a));    return PUSHED_VALUE;   }      static int pgtk2_push_gparamspec_param(const GValue *a) {    push_int(0);    return PUSHED_VALUE;   }      static struct push_callback {    int (*callback)(const GValue *);
pike.git/src/post_modules/GTK2/source/support.c:631:    CB(GTK_TYPE_TEXT_ATTRIBUTES, pgtk2_push_object_param);    CB(GTK_TYPE_TREE_ITER, pgtk2_push_object_param);    CB(GTK_TYPE_TREE_MODEL, pgtk2_push_object_param);    CB(PANGO_TYPE_ATTR_LIST, pgtk2_push_object_param);    CB(GTK_TYPE_TREE_PATH, pgtk2_push_object_param);    CB(PANGO_TYPE_FONT_DESCRIPTION, pgtk2_push_object_param);    CB(PANGO_TYPE_CONTEXT, pgtk2_push_object_param);    CB(PANGO_TYPE_LAYOUT, pgtk2_push_object_param);       CB( GTK_TYPE_ACCEL_GROUP, pgtk2_push_accel_group_param ); -  /*#ifndef HAS_GTK_20*/ -  CB( GDK_TYPE_DRAG_CONTEXT, pgtk2_push_gdk_drag_context_param ); -  /*#endif*/ +     CB( GDK_TYPE_EVENT, pgtk2_push_gdk_event_param );    CB( GDK_TYPE_RECTANGLE, pgtk2_push_gdk_rectangle_param );       CB( GTK_TYPE_ACCEL_FLAGS, pgtk2_push_int_param );    CB( GDK_TYPE_MODIFIER_TYPE,pgtk2_push_int_param );       CB( G_TYPE_FLOAT, pgtk2_push_float_param );    CB( G_TYPE_DOUBLE, pgtk2_push_float_param );       CB( G_TYPE_STRING, pgtk2_push_string_param );       CB( G_TYPE_INT, pgtk2_push_int_param );    CB( G_TYPE_INT64, pgtk2_push_int_param );    CB( G_TYPE_UINT64, pgtk2_push_int_param ); -  CB( G_TYPE_ENUM, pgtk2_push_int_param ); +  CB( G_TYPE_ENUM, pgtk2_push_enum_param );    CB( G_TYPE_FLAGS, pgtk2_push_int_param );    CB( G_TYPE_BOOLEAN, pgtk2_push_int_param );    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 );
pike.git/src/post_modules/GTK2/source/support.c:765:    GValue *return_value) {    unsigned int i;       if (!last_used_callback)    build_push_callbacks();    push_gobject(G_OBJECT(go));    for (i=0; i<n_params; i++) {    pgtk2_push_gvalue_rt(&(param_values[i]));    }    push_svalue(&d->args); -  apply_svalue(&d->cb,2+n_params); +  safe_apply_svalue(&d->cb, 2+n_params, 1);    if (return_value && G_VALUE_TYPE(return_value) != 0 )    pgtk2_set_value(return_value,&Pike_sp[-1]);    pop_stack();   }      void pgtk2_free_signal_data(struct signal_data *s, GClosure *gcl) {    free_svalue(&s->cb);    free_svalue(&s->args);    g_free(s);   }
pike.git/src/post_modules/GTK2/source/support.c:835:    mode=Pike_sp[-args].u.integer;    pgtk2_pop_n_elems(args);    if (mode!='O') {    push_undefined();    return;    }    push_string(make_shared_binary_string(__pgtk2_string_data+offset,len));   }      void pgtk2_clear_obj_struct(struct object *o) { -  MEMSET(Pike_fp->current_storage,0,sizeof(struct object_wrapper)); +  memset(Pike_fp->current_storage,0,sizeof(struct object_wrapper));   }      void pgtk2_setup_mixin(struct object *o, struct program *p) {    ptrdiff_t offset;    offset = low_get_storage(o->prog, p);    if(offset == -1)    Pike_error("This class can not be instantiated on its own.\n");    ((struct mixin_wrapper *)Pike_fp->current_storage)->offset = offset;   }    - LONGEST pgtk2_get_int(struct svalue *s) { + INT64 pgtk2_get_int(struct svalue *s) {    if (TYPEOF(*s) == PIKE_T_INT)    return s->u.integer; - #ifdef AUTO_BIGNUM +     if (is_bignum_object_in_svalue(s)) { -  LONGEST res; +  INT64 res;    int64_from_bignum(&res,s->u.object);    return res;    } - #endif +     if (TYPEOF(*s) == PIKE_T_FLOAT) -  return (LONGEST)s->u.float_number; +  return (INT64)s->u.float_number;    return 0;   }      int pgtk2_is_int(struct svalue *s) {    return ((TYPEOF(*s) == PIKE_T_INT) || -  (TYPEOF(*s) == PIKE_T_FLOAT) - #ifdef AUTO_BIGNUM -  || is_bignum_object_in_svalue(s) - #endif -  ); +  (TYPEOF(*s) == PIKE_T_FLOAT) || +  is_bignum_object_in_svalue(s));   }      /* double should be enough */   double pgtk2_get_float(struct svalue *s) {    if (TYPEOF(*s) == PIKE_T_FLOAT)    return s->u.float_number;    if (TYPEOF(*s) == PIKE_T_INT)    return (double)s->u.integer; - #ifdef AUTO_BIGNUM +     if (is_bignum_object_in_svalue(s)) {    FLOAT_TYPE f; -  push_text("float"); -  apply(s->u.object,"cast",1); +  ref_push_type_value(float_type_string); +  stack_swap(); +  f_cast();    f=Pike_sp[-1].u.float_number;    pop_stack();    return (double)f;    } - #endif +     return 0.0;   }      void pgtk2_free_object(struct object *o) {    free_object(o);   }      int pgtk2_is_float(struct svalue *s) {    return ((TYPEOF(*s) == PIKE_T_FLOAT) || -  (TYPEOF(*s) == PIKE_T_INT) - #ifdef AUTO_BIGNUM -  || is_bignum_object_in_svalue(s) - #endif -  ); +  (TYPEOF(*s) == PIKE_T_INT) || +  is_bignum_object_in_svalue(s));   }      void pgtk2_set_property(GObject *g, char *prop, struct svalue *sv) {    GParamSpec *gps;    GType v;    gps=g_object_class_find_property(G_OBJECT_GET_CLASS(g),prop);    if (!gps)    Pike_error("This object does not have a property called %s.\n",prop);    if (!(gps->flags & G_PARAM_WRITABLE))    Pike_error("This property is not writable.\n");
pike.git/src/post_modules/GTK2/source/support.c:1194:    return;    }    switch (gt) {    case G_TYPE_INT:    g_value_set_int(gv,(gint)PGTK_GETINT(sv));    break;    case G_TYPE_UINT:    g_value_set_uint(gv,(guint)PGTK_GETINT(sv));    break;    case G_TYPE_CHAR: + #ifdef HAVE_G_VALUE_SET_SCHAR +  g_value_set_schar(gv,(gchar)PGTK_GETINT(sv)); + #else    g_value_set_char(gv,(gchar)PGTK_GETINT(sv)); -  + #endif    break;    case G_TYPE_UCHAR:    g_value_set_uchar(gv,(guchar)PGTK_GETINT(sv));    break;    case G_TYPE_LONG:    g_value_set_long(gv,(glong)PGTK_GETINT(sv));    break;    case G_TYPE_ULONG:    g_value_set_ulong(gv,(gulong)PGTK_GETINT(sv));    break;
pike.git/src/post_modules/GTK2/source/support.c:1268:   }      int pgtk2_tree_sortable_callback(GtkTreeModel *model, GtkTreeIter *a,    GtkTreeIter *b, struct signal_data *d) {    int res;   /* push_gobjectclass(model,pgtk2_tree_model_program); */    push_gobject(model);    push_pgdk2object(a,pgtk2_tree_iter_program,0);    push_pgdk2object(b,pgtk2_tree_iter_program,0);    push_svalue(&d->args); -  apply_svalue(&d->cb,4); +  safe_apply_svalue(&d->cb, 4, 1);    res=Pike_sp[-1].u.integer;    pop_stack();    return res;   }      GObject *pgtk2_create_new_obj_with_properties(GType type, struct mapping *m) {    GParamSpec *pspec;    GObject *obj;    GObjectClass *class;    GParameter *params;
pike.git/src/post_modules/GTK2/source/support.c:1321:    GValue *return_value,    guint n_params,    const GValue *param_values,    gpointer invocation_hint,    gpointer marshal_data) {    typedef void (*pgtk2_marshal_func)(gpointer data1,    gpointer data2,    guint n_params,    const GValue *param_values,    GValue *return_value); -  register pgtk2_marshal_func callback; -  register GCClosure *cc=(GCClosure *)closure; -  register gpointer data1,data2; +  pgtk2_marshal_func callback; +  GCClosure *cc=(GCClosure *)closure; +  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;    }       callback=(pgtk2_marshal_func)(marshal_data?marshal_data:cc->callback);    callback(data1,data2,n_params-1,param_values+1,return_value);   }      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); +  safe_apply_svalue(&d->cb, 3, 1);    res=Pike_sp[-1].u.integer;    pop_stack();    return res;   }         int pgtk2_entry_completion_match_func( GtkEntryCompletion *x,    const gchar *key,    GtkTreeIter *iter,    struct signal_data *d)   {    int res;    push_gobject(x);    pgtk2_push_gchar( key );    push_gobjectclass(iter,pgtk2_tree_iter_program); -  apply_svalue( &d->cb, 3 ); +  safe_apply_svalue( &d->cb, 3, 1 );    res = Pike_sp[-1].u.integer;    pop_stack();    return res;   }      void add_property_docs(GType type, GString *str) {    GObjectClass *class;    GParamSpec **props;    guint n=0,i;    gboolean has_prop=FALSE;