Skip to content

axelexic/ViewHierarchyInspector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shared library to print the entire view heierarchy (and show View frame borders) 
of an application whose source code is not available. It's useful for 
understanding how the application was designed, which parts were custom drawn, 
and which were just off the shelf AppKit classes.

There are two targets in Xcode: One using GC another one using ARC or
MRR. The library is inserted as DYLD_INSERT_LIBRARIES and it will print the
entire view hierarchy on command line. Setting the environment variable 
SHOW_FRAMES=1 will cause the entire UI to print a border and view frame 
dimentions. See the screen shot included. 

Here's the output of running it with GrargeBand (for GarageBand, the 
library must be compiled to 32-bit, without ARC, since that's what 
GarageBand/i386 "non-fragile ABI" understands.)


$ SHOW_FRAMES=1 DYLD_INSERT_LIBRARIES=/tmp/ViewHierarchyInspector.dylib /Applications/GarageBand.app/Contents/MacOS/GarageBand

.... <Bring the main song window up....

2012-04-13 12:26:11.597 GarageBand[1604:4303] Traversing window: 0x1a7d7ed0 <YehKyaHuaa.band>
 DfWoodFrameView <- EcFrameView <- NSView <{{0, 0}, {1440, 900}}>
     EcWindowButton <- NSButton <{{22, 879}, {14, 16}}>
     EcWindowButton <- NSButton <{{43, 879}, {14, 16}}>
     EcWindowButton <- NSButton <{{64, 879}, {14, 16}}>
     EcWindowButton <- NSButton <{{1403, 879}, {16, 17}}>
     MABackgroundView <- NSView <{{17, 0}, {1405, 875}}>
         MABackgroundView <- NSView <{{0, 0}, {1405, 73}}>
             NSView <-  <{{408, 7}, {659, 61}}>
                 NSView <-  <{{551, 11}, {108, 34}}>
                     MASlider <- NSSlider <{{1, 0}, {106, 15}}>
                     MALevelMeter <- NSControl <{{0, 16}, {108, 18}}>
                 NSImageView <-  <{{213, 4}, {224, 52}}>
                     DfLCDModeControl <- DfAbstractLCDSongControl <- NSControl <{{7, 13}, {26, 26}}>
                     NSImageView <-  <{{216, 5}, {3, 3}}>
                     MAButton <- NSButton <{{11, 39}, {18, 10}}>
                     MAButton <- NSButton <{{11, 3}, {18, 10}}>
                     DfLCDTabView <- NSTabView <{{33, 0}, {185, 51}}>
                         NSView <-  <{{0, 0}, {185, 51}}>
                             MATextField <- NSTextField <{{9, 37}, {80, 13}}>
                             MATextField <- NSTextField <{{9, 1}, {31, 13}}>
                             MATextField <- NSTextField <{{71, 1}, {31, 13}}>
                             DfNumberEditorControl <- EcCellGroupControl <- NSControl <{{10, 10}, {173, 30}}>
                 MAButton <- NSButton <{{0, 13}, {41, 34}}>
                 MAButton <- NSButton <{{79, 13}, {38, 34}}>
                 MAButton <- NSButton <{{41, 13}, {38, 34}}>
                 MAButton <- NSButton <{{117, 13}, {38, 34}}>
                 MAButton <- NSButton <{{453, 13}, {41, 34}}>
                 MAButton <- NSButton <{{494, 13}, {42, 34}}>
                 MAButton <- NSButton <{{155, 13}, {42, 34}}>
             MAButton <- NSButton <{{60, 23}, {36, 27}}>
             MAButton <- NSButton <{{1290, 23}, {35, 27}}>
             MAButton <- NSButton <{{1325, 23}, {35, 27}}>
             MAButton <- NSButton <{{1360, 23}, {35, 27}}>
             MAButton <- NSButton <{{10, 23}, {36, 27}}>
         MAAccessoryContainerView <- NSView <{{0, 73}, {1405, 802}}>
             NSView <-  <{{1042, 0}, {363, 802}}>
                 DfTabView <- NSTabView <{{1, 0}, {362, 802}}>
                     NSView <-  <{{0, 0}, {362, 802}}>
                         MAButton <- NSButton <{{0, 770}, {181, 32}}>
                         MAButton <- NSButton <{{181, 770}, {181, 32}}>
                         NSTabView <-  <{{0, 0}, {362, 770}}>
                             MABorderView <- MABackgroundView <- NSView <{{0, 0}, {362, 770}}>
                                 MAButton <- NSButton <{{14, 11}, {163, 26}}>
                                 MAButton <- NSButton <{{186, 11}, {163, 26}}>
                                 DfTrackInfoGuitarMainView <- DfActionView <- NSView <{{0, 47}, {362, 723}}>
                                     MAButton <- NSButton <{{310, 693}, {46, 20}}>
                                     MAPopUpButton <- NSPopUpButton <{{65, 693}, {232, 20}}>
                 MAAccessorySplitter <- DfBorderView <- NSView <{{0, 0}, {1, 802}}>
             MAAccessoryContainerView <- NSView <{{0, 0}, {1042, 802}}>
                 NSView <-  <{{0, 0}, {1042, 802}}>
                     MASlider <- NSSlider <{{0, 0}, {307, 15}}>
                     DfArrangeScrollView <- DfSpecialScrollView <- ECScrollView <- NSScrollView <{{307, 0}, {735, 802}}>
                         ECSpecialClipView <- NSClipView <{{0, 16}, {720, 771}}>
                             DfArrangeRegionView <- DfArrangeView <- DfDropActionView <- DfActionView <- NSView <{{0, 0}, {2138, 771}}>
                         MAScroller <- NSScroller <{{0, 787}, {720, 15}}>
                         MAScroller <- NSScroller <{{720, 16}, {15, 771}}>
                         MAButton <- NSButton <{{720, 0}, {16, 16}}>
                         MAButton <- NSButton <{{720, 787}, {16, 17}}>
                         ECSpecialClipView <- NSClipView <{{0, 0}, {720, 16}}>
                             DfRulerView <- DfActionView <- NSView <{{0, 0}, {2138, 16}}>
                     DfArrangeScrollView <- DfSpecialScrollView <- ECScrollView <- NSScrollView <{{0, 15}, {307, 771}}>
                         NSClipView <-  <{{0, 0}, {307, 771}}>
                             DfArrangeTrackView <- DfDropActionView <- DfActionView <- NSView <{{0, 0}, {307, 771}}>
                         NSScroller <-  <{{-100, -100}, {15, 341}}>
                         NSScroller <-  <{{-100, -100}, {199, 15}}>
                         ECSpecialClipView <- NSClipView <{{0, 0}, {307, 0}}>
                             DfArrangeTrackCycleHeader <- MABorderView <- MABackgroundView <- NSView <{{0, 0}, {307, 0}}>
                     MAHeaderView <- NSTextField <{{0, 786}, {307, 16}}>

About

LD_PRELOAD to inspect the view hierarchy of applications like GarageBand.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published