summaryrefslogtreecommitdiff
path: root/vcl/aqua/source/window/salframeview.mm
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-11 10:53:35 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-11 10:53:35 +0000
commitdf3d827f86c0fb7a046175a1d2c8cc0a662fc4b3 (patch)
treee6ff3903eb20005d893732c909978f5e631b8c5e /vcl/aqua/source/window/salframeview.mm
parentb8128f15549ddc463545f068d482a79bb3ef30f8 (diff)
CWS-TOOLING: integrate CWS vcl98
2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
Diffstat (limited to 'vcl/aqua/source/window/salframeview.mm')
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm121
1 files changed, 119 insertions, 2 deletions
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index aee1bd351839..ec52d86528c9 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -626,6 +626,121 @@ private:
[self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SALEVENT_MOUSEBUTTONUP];
}
+- (void)magnifyWithEvent: (NSEvent*)pEvent
+{
+ YIELD_GUARD;
+
+ // TODO: ?? -(float)magnification;
+ if( AquaSalFrame::isAlive( mpFrame ) )
+ {
+ mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
+
+ float dZ = 0.0;
+ for(;;)
+ {
+ dZ += [pEvent deltaZ];
+ NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask
+ untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
+ if( !pNextEvent )
+ break;
+ pEvent = pNextEvent;
+ }
+
+ NSPoint aPt = [NSEvent mouseLocation];
+ mpFrame->CocoaToVCL( aPt );
+
+ SalWheelMouseEvent aEvent;
+ aEvent.mnTime = mpFrame->mnLastEventTime;
+ aEvent.mnX = static_cast<long>(aPt.x) - mpFrame->maGeometry.nX;
+ aEvent.mnY = static_cast<long>(aPt.y) - mpFrame->maGeometry.nY;
+ aEvent.mnCode = ImplGetModifierMask( mpFrame->mnLastModifierFlags );
+ aEvent.mnCode |= KEY_MOD1; // we want zooming, no scrolling
+
+ // --- RTL --- (mirror mouse pos)
+ if( Application::GetSettings().GetLayoutRTL() )
+ aEvent.mnX = mpFrame->maGeometry.nWidth-1-aEvent.mnX;
+
+ if( dZ != 0.0 )
+ {
+ aEvent.mnDelta = static_cast<long>(floor(dZ));
+ aEvent.mnNotchDelta = aEvent.mnDelta / 8;
+ if( aEvent.mnNotchDelta == 0 )
+ aEvent.mnNotchDelta = dZ < 0.0 ? -1 : 1;
+ aEvent.mbHorz = FALSE;
+ aEvent.mnScrollLines = aEvent.mnNotchDelta > 0 ? aEvent.mnNotchDelta : -aEvent.mnNotchDelta;
+ if( aEvent.mnScrollLines == 0 )
+ aEvent.mnScrollLines = 1;
+ mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ }
+ }
+}
+
+- (void)rotateWithEvent: (NSEvent*)pEvent
+{
+ //Rotation : -(float)rotation;
+ // TODO: create new CommandType so rotation is available to the applications
+}
+
+- (void)swipeWithEvent: (NSEvent*)pEvent
+{
+ YIELD_GUARD;
+
+ if( AquaSalFrame::isAlive( mpFrame ) )
+ {
+ mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
+
+ // merge pending scroll wheel events
+ float dX = 0.0;
+ float dY = 0.0;
+ for(;;)
+ {
+ dX += [pEvent deltaX];
+ dY += [pEvent deltaY];
+ NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask
+ untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
+ if( !pNextEvent )
+ break;
+ pEvent = pNextEvent;
+ }
+
+ NSPoint aPt = [NSEvent mouseLocation];
+ mpFrame->CocoaToVCL( aPt );
+
+ SalWheelMouseEvent aEvent;
+ aEvent.mnTime = mpFrame->mnLastEventTime;
+ aEvent.mnX = static_cast<long>(aPt.x) - mpFrame->maGeometry.nX;
+ aEvent.mnY = static_cast<long>(aPt.y) - mpFrame->maGeometry.nY;
+ aEvent.mnCode = ImplGetModifierMask( mpFrame->mnLastModifierFlags );
+
+ // --- RTL --- (mirror mouse pos)
+ if( Application::GetSettings().GetLayoutRTL() )
+ aEvent.mnX = mpFrame->maGeometry.nWidth-1-aEvent.mnX;
+
+ if( dX != 0.0 )
+ {
+ aEvent.mnDelta = static_cast<long>(floor(dX));
+ aEvent.mnNotchDelta = aEvent.mnDelta / 8;
+ if( aEvent.mnNotchDelta == 0 )
+ aEvent.mnNotchDelta = dX < 0.0 ? -1 : 1;
+ aEvent.mbHorz = TRUE;
+ aEvent.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL;
+ mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ }
+ if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame ))
+ {
+ aEvent.mnDelta = static_cast<long>(floor(dY));
+ aEvent.mnNotchDelta = aEvent.mnDelta / 8;
+ if( aEvent.mnNotchDelta == 0 )
+ aEvent.mnNotchDelta = dY < 0.0 ? -1 : 1;
+ aEvent.mbHorz = FALSE;
+ aEvent.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL;
+ mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ }
+ }
+}
+
-(void)scrollWheel: (NSEvent*)pEvent
{
YIELD_GUARD;
@@ -694,6 +809,7 @@ private:
}
}
+
-(void)keyDown: (NSEvent*)pEvent
{
YIELD_GUARD;
@@ -774,14 +890,15 @@ private:
{
OUString aInsertString( GetOUString( pInsert ) );
USHORT nKeyCode = 0;
+
// aCharCode initializer is safe since aInsertString will at least contain '\0'
sal_Unicode aCharCode = *aInsertString.getStr();
+ nKeyCode = ImplMapCharCode( aCharCode );
// FIXME: will probably break somehow in less than trivial text input mode
if( nLen == 1 &&
aCharCode < 0x80 &&
aCharCode > 0x1f &&
- ( nKeyCode = ImplMapCharCode( aCharCode ) ) != 0
- && ! [self hasMarkedText ]
+ ! [self hasMarkedText ]
)
{
[self sendKeyInputAndReleaseToFrame: nKeyCode character: aCharCode];