* Put the tile image on the server. * * We can't send the image to the server until the top level * is realized. When the tile file is first processed, the top * level is not realized. This routine is called after we * realize the top level, but before we start resizing the * map viewport. */
| 346 | * map viewport. |
| 347 | */ |
| 348 | void |
| 349 | post_process_tiles(void) |
| 350 | { |
| 351 | Display *dpy = XtDisplay(toplevel); |
| 352 | unsigned int width, height; |
| 353 | |
| 354 | if (tile_image == 0) |
| 355 | return; /* no tiles */ |
| 356 | |
| 357 | height = tile_image->height; |
| 358 | width = tile_image->width; |
| 359 | |
| 360 | tile_pixmap = XCreatePixmap(dpy, XtWindow(toplevel), width, height, |
| 361 | DefaultDepth(dpy, DefaultScreen(dpy))); |
| 362 | |
| 363 | XPutImage(dpy, tile_pixmap, DefaultGC(dpy, DefaultScreen(dpy)), |
| 364 | tile_image, 0, 0, 0, 0, /* src, dest top left */ |
| 365 | width, height); |
| 366 | |
| 367 | #ifdef MONITOR_HEAP |
| 368 | /* if we let XDestroyImage() handle it, our tracking will be off */ |
| 369 | if (tile_image->data) |
| 370 | free((genericptr_t) tile_image->data), tile_image->data = 0; |
| 371 | #endif |
| 372 | XDestroyImage(tile_image); /* data bytes free'd also */ |
| 373 | tile_image = 0; |
| 374 | |
| 375 | init_annotation(&pet_annotation, appResources.pet_mark_bitmap, |
| 376 | appResources.pet_mark_color); |
| 377 | init_annotation(&pile_annotation, appResources.pilemark_bitmap, |
| 378 | appResources.pilemark_color); |
| 379 | } |
| 380 | |
| 381 | /* |
| 382 | * Open and read the tile file. Return TRUE if there were no problems. |
no test coverage detected