salframe.cxx (9f62ea84) salframe.cxx (cd426cce)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 195 unchanged lines hidden (view full) ---

204
205 if( (mnStyle & SAL_FRAME_STYLE_TOOLTIP) )
206 [mpWindow setIgnoresMouseEvents: YES];
207 else
208 [mpWindow setAcceptsMouseMovedEvents: YES];
209 [mpWindow setHasShadow: YES];
210 [mpWindow setDelegate: mpWindow];
211
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 195 unchanged lines hidden (view full) ---

204
205 if( (mnStyle & SAL_FRAME_STYLE_TOOLTIP) )
206 [mpWindow setIgnoresMouseEvents: YES];
207 else
208 [mpWindow setAcceptsMouseMovedEvents: YES];
209 [mpWindow setHasShadow: YES];
210 [mpWindow setDelegate: mpWindow];
211
212 NSRect aRect = { { 0,0 }, { maGeometry.nWidth, maGeometry.nHeight } };
212 const NSRect aRect = NSMakeRect( 0,0, maGeometry.nWidth, maGeometry.nHeight );
213 mnTrackingRectTag = [mpView addTrackingRect: aRect owner: mpView userData: nil assumeInside: NO];
214
215 maSysData.pView = mpView;
216
217 UpdateFrameGeometry();
218
219 [mpWindow setContentView: mpView];
220}

--- 274 unchanged lines hidden (view full) ---

495
496 if( mpWindow )
497 {
498 // Always add the decoration as the dimension concerns only
499 // the content rectangle
500 nWidth += maGeometry.nLeftDecoration + maGeometry.nRightDecoration;
501 nHeight += maGeometry.nTopDecoration + maGeometry.nBottomDecoration;
502
213 mnTrackingRectTag = [mpView addTrackingRect: aRect owner: mpView userData: nil assumeInside: NO];
214
215 maSysData.pView = mpView;
216
217 UpdateFrameGeometry();
218
219 [mpWindow setContentView: mpView];
220}

--- 274 unchanged lines hidden (view full) ---

495
496 if( mpWindow )
497 {
498 // Always add the decoration as the dimension concerns only
499 // the content rectangle
500 nWidth += maGeometry.nLeftDecoration + maGeometry.nRightDecoration;
501 nHeight += maGeometry.nTopDecoration + maGeometry.nBottomDecoration;
502
503 NSSize aSize = { nWidth, nHeight };
503 const NSSize aSize = NSMakeSize( nWidth, nHeight);
504
505 // Size of full window (content+structure) although we only
506 // have the client size in arguments
507 [mpWindow setMinSize: aSize];
508 }
509}
510
511// -----------------------------------------------------------------------

--- 12 unchanged lines hidden (view full) ---

524 // the content rectangle
525 nWidth += maGeometry.nLeftDecoration + maGeometry.nRightDecoration;
526 nHeight += maGeometry.nTopDecoration + maGeometry.nBottomDecoration;
527
528 // Carbon windows can't have a size greater than 32767x32767
529 if (nWidth>32767) nWidth=32767;
530 if (nHeight>32767) nHeight=32767;
531
504
505 // Size of full window (content+structure) although we only
506 // have the client size in arguments
507 [mpWindow setMinSize: aSize];
508 }
509}
510
511// -----------------------------------------------------------------------

--- 12 unchanged lines hidden (view full) ---

524 // the content rectangle
525 nWidth += maGeometry.nLeftDecoration + maGeometry.nRightDecoration;
526 nHeight += maGeometry.nTopDecoration + maGeometry.nBottomDecoration;
527
528 // Carbon windows can't have a size greater than 32767x32767
529 if (nWidth>32767) nWidth=32767;
530 if (nHeight>32767) nHeight=32767;
531
532 NSSize aSize = { nWidth, nHeight };
532 const NSSize aSize = NSMakeSize( nWidth, nHeight);
533
534 // Size of full window (content+structure) although we only
535 // have the client size in arguments
536 [mpWindow setMaxSize: aSize];
537 }
538}
539
540// -----------------------------------------------------------------------
541
542void AquaSalFrame::SetClientSize( long nWidth, long nHeight )
543{
544 // #i113170# may not be the main thread if called from UNO API
545 SalData::ensureThreadAutoreleasePool();
546
547 if( mpWindow )
548 {
533
534 // Size of full window (content+structure) although we only
535 // have the client size in arguments
536 [mpWindow setMaxSize: aSize];
537 }
538}
539
540// -----------------------------------------------------------------------
541
542void AquaSalFrame::SetClientSize( long nWidth, long nHeight )
543{
544 // #i113170# may not be the main thread if called from UNO API
545 SalData::ensureThreadAutoreleasePool();
546
547 if( mpWindow )
548 {
549 NSSize aSize = { nWidth, nHeight };
549 const NSSize aSize = NSMakeSize( nWidth, nHeight);
550
551 [mpWindow setContentSize: aSize];
552 UpdateFrameGeometry();
553 if( mbShown )
554 // trigger filling our backbuffer
555 SendPaintEvent();
556 }
557}

--- 393 unchanged lines hidden (view full) ---

951
952// -----------------------------------------------------------------------
953
954void AquaSalFrame::SetPointerPos( long nX, long nY )
955{
956 // FIXME: use Cocoa functions
957
958 // FIXME: multiscreen support
550
551 [mpWindow setContentSize: aSize];
552 UpdateFrameGeometry();
553 if( mbShown )
554 // trigger filling our backbuffer
555 SendPaintEvent();
556 }
557}

--- 393 unchanged lines hidden (view full) ---

951
952// -----------------------------------------------------------------------
953
954void AquaSalFrame::SetPointerPos( long nX, long nY )
955{
956 // FIXME: use Cocoa functions
957
958 // FIXME: multiscreen support
959 CGPoint aPoint = { nX + maGeometry.nX, nY + maGeometry.nY };
959 const CGPoint aPoint = CGPointMake( nX + maGeometry.nX, nY + maGeometry.nY);
960 CGDirectDisplayID mainDisplayID = CGMainDisplayID();
961 CGDisplayMoveCursorToPoint( mainDisplayID, aPoint );
962}
963
964// -----------------------------------------------------------------------
965
966void AquaSalFrame::Flush( void )
967{

--- 20 unchanged lines hidden (view full) ---

988void AquaSalFrame::Flush( const Rectangle& rRect )
989{
990 if( !(mbGraphics && mpGraphics && mpView && mbShown) )
991 return;
992
993 // #i113170# may not be the main thread if called from UNO API
994 SalData::ensureThreadAutoreleasePool();
995
960 CGDirectDisplayID mainDisplayID = CGMainDisplayID();
961 CGDisplayMoveCursorToPoint( mainDisplayID, aPoint );
962}
963
964// -----------------------------------------------------------------------
965
966void AquaSalFrame::Flush( void )
967{

--- 20 unchanged lines hidden (view full) ---

988void AquaSalFrame::Flush( const Rectangle& rRect )
989{
990 if( !(mbGraphics && mpGraphics && mpView && mbShown) )
991 return;
992
993 // #i113170# may not be the main thread if called from UNO API
994 SalData::ensureThreadAutoreleasePool();
995
996 NSRect aNSRect = { {rRect.Left(), rRect.Top()}, { rRect.GetWidth(), rRect.GetHeight() } };
996 NSRect aNSRect = NSMakeRect( rRect.Left(), rRect.Top(), rRect.GetWidth(), rRect.GetHeight());
997 VCLToCocoa( aNSRect, false );
998 [mpView setNeedsDisplayInRect: aNSRect];
999
1000 // outside of the application's event loop (e.g. IntroWindow)
1001 // nothing would trigger paint event handling
1002 // => fall back to synchronous painting
1003 if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
1004 {

--- 745 unchanged lines hidden (view full) ---

1750
1751void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
1752{
1753 // #i113170# may not be the main thread if called from UNO API
1754 SalData::ensureThreadAutoreleasePool();
1755
1756 if( nWidth && nHeight )
1757 {
997 VCLToCocoa( aNSRect, false );
998 [mpView setNeedsDisplayInRect: aNSRect];
999
1000 // outside of the application's event loop (e.g. IntroWindow)
1001 // nothing would trigger paint event handling
1002 // => fall back to synchronous painting
1003 if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
1004 {

--- 745 unchanged lines hidden (view full) ---

1750
1751void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
1752{
1753 // #i113170# may not be the main thread if called from UNO API
1754 SalData::ensureThreadAutoreleasePool();
1755
1756 if( nWidth && nHeight )
1757 {
1758 NSRect aRect = { { nX, nY }, { nWidth, nHeight } };
1758 NSRect aRect = NSMakeRect( nX, nY, nWidth, nHeight);
1759 VCLToCocoa( aRect, false );
1760 maClippingRects.push_back( CGRectMake(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height) );
1761 }
1762}
1763
1764void AquaSalFrame::EndSetClipRegion()
1765{
1766 if ( !mpWindow )

--- 22 unchanged lines hidden ---
1759 VCLToCocoa( aRect, false );
1760 maClippingRects.push_back( CGRectMake(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height) );
1761 }
1762}
1763
1764void AquaSalFrame::EndSetClipRegion()
1765{
1766 if ( !mpWindow )

--- 22 unchanged lines hidden ---