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

version» Context lines:

pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:69:   //! @endmapping   {    GdkPixbuf *gp;    GError *error=NULL;       pgtk2_verify_not_inited();    pgtk2_verify_setup();    if (TYPEOF(Pike_sp[-1]) == PIKE_T_STRING) {    char *file;    -  get_all_args("create",args,"%s",&file); +  get_all_args(NULL,args,"%s",&file);    gp=gdk_pixbuf_new_from_file(file,&error);    if (gp==NULL)    Pike_error("Unable to load file %s: %s\n",file,error->message);    } else {    struct mapping *m;    struct svalue *sv;    int bits = 8, width = -2, height = -2, alpha = 0;    -  get_all_args("create",args,"%m",&m); +  get_all_args(NULL,args,"%m",&m);    sv=low_mapping_string_lookup(m,_STR("file"));    if (sv && TYPEOF(*sv) == PIKE_T_STRING) {    const char *file;   #ifdef HAVE_GTK26    int scale=0;   #endif       file=(const char *)STR0(sv->u.string);    sv=low_mapping_string_lookup(m,_STR("width"));    if (sv)
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:215:   gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf, const gchar *key, const gchar *value);   %}   int set_option(string key, string value)   //! Attaches a key/value pair as an option. If the key already exists   //! in the list of options, the new value is ignored.   {    pgtk2_verify_inited();    {    const gchar *key,*value;    int val; -  get_all_args("set_option",args,"%s%s",&key,&value); +  get_all_args(NULL,args,"%s%s",&key,&value);    val=gdk_pixbuf_set_option(GDK_PIXBUF(THIS->obj),key,value);    pgtk2_pop_n_elems(args);    push_int(val);    }   }   endrequire;      /*   require gtk26;   
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:249:      +GDK2.Pixbuf new_subpixbuf(int src_x, int src_y, int width, int height)   //! Creates a new pixbuf which represents a sub-region of src. The new   //! pixbuf shares its pixels with the original pixbuf, so writing to one   //! affects both. The new pixbuf holds a reference to this one, so   //! this object will not be finalized until the new pixbuf is finalized.   {    pgtk2_verify_inited();    {    INT_TYPE src_x,src_y,width,height; -  get_all_args("new_subpixbuf",args,"%i%i%i%i",&src_x,&src_y, +  get_all_args(NULL,args,"%i%i%i%i",&src_x,&src_y,    &width,&height);    pgtk2_pop_n_elems(args);    push_gobject(gdk_pixbuf_new_subpixbuf(GDK_PIXBUF(THIS->obj),    src_x,src_y,width,height));    }   }      +GDK2.Pixbuf save(string filename, string type, void|mapping options)   //! Save to a file in format type. "jpeg", "png", "ico", "bmp",   //! are the only valid writable types at this time. Quality is only
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:271:   {    pgtk2_verify_inited();    {    struct svalue *sv;    struct mapping *m=NULL;    char *filename;    struct pike_string *type;    int res;    GError *error=NULL;    -  get_all_args("save",args,"%s%n.%m",&filename,&type,&m); +  get_all_args(NULL,args,"%s%n.%m",&filename,&type,&m);    if (is_same_string(type,_STR("jpeg"))) {    const char *quality;       if (m==NULL) {    quality="100";    } else {    sv=low_mapping_string_lookup(m,_STR("quality"));    if (sv && TYPEOF(*sv) == PIKE_T_STRING)    quality=(const char *)STR0(sv->u.string);    else
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:406:   }      int put_pixel(int x, int y, int r, int g, int b)   //! Set pixel to value.   {    pgtk2_verify_inited();    {    INT_TYPE x,y,r,g,b;    int nchan,rowstride,w,h;    guchar *p,*p1; -  get_all_args("put_pixel",args,"%i%i%i%i%i",&x,&y,&r,&g,&b); +  get_all_args(NULL,args,"%i%i%i%i%i",&x,&y,&r,&g,&b);    nchan=gdk_pixbuf_get_n_channels(GDK_PIXBUF(THIS->obj));    if (nchan < 3)    Pike_error("Not in RGB.\n");    w=gdk_pixbuf_get_width(GDK_PIXBUF(THIS->obj));    h=gdk_pixbuf_get_height(GDK_PIXBUF(THIS->obj));    if ((x < 0) || (x >= w))    SIMPLE_ARG_TYPE_ERROR("put_pixel", 1, "int(0..)");    if ((y < 0) || (y >= h))    SIMPLE_ARG_TYPE_ERROR("put_pixel", 2, "int(0..)");    if (r & ~255)
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:439:   }      int set_alpha(int x, int y, int setting)   //! Set alpha value.   {    pgtk2_verify_inited();    {    INT_TYPE x,y,a;    int nchan,rowstride,w,h;    guchar *p,*p1; -  get_all_args("set_alpha",args,"%i%i%i",&x,&y,&a); +  get_all_args(NULL,args,"%i%i%i",&x,&y,&a);    nchan=gdk_pixbuf_get_n_channels(GDK_PIXBUF(THIS->obj));    if (nchan < 4)    Pike_error("No alpha channel present.\n");    w=gdk_pixbuf_get_width(GDK_PIXBUF(THIS->obj));    h=gdk_pixbuf_get_height(GDK_PIXBUF(THIS->obj));    if ((x < 0) || (x >= w))    SIMPLE_ARG_TYPE_ERROR("set_alpha", 1, "int(0..)");    if ((y < 0) || (y >= h))    SIMPLE_ARG_TYPE_ERROR("set_alpha", 2, "int(0..)");    if (a & ~255)
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:492:   }      string get_option(string key)   //! Looks up key in the list of options that may have been attached   //! to the pixbuf when it was loaded.   {    pgtk2_verify_inited();    {    char *s;    const gchar *t; -  get_all_args("get_option",args,"%s",&s); +  get_all_args(NULL,args,"%s",&s);    t=gdk_pixbuf_get_option(GDK_PIXBUF(THIS->obj),s);    pgtk2_pop_n_elems(args);    PGTK_PUSH_GCHAR(t);    }   }      +GDK2.Pixbuf scale_simple(int dest_width, int dest_height, ?int interp_type)   //! Create a new W(Pixbuf) containing a copy of this W(Pixbuf) scaled to   //! dest_width x dest_height. Leaves this W(Pixbuf) unaffected.   //! intertype should be GDK2.INTERP_NEAREST if you want maximum speed   //! (but when scaling down GDK2.INTERP_NEAREST is usually unusably ugly).   //! The default interp_type should be GDK2.INTERP_BILINEAR which offers   //! reasonable quality and speed.   //! You can scale a sub-portion by create a sub-pixbuf with new_subpixbuf().   {    pgtk2_verify_inited();    {    GdkPixbuf *gp1;    INT_TYPE width,height,type=GDK_INTERP_BILINEAR; -  get_all_args("scale_simple",args,"%i%i.%i",&width,&height,&type); +  get_all_args(NULL,args,"%i%i.%i",&width,&height,&type);    pgtk2_pop_n_elems(args);    gp1=gdk_pixbuf_scale_simple(GDK_PIXBUF(THIS->obj),width,height,type);    push_gobject(gp1);    }   }      +GDK2.Pixbuf scale(GDK2.Pixbuf dest, int dest_x, int dest_y, int dest_width,    int dest_height, float offset_x, float offset_y,    float scale_x, float scale_y, int type)   //! Creates a transformation of the source image by scaling by scale_x
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:538:   //! strength power tool you can fall back to if scale_simple() isn't   //! powerful enough.   {    pgtk2_verify_inited();    {    GdkPixbuf *dest;    struct object *o1;    INT_TYPE dest_x,dest_y,dest_width,dest_height;    FLOAT_TYPE offset_x,offset_y,scale_x,scale_y;    INT_TYPE type; -  get_all_args("scale",args,"%o%i%i%i%i%f%f%f%f%i",&o1,&dest_x,&dest_y, +  get_all_args(NULL,args,"%o%i%i%i%i%f%f%f%f%i",&o1,&dest_x,&dest_y,    &dest_width,&dest_height,&offset_x,&offset_y,    &scale_x,&scale_y,&type);    dest=GDK_PIXBUF(get_gobject(o1));    gdk_pixbuf_scale(GDK_PIXBUF(THIS->obj),dest,dest_x,dest_y,dest_width,    dest_height,offset_x,offset_y,scale_x,scale_y,type);    pgtk2_pop_n_elems(args);    push_gobject(dest);    }   }   
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:574:   //! when the destination rectangle contain parts not in the source image,   //! the data at the edges of the source image is replicated to infinity.   {    pgtk2_verify_inited();    {    GdkPixbuf *dest;    struct object *o1;    INT_TYPE dest_x,dest_y,dest_width,dest_height;    FLOAT_TYPE offset_x,offset_y,scale_x,scale_y;    INT_TYPE type,overall_alpha; -  get_all_args("composite",args,"%o%i%i%i%i%f%f%f%f%i%i",&o1,&dest_x, +  get_all_args(NULL,args,"%o%i%i%i%i%f%f%f%f%i%i",&o1,&dest_x,    &dest_y,&dest_width,&dest_height,&offset_x,&offset_y,    &scale_x,&scale_y,&type,&overall_alpha);    dest=GDK_PIXBUF(get_gobject(o1));    gdk_pixbuf_composite(GDK_PIXBUF(THIS->obj),dest,dest_x,dest_y,    dest_width,dest_height,offset_x,offset_y,scale_x,scale_y,    type,overall_alpha);    pgtk2_pop_n_elems(args);    push_gobject(dest);    }   }
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:607:   //! suitable for many tasks.   {    pgtk2_verify_inited();    {    GdkPixbuf *dest;    struct object *o1;    INT_TYPE dest_x,dest_y,dest_width,dest_height;    FLOAT_TYPE offset_x,offset_y,scale_x,scale_y;    INT_TYPE type,overall_alpha,check_x,check_y,check_size;    INT_TYPE color1,color2; -  get_all_args("composite_color",args,"%o%i%i%i%i%f%f%f%f%i%i%i%i%i%i%", +  get_all_args(NULL,args,"%o%i%i%i%i%f%f%f%f%i%i%i%i%i%i%",    &o1,&dest_x,&dest_y,&dest_width,&dest_height,&offset_x,    &offset_y,&scale_x,&scale_y,&type,&overall_alpha,&check_x,    &check_y,&check_size,&color1,&color2);    dest=GDK_PIXBUF(get_gobject(o1));    gdk_pixbuf_composite_color(GDK_PIXBUF(THIS->obj),dest,dest_x,dest_y,    dest_width,dest_height,offset_x,offset_y,scale_x,scale_y,    type,overall_alpha,check_x,check_y,check_size,color1,color2);    pgtk2_pop_n_elems(args);    push_gobject(dest);    }
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:651:   +GDK2.Pixbuf copy_area(GDK2.Pixbuf dest, int src_x, int src_y, int widt,    int height, int dest_x, int dest_y)   //! Copies a rectangular area from this pixbuf to dest. Conversion of   //! pixbuf formats is done automatically.   {    pgtk2_verify_inited();    {    GdkPixbuf *dest;    struct object *o1;    INT_TYPE src_x,src_y,width,height,dest_x,dest_y; -  get_all_args("copy_area",args,"%o%i%i%i%i%i%i",&o1,&src_x,&src_y, +  get_all_args(NULL,args,"%o%i%i%i%i%i%i",&o1,&src_x,&src_y,    &width,&height,&dest_x,&dest_y);    dest=GDK_PIXBUF(get_gobject(o1));    gdk_pixbuf_copy_area(GDK_PIXBUF(THIS->obj),src_x,src_y,width,height,    dest,dest_x,dest_y);    pgtk2_pop_n_elems(args);    push_gobject(dest);    }   }      void saturate_and_pixelate(GDK2.Pixbuf dest, float saturation,
pike.git/src/post_modules/GTK2/source/gdkpixbuf.pre:684:    int alpha_threshold)   //! Takes the opacity values in a rectangular portion of a pixbuf and   //! thresholds them to produce a bi-level alpha mask that can be used as a   //! clipping mask for a drawable.   {    pgtk2_verify_inited();    {    INT_TYPE x,y,dx,dy,w,h,a;    GdkBitmap *b;    -  get_all_args("render_threshold_alpha",args,"%i%i%i%i%i%i%i",&x,&y,&dx,&dy, +  get_all_args(NULL,args,"%i%i%i%i%i%i%i",&x,&y,&dx,&dy,    &w,&h,&a);    b = gdk_pixmap_new( NULL, w, h, 1 );    if (!b)    SIMPLE_OUT_OF_MEMORY_ERROR("render_threshold_alpha",sizeof(GdkBitmap));    gdk_pixbuf_render_threshold_alpha(GDK_PIXBUF(THIS->obj),b,    x,y,dx,dy,w,h,a);    pgtk2_pop_n_elems(args);    push_gobject(b);    }   }