/* * image parameters */ struct imginfo { imgtype type; //string image; int x; int y; int w; double alpha; int sub_image_x; int sub_image_y; int sub_image_h; int sub_image_d_x; int sub_image_d_y; int sub_image_d_h; unsigned char action; }; /* * this structure holds all the image information */ struct cimage { imginfo i; unsigned char *data; unsigned char flags; cairo_surface_t *s; cairo_surface_t *sd; cairo_region_t *r; }; inline void DrawableWindow::add_image( struct imginfo &ii ) { // seg fault here, removing the string from imginfo, no seg fault anymore ci[idx].i = ii; cairo_surface_t *tmps;//; = //cairo_image_surface_create_from_png(ii.image.c_str()); .....