Kaydet (Commit) e4653eee authored tarafından Herbert Dürr's avatar Herbert Dürr Kaydeden (comit) Caolán McNamara

Related: #i123895# adjust VCL support for 64bit OSX port

(cherry picked from commit 677d987b)

Conflicts:
	vcl/aqua/source/a11y/aqua11ywrapperrow.mm
	vcl/inc/aqua/aquavcltypes.h
	vcl/inc/quartz/salgdi.h
	vcl/osx/DropTarget.cxx
	vcl/osx/salframe.cxx
	vcl/osx/salinst.cxx
	vcl/osx/salmenu.cxx
	vcl/osx/vclnsapp.mm

Change-Id: I30d72e7caa1269982d176bc4d3baf604d5e7a84b
üst 4b0d7b61
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "osx/a11ywrapper.h" #include "osx/a11ywrapper.h"
@interface SalFrameWindow : NSWindow @interface SalFrameWindow : NSWindow<NSWindowDelegate>
{ {
AquaSalFrame* mpFrame; AquaSalFrame* mpFrame;
id mDraggingDestinationHandler; id mDraggingDestinationHandler;
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
-(void)windowDidMiniaturize: (NSNotification*)pNotification; -(void)windowDidMiniaturize: (NSNotification*)pNotification;
-(void)windowDidDeminiaturize: (NSNotification*)pNotification; -(void)windowDidDeminiaturize: (NSNotification*)pNotification;
-(BOOL)windowShouldClose: (NSNotification*)pNotification; -(BOOL)windowShouldClose: (NSNotification*)pNotification;
//-(void)willEncodeRestorableState:(NSCoder*)pCoderState;
//-(void)didDecodeRestorableState:(NSCoder*)pCoderState;
//-(void)windowWillEnterVersionBrowser:(NSNotification*)pNotification;
-(void)dockMenuItemTriggered: (id)sender; -(void)dockMenuItemTriggered: (id)sender;
-(AquaSalFrame*)getSalFrame; -(AquaSalFrame*)getSalFrame;
-(BOOL)containsMouse; -(BOOL)containsMouse;
......
...@@ -285,19 +285,13 @@ NSDragOperation DropTarget::draggingUpdated(id sender) ...@@ -285,19 +285,13 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
//NSLog(@"Drag update: Source actions: %x proposed action %x selected action %x", mDragSourceSupportedActions, currentAction, mSelectedDropAction); //NSLog(@"Drag update: Source actions: %x proposed action %x selected action %x", mDragSourceSupportedActions, currentAction, mSelectedDropAction);
} }
#ifndef __LP64__
// Weird but it appears as if there is no method in Cocoa
// to create a kThemeCopyArrowCursor hence we have to use
// Carbon to do it
if (dragOp == NSDragOperationNone) if (dragOp == NSDragOperationNone)
SetThemeCursor(kThemeNotAllowedCursor); [[NSCursor operationNotAllowedCursor] set];
else if (dragOp == NSDragOperationCopy) else if (dragOp == NSDragOperationCopy)
SetThemeCursor(kThemeCopyArrowCursor); [[NSCursor dragCopyCursor] set];
else else
SetThemeCursor(kThemeArrowCursor); [[NSCursor arrowCursor] set];
#else
// FIXME: SetThemeCursor replacement?
#endif
return dragOp; return dragOp;
} }
...@@ -308,9 +302,7 @@ void DropTarget::draggingExited(id /*sender*/) ...@@ -308,9 +302,7 @@ void DropTarget::draggingExited(id /*sender*/)
fire_dragExit(dte); fire_dragExit(dte);
mDragSourceSupportedActions = DNDConstants::ACTION_NONE; mDragSourceSupportedActions = DNDConstants::ACTION_NONE;
mSelectedDropAction = DNDConstants::ACTION_NONE; mSelectedDropAction = DNDConstants::ACTION_NONE;
#ifndef __LP64__ [[NSCursor arrowCursor] set];
SetThemeCursor(kThemeArrowCursor);
#endif
} }
...@@ -364,9 +356,7 @@ void DropTarget::concludeDragOperation(id /*sender*/) ...@@ -364,9 +356,7 @@ void DropTarget::concludeDragOperation(id /*sender*/)
mDragSourceSupportedActions = DNDConstants::ACTION_NONE; mDragSourceSupportedActions = DNDConstants::ACTION_NONE;
mSelectedDropAction = DNDConstants::ACTION_NONE; mSelectedDropAction = DNDConstants::ACTION_NONE;
mXCurrentDragClipboard = uno::Reference<XClipboard>(); mXCurrentDragClipboard = uno::Reference<XClipboard>();
#ifndef __LP64__ [[NSCursor arrowCursor] set];
SetThemeCursor(kThemeArrowCursor);
#endif
} }
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
@implementation AquaA11yWrapperRow : AquaA11yWrapper @implementation AquaA11yWrapperRow : AquaA11yWrapper
-(id)disclosingAttribute { -(id)disclosingAttribute {
return NULL; // TODO // TODO: implement
return nil;
} }
-(NSArray *)accessibilityAttributeNames { -(NSArray *)accessibilityAttributeNames {
......
...@@ -200,17 +200,7 @@ void AquaSalFrame::initWindowAndView() ...@@ -200,17 +200,7 @@ void AquaSalFrame::initWindowAndView()
else else
[mpNSWindow setAcceptsMouseMovedEvents: YES]; [mpNSWindow setAcceptsMouseMovedEvents: YES];
[mpNSWindow setHasShadow: YES]; [mpNSWindow setHasShadow: YES];
[mpNSWindow setDelegate: static_cast<id<NSWindowDelegate> >(mpNSWindow)];
// WTF? With the 10.6 SDK and gcc 4.2.1, we get: class 'NSWindow'
// does not implement the 'NSWindowDelegate' protocol. Anyway,
// having the window object be its own delegate object is
// apparently what the code does on purpose, see discussion in
// https://issues.apache.org/ooo/show_bug.cgi?id=91990
// So to silence the warning when compiling with -Werror, instead of:
// [mpNSWindow setDelegate: mpNSWindow];
// do this:
objc_msgSend(mpNSWindow, @selector(setDelegate:), mpNSWindow);
if( [mpNSWindow respondsToSelector: @selector(setRestorable:)]) if( [mpNSWindow respondsToSelector: @selector(setRestorable:)])
{ {
......
...@@ -253,15 +253,7 @@ AquaSalMenu::AquaSalMenu( bool bMenuBar ) : ...@@ -253,15 +253,7 @@ AquaSalMenu::AquaSalMenu( bool bMenuBar ) :
if( ! mbMenuBar ) if( ! mbMenuBar )
{ {
mpMenu = [[SalNSMenu alloc] initWithMenu: this]; mpMenu = [[SalNSMenu alloc] initWithMenu: this];
// With the 10.6 SDK and gcc 4.2.1, we get: class 'NSMenu' [mpMenu setDelegate: (id<NSMenuDelegate>)mpMenu];
// does not implement the 'NSMenuDelegate' protocol. Anyway,
// having the menu object be its own delegate object is
// apparently what the code does on purpose.
// So to silcense the warning, instead of:
// [mpMenu setDelegate: mpMenu];
// do this:
objc_msgSend(mpMenu, @selector(setDelegate:), mpMenu);
} }
else else
{ {
......
...@@ -82,19 +82,7 @@ ...@@ -82,19 +82,7 @@
if( nModMask == NSCommandKeyMask if( nModMask == NSCommandKeyMask
&& [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] ) && [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] )
{ {
// Note: gcc 4.2.1 (in the 10.6 SDK) tells us [(SalFrameWindow*)pFrame->getNSWindow() windowShouldClose: nil];
// 'NSWindow' may not respond to
// '-windowShouldClose:' . Is that a bogus
// warning, or is this code bogus? No idea.
// Anyway, so that we can compile also against
// this SDK with -Werror, use objc_msgSend
// instead.
// Instead of:
// [pFrame->getNSWindow() windowShouldClose: nil];
// do:
objc_msgSend(pFrame->getNSWindow(), @selector(windowShouldClose:), nil);
return; return;
} }
} }
......
...@@ -166,7 +166,7 @@ void AquaSalGraphics::SetState() ...@@ -166,7 +166,7 @@ void AquaSalGraphics::SetState()
bool AquaSalGraphics::CheckContext() bool AquaSalGraphics::CheckContext()
{ {
if( mbWindow && mpFrame != NULL ) if( mbWindow && mpFrame && mpFrame->getNSWindow() )
{ {
const unsigned int nWidth = mpFrame->maGeometry.nWidth; const unsigned int nWidth = mpFrame->maGeometry.nWidth;
const unsigned int nHeight = mpFrame->maGeometry.nHeight; const unsigned int nHeight = mpFrame->maGeometry.nHeight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment