aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2006-06-16 11:43:04 +0000
committerKim F. Storm2006-06-16 11:43:04 +0000
commit1e99743b70be082c238c63fb097dc17ace7d2f66 (patch)
tree23cbc4a13f38c1240dca67ed5f0d224ca82055e3 /src
parentdf05d913fa6d8fa448eec73de13900d73b68cc50 (diff)
downloademacs-1e99743b70be082c238c63fb097dc17ace7d2f66.tar.gz
emacs-1e99743b70be082c238c63fb097dc17ace7d2f66.zip
(pitx): Show composition parameters.
(pgx, pg): New commands to print a glyph structure. (pgi, pgn): New commands to print specific/next glyph. (pgrowx, pgrow): New commands to print all glyphs in a row.
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit129
1 files changed, 123 insertions, 6 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 04581efcbb1..810458ea897 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -190,12 +190,8 @@ define pitx
190 printf " ch=[%d,%d]", $it->c, $it->len 190 printf " ch=[%d,%d]", $it->c, $it->len
191 end 191 end
192 else 192 else
193 if ($it->what == IT_IMAGE) 193 printf " "
194 printf " IMAGE=%d", $it->image_id 194 output $it->what
195 else
196 printf " "
197 output $it->what
198 end
199 end 195 end
200 if ($it->method != GET_FROM_BUFFER) 196 if ($it->method != GET_FROM_BUFFER)
201 printf " next=" 197 printf " next="
@@ -203,6 +199,12 @@ define pitx
203 if ($it->method == GET_FROM_STRING) 199 if ($it->method == GET_FROM_STRING)
204 printf "[%d]", $it->current.string_pos.charpos 200 printf "[%d]", $it->current.string_pos.charpos
205 end 201 end
202 if ($it->method == GET_FROM_IMAGE)
203 printf "[%d]", $it->image_id
204 end
205 if ($it->method == GET_FROM_COMPOSITION)
206 printf "[%d,%d,%d]", $it->cmp_id, $it->len, $it->cmp_len
207 end
206 end 208 end
207 printf "\n" 209 printf "\n"
208 if ($it->region_beg_charpos >= 0) 210 if ($it->region_beg_charpos >= 0)
@@ -372,6 +374,121 @@ document pwin
372Pretty print window structure w. 374Pretty print window structure w.
373end 375end
374 376
377define pgx
378 set $g = $arg0
379 if ($g->type == CHAR_GLYPH)
380 if ($g->u.ch >= ' ' && $g->u.ch < 127)
381 printf "CHAR[%c]", $g->u.ch
382 else
383 printf "CHAR[0x%x]", $g->u.ch
384 end
385 end
386 if ($g->type == COMPOSITE_GLYPH)
387 printf "COMP[%d]", $g->u.cmp_id
388 end
389 if ($g->type == IMAGE_GLYPH)
390 printf "IMAGE[%d]", $g->u.img_id
391 end
392 if ($g->type == STRETCH_GLYPH)
393 printf "STRETCH[%d+%d]", $g->u.stretch.height, $g->u.stretch.ascent
394 end
395 xgettype ($g->object)
396 if ($type == Lisp_String)
397 printf " str=%x[%d]", $g->object, $g->charpos
398 else
399 printf " pos=%d", $g->charpos
400 end
401 printf " w=%d a+d=%d+%d", $g->pixel_width, $g->ascent, $g->descent
402 if ($g->face_id != DEFAULT_FACE_ID)
403 printf " face=%d", $g->face_id
404 end
405 if ($g->voffset)
406 printf " vof=%d", $g->voffset
407 end
408 if ($g->multibyte_p)
409 printf " MB"
410 end
411 if ($g->padding_p)
412 printf " PAD"
413 end
414 if ($g->glyph_not_available_p)
415 printf " N/A"
416 end
417 if ($g->overlaps_vertically_p)
418 printf " OVL"
419 end
420 if ($g->left_box_line_p)
421 printf " ["
422 end
423 if ($g->right_box_line_p)
424 printf " ]"
425 end
426 if ($g->slice.x || $g->slice.y || $g->slice.width || $g->slice.height)
427 printf " slice=%d,%d,%d,%d" ,$g->slice.x, $g->slice.y, $g->slice.width, $g->slice.height
428 end
429 printf "\n"
430end
431document pgx
432Pretty print a glyph structure.
433Takes one argument, a pointer to a glyph structure
434end
435
436define pg
437 set $pgidx = 0
438 pgx glyph
439end
440document pg
441Pretty print glyph structure glyph.
442end
443
444define pgi
445 set $pgidx = $arg0
446 pgx (&glyph[$pgidx])
447end
448document pgi
449Pretty print glyph structure glyph[I].
450Takes one argument, a integer I.
451end
452
453define pgn
454 set $pgidx = $pgidx + 1
455 pgx (&glyph[$pgidx])
456end
457document pgn
458Pretty print next glyph structure.
459end
460
461define pgrowx
462 set $row = $arg0
463 set $area = 0
464 set $xofs = $row->x
465 while ($area < 3)
466 set $used = $row->used[$area]
467 if ($used > 0)
468 set $gl0 = $row->glyphs[$area]
469 set $pgidx = 0
470 printf "%s: %d glyphs\n", ($area == 0 ? "LEFT" : $area == 2 ? "RIGHT" : "TEXT"), $used
471 while ($pgidx < $used)
472 printf "%3d %4d: ", $pgidx, $xofs
473 pgx $gl0[$pgidx]
474 set $xofs = $xofs + $gl0[$pgidx]->pixel_width
475 set $pgidx = $pgidx + 1
476 end
477 end
478 set $area = $area + 1
479 end
480end
481document pgrowx
482Pretty print all glyphs in a row structure.
483Takes one argument, a pointer to a row structure.
484end
485
486define pgrow
487 pgrowx row
488end
489document pgrow
490Pretty print all glyphs in row structure row.
491end
375 492
376define xtype 493define xtype
377 xgettype $ 494 xgettype $