📄 render_style.h
字号:
void setMinWidth(Length v) { SET_VAR(box,min_width,v) }
void setMaxWidth(Length v) { SET_VAR(box,max_width,v) }
void setMinHeight(Length v) { SET_VAR(box,min_height,v) }
void setMaxHeight(Length v) { SET_VAR(box,max_height,v) }
#if APPLE_CHANGES
QValueList<StyleDashboardRegion> dashboardRegions() const { return css3NonInheritedData->m_dashboardRegions; }
void setDashboardRegions(QValueList<StyleDashboardRegion> regions) { SET_VAR(css3NonInheritedData,m_dashboardRegions,regions); }
void setDashboardRegion (int type, QString label, Length t, Length r, Length b, Length l, bool append) {
StyleDashboardRegion region;
region.label = label;
region.offset.top = t;
region.offset.right = r;
region.offset.bottom = b;
region.offset.left = l;
region.type = type;
if (!append) {
css3NonInheritedData.access()->m_dashboardRegions.clear ();
}
css3NonInheritedData.access()->m_dashboardRegions.append (region);
}
#endif
void resetBorderTop() { SET_VAR(surround, border.top, BorderValue()) }
void resetBorderRight() { SET_VAR(surround, border.right, BorderValue()) }
void resetBorderBottom() { SET_VAR(surround, border.bottom, BorderValue()) }
void resetBorderLeft() { SET_VAR(surround, border.left, BorderValue()) }
void resetOutline() { SET_VAR(background, m_outline, OutlineValue()) }
void setBackgroundColor(const QColor& v) { SET_VAR(background, m_color, v) }
void setBorderLeftWidth(unsigned short v) { SET_VAR(surround,border.left.width,v) }
void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround,border.left.style,v) }
void setBorderLeftColor(const QColor & v) { SET_VAR(surround,border.left.color,v) }
void setBorderRightWidth(unsigned short v) { SET_VAR(surround,border.right.width,v) }
void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround,border.right.style,v) }
void setBorderRightColor(const QColor & v) { SET_VAR(surround,border.right.color,v) }
void setBorderTopWidth(unsigned short v) { SET_VAR(surround,border.top.width,v) }
void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround,border.top.style,v) }
void setBorderTopColor(const QColor & v) { SET_VAR(surround,border.top.color,v) }
void setBorderBottomWidth(unsigned short v) { SET_VAR(surround,border.bottom.width,v) }
void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround,border.bottom.style,v) }
void setBorderBottomColor(const QColor & v) { SET_VAR(surround,border.bottom.color,v) }
void setOutlineWidth(unsigned short v) { SET_VAR(background,m_outline.width,v) }
void setOutlineStyle(EBorderStyle v, bool isAuto = false)
{
SET_VAR(background,m_outline.style,v)
SET_VAR(background,m_outline._auto, isAuto)
}
void setOutlineColor(const QColor & v) { SET_VAR(background,m_outline.color,v) }
void setOverflow(EOverflow v) { noninherited_flags._overflow = v; }
void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
void setVerticalAlign(EVerticalAlign v) { noninherited_flags._vertical_align = v; }
void setVerticalAlignLength(Length l) { SET_VAR(box, vertical_align, l ) }
void setHasClip(bool b = true) { SET_VAR(visual,hasClip,b) }
void setClipLeft(Length v) { SET_VAR(visual,clip.left,v) }
void setClipRight(Length v) { SET_VAR(visual,clip.right,v) }
void setClipTop(Length v) { SET_VAR(visual,clip.top,v) }
void setClipBottom(Length v) { SET_VAR(visual,clip.bottom,v) }
void setClip( Length top, Length right, Length bottom, Length left );
void setUnicodeBidi( EUnicodeBidi b ) { noninherited_flags._unicodeBidi = b; }
void setClear(EClear v) { noninherited_flags._clear = v; }
void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
void ssetColSpan(short v) { SET_VAR(visual,colspan,v) }
bool setFontDef(const khtml::FontDef & v) {
// bah, this doesn't compare pointers. broken! (Dirk)
if (!(inherited->font.fontDef == v)) {
inherited.access()->font = Font( v, inherited->font.letterSpacing, inherited->font.wordSpacing );
return true;
}
return false;
}
void setColor(const QColor & v) { SET_VAR(inherited,color,v) }
void setTextIndent(Length v) { SET_VAR(inherited,indent,v) }
void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
void addToTextDecorationsInEffect(int v) { inherited_flags._text_decorations |= v; }
void setTextDecorationsInEffect(int v) { inherited_flags._text_decorations = v; }
void setTextDecoration(int v) { SET_VAR(visual, textDecoration, v); }
void setDirection(EDirection v) { inherited_flags._direction = v; }
void setLineHeight(Length v) { SET_VAR(inherited,line_height,v) }
void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
void setWordSpacing(int v) { SET_VAR(inherited,font.wordSpacing,v) }
void setLetterSpacing(int v) { SET_VAR(inherited,font.letterSpacing,v) }
void clearBackgroundLayers() { background.access()->m_background = BackgroundLayer(); }
void inheritBackgroundLayers(const BackgroundLayer& parent) { background.access()->m_background = parent; }
void adjustBackgroundLayers();
void setBorderCollapse(bool collapse) { inherited_flags._border_collapse = collapse; }
void setHorizontalBorderSpacing(short v) { SET_VAR(inherited,horizontal_border_spacing,v) }
void setVerticalBorderSpacing(short v) { SET_VAR(inherited,vertical_border_spacing,v) }
void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
void setCounterIncrement(short v) { SET_VAR(visual,counter_increment,v) }
void setCounterReset(short v) { SET_VAR(visual,counter_reset,v) }
void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
void setListStyleImage(CachedImage *v) { SET_VAR(inherited,style_image,v)}
void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
void setMarginTop(Length v) { SET_VAR(surround,margin.top,v) }
void setMarginBottom(Length v) { SET_VAR(surround,margin.bottom,v) }
void setMarginLeft(Length v) { SET_VAR(surround,margin.left,v) }
void setMarginRight(Length v) { SET_VAR(surround,margin.right,v) }
void resetPadding() { SET_VAR(surround, padding, LengthBox(Variable)) }
void setPaddingTop(Length v) { SET_VAR(surround,padding.top,v) }
void setPaddingBottom(Length v) { SET_VAR(surround,padding.bottom,v) }
void setPaddingLeft(Length v) { SET_VAR(surround,padding.left,v) }
void setPaddingRight(Length v) { SET_VAR(surround,padding.right,v) }
void setCursor( ECursor c ) { inherited_flags._cursor_style = c; }
void setCursorImage( CachedImage *v ) { SET_VAR(inherited,cursor_image,v) }
bool forceBackgroundsToWhite() const { return inherited_flags._force_backgrounds_to_white; }
void setForceBackgroundsToWhite(bool b=true) { inherited_flags._force_backgrounds_to_white = b; }
bool htmlHacks() const { return inherited_flags._htmlHacks; }
void setHtmlHacks(bool b=true) { inherited_flags._htmlHacks = b; }
bool hasAutoZIndex() { return box->z_auto; }
void setHasAutoZIndex() { SET_VAR(box, z_auto, true); SET_VAR(box, z_index, 0) }
int zIndex() const { return box->z_index; }
void setZIndex(int v) { SET_VAR(box, z_auto, false); SET_VAR(box, z_index, v) }
void setWidows(short w) { SET_VAR(inherited, widows, w); }
void setOrphans(short o) { SET_VAR(inherited, orphans, o); }
void setPageBreakInside(EPageBreak b) { SET_VAR(inherited, page_break_inside, b); }
void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
// CSS3 Setters
#ifndef KHTML_NO_XBL
void deleteBindingURIs() {
delete css3NonInheritedData->bindingURI;
SET_VAR(css3NonInheritedData, bindingURI, 0);
}
void inheritBindingURIs(BindingURI* other) {
SET_VAR(css3NonInheritedData, bindingURI, other->copy());
}
void addBindingURI(DOM::DOMStringImpl* uri);
#endif
void setOutlineOffset(unsigned short v) { SET_VAR(background, m_outline._offset, v) }
void setTextShadow(ShadowData* val, bool add=false);
void setOpacity(float f) { SET_VAR(css3NonInheritedData, opacity, f); }
void setBoxAlign(EBoxAlignment a) { SET_VAR(css3NonInheritedData.access()->flexibleBox, align, a); }
void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
void setBoxFlex(float f) { SET_VAR(css3NonInheritedData.access()->flexibleBox, flex, f); }
void setBoxFlexGroup(unsigned int fg) { SET_VAR(css3NonInheritedData.access()->flexibleBox, flex_group, fg); }
void setBoxLines(EBoxLines l) { SET_VAR(css3NonInheritedData.access()->flexibleBox, lines, l); }
void setBoxOrdinalGroup(unsigned int og) { SET_VAR(css3NonInheritedData.access()->flexibleBox, ordinal_group, og); }
void setBoxOrient(EBoxOrient o) { SET_VAR(css3NonInheritedData.access()->flexibleBox, orient, o); }
void setBoxPack(EBoxAlignment p) { SET_VAR(css3NonInheritedData.access()->flexibleBox, pack, p); }
void setMarqueeIncrement(const Length& f) { SET_VAR(css3NonInheritedData.access()->marquee, increment, f); }
void setMarqueeSpeed(int f) { SET_VAR(css3NonInheritedData.access()->marquee, speed, f); }
void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(css3NonInheritedData.access()->marquee, direction, d); }
void setMarqueeBehavior(EMarqueeBehavior b) { SET_VAR(css3NonInheritedData.access()->marquee, behavior, b); }
void setMarqueeLoopCount(int i) { SET_VAR(css3NonInheritedData.access()->marquee, loops, i); }
void setUserModify(EUserModify u) { SET_VAR(css3InheritedData, userModify, u); }
void setUserDrag(EUserDrag d) { SET_VAR(css3NonInheritedData, userDrag, d); }
void setUserSelect(EUserSelect s) { SET_VAR(css3NonInheritedData, userSelect, s); }
void setTextOverflow(bool b) { SET_VAR(css3NonInheritedData, textOverflow, b); }
void setMarginTopCollapse(EMarginCollapse c) { SET_VAR(css3NonInheritedData, marginTopCollapse, c); }
void setMarginBottomCollapse(EMarginCollapse c) { SET_VAR(css3NonInheritedData, marginBottomCollapse, c); }
void setWordWrap(EWordWrap b) { SET_VAR(css3InheritedData, wordWrap, b); }
void setNBSPMode(ENBSPMode b) { SET_VAR(css3InheritedData, nbspMode, b); }
void setKHTMLLineBreak(EKHTMLLineBreak b) { SET_VAR(css3InheritedData, khtmlLineBreak, b); }
void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(css3NonInheritedData, matchNearestMailBlockquoteColor, c); }
// End CSS3 Setters
#if APPLE_CHANGES
// Apple-specific property setters
void setLineClamp(int c) { SET_VAR(css3NonInheritedData, lineClamp, c); }
void setTextSizeAdjust(bool b) { SET_VAR(css3InheritedData, textSizeAdjust, b); }
#endif
#if !APPLE_CHANGES
QPalette palette() const { return visual->palette; }
void setPaletteColor(QPalette::ColorGroup g, QColorGroup::ColorRole r, const QColor& c);
void resetPalette() // Called when the desktop color scheme changes.
{
const_cast<StyleVisualData *>(visual.get())->palette = QApplication::palette();
}
#endif
ContentData* contentData() { return content; }
bool contentDataEquivalent(RenderStyle* otherStyle);
void setContent(DOM::DOMStringImpl* s, bool add = false);
void setContent(CachedObject* o, bool add = false);
bool inheritedNotEqual( RenderStyle *other ) const;
// The difference between two styles. The following values are used:
// (1) Equal - The two styles are identical
// (2) Repaint - The object just needs to be repainted.
// (3) RepaintLayer - The layer and its descendant layers needs to be repainted.
// (4) Layout - A layout is required.
enum Diff { Equal, Repaint, RepaintLayer, Layout };
Diff diff( const RenderStyle *other ) const;
bool isDisplayReplacedType() {
return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE;
}
bool isDisplayInlineType() {
return display() == INLINE || isDisplayReplacedType();
}
bool isOriginalDisplayInlineType() {
return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK ||
originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
}
// To obtain at any time the pseudo state for a given link.
PseudoState pseudoState() const { return m_pseudoState; }
void setPseudoState(PseudoState s) { m_pseudoState = s; }
// To tell if this style matched attribute selectors. This makes it impossible to share.
bool affectedByAttributeSelectors() const { return m_affectedByAttributeSelectors; }
void setAffectedByAttributeSelectors() { m_affectedByAttributeSelectors = true; }
// Initial values for all the properties
static bool initialBackgroundAttachment() { return true; }
static EBackgroundRepeat initialBackgroundRepeat() { return REPEAT; }
static bool initialBorderCollapse() { return false; }
static EBorderStyle initialBorderStyle() { return BNONE; }
static ECaptionSide initialCaptionSide() { return CAPTOP; }
static EClear initialClear() { return CNONE; }
static EDirection initialDirection() { return LTR; }
static EDisplay initialDisplay() { return INLINE; }
static EEmptyCell initialEmptyCells() { return SHOW; }
static EFloat initialFloating() { return FNONE; }
static EListStylePosition initialListStylePosition() { return OUTSIDE; }
static EListStyleType initialListStyleType() { return DISC; }
static EOverflow initialOverflow() { return OVISIBLE; }
static EPageBreak initialPageBreak() { return PBAUTO; }
static EPosition initialPosition() { return STATIC; }
static ETableLayout initialTableLayout() { return TAUTO; }
static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
static ETextTransform initialTextTransform() { return TTNONE; }
static EVisibility initialVisibility() { return VISIBLE; }
static EWhiteSpace initialWhiteSpace() { return NORMAL; }
static Length initialBackgroundXPosition() { return Length(); }
static Length initialBackgroundYPosition() { return Length(); }
static short initialHorizontalBorderSpacing() { return 0; }
static short initialVerticalBorderSpacing() { return 0; }
static ECursor initialCursor() { return CURSOR_AUTO; }
static QColor initialColor() { return Qt::black; }
static CachedImage* initialBackgroundImage() { return 0; }
static CachedImage* initialListStyleImage() { return 0; }
static unsigned short initialBorderWidth() { return 3; }
static int initialLetterWordSpacing() { return 0; }
static Length initialSize() { return Length(); }
static Length initialMinSize() { return Length(0, Fixed); }
static Length initialMaxSize() { return Length(UNDEFINED, Fixed); }
static Length initialOffset() { return Length(); }
static Length initialMargin() { return Length(Fixed); }
static Length initialPadding() { return Length(Variable); }
static Length initialTextIndent() { return Length(Fixed); }
static EVerticalAlign initialVerticalAlign() { return BASELINE; }
static int initialWidows() { return 2; }
static int initialOrphans() { return 2; }
static Length initialLineHeight() { return Length(-100, Percent); }
static ETextAlign initialTextAlign() { return TAAUTO; }
static ETextDecoration initialTextDecoration() { return TDNONE; }
static int initialOutlineOffset() { return 0; }
static float initialOpacity() { return 1.0f; }
static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
static EBoxDirection initialBoxDirection() { return BNORMAL; }
static EBoxLines initialBoxLines() { return SINGLE; }
static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
static EBoxAlignment initialBoxPack() { return BSTART; }
static float initialBoxFlex() { return 0.0f; }
static int initialBoxFlexGroup() { return 1; }
static int initialBoxOrdinalGroup() { return 1; }
static int initialMarqueeLoopCount() { return -1; }
static int initialMarqueeSpeed() { return 85; }
static Length initialMarqueeIncrement() { return Length(6, Fixed); }
static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
static EUserModify initialUserModify() { return READ_ONLY; }
static EUserDrag initialUserDrag() { return DRAG_AUTO; }
static EUserSelect initialUserSelect() { return SELECT_AUTO; }
static bool initialTextOverflow() { return false; }
static EMarginCollapse initialMarginTopCollapse() { return MCOLLAPSE; }
static EMarginCollapse initialMarginBottomCollapse() { return MCOLLAPSE; }
static EWordWrap initialWordWrap() { return WBNORMAL; }
static ENBSPMode initialNBSPMode() { return NBNORMAL; }
static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; }
static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
#if APPLE_CHANGES
// Keep these at the end.
static int initialLineClamp() { return -1; }
static bool initialTextSizeAdjust() { return true; }
static const QValueList<StyleDashboardRegion>& initialDashboardRegions();
static const QValueList<StyleDashboardRegion>& noneDashboardRegions();
#endif
};
} // namespace
#ifdef __WINSCW__
#pragma enumsalwaysint reset
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -