⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 render_box.h

📁 monqueror一个很具有参考价值的源玛
💻 H
字号:
/** * This file is part of the DOM implementation for KDE. * * Copyright (C) 1999 Lars Knoll (knoll@kde.org) *           (C) 1999 Antti Koivisto (koivisto@kde.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB.  If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * $Id: render_box.h,v 1.2 2003/04/22 08:41:10 weiym Exp $ */#ifndef RENDER_BOX_H#define RENDER_BOX_H#include "render_object.h"//#include "loader.h"#include "kurl.h"namespace khtml {    class CachedObject;class RenderBox : public RenderObject{// combines ElemImpl & PosElImpl (all rendering objects are positioned)// should contain all border and padding handlingpublic:    RenderBox();    virtual ~RenderBox();    virtual const char *renderName() const { return "RenderBox"; }    virtual void setStyle(RenderStyle *style);    virtual void print(MGPainter *p, int _x, int _y, int _w, int _h,                       int _tx, int _ty);    virtual void updateSize();    virtual void updateHeight();    virtual void close();    virtual MGSize contentSize() const;    virtual MGSize contentOffset() const;    virtual MGSize paddingSize() const;    virtual MGSize size() const;    virtual short minWidth() const { return m_minWidth; }    virtual short maxWidth() const { return m_maxWidth; }    virtual short contentWidth() const;    virtual int contentHeight() const;    virtual void absolutePosition(int &xPos, int &yPos, bool f = false);    virtual void setPos( int xPos, int yPos ) { m_x = xPos, m_y = yPos; }    virtual void setXPos( int xPos ) { m_x = xPos; }    virtual void setYPos( int yPos ) { m_y = yPos; }    virtual int xPos() const { return m_x; }    virtual int yPos() const { return m_y; }    virtual short width() const;    virtual int height() const;    virtual short marginTop() const { return m_marginTop; }    virtual short marginBottom() const { return m_marginBottom; }    virtual short marginLeft() const { return m_marginLeft; }    virtual short marginRight() const { return m_marginRight; }    virtual void setSize( int width, int height ) { m_width = width; m_height = height; }    virtual void setWidth( int width ) { m_width = width; }    virtual void setHeight( int height ) { m_height = height; }    // for table cells    virtual short baselineOffset() const;    virtual short verticalPositionHint() const;    virtual int bidiHeight() const;    virtual void position(int x, int y, int from, int len, int width, bool reverse);    virtual unsigned int width( int, int) const { return width(); }    virtual int lowestPosition() const;    void repaint();    virtual void repaintRectangle(int x, int y, int w, int h);    virtual void repaintObject(RenderObject *o, int x, int y);    virtual void setPixmap(const MGPixmap &, const MGRect&, MGCachedImage *, bool *manualUpdate=0);    virtual short containingBlockWidth() const;    virtual void calcWidth();    virtual void calcHeight();    void relativePositionOffset(int &tx, int &ty);protected:    virtual void printBoxDecorations(MGPainter *p,int _x, int _y,                                       int _w, int _h, int _tx, int _ty);    void printBackground(MGPainter *p, const MGColor &c, const MGCachedImage *bg, int clipy, int cliph, int _tx, int _ty, int w, int h);    void printBorder(MGPainter *p, int _tx, int _ty, int w, int h);    void outlineBox(MGPainter *p, int _tx, int _ty, const char *color = "red");    virtual int borderTopExtra() { return 0; }    virtual int borderBottomExtra() { return 0; }    void calcAbsoluteHorizontal();    void calcAbsoluteVertical();    void calcHorizontalMargins(const Length& ml, const Length& mr, int cw);    int m_y;    short m_x;    short m_marginTop;    short m_marginBottom;    short m_marginLeft;    short m_marginRight;    /*     * the minimum width the element needs, to be able to render     * it's content without clipping     */    short m_minWidth;    /* The maximum width the element can fill horizontally     * ( = the width of the element with line breaking disabled)     */    short m_maxWidth;public: //just for debug    // the actual width of the contents + borders + padding    short m_width;    // the actual height of the contents + borders + padding    int m_height;};}; //namespace#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -