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

version» Context lines:

pike.git/src/post_modules/GTK2/source/gdkimage.pre:78:   //! Grabbing non-toplevel widgets may produce unexpected results.   //! To get the size of a widget use ->xsize() and ->ysize().   //! To get the offset of the upper left corner of the widget, relative to it's   //! X-window (this is what you want for the offset arguments), use   //! ->xoffset() and ->yoffset().   {    GdkWindow *win=NULL;    struct object *o;    INT_TYPE x,y,w,h;    -  get_all_args("grab",args,"%o%i%i%i%i",&o,&x,&y,&w,&h); +  get_all_args(NULL,args,"%o%i%i%i%i",&o,&x,&y,&w,&h);       if (get_pg2object(o,pgtk2_widget_program))    win=GTK_WIDGET(get_pg2object(o,pgtk2_widget_program))->window;       if (!win)    Pike_error("This is not a window, or this widget doesn't have a window\n");       if (THIS->obj)    g_object_unref(THIS->obj);   
pike.git/src/post_modules/GTK2/source/gdkimage.pre:101:    RETURN_THIS();   }      void set(Image.Image|int image_or_xsize,int|void ysize)   //! Call this to set this image to either the contents of a pike image   //! or a blank image of a specified size.   {    struct object *img;       if (args==1) { -  get_all_args("init",args,"%o",&img); +  get_all_args(NULL,args,"%o",&img);    THIS->obj=G_OBJECT(gdkimage_from_pikeimage(img,THIS->extra_int,    &THIS->obj));    } else {    INT_TYPE x,y;    GdkImage *gi; -  get_all_args("set",args,"%i%i",&x,&y); +  get_all_args(NULL,args,"%i%i",&x,&y);    if (THIS->obj)    g_object_unref(THIS->obj);    gi=gdk_image_new(THIS->extra_int,gdk_visual_get_system(),x,y);    THIS->obj=G_OBJECT(gi);    if (!THIS->obj)    Pike_error("Failed to create GDK2.Image from size.\n");    }    RETURN_THIS();   }      int get_pixel(int x, int y)   //! Get the pixel value of a pixel as a X-pixel value.   //! It is usualy not very easy to convert this value to a   //! rgb triple. See get_pnm.   {    INT_TYPE x,y; -  get_all_args("get_pixel",args,"%i%i",&x,&y); +  get_all_args(NULL,args,"%i%i",&x,&y);    if (!THIS->obj)    Pike_error("No image.\n");    pgtk2_pop_n_elems(args);    push_int(gdk_image_get_pixel(GDK_IMAGE(THIS->obj),x,y));   }      void set_pixel(int x, int y, int pixel)   //! Set the pixel value of a pixel. Please note that the pixel argument   //! is a X-pixel value, which is not easily gotten from a RGB color.   //! See get_pixel and set.   {    INT_TYPE x,y,to; -  get_all_args("set_pixel",args,"%i%i%i",&x,&y,&to); +  get_all_args(NULL,args,"%i%i%i",&x,&y,&to);    if (!THIS->obj)    Pike_error("No image.\n");    gdk_image_put_pixel(GDK_IMAGE(THIS->obj),x,y,to);    RETURN_THIS();   }