[Libreoffice-commits] core.git: vcl/inc vcl/osx

2023-11-27 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframeview.h |5 +---
 vcl/osx/salframeview.mm|   50 ++---
 vcl/osx/salinst.cxx|   36 ++--
 3 files changed, 44 insertions(+), 47 deletions(-)

New commits:
commit 8a5da079592377cf69735973d922fc19e8ac763d
Author: Patrick Luby 
AuthorDate: Sat Nov 25 14:53:22 2023 -0500
Commit: Patrick Luby 
CommitDate: Mon Nov 27 14:36:51 2023 +0100

tdf#155092 don't dispatch left mouse up events during live resizing

Round 2 of trying to fix macOS live resizing.

If this is a left mouse up event, dispatching this event
will trigger tdf#155092 to occur in the next mouse down
event. So do not dispatch this event and push it back onto
the front of the event queue so no more events will be
dispatched until live resizing ends. Surprisingly, live
resizing appears to end in the next mouse down event.

Also, reverted parts of commit 54da842381ccb554d3cadc876f23cf183d21bf1a
and cleaned up the setting of ImplGetSVData()->mpWinData->mbIsLiveResize.

Change-Id: Ie93ed496e1f0e2a1711284ab205c6b245f71647c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159960
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 1bc2b278d630..2b1a3f9baaed 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -45,6 +45,8 @@ enum class SalEvent;
 -(void)windowDidDeminiaturize: (NSNotification*)pNotification;
 -(BOOL)windowShouldClose: (NSNotification*)pNotification;
 -(void)windowDidChangeBackingProperties:(NSNotification *)pNotification;
+-(void)windowWillStartLiveResize:(NSNotification *)pNotification;
+-(void)windowDidEndLiveResize:(NSNotification *)pNotification;
 //-(void)willEncodeRestorableState:(NSCoder*)pCoderState;
 //-(void)didDecodeRestorableState:(NSCoder*)pCoderState;
 //-(void)windowWillEnterVersionBrowser:(NSNotification*)pNotification;
@@ -261,9 +263,6 @@ enum class SalEvent;
 -(NSArray *)accessibilityChildren;
 -(NSArray > 
*)accessibilityChildrenInNavigationOrder;
 
--(void)viewWillStartLiveResize;
--(void)viewDidEndLiveResize;
-
 @end
 
 @interface SalFrameViewA11yWrapper : AquaA11yWrapper
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index c58320558013..4fd5913efc05 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -196,24 +196,19 @@ static NSArray *getMergedAccessibilityChildren(NSArray 
*pDefaultChildren, NSArra
 return pRet;
 }
 
-// Update ImplGetSVData()->mpWinData->mbIsLiveResize and return the old value
-static bool updateWinDataInLiveResize(bool bInLiveResize)
+// Update ImplGetSVData()->mpWinData->mbIsLiveResize
+static void updateWinDataInLiveResize(bool bInLiveResize)
 {
-bool bRet = false;
-
 ImplSVData* pSVData = ImplGetSVData();
 assert( pSVData );
 if ( pSVData )
 {
-bRet = pSVData->mpWinData->mbIsLiveResize;
-if ( bRet != bInLiveResize )
+if ( pSVData->mpWinData->mbIsLiveResize != bInLiveResize )
 {
 pSVData->mpWinData->mbIsLiveResize = bInLiveResize;
 Scheduler::Wakeup();
 }
 }
-
-return bRet;
 }
 
 @interface NSResponder (SalFrameWindow)
@@ -405,9 +400,8 @@ static bool updateWinDataInLiveResize(bool bInLiveResize)
 mpFrame->UpdateFrameGeometry();
 mpFrame->CallCallback( SalEvent::Resize, nullptr );
 
-bool bInLiveResize = [self inLiveResize];
-bool bOldInLiveResize = updateWinDataInLiveResize(bInLiveResize);
-if ( bInLiveResize || bOldInLiveResize )
+updateWinDataInLiveResize( [self inLiveResize] );
+if ( ImplGetSVData()->mpWinData->mbIsLiveResize )
 {
 #if HAVE_FEATURE_SKIA
 // Related: tdf#152703 Eliminate empty window with Skia/Metal 
while resizing
@@ -447,7 +441,7 @@ static bool updateWinDataInLiveResize(bool bInLiveResize)
 [self setMinSize:aMinSize];
 [self setMaxSize:aMaxSize];
 
-if ( bInLiveResize )
+if ( ImplGetSVData()->mpWinData->mbIsLiveResize )
 {
 // tdf#152703 Force repaint after live resizing ends
 // Repost this notification so that this selector will be 
called
@@ -568,6 +562,20 @@ static bool updateWinDataInLiveResize(bool bInLiveResize)
 #endif
 }
 
+-(void)windowWillStartLiveResize:(NSNotification *)pNotification
+{
+SolarMutexGuard aGuard;
+
+updateWinDataInLiveResize(true);
+}
+
+-(void)windowDidEndLiveResize:(NSNotification *)pNotification
+{
+SolarMutexGuard aGuard;
+
+updateWinDataInLiveResize(false);
+}
+
 -(void)dockMenuItemTriggered: (id)sender
 {
 (void)sender;
@@ -769,13 +777,7 @@ static bool updateWinDataInLiveResize(bool bInLiveResize)
 if (!mpFrame || !AquaSalFrame::isAlive(mpFrame))
 return;
 
-const bool bIsLiveResize = [self inLiveResize];
-const bool bWasLiveResize = 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2023-11-23 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframe.h |1 
 vcl/inc/osx/salframeview.h |4 ++-
 vcl/osx/salframe.cxx   |   34 ++
 vcl/osx/salframeview.mm|   50 +
 vcl/osx/salinst.cxx|   10 ++---
 5 files changed, 63 insertions(+), 36 deletions(-)

New commits:
commit 54da842381ccb554d3cadc876f23cf183d21bf1a
Author: Patrick Luby 
AuthorDate: Wed Nov 22 18:21:53 2023 -0500
Commit: Patrick Luby 
CommitDate: Thu Nov 23 16:02:27 2023 +0100

tdf#155092 use tracking areas instead of tracking rectangles

Apparently, the older, tracking rectangles selectors cause
unexpected window resizing upon the first mouse down after the
window has been manually resized so switch to the newer,
tracking areas selectors. Also, the NSTrackingInVisibleRect
option allows us to create one single tracking area that
resizes itself automatically over the lifetime of the view.

Note: for some unknown reason, both NSTrackingMouseMoved and
NSTrackingAssumeInside are necessary options for this fix
to work.

Change-Id: I1f771628d872166ff63a52990f671df053d144ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159845
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 2d9b9084fcbb..717e5f310178 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -78,7 +78,6 @@ public:
 
 PointerStylemePointerStyle; // currently 
active pointer style
 
-NSTrackingRectTag   mnTrackingRectTag;  // used to get 
enter/leave messages
 NSRect  maTrackingRect;
 
 CGMutablePathRefmrClippingPath; // used for 
"shaping"
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index f9eca27e305c..1bc2b278d630 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -28,7 +28,6 @@ enum class SalEvent;
 {
 AquaSalFrame*   mpFrame;
 id mDraggingDestinationHandler;
-BOOLmbInLiveResize;
 BOOLmbInWindowDidResize;
 NSTimer*mpLiveResizeTimer;
 }
@@ -262,6 +261,9 @@ enum class SalEvent;
 -(NSArray *)accessibilityChildren;
 -(NSArray > 
*)accessibilityChildrenInNavigationOrder;
 
+-(void)viewWillStartLiveResize;
+-(void)viewDidEndLiveResize;
+
 @end
 
 @interface SalFrameViewA11yWrapper : AquaA11yWrapper
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index a8616c4fedc4..2240de319860 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -84,7 +84,6 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 mpMenu( nullptr ),
 mnExtStyle( 0 ),
 mePointerStyle( PointerStyle::Arrow ),
-mnTrackingRectTag( 0 ),
 mrClippingPath( nullptr ),
 mnICOptions( InputContextFlags::NONE ),
 mnBlinkCursorDelay( nMinBlinkCursorDelay ),
@@ -237,14 +236,27 @@ void AquaSalFrame::initWindowAndView()
 if( mnStyle & SalFrameStyleFlags::TOOLTIP )
 [mpNSWindow setIgnoresMouseEvents: YES];
 else
-[mpNSWindow setAcceptsMouseMovedEvents: YES];
+// Related: tdf#155092 mouse events are now handled by tracking areas
+[mpNSWindow setAcceptsMouseMovedEvents: NO];
 [mpNSWindow setHasShadow: YES];
 
 [mpNSWindow setDelegate: static_cast >(mpNSWindow)];
 
 [mpNSWindow setRestorable:NO];
-const NSRect aRect = { NSZeroPoint, NSMakeSize(maGeometry.width(), 
maGeometry.height()) };
-mnTrackingRectTag = [mpNSView addTrackingRect: aRect owner: mpNSView 
userData: nil assumeInside: NO];
+
+// tdf#155092 use tracking areas instead of tracking rectangles
+// Apparently, the older, tracking rectangles selectors cause
+// unexpected window resizing upon the first mouse down after the
+// window has been manually resized so switch to the newer,
+// tracking areas selectors. Also, the NSTrackingInVisibleRect
+// option allows us to create one single tracking area that
+// resizes itself automatically over the lifetime of the view.
+// Note: for some unknown reason, both NSTrackingMouseMoved and
+// NSTrackingAssumeInside are necessary options for this fix
+// to work.
+NSTrackingArea *pTrackingArea = [[NSTrackingArea alloc] initWithRect: 
[mpNSView bounds] options: ( NSTrackingMouseEnteredAndExited | 
NSTrackingMouseMoved | NSTrackingActiveAlways | NSTrackingAssumeInside | 
NSTrackingInVisibleRect ) owner: mpNSView userInfo: nil];
+[mpNSView addTrackingArea: pTrackingArea];
+[pTrackingArea release];
 
 maSysData.mpNSView = mpNSView;
 
@@ -1832,7 +1844,6 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent )
 
 void AquaSalFrame::UpdateFrameGeometry()
 {
-bool bFirstTime = (mnTrackingRectTag == 0);
 mbGeometryDidChange = false;
 
 if ( !mpNSWindow )
@@ -1848,7 +1859,7 @@ void 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2023-11-06 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframe.h  |3 +++
 vcl/osx/salframe.cxx|9 ++---
 vcl/osx/salframeview.mm |7 +++
 3 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 0c54c09aeb7e170512195c8f619ab2ded98c1ec5
Author: Patrick Luby 
AuthorDate: Mon Nov 6 09:44:18 2023 -0500
Commit: Patrick Luby 
CommitDate: Mon Nov 6 20:27:08 2023 +0100

tdf#155266 force flush after scrolling

This is the second attempt to force a flush after scrolling.
Commit 9c0803edd1f42b2d29115674795c7c674fea1a35 worked on
Mac Silicon but not Mac Intel.

So, instead of calling [NSApp currentEvent] to determine if
scrolling has occurred, mark the AquaSalFrame whenever a
scrollwheel or mouse drag event is dispatched so the frame
will be flushed in the next AquaSalFrame::Flush() call.

Change-Id: I2d0b99d2cd1167e92c7fd89bf53b2f30ab85a165
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159003
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 21a4b963717d..2d9b9084fcbb 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -98,6 +98,9 @@ public:
 
 int mnBlinkCursorDelay;
 
+// tdf#155266 force flush after scrolling
+boolmbForceFlush;
+
 public:
 /** Constructor
 
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index d20e6e3d8422..a8616c4fedc4 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -87,7 +87,8 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 mnTrackingRectTag( 0 ),
 mrClippingPath( nullptr ),
 mnICOptions( InputContextFlags::NONE ),
-mnBlinkCursorDelay ( nMinBlinkCursorDelay )
+mnBlinkCursorDelay( nMinBlinkCursorDelay ),
+mbForceFlush( false )
 {
 mpParent = dynamic_cast(pParent);
 
@@ -1018,8 +1019,9 @@ void AquaSalFrame::Flush()
 // outside of the application's event loop (e.g. IntroWindow)
 // nothing would trigger paint event handling
 // => fall back to synchronous painting
-if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
+if( mbForceFlush || ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
 {
+mbForceFlush = false;
 mpGraphics->Flush();
 [mpNSView display];
 }
@@ -1039,8 +1041,9 @@ void AquaSalFrame::Flush( const tools::Rectangle& rRect )
 // outside of the application's event loop (e.g. IntroWindow)
 // nothing would trigger paint event handling
 // => fall back to synchronous painting
-if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
+if( mbForceFlush || ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
 {
+mbForceFlush = false;
 mpGraphics->Flush( rRect );
 [mpNSView display];
 }
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 4071155e28cc..27c9e773ec4c 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -861,6 +861,10 @@ static NSArray *getMergedAccessibilityChildren(NSArray 
*pDefaultChildren, NSArra
 aEvent.mnX = pDispatchFrame->maGeometry.width() - 1 - aEvent.mnX;
 
 pDispatchFrame->CallCallback( nEvent,  );
+
+// tdf#155266 force flush after scrolling
+if (nButton == MOUSE_LEFT && nEvent == SalEvent::MouseMove)
+mpFrame->mbForceFlush = true;
 }
 }
 
@@ -1164,6 +1168,9 @@ static NSArray *getMergedAccessibilityChildren(NSArray 
*pDefaultChildren, NSArra
 
 mpFrame->CallCallback( SalEvent::WheelMouse,  );
 }
+
+// tdf#155266 force flush after scrolling
+mpFrame->mbForceFlush = true;
 }
 }
 


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2023-06-07 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/a11yfactory.h|6 
 vcl/inc/osx/a11ywrapper.h|   16 +
 vcl/inc/osx/salframeview.h   |   44 
 vcl/inc/quartz/salgdi.h  |2 
 vcl/osx/a11yactionwrapper.h  |1 
 vcl/osx/a11yactionwrapper.mm |   19 +
 vcl/osx/a11yfactory.mm   |   57 -
 vcl/osx/a11ywrapper.mm   |  435 +--
 vcl/osx/salframe.cxx |7 
 vcl/osx/salframeview.mm  |  374 
 vcl/osx/salgdiutils.cxx  |   36 +++
 11 files changed, 918 insertions(+), 79 deletions(-)

New commits:
commit 75dc3a54fca8b2dc775ba007190d8c2e188f1c0a
Author: Patrick Luby 
AuthorDate: Wed Jun 7 13:53:39 2023 -0400
Commit: Patrick Luby 
CommitDate: Wed Jun 7 21:48:54 2023 +0200

Partial fix tdf#155376 use NSAccessibilityElement instead of NSView

On macOS, accessibility is implemented by creating a native NSView
for each C++ accessible element. The problem with using an NSView
for each element is that NSViews are very slow to add to or remove from
an NSWindow once the number of NSViews is more than a thousand or so.

Fortunately, Apple added a protocol that allows adding a native
accessible element using the lightweight NSAccessiblityElement class.
The topmost NSAccessiblityElement elements are connected to the single
SalFrameView in each NSWindow but since NSAccessiblityElements are not
NSViews, they are not connected to any of NSWindow's event or draw
dispatching. This makes NSAccessiblityElements significantly faster to
add to or remove from an NSWindow with no apparent loss in functionality.

Note: this change is a subset of the LibreOffice 4.4 code changes that I
wrote for NeoOffice.

Change-Id: I408108d57217db407512dfa3457fe26d2ab455de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152717
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 

diff --git a/vcl/inc/osx/a11yfactory.h b/vcl/inc/osx/a11yfactory.h
index cec49bf93b6d..9ef837dfaa9d 100644
--- a/vcl/inc/osx/a11yfactory.h
+++ b/vcl/inc/osx/a11yfactory.h
@@ -26,14 +26,14 @@
 @interface AquaA11yFactory : NSObject
 {
 }
-+(void)insertIntoWrapperRepository: (NSView *) viewElement 
forAccessibleContext: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext;
++(void)insertIntoWrapperRepository: (AquaA11yWrapper *) element 
forAccessibleContext: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext;
 +(AquaA11yWrapper *)wrapperForAccessible: (css::uno::Reference < 
css::accessibility::XAccessible >) rxAccessible;
 +(AquaA11yWrapper *)wrapperForAccessibleContext: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext;
 +(AquaA11yWrapper *)wrapperForAccessibleContext: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext 
createIfNotExists:(BOOL) bCreate;
 +(AquaA11yWrapper *)wrapperForAccessibleContext: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext 
createIfNotExists:(BOOL) bCreate asRadioGroup:(BOOL) asRadioGroup;
 +(void)removeFromWrapperRepositoryFor: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext;
-+(void)registerView: (NSView *) theView;
-+(void)revokeView: (NSView *) theViewt;
++(void)registerWrapper: (AquaA11yWrapper *) theWrapper;
++(void)revokeWrapper: (AquaA11yWrapper *) theWrapper;
 @end
 
 
diff --git a/vcl/inc/osx/a11ywrapper.h b/vcl/inc/osx/a11ywrapper.h
index 469e50820e19..1eb4039c57e9 100644
--- a/vcl/inc/osx/a11ywrapper.h
+++ b/vcl/inc/osx/a11ywrapper.h
@@ -50,7 +50,19 @@ struct ReferenceWrapper
 css::uno::Reference < css::accessibility::XAccessibleTextMarkup > 
rAccessibleTextMarkup;
 };
 
-@interface AquaA11yWrapper : NSView
+@interface AquaA11yWrapper : NSAccessibilityElement
+
 {
 ReferenceWrapper maReferenceWrapper;
 BOOL mActsAsRadioGroup;
@@ -68,6 +80,7 @@ struct ReferenceWrapper
 -(id)accessibilityFocusedUIElement;
 -(NSString *)accessibilityActionDescription:(NSString *)action;
 -(void)accessibilityPerformAction:(NSString *)action;
+-(BOOL)performAction:(NSString *)action;
 -(NSArray *)accessibilityActionNames;
 -(id)accessibilityHitTest:(NSPoint)point;
 // Attribute values
@@ -86,6 +99,7 @@ struct ReferenceWrapper
 -(void)setActsAsRadioGroup:(BOOL)actsAsRadioGroup;
 -(BOOL)actsAsRadioGroup;
 -(NSWindow*)windowForParent;
+-(id)init;
 -(id)initWithAccessibleContext: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) anAccessibleContext;
 -(void) setDefaults: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext;
 +(void)setPopupMenuOpen:(BOOL)popupMenuOpen;
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 1282eb10cbee..f9eca27e305c 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -70,11 +70,22 @@ enum class SalEvent;
 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2023-06-02 Thread Noel Grandin (via logerrit)
 vcl/inc/osx/a11ywrapper.h |3 --
 vcl/osx/a11ywrapper.mm|   60 +++---
 vcl/osx/salframeview.mm   |8 ++
 3 files changed, 30 insertions(+), 41 deletions(-)

New commits:
commit 7acc7660a752497a546263d28e82a2e8f61fd702
Author: Noel Grandin 
AuthorDate: Thu Jun 1 14:24:41 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 2 08:03:00 2023 +0200

reduce memory overhead of AquaA11yWrapper

we can allocate this internally, which reduces the number of
heap allocations we need to do

Change-Id: Id5298e70b6816cd65d8285ceea846dc8e9e4b39d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152489
Reviewed-by: Patrick Luby 
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/a11ywrapper.h b/vcl/inc/osx/a11ywrapper.h
index f9b30eb98fcd..469e50820e19 100644
--- a/vcl/inc/osx/a11ywrapper.h
+++ b/vcl/inc/osx/a11ywrapper.h
@@ -52,7 +52,7 @@ struct ReferenceWrapper
 
 @interface AquaA11yWrapper : NSView
 {
-ReferenceWrapper * mpReferenceWrapper;
+ReferenceWrapper maReferenceWrapper;
 BOOL mActsAsRadioGroup;
 BOOL mIsTableCell;
 }
@@ -88,7 +88,6 @@ struct ReferenceWrapper
 -(NSWindow*)windowForParent;
 -(id)initWithAccessibleContext: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) anAccessibleContext;
 -(void) setDefaults: (css::uno::Reference < 
css::accessibility::XAccessibleContext >) rxAccessibleContext;
--(void) dealloc;
 +(void)setPopupMenuOpen:(BOOL)popupMenuOpen;
 -(css::accessibility::XAccessibleAction *)accessibleAction;
 -(css::accessibility::XAccessibleContext *)accessibleContext;
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 96de29e07f77..75763a65a131 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -79,34 +79,33 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 }
 
 -(void) setDefaults: (Reference < XAccessibleContext >) rxAccessibleContext {
-mpReferenceWrapper = new ReferenceWrapper;
 mActsAsRadioGroup = NO;
-mpReferenceWrapper -> rAccessibleContext = rxAccessibleContext;
+maReferenceWrapper.rAccessibleContext = rxAccessibleContext;
 mIsTableCell = NO;
 // Querying all supported interfaces
 try {
 // XAccessibleComponent
-mpReferenceWrapper->rAccessibleComponent.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleComponent.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleExtendedComponent
-mpReferenceWrapper->rAccessibleExtendedComponent.set( 
rxAccessibleContext, UNO_QUERY );
+maReferenceWrapper.rAccessibleExtendedComponent.set( 
rxAccessibleContext, UNO_QUERY );
 // XAccessibleSelection
-mpReferenceWrapper->rAccessibleSelection.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleSelection.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleTable
-mpReferenceWrapper->rAccessibleTable.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleTable.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleText
-mpReferenceWrapper->rAccessibleText.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleText.set( rxAccessibleContext, UNO_QUERY 
);
 // XAccessibleEditableText
-mpReferenceWrapper->rAccessibleEditableText.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleEditableText.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleValue
-mpReferenceWrapper->rAccessibleValue.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleValue.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleAction
-mpReferenceWrapper->rAccessibleAction.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleAction.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleTextAttributes
-mpReferenceWrapper->rAccessibleTextAttributes.set( 
rxAccessibleContext, UNO_QUERY );
+maReferenceWrapper.rAccessibleTextAttributes.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleMultiLineText
-mpReferenceWrapper->rAccessibleMultiLineText.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleMultiLineText.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleTextMarkup
-mpReferenceWrapper->rAccessibleTextMarkup.set( rxAccessibleContext, 
UNO_QUERY );
+maReferenceWrapper.rAccessibleTextMarkup.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleEventBroadcaster
 #if 0
 /* #i102033# NSAccessibility does not seemt to know an equivalent for 
transient children.
@@ -137,13 +136,6 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 }
 }
 
--(void)dealloc {
-if ( mpReferenceWrapper ) {
-delete mpReferenceWrapper;
-}
-[ super dealloc ];
-}
-
 #pragma mark -
 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/qa vcl/source

2023-03-10 Thread Caolán McNamara (via logerrit)
 vcl/inc/IconThemeSelector.hxx |8 ++--
 vcl/osx/salframe.cxx  |2 -
 vcl/qa/cppunit/app/test_IconThemeSelector.cxx |2 -
 vcl/source/app/IconThemeSelector.cxx  |   42 +-
 4 files changed, 34 insertions(+), 20 deletions(-)

New commits:
commit 772328b386db4ab5a2b15e650610c31b34815c8c
Author: Caolán McNamara 
AuthorDate: Fri Mar 10 11:41:45 2023 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Mar 11 03:41:30 2023 +

Use a matching dark icon theme on auto picking icon theme from fallbacks

explicitly use:
 breeze/breeze_dark for plasma
 sukapura/sukapura_dark for macOS
 colibre/colibre_dark for win

originally we only had one dark theme so in a dark theme there was only
one option available, but there's now a bunch to choose from.

In practice nothing changes here because breeze_dark is the current (as
originally only) dark mode fallback for gnome and win/osx name an
explicit something"_dark" in their platform specific bits

Change-Id: I13fdfe586cec30b5a9770dc80c9bdcc6a57d04a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148650
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/inc/IconThemeSelector.hxx b/vcl/inc/IconThemeSelector.hxx
index 8dab03d3a8d2..0bfbf2034858 100644
--- a/vcl/inc/IconThemeSelector.hxx
+++ b/vcl/inc/IconThemeSelector.hxx
@@ -77,12 +77,12 @@ private:
 static OUString
 ReturnFallback(const std::vector& installedThemes);
 
-/** The name of the icon theme which is used as fallback */
-static constexpr OUStringLiteral FALLBACK_ICON_THEME_ID = u"colibre";
-
+/** The name of the icon themes which are used as fallbacks */
+static constexpr OUStringLiteral FALLBACK_LIGHT_ICON_THEME_ID = u"colibre";
+static constexpr OUStringLiteral FALLBACK_DARK_ICON_THEME_ID = 
u"colibre_dark";
 
 static OUString
-GetIconThemeForDesktopEnvironment(const OUString& desktopEnvironment);
+GetIconThemeForDesktopEnvironment(const OUString& desktopEnvironment, bool 
bPreferDarkIconTheme);
 
 OUString mPreferredIconTheme;
 bool mUseHighContrastTheme;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index bf2257be9fac..80045b92913f 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1315,8 +1315,6 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
   NSAppearanceNameAqua, 
NSAppearanceNameDarkAqua]];
 bUseDarkMode = [match isEqualToString: NSAppearanceNameDarkAqua];
 }
-// there is no sukapura_dark, at the time of writing at least, so whatever
-// is considered the default dark icon set will be used
 OUString sThemeName(!bUseDarkMode ? u"sukapura" : u"sukapura_dark");
 aStyleSettings.SetPreferredIconTheme(sThemeName, bUseDarkMode);
 
diff --git a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx 
b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
index 94d53b43d309..72ee344b1437 100644
--- a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
+++ b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
@@ -148,7 +148,7 @@ 
IconThemeSelectorTest::FallbackThemeIsReturnedForEmptyInput()
 vcl::IconThemeSelector s;
 OUString selected = s.SelectIconTheme(std::vector(), 
"colibre");
 CPPUNIT_ASSERT_EQUAL_MESSAGE("fallback is returned for empty input",
-OUString(vcl::IconThemeSelector::FALLBACK_ICON_THEME_ID), 
selected);
+OUString(vcl::IconThemeSelector::FALLBACK_LIGHT_ICON_THEME_ID), 
selected);
 }
 
 void
diff --git a/vcl/source/app/IconThemeSelector.cxx 
b/vcl/source/app/IconThemeSelector.cxx
index fd32008d9414..73c2f7e6ab39 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -51,30 +51,50 @@ IconThemeSelector::IconThemeSelector()
 }
 
 /*static*/ OUString
-IconThemeSelector::GetIconThemeForDesktopEnvironment(const OUString& 
desktopEnvironment)
+IconThemeSelector::GetIconThemeForDesktopEnvironment(const OUString& 
desktopEnvironment, bool bPreferDarkIconTheme)
 {
 if (comphelper::LibreOfficeKit::isActive())
-return "colibre";
+{
+if (!bPreferDarkIconTheme)
+return "colibre";
+else
+return "colibre_dark";
+}
 
 #ifdef _WIN32
 (void)desktopEnvironment;
-return "colibre";
+if (!bPreferDarkIconTheme)
+return "colibre";
+else
+return "colibre_dark";
 #else
 OUString r;
 if ( desktopEnvironment.equalsIgnoreAsciiCase("plasma5") ||
  desktopEnvironment.equalsIgnoreAsciiCase("lxqt") ) {
-r = "breeze";
+if (!bPreferDarkIconTheme)
+r = "breeze";
+else
+r = "breeze_dark";
 }
 else if ( desktopEnvironment.equalsIgnoreAsciiCase("macosx") ) {
-r = "sukapura";
+if (!bPreferDarkIconTheme)
+r = "sukapura";
+else
+r = "sukapura_dark";
 }
 else if ( 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source

2023-01-13 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframeview.h   |6 +++
 vcl/inc/osx/salinst.h|1 
 vcl/inc/svdata.hxx   |1 
 vcl/osx/salframeview.mm  |   77 +++
 vcl/osx/salinst.cxx  |   14 ++-
 vcl/osx/saltimer.cxx |4 +-
 vcl/source/app/scheduler.cxx |7 +++
 7 files changed, 92 insertions(+), 18 deletions(-)

New commits:
commit fed429e4f6f437997aa6a88e2d071f58aa00ee34
Author: Patrick Luby 
AuthorDate: Sun Jan 8 14:41:24 2023 -0500
Commit: Patrick Luby 
CommitDate: Fri Jan 13 14:10:00 2023 +

Related: tdf#152703 Eliminate potential blocking during live resize

Some events and timers call Application::Reschedule() or
Application::Yield() so don't block and wait for events when a
window is in live resize.

Also, only native events and timers need to be dispatched to redraw
the window so skip dispatching user events when a window is in
live resize.

Lastly, only higher priority tasks need to be fired to redraw the
window so skip firing potentially long-running tasks, such as the
Writer idle layout timer, when a window is in live resize.

Change-Id: I5d449caa432399e836b8e59781e5cc53af718873
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145211
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 7ec995b26c18..6242f3d4146a 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -29,8 +29,12 @@ enum class SalEvent;
 AquaSalFrame*   mpFrame;
 id mDraggingDestinationHandler;
 BOOLmbInLiveResize;
+BOOLmbInWindowDidResize;
+NSTimer*mpLiveResizeTimer;
 }
 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
+-(void)clearLiveResizeTimer;
+-(void)dealloc;
 -(BOOL)canBecomeKeyWindow;
 -(void)displayIfNeeded;
 -(void)windowDidBecomeKey: (NSNotification*)pNotification;
@@ -63,6 +67,8 @@ enum class SalEvent;
 
 -(void)endExtTextInput;
 -(void)endExtTextInput:(EndExtTextInputFlags)nFlags;
+
+-(void)windowDidResizeWithTimer:(NSTimer *)pTimer;
 @end
 
 @interface SalFrameView : AquaA11yWrapper 
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 1e6fce7092fd..8811fa3c9c72 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -89,7 +89,6 @@ public:
 int mnActivePrintJobs;
 osl::Mutex  maUserEventListMutex;
 osl::Condition  maWaitingYieldCond;
-boolmbIsLiveResize;
 boolmbNoYieldLock;
 boolmbTimerProcessed;
 
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 3651eb3bce61..06d0aeb9b9af 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -269,6 +269,7 @@ struct ImplSVWinData
 StartAutoScrollFlagsmnAutoScrollFlags = StartAutoScrollFlags::NONE; // 
auto scroll flags
 boolmbNoDeactivate = false; // true: do not 
execute Deactivate
 boolmbNoSaveFocus = false;  // true: menus 
must not save/restore focus
+boolmbIsLiveResize = false; // true: skip 
waiting for events and low priority timers
 };
 
 typedef std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList;
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 4833af8fda9e..b14d87eb7a37 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -170,6 +170,8 @@ static AquaSalFrame* getMouseContainerFrame()
 {
 mDraggingDestinationHandler = nil;
 mbInLiveResize = NO;
+mbInWindowDidResize = NO;
+mpLiveResizeTimer = nil;
 mpFrame = pFrame;
 NSRect aRect = { { static_cast(pFrame->maGeometry.x()), 
static_cast(pFrame->maGeometry.y()) },
  { static_cast(pFrame->maGeometry.width()), 
static_cast(pFrame->maGeometry.height()) } };
@@ -210,6 +212,22 @@ static AquaSalFrame* getMouseContainerFrame()
 return static_cast(pNSWindow);
 }
 
+-(void)clearLiveResizeTimer
+{
+if ( mpLiveResizeTimer )
+{
+[mpLiveResizeTimer invalidate];
+[mpLiveResizeTimer release];
+mpLiveResizeTimer = nil;
+}
+}
+
+-(void)dealloc
+{
+[self clearLiveResizeTimer];
+[super dealloc];
+}
+
 -(AquaSalFrame*)getSalFrame
 {
 return mpFrame;
@@ -318,12 +336,29 @@ static AquaSalFrame* getMouseContainerFrame()
 (void)pNotification;
 SolarMutexGuard aGuard;
 
+if ( mbInWindowDidResize )
+return;
+
+mbInWindowDidResize = YES;
+
 if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
 {
 mpFrame->UpdateFrameGeometry();
 mpFrame->CallCallback( SalEvent::Resize, nullptr );
 
 bool bInLiveResize = [self inLiveResize];
+ImplSVData* pSVData = ImplGetSVData();
+assert( pSVData );

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2023-01-04 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframeview.h |1 +
 vcl/osx/salframeview.mm|   39 ++-
 2 files changed, 31 insertions(+), 9 deletions(-)

New commits:
commit 3f7406bc4df3c7d6cc618312607bff1ec36a12f7
Author: Patrick Luby 
AuthorDate: Wed Jan 4 10:10:30 2023 -0500
Commit: Noel Grandin 
CommitDate: Wed Jan 4 18:49:55 2023 +

tdf#152703 Force relayout during live resizing of window

During a live resize, macOS floods the application with windowDidResize:
notifications so sending a paint event does not trigger redrawing with
the new size. Instead, force relayout by dispatching all pending internal
events and firing any pending timers.

Also, force a repaint of the window after live resizing ends by reposting
this notification so that [self windowDidResize:] will be called at least
once after live resizing ends.

Change-Id: I9d93108c989418bab6d80c7f6afaccc1daaa746e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145042
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 2fcff0d1c1e5..7ec995b26c18 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -28,6 +28,7 @@ enum class SalEvent;
 {
 AquaSalFrame*   mpFrame;
 id mDraggingDestinationHandler;
+BOOLmbInLiveResize;
 }
 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
 -(BOOL)canBecomeKeyWindow;
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 5a28f647c451..61061253a2da 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -169,6 +169,7 @@ static AquaSalFrame* getMouseContainerFrame()
 -(id)initWithSalFrame: (AquaSalFrame*)pFrame
 {
 mDraggingDestinationHandler = nil;
+mbInLiveResize = NO;
 mpFrame = pFrame;
 NSRect aRect = { { static_cast(pFrame->maGeometry.x()), 
static_cast(pFrame->maGeometry.y()) },
  { static_cast(pFrame->maGeometry.width()), 
static_cast(pFrame->maGeometry.height()) } };
@@ -226,6 +227,7 @@ static AquaSalFrame* getMouseContainerFrame()
 // explicitly flush the Skia graphics to the window during live
 // resizing or else nothing will be drawn until after live resizing
 // has ended.
+// TODO: See if flickering when flushing can be eliminated somehow.
 if ( [self inLiveResize] && SkiaHelper::isVCLSkiaEnabled() && mpFrame 
&& AquaSalFrame::isAlive( mpFrame ) )
 {
 AquaSalGraphics* pGraphics = mpFrame->mpGraphics;
@@ -337,16 +339,35 @@ static AquaSalFrame* getMouseContainerFrame()
 mpFrame->UpdateFrameGeometry();
 mpFrame->CallCallback( SalEvent::Resize, nullptr );
 
-// Related: tdf#152703 Stop flicker with Skia/Metal while resizing
-// When Skia/Metal is enabled, rapidly resizing a window has a
-// noticeable amount of flicker so don't send any paint events during
-// live resizing.
-// Also, it appears that most of the LibreOffice layouts do not change
-// their layout much during live resizing so apply this change when
-// Skia is not enabled to ensure consistent behavior whether Skia is
-// enabled or not.
-if ( ![self inLiveResize] )
+if ( [self inLiveResize] )
+{
+mbInLiveResize = YES;
+
+// tdf#152703 Force relayout during live resizing of window
+// During a live resize, macOS floods the application with
+// windowDidResize: notifications so sending a paint event does
+// not trigger redrawing with the new size.
+// Instead, force relayout by dispatching all pending internal
+// events and firing any pending timers.
+Application::Reschedule( true );
+
+// tdf#152703 Force repaint after live resizing ends
+// Repost this notification so that this selector will be called
+// at least once after live resizing ends. Pass nil for withObject:
+// since it is unused and makes it easier to cancel all pending
+// selector execution when live resizing ends.
+[self performSelector:@selector(windowDidResize:) withObject:nil 
afterDelay:0.1f];
+}
+else
+{
+if ( mbInLiveResize )
+{
+mbInLiveResize = NO;
+[NSObject cancelPreviousPerformRequestsWithTarget:self 
selector:@selector(windowDidResize:) object:nil];
+}
+
 mpFrame->SendPaintEvent();
+}
 }
 }
 


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2022-12-22 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframeview.h |2 
 vcl/osx/salframeview.mm|  157 ++---
 2 files changed, 151 insertions(+), 8 deletions(-)

New commits:
commit 1e4ef6d69b22f6674aefb415edf2e8e7ca78ff2d
Author: Patrick Luby 
AuthorDate: Tue Dec 20 10:30:00 2022 -0500
Commit: Noel Grandin 
CommitDate: Thu Dec 22 16:43:55 2022 +

tdf#42437 Enable press-and-hold special character input method

The first step to enable this input method is to always return a valid 
selected
range location. -[NSResponder interpretKeyEvents:] will not call
[self firstRectForCharacterRange:actualRange:] if the selected range 
location
is NSNotFound so that is what was disabling display of the press-and-hold
input method popup.

Once [self firstRectForCharacterRange:actualRange:] is called, emulate the
press-and-hold behavior of the TextEdit application by setting the marked 
text
to the last key down event's characters. The characters will already have 
been
committed by the special character input method so set the
mbTextInputWantsNonRepeatKeyDown flag to indicate that the characters need 
to
be deleted if the input method replaces the committed characters.

Also, emulate the press-and-hold behavior of the TextEdit application by
committing any uncommitted text when either the escape or the return key is
pressed while the press-and-hold input method popup is displayed.

Lastly, handle repeat key events by explicitly inserting the text if there 
is
no uncommitted text before -[NSResponder interpretKeyEvents:] is called.

Change-Id: I104b3d64a8c66fef3a5a1cec0fba1daa553cd9a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144630
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 4ec0b6c06651..2fcff0d1c1e5 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -86,6 +86,7 @@ enum class SalEvent;
 BOOLmbInEndExtTextInput;
 BOOLmbInCommitMarkedText;
 NSAttributedString* mpLastMarkedText;
+BOOLmbTextInputWantsNonRepeatKeyDown;
 }
 +(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
@@ -217,6 +218,7 @@ enum class SalEvent;
 
 -(void)endExtTextInput;
 -(void)endExtTextInput:(EndExtTextInputFlags)nFlags;
+-(void)deleteTextInputWantsNonRepeatKeyDown;
 
 @end
 
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index e6fda362f927..8b7a2e8c565c 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -483,6 +483,7 @@ static AquaSalFrame* getMouseContainerFrame()
 mbInEndExtTextInput = NO;
 mbInCommitMarkedText = NO;
 mpLastMarkedText = nil;
+mbTextInputWantsNonRepeatKeyDown = NO;
 }
 
 return self;
@@ -969,8 +970,52 @@ static AquaSalFrame* getMouseContainerFrame()
 
 if( ! [self handleKeyDownException: pEvent] )
 {
+sal_uInt16 nKeyCode = ImplMapKeyCode( [pEvent keyCode] );
+if ( nKeyCode == KEY_DELETE && mbTextInputWantsNonRepeatKeyDown )
+{
+// tdf#42437 Enable press-and-hold special character input 
method
+// Emulate the press-and-hold behavior of the TextEdit
+// application by deleting the marked text when only the
+// Delete key is pressed and keep the marked text when the
+// Backspace key or Fn-Delete keys are pressed.
+if ( [pEvent keyCode] == 51 )
+{
+[self deleteTextInputWantsNonRepeatKeyDown];
+}
+else
+{
+[self unmarkText];
+mbKeyHandled = true;
+mbInKeyInput = false;
+}
+
+[self endExtTextInput];
+return;
+}
+
 NSArray* pArray = [NSArray arrayWithObject: pEvent];
 [self interpretKeyEvents: pArray];
+
+// Handle repeat key events by explicitly inserting the text if
+// -[NSResponder interpretKeyEvents:] does not insert or mark any
+// text. Note: do not do this step if there is uncommitted text.
+if ( !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == 
NSEventTypeKeyDown && [mpLastEvent isARepeat] )
+{
+NSString *pChars = [mpLastEvent characters];
+[self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
+}
+// tdf#42437 Enable press-and-hold special character input method
+// Emulate the press-and-hold behavior of the TextEdit application
+// by committing an empty string for key down events dispatched
+// while the special character input method popup is displayed.
+else if ( 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2022-12-11 Thread Patrick Luby (via logerrit)
 vcl/inc/quartz/salbmp.h|6 +
 vcl/osx/salinst.cxx|6 +
 vcl/quartz/AquaGraphicsBackend.cxx |  139 +
 vcl/quartz/salbmp.cxx  |   60 +++
 4 files changed, 210 insertions(+), 1 deletion(-)

New commits:
commit 9eb732a32023e74c44ac8c3b5af9f5424273bb6c
Author: Patrick Luby 
AuthorDate: Sat Dec 10 14:16:39 2022 -0500
Commit: Caolán McNamara 
CommitDate: Sun Dec 11 20:02:53 2022 +

Related: tdf#146842 Convert SkiaSalBitmap to QuartzSalBitmap

Commit de3f13e2175564316eb5a62dee65e9ff8f31b460 disabled Skia for printing.
However, since all SalBitmaps created are either all QuartzSalBitmaps or all
SkiaSalBitmaps, a crash occurs whenever a SkiaSalBitmap is passed to a
printer's SalGraphics instance which is now always non-Skia.

Change-Id: I7c1b0e1a9993e21db18ba5695a106cb10cc4088a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143939
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h
index 8a9e94d043cc..459a2b528f99 100644
--- a/vcl/inc/quartz/salbmp.h
+++ b/vcl/inc/quartz/salbmp.h
@@ -30,6 +30,9 @@
 #include 
 #include 
 #include 
+#if HAVE_FEATURE_SKIA
+#include 
+#endif
 
 #include 
 
@@ -61,6 +64,9 @@ public:
 boolCreate( const SalBitmap& rSalBmp ) override;
 boolCreate( const SalBitmap& rSalBmp, SalGraphics* pGraphics ) 
override;
 boolCreate( const SalBitmap& rSalBmp, vcl::PixelFormat 
eNewPixelFormat) override;
+#if HAVE_FEATURE_SKIA
+boolCreate( const SkiaSalBitmap& rSkiaSalBmp, const 
SalTwoRect& rPosAry );
+#endif
 virtual boolCreate( const css::uno::Reference< 
css::rendering::XBitmapCanvas >& rBitmapCanvas,
 Size& rSize,
 bool bMask = false ) override;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index e7f202ae7ae5..22a024bc265d 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -524,7 +524,11 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* 
pEvent )
 bool AquaSalInstance::RunInMainYield( bool bHandleAllCurrentEvents )
 {
 OSX_SALDATA_RUNINMAIN_UNION( DoYield( false, bHandleAllCurrentEvents), 
boolean )
-assert( false && "Don't call this from the main thread!" );
+
+// PrinterController::removeTransparencies() calls this frequently on the
+// main thread so reduce the severity from an assert so that printing still
+// works in a debug builds
+SAL_WARN_IF( true, "vcl", "Don't call this from the main thread!" );
 return false;
 
 }
diff --git a/vcl/quartz/AquaGraphicsBackend.cxx 
b/vcl/quartz/AquaGraphicsBackend.cxx
index 987ce5b784a5..7482986dd58a 100644
--- a/vcl/quartz/AquaGraphicsBackend.cxx
+++ b/vcl/quartz/AquaGraphicsBackend.cxx
@@ -44,6 +44,11 @@
 #include 
 #endif
 
+#if HAVE_FEATURE_SKIA
+#include 
+#include 
+#endif
+
 using namespace vcl;
 
 namespace
@@ -187,6 +192,48 @@ void drawPattern50(void*, CGContextRef rContext)
 CGContextAddRects(rContext, aRects, 2);
 CGContextFillPath(rContext);
 }
+
+#if HAVE_FEATURE_SKIA
+
+// Related: tdf#146842 Convert SkiaSalBitmap to QuartzSalBitmap
+// Commit de3f13e2175564316eb5a62dee65e9ff8f31b460 disabled Skia for printing.
+// However, since all SalBitmaps created are either all QuartzSalBitmaps or all
+// SkiaSalBitmaps, a crash occurs whenever a SkiaSalBitmap is passed to a
+// printer's SalGraphics instance which is now always non-Skia.
+QuartzSalBitmap* checkAndConvertToQuartzSalBitmap(const SalTwoRect& rPosAry,
+  const SalBitmap& rSalBitmap,
+  SalTwoRect* 
pAdjustedSrcPosAry)
+{
+QuartzSalBitmap* pRet = nullptr;
+
+if (SkiaHelper::isVCLSkiaEnabled() && dynamic_cast())
+{
+const SkiaSalBitmap& rSkiaBitmap = static_cast(rSalBitmap);
+
+SalTwoRect aSrcPosAry(rPosAry);
+aSrcPosAry.mnDestX = 0;
+aSrcPosAry.mnDestY = 0;
+
+pRet = new QuartzSalBitmap;
+if (pRet)
+{
+// Ignore any failures as returning a nullptr will lead to a crash
+pRet->Create(rSkiaBitmap, aSrcPosAry);
+
+if (pAdjustedSrcPosAry)
+{
+pAdjustedSrcPosAry->mnSrcX = 0;
+pAdjustedSrcPosAry->mnSrcY = 0;
+pAdjustedSrcPosAry->mnSrcWidth = aSrcPosAry.mnDestWidth;
+pAdjustedSrcPosAry->mnSrcHeight = aSrcPosAry.mnDestHeight;
+}
+}
+}
+
+return pRet;
+}
+
+#endif
 }
 
 AquaGraphicsBackend::AquaGraphicsBackend(AquaSharedAttributes& rShared)
@@ -904,6 +951,21 @@ void AquaGraphicsBackend::drawBitmap(const SalTwoRect& 
rPosAry, const SalBitmap&
 if (!mrShared.checkContext())
 return;
 
+#if HAVE_FEATURE_SKIA
+if (mrShared.mbPrinter)
+{
+SAL_INFO("vcl.print", "Printing with 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2022-12-09 Thread Patrick Luby (via logerrit)
 vcl/inc/quartz/salgdi.h |2 +-
 vcl/osx/salprn.cxx  |2 +-
 vcl/quartz/salgdi.cxx   |   11 +--
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit de3f13e2175564316eb5a62dee65e9ff8f31b460
Author: Patrick Luby 
AuthorDate: Wed Dec 7 14:24:57 2022 -0500
Commit: Caolán McNamara 
CommitDate: Fri Dec 9 09:17:42 2022 +

tdf#146842 Do not use Skia for printing

Skia does not work with a native print graphics contexts. I am not sure why 
but from what I can see, the Skia implementation drawing to a bitmap buffer. 
However, in an NSPrintOperation, the print view's backing buffer is 
CGPDFContext so even if this bug could be solved by blitting the Skia bitmap 
buffer, the printed PDF would not have selectable text so always disable Skia 
for print graphics contexts.

Change-Id: I214ba83b6e368af3ef51ea770b093612d04047a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143798
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 61ff01c12e3a..9e070c4215ce 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -454,7 +454,7 @@ class AquaSalGraphics : public SalGraphicsAutoDelegateToImpl
 rtl::ReferencempFont[MAX_FALLBACK];
 
 public:
-AquaSalGraphics();
+AquaSalGraphics(bool bPrinter = false);
 virtual ~AquaSalGraphics() override;
 
 voidSetVirDevGraphics(SalVirtualDevice* 
pVirDev,CGLayerHolder const , CGContextRef, int nBitDepth = 0);
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index bec30a35b562..e9101e390085 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -71,7 +71,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const 
SalPrinterQueueInfo& i_rQueue ) :
 [mpPrintInfo setOrientation: NSPaperOrientationPortrait];
 }
 
-mpGraphics = new AquaSalGraphics();
+mpGraphics = new AquaSalGraphics(true);
 
 const int nWidth = 100, nHeight = 100;
 mpContextMemory.reset(new (std::nothrow) sal_uInt8[nWidth * 4 * nHeight]);
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 1058b7bc31e9..571e44f23e71 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -137,14 +137,21 @@ sal_IntPtr CoreTextFontFace::GetFontId() const
 return reinterpret_cast(mxFontDescriptor);
 }
 
-AquaSalGraphics::AquaSalGraphics()
+AquaSalGraphics::AquaSalGraphics(bool bPrinter)
 : mnRealDPIX( 0 )
 , mnRealDPIY( 0 )
 {
 SAL_INFO( "vcl.quartz", "AquaSalGraphics::AquaSalGraphics() this=" << this 
);
 
 #if HAVE_FEATURE_SKIA
-if(SkiaHelper::isVCLSkiaEnabled())
+// tdf#146842 Do not use Skia for printing
+// Skia does not work with a native print graphics contexts. I am not sure
+// why but from what I can see, the Skia implementation drawing to a bitmap
+// buffer. However, in an NSPrintOperation, the print view's backing buffer
+// is CGPDFContext so even if this bug could be solved by blitting the
+// Skia bitmap buffer, the printed PDF would not have selectable text so
+// always disable Skia for print graphics contexts.
+if(!bPrinter && SkiaHelper::isVCLSkiaEnabled())
 mpBackend.reset(new AquaSkiaSalGraphicsImpl(*this, maShared));
 #else
 if(false)


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2022-12-08 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframeview.h |   12 ++
 vcl/osx/salframe.cxx   |   12 ++
 vcl/osx/salframeview.mm|  184 -
 vcl/osx/salnsmenu.mm   |   14 +++
 vcl/osx/vclnsapp.mm|   11 ++
 5 files changed, 212 insertions(+), 21 deletions(-)

New commits:
commit 9ee57f36e26373ee7144d076c93c3462c4fc7110
Author: Patrick Luby 
AuthorDate: Sat Dec 3 13:41:23 2022 -0500
Commit: Caolán McNamara 
CommitDate: Thu Dec 8 09:33:38 2022 +

tdf#82115 Commit uncommitted text when a popup menu is opened

The Windows implementation of the SalFrame::EndExtTextInput() method 
commits or discards the native input method session. It appears that most macOS 
applications discard the uncommitted text when cancelling a session so always 
commit the uncommitted text. This change also commits any uncommitted text and 
cancels the native input method session whenever a window loses focus like in 
Safari, Firefox, and Excel.

Note: if there is any marked text, SalEvent::EndExtTextInput may leave the 
cursor hidden so commit the marked range to force the cursor to be visible.

Dispatching SalEvent::EndExtTextInput in SalFrame::EndExtTextInput() 
creates some other related native input method handling bugs that have also 
been fixed in this patch:

- Whenever a SalEvent::EndExtTextInput event is dispatched, cancel the 
native input method session so that the native input context's state is in sync 
with LibreOffice's internal state. The only exceptions are in [SalFrameView 
insertText:replacementRange:] or [SalFrameView 
setMarkedText:selectedRange:replacementRange:] because when these two selectors 
commit text, the native input method session has already been cancelled and 
calling [SalFrameView endExtTextInput] will cause repeated text insertions from 
the native macOS Character Viewer dialog to overwrite previous insertions.

- Highlight all characters in the selected range. Normally uncommitted text 
is underlined but when an item is selected in the native input method popup or 
selecting a subblock of uncommitted text using the left or right arrow keys, 
the selection range is set and the selected range is either highlighted like in 
Excel or is bold underlined like in Safari. Highlighting the selected range was 
chosen because highlighting was used in LibreOffice 7.4.x and using bold and 
double underlines can get clipped making the selection range indistinguishable 
from the rest of the uncommitted text.

- The fix for ooo#106901 always returns a zero length range if [self 
markedRange] called outside of mbInKeyInput. If a zero length range is 
returned, macOS won't call [self firstRectForCharacterRange:actualRange:] for 
any newly appended uncommitted text and the native input method popup will 
appear in the bottom left corner of the screen. So, [self markedRange] now 
returns the marked range if is valid.

- Commit uncommitted text before dispatching menu item selections and key 
shortcuts. In certain cases such as selecting the Insert > Comment menu item or 
pressing Command-Option-C in a Writer document while there is uncommitted text 
will call AquaSalFrame::EndExtTextInput() which will dispatch a 
SalEvent::EndExtTextInput event. Writer's handler for that event will delete 
the uncommitted text and then insert the committed text but LibreOffice will 
crash when deleting the uncommitted text because deletion of the text also 
removes and deletes the newly inserted comment.

Change-Id: I4ff4682aeef7d42ce26059aa76f971a68128833c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143619
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 36537f3db958..4ec0b6c06651 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -59,6 +59,9 @@ enum class SalEvent;
 
 -(void)registerDraggingDestinationHandler:(id)theHandler;
 -(void)unregisterDraggingDestinationHandler:(id)theHandler;
+
+-(void)endExtTextInput;
+-(void)endExtTextInput:(EndExtTextInputFlags)nFlags;
 @end
 
 @interface SalFrameView : AquaA11yWrapper 
@@ -79,9 +82,14 @@ enum class SalEvent;
 // #i102807# used by magnify event handler
 NSTimeInterval  mfLastMagnifyTime;
 float   mfMagnifyDeltaSum;
+
+BOOLmbInEndExtTextInput;
+BOOLmbInCommitMarkedText;
+NSAttributedString* mpLastMarkedText;
 }
 +(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
+-(void)dealloc;
 -(AquaSalFrame*)getSalFrame;
 -(BOOL)acceptsFirstResponder;
 -(BOOL)acceptsFirstMouse: (NSEvent *)pEvent;
@@ -112,6 +120,7 @@ enum class SalEvent;
 -(BOOL)sendSingleCharacter:(NSEvent*)pEvent;
 -(BOOL)handleKeyDownException:(NSEvent*)pEvent;
 -(void)clearLastEvent;
+-(void)clearLastMarkedText;
 /*
 text action methods
 */
@@ -206,6 +215,9 @@ enum class SalEvent;
 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2022-11-22 Thread Caolán McNamara (via logerrit)
 vcl/inc/osx/salinst.h|8 
 vcl/osx/salframe.cxx |   98 +++-
 vcl/osx/salinst.cxx  |   35 -
 vcl/osx/salnativewidgets.cxx |  851 +--
 4 files changed, 616 insertions(+), 376 deletions(-)

New commits:
commit c5396467030ebb47d3d0d649b28aed2cf2554a66
Author: Caolán McNamara 
AuthorDate: Thu Nov 3 15:17:49 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 22 12:12:01 2022 +0100

use an alternative macOS themeing approach to support dark-mode

checkboxes, radiobuttons and pushbuttons look decent, focus ring works

editboxes work, focus ring doesn't for some reason, so faked that in

spinbuttons work

list and combo boxes work

scrollbars work, though with some degree of overly complicated fakery

tabpanes and tabcontrols work

sliders work

progress bars work

disclosure butttons in listtrees work

a dark mode icon theme is automatically selected under dark mode

Change-Id: I4835c7639f725a0154288440fcad400f618438e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141435
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 6d707807d38e..1e6fce7092fd 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -76,6 +76,14 @@ class AquaSalInstance : public SalInstance, public 
SalUserEventList
 public:
 virtual void TriggerUserEventProcessing() override;
 
+NSButtonCell*   mpButtonCell;
+NSButtonCell*   mpCheckCell;
+NSButtonCell*   mpRadioCell;
+NSTextFieldCell*mpTextFieldCell;
+NSComboBoxCell* mpComboBoxCell;
+NSPopUpButtonCell*  mpPopUpButtonCell;
+NSStepperCell*  mpStepperCell;
+NSButtonCell*   mpListNodeCell;
 OUStringmaDefaultPrinter;
 oslThreadIdentifier maMainThread;
 int mnActivePrintJobs;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index dee0ada8e6a1..76635cf9f270 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -52,6 +52,7 @@
 // needed for theming
 // FIXME: move theming code to salnativewidgets.cxx
 #include 
+#include 
 #include 
 
 
@@ -1149,6 +1150,48 @@ static void getAppleScrollBarVariant(StyleSettings 
)
 }
 }
 
+static Color getNSBoxBackgroundColor(NSColor* pSysColor)
+{
+// Figuring out what a NSBox will draw for windowBackground, etc. seems 
very difficult.
+// So just draw to a 1x1 surface and read what actually gets drawn
+// This is similar to getPixel
+#if defined OSL_BIGENDIAN
+struct
+{
+unsigned char b, g, r, a;
+} aPixel;
+#else
+struct
+{
+unsigned char a, r, g, b;
+} aPixel;
+#endif
+
+// create a one-pixel bitmap context
+CGContextRef xOnePixelContext = CGBitmapContextCreate(
+, 1, 1, 8, 32, GetSalData()->mxRGBSpace,
+uint32_t(kCGImageAlphaNoneSkipFirst) | 
uint32_t(kCGBitmapByteOrder32Big));
+
+NSGraphicsContext* graphicsContext = [NSGraphicsContext 
graphicsContextWithCGContext:xOnePixelContext flipped:NO];
+
+NSRect rect = { NSZeroPoint, NSMakeSize(1, 1) };
+NSBox* pBox = [[NSBox alloc] initWithFrame: rect];
+
+[pBox setBoxType: NSBoxCustom];
+[pBox setFillColor: pSysColor];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH // setBorderType first deprecated in 
macOS 10.15
+[pBox setBorderType: NSNoBorder];
+SAL_WNODEPRECATED_DECLARATIONS_POP
+
+[pBox displayRectIgnoringOpacity: rect inContext: graphicsContext];
+
+[pBox release];
+
+CGContextRelease(xOnePixelContext);
+
+return Color(aPixel.r, aPixel.g, aPixel.b);
+}
+
 static Color getColor( NSColor* pSysColor, const Color& rDefault, NSWindow* 
pWin )
 {
 Color aRet( rDefault );
@@ -1165,12 +1208,6 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 CGFloat r = 0, g = 0, b = 0, a = 0;
 [pRBGColor getRed:  green:  blue:  alpha: ];
 aRet = Color( int(r*255.999), int(g*255.999), int(b*255.999) );
-/*
-do not release here; leads to duplicate free in yield
-it seems the converted color comes out autoreleased, although this
-is not documented
-[pRBGColor release];
-*/
 }
 }
 return aRet;
@@ -1225,19 +1262,44 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 StyleSettings aStyleSettings = rSettings.GetStyleSettings();
 
+
+bool bUseDarkMode(false);
+NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+if (userDefaults != nil)
+{
+NSString* setting = [userDefaults stringForKey: 
@"AppleInterfaceStyle"];
+bUseDarkMode = (setting && 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz vcl/skia

2022-10-12 Thread Noel Grandin (via logerrit)
 vcl/inc/osx/saldata.hxx|3 ++-
 vcl/inc/quartz/ctfonts.hxx |2 +-
 vcl/inc/quartz/salgdi.h|8 +---
 vcl/osx/saldata.cxx|2 +-
 vcl/quartz/ctfonts.cxx |   12 +---
 vcl/quartz/salgdi.cxx  |   11 ++-
 vcl/skia/osx/gdiimpl.cxx   |2 +-
 7 files changed, 21 insertions(+), 19 deletions(-)

New commits:
commit 2e78c92dfeefc301b1cc69130433917c3e77bfdc
Author: Noel Grandin 
AuthorDate: Mon Oct 3 16:00:11 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 12 13:09:24 2022 +0200

use unique_ptr for SystemFontList, fix leak

Using unique_ptr here fixes a leak, which in turn was hiding
the fact that we don't manage the lifecycle of CTFontDescriptor
in CoreTextFontFace properly

Change-Id: I2ade5fae9a40ad0ebb10538488018941f3f285c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140916
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index e201f45715c2..ba4d6e8c856b 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -68,7 +69,7 @@ public:
 SalObject*mpFirstObject;// pointer 
of first object window
 SalVirtualDevice *mpFirstVD;// first 
VirDev
 SalPrinter   *mpFirstPrinter;   // first 
printing printer
-SystemFontList   *mpFontList;
+std::unique_ptr   mpFontList;
 NSStatusItem* mpStatusItem; // one 
status item that draws all our statuses
 // at the 
moment this is only one add menu button
 CGColorSpaceRef   mxRGBSpace;
diff --git a/vcl/inc/quartz/ctfonts.hxx b/vcl/inc/quartz/ctfonts.hxx
index 431385aeeda6..be68dea71c9a 100644
--- a/vcl/inc/quartz/ctfonts.hxx
+++ b/vcl/inc/quartz/ctfonts.hxx
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-SystemFontList* GetCoretextFontList();
+std::unique_ptr GetCoretextFontList();
 FontAttributes DevFontFromCTFontDescriptor(CTFontDescriptorRef, bool*);
 
 #endif // INCLUDED_VCL_INC_QUARTZ_CTFONTS_HXX
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 0bf004033c52..5d2611f5b06e 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -61,11 +61,13 @@ class XorEmulation;
 class CoreTextFontFace : public vcl::font::PhysicalFontFace
 {
 public:
-CoreTextFontFace( const FontAttributes&, 
sal_IntPtr nFontID );
+CoreTextFontFace( const FontAttributes&, 
CTFontDescriptorRef xRef );
 virtual ~CoreTextFontFace() override;
 
 sal_IntPtr  GetFontId() const override;
 
+CTFontDescriptorRef GetFontDescriptorRef() const { return 
mxFontDescriptor; }
+
 int GetFontTable( uint32_t nTagCode, unsigned 
char* ) const;
 
 rtl::Reference CreateFontInstance(const 
vcl::font::FontSelectPattern&) const override;
@@ -73,7 +75,7 @@ public:
 virtual hb_blob_t*  GetHbTable(hb_tag_t nTag) const override;
 
 private:
-const sal_IntPtrmnFontId;
+CTFontDescriptorRef mxFontDescriptor;
 };
 
 class CoreTextStyle final : public LogicalFontInstance
@@ -96,7 +98,7 @@ public:
 bool mbFauxBold;
 
 private:
-explicit CoreTextStyle(const vcl::font::PhysicalFontFace&, const 
vcl::font::FontSelectPattern&);
+explicit CoreTextStyle(const CoreTextFontFace&, const 
vcl::font::FontSelectPattern&);
 
 virtual void ImplInitHbFont(hb_font_t*) override;
 bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const 
override;
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index d49df78d2ccf..e3b6703d0878 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #import "apple_remote/RemoteMainController.h"
 
@@ -49,7 +50,6 @@ SalData::SalData()
 mpFirstObject( nullptr ),
 mpFirstVD( nullptr ),
 mpFirstPrinter( nullptr ),
-mpFontList( nullptr ),
 mpStatusItem( nil ),
 mxRGBSpace( CGColorSpaceCreateWithName(kCGColorSpaceSRGB) ),
 mxGraySpace( CGColorSpaceCreateWithName(kCGColorSpaceGenericGrayGamma2_2) 
),
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 887abe4f2f35..298a5274aa1f 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -41,7 +41,7 @@
 #include 
 #include 
 
-CoreTextStyle::CoreTextStyle(const vcl::font::PhysicalFontFace& rPFF, const 
vcl::font::FontSelectPattern& rFSP)
+CoreTextStyle::CoreTextStyle(const CoreTextFontFace& rPFF, const 
vcl::font::FontSelectPattern& rFSP)
 : LogicalFontInstance(rPFF, rFSP)
 , 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2021-10-29 Thread Tor Lillqvist (via logerrit)
 vcl/inc/osx/salinst.h|2 
 vcl/osx/DropTarget.cxx   |7 --
 vcl/osx/a11ytextattributeswrapper.mm |   24 
 vcl/osx/salframe.cxx |   97 +++
 vcl/osx/salinst.cxx  |   40 +++---
 vcl/osx/salmenu.cxx  |   24 ++--
 vcl/osx/salnsmenu.mm |   18 +-
 vcl/osx/saltimer.cxx |5 -
 vcl/osx/vclnsapp.mm  |   31 +++
 9 files changed, 87 insertions(+), 161 deletions(-)

New commits:
commit 34327fdbc4b1d9070ff39d0a2caddad983b48385
Author: Tor Lillqvist 
AuthorDate: Thu Oct 28 13:43:39 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Oct 29 14:08:36 2021 +0200

Use non-deprecated names for bits and constants

Change-Id: I9004aaef7b2d526ad99b316b78733671a785c847
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124328
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index c94d5871a1df..3be765057ca9 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -145,7 +145,7 @@ public:
 void startedPrintJob() { mnActivePrintJobs++; }
 void endedPrintJob() { mnActivePrintJobs--; }
 
-// event subtypes for NSApplicationDefined events
+// event subtypes for NSEventTypeApplicationDefined events
 static const short AppExecuteSVMain   = 1;
 static const short AppStartTimerEvent = 10;
 static const short YieldWakeupEvent   = 20;
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index 26398cb903a3..56407a40abe9 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -370,12 +370,7 @@ void SAL_CALL DropTarget::initialize(const Sequence< Any 
>& aArguments)
 
 id wnd = [mView window];
 NSWindow* parentWnd = [wnd parentWindow];
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-// 'NSClosableWindowMask' is deprecated: first deprecated in macOS 
10.12
-// 'NSResizableWindowMask' is deprecated: first deprecated in macOS 
10.12
-// 'NSTitleWindowMask' is deprecated: first deprecated in macOS 10.12
-unsigned int topWndStyle = (NSTitledWindowMask | NSClosableWindowMask | 
NSResizableWindowMask);
-SAL_WNODEPRECATED_DECLARATIONS_POP
+unsigned int topWndStyle = (NSWindowStyleMaskTitled | 
NSWindowStyleMaskClosable | NSWindowStyleMaskResizable);
 unsigned int wndStyles = [wnd styleMask] & topWndStyle;
 
 if (parentWnd == nil && (wndStyles == topWndStyle))
diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index a1a6d0350e4b..84a9b27e54cc 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -247,19 +247,21 @@ using namespace ::com::sun::star::uno;
 sal_Int32 alignment;
 property.Value >>= alignment;
 NSNumber *textAlignment = nil;
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-// 'NSCenterTextAlignment' is deprecated: first deprecated in macOS 10.12
-// 'NSJustifiedTextAlignment' is deprecated: first deprecated in macOS 
10.12
-// 'NSLeftTextAlignment' is deprecated: first deprecated in macOS 10.12
-// 'NSRightTextAlignment' is deprecated: first deprecated in macOS 10.12
 switch(static_cast(alignment)) {
-case css::style::ParagraphAdjust_RIGHT : textAlignment = 
[NSNumber numberWithInteger:NSRightTextAlignment]; break;
-case css::style::ParagraphAdjust_CENTER: textAlignment = 
[NSNumber numberWithInteger:NSCenterTextAlignment]   ; break;
-case css::style::ParagraphAdjust_BLOCK : textAlignment = 
[NSNumber numberWithInteger:NSJustifiedTextAlignment]; break;
-case css::style::ParagraphAdjust_LEFT  :
-default : 
textAlignment = [NSNumber numberWithInteger:NSLeftTextAlignment] ; break;
+case css::style::ParagraphAdjust_RIGHT:
+textAlignment = [NSNumber 
numberWithInteger:NSTextAlignmentRight];
+break;
+case css::style::ParagraphAdjust_CENTER:
+textAlignment = [NSNumber 
numberWithInteger:NSTextAlignmentCenter];
+break;
+case css::style::ParagraphAdjust_BLOCK:
+textAlignment = [NSNumber 
numberWithInteger:NSTextAlignmentJustified];
+break;
+case css::style::ParagraphAdjust_LEFT:
+default:
+textAlignment = [NSNumber 
numberWithInteger:NSTextAlignmentLeft];
+break;
 }
-SAL_WNODEPRECATED_DECLARATIONS_POP
 NSDictionary *paragraphStyle = [NSDictionary 
dictionaryWithObjectsAndKeys:textAlignment, @"AXTextAlignment", textAlignment, 
@"AXVisualTextAlignment", 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2021-02-28 Thread Noel Grandin (via logerrit)
 vcl/inc/osx/salnativewidgets.h |1 -
 vcl/osx/salnativewidgets.cxx   |7 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 0833f01a3df511871c572c5454a97ef878eb9f67
Author: Noel Grandin 
AuthorDate: Sun Feb 28 14:32:13 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 1 08:00:10 2021 +0100

macOS spinbox and tab header tweaks

(*) tweak location of SpinBoxes so they line up a little better
(*) tweak the size of the TabItems so they don't overlap,
which causes little extra vertical bars of gray

Change-Id: Ic36be6c97b4b44f5e60b0f4a0f1e172fd7c2af03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111712
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salnativewidgets.h b/vcl/inc/osx/salnativewidgets.h
index 3fdcdc40ca97..86675e0623d6 100644
--- a/vcl/inc/osx/salnativewidgets.h
+++ b/vcl/inc/osx/salnativewidgets.h
@@ -22,7 +22,6 @@
 
 #define TAB_HEIGHT 20 // height of tab header in pixels
 #define TAB_TEXT_MARGIN 12// left/right margin of text within tab 
headers
-#define VCL_TAB_TEXT_SEPARATOR 2  // Space between two tabs required by VCL
 
 #define FOCUS_RING_WIDTH 4  // width of focus ring in pixels
 
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 606db5ba9a37..17d1744433f4 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -661,8 +661,6 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
 else if (aTabItemDrawInfo.position == 
kHIThemeTabPositionLast)
 aTabItemDrawInfo.position = kHIThemeTabPositionFirst;
 }
-rc.size.width += VCL_TAB_TEXT_SEPARATOR;
-rc.origin.x -= 1;
 HIThemeDrawTab(, , maContextHolder.get(), 
kHIThemeOrientationNormal, nullptr);
 bOK=true;
 }
@@ -812,7 +810,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
 ? kThemeAdornmentDefault : 
kThemeAdornmentNone;
 if (nUpperState & ControlState::FOCUSED || nLowerState & 
ControlState::FOCUSED)
 aSpinInfo.adornment |= kThemeAdornmentFocus;
-rc.origin.x += rc.size.width + 2 * FOCUS_RING_WIDTH;
+rc.origin.x += rc.size.width + FOCUS_RING_WIDTH + 1;
+rc.origin.y -= 1;
 rc.size.width = SPIN_BUTTON_WIDTH;
 rc.size.height = SPIN_LOWER_BUTTON_HEIGHT + 
SPIN_LOWER_BUTTON_HEIGHT;
 HIThemeDrawButton(, , maContextHolder.get(), 
kHIThemeOrientationNormal, nullptr);
@@ -968,7 +967,7 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType 
nType,
 break;
 case ControlType::TabItem:
 {
-w = aCtrlBoundRect.GetWidth() + 2 * TAB_TEXT_MARGIN - 2 * 
VCL_TAB_TEXT_SEPARATOR;
+w = aCtrlBoundRect.GetWidth() + 2 * TAB_TEXT_MARGIN;
 h = TAB_HEIGHT + 2;
 rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, 
h));
 rNativeBoundingRegion = tools::Rectangle(Point(x, y), Size(w, 
h));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/qa vcl/quartz

2021-02-22 Thread Thorsten Wagner (via logerrit)
 vcl/inc/quartz/salgdi.h  |3 -
 vcl/osx/salgdiutils.cxx  |   50 +++
 vcl/osx/salmacos.cxx |4 -
 vcl/qa/cppunit/BackendTest.cxx   |6 ++
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx |4 +
 vcl/qa/cppunit/outdev.cxx|4 +
 vcl/quartz/salgdi.cxx|8 ---
 7 files changed, 41 insertions(+), 38 deletions(-)

New commits:
commit 0c36f364b14aacd0eeb53087ae2fce54402dc741
Author: Thorsten Wagner 
AuthorDate: Sun Feb 21 01:34:54 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 23 08:22:05 2021 +0100

tdf#138122 Detect window scaling for multi display configurations on macOS

(1) Activate window scaling when at least one retina display is connected

(2) Remove environment variable VCL_MACOS_FORCE_WINDOW_SCALING

(3) Disable related unit tests unless bitmap scaling has been implemented

Change-Id: I218119a21e319e22bf17c609608724fce180f000
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111267
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 69b735787bdc..ce68b75b0b06 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,7 +174,6 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
-boolmbWindowScaling;
 
 #else // IOS
 
@@ -196,7 +195,7 @@ public:
 voidcopyResolution( AquaSalGraphics& );
 voidupdateResolution();
 
-float   GetWindowScaling();
+static floatGetWindowScaling();
 voidSetWindowGraphics( AquaSalFrame* pFrame );
 boolIsWindowGraphics()  const   { return mbWindow; 
}
 voidSetPrinterGraphics(CGContextRef, sal_Int32 
nRealDPIX, sal_Int32 nRealDPIY);
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index 01626d348999..f3ddd946f699 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,37 +35,35 @@
 #include 
 #include 
 
-float AquaSalGraphics::GetWindowScaling()
-{
-float fScale = 1.0f;
-
-#ifdef MACOSX
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
-// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
-// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
-// text and graphics.
+// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
+// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
 
-// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
-
-if (mbWindowScaling)
-{
-fScale = 2.0f;
-return fScale;
-}
+// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
+// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
+// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
+// scaling when displays are added while application is running is not 
supported.
 
-#endif
+static bool  bWindowScaling = false;
+static float fWindowScale = 1.0f;
 
-AquaSalFrame *pSalFrame = mpFrame;
-if (!pSalFrame)
-pSalFrame = static_cast(GetSalData()->mpInstance->anyFrame());
-if (pSalFrame)
+float AquaSalGraphics::GetWindowScaling()
+{
+if (!bWindowScaling)
 {
-NSWindow *pNSWindow = pSalFrame->getNSWindow();
-if (pNSWindow)
-fScale = [pNSWindow backingScaleFactor];
+NSArray *aScreens = [NSScreen screens];
+if (aScreens != nullptr)
+{
+int nScreens = [aScreens count];
+for (int i = 0; i < nScreens; i++)
+{
+float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
+if (fScale > fWindowScale)
+  fWindowScale = fScale;
+}
+bWindowScaling = true;
+}
 }
-return fScale;
+return fWindowScale;
 }
 
 void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame )
diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx
index 0f41dd9e8c4a..f6403dea2725 100644
--- a/vcl/osx/salmacos.cxx
+++ b/vcl/osx/salmacos.cxx
@@ -19,7 +19,7 @@
 
 // This file contains the 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2021-01-28 Thread Stephan Bergmann (via logerrit)
 vcl/inc/quartz/salgdi.h |1 
 vcl/osx/salgdiutils.cxx |   50 
 vcl/osx/salmacos.cxx|2 -
 vcl/quartz/salgdi.cxx   |8 +++
 4 files changed, 36 insertions(+), 25 deletions(-)

New commits:
commit b3737c638671ab39c5e6aaeaf5426d102392cc0a
Author: Stephan Bergmann 
AuthorDate: Thu Jan 28 09:39:48 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 28 10:43:09 2021 +0100

Revert "tdf#138122 Detect window scaling for multi display configurations 
on macOS"

This reverts commit f318b856ed055f1952276355f811153f6b29c93e.
It appears this reliably causes CppunitTest_vcl_backend_test to fail on 
macOS on
at least tb69, see e.g.  and
,

  [_RUN_] BackendTest::testDrawBlendExtended
  
/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/vcl/qa/cppunit/BackendTest.cxx:688:BackendTest::testDrawBlendExtended
  equality assertion failed
  - Expected: c[80ff]
  - Actual  : c[]

  BackendTest::testDrawBlendExtended finished in: 1ms
  [_RUN_] BackendTest::testDrawAlphaBitmapMirrored
  
/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/vcl/qa/cppunit/BackendTest.cxx:749:BackendTest::testDrawAlphaBitmapMirrored
  equality assertion failed
  - Expected: c[ffff]
  - Actual  : c[00ff]

  BackendTest::testDrawAlphaBitmapMirrored finished in: 1ms
  [_RUN_] BackendTest::testTdf124848
  
/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/vcl/qa/cppunit/BackendTest.cxx:808:BackendTest::testTdf124848
  equality assertion failed
  - Expected: c[00ff]
  - Actual  : c[]

And it also causes my local macOS 11.1 ARM64 build to consistently fail that
way, both the original patch set 1 (with the older parent) and the submitted
patch set 2 (with a newer parent).

Change-Id: I2c36fada271e8bc300b6caa19370d8e8bb1e7599
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110055
Reviewed-by: Tor Lillqvist 
Tested-by: Jenkins

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 4897d96c6089..69b735787bdc 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,6 +174,7 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
+boolmbWindowScaling;
 
 #else // IOS
 
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index f3ddd946f699..01626d348999 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,35 +35,37 @@
 #include 
 #include 
 
-// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
-// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
+float AquaSalGraphics::GetWindowScaling()
+{
+float fScale = 1.0f;
 
-// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
-// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
-// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
-// scaling when displays are added while application is running is not 
supported.
+#ifdef MACOSX
 
-static bool  bWindowScaling = false;
-static float fWindowScale = 1.0f;
+// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
+// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
+// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
+// text and graphics.
 
-float AquaSalGraphics::GetWindowScaling()
-{
-if (!bWindowScaling)
+// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
+
+if (mbWindowScaling)
 {
-NSArray *aScreens = [NSScreen screens];
-if (aScreens != nullptr)
-{
-int nScreens = [aScreens count];
-for (int i = 0; i < nScreens; i++)
-{
-float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
-if (fScale > fWindowScale)
-  fWindowScale = fScale;
-}
-bWindowScaling = true;
-}
+fScale = 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2021-01-27 Thread Thorsten Wagner (via logerrit)
 vcl/inc/quartz/salgdi.h |1 
 vcl/osx/salgdiutils.cxx |   50 +++-
 vcl/osx/salmacos.cxx|2 -
 vcl/quartz/salgdi.cxx   |8 ---
 4 files changed, 25 insertions(+), 36 deletions(-)

New commits:
commit f318b856ed055f1952276355f811153f6b29c93e
Author: Thorsten Wagner 
AuthorDate: Wed Jan 27 01:01:10 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Wed Jan 27 10:09:59 2021 +0100

tdf#138122 Detect window scaling for multi display configurations on macOS

(1) Activate window scaling when at least one retina display is connected

(2) Remove environment variable VCL_MACOS_FORCE_WINDOW_SCALING

Change-Id: If6926ace7238f2be4ae91290872dbb3dbf658221
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110002
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 69b735787bdc..4897d96c6089 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,7 +174,6 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
-boolmbWindowScaling;
 
 #else // IOS
 
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index 01626d348999..f3ddd946f699 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,37 +35,35 @@
 #include 
 #include 
 
-float AquaSalGraphics::GetWindowScaling()
-{
-float fScale = 1.0f;
-
-#ifdef MACOSX
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
-// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
-// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
-// text and graphics.
+// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
+// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
 
-// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
-
-if (mbWindowScaling)
-{
-fScale = 2.0f;
-return fScale;
-}
+// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
+// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
+// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
+// scaling when displays are added while application is running is not 
supported.
 
-#endif
+static bool  bWindowScaling = false;
+static float fWindowScale = 1.0f;
 
-AquaSalFrame *pSalFrame = mpFrame;
-if (!pSalFrame)
-pSalFrame = static_cast(GetSalData()->mpInstance->anyFrame());
-if (pSalFrame)
+float AquaSalGraphics::GetWindowScaling()
+{
+if (!bWindowScaling)
 {
-NSWindow *pNSWindow = pSalFrame->getNSWindow();
-if (pNSWindow)
-fScale = [pNSWindow backingScaleFactor];
+NSArray *aScreens = [NSScreen screens];
+if (aScreens != nullptr)
+{
+int nScreens = [aScreens count];
+for (int i = 0; i < nScreens; i++)
+{
+float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
+if (fScale > fWindowScale)
+  fWindowScale = fScale;
+}
+bWindowScaling = true;
+}
 }
-return fScale;
+return fWindowScale;
 }
 
 void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame )
diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx
index 0f41dd9e8c4a..5b1265130cd0 100644
--- a/vcl/osx/salmacos.cxx
+++ b/vcl/osx/salmacos.cxx
@@ -19,7 +19,7 @@
 
 // This file contains the macOS-specific versions of the functions which were 
touched in the commit
 // to fix tdf#138122. The iOS-specific versions of these functions are kept 
(for now, when this
-// comment is written) as they were before that commit in vcl/isx/salios.cxx.
+// comment is written) as they were before that commit in vcl/ios/salios.cxx.
 
 #include 
 #include 
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 8dd9ec9222ad..ae6a40cfd4e2 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -205,14 +205,6 @@ AquaSalGraphics::AquaSalGraphics()
 , mbVirDev( false )
 #ifdef MACOSX
 , mbWindow( false )
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable. If
-// unset window scaling from main display will be used. After 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2020-11-24 Thread Stephan Bergmann (via logerrit)
 vcl/inc/osx/salprn.h |1 -
 vcl/osx/salprn.cxx   |5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 9c1c43d4b94f75d97af319122312cbf7202f0cc6
Author: Stephan Bergmann 
AuthorDate: Tue Nov 24 11:02:34 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 24 13:11:28 2020 +0100

Remove unused parameter (flagged now by loplugin:stringview)

Change-Id: I78e2b60945f256de5e7455373a2ecff72f9eaae7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106484
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index abb787f5746e..7bfd41787e99 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -92,7 +92,6 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 // implement pull model print system
 boolStartJob( const OUString* i_pFileName,
   const OUString& rJobName,
-  const OUString& i_rAppName,
   ImplJobSetup* i_pSetupData,
   vcl::PrinterController& 
i_rController );
 boolEndJob();
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 0f2f38fa530a..6fd92fd4c5d6 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -351,7 +351,6 @@ static Size getPageSize( vcl::PrinterController const & 
i_rController, sal_Int32
 
 bool AquaSalInfoPrinter::StartJob( const OUString* i_pFileName,
const OUString& i_rJobName,
-   const OUString& /*i_rAppName*/,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rController
)
@@ -574,11 +573,11 @@ AquaSalPrinter::~AquaSalPrinter()
 
 bool AquaSalPrinter::StartJob( const OUString* i_pFileName,
const OUString& i_rJobName,
-   const OUString& i_rAppName,
+   const OUString&,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rController )
 {
-return mpInfoPrinter->StartJob( i_pFileName, i_rJobName, i_rAppName, 
i_pSetupData, i_rController );
+return mpInfoPrinter->StartJob( i_pFileName, i_rJobName, i_pSetupData, 
i_rController );
 }
 
 bool AquaSalPrinter::StartJob( const OUString* /*i_pFileName*/,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/inc/osx/salframe.h   |   19 ++-
 vcl/inc/osx/salinst.h|3 +
 vcl/inc/osx/salobj.h |7 ++--
 vcl/inc/osx/salprn.h |   11 --
 vcl/inc/quartz/salgdi.h  |   36 +++-
 vcl/inc/quartz/salvd.h   |   14 
 vcl/osx/a11yutil.mm  |3 +
 vcl/osx/salframe.cxx |   49 +++-
 vcl/osx/salframeview.mm  |   26 +++
 vcl/osx/salmenu.cxx  |   10 ++---
 vcl/osx/salnativewidgets.cxx |   12 +++---
 vcl/osx/salobj.cxx   |6 ++-
 vcl/osx/salprn.cxx   |   23 ++---
 vcl/osx/salsys.cxx   |6 +--
 vcl/quartz/ctfonts.cxx   |   10 ++---
 vcl/quartz/salgdi.cxx|   13 ---
 vcl/quartz/salgdicommon.cxx  |   74 +++
 vcl/quartz/salvd.cxx |   13 ---
 18 files changed, 185 insertions(+), 150 deletions(-)

New commits:
commit 7a83d0a268a348a86dd31acbac94872eab82f75b
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 15:13:56 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 19:03:09 2020 +0100

loplugin:toolslong in Library_vclplug_osx

Change-Id: I63892376154893a97e6b205b93c1682f66fd3064
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105756
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 3d0f19f418a0..d634647715ce 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -24,6 +24,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -117,10 +118,12 @@ public:
 virtual voidSetMenu( SalMenu* pSalMenu ) override;
 virtual voidDrawMenuBar() override;
 virtual voidShow( bool bVisible, bool bNoActivate = false 
) override;
-virtual voidSetMinClientSize( long nWidth, long nHeight ) 
override;
-virtual voidSetMaxClientSize( long nWidth, long nHeight ) 
override;
-virtual voidSetPosSize( long nX, long nY, long nWidth, 
long nHeight, sal_uInt16 nFlags ) override;
-virtual voidGetClientSize( long& rWidth, long& rHeight ) 
override;
+virtual voidSetMinClientSize( tools::Long nWidth, 
tools::Long nHeight )
+override;
+virtual voidSetMaxClientSize( tools::Long nWidth, 
tools::Long nHeight )
+override;
+virtual voidSetPosSize( tools::Long nX, tools::Long nY, 
tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) override;
+virtual voidGetClientSize( tools::Long& rWidth, 
tools::Long& rHeight ) override;
 virtual voidGetWorkArea( tools::Rectangle& rRect ) 
override;
 virtual SalFrame*   GetParent() const override;
 virtual voidSetWindowState( const SalFrameState* pState ) 
override;
@@ -131,7 +134,7 @@ public:
 virtual voidToTop( SalFrameToTop nFlags ) override;
 virtual voidSetPointer( PointerStyle ePointerStyle ) 
override;
 virtual voidCaptureMouse( bool bMouse ) override;
-virtual voidSetPointerPos( long nX, long nY ) override;
+virtual voidSetPointerPos( tools::Long nX, tools::Long nY 
) override;
 virtual voidFlush( void ) override;
 virtual voidFlush( const tools::Rectangle& ) override;
 virtual voidSetInputContext( SalInputContext* pContext ) 
override;
@@ -157,7 +160,8 @@ public:
 // start setting the clipregion consisting of nRects rectangles
 virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
 // add a rectangle to the clip region
-virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight 
) override;
+virtual void UnionClipRegion(
+tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long 
nHeight ) override;
 // done setting up the clipregion
 virtual void EndSetClipRegion() override;
 
@@ -193,7 +197,8 @@ public:
 void screenParametersChanged();
 
 protected:
-SalEvent PreparePosSize(long nX, long nY, long nWidth, long nHeight, 
sal_uInt16 nFlags);
+SalEvent PreparePosSize(
+tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long 
nHeight, sal_uInt16 nFlags);
 
 private: // methods
 /** do things on initial show (like centering on parent or on screen)
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index edece53b6bea..97cbe37e2038 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef MACOSX
 #include 
@@ -101,7 +102,7 @@ public:
 virtual voidDestroyObject( SalObject* pObject ) override;
 virtual std::unique_ptr
 CreateVirtualDevice( SalGraphics* pGraphics,
-   

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/inc/osx/saldata.hxx |4 ++--
 vcl/inc/quartz/salgdi.h |7 ---
 vcl/osx/salframe.cxx|2 +-
 vcl/osx/salprn.cxx  |2 +-
 vcl/quartz/salgdicommon.cxx |4 ++--
 vcl/quartz/salgdiutils.cxx  |2 +-
 6 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit bfc7706b4344ec9b9b300213147f2b874ce21c21
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 14:34:48 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 17:15:23 2020 +0100

DPI values are generally represented as sal_Int32 in VCL

cf. e.g. pure virtual SalGraphics::GetResolution (vcl/inc/salgdi.hxx)

Change-Id: I77d54ad0a7b80cf8839b253c14ce468ac4e16c84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105748
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 483902ff21cf..378741a739d9 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -85,8 +85,8 @@ public:
 AppleRemoteMainController*mpAppleRemoteMainController;
 #endif
 NSObject* mpDockIconClickHandler;
-long  mnDPIX;   // 
#i100617# read DPI only once per office life
-long  mnDPIY;   // 
#i100617# read DPI only once per office life
+sal_Int32 mnDPIX;   // 
#i100617# read DPI only once per office life
+sal_Int32 mnDPIY;   // 
#i100617# read DPI only once per office life
 
 css::uno::Reference< css::uno::XInterface >   mxClipboard;
 
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index d10ea2879559..0dbfd0065090 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -143,8 +143,8 @@ class AquaSalGraphics : public SalGraphics
 int mnHeight;
 int mnBitmapDepth;  // zero unless 
bitmap
 /// device resolution of this graphics
-longmnRealDPIX;
-longmnRealDPIY;
+sal_Int32   mnRealDPIX;
+sal_Int32   mnRealDPIY;
 
 /// path representing current clip region
 CGMutablePathRefmxClipPath;
@@ -190,7 +190,8 @@ public:
 boolIsBrushVisible() const  { return 
maFillColor.IsVisible(); }
 
 voidSetWindowGraphics( AquaSalFrame* pFrame );
-voidSetPrinterGraphics( CGContextRef, long nRealDPIX, 
long nRealDPIY );
+voidSetPrinterGraphics(
+CGContextRef, sal_Int32 nRealDPIX, sal_Int32 nRealDPIY );
 voidSetVirDevGraphics(CGLayerHolder const & rLayer, 
CGContextRef, int nBitDepth = 0);
 #ifdef MACOSX
 voidinitResolution( NSWindow* );
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 1ffb1b46dccd..76cd52e65541 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1189,7 +1189,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 return aRet;
 }
 
-static vcl::Font getFont( NSFont* pFont, long nDPIY, const vcl::Font& rDefault 
)
+static vcl::Font getFont( NSFont* pFont, sal_Int32 nDPIY, const vcl::Font& 
rDefault )
 {
 vcl::Font aResult( rDefault );
 if( pFont )
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index c0d05fde9fb5..7da42376569f 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -101,7 +101,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef 
i_rContext ) const
 if( mpPrintInfo )
 {
 // FIXME: get printer resolution
-long nDPIX = 720, nDPIY = 720;
+sal_Int32 nDPIX = 720, nDPIY = 720;
 NSSize aPaperSize = [mpPrintInfo paperSize];
 
 NSRect aImageRect = [mpPrintInfo imageablePageBounds];
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 0e1508fd9104..4b2b59459e1e 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1353,8 +1353,8 @@ void AquaSalGraphics::initResolution(NSWindow* nsWindow)
 // Apple suggest to do it this way
 const CGDirectDisplayID nDisplayID = 
static_cast([pVal longValue]);
 const CGSize aSize = CGDisplayScreenSize( nDisplayID ); // 
=> result is in millimeters
-mnRealDPIX = static_cast((CGDisplayPixelsWide( 
nDisplayID ) * 25.4) / aSize.width);
-mnRealDPIY = static_cast((CGDisplayPixelsHigh( 
nDisplayID ) * 25.4) / aSize.height);
+mnRealDPIX = static_cast((CGDisplayPixelsWide( 
nDisplayID ) * 25.4) / aSize.width);
+mnRealDPIY = static_cast((CGDisplayPixelsHigh( 
nDisplayID ) * 25.4) / 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source

2020-04-25 Thread Noel Grandin (via logerrit)
 vcl/inc/osx/salframe.h   |2 --
 vcl/inc/salframe.hxx |4 
 vcl/osx/salframe.cxx |9 -
 vcl/source/window/dialog.cxx |3 ---
 4 files changed, 18 deletions(-)

New commits:
commit 0ffbaecea3316a5c723f6e0eb7250611b5d0f3d7
Author: Noel Grandin 
AuthorDate: Sat Apr 25 21:16:53 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 25 22:30:34 2020 +0200

tf#131549 No titlebar on modal dialogs on macOS

regression from
commit e5230535877e30c3b874495e8794faa3a42d8017
Date:   Tue Mar 17 21:34:21 2020 +0200
simplify ORefVector code
where a half-finished patch of mine snuck into another patch.

Change-Id: I01f59a9d451f4535197d3abd7b37bfdbc8461c15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92901
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 60b4e82f2540..3d0f19f418a0 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -163,8 +163,6 @@ public:
 
 void UpdateFrameGeometry();
 
-virtual void BeginSheet(SalFrame* pSheetFrame) const override;
-
 // trigger painting of the window
 void SendPaintEvent( const tools::Rectangle* pRect = nullptr );
 
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index bc1127d1989b..b83138e29d40 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -259,10 +259,6 @@ public:
 return false;
 }
 
-/** only does anything on MACOSX where it indicates to the OS that this 
window is a modal-dialog
- * and  should be displayed using the special sheet mode */
-virtual void BeginSheet(SalFrame* /*pSheetWindow*/) const {}
-
 // return true to indicate tooltips are shown natively, false otherwise
 virtual boolShowTooltip(const OUString& /*rHelpText*/, const 
tools::Rectangle& /*rHelpArea*/)
 {
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index b2990d3ede17..6f7a395522cf 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1822,13 +1822,4 @@ void AquaSalFrame::EndSetClipRegion()
 // shadow is invalidated when view gets drawn again
 }
 
-void AquaSalFrame::BeginSheet(SalFrame* pSheetFrame) const
-{
-NSWindow* pSheetNSWindow = 
static_cast(pSheetFrame)->mpNSWindow;
-//[mpNSWindow beginSheet:pSheetNSWindow];
-//beginSheet(mpNSWindow];
-
-[mpNSWindow beginSheet:pSheetNSWindow completionHandler:nil ];
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 34d38021a73f..9ea561abe64f 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -966,9 +966,6 @@ bool Dialog::ImplStartExecute()
 // FIXME: no layouting, workaround some clipping issues
 ImplAdjustNWFSizes();
 
-if (mpDialogParent)
-mpDialogParent->ImplGetFrame()->BeginSheet(ImplGetFrame()); //  only 
does anything on macOS
-
 css::uno::Reference< css::uno::XComponentContext > xContext(
 comphelper::getProcessComponentContext());
 bool 
bForceFocusAndToFront(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2020-03-21 Thread Julien Nabet (via logerrit)
 vcl/inc/osx/salframe.h |2 ++
 vcl/osx/salframe.cxx   |   18 --
 2 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 7f45cbace44141e22c159dc2216fefd787e14d1f
Author: Julien Nabet 
AuthorDate: Fri Mar 20 23:54:54 2020 +0100
Commit: Julien Nabet 
CommitDate: Sat Mar 21 10:18:45 2020 +0100

tdf#100706: get blink cursor delay for MacOS

See https://bugs.documentfoundation.org/show_bug.cgi?id=100706#c1

Change-Id: I2e471f093ce18c8716108c4ba793c2124e489295
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90850
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 4e32f806c33e..60b4e82f2540 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -95,6 +95,8 @@ public:
 
 boolmbGeometryDidChange;
 
+int mnBlinkCursorDelay;
+
 public:
 /** Constructor
 
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index aafafe7a0c6c..b2990d3ede17 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -83,7 +83,8 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 mePointerStyle( PointerStyle::Arrow ),
 mnTrackingRectTag( 0 ),
 mrClippingPath( nullptr ),
-mnICOptions( InputContextFlags::NONE )
+mnICOptions( InputContextFlags::NONE ),
+mnBlinkCursorDelay ( 500 )
 {
 mpParent = dynamic_cast(pParent);
 
@@ -91,6 +92,19 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 
 SalData* pSalData = GetSalData();
 pSalData->mpInstance->insertFrame( this );
+NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+if (userDefaults != nil)
+{
+id setting = [userDefaults objectForKey: 
@"NSTextInsertionPointBlinkPeriodOn"];
+if (setting)
+mnBlinkCursorDelay = [setting intValue];
+else
+{
+setting = [userDefaults objectForKey: 
@"NSTextInsertionPointBlinkPeriodOff"];
+if (setting)
+mnBlinkCursorDelay = [setting intValue];
+}
+}
 }
 
 AquaSalFrame::~AquaSalFrame()
@@ -1306,7 +1320,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aStyleSettings.SetTabTextColor(aControlTextColor);
 aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 
-aStyleSettings.SetCursorBlinkTime( 500 );
+aStyleSettings.SetCursorBlinkTime( mnBlinkCursorDelay );
 
 // no mnemonics on macOS
 aStyleSettings.SetOptions( aStyleSettings.GetOptions() | 
StyleSettingsOptions::NoMnemonics );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2020-01-03 Thread Andrea Gelmini (via logerrit)
 vcl/inc/osx/salnativewidgets.h |4 ++--
 vcl/osx/salnativewidgets.cxx   |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9be165d3875ca5f85511f2ef42ec3627dee40a5e
Author: Andrea Gelmini 
AuthorDate: Fri Jan 3 09:54:53 2020 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 3 10:07:52 2020 +0100

Fix typos

Change-Id: I17b7881a28dc5b17d4051fe54cada2681e182873
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86159
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/vcl/inc/osx/salnativewidgets.h b/vcl/inc/osx/salnativewidgets.h
index 67d3a37612e7..3fdcdc40ca97 100644
--- a/vcl/inc/osx/salnativewidgets.h
+++ b/vcl/inc/osx/salnativewidgets.h
@@ -35,7 +35,7 @@
 #define RADIO_BUTTON_SMALL_SIZE 14 // width/height of small radio button 
without focus ring in pixels
 #define RADIO_BUTTON_TEXT_SEPARATOR 3  // space between radio button and 
following text in pixels
 
-#define CHECKBOX_SMALL_SIZE 14 // width/heiht of checkbox without focus 
ring in pixels
+#define CHECKBOX_SMALL_SIZE 14 // width/height of checkbox without focus 
ring in pixels
 #define CHECKBOX_TEXT_SEPARATOR 3  // space between checkbox and following 
text in pixels
 
 #define SLIDER_WIDTH 19   // width of slider in pixels
@@ -60,7 +60,7 @@
 #define SPIN_LOWER_BUTTON_HEIGHT 11  // height of lower spin button without 
focus ring in pixels
 
 // FIXME: spinboxes are positioned one pixel shifted to the right by VCL. As 
positioning as well as size should be equal to
-// corresponing editboxes, comboboxes or listboxes, positioning of spinboxes 
should by equal too. Issue cannot be fixed within
+// corresponding editboxes, comboboxes or listboxes, positioning of spinboxes 
should by equal too. Issue cannot be fixed within
 // native widget drawing code. As a workaround, an offset is considered for 
spinboxes to align spinboxes correctly.
 
 #define SPINBOX_OFFSET 1  // left offset for alignment with editboxes, 
comboboxes, and listboxes
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 5248251480c5..230735401993 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -41,7 +41,7 @@
 // AquaSalGraphics::getNativeControlRegion to determine native rectangle in 
pixels to draw the widget
 // AquaSalGraphics::drawNativeControl to do the drawing operation itself
 
-// getNativeControlRegion has to calculate a content rectangle within it is 
safe to draw the widget. Furthermore a boundig rectangle
+// getNativeControlRegion has to calculate a content rectangle within it is 
safe to draw the widget. Furthermore a bounding rectangle
 // has to be calculated by getNativeControlRegion to consider adornments like 
a focus rectangle. As drawNativeControl uses Carbon
 // API calls, all widgets are drawn without text. Drawing of text is done 
separately by VCL on top of graphical Carbon widget
 // representation. drawNativeControl is called by VCL using content rectangle 
determined by getNativeControlRegion.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2020-01-02 Thread Thorsten Wagner (via logerrit)
 vcl/inc/osx/salnativewidgets.h |   60 -
 vcl/osx/salnativewidgets.cxx   | 1625 ++---
 2 files changed, 768 insertions(+), 917 deletions(-)

New commits:
commit 9d31d8f1d8d3a73f8c07ca39f5ed45e2bb7b088c
Author: Thorsten Wagner 
AuthorDate: Wed Jan 1 14:43:38 2020 +0100
Commit: Noel Grandin 
CommitDate: Thu Jan 2 19:15:07 2020 +0100

tdf#125536 macOS native Carbon widgets reworked

Change-Id: Id60895a48f59cb3c55db39d18cd27fed2108727e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86066
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salnativewidgets.h b/vcl/inc/osx/salnativewidgets.h
index 1ba697afafa2..67d3a37612e7 100644
--- a/vcl/inc/osx/salnativewidgets.h
+++ b/vcl/inc/osx/salnativewidgets.h
@@ -20,42 +20,50 @@
 #ifndef INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 #define INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 
-// since 10.4 ... no metrics are returned, and we have to fix the values
-#define BUTTON_WIDTH 16
-#define BUTTON_HEIGHT 17
+#define TAB_HEIGHT 20 // height of tab header in pixels
+#define TAB_TEXT_MARGIN 12// left/right margin of text within tab 
headers
+#define VCL_TAB_TEXT_SEPARATOR 2  // Space between two tabs required by VCL
 
-//standard height of the AHIG
-//tabs
-#define TAB_HEIGHT_NORMAL 20
+#define FOCUS_RING_WIDTH 4  // width of focus ring in pixels
 
-#define TAB_TEXT_OFFSET 12
-#define VCL_TAB_TEXT_OFFSET 2
+#define MEDIUM_PROGRESS_INDICATOR_HEIGHT 10  // height of medium progress 
indicator in pixels
+#define LARGE_PROGRESS_INDICATOR_HEIGHT 16   // height of large progress 
indicator in pixels
 
-//listboxes, comboboxes (they have the same dimensions)
-#define COMBOBOX_HEIGHT_NORMAL 20
-#define DROPDOWN_BUTTON_WIDTH 20
+#define PUSH_BUTTON_NORMAL_HEIGHT 21  // height of normal push button without 
focus ring in pixels
+#define PUSH_BUTTON_SMALL_HEIGHT 15   // height of small push button without 
focus ring in pixels
 
-//text edit
-#define TEXT_EDIT_HEIGHT_NORMAL 22
+#define RADIO_BUTTON_SMALL_SIZE 14 // width/height of small radio button 
without focus ring in pixels
+#define RADIO_BUTTON_TEXT_SEPARATOR 3  // space between radio button and 
following text in pixels
 
-//spin box
-#define SPIN_BUTTON_SPACE   2
-#define SPIN_BUTTON_WIDTH   13
-#define SPIN_UPPER_BUTTON_HEIGHT11
-#define SPIN_LOWER_BUTTON_HEIGHT10
+#define CHECKBOX_SMALL_SIZE 14 // width/heiht of checkbox without focus 
ring in pixels
+#define CHECKBOX_TEXT_SEPARATOR 3  // space between checkbox and following 
text in pixels
 
-// progress bar
-#define INTRO_PROGRESS_HEIGHT 9
+#define SLIDER_WIDTH 19   // width of slider in pixels
+#define SLIDER_HEIGHT 18  // height of slider in pixels
 
-// for some controls, like spinbuttons + spinboxes, or listboxes
-// we need it to adjust text position beside radio and check buttons
+#define EDITBOX_HEIGHT 21   // height of editbox without focus ring in 
pixels
+#define EDITBOX_BORDER_WIDTH 1  // width of editbox border in pixels
+#define EDITBOX_INSET_MARGIN 1  // width of left/right as well as top/bottom 
editbox margin in pixels
 
-#define TEXT_SEPARATOR 3
+#define COMBOBOX_HEIGHT 20// height of combobox without focus ring in 
pixels
+#define COMBOBOX_BUTTON_WIDTH 18  // width of combobox button without focus 
ring in pixels
+#define COMBOBOX_BORDER_WIDTH 1   // width of combobox border in pixels
+#define COMBOBOX_TEXT_MARGIN 1// left/right margin of text in pixels
 
-// extra border for focus ring
-#define FOCUS_RING_WIDTH 4
+#define LISTBOX_HEIGHT 20// height of listbox without focus ring in 
pixels
+#define LISTBOX_BUTTON_WIDTH 18  // width of listbox button without focus ring 
in pixels
+#define LISTBOX_BORDER_WIDTH 1   // width of listbox border in pixels
+#define LISTBOX_TEXT_MARGIN 1// left/right margin of text in pixels
 
-#define CLIP_FUZZ 1
+#define SPIN_BUTTON_WIDTH 13 // width of spin button without focus 
ring in pixels
+#define SPIN_UPPER_BUTTON_HEIGHT 11  // height of upper spin button without 
focus ring in pixels
+#define SPIN_LOWER_BUTTON_HEIGHT 11  // height of lower spin button without 
focus ring in pixels
+
+// FIXME: spinboxes are positioned one pixel shifted to the right by VCL. As 
positioning as well as size should be equal to
+// corresponing editboxes, comboboxes or listboxes, positioning of spinboxes 
should by equal too. Issue cannot be fixed within
+// native widget drawing code. As a workaround, an offset is considered for 
spinboxes to align spinboxes correctly.
+
+#define SPINBOX_OFFSET 1  // left offset for alignment with editboxes, 
comboboxes, and listboxes
 
 #endif // INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 6e94cd3e4df3..5248251480c5 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -36,6 +36,22 @@
 
 #include "cuidraw.hxx"
 
+// 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2019-09-23 Thread Stephan Bergmann (via logerrit)
 vcl/inc/osx/salframe.h |4 
 vcl/osx/salframe.cxx   |   14 --
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit d2e8e301fcb2d0513d919b897f51f7a7586198b8
Author: Stephan Bergmann 
AuthorDate: Mon Sep 23 12:35:11 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Sep 23 19:07:17 2019 +0200

loplugin:fragiledestructor (macOS)

Change-Id: I85542ed9e631ad8589d3bc3469d171ab1d5cb4f9
Reviewed-on: https://gerrit.libreoffice.org/79396
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 2038cf99b33f..2fcdef3609e9 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -200,6 +200,10 @@ private: // methods
 
 void initWindowAndView();
 
+void doShowFullScreen( bool bFullScreen, sal_Int32 nDisplay );
+
+void doResetClipRegion();
+
 private: // data
 static AquaSalFrame*   s_pCaptureFrame;
 
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index f72ec1f53f57..8a18aa8e39b9 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -97,7 +97,7 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 AquaSalFrame::~AquaSalFrame()
 {
 if (mbFullScreen)
-ShowFullScreen(false, maGeometry.nDisplayScreenNumber);
+doShowFullScreen(false, maGeometry.nDisplayScreenNumber);
 
 assert( GetSalData()->mpInstance->IsMainThread() );
 
@@ -107,7 +107,7 @@ AquaSalFrame::~AquaSalFrame()
 AquaSalMenu::setDefaultMenu();
 
 // cleanup clipping stuff
-ResetClipRegion();
+doResetClipRegion();
 
 [SalFrameView unsetMouseFrame: this];
 
@@ -752,6 +752,11 @@ void AquaSalFrame::SetApplicationID( const OUString 
&/*rApplicationID*/ )
 
 void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
 {
+doShowFullScreen(bFullScreen, nDisplay);
+}
+
+void AquaSalFrame::doShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
+{
 if (!mpNSWindow)
 {
 if (Application::IsBitmapRendering() && bFullScreen)
@@ -1706,6 +1711,11 @@ void AquaSalFrame::CaptureMouse( bool bCapture )
 
 void AquaSalFrame::ResetClipRegion()
 {
+doResetClipRegion();
+}
+
+void AquaSalFrame::doResetClipRegion()
+{
 if ( !mpNSWindow )
 return;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source

2019-01-10 Thread Libreoffice Gerrit user
 vcl/inc/osx/salinst.h |3 ++-
 vcl/inc/salinst.hxx   |1 +
 vcl/osx/salinst.cxx   |   30 +++---
 vcl/osx/salmenu.cxx   |9 +
 vcl/osx/vclnsapp.mm   |   16 
 vcl/source/app/svmain.cxx |6 +-
 6 files changed, 52 insertions(+), 13 deletions(-)

New commits:
commit 284a7f60fff72c4d8c011ff60ea2e40163cd25c3
Author: Jan-Marek Glogowski 
AuthorDate: Thu Jan 3 13:45:16 2019 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Fri Jan 11 05:20:11 2019 +0100

OSX Re-Introduce NSApplicationMain usage

This restores the nested NSApplicationMain and default run loop
usage. Without it the Java AWT integration will start its own
event loop, effectively blocking any non-system event processing.

Reproducible via "Tools - Macros - Organize Macros - BeanShell...
- LibreOffice Macros - HelloWorld - helloworld.bsh - Edit".

The blocking can be prevented by overriding NSApplication::run and
running our own event loop using Application::Execute. But this
still doesn't show the Java AWT editor window and I couldn't find
any information how to fix this.

Since OSX now is a VCL plugin, this can't restore the old hook
mechanism, but instead adds a new function to SalInstance.
SalInstance initialization happens at InitVCL() start just a
little bit later in the call stack.

Somehow NSApplicationMain manages to run the Java VM in an extra
thread, so it doesn't block the main loop. Probably this could
also be handled by LO starting the JVM as a thread.
Further information for an implementation eventually can be found
in the "Technical Note TN2147" "JNI Development on Mac OS X."

Change-Id: I04a0c2bf7949571f1b678ada9ab3592e0fe30c1f
Regression-from: 925e2edb6f3f8fffcff9eddb31ed18bc77e2a690
Reviewed-on: https://gerrit.libreoffice.org/65836
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 18b8de8cfc7f..edece53b6bea 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -91,6 +91,7 @@ public:
 virtual ~AquaSalInstance() override;
 
 virtual void AfterAppInit() override;
+virtual bool SVMainHook(int *) override;
 
 virtual SalFrame*   CreateChildFrame( SystemParentData* pParent, 
SalFrameStyleFlags nStyle ) override;
 virtual SalFrame*   CreateFrame( SalFrame* pParent, SalFrameStyleFlags 
nStyle ) override;
@@ -145,7 +146,7 @@ public:
 void endedPrintJob() { mnActivePrintJobs--; }
 
 // event subtypes for NSApplicationDefined events
-static const short AppEndLoopEvent= 1;
+static const short AppExecuteSVMain   = 1;
 static const short AppStartTimerEvent = 10;
 static const short YieldWakeupEvent   = 20;
 static const short DispatchTimerEvent = 30;
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index f48cca4136e2..e35cd78df4fb 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -89,6 +89,7 @@ public:
 
 //called directly after Application::Init
 virtual voidAfterAppInit() {}
+virtual boolSVMainHook(int*) { return false; }
 
 // Frame
 // DisplayName for Unix ???
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index c92b621a023c..f0f470545138 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -81,6 +81,7 @@ extern "C" {
 using namespace std;
 using namespace ::com::sun::star;
 
+static int* gpnInit = nullptr;
 static NSMenu* pDockMenu = nil;
 static bool bLeftMain = false;
 
@@ -328,8 +329,6 @@ VCLPLUG_OSX_PUBLIC SalInstance* create_SalInstance()
 ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
 ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10;
 
-[NSApp finishLaunching];
-
 return pInst;
 }
 }
@@ -386,9 +385,14 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* 
pEvent )
 if ( pTimer )
 pTimer->handleStartTimerEvent( pEvent );
 break;
-case AppEndLoopEvent:
+case AppExecuteSVMain:
+{
+int nRet = ImplSVMain();
+if (gpnInit)
+*gpnInit = nRet;
 [NSApp stop: NSApp];
 break;
+}
 case DispatchTimerEvent:
 {
 AquaSalInstance *pInst = GetSalData()->mpInstance;
@@ -958,5 +962,25 @@ NSImage* CreateNSImage( const Image& rImage )
 return pImage;
 }
 
+bool AquaSalInstance::SVMainHook(int* pnInit)
+{
+gpnInit = pnInit;
+
+OUString aExeURL, aExe;
+osl_getExecutableFile(  );
+osl_getSystemPathFromFileURL( aExeURL.pData,  );
+OString aByteExe( OUStringToOString( aExe, osl_getThreadTextEncoding() ) );
+
+#ifdef DEBUG
+aByteExe += OString ( " NSAccessibilityDebugLogLevel 1" );
+const char* pArgv[] = { aByteExe.getStr(), NULL };
+NSApplicationMain( 3, pArgv );
+#else
+const char* pArgv[] = { aByteExe.getStr(), nullptr };
+NSApplicationMain( 1, pArgv );

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source

2018-11-27 Thread Libreoffice Gerrit user
 vcl/inc/osx/salframe.h   |3 --
 vcl/osx/salnativewidgets.cxx |   46 ---
 vcl/source/app/scheduler.cxx |1 
 3 files changed, 50 deletions(-)

New commits:
commit c76160c6e23f8a4e8d60068b7054591f238cbc9f
Author: Tor Lillqvist 
AuthorDate: Tue Nov 27 10:16:27 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Nov 27 10:35:01 2018 +0200

tdf#114839: Drop ancient AquaBlinker crack

Most probably that was related to "pulsating" buttons that haven't
been used since 10.9. Whether the code even worked (made buttons
pulsate) on 10.9 anyway is unclear.

Much of the code in this file uses various HITheme (Carbon?) API that
as far as I know is long since deprecated and undocumented. It's weird
that it still compiles, and that it doesn't get caught by the private
API use checking when submitting to the the Mac App Store, in the
LibreOffice Vanilla case.

This change reduces the busy looping in Dialog::Execute() even when
nothing happens (no user input, no mouse movement) when displaying a
dialog.

Change-Id: I9c62db608f637aa5d8493176feb2873f6426fd00

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index c1a55269b517..4d34b3375167 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -42,7 +42,6 @@ class AquaSalFrame;
 class AquaSalTimer;
 class AquaSalInstance;
 class AquaSalMenu;
-class AquaBlinker;
 
 typedef struct SalFrame::SalPointerState SalPointerState;
 
@@ -87,8 +86,6 @@ public:
 CGMutablePathRefmrClippingPath; // used for 
"shaping"
 std::vector< CGRect >   maClippingRects;
 
-std::list maBlinkers;
-
 tools::Rectangle   maInvalidRect;
 
 InputContextFlags   mnICOptions;
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index d89fecf1681e..0026d68a0dbd 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -44,45 +44,6 @@
 
 #endif
 
-class AquaBlinker : public Timer
-{
-AquaSalFrame*   mpFrame;
-tools::Rectangle   maInvalidateRect;
-
-AquaBlinker( AquaSalFrame* pFrame, const tools::Rectangle& rRect )
-: Timer( "AquaBlinker" )
-, mpFrame( pFrame )
-, maInvalidateRect( rRect )
-{
-mpFrame->maBlinkers.push_back( this );
-}
-
-public:
-static void Blink( AquaSalFrame*, const tools::Rectangle&, int nTimeout = 
80 );
-
-virtual void Invoke() override
-{
-if( AquaSalFrame::isAlive( mpFrame ) && mpFrame->mbShown )
-{
-mpFrame->maBlinkers.remove( this );
-mpFrame->SendPaintEvent(  );
-}
-delete this;
-}
-};
-
-void AquaBlinker::Blink( AquaSalFrame* pFrame, const tools::Rectangle& rRect, 
int nTimeout )
-{
-// prevent repeated paints from triggering themselves all the time
-auto isRepeated = std::any_of(pFrame->maBlinkers.begin(), 
pFrame->maBlinkers.end(),
-[](AquaBlinker* pBlinker) { return pBlinker->maInvalidateRect == 
rRect; });
-if( isRepeated )
-return;
-AquaBlinker* pNew = new AquaBlinker( pFrame, rRect );
-pNew->SetTimeout( nTimeout );
-pNew->Start();
-}
-
 // Helper returns an HIRect
 
 static HIRect ImplGetHIRectFromRectangle(tools::Rectangle aRect)
@@ -514,13 +475,6 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
 // avoid clipping when focused
 rc.origin.x += FOCUS_RING_WIDTH/2;
 rc.size.width -= FOCUS_RING_WIDTH;
-
-if( nState & ControlState::DEFAULT )
-{
-AquaBlinker::Blink( mpFrame, buttonRect );
-// show correct animation phase
-aPushInfo.animation.time.current = 
CFAbsoluteTimeGetCurrent();
-}
 }
 else
 aPushInfo.kind = kThemeBevelButton;
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index e647cab8de65..bdcb3fddafad 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -151,7 +151,6 @@ next_priority:
 // TODO: shutdown these timers before Scheduler de-init
 // TODO: remove Task from static object
 if ( pTask->GetDebugName() && ( false
-|| !strcmp( pTask->GetDebugName(), "AquaBlinker" )
 || !strcmp( pTask->GetDebugName(), "desktop::Desktop 
m_firstRunTimer" )
 || !strcmp( pTask->GetDebugName(), 
"DrawWorkStartupTimer" )
 || !strcmp( pTask->GetDebugName(), 
"editeng::ImpEditEngine aOnlineSpellTimer" )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/qt5 vcl/source vcl/unx vcl/win

2018-06-09 Thread Noel Grandin
 vcl/inc/osx/salinst.h|3 +--
 vcl/inc/qt5/Qt5Instance.hxx  |3 +--
 vcl/inc/salinst.hxx  |3 +--
 vcl/inc/unx/gtk/gtkinst.hxx  |3 +--
 vcl/inc/win/salinst.h|3 +--
 vcl/osx/salmenu.cxx  |   14 +++---
 vcl/qt5/Qt5Instance.cxx  |6 ++
 vcl/source/app/salvtables.cxx|7 +--
 vcl/source/window/menu.cxx   |   14 +++---
 vcl/source/window/menufloatingwindow.cxx |1 +
 vcl/source/window/menuitemlist.cxx   |7 +++
 vcl/source/window/menuitemlist.hxx   |4 +---
 vcl/source/window/menuwindow.cxx |1 +
 vcl/unx/gtk/gtkinst.cxx  |   13 +++--
 vcl/win/window/salmenu.cxx   |   24 
 15 files changed, 35 insertions(+), 71 deletions(-)

New commits:
commit b7abdafcfc42722ab060529864a2109d1e4198c0
Author: Noel Grandin 
Date:   Fri Jun 8 14:27:50 2018 +0200

return and hold SalMenuItem by std::unique_ptr

and drop DestroyMenuItem, all the implementations were just deleting the
pointer

Change-Id: I058817b963988b1e399279f61f45716a2cdba023
Reviewed-on: https://gerrit.libreoffice.org/55500
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 18f8630b0f27..a19e9e423f9b 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -120,8 +120,7 @@ public:
 virtual boolAnyInput( VclInputFlags nType ) override;
 virtual SalMenu*CreateMenu( bool bMenuBar, Menu* pVCLMenu ) 
override;
 virtual voidDestroyMenu( SalMenu* ) override;
-virtual SalMenuItem*CreateMenuItem( const SalItemParams* pItemData ) 
override;
-virtual voidDestroyMenuItem( SalMenuItem* ) override;
+virtual std::unique_ptr CreateMenuItem( const SalItemParams & 
rItemData ) override;
 virtual OpenGLContext*  CreateOpenGLContext() override;
 virtual OUStringGetConnectionIdentifier() override;
 virtual voidAddToRecentDocumentList(const OUString& rFileUrl, 
const OUString& rMimeType,
diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index aea3e792bfa0..16e22098cd09 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -82,8 +82,7 @@ public:
 
 virtual SalMenu* CreateMenu(bool, Menu*) override;
 virtual void DestroyMenu(SalMenu* pMenu) override;
-virtual SalMenuItem* CreateMenuItem(const SalItemParams*) override;
-virtual void DestroyMenuItem(SalMenuItem* pItem) override;
+virtual std::unique_ptr CreateMenuItem(const SalItemParams&) 
override;
 
 virtual SalTimer* CreateSalTimer() override;
 virtual SalSystem* CreateSalSystem() override;
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index c8f330350ad4..3924ee3d497f 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -154,8 +154,7 @@ public:
 // menus
 virtual SalMenu*CreateMenu( bool bMenuBar, Menu* pMenu );
 virtual voidDestroyMenu( SalMenu* pMenu);
-virtual SalMenuItem*CreateMenuItem( const SalItemParams* pItemData );
-virtual voidDestroyMenuItem( SalMenuItem* pItem );
+virtual std::unique_ptr CreateMenuItem( const SalItemParams& 
pItemData );
 
 // may return NULL to disable session management, only used by X11 backend
 virtual std::unique_ptr CreateSalSession();
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 25d3ff020886..499bacadd5b4 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -200,8 +200,7 @@ public:
 virtual std::unique_ptr CreatePrinter( SalInfoPrinter* 
pInfoPrinter ) override;
 virtual SalMenu*CreateMenu( bool, Menu* ) override;
 virtual voidDestroyMenu( SalMenu* pMenu ) override;
-virtual SalMenuItem*CreateMenuItem( const SalItemParams* ) 
override;
-virtual voidDestroyMenuItem( SalMenuItem* pItem ) override;
+virtual std::unique_ptr CreateMenuItem( const SalItemParams& 
) override;
 virtual SalTimer*   CreateSalTimer() override;
 virtual voidAddToRecentDocumentList(const OUString& 
rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
 virtual std::unique_ptr
diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h
index 4274f731ee2b..e96fbc5b56b0 100644
--- a/vcl/inc/win/salinst.h
+++ b/vcl/inc/win/salinst.h
@@ -74,8 +74,7 @@ public:
 virtual boolAnyInput( VclInputFlags nType ) override;
 virtual SalMenu*CreateMenu( bool bMenuBar, Menu* ) override;
 virtual voidDestroyMenu( SalMenu* ) override;
-virtual SalMenuItem*CreateMenuItem( const SalItemParams* pItemData 
) override;
-virtual void

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2018-05-24 Thread Tor Lillqvist
 vcl/inc/osx/salmenu.h |2 --
 vcl/osx/salmenu.cxx   |   18 +-
 2 files changed, 1 insertion(+), 19 deletions(-)

New commits:
commit db18cec885499f0c34681c323b0f70e0f9e11f4b
Author: Tor Lillqvist 
Date:   Thu May 24 17:35:01 2018 +0300

Bin ancient AQUA_NATIVE_MENUS=FALSE crack

Using the system ("native") menubar works fine since a long time
surely. No reason to keep a fallback possibility.

Change-Id: I0d9ed86c28b0d832c8123b18980740dbf895ec1c
Reviewed-on: https://gerrit.libreoffice.org/54775
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index f98e44ca0c23..597180cc1ac3 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -56,8 +56,6 @@ public:
 virtual ~AquaSalMenu() override;
 
 virtual bool VisibleMenuBar() override;
-// must return true to actually display native menu bars
-// otherwise only menu messages are processed (eg, OLE on Windows)
 
 virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) 
override;
 virtual void RemoveItem( unsigned nPos ) override;
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 9122f54c456c..f9ccbb310062 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -317,11 +317,6 @@ AquaSalMenu::~AquaSalMenu()
 
 bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nFlags)
 {
-// do not use native popup menu when AQUA_NATIVE_MENUS is set to false
-if( ! VisibleMenuBar() ) {
-return false;
-}
-
 // set offsets for positioning
 const float offset = 9.0;
 
@@ -488,17 +483,6 @@ void AquaSalMenu::removeFallbackMenuItem( NSMenuItem* 
pOldItem )
 
 bool AquaSalMenu::VisibleMenuBar()
 {
-// Enable/disable experimental native menus code?
-
-// To disable native menus, set the environment variable AQUA_NATIVE_MENUS 
to FALSE
-
-static const char *pExperimental = getenv ("AQUA_NATIVE_MENUS");
-
-if ( pExperimental && !strcasecmp(pExperimental, "FALSE") )
-return false;
-
-// End of experimental code enable/disable part
-
 return true;
 }
 
@@ -811,7 +795,7 @@ void AquaSalMenu::statusLayout()
 
 bool AquaSalMenu::AddMenuBarButton( const SalMenuButtonItem& i_rNewItem )
 {
-if( ! mbMenuBar || ! VisibleMenuBar() )
+if( ! mbMenuBar  )
 return false;
 
 MenuBarButtonEntry* pEntry = findButtonItem( i_rNewItem.mnId );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2018-05-22 Thread Tor Lillqvist
 vcl/inc/osx/salinst.h |3 ++-
 vcl/osx/vclnsapp.mm   |8 
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 059872b47ed957e847a3fe63bd35793ba93c4c32
Author: Tor Lillqvist 
Date:   Mon May 21 17:06:38 2018 +0300

tdf#77444: Call TriggerUserEventProcessing() in a few key places

Causes the updated aAppEventList to be handled right away, and not
only when the next ten-second timed fires.

Change-Id: Idbcc67f13c8ea69cc08b6c5f832d4461579d5dc6
Reviewed-on: https://gerrit.libreoffice.org/54643
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 4bb86ea271db..6fcb76aec1a7 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -71,10 +71,11 @@ class AquaSalInstance : public SalInstance, public 
SalUserEventList
 
 bool RunInMainYield( bool bHandleAllCurrentEvents );
 
-virtual void TriggerUserEventProcessing() override;
 virtual void ProcessEvent( SalUserEvent aEvent ) override;
 
 public:
+virtual void TriggerUserEventProcessing() override;
+
 SalYieldMutex*  mpSalYieldMutex;// 
Sal-Yield-Mutex
 OUStringmaDefaultPrinter;
 oslThreadIdentifier maMainThread;
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 825edac6be6c..4fc869f01919 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -248,6 +248,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 {
 const ApplicationEvent* pAppEvent = new 
ApplicationEvent(ApplicationEvent::Type::Open, aFile);
 AquaSalInstance::aAppEventList.push_back( pAppEvent );
+AquaSalInstance *pInst = GetSalData()->mpInstance;
+pInst->TriggerUserEventProcessing();
 }
 return YES;
 }
@@ -276,6 +278,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
 const ApplicationEvent* pAppEvent = new 
ApplicationEvent(ApplicationEvent::Type::Open, aFileList);
 AquaSalInstance::aAppEventList.push_back( pAppEvent );
+AquaSalInstance *pInst = GetSalData()->mpInstance;
+pInst->TriggerUserEventProcessing();
 }
 }
 
@@ -286,6 +290,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aFile.push_back( GetOUString( pFile ) );
 const ApplicationEvent* pAppEvent = new 
ApplicationEvent(ApplicationEvent::Type::Print, aFile);
 AquaSalInstance::aAppEventList.push_back( pAppEvent );
+AquaSalInstance *pInst = GetSalData()->mpInstance;
+pInst->TriggerUserEventProcessing();
 return YES;
 }
 -(NSApplicationPrintReply)application: (NSApplication *) app 
printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings 
showPrintPanels:(BOOL)bShowPrintPanels
@@ -305,6 +311,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 }
 const ApplicationEvent* pAppEvent = new 
ApplicationEvent(ApplicationEvent::Type::Print, aFileList);
 AquaSalInstance::aAppEventList.push_back( pAppEvent );
+AquaSalInstance *pInst = GetSalData()->mpInstance;
+pInst->TriggerUserEventProcessing();
 // we have no back channel here, we have to assume success
 // correct handling would be NSPrintingReplyLater and then send [app 
replyToOpenOrPrint]
 return NSPrintingSuccess;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/qa vcl/source vcl/unx vcl/win

2018-03-01 Thread Noel Grandin
 vcl/inc/osx/salprn.h  |4 ++--
 vcl/inc/salgdi.hxx|3 +++
 vcl/inc/salprn.hxx|4 ++--
 vcl/inc/unx/genprn.h  |4 ++--
 vcl/inc/win/salprn.h  |4 ++--
 vcl/osx/salframe.cxx  |8 
 vcl/osx/salnativewidgets.cxx  |   26 +-
 vcl/osx/salprn.cxx|   26 --
 vcl/qa/cppunit/complextext.cxx|3 +--
 vcl/source/control/scrbar.cxx |   12 ++--
 vcl/source/edit/texteng.cxx   |3 ++-
 vcl/source/edit/textview.cxx  |3 ++-
 vcl/source/gdi/pdfwriter_impl.cxx |3 ++-
 vcl/source/gdi/print.cxx  |4 ++--
 vcl/source/gdi/salgdilayout.cxx   |8 +++-
 vcl/source/outdev/font.cxx|2 +-
 vcl/source/outdev/outdev.cxx  |3 ++-
 vcl/source/outdev/text.cxx|   16 
 vcl/source/window/mouse.cxx   |2 +-
 vcl/source/window/toolbox.cxx |6 +-
 vcl/source/window/window.cxx  |2 +-
 vcl/unx/generic/print/genprnpsp.cxx   |   12 ++--
 vcl/win/gdi/DWriteTextRenderer.cxx|8 
 vcl/win/gdi/salfont.cxx   |6 +++---
 vcl/win/gdi/salnativewidgets-luna.cxx |   30 +++---
 vcl/win/gdi/salprn.cxx|   12 ++--
 vcl/win/gdi/winlayout.cxx |   16 
 vcl/win/window/salframe.cxx   |8 
 28 files changed, 130 insertions(+), 108 deletions(-)

New commits:
commit 312c0abcff23a5bc7cf4442359ec48187ec06d48
Author: Noel Grandin 
Date:   Tue Feb 27 17:07:24 2018 +0200

drop old tools/gen methods in vcl

Change-Id: I863ce5ae46ae90f06780261fa17b087a7153c807
Reviewed-on: https://gerrit.libreoffice.org/50445
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index b82095c7559f..8f9c04017a66 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -73,8 +73,8 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 virtual boolSetData( JobSetFlags i_nFlags, ImplJobSetup* 
i_pSetupData ) override;
 virtual voidGetPageInfo( const ImplJobSetup* i_pSetupData,
  long& o_rOutWidth, long& 
o_rOutHeight,
- long& o_rPageOffX, long& 
o_rPageOffY,
- long& o_rPageWidth, long& 
o_rPageHeight ) override;
+ Point& rPageOffset,
+ Size& rPaperSize ) override;
 virtual sal_uInt32  GetCapabilities( const ImplJobSetup* 
i_pSetupData, PrinterCapType i_nType ) override;
 virtual sal_uInt16  GetPaperBinCount( const ImplJobSetup* 
i_pSetupData ) override;
 virtual OUStringGetPaperBinName( const ImplJobSetup* 
i_pSetupData, sal_uInt16 i_nPaperBin ) override;
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 32b51f6630d9..655c3ea17aa1 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -203,6 +203,9 @@ public:
 voidSetLayout( SalLayoutFlags aLayout ) { 
m_nLayout = aLayout;}
 
 voidmirror( long& nX, const OutputDevice *pOutDev 
) const;
+// only called mirror2 to avoid ambiguity
+SAL_WARN_UNUSED_RESULT
+longmirror2( long nX, const OutputDevice *pOutDev 
) const;
 voidmirror( long& nX, long nWidth, const 
OutputDevice *pOutDev, bool bBack = false ) const;
 boolmirror( sal_uInt32 nPoints, const SalPoint 
*pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const;
 voidmirror( tools::Rectangle& rRect, const 
OutputDevice*, bool bBack = false ) const;
diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx
index d8b4182f4fee..d9da1a6d80ed 100644
--- a/vcl/inc/salprn.hxx
+++ b/vcl/inc/salprn.hxx
@@ -72,8 +72,8 @@ public:
 
 virtual voidGetPageInfo( const ImplJobSetup* 
pSetupData,
  long& rOutWidth, long& 
rOutHeight,
- long& rPageOffX, long& 
rPageOffY,
- long& rPageWidth, long& 
rPageHeight ) = 0;
+ Point& rPageOffset,
+ Size& rPaperSize ) = 0;
 virtual sal_uInt32  GetCapabilities( const ImplJobSetup* 
pSetupData, PrinterCapType nType ) = 0;
 virtual sal_uInt16  GetPaperBinCount( const ImplJobSetup* 
pSetupData ) = 0;
 virtual OUString

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2018-02-23 Thread Tor Lillqvist
 vcl/inc/osx/salframe.h |6 
 vcl/osx/salframe.cxx   |   66 +
 2 files changed, 56 insertions(+), 16 deletions(-)

New commits:
commit 715b7b6f346fdd9c856db268dcd66334b58c273c
Author: Tor Lillqvist 
Date:   Fri Feb 23 15:27:51 2018 +0200

tdf#103571: Avoid spurious heavy SalEvent::DisplayChanged callbacks

It seems that on some Macs that the
NSApplicationDidChangeScreenParametersNotification is sent for unknown
reasons quite often. I can reproduce the problem by changing the Dock
size in System Preferences while LibreOffice is running, but others
seem to get it without resorting to such trickery.

The code used to invoke the SalEvent::DisplayChanged callback in all
cases, which can be extremely heavy, as it involves re-measuring text
layouts all over the place in all open document windows.

Avoid that if the geometry in fact has not changed.

Sure, there still is the problem that LibreOffice can become
unresponsive for several seconds when the display geometry *does*
change, like when you attach or detach a display.

Change-Id: I659881e5e392bd599f6be190835e32a77d9f4725
Reviewed-on: https://gerrit.libreoffice.org/50249
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 0d93e9e9b2ff..c2b53e270648 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -82,6 +82,7 @@ public:
 PointerStylemePointerStyle; // currently 
active pointer style
 
 NSTrackingRectTag   mnTrackingRectTag;  // used to get 
enter/leave messages
+NSRect  maTrackingRect;
 
 CGMutablePathRefmrClippingPath; // used for 
"shaping"
 std::vector< CGRect >   maClippingRects;
@@ -95,6 +96,11 @@ public:
 // To prevent display sleep during presentation
 IOPMAssertionID mnAssertionID;
 
+NSRect  maFrameRect;
+NSRect  maContentRect;
+
+boolmbGeometryDidChange;
+
 public:
 /** Constructor
 
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index e8259b5bc223..5b00f7242900 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -268,6 +268,10 @@ void AquaSalFrame::screenParametersChanged()
 
 if( mpGraphics )
 mpGraphics->updateResolution();
+
+if (!mbGeometryDidChange)
+return;
+
 CallCallback( SalEvent::DisplayChanged, nullptr );
 }
 
@@ -1522,6 +1526,9 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent )
 
 void AquaSalFrame::UpdateFrameGeometry()
 {
+bool bFirstTime = (mnTrackingRectTag == 0);
+mbGeometryDidChange = false;
+
 if ( !mpNSWindow )
 return;
 
@@ -1534,38 +1541,65 @@ void AquaSalFrame::UpdateFrameGeometry()
 NSScreen * pScreen = [mpNSWindow screen];
 if( pScreen )
 {
-maScreenRect = [pScreen frame];
+NSRect aNewScreenRect = [pScreen frame];
+if (bFirstTime || !NSEqualRects(maScreenRect, aNewScreenRect))
+{
+mbGeometryDidChange = true;
+maScreenRect = aNewScreenRect;
+}
 NSArray* pScreens = [NSScreen screens];
 if( pScreens )
-maGeometry.nDisplayScreenNumber = [pScreens indexOfObject: 
pScreen];
+{
+unsigned int nNewDisplayScreenNumber = [pScreens indexOfObject: 
pScreen];
+if (bFirstTime || maGeometry.nDisplayScreenNumber != 
nNewDisplayScreenNumber)
+{
+mbGeometryDidChange = true;
+maGeometry.nDisplayScreenNumber = nNewDisplayScreenNumber;
+}
+}
 }
 
 NSRect aFrameRect = [mpNSWindow frame];
 NSRect aContentRect = [NSWindow contentRectForFrameRect: aFrameRect 
styleMask: mnStyleMask];
 
-// release old track rect
-[mpNSView removeTrackingRect: mnTrackingRectTag];
-// install the new track rect
 NSRect aTrackRect = { NSZeroPoint, aContentRect.size };
-mnTrackingRectTag = [mpNSView addTrackingRect: aTrackRect owner: mpNSView 
userData: nil assumeInside: NO];
+
+if (bFirstTime || !NSEqualRects(maTrackingRect, aTrackRect))
+{
+mbGeometryDidChange = true;
+maTrackingRect = aTrackRect;
+
+// release old track rect
+[mpNSView removeTrackingRect: mnTrackingRectTag];
+// install the new track rect
+mnTrackingRectTag = [mpNSView addTrackingRect: aTrackRect owner: 
mpNSView userData: nil assumeInside: NO];
+}
 
 // convert to vcl convention
 CocoaToVCL( aFrameRect );
 CocoaToVCL( aContentRect );
 
-maGeometry.nX = static_cast(aContentRect.origin.x);
-maGeometry.nY = static_cast(aContentRect.origin.y);
+if (bFirstTime || !NSEqualRects(maContentRect, aContentRect) 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source

2018-02-22 Thread Tor Lillqvist
 vcl/inc/salinst.hxx   |4 
 vcl/osx/salinst.cxx   |3 +++
 vcl/source/app/svmain.cxx |4 
 3 files changed, 11 insertions(+)

New commits:
commit 8bd289c43c34ab9258f4b08a0f3f6143dc710e4e
Author: Tor Lillqvist 
Date:   Thu Feb 22 12:40:26 2018 +0200

tdf#103690: Set up notifications only after VCL has been initialised

On some Macs, it seems that LibreOffice (or any app?) gets an
NSApplicationDidChangeScreenParametersNotification as soon as it has
started and asked for such a notification. Our handler for that
notification assumes that VCL is initialised. Thus we should not ask
for such notifications before VCL has been initialised.

I could not reproduce the reported crash with an unmodified
LibreOffice, only after inserting a sleep after the notifications had
been set up. But I am fairly sure this change fixes the problem.

Change-Id: I18d342eb7dc0c77cb7fc8623756bead65a1bd329
Reviewed-on: https://gerrit.libreoffice.org/50164
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index 1eadc7ac382f..600f8ddfb8b3 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -205,6 +205,10 @@ void DeInitSalData();   // called from 
Application-Dtor
 
 void InitSalMain();
 
+#ifdef MACOSX
+void postInitVCLinitNSApp();
+#endif
+
 #endif // INCLUDED_VCL_INC_SALINST_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 48eafa5eac1a..e008357b3641 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -157,7 +157,10 @@ static void initNSApp()
 
 // activate our delegate methods
 [NSApp setDelegate: NSApp];
+}
 
+void postInitVCLinitNSApp()
+{
 [[NSNotificationCenter defaultCenter] addObserver: NSApp
   selector: 
@selector(systemColorsChanged:)
   name: 
NSSystemColorsDidChangeNotification
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 500eb3060c19..f44fd566aabc 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -187,6 +187,10 @@ int ImplSVMain()
 
 bool bInit = isInitVCL() || InitVCL();
 
+#ifdef MACOSX
+postInitVCLinitNSApp();
+#endif
+
 if( bInit )
 {
 // call application main
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2017-11-08 Thread Stephan Bergmann
 vcl/inc/osx/runinmain.hxx |   79 +-
 vcl/inc/osx/salinst.h |4 ++
 vcl/osx/salinst.cxx   |   53 --
 3 files changed, 89 insertions(+), 47 deletions(-)

New commits:
commit b5b78703b5d801c2a9a5e45126f8e87bf5ebd4b4
Author: Stephan Bergmann 
Date:   Wed Nov 8 19:01:10 2017 +0100

Avoid races when using OSX_RUNINMAIN_MEMBERS

...so that e.g. main thread in SalYieldMutex::doAcquire could reset
m_aInMainTHreadCondition and then block waiting on it only after another 
thread
had set it.  (Saw such a deadlock in some 'make check' CppunitTest.)

Change-Id: I5c676956a2bec6bf8f94d7dbeee64f100db39bd3
Reviewed-on: https://gerrit.libreoffice.org/44501
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/osx/runinmain.hxx b/vcl/inc/osx/runinmain.hxx
index a57b7908214d..8f8559dac5c8 100644
--- a/vcl/inc/osx/runinmain.hxx
+++ b/vcl/inc/osx/runinmain.hxx
@@ -57,8 +57,11 @@ union RuninmainResult
 };
 
 #define OSX_RUNINMAIN_MEMBERS \
-osl::Condition  m_aInMainCondition; \
-osl::Condition  m_aResultCondition; \
+std::mutex  m_runInMainMutex; \
+std::condition_variable m_aInMainCondition; \
+std::condition_variable m_aResultCondition; \
+boolm_wakeUpMain = false; \
+boolm_resultReady = false; \
 RuninmainBlock  m_aCodeBlock; \
 RuninmainResult m_aResult;
 
@@ -67,18 +70,24 @@ union RuninmainResult
 { \
 DBG_TESTSOLARMUTEX(); \
 SalYieldMutex *aMutex = 
static_cast(instance->GetYieldMutex()); \
-assert( !aMutex->m_aCodeBlock ); \
-aMutex->m_aCodeBlock = Block_copy(^{ \
-command; \
-}); \
-aMutex->m_aResultCondition.reset(); \
+{ \
+std::unique_lock g(aMutex->m_runInMainMutex); \
+assert( !aMutex->m_aCodeBlock ); \
+aMutex->m_aCodeBlock = Block_copy(^{ \
+command; \
+}); \
+aMutex->m_wakeUpMain = true; \
+aMutex->m_aInMainCondition.notify_all(); \
+} \
 dispatch_async(dispatch_get_main_queue(),^{ \
 ImplNSAppPostEvent( AquaSalInstance::YieldWakeupEvent, NO ); \
 }); \
-aMutex->m_aInMainCondition.set(); \
-osl::Condition::Result res =  aMutex->m_aResultCondition.wait(); \
-(void) res; \
-assert(osl::Condition::Result::result_ok == res); \
+{ \
+std::unique_lock g(aMutex->m_runInMainMutex); \
+aMutex->m_aResultCondition.wait( \
+g, []() { return aMutex->m_resultReady; }); \
+aMutex->m_resultReady = false; \
+} \
 return; \
 }
 
@@ -87,18 +96,24 @@ union RuninmainResult
 { \
 DBG_TESTSOLARMUTEX(); \
 SalYieldMutex *aMutex = 
static_cast(instance->GetYieldMutex()); \
-assert( !aMutex->m_aCodeBlock ); \
-aMutex->m_aCodeBlock = Block_copy(^{ \
-aMutex->m_aResult.pointer = static_cast( command ); \
-}); \
-aMutex->m_aResultCondition.reset(); \
+{ \
+std::unique_lock g(aMutex->m_runInMainMutex); \
+assert( !aMutex->m_aCodeBlock ); \
+aMutex->m_aCodeBlock = Block_copy(^{ \
+aMutex->m_aResult.pointer = static_cast( command ); \
+}); \
+aMutex->m_wakeUpMain = true; \
+aMutex->m_aInMainCondition.notify_all(); \
+} \
 dispatch_async(dispatch_get_main_queue(),^{ \
 ImplNSAppPostEvent( AquaSalInstance::YieldWakeupEvent, NO ); \
 }); \
-aMutex->m_aInMainCondition.set(); \
-osl::Condition::Result res =  aMutex->m_aResultCondition.wait(); \
-(void) res; \
-assert(osl::Condition::Result::result_ok == res); \
+{ \
+std::unique_lock g(aMutex->m_runInMainMutex); \
+aMutex->m_aResultCondition.wait( \
+g, []() { return aMutex->m_resultReady; }); \
+aMutex->m_resultReady = false; \
+} \
 return static_cast( aMutex->m_aResult.pointer ); \
 }
 
@@ -107,18 +122,24 @@ union RuninmainResult
 { \
 DBG_TESTSOLARMUTEX(); \
 SalYieldMutex *aMutex = 
static_cast(instance->GetYieldMutex()); \
-assert( !aMutex->m_aCodeBlock ); \
-aMutex->m_aCodeBlock = Block_copy(^{ \
-aMutex->m_aResult.member = command; \
-}); \
-aMutex->m_aResultCondition.reset(); \
+{ \
+std::unique_lock g(aMutex->m_runInMainMutex); \
+assert( !aMutex->m_aCodeBlock ); \
+aMutex->m_aCodeBlock = Block_copy(^{ \
+aMutex->m_aResult.member = command; \
+}); \
+

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/win

2017-10-20 Thread Jan-Marek Glogowski
 vcl/inc/osx/salinst.h |6 -
 vcl/inc/win/saldata.hxx   |4 -
 vcl/inc/win/saltimer.h|2 
 vcl/osx/vclnsapp.mm   |2 
 vcl/win/app/salinst.cxx   |  144 --
 vcl/win/window/salobj.cxx |6 -
 6 files changed, 73 insertions(+), 91 deletions(-)

New commits:
commit 8ba60ca42d4d1873b8cd85c5d3b5ed2f0e19df60
Author: Jan-Marek Glogowski 
Date:   Mon Oct 16 17:04:24 2017 +0200

WIN message handling cleanup and refactoring

Replace a lot of duplicated case code with macros.
Some minor constifications of function parameters.

I restrained from shorten the SAL_MSG_* via preprocessor concat,
so a grep will still find the whole names.

Change-Id: If1f2477fc8817b4ae7816e807154e35004bb4da9
Reviewed-on: https://gerrit.libreoffice.org/43531
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 01e50af77b99..a80af4fb5ee7 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -63,6 +63,8 @@ public:
 
 class AquaSalInstance : public SalInstance, public SalUserEventList
 {
+friend class AquaSalFrame;
+
 bool RunInMainYield( bool bHandleAllCurrentEvents );
 
 virtual void TriggerUserEventProcessing() override;
@@ -81,7 +83,6 @@ public:
 
 static std::list aAppEventList;
 
-public:
 AquaSalInstance();
 virtual ~AquaSalInstance() override;
 
@@ -136,9 +137,6 @@ public:
 // this is needed to avoid duplicate open events through a) command line 
and b) NSApp's openFile
 static bool isOnCommandLine( const OUString& );
 
-public:
-friend class AquaSalFrame;
-
 void delayedSettingsChanged( bool bInvalidate );
 
 // Is this the NSAppThread?
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index 0f3e05b8f31a..659fd68f7dda 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -180,8 +180,8 @@ bool ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, 
LPARAM lParam );
 bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, 
LRESULT& rlResult );
 
 WinSalObject* ImplFindSalObject( HWND hWndChild );
-bool ImplSalPreDispatchMsg( MSG* pMsg );
-void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
+bool ImplSalPreDispatchMsg( const MSG* pMsg );
+void ImplSalPostDispatchMsg( const MSG* pMsg );
 
 void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, vcl::Font& 
rFont );
 
diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h
index b7d1a1e0d0f1..61d284d82ddb 100644
--- a/vcl/inc/win/saltimer.h
+++ b/vcl/inc/win/saltimer.h
@@ -25,7 +25,7 @@
 class WinSalTimer final : public SalTimer, protected VersionedEvent
 {
 // for access to Impl* functions
-friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, 
LPARAM lParam, int& rDef );
+friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, 
LPARAM lParam, bool& rDef );
 // for access to GetNextVersionedEvent
 friend void CALLBACK SalTimerProc( PVOID data, BOOLEAN );
 // for access to ImplHandleElapsedTimer
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 4dd8ceac8169..23b22c360eeb 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -66,7 +66,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
 NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint
modifierFlags: 0
-   timestamp: 0
+   timestamp: [[NSProcessInfo processInfo] 
systemUptime]
windowNumber: 0
context: nil
subtype: AquaSalInstance::AppExecuteSVMain
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 693411a0583c..68ad7deb994d 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -459,14 +459,14 @@ void WinSalInstance::AcquireYieldMutex( sal_uInt32 nCount 
)
 mpSalYieldMutex->acquire( nCount );
 }
 
-static LRESULT ImplSalDispatchMessage( MSG* pMsg )
+static LRESULT ImplSalDispatchMessage( const MSG* pMsg )
 {
 SalData* pSalData = GetSalData();
 if ( pSalData->mpFirstObject && ImplSalPreDispatchMsg( pMsg ) )
 return 0;
 LRESULT lResult = DispatchMessageW( pMsg );
 if ( pSalData->mpFirstObject )
-ImplSalPostDispatchMsg( pMsg, lResult );
+ImplSalPostDispatchMsg( pMsg );
 return lResult;
 }
 
@@ -569,124 +569,108 @@ bool WinSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 return bDidWork;
 }
 
-LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, 
int& rDef )
+#define CASE_NOYIELDLOCK( salmsg, function ) \
+case salmsg: \
+assert( !pInst->mbNoYieldLock ); \
+pInst->mbNoYieldLock = true; \
+function; \
+   

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2017-10-20 Thread Jan-Marek Glogowski
 vcl/inc/osx/salinst.h  |1 +
 vcl/inc/osx/saltimer.h |9 -
 vcl/osx/salinst.cxx|   17 +++--
 vcl/osx/saltimer.cxx   |   19 ---
 4 files changed, 36 insertions(+), 10 deletions(-)

New commits:
commit fd5fa397a0a46470e034bb23789f7a17592cb070
Author: Jan-Marek Glogowski 
Date:   Wed Oct 18 17:00:53 2017 +0200

OSX implement direct timeout processing

Basically works in the same way then in the Windows backend.

Change-Id: If48e2b55f037563839a5e716830ce75ed78381e4
Reviewed-on: https://gerrit.libreoffice.org/43530
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 272cfc722d64..01e50af77b99 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -77,6 +77,7 @@ public:
 osl::Condition  maWaitingYieldCond;
 boolmbIsLiveResize;
 boolmbNoYieldLock;
+boolmbTimerProcessed;
 
 static std::list aAppEventList;
 
diff --git a/vcl/inc/osx/saltimer.h b/vcl/inc/osx/saltimer.h
index c860ad5cbdda..a9934f280636 100644
--- a/vcl/inc/osx/saltimer.h
+++ b/vcl/inc/osx/saltimer.h
@@ -44,6 +44,7 @@ public:
 class AquaSalTimer final : public SalTimer, protected VersionedEvent
 {
 NSTimer*m_pRunningTimer;
+boolm_bDirectTimeout;///< timeout can be processed directly
 
 void queueDispatchTimerEvent( bool bAtStart );
 void callTimerCallback();
@@ -56,13 +57,19 @@ public:
 void Stop() override;
 
 void handleStartTimerEvent( NSEvent* pEvent );
-void handleDispatchTimerEvent( NSEvent* pEvent );
+bool handleDispatchTimerEvent( NSEvent* pEvent );
 void handleTimerElapsed();
 void handleWindowShouldClose();
 
 bool IsTimerElapsed() const;
+inline bool IsDirectTimeout() const;
 };
 
+inline bool AquaSalTimer::IsDirectTimeout() const
+{
+return m_bDirectTimeout;
+}
+
 #endif // INCLUDED_VCL_INC_OSX_SALTIMER_H
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index d475f30275b0..922046bcbfe8 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -379,6 +379,7 @@ AquaSalInstance::AquaSalInstance()
 : mnActivePrintJobs( 0 )
 , mbIsLiveResize( false )
 , mbNoYieldLock( false )
+, mbTimerProcessed( false )
 {
 mpSalYieldMutex = new SalYieldMutex;
 mpSalYieldMutex->acquire();
@@ -452,9 +453,12 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* 
pEvent )
 break;
 }
 case DispatchTimerEvent:
-if ( pTimer )
-pTimer->handleDispatchTimerEvent( pEvent );
+{
+AquaSalInstance *pInst = GetSalData()->mpInstance;
+if ( pTimer && pInst )
+pInst->mbTimerProcessed = pTimer->handleDispatchTimerEvent( pEvent 
);
 break;
+}
 #if !HAVE_FEATURE_MACOSX_SANDBOX
 case AppleRemoteControlEvent: // Defined in 

 {
@@ -570,6 +574,8 @@ bool AquaSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 // handle available events
 NSEvent* pEvent = nil;
 NSTimeInterval now = [[NSProcessInfo processInfo] systemUptime];
+mbTimerProcessed = false;
+
 do
 {
 SolarMutexReleaser aReleaser;
@@ -596,6 +602,13 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 }
 while( true );
 
+AquaSalTimer *pTimer = static_cast( 
ImplGetSVData()->maSchedCtx.mpSalTimer );
+if ( !mbTimerProcessed && pTimer && pTimer->IsDirectTimeout() )
+{
+pTimer->handleTimerElapsed();
+bHadEvent = true;
+}
+
 // if we had no event yet, wait for one if requested
 if( bWait && ! bHadEvent )
 {
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 34d46f08728a..3d74da42a3dc 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -74,6 +74,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 void AquaSalTimer::queueDispatchTimerEvent( bool bAtStart )
 {
 Stop();
+m_bDirectTimeout = true;
 ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent,
 bAtStart, GetNextEventVersion() );
 }
@@ -88,8 +89,9 @@ void AquaSalTimer::Start( sal_uLong nMS )
 return;
 }
 
-if ( 0 == nMS && !pSalData->mpInstance->mbIsLiveResize )
-queueDispatchTimerEvent( NO );
+m_bDirectTimeout = (0 == nMS) && !pSalData->mpInstance->mbIsLiveResize;
+if ( m_bDirectTimeout )
+Stop();
 else
 {
 NSTimeInterval aTI = double(nMS) / 1000.0;
@@ -139,13 +141,14 @@ void AquaSalTimer::callTimerCallback()
 {
 ImplSVData* pSVData = ImplGetSVData();
 SolarMutexGuard aGuard;
+m_bDirectTimeout = false;
 if( pSVData->maSchedCtx.mpSalTimer )
 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/README.scheduler

2017-10-16 Thread Jan-Marek Glogowski
 vcl/README.scheduler|4 
 vcl/inc/osx/saltimer.h  |1 +
 vcl/osx/salframeview.mm |3 +++
 vcl/osx/saltimer.cxx|8 
 4 files changed, 16 insertions(+)

New commits:
commit c69c1ee9d1305c284be48a7a973810da16c15541
Author: Jan-Marek Glogowski 
Date:   Sat Oct 14 01:43:07 2017 +0200

tdf#112076 OSX post timeout after shouldCloseWindow

It seems that something filters application defined events when
closing a window... DoYield expects a timeout event, which never
arrives, stopping all redraw and generating a busy loop.

Change-Id: Ic83468cceac7b967acaecf18b321178fc7565b94
Reviewed-on: https://gerrit.libreoffice.org/43381
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 566a88629301..17648ae3b439 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -170,6 +170,10 @@ There is also a workaround for a problem for pushing tasks 
to an empty queue,
 as [NSApp postEvent: ... atStart: NO] doesn't append the event, if the
 message queue is empty.
 
+An additional problem is the filtering of events on Window close. This drops
+posted timer events, when a Window is closed resulting in a busy DoYield loop,
+so we have to re-post the event, after closing a window.
+
 == Windows implementation details ==
 
 Posted or sent event messages often trigger processing of WndProc in
diff --git a/vcl/inc/osx/saltimer.h b/vcl/inc/osx/saltimer.h
index 65247b930cfa..c860ad5cbdda 100644
--- a/vcl/inc/osx/saltimer.h
+++ b/vcl/inc/osx/saltimer.h
@@ -58,6 +58,7 @@ public:
 void handleStartTimerEvent( NSEvent* pEvent );
 void handleDispatchTimerEvent( NSEvent* pEvent );
 void handleTimerElapsed();
+void handleWindowShouldClose();
 
 bool IsTimerElapsed() const;
 };
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 1f0a3690bb70..c0d28fe4bc3f 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -369,6 +369,9 @@ static AquaSalFrame* getMouseContainerFrame()
 {
 mpFrame->CallCallback( SalEvent::Close, nullptr );
 bRet = NO; // application will close the window or not, AppKit 
shouldn't
+AquaSalTimer *pTimer = static_cast( 
ImplGetSVData()->maSchedCtx.mpSalTimer );
+assert( pTimer );
+pTimer->handleWindowShouldClose();
 }
 }
 
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 877fdfae85b5..3226b1d1f9ec 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -196,4 +196,12 @@ AquaSalTimer::~AquaSalTimer()
 Stop();
 }
 
+void AquaSalTimer::handleWindowShouldClose()
+{
+// for whatever reason events get filtered on close, presumely by
+// timestamp so post a new timeout event, if there was one queued...
+if ( ExistsValidEvent() && !m_pRunningTimer )
+queueDispatchTimerEvent( NO );
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/README.scheduler vcl/win

2017-10-04 Thread Jan-Marek Glogowski
 vcl/README.scheduler |   51 +--
 vcl/inc/osx/saltimer.h   |3 --
 vcl/inc/saltimer.hxx |   44 
 vcl/inc/win/saltimer.h   |7 +++---
 vcl/osx/saltimer.cxx |   22 +---
 vcl/win/app/saltimer.cxx |   18 ++--
 6 files changed, 98 insertions(+), 47 deletions(-)

New commits:
commit da5cdcdeddf7bc21606b4cb64d8b1fc412146935
Author: Jan-Marek Glogowski 
Date:   Fri Sep 29 21:02:17 2017 +0200

Convert tick-based timer events to versioned ones

Instead of storing the system ticks in the timer event message
simply store a version.

Moves the version handling code into a VersionedEvent class,
inherited by WinSalTimer and AquaSalTimer.

Change-Id: I5add85031d36b3424a26a9ef798294cbfb00b2e4
Reviewed-on: https://gerrit.libreoffice.org/42959
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index ac4a0dd698d4..8c5e64ba74c5 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -107,7 +107,7 @@ thread redirects using Qt::BlockingQueuedConnection.
 == General: processing all current events for DoYield ==
 
 This is easily implemented for all non-priority queue based implementations.
-Windows and MacOS both have a timestamp attached to their events / messages,
+Windows and macOS both have a timestamp attached to their events / messages,
 so simply get the current time and just process anything < timestamp.
 For the KDE backend this is already the default behaviour - single event
 processing isn't even supported. The headless backend accomplishes this by
@@ -130,10 +130,27 @@ may block the main thread until some events happen.
 Currently we wait on an extra conditional, which is cleared by the main event
 loop.
 
-== MacOS implementation details ==
+== General: invalidation of elapsed timer event messages ==
+
+Since the system timer to run the scheduler is single-shot, there should never
+be more then one elapsed timer event in system event queue. When stopping or
+restarting the timer, we eventually have to remove the now invalid event from
+the queue.
+
+But for the Windows and macOS backends this may fail as they have delayed
+posting of events, so a consecutive remove after a post will actually yield no
+remove. On Windows we even get unwanted processing of events outside of the
+main event loop, which may call the Scheduler, as timer management is handled
+in critical scheduler code.
+
+To prevent these problems, we don't even try to remove these events, but
+invalidate them by versioning the timer events. Timer events with invalid
+versions are processed but simply don't run the scheduler.
+
+== macOS implementation details ==
 
 Generally the Scheduler is handled as expected, except on resize, which is
-handled with different runloop-modes in MacOS. In case of a resize, the normal
+handled with different runloop-modes in macOS. In case of a resize, the normal
 runloop is suspended in sendEvent, so we can't call the scheduler via posted
 main loop-events. Instead the scheduler uses the timer again.
 
@@ -145,7 +162,7 @@ but we can prevent running any other SolarMutex based code. 
Those wakeup
 events must be ignored to prevent busy-locks. For more info read the "General:
 main thread deferral" section.
 
-We can neither rely on MacOS dispatch_sync code block execution nor the
+We can neither rely on macOS dispatch_sync code block execution nor the
 message handling, as both can't be prioritized or filtered and the first
 does also not allow nested execution and is just processed in sequence.
 
@@ -153,29 +170,25 @@ There is also a workaround for a problem for pushing 
tasks to an empty queue,
 as [NSApp postEvent: ... atStart: NO] doesn't append the event, if the
 message queue is empty.
 
-Probably that's the reason, why some code comments spoke of lost events and
-there was some distinct additional event processing implemented.
-
 == Windows implementation details ==
 
 Posted or sent event messages often trigger processing of WndProc in
 PeekMessage, GetMessage or DispatchMessage, independently from the message to
 fetch, remove or dispatch ("During this call, the system delivers pending,
 nonqueued messages..."). Additionally messages have an inherited priority
-based on the function used to generate them. Even if WM_TIMER should have been
-the lowest prio, a posted WM_TIMER is processed with the prio of a posted
-message.
+based on the function used to generate them. Even if WM_TIMER messages should
+have the lowest priority, a manually posted WM_TIMER is processed with the
+priority of a PostMessage message.
 
-Therefore the current solution always starts a (threaded) timer even for the
-instant Idles and syncs to this timer message in the main dispatch loop.
-Using SwitchToThread(), this seem to work 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2017-09-29 Thread Jan-Marek Glogowski
 vcl/inc/osx/runinmain.hxx |6 +++---
 vcl/inc/osx/saldata.hxx   |2 +-
 vcl/inc/osx/salframe.h|2 +-
 vcl/osx/saldata.cxx   |2 +-
 vcl/osx/salframe.cxx  |8 
 vcl/osx/salframeview.mm   |8 
 vcl/osx/salinst.cxx   |   22 +++---
 vcl/osx/salobj.cxx|2 +-
 vcl/osx/salprn.cxx|2 +-
 vcl/osx/saltimer.cxx  |8 
 vcl/osx/vclnsapp.mm   |   10 +-
 vcl/quartz/salvd.cxx  |2 +-
 12 files changed, 37 insertions(+), 37 deletions(-)

New commits:
commit 442771d105fbce531ec3df5673dcc4a5f7a8bc7b
Author: Jan-Marek Glogowski 
Date:   Fri Sep 29 09:18:51 2017 +0200

OSX rename mpFirstInstance to mpInstance

In the same spirit as the Windows commit
7c52d86f7b05fe7e0178f6d98a12a531b88a32ff.

Change-Id: Ic45803c0715723b6f57c9f6a0c731edd559aa92c
Reviewed-on: https://gerrit.libreoffice.org/42932
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/osx/runinmain.hxx b/vcl/inc/osx/runinmain.hxx
index c971d3a25639..0c2a5268d70a 100644
--- a/vcl/inc/osx/runinmain.hxx
+++ b/vcl/inc/osx/runinmain.hxx
@@ -140,13 +140,13 @@ union RuninmainResult
  */
 
 #define OSX_SALDATA_RUNINMAIN( command ) \
-OSX_RUNINMAIN( GetSalData()->mpFirstInstance, command )
+OSX_RUNINMAIN( GetSalData()->mpInstance, command )
 
 #define OSX_SALDATA_RUNINMAIN_POINTER( command, type ) \
-OSX_RUNINMAIN_POINTER( GetSalData()->mpFirstInstance, command, type )
+OSX_RUNINMAIN_POINTER( GetSalData()->mpInstance, command, type )
 
 #define OSX_SALDATA_RUNINMAIN_UNION( command, member ) \
-OSX_RUNINMAIN_UNION( GetSalData()->mpFirstInstance, command, member )
+OSX_RUNINMAIN_UNION( GetSalData()->mpInstance, command, member )
 
 #endif // INCLUDED_VCL_INC_OSX_RUNINMAIN_HXX
 
diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 5ec684b83973..357a2df6a74b 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -63,7 +63,7 @@ class SalData
 {
 public:
 SALTIMERPROC  mpTimerProc;  // timer 
callback proc
-AquaSalInstance  *mpFirstInstance;  // pointer 
of first instance
+AquaSalInstance  *mpInstance;
 std::list  maPresentationFrames;  // 
list of frames in presentation mode
 SalObject*mpFirstObject;// pointer 
of first object window
 SalVirtualDevice *mpFirstVD;// first 
VirDev
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index f8cef1834106..55779e6868be 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -206,7 +206,7 @@ private: // data
 
 inline bool AquaSalFrame::isAlive( const AquaSalFrame* pFrame )
 {
-AquaSalInstance *pInst = GetSalData()->mpFirstInstance;
+AquaSalInstance *pInst = GetSalData()->mpInstance;
 return pInst && pInst->isFrameAlive( pFrame );
 }
 
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index de139319e8bd..a445e5cfb7ad 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -37,7 +37,7 @@ static void SAL_CALL releasePool( void* pPool )
 SalData::SalData()
 :
 mpTimerProc( nullptr ),
-mpFirstInstance( nullptr ),
+mpInstance( nullptr ),
 mpFirstObject( nullptr ),
 mpFirstVD( nullptr ),
 mpFirstPrinter( nullptr ),
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index dcdfe6d9c936..ff87c83e3205 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -87,12 +87,12 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 initWindowAndView();
 
 SalData* pSalData = GetSalData();
-pSalData->mpFirstInstance->insertFrame( this );
+pSalData->mpInstance->insertFrame( this );
 }
 
 AquaSalFrame::~AquaSalFrame()
 {
-assert( GetSalData()->mpFirstInstance->IsMainThread() );
+assert( GetSalData()->mpInstance->IsMainThread() );
 
 // if the frame is destroyed and has the current menubar
 // set the default menubar
@@ -105,7 +105,7 @@ AquaSalFrame::~AquaSalFrame()
 [SalFrameView unsetMouseFrame: this];
 
 SalData* pSalData = GetSalData();
-pSalData->mpFirstInstance->eraseFrame( this );
+pSalData->mpInstance->eraseFrame( this );
 pSalData->maPresentationFrames.remove( this );
 
 SAL_WARN_IF( this == s_pCaptureFrame, "vcl", "capture frame destroyed" );
@@ -294,7 +294,7 @@ void AquaSalFrame::ReleaseGraphics( SalGraphics *pGraphics )
 
 bool AquaSalFrame::PostEvent(ImplSVEvent* pData)
 {
-GetSalData()->mpFirstInstance->PostEvent( this, pData, SalEvent::UserEvent 
);
+GetSalData()->mpInstance->PostEvent( this, pData, SalEvent::UserEvent );
 return TRUE;
 }
 
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 184c5bc15b70..1f0a3690bb70 100644
--- 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2017-09-29 Thread Jan-Marek Glogowski
 vcl/inc/osx/saltimer.h |   14 --
 vcl/osx/salinst.cxx|   23 ---
 vcl/osx/salnstimer.mm  |   14 ++
 vcl/osx/saltimer.cxx   |  101 +++--
 4 files changed, 90 insertions(+), 62 deletions(-)

New commits:
commit a60f687b5dd684260fc976c1216d65d30e77e5de
Author: Jan-Marek Glogowski 
Date:   Tue Sep 26 19:06:51 2017 +0200

tdf#112605 OSX refactor SalAquaTimer

Drops all the static calls and variables from SalAquaTimer
and moves all timer handling logic inside the class.

This also fixes the leak in timerElapsed.

Change-Id: Ie7a1a8fffb70b8579ec6876eed10a275d2f06d27
Reviewed-on: https://gerrit.libreoffice.org/42913
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/osx/saltimer.h b/vcl/inc/osx/saltimer.h
index 86964115d648..f70bd65491b8 100644
--- a/vcl/inc/osx/saltimer.h
+++ b/vcl/inc/osx/saltimer.h
@@ -43,6 +43,12 @@ public:
 
 class AquaSalTimer : public SalTimer
 {
+NSTimer*m_pRunningTimer;
+sal_Int32   m_nTimerStartTicks;  ///< system ticks at timer start % 
SAL_MAX_INT32
+
+void queueDispatchTimerEvent( bool bAtStart );
+void callTimerCallback();
+
 public:
 AquaSalTimer();
 virtual ~AquaSalTimer() override;
@@ -50,11 +56,11 @@ public:
 void Start( sal_uLong nMS ) override;
 void Stop() override;
 
-static void handleStartTimerEvent( NSEvent* pEvent );
-static void handleDispatchTimerEvent();
+void handleStartTimerEvent( NSEvent* pEvent );
+void handleDispatchTimerEvent( NSEvent* pEvent );
+void handleTimerElapsed();
 
-static NSTimer* pRunningTimer;
-static bool bDispatchTimer;
+bool IsTimerElapsed() const;
 };
 
 #endif // INCLUDED_VCL_INC_OSX_SALTIMER_H
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 89e3ae6d4e82..8af988a1de77 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -426,11 +426,13 @@ bool AquaSalInstance::IsMainThread() const
 
 void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent )
 {
+AquaSalTimer *pTimer = static_cast( 
ImplGetSVData()->maSchedCtx.mpSalTimer );
 int nSubtype = [pEvent subtype];
 switch( nSubtype )
 {
 case AppStartTimerEvent:
-AquaSalTimer::handleStartTimerEvent( pEvent );
+if ( pTimer )
+pTimer->handleStartTimerEvent( pEvent );
 break;
 case AppEndLoopEvent:
 [NSApp stop: NSApp];
@@ -450,7 +452,8 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* 
pEvent )
 break;
 }
 case DispatchTimerEvent:
-AquaSalTimer::handleDispatchTimerEvent();
+if ( pTimer )
+pTimer->handleDispatchTimerEvent( pEvent );
 break;
 #if !HAVE_FEATURE_MACOSX_SANDBOX
 case AppleRemoteControlEvent: // Defined in 

@@ -566,7 +569,7 @@ bool AquaSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 {
 // handle available events
 NSEvent* pEvent = nil;
-NSTimeInterval now = [[NSProcessInfo processInfo]systemUptime];
+NSTimeInterval now = [[NSProcessInfo processInfo] systemUptime];
 do
 {
 SolarMutexReleaser aReleaser;
@@ -598,12 +601,11 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 {
 SolarMutexReleaser aReleaser;
 
-NSDate* pDt = AquaSalTimer::pRunningTimer ? 
[AquaSalTimer::pRunningTimer fireDate] : [NSDate distantFuture];
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
 // 'NSAnyEventMask' is deprecated: first deprecated in macOS 10.12
 pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask
 SAL_WNODEPRECATED_DECLARATIONS_POP
-untilDate: pDt
+untilDate: [NSDate distantFuture]
 inMode: NSDefaultRunLoopMode
 dequeue: YES];
 if( pEvent )
@@ -682,14 +684,9 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
 
 if( nType & VclInputFlags::TIMER )
 {
-if( AquaSalTimer::pRunningTimer )
-{
-NSDate* pDt = [AquaSalTimer::pRunningTimer fireDate];
-if( pDt && [pDt timeIntervalSinceNow] < 0 )
-{
-return true;
-}
-}
+AquaSalTimer *pTimer = static_cast( 
ImplGetSVData()->maSchedCtx.mpSalTimer );
+if (pTimer && pTimer->IsTimerElapsed())
+return true;
 }
 
 unsigned/*NSUInteger*/ nEventMask = 0;
diff --git a/vcl/osx/salnstimer.mm b/vcl/osx/salnstimer.mm
index c9b657dcd776..9647bb6b87c1 100644
--- a/vcl/osx/salnstimer.mm
+++ b/vcl/osx/salnstimer.mm
@@ -27,16 +27,12 @@
 
 @implementation TimerCallbackCaller
 
--(void)timerElapsed:(NSTimer*)pTimer
+-(void)timerElapsed:(NSTimer*)pNSTimer
 {
-(void)pTimer;
-// nil the timer, as it is just invalidated after the firing function
-AquaSalTimer::pRunningTimer = nil;
-  

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/README.scheduler vcl/win

2017-09-27 Thread Jan-Marek Glogowski
 vcl/README.scheduler|8 
 vcl/inc/osx/salinst.h   |2 ++
 vcl/osx/salinst.cxx |   23 +--
 vcl/win/app/salinst.cxx |   28 +++-
 4 files changed, 34 insertions(+), 27 deletions(-)

New commits:
commit ce8bbb782b806e429ffb44226162967bed244d94
Author: Jan-Marek Glogowski 
Date:   Tue Aug 29 09:40:01 2017 +0200

Don't wait-yield non-main threads in the main thread

This prevents blocking the main thread by a yielding non-main thread.
The current solution is to wait on a condition, which is set by the
main thread on wakeup.

Change-Id: I8d680bb51a36ce1e0d3d4713d47d8e2ef93d7297
Reviewed-on: https://gerrit.libreoffice.org/42808
Tested-by: Jenkins 
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 7e0d6ca8b467..ac4a0dd698d4 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -122,6 +122,14 @@ basically the same we're doing with the LO scheduler as a 
system event.
 The gen X11 backend has some levels of redirection, but needs quite some work
 to get this fixed.
 
+== General: non-main thread yield ==
+
+Yielding from a non-main thread must not wait in the main thread, as this
+may block the main thread until some events happen.
+
+Currently we wait on an extra conditional, which is cleared by the main event
+loop.
+
 == MacOS implementation details ==
 
 Generally the Scheduler is handled as expected, except on resize, which is
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 65db0d0b0f2a..0e30dfafb693 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -72,6 +72,8 @@ class AquaSalInstance : public SalInstance
 {}
 };
 
+bool RunInMainYield( bool bHandleAllCurrentEvents );
+
 public:
 SalYieldMutex*  mpSalYieldMutex;// 
Sal-Yield-Mutex
 OUStringmaDefaultPrinter;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index e3e101cbc13e..f55e9b4aa297 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -525,6 +525,13 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* 
pEvent )
 };
 }
 
+bool AquaSalInstance::RunInMainYield( bool bHandleAllCurrentEvents )
+{
+OSX_SALDATA_RUNINMAIN_UNION( DoYield( false, bHandleAllCurrentEvents), 
boolean )
+assert( false && "Don't call this from the main thread!" );
+return false;
+
+}
 static bool isWakeupEvent( NSEvent *pEvent )
 {
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
@@ -645,13 +652,17 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 if ( bHadEvent )
 maWaitingYieldCond.set();
 }
-else if( bWait )
+else
 {
-// #i103162#
-// wait until the main thread has dispatched an event
-maWaitingYieldCond.reset();
-SolarMutexReleaser aReleaser;
-maWaitingYieldCond.wait();
+bHadEvent = RunInMainYield( bHandleAllCurrentEvents );
+if ( !bHadEvent && bWait )
+{
+// #i103162#
+// wait until the main thread has dispatched an event
+maWaitingYieldCond.reset();
+SolarMutexReleaser aReleaser;
+maWaitingYieldCond.wait();
+}
 }
 
 // we get some apple events way too early
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 23e48532d3b9..b77e84eac739 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -572,31 +572,16 @@ bool WinSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 SolarMutexReleaser aReleaser;
 if ( !IsMainThread() )
 {
-if ( bWait )
+// If you change the SendMessageW function, you might need to update
+// the PeekMessage( ... PM_QS_POSTMESSAGE) calls!
+bDidWork = SendMessageW( mhComWnd, SAL_MSG_THREADYIELD,
+ (WPARAM) false, (LPARAM) 
bHandleAllCurrentEvents );
+if ( !bDidWork && bWait )
 {
 maWaitingYieldCond.reset();
 maWaitingYieldCond.wait();
 bDidWork = true;
 }
-else {
-// #97739# A SendMessage call blocks until the called thread 
(here: the main thread)
-// returns. During a yield however, messages are processed in the 
main thread that might
-// result in a new message loop due to opening a dialog. Thus, 
SendMessage would not
-// return which will block this thread!
-// Solution: just give up the time slice and hope that messages 
are processed
-// by the main thread anyway (where all windows are created)
-// If the mainthread is not currently handling messages, then our 
SendMessage would
-// also do nothing, so this seems to be reasonable.
-
-// #i18883# only sleep if potential deadlock scenario, ie, when a 
dialog is open
-if( 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2017-09-21 Thread Tor Lillqvist
 vcl/inc/osx/runinmain.hxx |3 +++
 vcl/osx/salinst.cxx   |1 +
 2 files changed, 4 insertions(+)

New commits:
commit f28db2168700bd611a33deb3c9aeabb9a35e215c
Author: Tor Lillqvist 
Date:   Thu Sep 21 10:18:52 2017 +0300

WaE: -Wunused-variable

Change-Id: I6bcc39cd749f8cdbe550b94346c5cb8fd9f67097

diff --git a/vcl/inc/osx/runinmain.hxx b/vcl/inc/osx/runinmain.hxx
index e9ef9113d041..c971d3a25639 100644
--- a/vcl/inc/osx/runinmain.hxx
+++ b/vcl/inc/osx/runinmain.hxx
@@ -77,6 +77,7 @@ union RuninmainResult
 }); \
 aMutex->m_aInMainCondition.set(); \
 osl::Condition::Result res =  aMutex->m_aResultCondition.wait(); \
+(void) res; \
 assert(osl::Condition::Result::result_ok == res); \
 return; \
 }
@@ -96,6 +97,7 @@ union RuninmainResult
 }); \
 aMutex->m_aInMainCondition.set(); \
 osl::Condition::Result res =  aMutex->m_aResultCondition.wait(); \
+(void) res; \
 assert(osl::Condition::Result::result_ok == res); \
 return static_cast( aMutex->m_aResult.pointer ); \
 }
@@ -115,6 +117,7 @@ union RuninmainResult
 }); \
 aMutex->m_aInMainCondition.set(); \
 osl::Condition::Result res =  aMutex->m_aResultCondition.wait(); \
+(void) res; \
 assert(osl::Condition::Result::result_ok == res); \
 return std::move( aMutex->m_aResult.member ); \
 }
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index d33c0a33af25..54f6ffdd7021 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -292,6 +292,7 @@ void SalYieldMutex::doAcquire( sal_uInt32 nLockCount )
 break;
 // wait for doRelease() or RUNINMAIN_* to set the condition
 osl::Condition::Result res =  m_aInMainCondition.wait();
+(void) res;
 assert(osl::Condition::Result::result_ok == res);
 }
 while ( true );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2017-09-19 Thread Stephan Bergmann
 vcl/inc/osx/salinst.h |4 
 vcl/osx/salinst.cxx   |   10 --
 2 files changed, 14 deletions(-)

New commits:
commit 07fef83b20504890336fd146c558561dacf7e7e4
Author: Stephan Bergmann 
Date:   Tue Sep 19 11:43:23 2017 +0200

loplugin:unnecessaryoverride

Change-Id: I37c338fd08df3dc102963ccffc65c1f0684653be

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index ecff6207f5d7..f1598a4f1040 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -39,10 +39,6 @@ enum class SalEvent;
 
 class SalYieldMutex : public comphelper::GenericSolarMutex
 {
-protected:
-virtual voiddoAcquire( sal_uInt32 nLockCount ) override;
-virtual sal_uInt32  doRelease( bool bUnlockAll ) override;
-
 public:
 SalYieldMutex();
 virtual ~SalYieldMutex() override;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index aa274e8292f3..5e5415fef884 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -265,16 +265,6 @@ SalYieldMutex::~SalYieldMutex()
 {
 }
 
-void SalYieldMutex::doAcquire( sal_uInt32 nLockCount )
-{
-comphelper::GenericSolarMutex::doAcquire( nLockCount );
-}
-
-sal_uInt32 SalYieldMutex::doRelease( const bool bUnlockAll )
-{
-return comphelper::GenericSolarMutex::doRelease( bUnlockAll );
-}
-
 // some convenience functions regarding the yield mutex, aka solar mutex
 
 bool ImplSalYieldMutexTryToAcquire()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/README.scheduler

2017-08-22 Thread Jan-Marek Glogowski
 vcl/README.scheduler|   11 ---
 vcl/inc/osx/salinst.h   |1 +
 vcl/osx/salframeview.mm |   11 +++
 vcl/osx/salinst.cxx |1 +
 vcl/osx/salnstimer.mm   |8 +++-
 vcl/osx/saltimer.cxx|4 ++--
 6 files changed, 30 insertions(+), 6 deletions(-)

New commits:
commit 33b094a8949c34756c593bfad52450ec2b7daa54
Author: Jan-Marek Glogowski 
Date:   Tue Aug 15 08:23:31 2017 +0200

OSX fix updates during resize

While resizing MacOS suspends the NSDefaultRunLoopMode. So in this
caae we can't post to the system event loop, but must use timers
to restart ourself.

Since the timer itself is scheduled on the NSEventTrackingRunLoopMode
it' also triggers on resize events.

There is still some minor glitch: when resizing too fast some part of
LibreOffice isn't painted, while the left mouse button is down.

Since there isn't any layouting triggered by the mouse up, there has
to be an other inconsistency.

Change-Id: I3ccba78bd23ec8526f21e7b93b027f3d3279f901

diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 4c0f4c57981a..0251ab88fcab 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -91,9 +91,14 @@ can be added to the scheduler reasonably.
 
 == MacOS implementation details ==
 
-Generally the Scheduler is handled as expected. There is a workaround for a
-problem for pushing tasks to an empty queue, as [NSApp postEvent: ...
-atStart: NO] doesn't append the event, if the message queue is empty.
+Generally the Scheduler is handled as expected, except on resize, which is
+handled with different runloop-modes in MacOS. In case of a resize, the normal
+runloop is suspended in sendEvent, so we can't call the scheduler via posted
+main loop-events. Instead the schedule the timer again.
+
+There is also a workaround for a problem for pushing tasks to an empty queue,
+as [NSApp postEvent: ... atStart: NO] doesn't append the event, if the
+message queue is empty.
 
 Probably that's the reason, why some code comments spoke of lost events and
 there was some distinct additional event processing implemented.
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 8468dbd8dd59..bd02608d4d45 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -74,6 +74,7 @@ public:
 std::list< SalUserEvent >   maUserEvents;
 osl::Mutex  maUserEventListMutex;
 osl::Condition  maWaitingYieldCond;
+boolmbIsLiveResize;
 
 static std::list aAppEventList;
 
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index e290891ce294..a20f3b7a6e5a 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -533,6 +533,17 @@ private:
 
 -(void)drawRect: (NSRect)aRect
 {
+if( GetSalData()->mpFirstInstance )
+{
+const bool bIsLiveResize = [self inLiveResize];
+const bool bWasLiveResize = 
GetSalData()->mpFirstInstance->mbIsLiveResize;
+if ( bWasLiveResize != bIsLiveResize )
+{
+GetSalData()->mpFirstInstance->mbIsLiveResize = bIsLiveResize;
+Scheduler::ProcessTaskScheduling();
+}
+}
+
 // HOTFIX: #i93512# prevent deadlocks if any other thread already has the 
SalYieldMutex
 TryGuard aTryGuard;
 if( !aTryGuard.IsGuarded() )
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 54e04dad76ca..e16e73945c2d 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -347,6 +347,7 @@ void DestroySalInstance( SalInstance* pInst )
 AquaSalInstance::AquaSalInstance()
  : maUserEventListMutex()
  , maWaitingYieldCond()
+ , mbIsLiveResize( false )
 {
 mpSalYieldMutex = new SalYieldMutex;
 mpSalYieldMutex->acquire();
diff --git a/vcl/osx/salnstimer.mm b/vcl/osx/salnstimer.mm
index c9867cf7a79e..c9b657dcd776 100644
--- a/vcl/osx/salnstimer.mm
+++ b/vcl/osx/salnstimer.mm
@@ -30,7 +30,13 @@
 -(void)timerElapsed:(NSTimer*)pTimer
 {
 (void)pTimer;
-ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent, YES );
+// nil the timer, as it is just invalidated after the firing function
+AquaSalTimer::pRunningTimer = nil;
+const AquaSalInstance *pInst = GetSalData()->mpFirstInstance;
+if (pInst->mbIsLiveResize)
+AquaSalTimer::handleDispatchTimerEvent();
+else
+ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent, YES );
 }
 
 @end
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 3cf74529a301..e442fcf05335 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -83,7 +83,7 @@ static void ImplSalStartTimer( sal_uLong nMS )
 return;
 }
 
-if ( 0 == nMS )
+if ( 0 == nMS && !pSalData->mpFirstInstance->mbIsLiveResize )
 {
 ImplSalStopTimer();
 ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent, NO );
@@ -93,7 +93,7 @@ static void ImplSalStartTimer( sal_uLong nMS )
 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2016-09-14 Thread Stephan Bergmann
 vcl/inc/osx/a11ylistener.hxx  |2 +-
 vcl/inc/osx/salframe.h|2 +-
 vcl/inc/osx/salinst.h |2 +-
 vcl/inc/osx/salmenu.h |4 ++--
 vcl/inc/osx/salobj.h  |2 +-
 vcl/inc/osx/salprn.h  |4 ++--
 vcl/inc/osx/salsys.h  |2 +-
 vcl/inc/osx/saltimer.h|2 +-
 vcl/inc/quartz/salbmp.h   |2 +-
 vcl/inc/quartz/salgdi.h   |4 ++--
 vcl/inc/quartz/salvd.h|2 +-
 vcl/osx/DataFlavorMapping.cxx |2 +-
 vcl/osx/DragSource.hxx|2 +-
 vcl/osx/DragSourceContext.hxx |2 +-
 vcl/osx/DropTarget.hxx|2 +-
 vcl/osx/OSXTransferable.hxx   |2 +-
 vcl/osx/a11yfocuslistener.hxx |2 +-
 vcl/osx/clipboard.hxx |2 +-
 vcl/quartz/ctlayout.cxx   |2 +-
 19 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit bd132e558df9e1cfe48beb7a67f9237ed78465c5
Author: Stephan Bergmann 
Date:   Wed Sep 14 12:53:30 2016 +0200

loplugin:override

Change-Id: Ica137897f02c5caa4c4891f75531ada3957025d9

diff --git a/vcl/inc/osx/a11ylistener.hxx b/vcl/inc/osx/a11ylistener.hxx
index 525446c..353b642 100644
--- a/vcl/inc/osx/a11ylistener.hxx
+++ b/vcl/inc/osx/a11ylistener.hxx
@@ -35,7 +35,7 @@ class AquaA11yEventListener :
 
 public:
 AquaA11yEventListener(id wrapperObject, sal_Int16 role);
-virtual ~AquaA11yEventListener();
+virtual ~AquaA11yEventListener() override;
 
 // XEventListener
 virtual void SAL_CALL disposing( const css::lang::EventObject& Source )
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 81e1614..94afaf3 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -103,7 +103,7 @@ public:
 */
 AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle );
 
-virtual ~AquaSalFrame();
+virtual ~AquaSalFrame() override;
 
 virtual SalGraphics*AcquireGraphics() override;
 virtual voidReleaseGraphics( SalGraphics* pGraphics ) 
override;
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index fbc4319..b56b8df 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -79,7 +79,7 @@ public:
 
 public:
 AquaSalInstance();
-virtual ~AquaSalInstance();
+virtual ~AquaSalInstance() override;
 
 virtual SalFrame*   CreateChildFrame( SystemParentData* pParent, 
SalFrameStyleFlags nStyle ) override;
 virtual SalFrame*   CreateFrame( SalFrame* pParent, SalFrameStyleFlags 
nStyle ) override;
diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index f4407f3..f21c750 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -53,7 +53,7 @@ private:
 static void statusLayout();
 public:
 AquaSalMenu( bool bMenuBar );
-virtual ~AquaSalMenu();
+virtual ~AquaSalMenu() override;
 
 virtual bool VisibleMenuBar() override;
 // must return true to actually display native menu bars
@@ -100,7 +100,7 @@ class AquaSalMenuItem : public SalMenuItem
 {
 public:
 AquaSalMenuItem( const SalItemParams* );
-virtual ~AquaSalMenuItem();
+virtual ~AquaSalMenuItem() override;
 
 sal_uInt16  mnId; // Item ID
 VclPtrmpVCLMenu;// VCL Menu into which this 
MenuItem is inserted
diff --git a/vcl/inc/osx/salobj.h b/vcl/inc/osx/salobj.h
index 19a0090..c5d4465 100644
--- a/vcl/inc/osx/salobj.h
+++ b/vcl/inc/osx/salobj.h
@@ -52,7 +52,7 @@ public:
 void setClippedPosSize();
 
 AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWinData );
-virtual ~AquaSalObject();
+virtual ~AquaSalObject() override;
 
 virtual voidResetClipRegion() override;
 virtual voidBeginSetClipRegion( sal_uLong nRects ) 
override;
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index bfedb08..f47a32b 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -62,7 +62,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 
 public:
 AquaSalInfoPrinter( const SalPrinterQueueInfo& pInfo );
-virtual ~AquaSalInfoPrinter();
+virtual ~AquaSalInfoPrinter() override;
 
 voidSetupPrinterGraphics( CGContextRef i_xContext 
) const;
 
@@ -117,7 +117,7 @@ class AquaSalPrinter : public SalPrinter
 AquaSalInfoPrinter* mpInfoPrinter;  // pointer to the 
compatible InfoPrinter
 public:
 AquaSalPrinter( AquaSalInfoPrinter* i_pInfoPrinter );
-virtual ~AquaSalPrinter();
+virtual ~AquaSalPrinter() override;
 
 virtual boolStartJob( const OUString* i_pFileName,
   const OUString& i_rJobName,
diff --git a/vcl/inc/osx/salsys.h b/vcl/inc/osx/salsys.h
index b667b31..e1b18f9 100644
--- a/vcl/inc/osx/salsys.h
+++ b/vcl/inc/osx/salsys.h
@@ -29,7 +29,7 @@ class VCL_DLLPUBLIC AquaSalSystem : public SalSystem
 {
 public:
 AquaSalSystem() {}
-virtual ~AquaSalSystem();
+

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2016-06-28 Thread Stephan Bergmann
 vcl/inc/osx/salmenu.h |4 ++--
 vcl/osx/salmenu.cxx   |1 -
 vcl/osx/salnsmenu.mm  |2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit c63ae748b301db1f4996b43f6faf4bb317c37467
Author: Stephan Bergmann 
Date:   Tue Jun 28 14:48:29 2016 +0200

Adapt OS-X--only code to aa0d0536a444fb26d9e570bd6bf6c1bdc3596cf3

..."tdf#97527 - vcl: reference-count Menu"

Change-Id: I47457205ae99025d2ca13965dcf2fac79962124a

diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index ad1b29e..f4407f3 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -88,7 +88,7 @@ public:
 
 boolmbMenuBar;  // true - Menubar, false - Menu
 NSMenu* mpMenu; // The Carbon reference to 
this menu
-Menu*   mpVCLMenu;  // the corresponding vcl Menu 
object
+VclPtrmpVCLMenu;  // the corresponding vcl Menu 
object
 const AquaSalFrame* mpFrame;// the frame to dispatch the 
menu events to
 AquaSalMenu*mpParentSalMenu;// the parent menu that 
contains us (and perhaps has a frame)
 
@@ -103,7 +103,7 @@ public:
 virtual ~AquaSalMenuItem();
 
 sal_uInt16  mnId; // Item ID
-Menu*   mpVCLMenu;// VCL Menu into which this 
MenuItem is inserted
+VclPtrmpVCLMenu;// VCL Menu into which this 
MenuItem is inserted
 AquaSalMenu*mpParentMenu; // The menu in which this menu 
item is inserted
 AquaSalMenu*mpSubMenu;// Sub menu of this item (if 
defined)
 NSMenuItem* mpMenuItem;   // The NSMenuItem
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index b9d8e69..3c2a476 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -257,7 +257,6 @@ void AquaSalInstance::DestroyMenuItem( SalMenuItem* 
pSalMenuItem )
 AquaSalMenu::AquaSalMenu( bool bMenuBar ) :
 mbMenuBar( bMenuBar ),
 mpMenu( nil ),
-mpVCLMenu( nullptr ),
 mpFrame( nullptr ),
 mpParentSalMenu( nullptr )
 {
diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm
index b30792d..cd22b78 100644
--- a/vcl/osx/salnsmenu.mm
+++ b/vcl/osx/salnsmenu.mm
@@ -125,7 +125,7 @@
 // if an item from submenu was selected. the corresponding Window does 
not exist because
 // we use native popup menus, so we have to set the selected menuitem 
directly
 // incidentally this of course works for top level popup menus, too
-PopupMenu * pPopupMenu = dynamic_cast(mpMenuItem->mpVCLMenu);
+PopupMenu * pPopupMenu = dynamic_cast(mpMenuItem->mpVCLMenu.get());
 if( pPopupMenu )
 {
 // FIXME: revise this ugly code
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source vcl/unx vcl/win

2016-06-26 Thread Noel Grandin
 vcl/inc/fontattributes.hxx   |2 --
 vcl/inc/salwtype.hxx |2 --
 vcl/inc/unx/gtk/gtkframe.hxx |2 --
 vcl/inc/unx/printergfx.hxx   |6 +-
 vcl/inc/unx/saldata.hxx  |1 -
 vcl/inc/unx/salframe.h   |3 ---
 vcl/inc/unx/wmadaptor.hxx|8 
 vcl/inc/window.h |3 ---
 vcl/osx/salframeview.mm  |6 --
 vcl/source/edit/vclmedit.cxx |5 -
 vcl/source/filter/wmf/winmtf.hxx |1 -
 vcl/source/filter/wmf/winwmf.cxx |2 --
 vcl/source/font/fontattributes.cxx   |2 --
 vcl/source/fontsubset/cff.cxx|   24 
 vcl/source/gdi/pdfwriter_impl.cxx|   32 
 vcl/source/gdi/pdfwriter_impl.hxx|7 +--
 vcl/source/outdev/font.cxx   |4 ++--
 vcl/source/window/menubarwindow.cxx  |   34 ++
 vcl/source/window/menubarwindow.hxx  |1 -
 vcl/source/window/settings.cxx   |4 ++--
 vcl/source/window/window.cxx |   11 ---
 vcl/unx/generic/app/i18n_cb.cxx  |2 --
 vcl/unx/generic/app/i18n_ic.cxx  |6 --
 vcl/unx/generic/app/saldata.cxx  |1 -
 vcl/unx/generic/app/wmadaptor.cxx|3 ---
 vcl/unx/generic/print/bitmap_gfx.cxx |   22 +++---
 vcl/unx/generic/print/common_gfx.cxx |3 ---
 vcl/unx/generic/print/text_gfx.cxx   |2 +-
 vcl/unx/generic/window/salframe.cxx  |   24 ++--
 vcl/unx/gtk/gtksalframe.cxx  |   19 ++-
 vcl/unx/gtk/salnativewidgets-gtk.cxx |4 
 vcl/unx/gtk3/gtk3gtkframe.cxx|7 ---
 vcl/win/window/salframe.cxx  |4 
 33 files changed, 36 insertions(+), 221 deletions(-)

New commits:
commit 1ac18c60bb280855cfcc8d92886709cd6db35118
Author: Noel Grandin 
Date:   Thu Jun 23 14:10:31 2016 +0200

loplugin:singlevalfields in vcl(part2)

Change-Id: I4782c6f6d3d090ba0f9e29af8afdd7d88aa2d382
Reviewed-on: https://gerrit.libreoffice.org/26598
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx
index faca6a8..fcd2fa8 100644
--- a/vcl/inc/fontattributes.hxx
+++ b/vcl/inc/fontattributes.hxx
@@ -42,7 +42,6 @@ public:
 FontItalic  GetItalic() const   { return 
meItalic; }
 FontPitch   GetPitch() const{ return 
mePitch; }
 FontWidth   GetWidthType() const{ return 
meWidthType; }
-TextAlign   GetAlignment() const{ return 
meAlign; }
 rtl_TextEncodingGetCharSet() const  { return 
meCharSet; }
 
 boolIsSymbolFont() const{ return 
mbSymbolFlag; }
@@ -86,7 +85,6 @@ private:
 FontPitch   mePitch;// Pitch Type
 FontWidth   meWidthType;// Width Type
 FontItalic  meItalic;   // Slant Type
-TextAlign   meAlign;// Text alignment
 rtl_TextEncodingmeCharSet;  // RTL_TEXTENCODING_SYMBOL 
or RTL_TEXTENCODING_UNICODE
 boolmbSymbolFlag;   // Is font a symbol?
 
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 2a45616..75fae73 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -161,12 +161,10 @@ struct SalWheelMouseEvent
 
 struct SalExtTextInputEvent
 {
-sal_uInt64  mnTime; // Time in ms, when event is created
 OUStringmaText; // Text
 const ExtTextInputAttr* mpTextAttr; // Text-Attribute
 sal_Int32   mnCursorPos;// Cursor-Position
 sal_uInt8   mnCursorFlags;  // EXTTEXTINPUT_CURSOR_xxx
-boolmbOnlyCursor;   // true: Only Cursor-Position has been 
changed
 };
 
 struct SalExtTextInputPosEvent
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index ff5c454..30c0743 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -180,7 +180,6 @@ class GtkSalFrame : public SalFrame
 GdkNativeWindow m_aForeignParentWindow;
 GdkWindow*  m_pForeignTopLevel;
 GdkNativeWindow m_aForeignTopLevelWindow;
-Pixmap  m_hBackgroundPixmap;
 SalFrameStyleFlags  m_nStyle;
 SalExtStyle m_nExtStyle;
 GtkSalFrame*m_pParent;
@@ -381,7 +380,6 @@ public:
 GdkNativeWindow getForeignParentWindow() const { return 
m_aForeignParentWindow; }
 GdkWindow*  getForeignTopLevel() const { return m_pForeignTopLevel; }
 GdkNativeWindow getForeignTopLevelWindow() const { return 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2016-06-02 Thread Stephan Bergmann
 vcl/inc/osx/a11yfocustracker.hxx |6 +-
 vcl/osx/a11yfactory.mm   |2 +-
 vcl/osx/a11yfocuslistener.cxx|2 +-
 vcl/osx/a11ylistener.cxx |2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 1ac1b375ee3e6359d1519ac94f3ad9e69009859c
Author: Stephan Bergmann 
Date:   Fri Jun 3 07:50:46 2016 +0200

Follow-up fix (odd missing ~TheAquaA11yFocusTracker error)

Change-Id: I18501185f52ab4e90d16313cba299b7501106db3

diff --git a/vcl/inc/osx/a11yfocustracker.hxx b/vcl/inc/osx/a11yfocustracker.hxx
index b8872f3..9852b51 100644
--- a/vcl/inc/osx/a11yfocustracker.hxx
+++ b/vcl/inc/osx/a11yfocustracker.hxx
@@ -35,7 +35,7 @@ class ToolBox;
 class DocumentFocusListener;
 
 
-class AquaA11yFocusTracker : public rtl::Static< AquaA11yFocusTracker, 
AquaA11yFocusTracker>
+class AquaA11yFocusTracker
 {
 
 public:
@@ -94,6 +94,10 @@ private:
 const rtl::Reference< DocumentFocusListener > m_xDocumentFocusListener;
 };
 
+struct TheAquaA11yFocusTracker:
+rtl::Static
+{};
+
 #endif // INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/a11yfactory.mm b/vcl/osx/a11yfactory.mm
index 79ddf64..e9ce490 100644
--- a/vcl/osx/a11yfactory.mm
+++ b/vcl/osx/a11yfactory.mm
@@ -59,7 +59,7 @@ static bool enabled = false;
 mdAllWrapper = [ [ [ NSMutableDictionary alloc ] init ] retain ];
 // initialize keyboard focus tracker
 rtl::Reference< AquaA11yFocusListener > listener( 
AquaA11yFocusListener::get() );
-AquaA11yFocusTracker::get().setFocusListener(listener.get());
+TheAquaA11yFocusTracker::get().setFocusListener(listener.get());
 enabled = true;  
 }
 return mdAllWrapper;
diff --git a/vcl/osx/a11yfocuslistener.cxx b/vcl/osx/a11yfocuslistener.cxx
index ea593f2..da4e410 100644
--- a/vcl/osx/a11yfocuslistener.cxx
+++ b/vcl/osx/a11yfocuslistener.cxx
@@ -42,7 +42,7 @@ AquaA11yFocusListener::AquaA11yFocusListener() : 
m_focusedObject(nil)
 id AquaA11yFocusListener::getFocusedUIElement()
 {
 if ( nil == m_focusedObject ) {
-Reference< XAccessible > xAccessible( 
AquaA11yFocusTracker::get().getFocusedObject() );
+Reference< XAccessible > xAccessible( 
TheAquaA11yFocusTracker::get().getFocusedObject() );
 try {
 if( xAccessible.is() ) {
 Reference< XAccessibleContext > 
xContext(xAccessible->getAccessibleContext());
diff --git a/vcl/osx/a11ylistener.cxx b/vcl/osx/a11ylistener.cxx
index aeefaf6..1d56c1f 100644
--- a/vcl/osx/a11ylistener.cxx
+++ b/vcl/osx/a11ylistener.cxx
@@ -80,7 +80,7 @@ AquaA11yEventListener::notifyEvent( const 
AccessibleEventObject& aEvent ) throw(
 if( m_role != AccessibleRole::LIST ) {
 Reference< XAccessible > xAccessible;
 if( aEvent.NewValue >>= xAccessible )
-AquaA11yFocusTracker::get().setFocusedObject( xAccessible 
);
+TheAquaA11yFocusTracker::get().setFocusedObject( 
xAccessible );
 }
 break;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2016-06-02 Thread Stephan Bergmann
 vcl/inc/osx/a11yfocustracker.hxx |4 +++-
 vcl/osx/a11yfocustracker.cxx |2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 64e83932264f0d708e4ce2dce9b36a933afd2fbf
Author: Stephan Bergmann 
Date:   Fri Jun 3 07:32:06 2016 +0200

loplugin:refcounting

Change-Id: Ia7bd500728e122f1f4c7ff4c020cc067e72613ca

diff --git a/vcl/inc/osx/a11yfocustracker.hxx b/vcl/inc/osx/a11yfocustracker.hxx
index bd7a520..b8872f3 100644
--- a/vcl/inc/osx/a11yfocustracker.hxx
+++ b/vcl/inc/osx/a11yfocustracker.hxx
@@ -41,6 +41,8 @@ class AquaA11yFocusTracker : public rtl::Static< 
AquaA11yFocusTracker, AquaA11yF
 public:
 AquaA11yFocusTracker();
 
+~AquaA11yFocusTracker();
+
 css::uno::Reference< css::accessibility::XAccessible > const & 
getFocusedObject() { return m_xFocusedObject; };
 
 // sets the currently focus object and notifies the FocusEventListener (if 
any)
@@ -89,7 +91,7 @@ private:
 Link m_aWindowEventLink;
 
 // the UNO XAccessibilityEventListener for Documents and other non VCL 
objects
-const css::uno::Reference< DocumentFocusListener > 
m_xDocumentFocusListener;
+const rtl::Reference< DocumentFocusListener > m_xDocumentFocusListener;
 };
 
 #endif // INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
diff --git a/vcl/osx/a11yfocustracker.cxx b/vcl/osx/a11yfocustracker.cxx
index 6f9441d..1389ae3 100644
--- a/vcl/osx/a11yfocustracker.cxx
+++ b/vcl/osx/a11yfocustracker.cxx
@@ -96,6 +96,8 @@ AquaA11yFocusTracker::AquaA11yFocusTracker() :
 window_got_focus(Application::GetFocusWindow());
 }
 
+AquaA11yFocusTracker::~AquaA11yFocusTracker() {}
+
 void AquaA11yFocusTracker::setFocusedObject(const Reference< XAccessible >& 
xAccessible)
 {
 if( xAccessible != m_xFocusedObject )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/win

2016-05-10 Thread Noel Grandin
 vcl/inc/osx/salframeview.h  |4 +++-
 vcl/inc/osx/salinst.h   |2 +-
 vcl/osx/salframe.cxx|4 ++--
 vcl/osx/salframeview.mm |2 +-
 vcl/osx/salinst.cxx |2 +-
 vcl/win/window/salframe.cxx |2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit f6fb8a152797de4c5339b2fa5a3adf0e2ee0c349
Author: Noel Grandin 
Date:   Tue May 10 12:16:45 2016 +0200

fix OSX and Windows builds

after my "Convert SALEVENT to scoped enum" commit

Change-Id: Ib4a3f0e18fa5d8160446d5b5cd505bae651da7d5

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index bb922b8..0d32266 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -22,6 +22,8 @@
 
 #include "osx/a11ywrapper.h"
 
+enum class SalEvent;
+
 @interface SalFrameWindow : NSWindow
 {
 AquaSalFrame*   mpFrame;
@@ -103,7 +105,7 @@
 -(void)swipeWithEvent: (NSEvent*)pEvent;
 -(void)keyDown: (NSEvent*)pEvent;
 -(void)flagsChanged: (NSEvent*)pEvent;
--(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(sal_uInt16)nEvent;
+-(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(SalEvent)nEvent;
 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: 
(sal_Unicode)aChar;
 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: 
(sal_Unicode)aChar modifiers: (unsigned int)nMod;
 -(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: 
(sal_Unicode)aChar modifiers: (unsigned int)nMod;
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 82bdfde..20f3e3e 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -141,7 +141,7 @@ public:
  public:
 friend class AquaSalFrame;
 
-void PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData );
+void PostUserEvent( AquaSalFrame* pFrame, SalEvent nType, void* pData );
 void delayedSettingsChanged( bool bInvalidate );
 
 bool isNSAppThread() const;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index a084520..a1498c5 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1245,7 +1245,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long 
nWidth, long nHeight, sal_u
 // #i113170# may not be the main thread if called from UNO API
 SalData::ensureThreadAutoreleasePool();
 
-sal_uInt16 nEvent = 0;
+SalEvent nEvent = SalEvent::NONE;
 
 if( [mpNSWindow isMiniaturized] )
 [mpNSWindow deminiaturize: NSApp]; // expand the window
@@ -1314,7 +1314,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long 
nWidth, long nHeight, sal_u
 
 UpdateFrameGeometry();
 
-if (nEvent)
+if (nEvent != SalEvent::NONE)
 CallCallback(nEvent, nullptr);
 
 if( mbShown && bPaint )
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 246ca40..6906f9b 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -549,7 +549,7 @@ private:
 }
 }
 
--(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(sal_uInt16)nEvent
+-(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(SalEvent)nEvent
 {
 SolarMutexGuard aGuard;
 
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 2d57b4a..10e3f2f 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -387,7 +387,7 @@ void AquaSalInstance::wakeupYield()
 }
 }
 
-void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, 
void* pData )
+void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, SalEvent nType, 
void* pData )
 {
 {
 osl::MutexGuard g( maUserEventListMutex );
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 47aa4dd..2f057d3 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1434,7 +1434,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long 
nWidth, long nHeight,
 UpdateFrameGeometry( mhWnd, this );
 
 // Notification -- really ???
-if( nEvent )
+if( nEvent != SalEvent::NONE )
 CallCallback( nEvent, NULL );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2016-03-29 Thread Michael Stahl
 vcl/inc/osx/salprn.h |5 ++---
 vcl/osx/salprn.cxx   |   12 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 4b039f27a2fe85a76ac8ccbf882fe9aff6870b4c
Author: Michael Stahl 
Date:   Thu Mar 24 23:04:42 2016 +0100

vcl: replace boost::shared_array with std::shared_ptr

The boost::bind here looks totally pointless too.

No idea why this uses rtl_allocateMemory, let's keep that.

Change-Id: If51ba9837a318f11094ee39225233212a848a955
Reviewed-on: https://gerrit.libreoffice.org/23502
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index 363c137..bfedb08 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -24,8 +24,7 @@
 
 #include "salprn.hxx"
 
-#include 
-
+#include 
 
 class AquaSalGraphics;
 
@@ -48,7 +47,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 /// graphics context for Quartz 2D
 CGContextRefmrContext;
 /// memory for graphics bitmap context for querying metrics
-boost::shared_array< sal_uInt8 >maContextMemory;
+std::shared_ptr mpContextMemory;
 
 // since changes to NSPrintInfo during a job are ignored
 // we have to care for some settings ourselves
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 3ec8631..af51e05 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
-
 #include "officecfg/Office/Common.hxx"
 
 #include 
@@ -78,12 +76,14 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const 
SalPrinterQueueInfo& i_rQueue ) :
 mpGraphics = new AquaSalGraphics();
 
 const int nWidth = 100, nHeight = 100;
-maContextMemory.reset( static_cast( rtl_allocateMemory( nWidth 
* 4 * nHeight ) ),
-   boost::bind( rtl_freeMemory, _1 ) );
+mpContextMemory.reset(static_cast(rtl_allocateMemory(nWidth * 
4 * nHeight)),
+  _freeMemory);
 
-if( maContextMemory )
+if (mpContextMemory)
 {
-mrContext = CGBitmapContextCreate( maContextMemory.get(), nWidth, 
nHeight, 8, nWidth * 4, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst );
+mrContext = CGBitmapContextCreate(mpContextMemory.get(),
+nWidth, nHeight, 8, nWidth * 4,
+GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst);
 if( mrContext )
 SetupPrinterGraphics( mrContext );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2016-01-26 Thread Matteo Casalin
 vcl/inc/osx/salprn.h |2 +-
 vcl/osx/salprn.cxx   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fc388c1ff4ba005bbf784a083825f2070e66325e
Author: Matteo Casalin 
Date:   Tue Jan 26 22:13:40 2016 +0100

Blind fix for OSX

Change-Id: Ieafe8df5d67299615e279151b29744ddd180

diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index afb0cb7..94340f3 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -125,7 +125,7 @@ class AquaSalPrinter : public SalPrinter
 virtual boolStartJob( const OUString* i_pFileName,
   const OUString& i_rJobName,
   const OUString& i_rAppName,
-  sal_uLong i_nCopies,
+  sal_uInt32 i_nCopies,
   bool i_bCollate,
   bool i_bDirect,
   ImplJobSetup* i_pSetupData ) 
override;
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index ca9bec2..54e3e8f 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -590,7 +590,7 @@ bool AquaSalPrinter::StartJob( const OUString* i_pFileName,
 bool AquaSalPrinter::StartJob( const OUString* /*i_pFileName*/,
const OUString& /*i_rJobName*/,
const OUString& /*i_rAppName*/,
-   sal_uLong /*i_nCopies*/,
+   sal_uInt32 /*i_nCopies*/,
bool /*i_bCollate*/,
bool /*i_bDirect*/,
ImplJobSetup* )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2016-01-21 Thread Douglas Mencken
 vcl/inc/osx/salinst.h |3 +++
 vcl/osx/salinst.cxx   |   17 +
 2 files changed, 20 insertions(+)

New commits:
commit ee27dae3b5df1e3fc63ecb2ee2c2d123fd4c8cff
Author: Douglas Mencken 
Date:   Mon Jan 18 01:11:18 2016 -0500

tdf#96407 Provide OS X version info for About box

since commits 56a9594649872f4076b6891f & 52856b6ea7b6b01e8a8455ed
the about box now includes information about a version of operating system

Change-Id: Iaf28b555ec1eb3dfe8c6e9b9567fa0dda18741db
Reviewed-on: https://gerrit.libreoffice.org/21564
Tested-by: Jenkins 
Reviewed-by: Chris Sherlock 

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 5c65241..4a6d12f 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -1,3 +1,4 @@
+
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
@@ -120,6 +121,8 @@ public:
 virtual voidAddToRecentDocumentList(const OUString& rFileUrl, 
const OUString& rMimeType,
 const OUString& 
rDocumentService) override;
 
+virtual OUStringgetOSVersion() override;
+
 // dtrans implementation
 virtual css::uno::Reference< css::uno::XInterface > CreateClipboard(
 const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 153998a..41ad480 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -976,6 +976,23 @@ SalSession* AquaSalInstance::CreateSalSession()
 return nullptr;
 }
 
+OUString AquaSalInstance::getOSVersion()
+{
+NSString * versionString = nullptr;
+NSString * sysVersionDictionaryPath = 
@"/System/Library/CoreServices/SystemVersion.plist";
+NSDictionary * sysVersionDict = [ NSDictionary 
dictionaryWithContentsOfFile: sysVersionDictionaryPath ];
+if ( sysVersionDict )
+versionString = [ sysVersionDict valueForKey: @"ProductVersion" ];
+
+OUString aVersion = "Mac OS X ";
+if ( versionString )
+aVersion += OUString::fromUtf8( [ versionString UTF8String ] );
+else
+aVersion += "(unknown)";
+
+return aVersion;
+}
+
 class MacImeStatus : public SalI18NImeStatus
 {
 public:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2016-01-11 Thread Maxim Monastirsky
 vcl/inc/osx/salnsmenu.h |8 
 vcl/osx/salmenu.cxx |   42 +-
 vcl/osx/salnsmenu.mm|   15 +++
 3 files changed, 16 insertions(+), 49 deletions(-)

New commits:
commit cbd483211e1ac9d9e724b5ba3e3e38a0c5abe55c
Author: Maxim Monastirsky 
Date:   Mon Jan 11 18:17:49 2016 +0200

tdf#96875 Make OS X native context menus compatible

... with how framework::MenuBarManager works, following my
work of converting context menus to use it instead of
SfxPopupMenuManager (see tdf#93837).

MenuBarManager sets menu item properties/select handler
when the menu activates - in MenuBarManager::Activate, but
it was never called for submenus. The solution is to adapt
the menuNeedsUpdate delegate to call Menu::Activate.

This makes submenu items work, but doesn't update their
visual state (e.g. title). The reason is that
AquaSalMenu::ShowNativePopupMenu is creating a copy of the
NSMenu, so AquaSalMenu::SetItemText is modifying the wrong
NSMenu instance.

Another problem is that AquaSalMenu::ShowNativePopupMenu
tries to removes (via removeUnusedItemsRunner function)
all disabled items, but the correct state is set by
MenuBarManager only when the menu activates. So we must
handle disabled items only after MenuBarManager::Activate
did its job.

Turns out that we can just hide items in NSMenu instead
of removing them, so no need to clone the NSMenu anymore.

Change-Id: If0785b7f9d5f0ad98ced23585379039a51dc13bf
Reviewed-on: https://gerrit.libreoffice.org/21374
Reviewed-by: Maxim Monastirsky 
Tested-by: Maxim Monastirsky 

diff --git a/vcl/inc/osx/salnsmenu.h b/vcl/inc/osx/salnsmenu.h
index 47c410b..f815c14 100644
--- a/vcl/inc/osx/salnsmenu.h
+++ b/vcl/inc/osx/salnsmenu.h
@@ -33,10 +33,6 @@ class AquaSalMenuItem;
 
 @interface SalNSMenu : NSMenu
 {
-/* Caution: SalNSMenu instances occasionally are binary copied
-   in AquaSalMenu::ShowNativePopupMenu. If any members are added,
-   please take this into account !
-*/
 AquaSalMenu*mpMenu;
 }
 -(id)initWithMenu: (AquaSalMenu*)pMenu;
@@ -46,10 +42,6 @@ class AquaSalMenuItem;
 
 @interface SalNSMenuItem : NSMenuItem
 {
-/* Caution: SalNSMenuItem instances occasionally are binary copied
-   in AquaSalMenu::ShowNativePopupMenu. If any members are added,
-   please take this into account !
-*/
 AquaSalMenuItem*mpMenuItem;
 }
 -(id)initWithMenuItem: (AquaSalMenuItem*)pMenuItem;
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 5119d6c..91a5c2e 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -317,37 +317,6 @@ AquaSalMenu::~AquaSalMenu()
 }
 }
 
-sal_Int32 removeUnusedItemsRunner(NSMenu * pMenu)
-{
-NSArray * elements = [pMenu itemArray];
-NSEnumerator * it = [elements objectEnumerator];
-id elem;
-NSMenuItem * lastDisplayedMenuItem = nil;
-sal_Int32 drawnItems = 0;
-bool firstEnabledItemIsNoSeparator = false;
-while((elem=[it nextObject]) != nil) {
-NSMenuItem * item = static_cast(elem);
-if( (![item isEnabled] && ![item isSeparatorItem]) || ([item 
isSeparatorItem] && (lastDisplayedMenuItem != nil && [lastDisplayedMenuItem 
isSeparatorItem])) ) {
-[[item menu]removeItem:item];
-} else {
-if( ! firstEnabledItemIsNoSeparator && [item isSeparatorItem] ) {
-[[item menu]removeItem:item];
-} else {
-firstEnabledItemIsNoSeparator = true;
-lastDisplayedMenuItem = item;
-drawnItems++;
-if( [item hasSubmenu] ) {
-removeUnusedItemsRunner( [item submenu] );
-}
-}
-}
-}
-if( lastDisplayedMenuItem != nil && [lastDisplayedMenuItem 
isSeparatorItem]) {
-[[lastDisplayedMenuItem menu]removeItem:lastDisplayedMenuItem];
-}
-return drawnItems;
-}
-
 bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& 
rRect, FloatWinPopupFlags nFlags)
 {
 // do not use native popup menu when AQUA_NATIVE_MENUS is set to false
@@ -365,13 +334,6 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * 
pWin, const Rectangle& rR
 NSView* pPopupNSView = static_cast(pWin->ImplGetWindow()->ImplGetFrame())->mpNSView;
 NSRect popupFrame = [pPopupNSView frame];
 
-// since we manipulate the menu below (removing entries)
-// let's rather make a copy here and work with that
-NSMenu* pCopyMenu = [mpMenu copy];
-
-// filter disabled elements
-removeUnusedItemsRunner( pCopyMenu );
-
 // create frame rect
 NSRect displayPopupFrame = NSMakeRect( rRect.Left()+(offset-1), 
rRect.Top()+(offset+1), popupFrame.size.width, 0 );
 pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false);
@@ -390,15 +352,13 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2015-10-24 Thread Douglas Mencken
 vcl/inc/osx/printview.h   |7 
 vcl/osx/printaccessoryview.mm |  478 +-
 vcl/osx/printview.mm  |   12 -
 vcl/osx/salprn.cxx|3 
 4 files changed, 352 insertions(+), 148 deletions(-)

New commits:
commit 0d4f422300d81dcb9d875885c988e88a926fb722
Author: Douglas Mencken 
Date:   Sun Oct 18 11:29:49 2015 -0400

vcl.osx.print: convert to use modern API for print dialog

Change-Id: Icc7d7ad95d1ffbf55f1cd704148f3ceb58618e6c
Reviewed-on: https://gerrit.libreoffice.org/19432
Reviewed-by: Norbert Thiebaud 
Tested-by: Norbert Thiebaud 

diff --git a/vcl/inc/osx/printview.h b/vcl/inc/osx/printview.h
index e396bd8..22fafb6 100644
--- a/vcl/inc/osx/printview.h
+++ b/vcl/inc/osx/printview.h
@@ -42,7 +42,8 @@ struct PrintAccessoryViewState
 vcl::PrinterController* mpController;
 AquaSalInfoPrinter* mpInfoPrinter;
 }
--(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: 
(AquaSalInfoPrinter*)pInfoPrinter;
+-(id)initWithController: (vcl::PrinterController*)pController
+withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
 -(BOOL)knowsPageRange: (NSRangePointer)range;
 -(NSRect)rectForPage: (int)page;
 -(NSPoint)locationOfPrintRect: (NSRect)aRect;
@@ -52,7 +53,9 @@ struct PrintAccessoryViewState
 @interface AquaPrintAccessoryView : NSObject
 {
 }
-+(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: 
(vcl::PrinterController*)pController withState: 
(PrintAccessoryViewState*)pState;
++(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp
+   withController: (vcl::PrinterController*)pController
+withState: (PrintAccessoryViewState*)pState;
 @end
 
 #endif // INCLUDED_VCL_INC_OSX_PRINTVIEW_H
diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index d03d4f4..80d972e 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -45,11 +45,15 @@ using namespace com::sun::star;
 using namespace com::sun::star::beans;
 using namespace com::sun::star::uno;
 
-/* Note: the accessory view as implemented here is already deprecated in 
Leopard. Unfortunately
-   as long as our baseline is Tiger we cannot gain the advantages over 
multiple accessory views
-   as well havs having accessory views AND a preview (as long as you are 
linked vs. 10.4 libraries
-   the preview insists on not being present. This is unfortunate.
-*/
+#if MACOSX_SDK_VERSION <= 1040
+// as long as you are linking with 10.4 libraries there's no preview
+# define VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+#  undef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+#else
+// since 10.5 you can use multiple accessory views and have accessory views 
and a preview
+# define MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+#  undef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+#endif
 
 class ControllerProperties;
 
@@ -60,93 +64,207 @@ class ControllerProperties;
 -(id)initWithControllerMap: (ControllerProperties*)pController;
 -(void)triggered:(id)pSender;
 -(void)triggeredNumeric:(id)pSender;
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
 -(void)triggeredPreview:(id)pSender;
+#endif
 -(void)dealloc;
 @end
 
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+
+@interface AquaPrintPanelAccessoryController : NSViewController< 
NSPrintPanelAccessorizing >
+{
+NSPrintOperation *mpPrintOperation;
+vcl::PrinterController *mpPrinterController;
+PrintAccessoryViewState *mpViewState;
+}
+
+-(void)forPrintOperation:(NSPrintOperation*)pPrintOp;
+-(void)withPrinterController:(vcl::PrinterController*)pController;
+-(void)withViewState:(PrintAccessoryViewState*)pState;
+
+-(NSPrintOperation*)printOperation;
+-(vcl::PrinterController*)printerController;
+-(PrintAccessoryViewState*)viewState;
+
+-(NSSet*)keyPathsForValuesAffectingPreview;
+-(NSArray*)localizedSummaryItems;
+
+-(sal_Int32)updatePrintOperation:(sal_Int32)pLastPageCount;
+
+@end
+
+@implementation AquaPrintPanelAccessoryController
+
+-(void)forPrintOperation:(NSPrintOperation*)pPrintOp
+{ mpPrintOperation = pPrintOp; }
+
+-(void)withPrinterController:(vcl::PrinterController*)pController
+{ mpPrinterController = pController; }
+
+-(void)withViewState:(PrintAccessoryViewState*)pState
+{ mpViewState = pState; }
+
+-(NSPrintOperation*)printOperation
+{ return mpPrintOperation; }
+
+-(vcl::PrinterController*)printerController
+{ return mpPrinterController; }
+
+-(PrintAccessoryViewState*)viewState
+{ return mpViewState; }
+
+-(NSSet*)keyPathsForValuesAffectingPreview
+{
+return [ NSSet setWithObject:@"updatePrintOperation" ];
+}
+
+-(NSArray*)localizedSummaryItems
+{
+return [ NSArray arrayWithObject:
+   [ NSDictionary dictionary ] ];
+}
+
+-(sal_Int32)updatePrintOperation:(sal_Int32)pLastPageCount
+{
+// page range may be changed by option choice
+sal_Int32 nPages = 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/qa vcl/source vcl/unx

2015-09-11 Thread Takeshi Abe
 vcl/inc/canvasbitmap.hxx|4 ++--
 vcl/inc/displayconnectiondispatch.hxx   |4 ++--
 vcl/inc/dndevdis.hxx|4 ++--
 vcl/inc/dndlcon.hxx |4 ++--
 vcl/inc/osx/a11ylistener.hxx|4 ++--
 vcl/inc/pch/precompiled_vcl.hxx |7 ++-
 vcl/osx/DragSource.cxx  |2 +-
 vcl/osx/DragSource.hxx  |4 ++--
 vcl/osx/DragSourceContext.cxx   |2 +-
 vcl/osx/DragSourceContext.hxx   |5 ++---
 vcl/osx/DropTarget.cxx  |2 +-
 vcl/osx/DropTarget.hxx  |4 ++--
 vcl/osx/OSXTransferable.hxx |4 ++--
 vcl/osx/clipboard.cxx   |2 +-
 vcl/osx/clipboard.hxx   |4 ++--
 vcl/osx/documentfocuslistener.hxx   |4 ++--
 vcl/qa/cppunit/canvasbitmaptest.cxx |4 ++--
 vcl/qa/cppunit/dndtest.cxx  |7 +++
 vcl/source/app/session.cxx  |6 +++---
 vcl/source/app/svdata.cxx   |1 -
 vcl/source/app/svmain.cxx   |6 +++---
 vcl/source/components/dtranscomp.cxx|3 +--
 vcl/source/filter/graphicfilter.cxx |4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx   |4 ++--
 vcl/source/gdi/pdfwriter_impl2.cxx  |4 ++--
 vcl/source/helper/canvastools.cxx   |4 ++--
 vcl/source/window/dndlcon.cxx   |2 +-
 vcl/unx/generic/dtrans/X11_clipboard.cxx|2 +-
 vcl/unx/generic/dtrans/X11_clipboard.hxx|4 ++--
 vcl/unx/generic/dtrans/X11_dndcontext.hxx   |8 
 vcl/unx/generic/dtrans/X11_droptarget.cxx   |2 +-
 vcl/unx/generic/dtrans/X11_selection.cxx|2 +-
 vcl/unx/generic/dtrans/X11_selection.hxx|   10 +-
 vcl/unx/generic/dtrans/X11_service.cxx  |1 -
 vcl/unx/generic/dtrans/X11_transferable.hxx |4 ++--
 vcl/unx/gtk/a11y/atklistener.hxx|4 ++--
 vcl/unx/gtk/a11y/atkutil.cxx|4 ++--
 vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx|4 ++--
 vcl/unx/gtk/fpicker/SalGtkFolderPicker.hxx  |4 ++--
 vcl/unx/gtk/fpicker/SalGtkPicker.cxx|2 +-
 vcl/unx/gtk/fpicker/SalGtkPicker.hxx|4 ++--
 vcl/unx/gtk3/app/gtk3gtkinst.cxx|4 ++--
 vcl/unx/kde/UnxFilePicker.hxx   |4 ++--
 vcl/unx/kde4/KDE4FilePicker.hxx |4 ++--
 44 files changed, 82 insertions(+), 90 deletions(-)

New commits:
commit 50b26404dee83974cf84749a9d492ed208464597
Author: Takeshi Abe 
Date:   Fri Sep 11 10:37:30 2015 +0900

vcl: tdf#88206 replace cppu::WeakImplHelper* etc.

with the variadic variants.

Change-Id: I4499569f73b04cc7444787d51bf804c090a5c951
Reviewed-on: https://gerrit.libreoffice.org/18478
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/vcl/inc/canvasbitmap.hxx b/vcl/inc/canvasbitmap.hxx
index bd00fb7..7b9174a 100644
--- a/vcl/inc/canvasbitmap.hxx
+++ b/vcl/inc/canvasbitmap.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_VCL_INC_CANVASBITMAP_HXX
 #define INCLUDED_VCL_INC_CANVASBITMAP_HXX
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -34,7 +34,7 @@ namespace vcl
 namespace unotools
 {
 class VCL_DLLPUBLIC VclCanvasBitmap :
-public cppu::WeakImplHelper3< 
com::sun::star::rendering::XIntegerReadOnlyBitmap,
+public cppu::WeakImplHelper< 
com::sun::star::rendering::XIntegerReadOnlyBitmap,
   
com::sun::star::rendering::XBitmapPalette,
   
com::sun::star::rendering::XIntegerBitmapColorSpace >
 {
diff --git a/vcl/inc/displayconnectiondispatch.hxx 
b/vcl/inc/displayconnectiondispatch.hxx
index 564111e..b1e36d3 100644
--- a/vcl/inc/displayconnectiondispatch.hxx
+++ b/vcl/inc/displayconnectiondispatch.hxx
@@ -23,12 +23,12 @@
 #include 
 
 #include 
-#include 
+#include 
 
 namespace vcl {
 
 class DisplayConnectionDispatch:
-public cppu::WeakImplHelper1< com::sun::star::awt::XDisplayConnection >
+public cppu::WeakImplHelper< com::sun::star::awt::XDisplayConnection >
 {
 public:
 virtual bool dispatchEvent(void * pData, int nBytes) = 0;
diff --git a/vcl/inc/dndevdis.hxx b/vcl/inc/dndevdis.hxx
index b542581..4d5df39 100644
--- a/vcl/inc/dndevdis.hxx
+++ b/vcl/inc/dndevdis.hxx
@@ -24,10 +24,10 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 
-class DNDEventDispatcher: public ::cppu::WeakImplHelper3<
+class DNDEventDispatcher: public ::cppu::WeakImplHelper<
 ::com::sun::star::datatransfer::dnd::XDropTargetListener,
 ::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
 ::com::sun::star::datatransfer::dnd::XDragGestureListener >
diff --git a/vcl/inc/dndlcon.hxx b/vcl/inc/dndlcon.hxx
index b2febee..d6e3cab 100644
--- a/vcl/inc/dndlcon.hxx
+++ 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2015-08-13 Thread Norbert Thiebaud
 vcl/inc/osx/salinst.h|   47 +++---
 vcl/inc/saldatabasic.hxx |6 ++--
 vcl/osx/salframeview.mm  |   58 ---
 vcl/osx/salmenu.cxx  |   22 -
 vcl/osx/salnsmenu.mm |   21 -
 vcl/osx/salnstimer.mm|8 +++---
 vcl/osx/saltimer.cxx |6 
 vcl/osx/vclnsapp.mm  |   29 ---
 8 files changed, 104 insertions(+), 93 deletions(-)

New commits:
commit 2c797c39478b485c0285eb351d23e0d4e0fa7585
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Wed Aug 12 21:38:20 2015 -0500

kill YIELD_GUARD macro

Change-Id: I81990df584255f4a286cd078bcf15917c00ad504
Reviewed-on: https://gerrit.libreoffice.org/17687
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 24b7b6f..ba0eb12 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -20,18 +20,17 @@
 #ifndef INCLUDED_VCL_INC_OSX_SALINST_H
 #define INCLUDED_VCL_INC_OSX_SALINST_H
 
-#include comphelper/solarmutex.hxx
-#include osl/thread.hxx
-#include osl/conditn.h
+#include list
+
+#include comphelper/solarmutex.hxx
+#include osl/conditn.h
+#include osl/thread.hxx
 
 #ifdef MACOSX
 #include osx/osxvcltypes.h
 #endif
-
 #include salinst.hxx
 
-#include list
-
 class AquaSalFrame;
 class ApplicationEvent;
 class Image;
@@ -39,7 +38,7 @@ class Image;
 class SalYieldMutex : public comphelper::SolarMutex
 {
 osl::Mutex m_mutex;
-sal_uLong   mnCount;
+sal_uLong   mnCount;
 oslThreadIdentifier mnThreadId;
 
 public:
@@ -51,8 +50,6 @@ public:
 oslThreadIdentifier GetThreadId() const { return 
mnThreadId; }
 };
 
-#define YIELD_GUARD osl::Guard comphelper::SolarMutex  aGuard( 
GetSalData()-mpFirstInstance-GetYieldMutex() )
-
 class AquaSalInstance : public SalInstance
 {
 struct SalUserEvent
@@ -68,7 +65,7 @@ class AquaSalInstance : public SalInstance
 
 public:
 SalYieldMutex*  mpSalYieldMutex;// 
Sal-Yield-Mutex
-OUString   maDefaultPrinter;
+OUStringmaDefaultPrinter;
 oslThreadIdentifier maMainThread;
 boolmbWaitingYield;
 int mnActivePrintJobs;
@@ -86,12 +83,13 @@ public:
 virtual SalFrame*   CreateChildFrame( SystemParentData* pParent, 
sal_uLong nStyle ) SAL_OVERRIDE;
 virtual SalFrame*   CreateFrame( SalFrame* pParent, sal_uLong nStyle ) 
SAL_OVERRIDE;
 virtual voidDestroyFrame( SalFrame* pFrame ) SAL_OVERRIDE;
-virtual SalObject*  CreateObject( SalFrame* pParent, SystemWindowData* 
pWindowData, bool bShow = true ) SAL_OVERRIDE;
+virtual SalObject*  CreateObject( SalFrame* pParent, SystemWindowData* 
pWindowData,
+  bool bShow = true ) SAL_OVERRIDE;
 virtual voidDestroyObject( SalObject* pObject ) SAL_OVERRIDE;
-virtual SalVirtualDevice*   CreateVirtualDevice( SalGraphics* pGraphics,
- long nDX, long nDY,
- sal_uInt16 nBitCount,
- const SystemGraphicsData 
*pData ) SAL_OVERRIDE;
+virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+   long nDX, long nDY,
+   sal_uInt16 nBitCount,
+   const SystemGraphicsData 
*pData ) SAL_OVERRIDE;
 virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData ) 
SAL_OVERRIDE;
 virtual voidDestroyInfoPrinter( SalInfoPrinter* pPrinter ) 
SAL_OVERRIDE;
@@ -102,28 +100,31 @@ public:
 virtual voidDeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo 
) SAL_OVERRIDE;
 virtual OUStringGetDefaultPrinter() SAL_OVERRIDE;
 virtual SalTimer*   CreateSalTimer() SAL_OVERRIDE;
-virtual SalI18NImeStatus*   CreateI18NImeStatus() SAL_OVERRIDE;
+virtual SalI18NImeStatus* CreateI18NImeStatus() SAL_OVERRIDE;
 virtual SalSystem*  CreateSalSystem() SAL_OVERRIDE;
 virtual SalBitmap*  CreateSalBitmap() SAL_OVERRIDE;
 virtual comphelper::SolarMutex* GetYieldMutex() SAL_OVERRIDE;
 virtual sal_uLong   ReleaseYieldMutex() SAL_OVERRIDE;
 virtual voidAcquireYieldMutex( sal_uLong nCount ) SAL_OVERRIDE;
 virtual boolCheckYieldMutex() SAL_OVERRIDE;
-virtual voidDoYield(bool bWait, bool bHandleAllCurrentEvents, 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2015-05-13 Thread Noel Grandin
 vcl/inc/osx/salmenu.h |2 +-
 vcl/osx/salmenu.cxx   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6ef580e7922adf85b3bd60af679c1fd51cfc8490
Author: Noel Grandin n...@peralex.com
Date:   Wed May 13 09:51:35 2015 +0200

fix OSX build

after my commit facc91ab4a3f25b3290408c7083ed4c09dd8d759
convert FLOATWIN_POPUPMODE constants to scoped enum

Change-Id: I5c2264eb2bab9ace89a72adecc840bc5d9d80b9d

diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index 1419050..941a1b2 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -69,7 +69,7 @@ public:
 virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const 
Image rImage) SAL_OVERRIDE;
 virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, 
const vcl::KeyCode rKeyCode, const OUString rKeyName ) SAL_OVERRIDE;
 virtual void GetSystemMenuData( SystemMenuData* pData ) SAL_OVERRIDE;
-virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle 
rRect, sal_uLong nFlags) SAL_OVERRIDE;
+virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle 
rRect, FloatWinPopupFlags nFlags) SAL_OVERRIDE;
 virtual bool AddMenuBarButton( const SalMenuButtonItem ) SAL_OVERRIDE;
 virtual void RemoveMenuBarButton( sal_uInt16 nId ) SAL_OVERRIDE;
 virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, 
SalFrame* i_pReferenceFrame ) SAL_OVERRIDE;
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 4d7fb8f..63fb8ef 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -348,7 +348,7 @@ sal_Int32 removeUnusedItemsRunner(NSMenu * pMenu)
 return drawnItems;
 }
 
-bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle 
rRect, sal_uLong nFlags)
+bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle 
rRect, FloatWinPopupFlags nFlags)
 {
 // do not use native popup menu when AQUA_NATIVE_MENUS is set to false
 if( ! VisibleMenuBar() ) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx

2015-05-11 Thread Norbert Thiebaud
 vcl/inc/osx/vclnsapp.h |1 +
 vcl/osx/vclnsapp.mm|8 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 5d00f1b0918dc067e0d22809f93b0491bbcee0a9
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Sat May 9 08:46:58 2015 -0500

invoke sal_detail_deinitialized() on MacOSX too

LibreOffice.app on Mac, eventually call NSApplicationMain()
which never return.. so the sal_detail_deinitialize()
call intented by SAL_IMPLEMENT_MAIN*() is bypassed.
This will attempt to call it, as late as possible in the NSApplication
lifecycle.

Change-Id: I5cb63bfaeafb784a0fee356ff843b332d8e31932
Reviewed-on: https://gerrit.libreoffice.org/15684
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Stephan Bergmann sberg...@redhat.com
Tested-by: Stephan Bergmann sberg...@redhat.com

diff --git a/vcl/inc/osx/vclnsapp.h b/vcl/inc/osx/vclnsapp.h
index 541b509..c899ffc 100644
--- a/vcl/inc/osx/vclnsapp.h
+++ b/vcl/inc/osx/vclnsapp.h
@@ -47,6 +47,7 @@ class AquaSalFrame;
 -(BOOL)application: (NSApplication*) app printFile: (NSString*)file;
 -(NSApplicationPrintReply)application: (NSApplication *) app 
printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings 
showPrintPanels:(BOOL)bShowPrintPanels;
 -(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) 
app;
+-(void)applicationWillTerminate: (NSNotification *) aNotification;
 -(void)systemColorsChanged: (NSNotification*) pNotification;
 -(void)screenParametersChanged: (NSNotification*) pNotification;
 -(void)scrollbarVariantChanged: (NSNotification*) pNotification;
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index d1d086f..f7c9a4b 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -20,7 +20,7 @@
 #include config_features.h
 
 #include sal/config.h
-
+#include sal/main.h
 #include vector
 
 #include vcl/window.hxx
@@ -384,6 +384,12 @@
 return NSPrintingSuccess;
 }
 
+-(void)applicationWillTerminate: (NSNotification *) aNotification
+{
+(void)aNotification;
+sal_detail_deinitialize();
+}
+
 -(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
 {
 (void)app;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2015-01-04 Thread Caolán McNamara
 vcl/inc/osx/saldata.hxx |6 +++---
 vcl/inc/pch/precompiled_vcl.hxx |4 ++--
 vcl/inc/quartz/salgdi.h |4 ++--
 vcl/inc/win/salgdi.h|4 ++--
 vcl/osx/DataFlavorMapping.hxx   |4 ++--
 vcl/quartz/ctfonts.cxx  |2 --
 6 files changed, 11 insertions(+), 13 deletions(-)

New commits:
commit 547b472d5b81ef7f22c32b089bd9f42f721c1cbf
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Jan 4 20:20:21 2015 +

vcl/osx boost::unordered_map-std::unordered_map

Change-Id: I00dabf3307734e319a8187df111e1065ea383524

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 86667ac..4ac39dd 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -34,9 +34,9 @@
 #include salwtype.hxx
 
 #include list
-#include vector
 #include map
-#include boost/unordered_set.hpp
+#include unordered_set
+#include vector
 
 #include cstdio
 #include cstdarg
@@ -70,7 +70,7 @@ public:
 SALTIMERPROC  mpTimerProc;  // timer 
callback proc
 AquaSalInstance  *mpFirstInstance;  // pointer 
of first instance
 std::listAquaSalFrame*  maFrames; // list of 
all frames
-boost::unordered_setconst AquaSalFrame*,FrameHash  maFrameCheck; // 
for fast check of frame existence
+std::unordered_setconst AquaSalFrame*,FrameHash  maFrameCheck;// for 
fast check of frame existence
 std::listAquaSalFrame*  maPresentationFrames;  // 
list of frames in presentation mode
 SalObject*mpFirstObject;// pointer 
of first object window
 SalVirtualDevice *mpFirstVD;// first 
VirDev
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index 9d3018a..484f1e0 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -146,8 +146,6 @@
 #include boost/scoped_ptr.hpp
 #include boost/shared_ptr.hpp
 #include boost/static_assert.hpp
-#include boost/unordered_map.hpp
-#include boost/unordered_set.hpp
 #include cassert
 #include cmath
 #include com/sun/star/accessibility/AccessibleEventObject.hpp
@@ -396,6 +394,8 @@
 #include uno/current_context.hxx
 #include uno/dispatcher.h
 #include uno/mapping.hxx
+#include unordered_map
+#include unordered_set
 #include unotools/calendarwrapper.hxx
 #include unotools/charclass.hxx
 #include unotools/configmgr.hxx
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 3abfdb6..87c35c1 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -43,7 +43,7 @@
 #include salgdi.hxx
 
 #include quartz/salgdicommon.hxx
-#include boost/unordered_map.hpp
+#include unordered_map
 
 class AquaSalFrame;
 class ImplDevFontAttributes;
@@ -133,7 +133,7 @@ private:
 CTFontCollectionRef mpCTFontCollection;
 CFArrayRef mpCTFontArray;
 
-typedef boost::unordered_mapsal_IntPtr,CoreTextFontData* CTFontContainer;
+typedef std::unordered_mapsal_IntPtr,CoreTextFontData* CTFontContainer;
 CTFontContainer maFontContainer;
 };
 
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 5a46cb1f..6ce3a61 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -29,7 +29,7 @@
 #include vcl/fontcapabilities.hxx
 
 #include boost/scoped_ptr.hpp
-#include boost/unordered_set.hpp
+#include unordered_set
 
 #include config_graphite.h
 #if ENABLE_GRAPHITE
@@ -134,7 +134,7 @@ private:
 
 voidReadGsubTable( HDC ) const;
 
-typedef boost::unordered_setsal_UCS4 UcsHashSet;
+typedef std::unordered_setsal_UCS4 UcsHashSet;
 mutable UcsHashSet  maGsubTable;
 mutable boolmbGsubRead;
 public:
diff --git a/vcl/osx/DataFlavorMapping.hxx b/vcl/osx/DataFlavorMapping.hxx
index a3cff1c..1917aeb 100644
--- a/vcl/osx/DataFlavorMapping.hxx
+++ b/vcl/osx/DataFlavorMapping.hxx
@@ -29,8 +29,8 @@
 #import Cocoa/Cocoa.h
 #include postmac.h
 
-#include boost/unordered_map.hpp
 #include memory
+#include unordered_map
 #include boost/shared_ptr.hpp
 
 /* An interface to get the clipboard data in either
@@ -119,7 +119,7 @@ private:
 
 private:
   ::com::sun::star::uno::Reference 
::com::sun::star::datatransfer::XMimeContentTypeFactory mrXMimeCntFactory;
-  typedef boost::unordered_map OUString, NSString*, OUStringHash  
OfficeOnlyTypes;
+  typedef std::unordered_map OUString, NSString*, OUStringHash  
OfficeOnlyTypes;
   mutable OfficeOnlyTypes maOfficeOnlyTypes;
 };
 
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 80253ab..5fb772b 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include boost/unordered_map.hpp
-
 #include impfont.hxx
 #include outfont.hxx
 #include PhysicalFontCollection.hxx
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2014-12-03 Thread Stephan Bergmann
 vcl/inc/osx/saldata.hxx  |2 +-
 vcl/osx/DragSource.cxx   |2 +-
 vcl/osx/DropTarget.cxx   |2 +-
 vcl/osx/a11ytextattributeswrapper.mm |2 +-
 vcl/osx/saldata.cxx  |4 ++--
 vcl/osx/salframe.cxx |2 +-
 vcl/osx/salframeview.mm  |6 +++---
 vcl/osx/salmenu.cxx  |8 
 vcl/osx/salnativewidgets.cxx |6 +++---
 vcl/quartz/ctfonts.cxx   |7 +++
 vcl/quartz/ctlayout.cxx  |4 ++--
 11 files changed, 22 insertions(+), 23 deletions(-)

New commits:
commit 083f517ca3c037a1d36e6f5ea830366f24659f22
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Dec 4 08:47:31 2014 +0100

vcl (Mac): loplugin:cstylecast

Change-Id: Ic46623380f026a8dfcc74c895db35a06bcea1ead

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 413754b..86667ac 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -59,7 +59,7 @@ struct FrameHash : public boost::hashsal_IntPtr
 { return boost::hashsal_IntPtr::operator()( reinterpret_castconst 
sal_IntPtr(frame) ); }
 };
 
-#define INVALID_CURSOR_PTR (NSCursor*)0xdeadbeef
+#define INVALID_CURSOR_PTR reinterpret_castNSCursor*(0xdeadbeef)
 
 // Singleton, instantiated from Application::Application() in
 // vcl/source/app/svapp.cxx through InitSalData().
diff --git a/vcl/osx/DragSource.cxx b/vcl/osx/DragSource.cxx
index 593bf8b..5601d25 100644
--- a/vcl/osx/DragSource.cxx
+++ b/vcl/osx/DragSource.cxx
@@ -172,7 +172,7 @@ void SAL_CALL DragSource::initialize(const Sequence Any  
aArguments)
   Any pNSView = aArguments[1];
   sal_uInt64 tmp = 0;
   pNSView = tmp;
-  mView = (NSView*)tmp;
+  mView = reinterpret_castNSView*(tmp);
 
   /* All SalFrameView the base class for all VCL system views inherits from
  NSView in order to get mouse and other events. This is the only way to
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index 7ee0f5b..a6721a6 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -352,7 +352,7 @@ void SAL_CALL DropTarget::initialize(const Sequence Any  
aArguments)
 Any pNSView = aArguments[0];
 sal_uInt64 tmp = 0;
 pNSView = tmp;
-mView = (id)tmp;
+mView = reinterpret_castid(tmp);
 mpFrame = [(SalFrameView*)mView getSalFrame];
 
 mDropTargetHelper = [[DropTargetHelper alloc] initWithDropTarget: this];
diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index 4b18234..3ac368e 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -178,7 +178,7 @@ using namespace ::com::sun::star::uno;
 return;
 const RGBAColor aRGBAColor( nSalColor);
 CGColorRef aColorRef = CGColorCreate ( CGColorSpaceCreateWithName ( 
kCGColorSpaceGenericRGB ), aRGBAColor.AsArray() );
-[ string addAttribute: attribute value: (id) aColorRef range: range ];
+[ string addAttribute: attribute value: reinterpret_castid(aColorRef) 
range: range ];
 CGColorRelease( aColorRef );
 }
 
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index f4dc179..a2a8b85 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -30,7 +30,7 @@ oslThreadKey SalData::s_aAutoReleaseKey = 0;
 static void SAL_CALL releasePool( void* pPool )
 {
 if( pPool )
-[(NSAutoreleasePool*)pPool release];
+[static_castNSAutoreleasePool*(pPool) release];
 }
 
 SalData::SalData()
@@ -230,7 +230,7 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle )
 CFURLRef hURL = CFBundleCopyResourceURL( hMain, pCursorName, 
CFSTR(png), CFSTR(cursors) );
 if( hURL )
 {
-pCurs = [[NSCursor alloc] initWithImage: [[NSImage alloc] 
initWithContentsOfURL: (NSURL*)hURL] hotSpot: aHotSpot];
+pCurs = [[NSCursor alloc] initWithImage: [[NSImage alloc] 
initWithContentsOfURL: const_castNSURL*(static_castNSURL const *(hURL))] 
hotSpot: aHotSpot];
 CFRelease( hURL );
 }
 CFRelease( pCursorName );
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 0f266db..7591c69 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1497,7 +1497,7 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent )
 bool bShown = mbShown;
 // remove from child list
 Show( FALSE );
-mpParent = (AquaSalFrame*)pNewParent;
+mpParent = static_castAquaSalFrame*(pNewParent);
 // insert to correct parent and paint
 Show( bShown );
 }
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index add9891..248c8eb 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -189,13 +189,13 @@ static AquaSalFrame* getMouseContainerFrame()
 if( bAllowFullScreen  [pNSWindow respondsToSelector: 
setCollectionBehavior])
 {
 const int bMode= (bAllowFullScreen ? 
NSWindowCollectionBehaviorFullScreenPrimary : 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2014-06-16 Thread Douglas Mencken
 vcl/inc/osx/salframeview.h |   10 +-
 vcl/osx/salframeview.mm|   26 +-
 2 files changed, 34 insertions(+), 2 deletions(-)

New commits:
commit a2ee38ef7afcec27f46530bf9e177939e38cc815
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Sun Jun 15 22:40:36 2014 -0400

fix keyboard input on OS X  10.6

Since commit e4dc93f5, LibreOffice just beeps on any key press:
it's impossible to add symbols by using keyboard. This patch
fixes that.

conditionally reverts e4dc93f5d8d0df50f1a8b4594220d0c57703e03d

Change-ID: Id30e30775c0d0224954b8a1f05fd0d8d5f39cd4e
Reviewed-on: https://gerrit.libreoffice.org/9793
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 4f0c685..7e957b6 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -63,11 +63,15 @@
 -(void)unregisterDraggingDestinationHandler:(id)theHandler;
 @end
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+@interface SalFrameView : AquaA11yWrapper NSTextInput
+#else
 @interface SalFrameView : AquaA11yWrapper NSTextInputClient
+#endif
 {
 AquaSalFrame*   mpFrame;
 
-// for NSTextInputClient
+// for NSTextInput/NSTextInputClient
 NSEvent*mpLastEvent;
 BOOLmbNeedSpecialKeyHandle;
 BOOLmbInKeyInput;
@@ -117,7 +121,11 @@
 /*
 text action methods
 */
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+-(void)insertText:(id)aString;
+#else
 -(void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
+#endif
 -(void)insertTab: (id)aSender;
 -(void)insertBacktab: (id)aSender;
 -(void)moveLeft: (id)aSender;
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index fadd508..ec73f05 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1026,9 +1026,15 @@ private:
 }
 }
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+-(void)insertText:(id)aString
+#else
 -(void)insertText:(id)aString replacementRange:(NSRange)replacementRange
+#endif
 {
+#if MAC_OS_X_VERSION_MAX_ALLOWED = 1060
 (void) replacementRange; // FIXME: surely it must be used
+#endif
 
 YIELD_GUARD;
 
@@ -1547,7 +1553,7 @@ private:
 }
 
 
-// NSTextInputClient protocol
+// NSTextInput/NSTextInputClient protocol
 - (NSArray *)validAttributesForMarkedText
 {
 return [NSArray arrayWithObjects:NSUnderlineStyleAttributeName, nil];
@@ -1598,9 +1604,15 @@ private:
 return mSelectedRange;
 }
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange
+#else
 - (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange 
replacementRange:(NSRange)replacementRange
+#endif
 {
+#if MAC_OS_X_VERSION_MAX_ALLOWED = 1060
 (void) replacementRange; // FIXME - use it!
+#endif
 
 if( ![aString isKindOfClass:[NSAttributedString class]] )
 aString = [[[NSAttributedString alloc] initWithString:aString] 
autorelease];
@@ -1668,10 +1680,16 @@ private:
 mSelectedRange = mMarkedRange = NSMakeRange(NSNotFound, 0);
 }
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+- (NSAttributedString *)attributedSubstringFromRange:(NSRange)aRange
+#else
 - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange 
actualRange:(NSRangePointer)actualRange
+#endif
 {
 (void) aRange;
+#if MAC_OS_X_VERSION_MAX_ALLOWED = 1060
 (void) actualRange;
+#endif
 
 // FIXME - Implement
 return nil;
@@ -1715,11 +1733,17 @@ private:
 mpLastEvent = nil;
 }
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+- (NSRect)firstRectForCharacterRange:(NSRange)aRange
+#else
 - (NSRect)firstRectForCharacterRange:(NSRange)aRange 
actualRange:(NSRangePointer)actualRange
+#endif
 {
  // FIXME - These should probably be used?
 (void) aRange;
+#if MAC_OS_X_VERSION_MAX_ALLOWED = 1060
 (void) actualRange;
+#endif
 
 SalExtTextInputPosEvent aPosEvent;
 mpFrame-CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void *)aPosEvent );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source

2014-04-07 Thread Stephan Bergmann
 vcl/inc/svmain.hxx|   30 ++
 vcl/osx/salinst.cxx   |1 +
 vcl/source/app/svmain.cxx |4 +---
 vcl/source/app/svmainhook.cxx |4 
 4 files changed, 36 insertions(+), 3 deletions(-)

New commits:
commit 57ecf341a42866c8ed207768603a379173961c71
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Apr 7 13:41:06 2014 +0200

Clean up ImplSVMainHook declaration

Change-Id: I51d7eac6160a3c3abc96733fa30fdcbb41bb5509

diff --git a/vcl/inc/svmain.hxx b/vcl/inc/svmain.hxx
new file mode 100644
index 000..6ea93fa
--- /dev/null
+++ b/vcl/inc/svmain.hxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VCL_INC_SVMAIN_HXX
+#define INCLUDED_VCL_INC_SVMAIN_HXX
+
+#include sal/config.h
+
+// #i47888# allow for alternative initialization as required for e.g. MacOSX
+bool ImplSVMainHook( int* );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index fce9e95..4414bef 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -46,6 +46,7 @@
 #include print.h
 #include impbmp.hxx
 #include salimestatus.hxx
+#include svmain.hxx
 
 #include comphelper/processfactory.hxx
 
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index f0277ea..f5b05fe 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -52,6 +52,7 @@
 #include salinst.hxx
 #include salwtype.hxx
 #include svdata.hxx
+#include svmain.hxx
 #include dbggui.hxx
 #include accmgr.hxx
 #include idlemgr.hxx
@@ -180,9 +181,6 @@ int ImplSVMain()
 
 int SVMain()
 {
-// #i47888# allow for alternative initialization as required for e.g. 
MacOSX
-extern bool ImplSVMainHook( int* );
-
 int nRet;
 if( !Application::IsConsoleOnly()  ImplSVMainHook( nRet ) )
 return nRet;
diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx
index 1f2ba0d..4974cff 100644
--- a/vcl/source/app/svmainhook.cxx
+++ b/vcl/source/app/svmainhook.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include sal/config.h
+
+#include svmain.hxx
+
 #ifndef MACOSX
 // MacOSX implementation of ImplSVMainHook is in osx/salinst.cxx
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2014-02-28 Thread Tor Lillqvist
 vcl/inc/osx/a11yfocustracker.hxx  |   14 ++---
 vcl/inc/osx/a11ylistener.hxx  |4 -
 vcl/inc/osx/salframe.h|   98 ++
 vcl/inc/osx/salinst.h |   82 +++
 vcl/inc/osx/salmenu.h |   35 ++---
 vcl/inc/osx/salobj.h  |   16 +++---
 vcl/inc/osx/salprn.h  |   36 ++---
 vcl/inc/osx/salsys.h  |8 +--
 vcl/osx/DataFlavorMapping.cxx |   20 +++
 vcl/osx/DragSource.hxx|   18 +++---
 vcl/osx/DragSourceContext.hxx |8 +--
 vcl/osx/DropTarget.hxx|   44 -
 vcl/osx/OSXTransferable.hxx   |6 +-
 vcl/osx/a11yfocuslistener.hxx |6 +-
 vcl/osx/clipboard.hxx |   20 +++
 vcl/osx/documentfocuslistener.hxx |4 -
 vcl/osx/salframe.cxx  |   21 
 vcl/osx/salinst.cxx   |   32 +---
 vcl/osx/salnativewidgets.cxx  |2 
 vcl/quartz/salbmp.cxx |   42 
 20 files changed, 233 insertions(+), 283 deletions(-)

New commits:
commit ce433069f1b1c39ba368d5d2fc8008b6e9148324
Author: Tor Lillqvist t...@collabora.com
Date:   Fri Feb 28 14:27:15 2014 +0200

Add SAL_OVERRIDE markup for the vcl OS X and iOS code, and follow-up cleanup

Thanks to SAL_OVERRIDE, I found a couple of unused functions and
several that were virtual even if they did not override anything and
were not overridden in any derived class.

Change-Id: I598d2fc38f75a384c52359546a973e772393

diff --git a/vcl/inc/osx/a11yfocustracker.hxx b/vcl/inc/osx/a11yfocustracker.hxx
index f1bae09..2b5e96f 100644
--- a/vcl/inc/osx/a11yfocustracker.hxx
+++ b/vcl/inc/osx/a11yfocustracker.hxx
@@ -55,25 +55,25 @@ public:
 protected:
 
 // received a WINDOW_GETFOCUS event for this window
-virtual void window_got_focus(Window *pWindow);
+void window_got_focus(Window *pWindow);
 
 // received a TOOLBOX_HIGHLIGHT event for this window
-virtual void toolbox_highlight_on(Window *pWindow);
+void toolbox_highlight_on(Window *pWindow);
 
 // received a TOOLBOX_HIGHLIGHTOFF event for this window
-virtual void toolbox_highlight_off(Window *pWindow);
+void toolbox_highlight_off(Window *pWindow);
 
 // received a TABPAGE_ACTIVATE event for this window
-virtual void tabpage_activated(Window *pWindow);
+void tabpage_activated(Window *pWindow);
 
 // received a MENU_HIGHLIGHT event for this window
-virtual void menu_highlighted(const ::VclMenuEvent *pEvent);
+void menu_highlighted(const ::VclMenuEvent *pEvent);
 
 // toolbox items are widgets in gtk+ and Cocoa
-virtual void notify_toolbox_item_focus(ToolBox *pToolBox);
+void notify_toolbox_item_focus(ToolBox *pToolBox);
 
 // toolbox item opened a floating window (e.g. color chooser)
-virtual void toolbox_open_floater(Window *pWindow);
+void toolbox_open_floater(Window *pWindow);
 
 // callback function for Application::addEventListener
 static long WindowEventHandler(AquaA11yFocusTracker *pFocusTracker, 
::VclSimpleEvent const *pEvent);
diff --git a/vcl/inc/osx/a11ylistener.hxx b/vcl/inc/osx/a11ylistener.hxx
index 7d15345..503e986 100644
--- a/vcl/inc/osx/a11ylistener.hxx
+++ b/vcl/inc/osx/a11ylistener.hxx
@@ -42,11 +42,11 @@ public:
 
 // XEventListener
 virtual void SAL_CALL disposing( const 
::com::sun::star::lang::EventObject Source )
-throw (::com::sun::star::uno::RuntimeException, std::exception);
+throw (::com::sun::star::uno::RuntimeException, std::exception) 
SAL_OVERRIDE;
 
 // XAccessibleEventListener
 virtual void SAL_CALL notifyEvent( const 
::com::sun::star::accessibility::AccessibleEventObject aEvent )
-throw( ::com::sun::star::uno::RuntimeException, std::exception );
+throw( ::com::sun::star::uno::RuntimeException, std::exception ) 
SAL_OVERRIDE;
 
 private:
 const id m_wrapperObject;
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index bbd638b..ff7c972 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -112,62 +112,60 @@ public:
 
 virtual ~AquaSalFrame();
 
-virtual SalGraphics*GetGraphics();
-virtual voidReleaseGraphics( SalGraphics* pGraphics );
-virtual boolPostEvent( void* pData );
-virtual voidSetTitle( const OUString rTitle );
-virtual voidSetIcon( sal_uInt16 nIcon );
-virtual voidSetRepresentedURL( const OUString );
-virtual voidSetMenu( SalMenu* pSalMenu );
-virtual voidDrawMenuBar();
-virtual voidShow( bool bVisible, bool bNoActivate = false 
);
-virtual voidEnable( bool bEnable );
-virtual voidSetMinClientSize( long nWidth, long nHeight );
-virtual voidSetMaxClientSize( long nWidth, long 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2014-02-24 Thread Douglas Mencken
 vcl/inc/osx/salframe.h |4 
 vcl/inc/osx/salframeview.h |4 
 vcl/osx/salframe.cxx   |   39 +++
 vcl/osx/salmenu.cxx|4 
 4 files changed, 51 insertions(+)

New commits:
commit 553473945b6789cb757ec69aabba6b87c4854916
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Mon Feb 24 15:00:31 2014 -0500

vcl/osx/sal: SDK 10.5 compatibility

NSWindowDelegate and NSMenuDelegate protocols, IOPMAssertion*
are available only in OS X v10.6 and later.

Change-Id: Icda4b8014d9a6dde2284b9f5df493eb470fb79fc
Reviewed-on: https://gerrit.libreoffice.org/8211
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 4386107..4150dc7 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -95,7 +95,11 @@ public:
 sal_uLong   mnICOptions;
 
 // To prevent display sleep during presentation
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+boost::shared_ptr Timer   mpActivityTimer;
+#else
 IOPMAssertionID mnAssertionID;
+#endif
 
 public:
 /** Constructor
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index fa3222e..d187f94 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -22,7 +22,11 @@
 
 #include osx/a11ywrapper.h
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+@interface SalFrameWindow : NSWindow
+#else
 @interface SalFrameWindow : NSWindowNSWindowDelegate
+#endif
 {
 AquaSalFrame*   mpFrame;
 id mDraggingDestinationHandler;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index e49df67..ab5ef79 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -38,6 +38,11 @@
 #include osx/a11yfactory.h
 #include quartz/utils.h
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+#include vcl/timer.hxx
+#include osx/saltimer.h
+#endif
+
 #include salwtype.hxx
 
 #include premac.h
@@ -201,7 +206,12 @@ void AquaSalFrame::initWindowAndView()
 else
 [mpNSWindow setAcceptsMouseMovedEvents: YES];
 [mpNSWindow setHasShadow: YES];
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+objc_msgSend(mpNSWindow, @selector(setDelegate:), mpNSWindow);
+#else
 [mpNSWindow setDelegate: static_castidNSWindowDelegate (mpNSWindow)];
+#endif
 
 if( [mpNSWindow respondsToSelector: @selector(setRestorable:)])
 {
@@ -819,6 +829,27 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, 
sal_Int32 nDisplay )
 
 
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+class PreventSleepTimer : public AutoTimer
+{
+public:
+PreventSleepTimer()
+{
+SetTimeout( 3 );
+Start();
+}
+
+virtual ~PreventSleepTimer()
+{
+}
+
+virtual void Timeout()
+{
+UpdateSystemActivity(OverallAct);
+}
+};
+#endif
+
 void AquaSalFrame::StartPresentation( sal_Bool bStart )
 {
 if ( !mpNSWindow )
@@ -830,10 +861,14 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart )
 if( bStart )
 {
 GetSalData()-maPresentationFrames.push_back( this );
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+mpActivityTimer.reset( new PreventSleepTimer() );
+#else /* OS X 10.6 and above */
 IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
 kIOPMAssertionLevelOn,
 CFSTR(LibreOffice presentation running),
 mnAssertionID);
+#endif
 [mpNSWindow setLevel: NSPopUpMenuWindowLevel];
 if( mbShown )
 [mpNSWindow makeMainWindow];
@@ -841,7 +876,11 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart )
 else
 {
 GetSalData()-maPresentationFrames.remove( this );
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+mpActivityTimer.reset();
+#else
 IOPMAssertionRelease(mnAssertionID);
+#endif
 [mpNSWindow setLevel: NSNormalWindowLevel];
 }
 }
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 7912825..b3a1736 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -253,7 +253,11 @@ AquaSalMenu::AquaSalMenu( bool bMenuBar ) :
 if( ! mbMenuBar )
 {
 mpMenu = [[SalNSMenu alloc] initWithMenu: this];
+#if MAC_OS_X_VERSION_MAX_ALLOWED  1060
+objc_msgSend(mpMenu, @selector(setDelegate:), mpMenu);
+#else
 [mpMenu setDelegate: (idNSMenuDelegate)mpMenu];
+#endif
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2014-02-21 Thread Stephan Bergmann
 vcl/inc/osx/salframe.h   |6 +++---
 vcl/inc/osx/salmenu.h|2 +-
 vcl/inc/osx/salprn.h |   16 
 vcl/inc/quartz/salgdi.h  |   18 +-
 vcl/inc/quartz/salvd.h   |2 +-
 vcl/osx/salframe.cxx |6 +++---
 vcl/osx/salmenu.cxx  |2 +-
 vcl/osx/salnativewidgets.cxx |8 
 vcl/osx/salprn.cxx   |   16 
 vcl/quartz/salgdicommon.cxx  |   10 +-
 vcl/quartz/salvd.cxx |2 +-
 11 files changed, 44 insertions(+), 44 deletions(-)

New commits:
commit d6dfeb95885a03e6f255c0be75b2dfa9258c61cc
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Feb 21 13:08:35 2014 +0100

Mac OS X vcl: sal_Bool - bool fixup

Change-Id: I77a2e7957351ca6da44948e5a28d08116e1cd14d

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 464a54a..ed9f61c 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -110,7 +110,7 @@ public:
 
 virtual SalGraphics*GetGraphics();
 virtual voidReleaseGraphics( SalGraphics* pGraphics );
-virtual sal_BoolPostEvent( void* pData );
+virtual boolPostEvent( void* pData );
 virtual voidSetTitle( const OUString rTitle );
 virtual voidSetIcon( sal_uInt16 nIcon );
 virtual voidSetRepresentedURL( const OUString );
@@ -125,7 +125,7 @@ public:
 virtual voidGetWorkArea( Rectangle rRect );
 virtual SalFrame*   GetParent() const;
 virtual voidSetWindowState( const SalFrameState* pState );
-virtual sal_BoolGetWindowState( SalFrameState* pState );
+virtual boolGetWindowState( SalFrameState* pState );
 virtual voidShowFullScreen( sal_Bool bFullScreen, 
sal_Int32 nDisplay );
 virtual voidStartPresentation( sal_Bool bStart );
 virtual voidSetAlwaysOnTop( sal_Bool bOnTop );
@@ -139,7 +139,7 @@ public:
 virtual voidSetInputContext( SalInputContext* pContext );
 virtual voidEndExtTextInput( sal_uInt16 nFlags );
 virtual OUString  GetKeyName( sal_uInt16 nKeyCode );
-virtual sal_BoolMapUnicodeToKeyCode( sal_Unicode aUnicode, 
LanguageType aLangType, KeyCode rKeyCode );
+virtual boolMapUnicodeToKeyCode( sal_Unicode aUnicode, 
LanguageType aLangType, KeyCode rKeyCode );
 virtual LanguageTypeGetInputLanguage();
 virtual voidUpdateSettings( AllSettings rSettings );
 virtual voidBeep();
diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index 925a339..6bd9b72 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -56,7 +56,7 @@ public:
 AquaSalMenu( bool bMenuBar );
 virtual ~AquaSalMenu();
 
-virtual sal_Bool VisibleMenuBar();  // must return TRUE to actually 
DISPLAY native menu bars
+virtual bool VisibleMenuBar();  // must return TRUE to actually DISPLAY 
native menu bars
 // otherwise only menu messages are 
processed (eg, OLE on Windows)
 
 virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index 906a61d..d2ac588 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -73,9 +73,9 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 
 virtual SalGraphics*GetGraphics();
 virtual voidReleaseGraphics( SalGraphics* i_pGraphics );
-virtual sal_BoolSetup( SalFrame* i_pFrame, ImplJobSetup* 
i_pSetupData );
-virtual sal_BoolSetPrinterData( ImplJobSetup* pSetupData );
-virtual sal_BoolSetData( sal_uLong i_nFlags, ImplJobSetup* 
i_pSetupData );
+virtual boolSetup( SalFrame* i_pFrame, ImplJobSetup* 
i_pSetupData );
+virtual boolSetPrinterData( ImplJobSetup* pSetupData );
+virtual boolSetData( sal_uLong i_nFlags, ImplJobSetup* 
i_pSetupData );
 virtual voidGetPageInfo( const ImplJobSetup* i_pSetupData,
  long o_rOutWidth, long 
o_rOutHeight,
  long o_rPageOffX, long 
o_rPageOffY,
@@ -127,7 +127,7 @@ class AquaSalPrinter : public SalPrinter
 AquaSalPrinter( AquaSalInfoPrinter* i_pInfoPrinter );
 virtual ~AquaSalPrinter();
 
-virtual sal_BoolStartJob( const OUString* i_pFileName,
+virtual boolStartJob( const OUString* i_pFileName,
   const OUString i_rJobName,
   const OUString i_rAppName,
   sal_uLong i_nCopies,
@@ -135,16 +135,16 @@ class 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2014-02-06 Thread Herbert Dürr
 vcl/inc/osx/a11ywrapper.h  |2 +-
 vcl/inc/osx/salframeview.h |2 +-
 vcl/osx/a11ywrapper.mm |8 
 vcl/osx/salframeview.mm|6 ++
 4 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 3c7530411e8f466d9949d998ec40773e4e9a762e
Author: Herbert Dürr h...@apache.org
Date:   Thu Feb 6 14:07:50 2014 +

Related: #i123795# add a windowForParent() method for AquaA11yWrapper

for getting the parent window of an A11y enabled NSView. The method
viewElementForParent() was abused for that purpose, but it was mis-named
and mis-typed. The new method cleans this up and the now unused
viewElementForParent() method can be retired.

(cherry picked from commit 96cd47d49a3aa5b1e3b96b649f40e516ca568d4b)

Conflicts:
vcl/osx/a11ywrapper.mm
vcl/osx/salframeview.mm

Change-Id: Ib88aa1ad442d3b8fb3adbf7a76b3ed8ca268fa87

(cherry picked from commit a7d6569fdecc36bd5ca093442a9b7aec093637d5)

diff --git a/vcl/inc/osx/a11ywrapper.h b/vcl/inc/osx/a11ywrapper.h
index 7f291b4..a49230b 100644
--- a/vcl/inc/osx/a11ywrapper.h
+++ b/vcl/inc/osx/a11ywrapper.h
@@ -86,7 +86,7 @@ struct ReferenceWrapper
 // Wrapper-specific
 -(void)setActsAsRadioGroup:(BOOL)actsAsRadioGroup;
 -(BOOL)actsAsRadioGroup;
--(NSView *)viewElementForParent;
+-(NSWindow*)windowForParent;
 -(id)initWithAccessibleContext: (::com::sun::star::uno::Reference  
::com::sun::star::accessibility::XAccessibleContext ) anAccessibleContext;
 -(void) setDefaults: (::com::sun::star::uno::Reference  
::com::sun::star::accessibility::XAccessibleContext ) rxAccessibleContext;
 -(void) dealloc;
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index db3d588..fa3222e 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -174,7 +174,7 @@
 -(void)resetCursorRects;
 -(::com::sun::star::accessibility::XAccessibleContext *)accessibleContext;
 -(id)parentAttribute;
--(NSView *)viewElementForParent;
+-(NSWindow*)windowForParent;
 /*
   Event hook for DD service.
 
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 85ee3ff..da7f202 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -397,8 +397,8 @@ static std::ostream operator(std::ostream s, NSPoint 
point) {
 [ aWrapper autorelease ];
 }
 // get associated NSWindow
-NSView * theView = [ aWrapper viewElementForParent ];
-return theView;
+NSWindow* theWindow = [ aWrapper windowForParent ];
+return theWindow;
 }
 
 -(id)topLevelUIElementAttribute {
@@ -1125,8 +1125,8 @@ Reference  XAccessibleContext  hitTestRunner ( 
com::sun::star::awt::Point poin
 return mpReferenceWrapper - rAccessibleTextMarkup.get();
 }
 
--(NSView *)viewElementForParent {
-return self;
+-(NSWindow*)windowForParent {
+return [self window];
 }
 
 // These four are for AXTextAreas only. They are needed, because bold and 
italic
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 3fc5124..a8fda42 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1740,11 +1740,9 @@ private:
 return [ super accessibleContext ];
 }
 
--(NSView*)viewElementForParent
+-(NSWindow*)windowForParent
 {
-// Interestingly enough, despite being declared as returning a NSView*, 
what this method actually
-// does return is a NSWindow*, and that is what the caller expects. Go 
figure.
-return (NSView*) mpFrame-getNSWindow();
+return mpFrame-getNSWindow();
 }
 
 -(void)registerMouseEventListener: (id)theListener
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/unx vcl/win

2014-01-12 Thread Caolán McNamara
 vcl/inc/salwtype.hxx|1 -
 vcl/osx/salframeview.mm |3 ---
 vcl/unx/generic/app/i18n_cb.cxx |1 -
 vcl/unx/generic/app/i18n_ic.cxx |3 ---
 vcl/unx/generic/window/salframe.cxx |3 ---
 vcl/unx/gtk/window/gtksalframe.cxx  |3 ---
 vcl/win/source/window/salframe.cxx  |2 --
 7 files changed, 16 deletions(-)

New commits:
commit 3709fe0e2e9336787f3d18b8ae4a1ff2ef5608e6
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Jan 11 21:01:19 2014 +

mnDeltaStart is unused

Change-Id: I4f970a150b8ecf6e5631c89ae78ae97134c78d7c

diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index de9e2a4..770c025 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -177,7 +177,6 @@ struct SalExtTextInputEvent
 OUStringmaText; // Text
 const sal_uInt16*   mpTextAttr; // Text-Attribute
 sal_uLong   mnCursorPos;// Cursor-Position
-sal_uLong   mnDeltaStart;   // Start-Position of last change
 sal_uInt8   mnCursorFlags;  // EXTTEXTINPUT_CURSOR_xxx
 sal_BoolmbOnlyCursor;   // sal_True: Only Cursor-Position has 
been changed
 };
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 81ae1cd..cc4b768 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1084,7 +1084,6 @@ private:
 aEvent.maText   = aInsertString;
 aEvent.mpTextAttr   = NULL;
 aEvent.mnCursorPos  = aInsertString.getLength();
-aEvent.mnDeltaStart = 0;
 aEvent.mnCursorFlags= 0;
 aEvent.mbOnlyCursor = FALSE;
 mpFrame-CallCallback( SALEVENT_EXTTEXTINPUT, aEvent );
@@ -1099,7 +1098,6 @@ private:
 aEvent.maText   = OUString();
 aEvent.mpTextAttr   = NULL;
 aEvent.mnCursorPos  = 0;
-aEvent.mnDeltaStart = 0;
 aEvent.mnCursorFlags= 0;
 aEvent.mbOnlyCursor = FALSE;
 mpFrame-CallCallback( SALEVENT_EXTTEXTINPUT, aEvent );
@@ -1612,7 +1610,6 @@ private:
 int len = [aString length];
 SalExtTextInputEvent aInputEvent;
 aInputEvent.mnTime = mpFrame-mnLastEventTime;
-aInputEvent.mnDeltaStart = 0;
 aInputEvent.mbOnlyCursor = FALSE;
 if( len  0 ) {
 NSString *pString = [aString string];
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index 6c34568..b5c2f77 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -386,7 +386,6 @@ PreeditDrawCallback(XIC ic, XPointer client_data,
 pPreeditData-aInputEv.maText = 
OUString(pPreeditData-aText.pUnicodeBuffer,
 pPreeditData-aText.nLength);
 pPreeditData-aInputEv.mnCursorFlags= 0; // default: make cursor 
visible
-pPreeditData-aInputEv.mnDeltaStart = 0; // call_data-chg_first;
 pPreeditData-aInputEv.mbOnlyCursor = False;
 
 if ( pPreeditData-eState == ePreeditStatusActive  pPreeditData-pFrame )
diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx
index 3348a4f..345f4f7 100644
--- a/vcl/unx/generic/app/i18n_ic.cxx
+++ b/vcl/unx/generic/app/i18n_ic.cxx
@@ -50,7 +50,6 @@ static void sendEmptyCommit( SalFrame* pFrame )
 aEmptyEv.maText = ;
 aEmptyEv.mnCursorPos= 0;
 aEmptyEv.mnCursorFlags  = 0;
-aEmptyEv.mnDeltaStart   = 0;
 aEmptyEv.mbOnlyCursor   = False;
 pFrame-CallCallback( SALEVENT_EXTTEXTINPUT, (void*)aEmptyEv );
 if( ! aDel.isDeleted() )
@@ -170,7 +169,6 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame 
*pFrame ) :
 maClientData.aInputEv.mnTime= 0;
 maClientData.aInputEv.mpTextAttr= NULL;
 maClientData.aInputEv.mnCursorPos   = 0;
-maClientData.aInputEv.mnDeltaStart  = 0;
 maClientData.aInputEv.mnCursorFlags = 0;
 maClientData.aInputEv.mbOnlyCursor  = sal_False;
 
@@ -570,7 +568,6 @@ SalI18N_InputContext::CommitKeyEvent(sal_Unicode* pText, 
sal_Size nLength)
 aTextEvent.mnCursorPos   = nLength;
 aTextEvent.maText= OUString(pText, nLength);
 aTextEvent.mnCursorFlags = 0;
-aTextEvent.mnDeltaStart  = 0;
 aTextEvent.mbOnlyCursor  = False;
 
 maClientData.pFrame-CallCallback(SALEVENT_EXTTEXTINPUT,
(void*)aTextEvent);
diff --git a/vcl/unx/generic/window/salframe.cxx 
b/vcl/unx/generic/window/salframe.cxx
index ee04b72..ee1abf8 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2974,7 +2974,6 @@ void X11SalFrame::beginUnicodeSequence()
 aEv.maText  = rSeq;
 aEv.mpTextAttr  = nTextAttr;
 aEv.mnCursorPos = 0;
-aEv.mnDeltaStart= 0;
 aEv.mnCursorFlags   = 0;
 aEv.mbOnlyCursor= sal_False;
 
@@ -3004,7 +3003,6 @@ bool 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2013-12-18 Thread Tor Lillqvist
 vcl/inc/headless/svpgdi.hxx |4 
 vcl/inc/quartz/salgdi.h |8 ++--
 vcl/osx/salprn.cxx  |2 +-
 vcl/quartz/ctfonts.cxx  |   10 +-
 vcl/quartz/salgdi.cxx   |4 +---
 vcl/quartz/salgdicommon.cxx |7 ++-
 vcl/quartz/salgdiutils.cxx  |3 +--
 7 files changed, 12 insertions(+), 26 deletions(-)

New commits:
commit 0d9c4baf86c502e7cc2b6072a530c6fad2179abe
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Dec 19 00:04:55 2013 +0200

The fake DPI scale was always 1

Thanks to kendy for noticing.

Change-Id: I6b62d5a0c1dc5df374629a8f7c6e7d2f7cd7ffbd

diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 1135c7d..c3ffc65 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -74,10 +74,6 @@ class SvpSalGraphics : public SalGraphics
 int mnWidth;
 int mnHeight;
 int  mnBitmapDepth;  // zero unless bitmap
-/// some graphics implementations (e.g. AquaSalInfoPrinter) scale
-/// everything down by a factor (see SetupPrinterGraphics for details)
-/// so we have to compensate for it with the inverse factor
-double   mfFakeDPIScale;
 
 /// path representing current clip region
 CGMutablePathRefmxClipPath;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 49140fa..e0b86c3 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -92,7 +92,7 @@ public:
 
 SalLayout* GetTextLayout( void ) const;
 
-void   GetFontMetric( float fPDIY, ImplFontMetricData ) const;
+void   GetFontMetric( ImplFontMetricData ) const;
 bool   GetGlyphBoundRect( sal_GlyphId, Rectangle ) const;
 bool   GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon ) const;
 
@@ -156,10 +156,6 @@ protected:
 /// device resolution of this graphics
 longmnRealDPIX;
 longmnRealDPIY;
-/// some graphics implementations (e.g. AquaSalInfoPrinter) scale
-/// everything down by a factor (see SetupPrinterGraphics for details)
-/// so we have to compensate for it with the inverse factor
-double  mfFakeDPIScale;
 
 /// path representing current clip region
 CGMutablePathRefmxClipPath;
@@ -194,7 +190,7 @@ public:
 boolIsBrushVisible() const  { return 
maFillColor.IsVisible(); }
 
 voidSetWindowGraphics( AquaSalFrame* pFrame );
-voidSetPrinterGraphics( CGContextRef, long nRealDPIX, long 
nRealDPIY, double fFakeScale );
+voidSetPrinterGraphics( CGContextRef, long nRealDPIX, long 
nRealDPIY );
 voidSetVirDevGraphics( CGLayerRef, CGContextRef, int 
nBitDepth = 0 );
 
 voidinitResolution( NSWindow* );
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 082fa1c..37fa0ec 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -139,7 +139,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef 
i_rContext ) const
 // scale to be top/down and reflect our virtual DPI
 CGContextScaleCTM( i_rContext, -(72.0/double(nDPIY)), 
(72.0/double(nDPIX)) );
 }
-mpGraphics-SetPrinterGraphics( i_rContext, nDPIX, nDPIY, 1.0 );
+mpGraphics-SetPrinterGraphics( i_rContext, nDPIX, nDPIY );
 }
 else
 OSL_FAIL( no print info in SetupPrinterGraphics );
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index d93d4b5..8211b9f 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -112,20 +112,20 @@ CoreTextStyle::~CoreTextStyle( void )
 
 // ---
 
-void CoreTextStyle::GetFontMetric( float fPixelSize, ImplFontMetricData 
rMetric ) const
+void CoreTextStyle::GetFontMetric( ImplFontMetricData rMetric ) const
 {
 // get the matching CoreText font handle
 // TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it 
here?
 CTFontRef aCTFontRef = (CTFontRef)CFDictionaryGetValue( mpStyleDict, 
kCTFontAttributeName );
 
-rMetric.mnAscent   = lrint( CTFontGetAscent( aCTFontRef ) * 
fPixelSize);
-rMetric.mnDescent  = lrint( CTFontGetDescent( aCTFontRef ) * 
fPixelSize);
-rMetric.mnExtLeading   = lrint( CTFontGetLeading( aCTFontRef ) * 
fPixelSize);
+rMetric.mnAscent   = CTFontGetAscent( aCTFontRef );
+rMetric.mnDescent  = CTFontGetDescent( aCTFontRef );
+rMetric.mnExtLeading   = CTFontGetLeading( aCTFontRef );
 rMetric.mnIntLeading   = 0;
 // since ImplFontMetricData::mnWidth is only used for stretching/squeezing 
fonts
 // setting this width to the pixel height of the fontsize is