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:292:    ((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) +  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); +  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 */