diff options
Diffstat (limited to 'hierarchyviewer2')
-rw-r--r-- | hierarchyviewer2/app/.classpath | 1 | ||||
-rw-r--r-- | hierarchyviewer2/app/Android.mk | 27 | ||||
-rw-r--r-- | hierarchyviewer2/app/NOTICE | 190 | ||||
-rwxr-xr-x | hierarchyviewer2/app/README | 69 | ||||
-rwxr-xr-x | hierarchyviewer2/app/etc/hierarchyviewer | 8 | ||||
-rwxr-xr-x | hierarchyviewer2/app/etc/hierarchyviewer.bat | 2 | ||||
-rw-r--r-- | hierarchyviewer2/app/src/Android.mk | 33 | ||||
-rw-r--r-- | hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java | 4 | ||||
-rw-r--r-- | hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java | 98 | ||||
-rw-r--r-- | hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java | 2 | ||||
-rw-r--r-- | hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java | 4 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/NOTICE | 190 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk | 2 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java | 13 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DumpDisplayListAction.java | 56 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java | 14 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java | 41 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/auto-refresh.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/auto-refresh.png) | bin | 541 -> 541 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/capture-psd.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/capture-psd.png) | bin | 339 -> 339 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view-selected.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/device-view-selected.png) | bin | 254 -> 254 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/device-view.png) | bin | 228 -> 228 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/display.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/display.png) | bin | 946 -> 946 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/filtered.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/filtered.png) | bin | 9242 -> 9242 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/green.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/green.png) | bin | 302 -> 302 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/inspect-screenshot.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/inspect-screenshot.png) | bin | 412 -> 412 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/invalidate.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/invalidate.png) | bin | 391 -> 391 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-all-views.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-all-views.png) | bin | 728 -> 728 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-overlay.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-overlay.png) | bin | 549 -> 549 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-view-hierarchy.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-view-hierarchy.png) | bin | 288 -> 288 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/not-selected.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/not-selected.png) | bin | 12468 -> 12468 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-black.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/on-black.png) | bin | 157 -> 157 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-white.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/on-white.png) | bin | 158 -> 158 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view-selected.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/pixel-perfect-view-selected.png) | bin | 734 -> 734 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/pixel-perfect-view.png) | bin | 733 -> 733 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/red.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/red.png) | bin | 383 -> 383 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/refresh-windows.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/refresh-windows.png) | bin | 872 -> 872 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/request-layout.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/request-layout.png) | bin | 223 -> 223 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/save.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/save.png) | bin | 360 -> 360 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-128.png | bin | 0 -> 17512 bytes | |||
-rwxr-xr-x | hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-16.png | bin | 0 -> 880 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered-small.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-filtered-small.png) | bin | 5182 -> 5182 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-filtered.png) | bin | 9015 -> 9015 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-small.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-small.png) | bin | 12611 -> 12611 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected.png) | bin | 12159 -> 12159 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-extras.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/show-extras.png) | bin | 330 -> 330 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-overlay.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/show-overlay.png) | bin | 958 -> 958 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view-selected.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/tree-view-selected.png) | bin | 276 -> 276 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/tree-view.png) | bin | 281 -> 281 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/images/yellow.png (renamed from hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/yellow.png) | bin | 255 -> 255 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about-small.jpg | bin | 1578 -> 0 bytes | |||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about.jpg | bin | 17237 -> 0 bytes |
51 files changed, 668 insertions, 86 deletions
diff --git a/hierarchyviewer2/app/.classpath b/hierarchyviewer2/app/.classpath index d75889a..c5a657c 100644 --- a/hierarchyviewer2/app/.classpath +++ b/hierarchyviewer2/app/.classpath @@ -7,5 +7,6 @@ <classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/> <classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/> <classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/> + <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swtmenubar.jar" sourcepath="/ANDROID_SRC/sdk/swtmenubar/src"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/hierarchyviewer2/app/Android.mk b/hierarchyviewer2/app/Android.mk index 2927f1d..0e00273 100644 --- a/hierarchyviewer2/app/Android.mk +++ b/hierarchyviewer2/app/Android.mk @@ -12,6 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -HIERARCHYVIEWERAPP_LOCAL_DIR := $(call my-dir) -include $(HIERARCHYVIEWERAPP_LOCAL_DIR)/etc/Android.mk -include $(HIERARCHYVIEWERAPP_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := etc/manifest.txt + +LOCAL_JAVA_LIBRARIES := \ + ddmlib \ + ddmuilib \ + hierarchyviewerlib \ + swt \ + org.eclipse.jface_3.4.2.M20090107-0800 \ + org.eclipse.core.commands_3.4.0.I20080509-2000 \ + sdklib \ + swtmenubar + +LOCAL_MODULE := hierarchyviewer2 + +include $(BUILD_HOST_JAVA_LIBRARY) + +# Build all sub-directories +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/hierarchyviewer2/app/NOTICE b/hierarchyviewer2/app/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/hierarchyviewer2/app/NOTICE @@ -0,0 +1,190 @@ + + Copyright (c) 2005-2008, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/hierarchyviewer2/app/README b/hierarchyviewer2/app/README new file mode 100755 index 0000000..c00ef99 --- /dev/null +++ b/hierarchyviewer2/app/README @@ -0,0 +1,69 @@ +Using the Eclipse project HierarchyViewer +----------------------------------------- + +HierarchyViewer requires some external libraries to compile. +If you build HierarchyViewer using the makefile, you have nothing +to configure. However if you want to develop on HierarchyViewer +using Eclipse, you need to perform the following configuration. + + +------- +1- Projects required in Eclipse +------- + +To run HierarchyViewer from Eclipse, you need to import the following 5 projects: + + - sdk/hierarchyviewer2/app + - sdk/hierarchyviewer2/libs/hierarchyviewerlib/ + - sdk/ddms/libs/ddmlib + - sdk/ddms/libs/ddmuilib + - sdk/sdkmanager/libs/sdklib + + +------- +2- HierarchyViewer requires some SWT JARs to compile. +------- + +SWT is available in the tree under prebuild/<platform>/swt + +Because the build path cannot contain relative path that are not inside +the project directory, the .classpath file references a user library +called ANDROID_SWT. + +In order to compile the project: +- Open Preferences > Java > Build Path > User Libraries + +- Create a new user library named ANDROID_SWT +- Add the following 4 JAR files: + + - prebuilt/<platform>/swt/swt.jar + - prebuilt/common/eclipse/org.eclipse.core.commands_3.*.jar + - prebuilt/common/eclipse/org.eclipse.equinox.common_3.*.jar + - prebuilt/common/eclipse/org.eclipse.jface_3.*.jar + + +------- +3- HierarchyViewer also requires the compiled SwtMenuBar library. +------- + +Build the swtmenubar library: +$ cd $TOP (top of Android tree) +$ . build/envsetup.sh && lunch sdk-eng +$ sdk/eclipse/scripts/create_sdkman_symlinks.sh + +Define a classpath variable in Eclipse: +- Open Preferences > Java > Build Path > Classpath Variables +- Create a new classpath variable named ANDROID_OUT_FRAMEWORK +- Set its folder value to <Android tree>/out/host/<platform>/framework +- Create a new classpath variable named ANDROID_SRC +- Set its folder value to <Android tree> + +You might need to clean the ddms project (Project > Clean...) after +you add the new classpath variable, otherwise previous errors might not +go away automatically. + +The ANDROID_SRC part should be optional. It allows you to have access to +the SwtMenuBar generic parts from the Java editor. + +-- +EOF diff --git a/hierarchyviewer2/app/etc/hierarchyviewer b/hierarchyviewer2/app/etc/hierarchyviewer index 9f31701..82304dc 100755 --- a/hierarchyviewer2/app/etc/hierarchyviewer +++ b/hierarchyviewer2/app/etc/hierarchyviewer @@ -76,7 +76,7 @@ if [ `uname` = "Linux" ]; then export GDK_NATIVE_WINDOWS=true fi -jarpath="$frameworkdir/$jarfile" +jarpath="$frameworkdir/$jarfile:$frameworkdir/swtmenubar.jar" # Figure out the path to the swt.jar for the current architecture. # if ANDROID_SWT is defined, then just use this. @@ -103,4 +103,8 @@ fi # need to use "java.ext.dirs" because "-jar" causes classpath to be ignored # might need more memory, e.g. -Xmx128M -exec "$javaCmd" -Xmx512M $os_opts $java_debug -Dcom.android.hierarchyviewer.bindir="$progdir" -classpath "$jarpath:$swtpath/swt.jar" com.android.hierarchyviewer.HierarchyViewerApplication "$@" +exec "$javaCmd" \ + -Xmx512M $os_opts $java_debug \ + -Dcom.android.hierarchyviewer.bindir="$progdir" \ + -classpath "$jarpath:$swtpath/swt.jar" \ + com.android.hierarchyviewer.HierarchyViewerApplication "$@" diff --git a/hierarchyviewer2/app/etc/hierarchyviewer.bat b/hierarchyviewer2/app/etc/hierarchyviewer.bat index 0876d2f..8a14957 100755 --- a/hierarchyviewer2/app/etc/hierarchyviewer.bat +++ b/hierarchyviewer2/app/etc/hierarchyviewer.bat @@ -49,7 +49,7 @@ if debug NEQ "%1" goto NoDebug shift 1
:NoDebug
-set jarpath=%frameworkdir%%jarfile%;%frameworkdir%hierarchyviewerlib.jar
+set jarpath=%frameworkdir%%jarfile%;%frameworkdir%hierarchyviewerlib.jar;%frameworkdir%swtmenubar.jar
if not defined ANDROID_SWT goto QueryArch
set swt_path=%ANDROID_SWT%
diff --git a/hierarchyviewer2/app/src/Android.mk b/hierarchyviewer2/app/src/Android.mk deleted file mode 100644 index 1f15bee..0000000 --- a/hierarchyviewer2/app/src/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2010 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_JAR_MANIFEST := ../etc/manifest.txt -LOCAL_JAVA_LIBRARIES := \ - ddmlib \ - ddmuilib \ - hierarchyviewerlib \ - swt \ - org.eclipse.jface_3.4.2.M20090107-0800 \ - org.eclipse.core.commands_3.4.0.I20080509-2000 \ - sdklib - -LOCAL_MODULE := hierarchyviewer2 - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java index 3f973e7..150c70a 100644 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java +++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java @@ -41,8 +41,8 @@ public class AboutDialog extends Dialog { public AboutDialog(Shell shell) { super(shell); ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - mSmallImage = imageLoader.loadImage("load-view-hierarchy.png", Display.getDefault()); //$NON-NLS-1$ - mAboutImage = imageLoader.loadImage("about.jpg", Display.getDefault()); //$NON-NLS-1$ + mSmallImage = imageLoader.loadImage("sdk-hierarchyviewer-16.png", Display.getDefault()); //$NON-NLS-1$ + mAboutImage = imageLoader.loadImage("sdk-hierarchyviewer-128.png", Display.getDefault()); //$NON-NLS-1$ } @Override diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java index 25943c4..bf18965 100644 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java +++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java @@ -26,6 +26,7 @@ import com.android.hierarchyviewer.util.ActionButton; import com.android.hierarchyviewerlib.HierarchyViewerDirector; import com.android.hierarchyviewerlib.actions.CapturePSDAction; import com.android.hierarchyviewerlib.actions.DisplayViewAction; +import com.android.hierarchyviewerlib.actions.DumpDisplayListAction; import com.android.hierarchyviewerlib.actions.InspectScreenshotAction; import com.android.hierarchyviewerlib.actions.InvalidateAction; import com.android.hierarchyviewerlib.actions.LoadOverlayAction; @@ -38,6 +39,8 @@ import com.android.hierarchyviewerlib.actions.RefreshWindowsAction; import com.android.hierarchyviewerlib.actions.RequestLayoutAction; import com.android.hierarchyviewerlib.actions.SavePixelPerfectAction; import com.android.hierarchyviewerlib.actions.SaveTreeViewAction; +import com.android.hierarchyviewerlib.device.DeviceBridge.ViewServerInfo; +import com.android.hierarchyviewerlib.models.DeviceSelectionModel; import com.android.hierarchyviewerlib.models.PixelPerfectModel; import com.android.hierarchyviewerlib.models.TreeViewModel; import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener; @@ -53,11 +56,15 @@ import com.android.hierarchyviewerlib.ui.PropertyViewer; import com.android.hierarchyviewerlib.ui.TreeView; import com.android.hierarchyviewerlib.ui.TreeViewControls; import com.android.hierarchyviewerlib.ui.TreeViewOverview; +import com.android.menubar.IMenuBarEnhancer; +import com.android.menubar.MenuBarEnhancer; +import com.android.menubar.IMenuBarEnhancer.MenuBarMode; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.window.ApplicationWindow; import org.eclipse.swt.SWT; +import org.eclipse.swt.SWTException; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.StackLayout; import org.eclipse.swt.events.SelectionEvent; @@ -81,8 +88,9 @@ import org.eclipse.swt.widgets.Shell; public class HierarchyViewerApplication extends ApplicationWindow { - private static final int INITIAL_WIDTH = 1024; - private static final int INITIAL_HEIGHT = 768; + private static final String APP_NAME = "Hierarchy Viewer"; + private static final int INITIAL_WIDTH = 1280; + private static final int INITIAL_HEIGHT = 800; private static HierarchyViewerApplication sMainWindow; @@ -119,6 +127,8 @@ public class HierarchyViewerApplication extends ApplicationWindow { private PixelPerfectLoupe mPixelPerfectLoupe; private Composite mTreeViewControls; + private ActionButton dumpDisplayList; + private HierarchyViewerDirector mDirector; /* @@ -148,9 +158,9 @@ public class HierarchyViewerApplication extends ApplicationWindow { @Override protected void configureShell(Shell shell) { super.configureShell(shell); - shell.setText("Hierarchy Viewer"); + shell.setText(APP_NAME); ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - Image image = imageLoader.loadImage("load-view-hierarchy.png", Display.getDefault()); //$NON-NLS-1$ + Image image = imageLoader.loadImage("sdk-hierarchyviewer-128.png", Display.getDefault()); //$NON-NLS-1$ shell.setImage(image); } @@ -162,7 +172,14 @@ public class HierarchyViewerApplication extends ApplicationWindow { public void run() { setBlockOnOpen(true); - open(); + try { + open(); + } catch (SWTException e) { + // Ignore "widget disposed" errors after we closed. + if (!getShell().isDisposed()) { + throw e; + } + } TreeViewModel.getModel().removeTreeChangeListener(mTreeChangeListener); PixelPerfectModel.getModel().removeImageChangeListener(mImageChangeListener); @@ -354,7 +371,7 @@ public class HierarchyViewerApplication extends ApplicationWindow { Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE); innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - GridLayout innerButtonPanelLayout = new GridLayout(6, true); + GridLayout innerButtonPanelLayout = new GridLayout(7, true); innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2; innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2; innerButtonPanel.setLayout(innerButtonPanelLayout); @@ -382,6 +399,10 @@ public class HierarchyViewerApplication extends ApplicationWindow { new ActionButton(innerButtonPanel, RequestLayoutAction.getAction()); requestLayout.setLayoutData(new GridData(GridData.FILL_BOTH)); + dumpDisplayList = + new ActionButton(innerButtonPanel, DumpDisplayListAction.getAction()); + dumpDisplayList.setLayoutData(new GridData(GridData.FILL_BOTH)); + SashForm mainSash = new SashForm(mTreeViewPanel, SWT.HORIZONTAL | SWT.SMOOTH); mainSash.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite treeViewContainer = new Composite(mainSash, SWT.BORDER); @@ -581,12 +602,16 @@ public class HierarchyViewerApplication extends ApplicationWindow { MenuManager mm = getMenuBarManager(); mm.removeAll(); - String os = System.getProperty("os.name"); //$NON-NLS-1$ - if (os.startsWith("Mac OS") == false) { //$NON-NLS-1$ - MenuManager file = new MenuManager("&File"); + MenuManager file = new MenuManager("&File"); + IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager( + APP_NAME, + getShell().getDisplay(), + file, + AboutAction.getAction(getShell()), + null /*preferencesAction*/, + QuitAction.getAction()); + if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) { mm.add(file); - - file.add(QuitAction.getAction()); } MenuManager device = new MenuManager("&Devices"); @@ -596,11 +621,6 @@ public class HierarchyViewerApplication extends ApplicationWindow { device.add(LoadViewHierarchyAction.getAction()); device.add(InspectScreenshotAction.getAction()); - MenuManager help = new MenuManager("&Help"); - mm.add(help); - - help.add(AboutAction.getAction(getShell())); - mm.updateAll(true); mDeviceViewButton.setSelection(true); @@ -626,12 +646,16 @@ public class HierarchyViewerApplication extends ApplicationWindow { MenuManager mm = getMenuBarManager(); mm.removeAll(); - String os = System.getProperty("os.name"); //$NON-NLS-1$ - if (os.startsWith("Mac OS") == false) { //$NON-NLS-1$ - MenuManager file = new MenuManager("&File"); + MenuManager file = new MenuManager("&File"); + IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager( + APP_NAME, + getShell().getDisplay(), + file, + AboutAction.getAction(getShell()), + null /*preferencesAction*/, + QuitAction.getAction()); + if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) { mm.add(file); - - file.add(QuitAction.getAction()); } MenuManager treeViewMenu = new MenuManager("&Tree View"); @@ -642,15 +666,18 @@ public class HierarchyViewerApplication extends ApplicationWindow { treeViewMenu.add(new Separator()); treeViewMenu.add(RefreshViewAction.getAction()); treeViewMenu.add(DisplayViewAction.getAction(getShell())); + // Only make the DumpDisplayList action visible if the protocol supports it. + ViewServerInfo info = DeviceSelectionModel.getModel().getSelectedDeviceInfo(); + if (info != null && info.protocolVersion >= 4) { + treeViewMenu.add(DumpDisplayListAction.getAction()); + dumpDisplayList.setVisible(true); + } else { + dumpDisplayList.setVisible(false); + } treeViewMenu.add(new Separator()); treeViewMenu.add(InvalidateAction.getAction()); treeViewMenu.add(RequestLayoutAction.getAction()); - MenuManager help = new MenuManager("&Help"); - mm.add(help); - - help.add(AboutAction.getAction(getShell())); - mm.updateAll(true); mDeviceViewButton.setSelection(false); @@ -676,12 +703,16 @@ public class HierarchyViewerApplication extends ApplicationWindow { MenuManager mm = getMenuBarManager(); mm.removeAll(); - String os = System.getProperty("os.name"); //$NON-NLS-1$ - if (os.startsWith("Mac OS") == false) { //$NON-NLS-1$ - MenuManager file = new MenuManager("&File"); + MenuManager file = new MenuManager("&File"); + IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager( + APP_NAME, + getShell().getDisplay(), + file, + AboutAction.getAction(getShell()), + null /*preferencesAction*/, + QuitAction.getAction()); + if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) { mm.add(file); - - file.add(QuitAction.getAction()); } MenuManager pixelPerfect = new MenuManager("&Pixel Perfect"); @@ -695,11 +726,6 @@ public class HierarchyViewerApplication extends ApplicationWindow { mm.add(pixelPerfect); - MenuManager help = new MenuManager("&Help"); - mm.add(help); - - help.add(AboutAction.getAction(getShell())); - mm.updateAll(true); mDeviceViewButton.setSelection(false); diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java index 0c7c7b2..332b2dc 100644 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java +++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java @@ -41,7 +41,7 @@ public class AboutAction extends Action implements ImageAction { this.mShell = shell; setAccelerator(SWT.MOD1 + 'A'); ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - mImage = imageLoader.loadImage("about-small.jpg", Display.getDefault()); //$NON-NLS-1$ + mImage = imageLoader.loadImage("sdk-hierarchyviewer-16.png", Display.getDefault()); //$NON-NLS-1$ setImageDescriptor(ImageDescriptor.createFromImage(mImage)); setToolTipText("Shows the about dialog"); } diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java index 4681c40..ca3c689 100644 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java +++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java @@ -73,4 +73,8 @@ public class ActionButton implements IPropertyChangeListener, SelectionListener public void addSelectionListener(SelectionListener listener) { mButton.addSelectionListener(listener); } + + public void setVisible(boolean visible) { + mButton.setVisible(visible); + } } diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE b/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE @@ -0,0 +1,190 @@ + + Copyright (c) 2005-2008, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk b/hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk index ded20e1..3ca63dd 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk @@ -16,7 +16,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAVA_RESOURCE_DIRS := resources +LOCAL_JAVA_RESOURCE_DIRS := ../src LOCAL_JAR_MANIFEST := ../manifest.txt diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java index 77f8d74..23dfbea 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java @@ -166,7 +166,7 @@ public abstract class HierarchyViewerDirector implements IDeviceChangeListener, return; } Window[] windows = DeviceBridge.loadWindows(device); - DeviceSelectionModel.getModel().addDevice(device, windows); + DeviceSelectionModel.getModel().addDevice(device, windows, viewServerInfo); if (viewServerInfo.protocolVersion >= 3) { WindowUpdater.startListenForWindowChanges(HierarchyViewerDirector.this, device); focusChanged(device); @@ -586,6 +586,17 @@ public abstract class HierarchyViewerDirector implements IDeviceChangeListener, } } + public void dumpDisplayListForCurrentNode() { + final DrawableViewNode selectedNode = TreeViewModel.getModel().getSelection(); + if (selectedNode != null) { + executeInBackground("Dump displaylist", new Runnable() { + public void run() { + DeviceBridge.outputDisplayList(selectedNode.viewNode); + } + }); + } + } + public void loadAllViews() { executeInBackground("Loading all views", new Runnable() { public void run() { diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DumpDisplayListAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DumpDisplayListAction.java new file mode 100644 index 0000000..8b9ba29 --- /dev/null +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DumpDisplayListAction.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.hierarchyviewerlib.actions; + +import com.android.ddmuilib.ImageLoader; +import com.android.hierarchyviewerlib.HierarchyViewerDirector; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; + +public class DumpDisplayListAction extends SelectedNodeEnabledAction implements ImageAction { + + private static DumpDisplayListAction sAction; + + private Image mImage; + + private DumpDisplayListAction() { + super("Dump DisplayList"); + ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); + mImage = imageLoader.loadImage("load-view-hierarchy.png", Display.getDefault()); //$NON-NLS-1$ + setImageDescriptor(ImageDescriptor.createFromImage(mImage)); + setToolTipText("Request the view to output its displaylist to logcat"); + } + + public static DumpDisplayListAction getAction() { + if (sAction == null) { + sAction = new DumpDisplayListAction(); + } + return sAction; + } + + @Override + public void run() { + HierarchyViewerDirector.getDirector().dumpDisplayListForCurrentNode(); + } + + public Image getImage() { + return mImage; + } +} diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java index 40cc3a9..610f7b3 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java @@ -643,4 +643,18 @@ public class DeviceBridge { } } + public static void outputDisplayList(ViewNode viewNode) { + DeviceConnection connection = null; + try { + connection = new DeviceConnection(viewNode.window.getDevice()); + connection.sendCommand("OUTPUT_DISPLAYLIST " + + viewNode.window.encode() + " " + viewNode); //$NON-NLS-1$ + } catch (Exception e) { + Log.e(TAG, "Unable to dump displaylist for node " + viewNode + " in window " + + viewNode.window + " on device " + viewNode.window.getDevice()); + } finally { + connection.close(); + } + } + } diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java index d029d39..b00a1dc 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java @@ -17,6 +17,7 @@ package com.android.hierarchyviewerlib.models; import com.android.ddmlib.IDevice; +import com.android.hierarchyviewerlib.device.DeviceBridge.ViewServerInfo; import com.android.hierarchyviewerlib.device.Window; import java.util.ArrayList; @@ -29,7 +30,7 @@ import java.util.HashMap; */ public class DeviceSelectionModel { - private final HashMap<IDevice, Window[]> mDeviceMap = new HashMap<IDevice, Window[]>(); + private final HashMap<IDevice, DeviceInfo> mDeviceMap = new HashMap<IDevice, DeviceInfo>(); private final HashMap<IDevice, Integer> mFocusedWindowHashes = new HashMap<IDevice, Integer>(); @@ -44,6 +45,15 @@ public class DeviceSelectionModel { private static DeviceSelectionModel sModel; + private static class DeviceInfo { + Window[] windows; + ViewServerInfo viewServerInfo; + + private DeviceInfo(Window[] windows, ViewServerInfo viewServerInfo) { + this.windows = windows; + this.viewServerInfo = viewServerInfo; + } + } public static DeviceSelectionModel getModel() { if (sModel == null) { sModel = new DeviceSelectionModel(); @@ -57,9 +67,9 @@ public class DeviceSelectionModel { } } - public void addDevice(IDevice device, Window[] windows) { + public void addDevice(IDevice device, Window[] windows, ViewServerInfo info) { synchronized (mDeviceMap) { - mDeviceMap.put(device, windows); + mDeviceMap.put(device, new DeviceInfo(windows, info)); mDeviceList.add(device); } notifyDeviceConnected(device); @@ -88,7 +98,12 @@ public class DeviceSelectionModel { public void updateDevice(IDevice device, Window[] windows) { boolean selectionChanged = false; synchronized (mDeviceMap) { - mDeviceMap.put(device, windows); + DeviceInfo oldDeviceInfo = mDeviceMap.get(device); + ViewServerInfo oldViewServerInfo = null; + if (oldDeviceInfo != null) { + oldViewServerInfo = oldDeviceInfo.viewServerInfo; + } + mDeviceMap.put(device, new DeviceInfo(windows, oldViewServerInfo)); // If the selected window no longer exists, we clear the selection. if (mSelectedDevice == device && mSelectedWindow != null) { boolean windowStillExists = false; @@ -214,9 +229,12 @@ public class DeviceSelectionModel { } public Window[] getWindows(IDevice device) { - Window[] windows; + Window[] windows = null; synchronized (mDeviceMap) { - windows = mDeviceMap.get(device); + DeviceInfo info = mDeviceMap.get(device); + if (info != null) { + windows = mDeviceMap.get(device).windows; + } } return windows; } @@ -253,4 +271,15 @@ public class DeviceSelectionModel { return mSelectedWindow; } } + + public ViewServerInfo getSelectedDeviceInfo() { + synchronized (mDeviceMap) { + ViewServerInfo viewServerInfo = null; + if (mSelectedDevice != null) { + return mDeviceMap.get(mSelectedDevice).viewServerInfo; + } + return null; + } + } + } diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/auto-refresh.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/auto-refresh.png Binary files differindex 240862f..240862f 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/auto-refresh.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/auto-refresh.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/capture-psd.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/capture-psd.png Binary files differindex 0f25426..0f25426 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/capture-psd.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/capture-psd.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/device-view-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view-selected.png Binary files differindex fd107ed..fd107ed 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/device-view-selected.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view-selected.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/device-view.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view.png Binary files differindex 9a7eed4..9a7eed4 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/device-view.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/display.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/display.png Binary files differindex a9de0ec..a9de0ec 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/display.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/display.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/filtered.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/filtered.png Binary files differindex 4fcab3f..4fcab3f 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/filtered.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/filtered.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/green.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/green.png Binary files differindex 800000d..800000d 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/green.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/green.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/inspect-screenshot.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/inspect-screenshot.png Binary files differindex 6e51701..6e51701 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/inspect-screenshot.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/inspect-screenshot.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/invalidate.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/invalidate.png Binary files differindex ee75f69..ee75f69 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/invalidate.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/invalidate.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-all-views.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-all-views.png Binary files differindex 3329ec9..3329ec9 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-all-views.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-all-views.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-overlay.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-overlay.png Binary files differindex 4817252..4817252 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-overlay.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-overlay.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-view-hierarchy.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-view-hierarchy.png Binary files differindex 8f01dda..8f01dda 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/load-view-hierarchy.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-view-hierarchy.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/not-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/not-selected.png Binary files differindex db6f13b..db6f13b 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/not-selected.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/not-selected.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/on-black.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-black.png Binary files differindex cd88803..cd88803 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/on-black.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-black.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/on-white.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-white.png Binary files differindex 5f05662..5f05662 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/on-white.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-white.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/pixel-perfect-view-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view-selected.png Binary files differindex 1e44000..1e44000 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/pixel-perfect-view-selected.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view-selected.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/pixel-perfect-view.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view.png Binary files differindex ec51cec..ec51cec 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/pixel-perfect-view.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/red.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/red.png Binary files differindex a2ab855..a2ab855 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/red.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/red.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/refresh-windows.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/refresh-windows.png Binary files differindex 8fddcae..8fddcae 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/refresh-windows.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/refresh-windows.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/request-layout.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/request-layout.png Binary files differindex 92a78c8..92a78c8 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/request-layout.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/request-layout.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/save.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/save.png Binary files differindex 2c0bab1..2c0bab1 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/save.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/save.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-128.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-128.png Binary files differnew file mode 100644 index 0000000..4535f22 --- /dev/null +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-128.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-16.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-16.png Binary files differnew file mode 100755 index 0000000..8c3c23d --- /dev/null +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-16.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-filtered-small.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered-small.png Binary files differindex 9ef6b34..9ef6b34 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-filtered-small.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered-small.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-filtered.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered.png Binary files differindex 1f59685..1f59685 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-filtered.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-small.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-small.png Binary files differindex 538e385..538e385 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected-small.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-small.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected.png Binary files differindex 5cd5c3f..5cd5c3f 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/selected.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/show-extras.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-extras.png Binary files differindex ba9c305..ba9c305 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/show-extras.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-extras.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/show-overlay.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-overlay.png Binary files differindex e39e90a..e39e90a 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/show-overlay.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-overlay.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/tree-view-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view-selected.png Binary files differindex 175ad1f..175ad1f 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/tree-view-selected.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view-selected.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/tree-view.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view.png Binary files differindex 23aa424..23aa424 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/tree-view.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/yellow.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/yellow.png Binary files differindex e9b5781..e9b5781 100644 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/yellow.png +++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/yellow.png diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about-small.jpg b/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about-small.jpg Binary files differdeleted file mode 100644 index 6fe9291..0000000 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about-small.jpg +++ /dev/null diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about.jpg b/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about.jpg Binary files differdeleted file mode 100644 index 8e10514..0000000 --- a/hierarchyviewer2/libs/hierarchyviewerlib/src/resources/images/about.jpg +++ /dev/null |