2018-03-19 02:04:25 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ViewProps.h"
|
|
|
|
|
2018-07-15 23:46:31 +00:00
|
|
|
#include <fabric/components/view/conversions.h>
|
2018-04-27 00:51:59 +00:00
|
|
|
#include <fabric/core/propsConversions.h>
|
2018-05-14 22:43:28 +00:00
|
|
|
#include <fabric/debug/debugStringConvertibleUtils.h>
|
2018-05-14 22:43:48 +00:00
|
|
|
#include <fabric/graphics/conversions.h>
|
2018-03-19 02:04:25 +00:00
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
2018-05-14 22:43:28 +00:00
|
|
|
ViewProps::ViewProps(const YGStyle &yogaStyle):
|
|
|
|
YogaStylableProps(yogaStyle) {}
|
2018-04-10 19:45:43 +00:00
|
|
|
|
2018-05-14 22:43:28 +00:00
|
|
|
ViewProps::ViewProps(const ViewProps &sourceProps, const RawProps &rawProps):
|
|
|
|
Props(sourceProps, rawProps),
|
|
|
|
YogaStylableProps(sourceProps, rawProps),
|
2018-06-24 02:10:08 +00:00
|
|
|
opacity(convertRawProp(rawProps, "opacity", sourceProps.opacity, (Float)1.0)),
|
2018-06-15 18:25:19 +00:00
|
|
|
foregroundColor(convertRawProp(rawProps, "foregroundColor", sourceProps.foregroundColor)),
|
|
|
|
backgroundColor(convertRawProp(rawProps, "backgroundColor", sourceProps.backgroundColor)),
|
|
|
|
borderWidth(convertRawProp(rawProps, "borderWidth", sourceProps.borderWidth)),
|
2018-06-18 04:35:57 +00:00
|
|
|
borderRadius(convertRawProp(rawProps, "borderRadius", sourceProps.borderRadius)),
|
2018-06-15 18:25:19 +00:00
|
|
|
borderColor(convertRawProp(rawProps, "borderColor", sourceProps.borderColor)),
|
|
|
|
borderStyle(convertRawProp(rawProps, "borderStyle", sourceProps.borderStyle)),
|
|
|
|
shadowColor(convertRawProp(rawProps, "shadowColor", sourceProps.shadowColor)),
|
|
|
|
shadowOffset(convertRawProp(rawProps, "shadowOffset", sourceProps.shadowOffset)),
|
|
|
|
shadowOpacity(convertRawProp(rawProps, "shadowOpacity", sourceProps.shadowOpacity)),
|
|
|
|
shadowRadius(convertRawProp(rawProps, "shadowRadius", sourceProps.shadowRadius)),
|
2018-06-15 18:25:28 +00:00
|
|
|
transform(convertRawProp(rawProps, "transform", sourceProps.transform)),
|
2018-06-15 18:25:19 +00:00
|
|
|
backfaceVisibility(convertRawProp(rawProps, "backfaceVisibility", sourceProps.backfaceVisibility)),
|
|
|
|
shouldRasterize(convertRawProp(rawProps, "shouldRasterize", sourceProps.shouldRasterize)),
|
|
|
|
zIndex(convertRawProp(rawProps, "zIndex", sourceProps.zIndex)),
|
|
|
|
pointerEvents(convertRawProp(rawProps, "pointerEvents", sourceProps.pointerEvents)),
|
2018-06-23 01:31:42 +00:00
|
|
|
hitSlop(convertRawProp(rawProps, "hitSlop", sourceProps.hitSlop)),
|
|
|
|
onLayout(convertRawProp(rawProps, "onLayout", sourceProps.onLayout)) {};
|
2018-04-10 19:45:43 +00:00
|
|
|
|
|
|
|
#pragma mark - DebugStringConvertible
|
|
|
|
|
2018-03-19 02:04:25 +00:00
|
|
|
SharedDebugStringConvertibleList ViewProps::getDebugProps() const {
|
2018-06-22 14:28:36 +00:00
|
|
|
const auto &defaultViewProps = ViewProps();
|
2018-05-14 22:43:51 +00:00
|
|
|
|
2018-05-14 22:43:28 +00:00
|
|
|
return
|
|
|
|
AccessibilityProps::getDebugProps() +
|
|
|
|
YogaStylableProps::getDebugProps() +
|
|
|
|
SharedDebugStringConvertibleList {
|
2018-05-14 22:43:51 +00:00
|
|
|
debugStringConvertibleItem("zIndex", zIndex, defaultViewProps.zIndex),
|
|
|
|
debugStringConvertibleItem("opacity", opacity, defaultViewProps.opacity),
|
|
|
|
debugStringConvertibleItem("foregroundColor", foregroundColor, defaultViewProps.foregroundColor),
|
|
|
|
debugStringConvertibleItem("backgroundColor", backgroundColor, defaultViewProps.backgroundColor),
|
2018-05-14 22:43:28 +00:00
|
|
|
};
|
2018-03-19 02:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace react
|
|
|
|
} // namespace facebook
|