[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:17:17 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 9725ca2032e2cec580908aeaf1bcabc5dfa1c522
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jun 6 22:58:18 2002 +0000

    2002-06-06  Chris Blumenberg  <cblu at apple.com>
    
            Added support for key codes and other encodings.
            Send activate to make Java happy.
    
            * Plugins.subproj/IFPluginView.mm:
            (-[IFPluginView keyMessageForEvent:]): added
            (-[IFPluginView keyUp:]): use above.
            (-[IFPluginView keyDown:]): use above.
            (-[IFPluginView windowBecameKey:]): send activate.
            (-[IFPluginView windowResignedKey:]): send activate.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1286 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 516c187..6da5d13 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2002-06-06  Chris Blumenberg  <cblu at apple.com>
+
+	Added support for key codes and other encodings.
+	Send activate to make Java happy.
+
+	* Plugins.subproj/IFPluginView.mm:
+	(-[IFPluginView keyMessageForEvent:]): added
+	(-[IFPluginView keyUp:]): use above.
+	(-[IFPluginView keyDown:]): use above.
+	(-[IFPluginView windowBecameKey:]): send activate.
+	(-[IFPluginView windowResignedKey:]): send activate.
+
 2002-06-06  John Sullivan  <sullivan at apple.com>
 
 	* Bookmarks.subproj/IFBookmarkList.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 516c187..6da5d13 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,15 @@
+2002-06-06  Chris Blumenberg  <cblu at apple.com>
+
+	Added support for key codes and other encodings.
+	Send activate to make Java happy.
+
+	* Plugins.subproj/IFPluginView.mm:
+	(-[IFPluginView keyMessageForEvent:]): added
+	(-[IFPluginView keyUp:]): use above.
+	(-[IFPluginView keyDown:]): use above.
+	(-[IFPluginView windowBecameKey:]): send activate.
+	(-[IFPluginView windowResignedKey:]): send activate.
+
 2002-06-06  John Sullivan  <sullivan at apple.com>
 
 	* Bookmarks.subproj/IFBookmarkList.m:
diff --git a/WebKit/Plugins.subproj/IFPluginView.mm b/WebKit/Plugins.subproj/IFPluginView.mm
index 4f1240b..00b8692 100644
--- a/WebKit/Plugins.subproj/IFPluginView.mm
+++ b/WebKit/Plugins.subproj/IFPluginView.mm
@@ -94,6 +94,22 @@
     carbonEvent->modifiers = [self modifiersForEvent:cocoaEvent];    
 }
 
+- (UInt32)keyMessageForEvent:(NSEvent *)theEvent
+{
+    NSData *data;
+    UInt8 characterCode;
+    UInt16 keyCode;
+    UInt32 message=0;
+
+    data = [[theEvent characters] dataUsingEncoding:CFStringConvertEncodingToNSStringEncoding(CFStringGetSystemEncoding())];
+    if(data){
+        [data getBytes:&characterCode length:1];
+        keyCode = [theEvent keyCode];
+        message = keyCode << 8 | characterCode;
+    }
+    return message;
+}
+
 -(void)sendActivateEvent:(BOOL)activate
 {
     EventRecord event;
@@ -217,14 +233,11 @@
 {
     EventRecord event;
     bool acceptedEvent;
-        
+
     [self getCarbonEvent:&event withEvent:theEvent];
     event.what = keyUp;
-    // FIXME: Unicode characters vs. Macintosh ASCII character codes?
-    // FIXME: Multiple characters?
-    // FIXME: Key codes?
-    event.message = [[theEvent characters] characterAtIndex:0];
-
+    event.message = [self keyMessageForEvent:theEvent];
+    
     acceptedEvent = NPP_HandleEvent(instance, &event);
     
     WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "NPP_HandleEvent(keyUp): %d key:%c\n", acceptedEvent, (char) (event.message & charCodeMask));
@@ -237,10 +250,7 @@
     
     [self getCarbonEvent:&event withEvent:theEvent];
     event.what = keyDown;
-    // FIXME: Unicode characters vs. Macintosh ASCII character codes?
-    // FIXME: Multiple characters?
-    // FIXME: Key codes?
-    event.message = [[theEvent characters] characterAtIndex:0];
+    event.message = [self keyMessageForEvent:theEvent];
     
     acceptedEvent = NPP_HandleEvent(instance, &event);
     
@@ -524,11 +534,13 @@ static char *newCString(NSString *string)
 
 -(void) windowBecameKey:(NSNotification *)notification
 {
+    [self sendActivateEvent:YES];
     [self performSelector:@selector(sendUpdateEvent) withObject:nil afterDelay:.001];
 }
 
 -(void) windowResignedKey:(NSNotification *)notification
 {
+    [self sendActivateEvent:NO];
     [self performSelector:@selector(sendUpdateEvent) withObject:nil afterDelay:.001];
 }
 
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 4f1240b..00b8692 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -94,6 +94,22 @@
     carbonEvent->modifiers = [self modifiersForEvent:cocoaEvent];    
 }
 
+- (UInt32)keyMessageForEvent:(NSEvent *)theEvent
+{
+    NSData *data;
+    UInt8 characterCode;
+    UInt16 keyCode;
+    UInt32 message=0;
+
+    data = [[theEvent characters] dataUsingEncoding:CFStringConvertEncodingToNSStringEncoding(CFStringGetSystemEncoding())];
+    if(data){
+        [data getBytes:&characterCode length:1];
+        keyCode = [theEvent keyCode];
+        message = keyCode << 8 | characterCode;
+    }
+    return message;
+}
+
 -(void)sendActivateEvent:(BOOL)activate
 {
     EventRecord event;
@@ -217,14 +233,11 @@
 {
     EventRecord event;
     bool acceptedEvent;
-        
+
     [self getCarbonEvent:&event withEvent:theEvent];
     event.what = keyUp;
-    // FIXME: Unicode characters vs. Macintosh ASCII character codes?
-    // FIXME: Multiple characters?
-    // FIXME: Key codes?
-    event.message = [[theEvent characters] characterAtIndex:0];
-
+    event.message = [self keyMessageForEvent:theEvent];
+    
     acceptedEvent = NPP_HandleEvent(instance, &event);
     
     WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "NPP_HandleEvent(keyUp): %d key:%c\n", acceptedEvent, (char) (event.message & charCodeMask));
@@ -237,10 +250,7 @@
     
     [self getCarbonEvent:&event withEvent:theEvent];
     event.what = keyDown;
-    // FIXME: Unicode characters vs. Macintosh ASCII character codes?
-    // FIXME: Multiple characters?
-    // FIXME: Key codes?
-    event.message = [[theEvent characters] characterAtIndex:0];
+    event.message = [self keyMessageForEvent:theEvent];
     
     acceptedEvent = NPP_HandleEvent(instance, &event);
     
@@ -524,11 +534,13 @@ static char *newCString(NSString *string)
 
 -(void) windowBecameKey:(NSNotification *)notification
 {
+    [self sendActivateEvent:YES];
     [self performSelector:@selector(sendUpdateEvent) withObject:nil afterDelay:.001];
 }
 
 -(void) windowResignedKey:(NSNotification *)notification
 {
+    [self sendActivateEvent:NO];
     [self performSelector:@selector(sendUpdateEvent) withObject:nil afterDelay:.001];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list