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.4 2005/11/12 21:22:53 nilsson Exp $ + || $Id: support.c,v 1.5 2005/12/29 00:00:53 nilsson Exp $   */      #include <version.h>   #include <bignum.h>   #include <stdarg.h>      void pgtk_encode_grey(struct image *i, unsigned char *dest, int bpp, int bpl);      void pgtk_verify_setup() {    if (!pigtk_is_setup)
pike.git/src/post_modules/GTK2/source/support.c:53:      void pgtk_index_stack(char *what) {    push_text(what);    f_index(2);   #ifdef PIKE_DEBUG    if (Pike_sp[-1].type==PIKE_T_INT)    Pike_error("Internal indexing error.\n");   #endif   }    - #ifdef DYNAMIC_MODULE - struct program *image_color_program = NULL; - #else - extern struct program *image_color_program; - #endif -  +    int get_color_from_pikecolor(struct object *o, INT_TYPE *r, INT_TYPE *g, INT_TYPE *b) {    struct color_struct *col; -  - #ifdef DYNAMIC_MODULE -  if (!image_color_program) { -  image_color_program = PIKE_MODULE_IMPORT(Image, image_color_program); -  if(!image_color_program) -  Pike_error("Could not load Image module.\n"); -  } - #endif -  +     col=(struct color_struct *)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;   }    - #ifdef DYNAMIC_MODULE - struct program *image_program = NULL; - #else - extern struct program *image_program; - #endif -  +    GdkImage *gdkimage_from_pikeimage(struct object *img, int fast, 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");    - #ifdef DYNAMIC_MODULE -  if(!image_program) { -  image_program = PIKE_MODULE_IMPORT(Image, image_program); -  if(!image_program) -  Pike_error("Could not load Image module.\n"); -  } - #endif -  +     img_data=(struct image*)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 (i) {