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