2007-02-24 13:58:48 +03:00
|
|
|
/* vim: set sw=4 sts=4 et cin: */
|
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/. */
|
2007-02-24 13:58:48 +03:00
|
|
|
|
|
|
|
#ifndef GFX_OS2_PLATFORM_H
|
|
|
|
#define GFX_OS2_PLATFORM_H
|
|
|
|
|
|
|
|
#define INCL_GPIBITMAPS
|
|
|
|
#include <os2.h>
|
|
|
|
|
|
|
|
#include "gfxPlatform.h"
|
2008-07-20 22:51:49 +04:00
|
|
|
#include "gfxOS2Fonts.h"
|
|
|
|
#include "gfxFontUtils.h"
|
2009-01-18 23:14:14 +03:00
|
|
|
#include "nsTArray.h"
|
2007-02-24 13:58:48 +03:00
|
|
|
|
2007-05-20 17:45:49 +04:00
|
|
|
class gfxFontconfigUtils;
|
|
|
|
|
2013-05-30 01:59:24 +04:00
|
|
|
class gfxOS2Platform : public gfxPlatform {
|
2007-02-24 13:58:48 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
gfxOS2Platform();
|
|
|
|
virtual ~gfxOS2Platform();
|
|
|
|
|
|
|
|
static gfxOS2Platform *GetPlatform() {
|
|
|
|
return (gfxOS2Platform*) gfxPlatform::GetPlatform();
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<gfxASurface>
|
|
|
|
CreateOffscreenSurface(const gfxIntSize& size,
|
2010-09-17 01:34:53 +04:00
|
|
|
gfxASurface::gfxContentType contentType);
|
2007-02-24 13:58:48 +03:00
|
|
|
|
2010-02-24 20:57:57 +03:00
|
|
|
nsresult GetFontList(nsIAtom *aLangGroup,
|
2007-02-24 13:58:48 +03:00
|
|
|
const nsACString& aGenericFamily,
|
2009-01-18 23:14:14 +03:00
|
|
|
nsTArray<nsString>& aListOfFonts);
|
2007-05-20 17:45:49 +04:00
|
|
|
nsresult UpdateFontList();
|
2007-02-24 13:58:48 +03:00
|
|
|
nsresult ResolveFontName(const nsAString& aFontName,
|
|
|
|
FontResolverCallback aCallback,
|
2011-09-29 10:19:26 +04:00
|
|
|
void *aClosure, bool& aAborted);
|
2008-03-13 13:32:50 +03:00
|
|
|
nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
|
2007-02-24 13:58:48 +03:00
|
|
|
|
2007-04-02 23:06:16 +04:00
|
|
|
gfxFontGroup *CreateFontGroup(const nsAString &aFamilies,
|
2008-10-09 09:52:00 +04:00
|
|
|
const gfxFontStyle *aStyle,
|
2008-10-01 07:01:53 +04:00
|
|
|
gfxUserFontSet *aUserFontSet);
|
2008-07-20 22:51:49 +04:00
|
|
|
|
|
|
|
// Given a string and a font we already have, find the font that
|
|
|
|
// supports the most code points and most closely resembles aFont.
|
|
|
|
// This simple version involves looking at the fonts on the machine to see
|
|
|
|
// which code points they support.
|
2012-08-22 19:56:38 +04:00
|
|
|
already_AddRefed<gfxOS2Font> FindFontForChar(uint32_t aCh, gfxOS2Font *aFont);
|
2008-07-20 22:51:49 +04:00
|
|
|
|
|
|
|
// return true if it's already known that we don't have a font for this char
|
2012-08-22 19:56:38 +04:00
|
|
|
bool noFontWithChar(uint32_t aCh) {
|
2008-07-20 22:51:49 +04:00
|
|
|
return mCodepointsWithNoFonts.test(aCh);
|
|
|
|
}
|
|
|
|
|
2007-05-20 17:45:49 +04:00
|
|
|
protected:
|
|
|
|
static gfxFontconfigUtils *sFontconfigUtils;
|
2008-07-20 22:51:49 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
// when font lookup fails for a character, cache it to skip future searches
|
|
|
|
gfxSparseBitSet mCodepointsWithNoFonts;
|
2007-02-24 13:58:48 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_OS2_PLATFORM_H */
|