From c924dd126db5d029af407ae6dd1a41c3652a6a64 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 29 Jul 2014 15:51:12 -0400 Subject: Remove CSS string doLayout entrypoint and supporting code All usage is ported to the new doLayout() API now. Bug: 16651112 Change-Id: I2c959138a69853b5e30098889d771fe5f4cfaa66 --- include/minikin/CssParse.h | 108 --------------------------------------------- include/minikin/Layout.h | 5 --- 2 files changed, 113 deletions(-) delete mode 100644 include/minikin/CssParse.h (limited to 'include/minikin') diff --git a/include/minikin/CssParse.h b/include/minikin/CssParse.h deleted file mode 100644 index 259b933..0000000 --- a/include/minikin/CssParse.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MINIKIN_CSS_PARSE_H -#define MINIKIN_CSS_PARSE_H - -#include -#include - -namespace android { - -enum CssTag { - unknown, - fontScaleX, - fontSize, - fontSkewX, - fontStyle, - fontWeight, - cssLang, - letterSpacing, - minikinBidi, - minikinHinting, - minikinVariant, - paintFlags, -}; - -const std::string cssTagNames[] = { - "unknown", - "font-scale-x", - "font-size", - "font-skew-x", - "font-style", - "font-weight", - "lang", - "letter-spacing", - "-minikin-bidi", - "-minikin-hinting", - "-minikin-variant", - "-paint-flags", -}; - -class CssValue { -public: - enum Type { - UNKNOWN, - DOUBLE, - STRING - }; - enum Units { - SCALAR, - PERCENT, - PX, - EM - }; - CssValue() : mType(UNKNOWN) { } - explicit CssValue(double v) : - mType(DOUBLE), doubleValue(v), mUnits(SCALAR) { } - Type getType() const { return mType; } - double getDoubleValue() const { return doubleValue; } - int32_t getIntValue() const { return doubleValue; } - uint32_t getUintValue() const { return doubleValue; } - std::string getStringValue() const { return stringValue; } - std::string toString(CssTag tag) const; - void setDoubleValue(double v) { - mType = DOUBLE; - doubleValue = v; - } - void setStringValue(const std::string& v) { - mType = STRING; - stringValue = v; - } -private: - Type mType; - double doubleValue; - std::string stringValue; - Units mUnits; -}; - -class CssProperties { -public: - bool parse(const std::string& str); - bool hasTag(CssTag tag) const; - CssValue value(CssTag tag) const; - - // primarily for debugging - std::string toString() const; -private: - // We'll use STL map for now but can replace it with something - // more efficient if needed - std::map mMap; -}; - -} // namespace android - -#endif // MINIKIN_CSS_PARSE_H diff --git a/include/minikin/Layout.h b/include/minikin/Layout.h index cd08e00..1a0df99 100644 --- a/include/minikin/Layout.h +++ b/include/minikin/Layout.h @@ -21,7 +21,6 @@ #include -#include #include #include @@ -68,10 +67,6 @@ public: void dump() const; void setFontCollection(const FontCollection* collection); - // Deprecated. Will be removed. - void doLayout(const uint16_t* buf, size_t start, size_t count, size_t bufSize, - const std::string& css); - void doLayout(const uint16_t* buf, size_t start, size_t count, size_t bufSize, int bidiFlags, const FontStyle &style, const MinikinPaint &paint); -- cgit v1.2.3