gfx/skia/trunk/src/ports/SkFontConfigParser_android.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /*
michael@0 2 * Copyright 2011 The Android Open Source Project
michael@0 3 *
michael@0 4 * Use of this source code is governed by a BSD-style license that can be
michael@0 5 * found in the LICENSE file.
michael@0 6 */
michael@0 7
michael@0 8 #ifndef SKFONTCONFIGPARSER_ANDROID_H_
michael@0 9 #define SKFONTCONFIGPARSER_ANDROID_H_
michael@0 10
michael@0 11 #include "SkTypes.h"
michael@0 12
michael@0 13 #include "SkPaintOptionsAndroid.h"
michael@0 14 #include "SkString.h"
michael@0 15 #include "SkTDArray.h"
michael@0 16
michael@0 17 struct FontFileInfo {
michael@0 18 FontFileInfo() : fFileName(NULL) {}
michael@0 19
michael@0 20 const char* fFileName;
michael@0 21 SkPaintOptionsAndroid fPaintOptions;
michael@0 22 };
michael@0 23
michael@0 24 /**
michael@0 25 * The FontFamily data structure is created during parsing and handed back to
michael@0 26 * Skia to fold into its representation of font families. fNames is the list of
michael@0 27 * font names that alias to a font family. fontFileArray is the list of information
michael@0 28 * about each file. Order is the priority order for the font. This is
michael@0 29 * used internally to determine the order in which to place fallback fonts as
michael@0 30 * they are read from the configuration files.
michael@0 31 */
michael@0 32 struct FontFamily {
michael@0 33 FontFamily() : fIsFallbackFont(false), order(-1) {}
michael@0 34
michael@0 35 SkTDArray<const char*> fNames;
michael@0 36 SkTDArray<FontFileInfo*> fFontFiles;
michael@0 37 bool fIsFallbackFont;
michael@0 38 int order; // only used internally by SkFontConfigParser
michael@0 39 };
michael@0 40
michael@0 41 namespace SkFontConfigParser {
michael@0 42
michael@0 43 /**
michael@0 44 * Parses all system font configuration files and returns the results in an
michael@0 45 * array of FontFamily structures.
michael@0 46 */
michael@0 47 void GetFontFamilies(SkTDArray<FontFamily*> &fontFamilies);
michael@0 48
michael@0 49 /**
michael@0 50 * Parses all test font configuration files and returns the results in an
michael@0 51 * array of FontFamily structures.
michael@0 52 */
michael@0 53 void GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilies,
michael@0 54 const char* testMainConfigFile,
michael@0 55 const char* testFallbackConfigFile);
michael@0 56
michael@0 57 SkString GetLocale();
michael@0 58
michael@0 59 } // SkFontConfigParser namespace
michael@0 60
michael@0 61 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */

mercurial