Japanese translation of message catalog for Sawfish Window-Manager
修訂 | 7514eef2c30ad481877e90589b7bb8f73b04d25a (tree) |
---|---|
時間 | 2010-12-19 13:32:18 |
作者 | Michal Maruska <mmaruska@gmai...> |
Commiter | Michal Maruska |
debug images.c
@@ -108,9 +108,12 @@ make_image (image_t im, repv plist) | ||
108 | 108 | Lisp_Image *f; |
109 | 109 | for (f = image_list; f != 0; f = f->next) |
110 | 110 | { |
111 | - if (f->image == im) | |
111 | + if (f->image == im){ | |
112 | + if (debug_images & DB_IMAGES_CREATE) | |
113 | + DB(("%s: image already known!\n", __FUNCTION__)); | |
112 | 114 | /* XXX do what with the plist..? */ |
113 | 115 | return rep_VAL(f); |
116 | + } | |
114 | 117 | } |
115 | 118 | f = rep_ALLOC_CELL(sizeof(Lisp_Image)); |
116 | 119 | rep_data_after_gc += sizeof (Lisp_Image) + IMAGE_T_SIZE (im); |
@@ -212,6 +215,8 @@ string). PLIST defines the property list of the image. | ||
212 | 215 | rep_DECLARE1(file, rep_STRINGP); |
213 | 216 | if (dpy == 0) |
214 | 217 | return Qnil; |
218 | + if (debug_images & DB_IMAGES_CREATE) | |
219 | + DB(("%s %s\n", __FUNCTION__, rep_STR(file))); | |
215 | 220 | rep_PUSHGC(gc_plist, plist); |
216 | 221 | file = find_image_file (file, &delete); |
217 | 222 | rep_POPGC; |
@@ -242,6 +247,8 @@ make-image-from-x-drawable ID [MASK-ID] | ||
242 | 247 | unsigned w, h, bdr, dp; |
243 | 248 | image_t im; |
244 | 249 | |
250 | + if (debug_images & DB_IMAGES_CREATE) | |
251 | + DB(("%s\n", __FUNCTION__)); | |
245 | 252 | rep_DECLARE1 (id, rep_INTP); |
246 | 253 | d = rep_INT (id); |
247 | 254 | if (rep_INTP (mask_id)) |
@@ -388,6 +395,8 @@ Return a new image object, a clone of SOURCE-IMAGE. | ||
388 | 395 | { |
389 | 396 | image_t im; |
390 | 397 | rep_DECLARE1(source, IMAGEP); |
398 | + if (debug_images & DB_IMAGES_OPS) | |
399 | + DB(("%s\n", __FUNCTION__)); | |
391 | 400 | #if defined HAVE_IMLIB |
392 | 401 | im = Imlib_clone_image (imlib_id, VIMAGE(source)->image); |
393 | 402 | #elif defined HAVE_GDK_PIXBUF |
@@ -525,6 +534,9 @@ Return the value of the property named PROPERTY (a symbol) of IMAGE. | ||
525 | 534 | repv plist; |
526 | 535 | rep_DECLARE1(image, IMAGEP); |
527 | 536 | plist = VIMAGE(image)->plist; |
537 | + if (debug_images & DB_IMAGES_GET) | |
538 | + DB(("%s %s\n", __FUNCTION__, rep_SYMBOLP(prop)? rep_STR(rep_SYM(prop)->name) | |
539 | + :(u_char*)"not a symbol")); | |
528 | 540 | while (rep_CONSP(plist) && rep_CONSP(rep_CDR(plist))) |
529 | 541 | { |
530 | 542 | if (rep_CAR(plist) == prop |
@@ -549,6 +561,8 @@ Set the value of the property named PROPERTY (a symbol) of IMAGE to VALUE. | ||
549 | 561 | repv plist; |
550 | 562 | rep_DECLARE1(image, IMAGEP); |
551 | 563 | plist = VIMAGE(image)->plist; |
564 | + if (debug_images & DB_IMAGES_GET) | |
565 | + DB(("%s\n", __FUNCTION__)); | |
552 | 566 | while (rep_CONSP(plist) && rep_CONSP(rep_CDR(plist))) |
553 | 567 | { |
554 | 568 | if (rep_CAR(plist) == prop |
@@ -585,7 +599,8 @@ Return (WIDTH . HEIGHT) representing the dimensions in pixels of IMAGE. | ||
585 | 599 | ::end:: */ |
586 | 600 | { |
587 | 601 | rep_DECLARE1(img, IMAGEP); |
588 | - | |
602 | + if (debug_images & DB_IMAGES_GET) | |
603 | + DB(("%s\n", __FUNCTION__)); | |
589 | 604 | return Fcons (rep_MAKE_INT(image_width(VIMAGE(img))), |
590 | 605 | rep_MAKE_INT(image_height(VIMAGE(img)))); |
591 | 606 | } |
@@ -670,6 +685,8 @@ are resized. | ||
670 | 685 | ::end:: */ |
671 | 686 | { |
672 | 687 | rep_DECLARE1(img, IMAGEP); |
688 | + if (debug_images & DB_IMAGES_GET) | |
689 | + DB(("%s\n", __FUNCTION__)); | |
673 | 690 | #if !defined (HAVE_IMLIB) |
674 | 691 | VIMAGE(img)->border[0] = rep_INTP (left) ? rep_INT (left) : 0; |
675 | 692 | VIMAGE(img)->border[1] = rep_INTP (right) ? rep_INT (right) : 0; |
@@ -977,6 +994,8 @@ defines the color of its pixels. | ||
977 | 994 | rep_INT(width), rep_INT(height)); |
978 | 995 | rep_free (data); |
979 | 996 | #elif defined HAVE_GDK_PIXBUF |
997 | + if (debug_images & DB_IMAGES_CREATE) | |
998 | + DB(("make-sized-image: gdk constant color!\n")); | |
980 | 999 | data = rep_alloc (rep_INT(width) * rep_INT(height) * 4); |
981 | 1000 | if (data != 0) |
982 | 1001 | { |
@@ -1064,6 +1083,8 @@ to WIDTH by HEIGHT pixels. | ||
1064 | 1083 | { |
1065 | 1084 | image_t copy; |
1066 | 1085 | |
1086 | + if (debug_images & DB_IMAGES_OPS) | |
1087 | + DB(("%s\n", __FUNCTION__)); | |
1067 | 1088 | rep_DECLARE1 (img, IMAGEP); |
1068 | 1089 | rep_DECLARE (2, w, rep_INTP (w) && rep_INT (w) > 0); |
1069 | 1090 | rep_DECLARE (3, h, rep_INTP (h) && rep_INT (h) > 0); |
@@ -1256,6 +1277,8 @@ image_channels (Lisp_Image *im) | ||
1256 | 1277 | void |
1257 | 1278 | image_changed (Lisp_Image *im) |
1258 | 1279 | { |
1280 | + if (debug_images) | |
1281 | + DB(("%s %x\n", __FUNCTION__, im)); | |
1259 | 1282 | #if defined NEED_PIXMAP_CACHE |
1260 | 1283 | pixmap_cache_flush_image (im); |
1261 | 1284 | #endif |
@@ -1292,6 +1315,7 @@ do_scale (GdkPixbuf *src, int src_x, int src_y, int src_w, int src_h, | ||
1292 | 1315 | } |
1293 | 1316 | #endif |
1294 | 1317 | |
1318 | +extern int debug_cache; | |
1295 | 1319 | void |
1296 | 1320 | image_render (Lisp_Image *image, int width, int height, |
1297 | 1321 | Pixmap *pixmap, Pixmap *mask) |
@@ -1316,6 +1340,17 @@ image_render (Lisp_Image *image, int width, int height, | ||
1316 | 1340 | |
1317 | 1341 | if (pixmap_cache_ref (image, width, height, pixmap, mask)) |
1318 | 1342 | return; |
1343 | + else { | |
1344 | + if ((debug_images & DB_IMAGES_RENDER) || debug_cache) | |
1345 | + { | |
1346 | + repv name = Fimage_get(image, Qfile); | |
1347 | + DB(("%s: %s%s (w %d h %d) not found%s in the cache\n", __FUNCTION__, | |
1348 | + image_color,rep_STRINGP(name)?rep_STR(name):"???", width, height,color_reset)); | |
1349 | + } | |
1350 | + else | |
1351 | + if (debug_images) | |
1352 | + DB(("%s$%s",image_color, color_reset)); /* dollars -> cache miss ? */ | |
1353 | + } | |
1319 | 1354 | |
1320 | 1355 | /* XXX handle cases where combined image borders are larger |
1321 | 1356 | XXX than the destination image.. */ |
@@ -1323,8 +1358,12 @@ image_render (Lisp_Image *image, int width, int height, | ||
1323 | 1358 | if (im_width != width || im_height != height) |
1324 | 1359 | { |
1325 | 1360 | /* need to scale to width by height */ |
1326 | - | |
1327 | 1361 | int border[4]; |
1362 | + | |
1363 | + if (debug_images & DB_IMAGES_CREATE) | |
1364 | + DB(("%s: need to scale to width by height\n", __FUNCTION__)); | |
1365 | + else if (debug_images) | |
1366 | + DB(("%s=%s",image_color, color_reset)); /* dollars -> cache miss ? */ | |
1328 | 1367 | border[0] = image->border[0]; |
1329 | 1368 | border[1] = image->border[1]; |
1330 | 1369 | border[2] = image->border[2]; |
@@ -1446,6 +1485,8 @@ image_render (Lisp_Image *image, int width, int height, | ||
1446 | 1485 | void |
1447 | 1486 | image_free_pixmaps (Lisp_Image *image, Pixmap pixmap, Pixmap mask) |
1448 | 1487 | { |
1488 | + if (debug_images & DB_IMAGES_GC) | |
1489 | + DB(("%s\n", __FUNCTION__)); | |
1449 | 1490 | #if defined NEED_PIXMAP_CACHE |
1450 | 1491 | pixmap_cache_unref (image, pixmap, mask); |
1451 | 1492 | #endif |
@@ -1722,6 +1763,8 @@ image_prin (repv stream, repv obj) | ||
1722 | 1763 | static void |
1723 | 1764 | image_mark (repv obj) |
1724 | 1765 | { |
1766 | + if (debug_images & DB_WINDOWS_GC) | |
1767 | + DB(("%s\n", __FUNCTION__)); | |
1725 | 1768 | rep_MARKVAL(VIMAGE(obj)->plist); |
1726 | 1769 | } |
1727 | 1770 |
@@ -1739,10 +1782,16 @@ image_sweep (void) | ||
1739 | 1782 | pixmap_cache_flush_image (w); |
1740 | 1783 | #endif |
1741 | 1784 | #if defined HAVE_IMLIB |
1785 | + if (debug_images) | |
1786 | + DB(("%s -> Imlib_kill_image \n", __FUNCTION__)); | |
1742 | 1787 | Imlib_kill_image (imlib_id, w->image); |
1743 | 1788 | #elif defined HAVE_GDK_PIXBUF |
1789 | + if (debug_images) | |
1790 | + DB(("%s -> gdk_pixbuf_unref\n", __FUNCTION__)); | |
1744 | 1791 | gdk_pixbuf_unref (w->image); |
1745 | 1792 | #endif |
1793 | + if (debug_images) | |
1794 | + DB(("%s freeing %x\n", __FUNCTION__, w)); | |
1746 | 1795 | rep_FREE_CELL(w); |
1747 | 1796 | } |
1748 | 1797 | else |