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.12 2006/08/02 13:42:31 ldillon Exp $ + || $Id: support.c,v 1.13 2006/08/03 16:49:49 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:504:    push_text("y"); push_int(r->y);    push_text("width"); push_int(r->width);    push_text("height"); push_int(r->height);    f_aggregate_mapping(8);    return PUSHED_VALUE;   }      static int pgtk2_push_int_param(const GValue *a) {    LONGEST retval;    switch (G_VALUE_TYPE(a)) { +  case G_TYPE_UINT: +  retval=(LONGEST)g_value_get_uint(a); +  break; +  case G_TYPE_INT64: +  retval=(LONGEST)g_value_get_int64(a); +  break; +  case G_TYPE_UINT64: +  retval=(LONGEST)g_value_get_uint64(a); +  break;    case G_TYPE_INT:    retval=(LONGEST)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);    break;    case G_TYPE_BOOLEAN:
pike.git/src/post_modules/GTK2/source/support.c:614:       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_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 );   
pike.git/src/post_modules/GTK2/source/support.c:898:    g_object_set(g,prop,s,NULL);    PGTK_FREESTR(s);    }    break;    case G_TYPE_OBJECT:    g_object_set(g,prop,get_gobject(sv->u.object),NULL);    break;    case G_TYPE_POINTER:    case G_TYPE_BOXED:    case G_TYPE_PARAM: +  { +  if (gps->value_type==g_type_from_name("GdkColor")) { +  GdkColor *gc; +  gc=(GdkColor *)get_gdkobject(sv->u.object,color); +  g_object_set(g,prop,gc,NULL); +  } else    Pike_error("Unable to handle type %s.\n",g_type_name(gps->value_type)); -  +  }    break;    default:    g_object_set(g,prop,PGTK_GETINT(sv),NULL);    break;    }   }      void pgtk2_get_property(GObject *g, char *prop) {    GParamSpec *gps=g_object_class_find_property(G_OBJECT_GET_CLASS(g),prop);    if (!gps)
pike.git/src/post_modules/GTK2/source/support.c:927:   #define get_type(type) do { \    type i; \    g_object_get(g,prop,&i,NULL); \    } while(0)    if (G_TYPE_IS_OBJECT(gps->value_type)) {    GObject *o;    g_object_get(g,prop,&o,NULL);    push_gobject(o);    return;    } -  if (gps->value_type==GTK_TYPE_TREE_MODEL) { + /* if (gps->value_type==GTK_TYPE_TREE_MODEL) { */ +  if (G_TYPE_IS_INTERFACE(gps->value_type)) {    GObject *o;    g_object_get(g,prop,&o,NULL);    push_gobject(o);    return;    }    switch (gps->value_type) {    case G_TYPE_INT:    case G_TYPE_FLAGS:    case G_TYPE_ENUM:    {
pike.git/src/post_modules/GTK2/source/support.c:1035:    {    GObject *o;    g_object_get(g,prop,&o,NULL);    push_gobject(o);    }    break;    case G_TYPE_BOXED:    case G_TYPE_POINTER:    case G_TYPE_PARAM:    default: +  { +  if (gps->value_type==g_type_from_name("GdkColor")) { +  GdkColor *gc; +  gc=g_malloc(sizeof(GdkColor)); +  if (gc==NULL) +  Pike_error("Out of memory allocating %d bytes\n",sizeof(GdkColor)); +  g_object_get(g,prop,gc,NULL); +  push_gdkobject(gc,color); +  } else {    Pike_error("Unable to handle type %s.\n",g_type_name(gps->value_type)); -  +  } +  }    break;    }   }      void pgtk2_destroy_store_data(gpointer data) {    struct store_data *sd=(struct store_data *)data;    g_free(sd->types);    g_free(sd);   }   
pike.git/src/post_modules/GTK2/source/support.c:1226:    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); +  res=Pike_sp[-1].u.integer; +  pop_stack(); +  return res; + } +