2007-03-22 10:30:00 -07:00
|
|
|
/* vim: set sw=4 sts=4 et cin: */
|
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_OS2_PLATFORM_H
|
|
|
|
#define GFX_OS2_PLATFORM_H
|
|
|
|
|
|
|
|
#define INCL_GPIBITMAPS
|
|
|
|
#include <os2.h>
|
|
|
|
|
|
|
|
#include "gfxPlatform.h"
|
2008-07-20 11:51:49 -07:00
|
|
|
#include "gfxOS2Fonts.h"
|
|
|
|
#include "gfxFontUtils.h"
|
2009-01-18 12:14:14 -08:00
|
|
|
#include "nsTArray.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-05-20 06:45:49 -07:00
|
|
|
class gfxFontconfigUtils;
|
|
|
|
|
2013-05-29 14:59:24 -07:00
|
|
|
class gfxOS2Platform : public gfxPlatform {
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
gfxOS2Platform();
|
|
|
|
virtual ~gfxOS2Platform();
|
|
|
|
|
|
|
|
static gfxOS2Platform *GetPlatform() {
|
|
|
|
return (gfxOS2Platform*) gfxPlatform::GetPlatform();
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<gfxASurface>
|
|
|
|
CreateOffscreenSurface(const gfxIntSize& size,
|
2013-09-24 13:45:13 -07:00
|
|
|
gfxContentType contentType);
|
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-05-20 06:45:49 -07:00
|
|
|
nsresult UpdateFontList();
|
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);
|
2008-03-13 03:32:50 -07:00
|
|
|
nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-04-02 12:06:16 -07:00
|
|
|
gfxFontGroup *CreateFontGroup(const nsAString &aFamilies,
|
2008-10-08 22:52:00 -07:00
|
|
|
const gfxFontStyle *aStyle,
|
2008-09-30 20:01:53 -07:00
|
|
|
gfxUserFontSet *aUserFontSet);
|
2008-07-20 11:51:49 -07: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 08:56:38 -07:00
|
|
|
already_AddRefed<gfxOS2Font> FindFontForChar(uint32_t aCh, gfxOS2Font *aFont);
|
2008-07-20 11:51:49 -07:00
|
|
|
|
|
|
|
// return true if it's already known that we don't have a font for this char
|
2012-08-22 08:56:38 -07:00
|
|
|
bool noFontWithChar(uint32_t aCh) {
|
2008-07-20 11:51:49 -07:00
|
|
|
return mCodepointsWithNoFonts.test(aCh);
|
|
|
|
}
|
|
|
|
|
2007-05-20 06:45:49 -07:00
|
|
|
protected:
|
|
|
|
static gfxFontconfigUtils *sFontconfigUtils;
|
2008-07-20 11:51:49 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
// when font lookup fails for a character, cache it to skip future searches
|
|
|
|
gfxSparseBitSet mCodepointsWithNoFonts;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_OS2_PLATFORM_H */
|