[St] add st_describe_actor, for debugging

This can be used when adding debug printfs, to get clear descriptions of
actors.

Also update the Looking Glass inspector to use it

https://bugzilla.gnome.org/show_bug.cgi?id=621668
This commit is contained in:
Dan Winship
2010-06-11 13:45:43 -04:00
parent 9baf8e19ea
commit 792dc489ee
3 changed files with 105 additions and 8 deletions

View File

@ -402,14 +402,10 @@ Inspector.prototype = {
let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL,
stageX,
stageY);
let id, style_class;
if (target instanceof St.Widget) {
id = target.get_theme_node().get_element_id();
style_class = target.get_theme_node().get_element_class();
}
let position = '<inspect x: ' + stageX + ' y: ' + stageY + '>';
let style = '<style id: ' + id + ' class: ' + style_class + '>';
displayText.text = position + ' ' + style + ' ' + target;
let position = '[inspect x: ' + stageX + ' y: ' + stageY + ']';
displayText.text = '';
let description = St.describe_actor(target);
displayText.text = position + ' ' + description;
if (borderPaintTarget != null)
borderPaintTarget.disconnect(borderPaintId);
borderPaintTarget = target;