1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/thebes/gfxUniscribeShaper.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef GFX_UNISCRIBESHAPER_H 1.10 +#define GFX_UNISCRIBESHAPER_H 1.11 + 1.12 +#include "gfxTypes.h" 1.13 +#include "gfxGDIFont.h" 1.14 + 1.15 +#include <usp10.h> 1.16 +#include <cairo-win32.h> 1.17 + 1.18 + 1.19 +class gfxUniscribeShaper : public gfxFontShaper 1.20 +{ 1.21 +public: 1.22 + gfxUniscribeShaper(gfxGDIFont *aFont) 1.23 + : gfxFontShaper(aFont) 1.24 + , mScriptCache(nullptr) 1.25 + { 1.26 + MOZ_COUNT_CTOR(gfxUniscribeShaper); 1.27 + } 1.28 + 1.29 + virtual ~gfxUniscribeShaper() 1.30 + { 1.31 + MOZ_COUNT_DTOR(gfxUniscribeShaper); 1.32 + } 1.33 + 1.34 + virtual bool ShapeText(gfxContext *aContext, 1.35 + const char16_t *aText, 1.36 + uint32_t aOffset, 1.37 + uint32_t aLength, 1.38 + int32_t aScript, 1.39 + gfxShapedText *aShapedText); 1.40 + 1.41 + SCRIPT_CACHE *ScriptCache() { return &mScriptCache; } 1.42 + 1.43 + gfxGDIFont *GetFont() { return static_cast<gfxGDIFont*>(mFont); } 1.44 + 1.45 +private: 1.46 + SCRIPT_CACHE mScriptCache; 1.47 + 1.48 + enum { 1.49 + kUnicodeVS17 = gfxFontUtils::kUnicodeVS17, 1.50 + kUnicodeVS256 = gfxFontUtils::kUnicodeVS256 1.51 + }; 1.52 +}; 1.53 + 1.54 +#endif /* GFX_UNISCRIBESHAPER_H */