Reviewed by Anders.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 21:42:36 +0000 (21:42 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 21:42:36 +0000 (21:42 +0000)
        - add a bunch of casts to get this compiling with older Xcode versions

        (I used static_cast so it will be easier to find and remove these once we have completely moved
        on to a new enough compiler version.)

        * Plugins/WebBaseNetscapePluginView.m:
        (+[WebBaseNetscapePluginView getCarbonEvent:]):
        (-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]):
        (-[WebBaseNetscapePluginView fixWindowPort]):
        (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
        (-[WebBaseNetscapePluginView _createWindowlessAGLContext]):
        (-[WebBaseNetscapePluginView _reshapeAGLWindow]):
        (-[WebBaseNetscapePluginView _aglOffscreenImageForDrawingInRect:]):
        * WebKit.xcodeproj/project.pbxproj:

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

WebKit/ChangeLog
WebKit/Plugins/WebBaseNetscapePluginView.m
WebKit/WebKit.xcodeproj/project.pbxproj

index fd8d781cc4d7d90b1d5676b816fce19c30e8b100..f81aef212b4e3ff6dfc593e421e6df1a97ff1ccc 100644 (file)
@@ -1,3 +1,22 @@
+2006-10-13  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Anders.
+        
+        - add a bunch of casts to get this compiling with older Xcode versions
+        
+        (I used static_cast so it will be easier to find and remove these once we have completely moved
+        on to a new enough compiler version.)
+
+        * Plugins/WebBaseNetscapePluginView.m:
+        (+[WebBaseNetscapePluginView getCarbonEvent:]):
+        (-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]):
+        (-[WebBaseNetscapePluginView fixWindowPort]):
+        (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
+        (-[WebBaseNetscapePluginView _createWindowlessAGLContext]):
+        (-[WebBaseNetscapePluginView _reshapeAGLWindow]):
+        (-[WebBaseNetscapePluginView _aglOffscreenImageForDrawingInRect:]):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2006-10-13  Kevin McCullough  <KMcCullough@apple.com>
 
         Changed by Darin, reviewed by me.
index 1ab69ed7e13c80396cd4637482b97456e7a307bc..0736faea7713038bbda36a98471ab7fa1f497dfc 100644 (file)
@@ -149,8 +149,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     carbonEvent->message = 0;
     carbonEvent->when = TickCount();
     GetGlobalMouse(&carbonEvent->where);
-    carbonEvent->where.h *= HIGetScaleFactor();
-    carbonEvent->where.v *= HIGetScaleFactor();
+    carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor());
+    carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor());
     carbonEvent->modifiers = GetCurrentKeyModifiers();
     if (!Button())
         carbonEvent->modifiers |= btnState;
@@ -193,8 +193,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
 - (void)getCarbonEvent:(EventRecord *)carbonEvent withEvent:(NSEvent *)cocoaEvent
 {
     if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) {
-        carbonEvent->where.h *= HIGetScaleFactor();
-        carbonEvent->where.v *= HIGetScaleFactor();
+        carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor());
+        carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor());
         return;
     }
     
@@ -240,8 +240,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     GetPort(&oldPort);    
     SetPort(GetWindowPort((WindowRef)[currentWindow windowRef]));
     
-    MovePortTo(contentRect.origin.x, /* Flip Y */ windowHeight - NSMaxY(contentRect));
-    PortSize(contentRect.size.width, contentRect.size.height);
+    MovePortTo(static_cast<short>(contentRect.origin.x), /* Flip Y */ static_cast<short>(windowHeight - NSMaxY(contentRect)));
+    PortSize(static_cast<short>(contentRect.size.width), static_cast<short>(contentRect.size.height));
     
     SetPort(oldPort);
 }
@@ -287,8 +287,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     
     window.x = (int32)boundsInWindow.origin.x; 
     window.y = (int32)boundsInWindow.origin.y;
-    window.width = NSWidth(boundsInWindow);
-    window.height = NSHeight(boundsInWindow);
+    window.width = static_cast<uint32>(NSWidth(boundsInWindow));
+    window.height = static_cast<uint32>(NSHeight(boundsInWindow));
     
     // "Clip-out" the plug-in when:
     // 1) it's not really in a window or off-screen or has no height or width.
@@ -380,7 +380,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
                     if (!NSEqualSizes(dirtyRect.size, NSZeroSize)) {
                         // Create a region for this dirty rect
                         RgnHandle dirtyRectRegion = NewRgn();
-                        SetRectRgn(dirtyRectRegion, NSMinX(dirtyRect), NSMinY(dirtyRect), NSMaxX(dirtyRect), NSMaxY(dirtyRect));
+                        SetRectRgn(dirtyRectRegion, static_cast<short>(NSMinX(dirtyRect)), static_cast<short>(NSMinY(dirtyRect)), static_cast<short>(NSMaxX(dirtyRect)), static_cast<short>(NSMaxY(dirtyRect)));
                         
                         // Union this dirty rect with the rest of the dirty rects
                         UnionRgn(viewClipRegion, dirtyRectRegion, viewClipRegion);
@@ -470,7 +470,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
             // Adjust viewport according to clip
             switch (window.type) {
                 case NPWindowTypeWindow:
-                    glViewport(NSMinX(boundsInWindow) - NSMinX(visibleRectInWindow), NSMaxY(visibleRectInWindow) - NSMaxY(boundsInWindow), window.width, window.height);
+                    glViewport(static_cast<GLint>(NSMinX(boundsInWindow) - NSMinX(visibleRectInWindow)), static_cast<GLint>(NSMaxY(visibleRectInWindow) - NSMaxY(boundsInWindow)), window.width, window.height);
                 break;
                 
                 case NPWindowTypeDrawable:
@@ -2548,7 +2548,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     
     // Create offscreen buffer for AGL context
     NSSize boundsSize = [self bounds].size;
-    GLvoid *offscreenBuffer = (GLvoid *)malloc(boundsSize.width * boundsSize.height * 4);
+    GLvoid *offscreenBuffer = (GLvoid *)malloc(static_cast<size_t>(boundsSize.width * boundsSize.height * 4));
     if (!offscreenBuffer) {
         LOG_ERROR("Could not allocate offscreen buffer for AGL context");
         aglDestroyContext(aglContext);
@@ -2558,7 +2558,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     
     // Attach AGL context to offscreen buffer
     CGLContextObj cglContext = [self _cglContext];
-    CGLError error = CGLSetOffScreen(cglContext, boundsSize.width, boundsSize.height, boundsSize.width * 4, offscreenBuffer);
+    CGLError error = CGLSetOffScreen(cglContext, static_cast<long>(boundsSize.width), static_cast<long>(boundsSize.height), static_cast<long>(boundsSize.width * 4), offscreenBuffer);
     if (error) {
         LOG_ERROR("Could not set offscreen buffer for AGL context: %d", error);
         aglDestroyContext(aglContext);
@@ -2698,7 +2698,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
                 break;
             
             // Resize the offscreen buffer
-            offscreenBuffer = realloc(offscreenBuffer, boundsSize.width * boundsSize.height * 4);
+            offscreenBuffer = realloc(offscreenBuffer, static_cast<size_t>(boundsSize.width * boundsSize.height * 4));
             if (!offscreenBuffer) {
                 LOG_ERROR("Could not allocate offscreen buffer for AGL context");
                 break;
@@ -2706,7 +2706,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
 
             // Update the offscreen 
             CGLContextObj cglContext = [self _cglContext];
-            CGLError error = CGLSetOffScreen(cglContext, boundsSize.width, boundsSize.height, boundsSize.width * 4, offscreenBuffer);
+            CGLError error = CGLSetOffScreen(cglContext, static_cast<long>(boundsSize.width), static_cast<long>(boundsSize.height), static_cast<long>(boundsSize.width * 4), offscreenBuffer);
             if (error) {
                 LOG_ERROR("Could not set offscreen buffer for AGL context: %d", error);
                 break;
@@ -2773,8 +2773,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     GLvoid *swizzleImageBase = (unsigned char *)offscreenBuffer + (int)(NSMinY(drawingInRect) * rowBytes) + (int)(NSMinX(drawingInRect) * 4);
     vImage_Buffer vImage = {
         data: swizzleImageBase,
-        height: NSHeight(drawingInRect),
-        width: NSWidth(drawingInRect),
+        height: static_cast<vImagePixelCount>(NSHeight(drawingInRect)),
+        width: static_cast<vImagePixelCount>(NSWidth(drawingInRect)),
         rowBytes: rowBytes
     };
     uint8_t vImagePermuteMap[4] = { 3, 2, 1, 0 }; // Where { 0, 1, 2, 3 } would leave the channels unchanged; this map converts BGRA to ARGB
index 0c5775ad1157f2d65474c1488b53f78e4098b906..510d2bed68710cb75c25639387b0bae0fd3c602c 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
-                       projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                9398100A0824BF01008DF038 /* WebKit */,
                        );