本文整理汇总了C++中DashboardRegion类的典型用法代码示例。如果您正苦于以下问题:C++ DashboardRegion类的具体用法?C++ DashboardRegion怎么用?C++ DashboardRegion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DashboardRegion类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
//.........这里部分代码省略.........
append(result, rectVal->top()->cssText());
result.append(' ');
append(result, rectVal->right()->cssText());
result.append(' ');
append(result, rectVal->bottom()->cssText());
result.append(' ');
append(result, rectVal->left()->cssText());
result.append(')');
return String::adopt(result);
}
case CSS_RGBCOLOR:
case CSS_PARSER_HEXCOLOR: {
DEFINE_STATIC_LOCAL(const String, commaSpace, (", "));
DEFINE_STATIC_LOCAL(const String, rgbParen, ("rgb("));
DEFINE_STATIC_LOCAL(const String, rgbaParen, ("rgba("));
RGBA32 rgbColor = m_value.rgbcolor;
if (m_type == CSS_PARSER_HEXCOLOR)
Color::parseHexColor(m_value.string, rgbColor);
Color color(rgbColor);
Vector<UChar> result;
result.reserveInitialCapacity(32);
if (color.hasAlpha())
append(result, rgbaParen);
else
append(result, rgbParen);
appendNumber(result, static_cast<unsigned char>(color.red()));
append(result, commaSpace);
appendNumber(result, static_cast<unsigned char>(color.green()));
append(result, commaSpace);
appendNumber(result, static_cast<unsigned char>(color.blue()));
if (color.hasAlpha()) {
append(result, commaSpace);
append(result, String::number(static_cast<float>(color.alpha()) / 256.0f));
}
result.append(')');
return String::adopt(result);
}
case CSS_PAIR:
text = m_value.pair->first()->cssText();
text += " ";
text += m_value.pair->second()->cssText();
break;
#if ENABLE(DASHBOARD_SUPPORT)
case CSS_DASHBOARD_REGION:
for (DashboardRegion* region = getDashboardRegionValue(); region; region = region->m_next.get()) {
if (!text.isEmpty())
text.append(' ');
text += "dashboard-region(";
text += region->m_label;
if (region->m_isCircle)
text += " circle";
else if (region->m_isRectangle)
text += " rectangle";
else
break;
if (region->top()->m_type == CSS_IDENT && region->top()->getIdent() == CSSValueInvalid) {
ASSERT(region->right()->m_type == CSS_IDENT);
ASSERT(region->bottom()->m_type == CSS_IDENT);
ASSERT(region->left()->m_type == CSS_IDENT);
ASSERT(region->right()->getIdent() == CSSValueInvalid);
ASSERT(region->bottom()->getIdent() == CSSValueInvalid);
ASSERT(region->left()->getIdent() == CSSValueInvalid);
} else {
text.append(' ');
text += region->top()->cssText() + " ";
text += region->right()->cssText() + " ";
text += region->bottom()->cssText() + " ";
text += region->left()->cssText();
}
text += ")";
}
break;
#endif
case CSS_PARSER_VARIABLE_FUNCTION_SYNTAX:
text = "-webkit-var(";
text += m_value.string;
text += ")";
break;
case CSS_PARSER_OPERATOR: {
char c = static_cast<char>(m_value.ident);
text = String(&c, 1U);
break;
}
case CSS_PARSER_IDENTIFIER:
text = quoteStringIfNeeded(m_value.string);
break;
}
return text;
}
示例2: switch
//.........这里部分代码省略.........
break;
case CSS_STRING:
text = quoteStringIfNeeded(m_value.string);
break;
case CSS_URI:
text = "url(" + quoteURLIfNeeded(m_value.string) + ")";
break;
case CSS_IDENT:
text = valueOrPropertyName(m_value.ident);
break;
case CSS_ATTR:
// FIXME
break;
case CSS_COUNTER:
text = "counter(";
text += String::number(m_value.num);
text += ")";
// FIXME: Add list-style and separator
break;
case CSS_RECT: {
Rect* rectVal = getRectValue();
text = "rect(";
text += rectVal->top()->cssText() + " ";
text += rectVal->right()->cssText() + " ";
text += rectVal->bottom()->cssText() + " ";
text += rectVal->left()->cssText() + ")";
break;
}
case CSS_RGBCOLOR:
case CSS_PARSER_HEXCOLOR: {
RGBA32 rgbColor = m_value.rgbcolor;
if (m_type == CSS_PARSER_HEXCOLOR)
Color::parseHexColor(m_value.string, rgbColor);
Color color(rgbColor);
text = (color.alpha() < 0xFF) ? "rgba(" : "rgb(";
text += String::number(color.red()) + ", ";
text += String::number(color.green()) + ", ";
text += String::number(color.blue());
if (color.alpha() < 0xFF)
text += ", " + String::number(static_cast<float>(color.alpha()) / 0xFF);
text += ")";
break;
}
case CSS_PAIR:
text = m_value.pair->first()->cssText();
text += " ";
text += m_value.pair->second()->cssText();
break;
#if ENABLE(DASHBOARD_SUPPORT)
case CSS_DASHBOARD_REGION:
for (DashboardRegion* region = getDashboardRegionValue(); region; region = region->m_next.get()) {
if (!text.isEmpty())
text.append(' ');
text += "dashboard-region(";
text += region->m_label;
if (region->m_isCircle)
text += " circle";
else if (region->m_isRectangle)
text += " rectangle";
else
break;
if (region->top()->m_type == CSS_IDENT && region->top()->getIdent() == CSSValueInvalid) {
ASSERT(region->right()->m_type == CSS_IDENT);
ASSERT(region->bottom()->m_type == CSS_IDENT);
ASSERT(region->left()->m_type == CSS_IDENT);
ASSERT(region->right()->getIdent() == CSSValueInvalid);
ASSERT(region->bottom()->getIdent() == CSSValueInvalid);
ASSERT(region->left()->getIdent() == CSSValueInvalid);
} else {
text.append(' ');
text += region->top()->cssText() + " ";
text += region->right()->cssText() + " ";
text += region->bottom()->cssText() + " ";
text += region->left()->cssText();
}
text += ")";
}
break;
#endif
case CSS_PARSER_VARIABLE_FUNCTION_SYNTAX:
text = "-webkit-var(";
text += m_value.string;
text += ")";
break;
case CSS_PARSER_VARIABLE_EQUALS_SYNTAX:
text = "=";
text += m_value.string;
text += "=";
break;
case CSS_PARSER_VARIABLE_DOLLAR_SYNTAX:
text = "$";
text += m_value.string;
break;
case CSS_PARSER_OPERATOR:
char c = static_cast<char>(m_value.ident);
text = String(&c, 1U);
break;
}
return text;
}
示例3: ASSERT
//.........这里部分代码省略.........
Vector<LChar> result;
result.reserveInitialCapacity(32);
bool colorHasAlpha = color.hasAlpha();
if (colorHasAlpha)
result.append("rgba(", 5);
else
result.append("rgb(", 4);
appendNumber(result, static_cast<unsigned char>(color.red()));
result.append(", ", 2);
appendNumber(result, static_cast<unsigned char>(color.green()));
result.append(", ", 2);
appendNumber(result, static_cast<unsigned char>(color.blue()));
if (colorHasAlpha) {
result.append(", ", 2);
NumberToStringBuffer buffer;
const char* alphaString = numberToFixedPrecisionString(color.alpha() / 255.0f, 6, buffer, true);
result.append(alphaString, strlen(alphaString));
}
result.append(')');
text = String::adopt(result);
break;
}
case CSS_PAIR:
text = getPairValue()->cssText();
break;
#if ENABLE(DASHBOARD_SUPPORT)
case CSS_DASHBOARD_REGION: {
StringBuilder result;
for (DashboardRegion* region = getDashboardRegionValue(); region; region = region->m_next.get()) {
if (!result.isEmpty())
result.append(' ');
result.appendLiteral("dashboard-region(");
result.append(region->m_label);
if (region->m_isCircle)
result.appendLiteral(" circle");
else if (region->m_isRectangle)
result.appendLiteral(" rectangle");
else
break;
if (region->top()->m_primitiveUnitType == CSS_IDENT && region->top()->getIdent() == CSSValueInvalid) {
ASSERT(region->right()->m_primitiveUnitType == CSS_IDENT);
ASSERT(region->bottom()->m_primitiveUnitType == CSS_IDENT);
ASSERT(region->left()->m_primitiveUnitType == CSS_IDENT);
ASSERT(region->right()->getIdent() == CSSValueInvalid);
ASSERT(region->bottom()->getIdent() == CSSValueInvalid);
ASSERT(region->left()->getIdent() == CSSValueInvalid);
} else {
result.append(' ');
result.append(region->top()->cssText());
result.append(' ');
result.append(region->right()->cssText());
result.append(' ');
result.append(region->bottom()->cssText());
result.append(' ');
result.append(region->left()->cssText());
}
result.append(')');
}
text = result.toString();
break;
}
示例4: switch
bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
{
if (m_primitiveUnitType != other.m_primitiveUnitType)
return false;
switch (m_primitiveUnitType) {
case CSS_UNKNOWN:
return false;
case CSS_NUMBER:
case CSS_PARSER_INTEGER:
case CSS_PERCENTAGE:
case CSS_EMS:
case CSS_EXS:
case CSS_REMS:
case CSS_PX:
case CSS_CM:
#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
case CSS_DPPX:
case CSS_DPI:
case CSS_DPCM:
#endif
case CSS_MM:
case CSS_IN:
case CSS_PT:
case CSS_PC:
case CSS_DEG:
case CSS_RAD:
case CSS_GRAD:
case CSS_MS:
case CSS_S:
case CSS_HZ:
case CSS_KHZ:
case CSS_TURN:
case CSS_VW:
case CSS_VH:
case CSS_VMIN:
case CSS_DIMENSION:
return m_value.num == other.m_value.num;
case CSS_IDENT:
return valueOrPropertyName(m_value.ident) == valueOrPropertyName(other.m_value.ident);
case CSS_STRING:
case CSS_URI:
case CSS_ATTR:
case CSS_COUNTER_NAME:
case CSS_PARSER_IDENTIFIER:
case CSS_PARSER_HEXCOLOR:
#if ENABLE(CSS_VARIABLES)
case CSS_VARIABLE_NAME:
#endif
return equal(m_value.string, other.m_value.string);
case CSS_COUNTER:
return m_value.counter && other.m_value.counter && m_value.counter->equals(*other.m_value.counter);
case CSS_RECT:
return m_value.rect && other.m_value.rect && m_value.rect->equals(*other.m_value.rect);
case CSS_QUAD:
return m_value.quad && other.m_value.quad && m_value.quad->equals(*other.m_value.quad);
case CSS_RGBCOLOR:
return m_value.rgbcolor == other.m_value.rgbcolor;
case CSS_PAIR:
return m_value.pair && other.m_value.pair && m_value.pair->equals(*other.m_value.pair);
#if ENABLE(DASHBOARD_SUPPORT)
case CSS_DASHBOARD_REGION: {
DashboardRegion* region = getDashboardRegionValue();
DashboardRegion* otherRegion = other.getDashboardRegionValue();
return region ? otherRegion && region->equals(*otherRegion) : !otherRegion;
}
#endif
case CSS_PARSER_OPERATOR:
return m_value.ident == other.m_value.ident;
case CSS_CALC:
return m_value.calc && other.m_value.calc && m_value.calc->equals(*other.m_value.calc);
case CSS_SHAPE:
return m_value.shape && other.m_value.shape && m_value.shape->equals(*other.m_value.shape);
}
return false;
}
示例5: switch
//.........这里部分代码省略.........
text = String::number(m_value.num) + "mm";
break;
case CSS_IN:
text = String::number(m_value.num) + "in";
break;
case CSS_PT:
text = String::number(m_value.num) + "pt";
break;
case CSS_PC:
text = String::number(m_value.num) + "pc";
break;
case CSS_DEG:
text = String::number(m_value.num) + "deg";
break;
case CSS_RAD:
text = String::number(m_value.num) + "rad";
break;
case CSS_GRAD:
text = String::number(m_value.num) + "grad";
break;
case CSS_MS:
text = String::number(m_value.num) + "ms";
break;
case CSS_S:
text = String::number(m_value.num) + "s";
break;
case CSS_HZ:
text = String::number(m_value.num) + "hz";
break;
case CSS_KHZ:
text = String::number(m_value.num) + "khz";
break;
case CSS_DIMENSION:
// ###
break;
case CSS_STRING:
text = quoteStringIfNeeded(m_value.string);
break;
case CSS_URI:
text = "url(" + String(m_value.string) + ")";
break;
case CSS_IDENT:
text = getValueName(m_value.ident);
break;
case CSS_ATTR:
// ###
break;
case CSS_COUNTER:
// ###
break;
case CSS_RECT: {
RectImpl* rectVal = getRectValue();
text = "rect(";
text += rectVal->top()->cssText() + " ";
text += rectVal->right()->cssText() + " ";
text += rectVal->bottom()->cssText() + " ";
text += rectVal->left()->cssText() + ")";
break;
}
case CSS_RGBCOLOR: {
Color color(m_value.rgbcolor);
if (color.alpha() < 0xFF)
text = "rgba(";
else
text = "rgb(";
text += String::number(color.red()) + ", ";
text += String::number(color.green()) + ", ";
text += String::number(color.blue());
if (color.alpha() < 0xFF)
text += ", " + String::number((float)color.alpha() / 0xFF);
text += ")";
break;
}
case CSS_PAIR:
text = m_value.pair->first()->cssText();
text += " ";
text += m_value.pair->second()->cssText();
break;
#if __APPLE__
case CSS_DASHBOARD_REGION:
for (DashboardRegion* region = getDashboardRegionValue(); region; region = region->m_next.get()) {
text = "dashboard-region(";
text += region->m_label;
if (region->m_isCircle)
text += " circle ";
else if (region->m_isRectangle)
text += " rectangle ";
else
break;
text += region->top()->cssText() + " ";
text += region->right()->cssText() + " ";
text += region->bottom()->cssText() + " ";
text += region->left()->cssText();
text += ")";
}
break;
#endif
}
return text;
}