• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Japanese translation of message catalog for Sawfish Window-Manager


Commit MetaInfo

修訂7514eef2c30ad481877e90589b7bb8f73b04d25a (tree)
時間2010-12-19 13:32:18
作者Michal Maruska <mmaruska@gmai...>
CommiterMichal Maruska

Log Message

debug images.c

Change Summary

差異

--- a/src/images.c
+++ b/src/images.c
@@ -108,9 +108,12 @@ make_image (image_t im, repv plist)
108108 Lisp_Image *f;
109109 for (f = image_list; f != 0; f = f->next)
110110 {
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__));
112114 /* XXX do what with the plist..? */
113115 return rep_VAL(f);
116+ }
114117 }
115118 f = rep_ALLOC_CELL(sizeof(Lisp_Image));
116119 rep_data_after_gc += sizeof (Lisp_Image) + IMAGE_T_SIZE (im);
@@ -212,6 +215,8 @@ string). PLIST defines the property list of the image.
212215 rep_DECLARE1(file, rep_STRINGP);
213216 if (dpy == 0)
214217 return Qnil;
218+ if (debug_images & DB_IMAGES_CREATE)
219+ DB(("%s %s\n", __FUNCTION__, rep_STR(file)));
215220 rep_PUSHGC(gc_plist, plist);
216221 file = find_image_file (file, &delete);
217222 rep_POPGC;
@@ -242,6 +247,8 @@ make-image-from-x-drawable ID [MASK-ID]
242247 unsigned w, h, bdr, dp;
243248 image_t im;
244249
250+ if (debug_images & DB_IMAGES_CREATE)
251+ DB(("%s\n", __FUNCTION__));
245252 rep_DECLARE1 (id, rep_INTP);
246253 d = rep_INT (id);
247254 if (rep_INTP (mask_id))
@@ -388,6 +395,8 @@ Return a new image object, a clone of SOURCE-IMAGE.
388395 {
389396 image_t im;
390397 rep_DECLARE1(source, IMAGEP);
398+ if (debug_images & DB_IMAGES_OPS)
399+ DB(("%s\n", __FUNCTION__));
391400 #if defined HAVE_IMLIB
392401 im = Imlib_clone_image (imlib_id, VIMAGE(source)->image);
393402 #elif defined HAVE_GDK_PIXBUF
@@ -525,6 +534,9 @@ Return the value of the property named PROPERTY (a symbol) of IMAGE.
525534 repv plist;
526535 rep_DECLARE1(image, IMAGEP);
527536 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"));
528540 while (rep_CONSP(plist) && rep_CONSP(rep_CDR(plist)))
529541 {
530542 if (rep_CAR(plist) == prop
@@ -549,6 +561,8 @@ Set the value of the property named PROPERTY (a symbol) of IMAGE to VALUE.
549561 repv plist;
550562 rep_DECLARE1(image, IMAGEP);
551563 plist = VIMAGE(image)->plist;
564+ if (debug_images & DB_IMAGES_GET)
565+ DB(("%s\n", __FUNCTION__));
552566 while (rep_CONSP(plist) && rep_CONSP(rep_CDR(plist)))
553567 {
554568 if (rep_CAR(plist) == prop
@@ -585,7 +599,8 @@ Return (WIDTH . HEIGHT) representing the dimensions in pixels of IMAGE.
585599 ::end:: */
586600 {
587601 rep_DECLARE1(img, IMAGEP);
588-
602+ if (debug_images & DB_IMAGES_GET)
603+ DB(("%s\n", __FUNCTION__));
589604 return Fcons (rep_MAKE_INT(image_width(VIMAGE(img))),
590605 rep_MAKE_INT(image_height(VIMAGE(img))));
591606 }
@@ -670,6 +685,8 @@ are resized.
670685 ::end:: */
671686 {
672687 rep_DECLARE1(img, IMAGEP);
688+ if (debug_images & DB_IMAGES_GET)
689+ DB(("%s\n", __FUNCTION__));
673690 #if !defined (HAVE_IMLIB)
674691 VIMAGE(img)->border[0] = rep_INTP (left) ? rep_INT (left) : 0;
675692 VIMAGE(img)->border[1] = rep_INTP (right) ? rep_INT (right) : 0;
@@ -977,6 +994,8 @@ defines the color of its pixels.
977994 rep_INT(width), rep_INT(height));
978995 rep_free (data);
979996 #elif defined HAVE_GDK_PIXBUF
997+ if (debug_images & DB_IMAGES_CREATE)
998+ DB(("make-sized-image: gdk constant color!\n"));
980999 data = rep_alloc (rep_INT(width) * rep_INT(height) * 4);
9811000 if (data != 0)
9821001 {
@@ -1064,6 +1083,8 @@ to WIDTH by HEIGHT pixels.
10641083 {
10651084 image_t copy;
10661085
1086+ if (debug_images & DB_IMAGES_OPS)
1087+ DB(("%s\n", __FUNCTION__));
10671088 rep_DECLARE1 (img, IMAGEP);
10681089 rep_DECLARE (2, w, rep_INTP (w) && rep_INT (w) > 0);
10691090 rep_DECLARE (3, h, rep_INTP (h) && rep_INT (h) > 0);
@@ -1256,6 +1277,8 @@ image_channels (Lisp_Image *im)
12561277 void
12571278 image_changed (Lisp_Image *im)
12581279 {
1280+ if (debug_images)
1281+ DB(("%s %x\n", __FUNCTION__, im));
12591282 #if defined NEED_PIXMAP_CACHE
12601283 pixmap_cache_flush_image (im);
12611284 #endif
@@ -1292,6 +1315,7 @@ do_scale (GdkPixbuf *src, int src_x, int src_y, int src_w, int src_h,
12921315 }
12931316 #endif
12941317
1318+extern int debug_cache;
12951319 void
12961320 image_render (Lisp_Image *image, int width, int height,
12971321 Pixmap *pixmap, Pixmap *mask)
@@ -1316,6 +1340,17 @@ image_render (Lisp_Image *image, int width, int height,
13161340
13171341 if (pixmap_cache_ref (image, width, height, pixmap, mask))
13181342 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+ }
13191354
13201355 /* XXX handle cases where combined image borders are larger
13211356 XXX than the destination image.. */
@@ -1323,8 +1358,12 @@ image_render (Lisp_Image *image, int width, int height,
13231358 if (im_width != width || im_height != height)
13241359 {
13251360 /* need to scale to width by height */
1326-
13271361 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 ? */
13281367 border[0] = image->border[0];
13291368 border[1] = image->border[1];
13301369 border[2] = image->border[2];
@@ -1446,6 +1485,8 @@ image_render (Lisp_Image *image, int width, int height,
14461485 void
14471486 image_free_pixmaps (Lisp_Image *image, Pixmap pixmap, Pixmap mask)
14481487 {
1488+ if (debug_images & DB_IMAGES_GC)
1489+ DB(("%s\n", __FUNCTION__));
14491490 #if defined NEED_PIXMAP_CACHE
14501491 pixmap_cache_unref (image, pixmap, mask);
14511492 #endif
@@ -1722,6 +1763,8 @@ image_prin (repv stream, repv obj)
17221763 static void
17231764 image_mark (repv obj)
17241765 {
1766+ if (debug_images & DB_WINDOWS_GC)
1767+ DB(("%s\n", __FUNCTION__));
17251768 rep_MARKVAL(VIMAGE(obj)->plist);
17261769 }
17271770
@@ -1739,10 +1782,16 @@ image_sweep (void)
17391782 pixmap_cache_flush_image (w);
17401783 #endif
17411784 #if defined HAVE_IMLIB
1785+ if (debug_images)
1786+ DB(("%s -> Imlib_kill_image \n", __FUNCTION__));
17421787 Imlib_kill_image (imlib_id, w->image);
17431788 #elif defined HAVE_GDK_PIXBUF
1789+ if (debug_images)
1790+ DB(("%s -> gdk_pixbuf_unref\n", __FUNCTION__));
17441791 gdk_pixbuf_unref (w->image);
17451792 #endif
1793+ if (debug_images)
1794+ DB(("%s freeing %x\n", __FUNCTION__, w));
17461795 rep_FREE_CELL(w);
17471796 }
17481797 else