Add operator<< for BackgroundFill.
This commit is contained in:
parent
d01cac3344
commit
51db71c250
@ -238,6 +238,11 @@ bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs) {
|
|||||||
lhs.fourth_color_ == rhs.fourth_color_;
|
lhs.fourth_color_ == rhs.fourth_color_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundFill &fill) {
|
||||||
|
return string_builder << "BackgroundFill[" << fill.top_color_ << '~' << fill.bottom_color_ << '~' << fill.third_color_
|
||||||
|
<< '~' << fill.fourth_color_ << ':' << fill.rotation_angle_ << ']';
|
||||||
|
}
|
||||||
|
|
||||||
string BackgroundType::get_mime_type() const {
|
string BackgroundType::get_mime_type() const {
|
||||||
CHECK(has_file());
|
CHECK(has_file());
|
||||||
return type_ == Type::Pattern ? "image/png" : "image/jpeg";
|
return type_ == Type::Pattern ? "image/png" : "image/jpeg";
|
||||||
@ -340,6 +345,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundType &t
|
|||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// string_builder << ' ' << type.is_blurred_ << ' ' << type.is_moving_ << ' ' << type.intensity_ << ' ' << type.fill_
|
||||||
|
// << ' ' << type.theme_name_ << ' ';
|
||||||
return string_builder << '[' << type.get_link() << ']';
|
return string_builder << '[' << type.get_link() << ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ class BackgroundFill {
|
|||||||
|
|
||||||
friend bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs);
|
friend bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs);
|
||||||
|
|
||||||
|
friend StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundFill &fill);
|
||||||
|
|
||||||
friend class BackgroundType;
|
friend class BackgroundType;
|
||||||
|
|
||||||
static Result<BackgroundFill> get_background_fill(Slice name);
|
static Result<BackgroundFill> get_background_fill(Slice name);
|
||||||
@ -63,6 +65,8 @@ class BackgroundFill {
|
|||||||
|
|
||||||
bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs);
|
bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs);
|
||||||
|
|
||||||
|
StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundFill &fill);
|
||||||
|
|
||||||
class BackgroundType {
|
class BackgroundType {
|
||||||
enum class Type : int32 { Wallpaper, Pattern, Fill, ChatTheme };
|
enum class Type : int32 { Wallpaper, Pattern, Fill, ChatTheme };
|
||||||
Type type_ = Type::Fill;
|
Type type_ = Type::Fill;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user