2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 04:12:37 -07:00
|
|
|
* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef GFX_PLATFORM_MAC_H
|
|
|
|
#define GFX_PLATFORM_MAC_H
|
|
|
|
|
2008-01-30 16:23:36 -08:00
|
|
|
#include "nsTArray.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "gfxPlatform.h"
|
|
|
|
|
2008-04-18 02:11:47 -07:00
|
|
|
#define MAC_OS_X_VERSION_10_4_HEX 0x00001040
|
|
|
|
#define MAC_OS_X_VERSION_10_5_HEX 0x00001050
|
2009-12-10 12:18:14 -08:00
|
|
|
#define MAC_OS_X_VERSION_10_6_HEX 0x00001060
|
2011-11-03 07:50:40 -07:00
|
|
|
#define MAC_OS_X_VERSION_10_7_HEX 0x00001070
|
2009-12-10 12:18:14 -08:00
|
|
|
|
|
|
|
#define MAC_OS_X_MAJOR_VERSION_MASK 0xFFFFFFF0U
|
2008-04-18 02:11:47 -07:00
|
|
|
|
2009-03-29 17:31:51 -07:00
|
|
|
class gfxTextRun;
|
2012-03-08 18:05:24 -08:00
|
|
|
class gfxFontFamily;
|
2012-01-09 10:54:44 -08:00
|
|
|
class mozilla::gfx::DrawTarget;
|
2009-03-29 17:31:51 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
class THEBES_API gfxPlatformMac : public gfxPlatform {
|
|
|
|
public:
|
|
|
|
gfxPlatformMac();
|
2009-03-29 17:31:51 -07:00
|
|
|
virtual ~gfxPlatformMac();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static gfxPlatformMac *GetPlatform() {
|
|
|
|
return (gfxPlatformMac*) gfxPlatform::GetPlatform();
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<gfxASurface> CreateOffscreenSurface(const gfxIntSize& size,
|
2010-09-16 14:34:53 -07:00
|
|
|
gfxASurface::gfxContentType contentType);
|
2012-06-25 19:43:31 -07:00
|
|
|
virtual already_AddRefed<gfxASurface>
|
|
|
|
CreateOffscreenImageSurface(const gfxIntSize& aSize,
|
|
|
|
gfxASurface::gfxContentType aContentType);
|
2011-11-02 12:55:03 -07:00
|
|
|
|
2008-07-01 21:19:37 -07:00
|
|
|
already_AddRefed<gfxASurface> OptimizeImage(gfxImageSurface *aSurface,
|
|
|
|
gfxASurface::gfxImageFormat format);
|
2011-11-02 12:55:03 -07:00
|
|
|
|
|
|
|
mozilla::RefPtr<mozilla::gfx::ScaledFont>
|
|
|
|
GetScaledFontForFont(gfxFont *aFont);
|
2008-02-05 22:48:47 -08:00
|
|
|
|
2011-11-17 20:00:38 -08:00
|
|
|
virtual bool SupportsAzure(mozilla::gfx::BackendType& aBackend);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult ResolveFontName(const nsAString& aFontName,
|
|
|
|
FontResolverCallback aCallback,
|
2011-09-28 23:19:26 -07:00
|
|
|
void *aClosure, bool& aAborted);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-03-13 03:32:50 -07:00
|
|
|
nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
|
|
|
|
|
2007-04-02 12:06:16 -07:00
|
|
|
gfxFontGroup *CreateFontGroup(const nsAString &aFamilies,
|
2008-09-30 20:01:53 -07:00
|
|
|
const gfxFontStyle *aStyle,
|
|
|
|
gfxUserFontSet *aUserFontSet);
|
|
|
|
|
2009-01-02 19:21:49 -08:00
|
|
|
virtual gfxFontEntry* LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
|
|
|
|
const nsAString& aFontName);
|
2008-09-30 20:01:53 -07:00
|
|
|
|
2009-08-16 06:52:12 -07:00
|
|
|
virtual gfxPlatformFontList* CreatePlatformFontList();
|
|
|
|
|
2008-12-05 15:19:27 -08:00
|
|
|
virtual gfxFontEntry* MakePlatformFont(const gfxProxyFontEntry *aProxyEntry,
|
|
|
|
const PRUint8 *aFontData,
|
|
|
|
PRUint32 aLength);
|
2008-09-30 20:01:53 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsFontFormatSupported(nsIURI *aFontURI, PRUint32 aFormatFlags);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-02-24 09:57:57 -08:00
|
|
|
nsresult GetFontList(nsIAtom *aLangGroup,
|
2007-03-22 10:30:00 -07:00
|
|
|
const nsACString& aGenericFamily,
|
2009-01-18 12:14:14 -08:00
|
|
|
nsTArray<nsString>& aListOfFonts);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult UpdateFontList();
|
2007-07-23 15:02:17 -07:00
|
|
|
|
2012-03-08 18:05:24 -08:00
|
|
|
virtual void GetCommonFallbackFonts(const PRUint32 aCh,
|
|
|
|
PRInt32 aRunScript,
|
|
|
|
nsTArray<const char*>& aFontList);
|
|
|
|
|
2008-04-18 02:11:47 -07:00
|
|
|
// Returns the OS X version as returned from Gestalt(gestaltSystemVersion, ...)
|
|
|
|
// Ex: Mac OS X 10.4.x ==> 0x104x
|
|
|
|
PRInt32 OSXVersion();
|
|
|
|
|
2008-05-01 02:07:17 -07:00
|
|
|
// lower threshold on font anti-aliasing
|
|
|
|
PRUint32 GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; }
|
2009-03-29 17:31:51 -07:00
|
|
|
|
2012-01-09 10:54:44 -08:00
|
|
|
virtual already_AddRefed<gfxASurface>
|
|
|
|
GetThebesSurfaceForDrawTarget(mozilla::gfx::DrawTarget *aTarget);
|
2007-07-23 15:02:17 -07:00
|
|
|
private:
|
2009-04-07 09:02:11 -07:00
|
|
|
virtual qcms_profile* GetPlatformCMSOutputProfile();
|
2008-01-30 16:23:36 -08:00
|
|
|
|
2008-05-01 02:07:17 -07:00
|
|
|
// read in the pref value for the lower threshold on font anti-aliasing
|
|
|
|
static PRUint32 ReadAntiAliasingThreshold();
|
|
|
|
|
2008-04-18 02:11:47 -07:00
|
|
|
PRInt32 mOSXVersion;
|
2008-05-01 02:07:17 -07:00
|
|
|
PRUint32 mFontAntiAliasingThreshold;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_PLATFORM_MAC_H */
|