pike.git / src / post_modules / GTK2 / source / gdkpixmap.pre

version» Context lines:

pike.git/src/post_modules/GTK2/source/gdkpixmap.pre:24:    return gdkimage_from_pikeimage(o,GDK_IMAGE_FASTEST,0);    }   }      void pgtk__pixmap_draw(GdkImage *i)   {    GdkGC *gc;    if (THIS->extra_data)    gc=THIS->extra_data;    else -  THIS->extra_data=gc=gdk_gc_new(GDK_WINDOW(THIS->obj)); -  gdk_draw_image(GDK_WINDOW(THIS->obj),gc,i,0,0,0,0, +  THIS->extra_data=gc=gdk_gc_new(GDK_DRAWABLE(THIS->obj)); +  gdk_draw_image(GDK_DRAWABLE(THIS->obj),gc,i,0,0,0,0,    i->width,i->height);   }   %}      void create(int|object image)   //! Create a new GDK2.Pixmap object.   //! Argument is a GDK2.Image object or a Image.Image object   {    GdkImage *i;    int f=0;    struct object *o; -  +  GdkPixmap *gp;    pgtk_verify_setup();    pgtk_verify_not_inited();       if (Pike_sp[-args].type==PIKE_T_OBJECT) {    get_all_args("create",args,"%o",&o);    i=pgtk_pixmap_setup(o,&f);    -  THIS->obj=G_OBJECT(gdk_pixmap_new(0,i->width,i->height,i->depth)); +  gp=gdk_pixmap_new(0,i->width,i->height,i->depth); +  THIS->obj=G_OBJECT(gp);    if (!THIS->obj) {    if (f)    g_object_unref(i);    Pike_error("Failed to create pixmap.\n");    }    pgtk__pixmap_draw(i);    if (f)    g_object_unref(i);    } else if (args && Pike_sp[-1].type==PIKE_T_INT) { -  THIS->obj=G_OBJECT(gdk_pixmap_foreign_new(Pike_sp[-1].u.integer)); +  gp=gdk_pixmap_foreign_new(Pike_sp[-1].u.integer); +  THIS->obj=G_OBJECT(gp);    if (!THIS->obj)    Pike_error("Failed to find remote pixmap\n");    } -  +  my_pop_n_elems(args); +  pgtk__init_this_object();   }      void set(GDK2.Image|Image.Image image)   //! Argument is a GDK2.Image object or an Image.image object.   //! It is much faster to use an gdkImage object, especially one   //! allocated in shared memory. This is only an issue if you are   //! going to change the contents of the pixmap often, toggling between   //! a small number of images.   {    struct object *o;
pike.git/src/post_modules/GTK2/source/gdkpixmap.pre:88:   void destroy()   //! Destructor. Destroys the pixmap.   {    if (THIS->obj)    g_object_unref(THIS->obj);    THIS->obj=0;       if (THIS->extra_data)    g_object_unref(THIS->extra_data);    THIS->extra_data=0; +  my_pop_n_elems(args); +  push_int(0);   }      void ref()   //! Ref this object.   {    g_object_ref(THIS->obj);    RETURN_THIS();   }      void unref()   //! Unref this object.   {    g_object_unref(THIS->obj);    RETURN_THIS();   }