Reviewed by Tim H.
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Oct 2006 05:09:44 +0000 (05:09 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Oct 2006 05:09:44 +0000 (05:09 +0000)
        Improve the doubleclick behavior of breakpoints, and make breakpoints with no custom condition set appear blank instead of return [-1, 1] depending on enabled state.

        * Drosera/DebuggerDocument.m:
        (-[WebScriptObject getDoubleClickMillis]): Add an ObjC wrapper for GetDblTime() so that JS can call it
        * Drosera/Drosera.xcodeproj/project.pbxproj: link Carbon for GetDblTime()
        * Drosera/debugger.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17129 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Drosera/DebuggerDocument.m
WebKitTools/Drosera/Drosera.xcodeproj/project.pbxproj
WebKitTools/Drosera/debugger.js

index 4e6173d6936a6cc58899e1bc4f1f074158d31839..7ffeda440d5443f2619682e7adfc47d1d4b34f68 100644 (file)
@@ -1,3 +1,14 @@
+2006-10-18  David Smith  <catfish.man@gmail.com>
+
+        Reviewed by Tim H.
+
+        Improve the doubleclick behavior of breakpoints, and make breakpoints with no custom condition set appear blank instead of return [-1, 1] depending on enabled state.
+
+        * Drosera/DebuggerDocument.m:
+        (-[WebScriptObject getDoubleClickMillis]): Add an ObjC wrapper for GetDblTime() so that JS can call it
+        * Drosera/Drosera.xcodeproj/project.pbxproj: link Carbon for GetDblTime()
+        * Drosera/debugger.js:
+
 2006-10-18  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Anders.
index b0303668f0e7a33abb805ca5113f752bf5c9b50e..0c835a6fc7578b475fed3327a5cd3b80a0512399 100644 (file)
@@ -28,6 +28,7 @@
 
 #import "DebuggerDocument.h"
 #import "DebuggerApplication.h"
+#import <Carbon/Carbon.h>
 
 static NSString *DebuggerConsoleToolbarItem = @"DebuggerConsoleToolbarItem";
 static NSString *DebuggerContinueToolbarItem = @"DebuggerContinueToolbarItem";
@@ -166,6 +167,15 @@ static NSString *DebuggerStepOutToolbarItem = @"DebuggerStepOutToolbarItem";
     return nil;
 }
 
+#pragma mark -
+#pragma mark System Information
+
+- (int)doubleClickMilliseconds
+{
+    // GetDblTime() returns values in 1/60ths of a second
+    return ((double)GetDblTime() / 60.0) * 1000;
+}
+
 #pragma mark -
 #pragma mark Pause & Step
 
index 9a531ea4f0bff54a0314b180b4043b1ea18275ab..f0d0f19918f1ce8a424d9b299f121d30714a648d 100644 (file)
@@ -59,6 +59,7 @@
                1CD8D5A60A49102900E5677B /* Drosera.app in Resources */ = {isa = PBXBuildFile; fileRef = 8D15AC370486D014006FF6A4 /* Drosera.app */; };
                5D2C827F0A816BA700C193FD /* Drosera.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1C3487970A81208400101C5C /* Drosera.icns */; };
                63D54BD70AE600560064C440 /* breakpointeditor.png in Resources */ = {isa = PBXBuildFile; fileRef = 63D54BD60AE600560064C440 /* breakpointeditor.png */; };
+               63D54CBD0AE72C990064C440 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63D54CBC0AE72C990064C440 /* Carbon.framework */; };
                8D15AC2D0486D014006FF6A4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */; };
                8D15AC2E0486D014006FF6A4 /* Debugger.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B4FDCFA73011CA2CEA /* Debugger.nib */; };
                8D15AC310486D014006FF6A4 /* DebuggerDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* DebuggerDocument.m */; settings = {ATTRIBUTES = (); }; };
                2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
                32DBCF750370BD2300C91783 /* Drosera.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Drosera.pch; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                63D54BD60AE600560064C440 /* breakpointeditor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = breakpointeditor.png; sourceTree = "<group>"; };
+               63D54CBC0AE72C990064C440 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
                8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
                8D15AC370486D014006FF6A4 /* Drosera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Drosera.app; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
                        files = (
                                8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */,
                                1C27ABC60A413B720016ECF4 /* WebKit.framework in Frameworks */,
+                               63D54CBD0AE72C990064C440 /* Carbon.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = {
                        isa = PBXGroup;
                        children = (
+                               63D54CBC0AE72C990064C440 /* Carbon.framework */,
                                1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */,
                                1C27ABC50A413B720016ECF4 /* WebKit.framework */,
                        );
index 53391e07b16027892c4c0e3fc106eb710c7e711d..ecb7e3c0f98255687c060f092c052f4a1abdc6af 100644 (file)
@@ -48,7 +48,8 @@ var pauseOnNextStatement = false;
 var pausedWhileLeavingFrame = false;
 var consoleWindow = null;
 var enabledBreakpoint = "break";
-var breakpointEditorHTML = '<div class="top">Edit Breakpoint:<label><input type="checkbox" onclick="window.parent.toggleBreakpointForEditor(this.parentNode.parentNode.parentNode)"></input>Enable</label><button class="save" onclick="window.parent.saveBreakpointForEditor(this.parentNode.parentNode)">Save</button></div><div class="bottom"><label for="editorCondition">Condition:</label><div class="condition"></div></div>'
+var breakpointEditorHTML = '<div class="top">Edit Breakpoint:<label><input type="checkbox" onclick="window.parent.toggleBreakpointForEditor(this.parentNode.parentNode.parentNode)"></input>Enable</label><button class="save" onclick="window.parent.saveBreakpointForEditor(this.parentNode.parentNode)">Save</button></div><div class="bottom"><label for="editorCondition">Condition:</label><div class="condition"></div></div>';
+var pendingAction = null;
 
 ScriptCallFrame = function (functionName, index, row)
 {
@@ -342,9 +343,10 @@ function breakpointAction(event)
     var file = files[currentFile];
     var lineNum = parseInt(event.target.title);
     
-    if (row.hasStyleClass("breakpoint"))
-        toggleBreakpoint(row, file, lineNum);    
-    else
+    if (row.hasStyleClass("breakpoint")) {
+        if (!pendingAction)
+            pendingAction = setTimeout(toggleBreakpoint, DebuggerDocument.doubleClickMilliseconds(), row, file, lineNum);  
+    } else
         createBreakpoint(row, file, lineNum);
 }
 
@@ -358,6 +360,10 @@ function createBreakpoint(row, file, lineNum)
 
 function toggleBreakpointEditor(event)
 {
+    if (pendingAction) {
+        clearTimeout(pendingAction);
+        pendingAction = null;
+    }
     var row = event.target.parentNode;
     var file = files[currentFile];
     var lineNum = parseInt(event.target.title);
@@ -389,10 +395,8 @@ function setConditionFieldText(editor, lineNum)
 {
     var conditionField = editor.childNodes[1].childNodes[1];
     var functionBody = files[currentFile].breakpoints[lineNum];
-    if (!functionBody)
-        functionBody = "return -1;";
-    else if (functionBody == "break")
-        functionBody = "return 1;";
+    if (!functionBody || functionBody == "break")
+        functionBody = "";
     else {
         var startIndex = functionBody.indexOf("{") + 1;
         var endIndex = functionBody.lastIndexOf("}");
@@ -421,11 +425,14 @@ function saveBreakpointForEditor(editor)
 
 function toggleBreakpoint(row, file, lineNum)
 {
+    pendingAction = null;
     if (row.hasStyleClass("disabled"))
         row.removeStyleClass("disabled");    
     else
         row.addStyleClass("disabled");
     
+    var hack = row.offsetTop; // force a relayout if needed.
+    
     var temp = file.breakpoints[lineNum];
     file.breakpoints[lineNum] = file.disabledBreakpoints[lineNum];
     file.disabledBreakpoints[lineNum] = temp;