diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /widget/cocoa/nsCocoaUtils.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/cocoa/nsCocoaUtils.h')
-rw-r--r-- | widget/cocoa/nsCocoaUtils.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/widget/cocoa/nsCocoaUtils.h b/widget/cocoa/nsCocoaUtils.h index 9e3b76a920..9b36c1192d 100644 --- a/widget/cocoa/nsCocoaUtils.h +++ b/widget/cocoa/nsCocoaUtils.h @@ -18,6 +18,7 @@ #include "nsObjCExceptions.h" #include "mozilla/EventForwards.h" +#include "mozilla/MacStringHelpers.h" #include "mozilla/StaticMutex.h" #include "mozilla/StaticPtr.h" #include "nsIWidget.h" @@ -298,8 +299,9 @@ class nsCocoaUtils { static nsresult CreateNSImageFromImageContainer( imgIContainer* aImage, uint32_t aWhichFrame, const nsPresContext* aPresContext, - const mozilla::ComputedStyle* aComputedStyle, NSImage** aResult, - CGFloat scaleFactor, bool* aIsEntirelyBlack = nullptr); + const mozilla::ComputedStyle* aComputedStyle, + const NSSize& aPreferredSize, NSImage** aResult, CGFloat scaleFactor, + bool* aIsEntirelyBlack = nullptr); /** Creates a Cocoa <code>NSImage</code> from a frame of an <code>imgIContainer</code>. The new <code>NSImage</code> will have both a @@ -317,18 +319,23 @@ class nsCocoaUtils { static nsresult CreateDualRepresentationNSImageFromImageContainer( imgIContainer* aImage, uint32_t aWhichFrame, const nsPresContext* aPresContext, - const mozilla::ComputedStyle* aComputedStyle, NSImage** aResult, + const mozilla::ComputedStyle* aComputedStyle, + const NSSize& aPreferredSize, NSImage** aResult, bool* aIsEntirelyBlack = nullptr); /** * Returns nsAString for aSrc. */ - static void GetStringForNSString(const NSString* aSrc, nsAString& aDist); + static void GetStringForNSString(const NSString* aSrc, nsAString& aDist) { + mozilla::CopyNSStringToXPCOMString(aSrc, aDist); + } /** * Makes NSString instance for aString. */ - static NSString* ToNSString(const nsAString& aString); + static NSString* ToNSString(const nsAString& aString) { + return mozilla::XPCOMStringToNSString(aString); + } /** * Returns an NSURL instance for the provided string. @@ -338,7 +345,9 @@ class nsCocoaUtils { /** * Makes NSString instance for aCString. */ - static NSString* ToNSString(const nsACString& aCString); + static NSString* ToNSString(const nsACString& aCString) { + return mozilla::XPCOMStringToNSString(aCString); + } /** * Returns NSRect for aGeckoRect. |