亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? render_frames.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/**
 * This file is part of the KDE project.
 *
 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
 *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
 * Copyright (C) 2004 Apple Computer, Inc.
 * Copyright (c) 2005 Nokia Corporation, Inc.
 *
 * 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.
 *
 */
//#define DEBUG_LAYOUT

#include "rendering/render_frames.h"

#include "css/cssproperties.h"
#include "rendering/render_canvas.h"
#include "html/html_baseimpl.h"
#include "html/html_objectimpl.h"
#include "html/htmltokenizer.h"
#include "misc/htmlattrs.h"
#include "xml/dom2_eventsimpl.h"
#include "xml/dom_docimpl.h"
#include "dom/dom_doc.h"
#include "misc/htmltags.h"
#include "khtmlview.h"
#include "khtml_part.h"
#include "render_arena.h"
#include "html/html_documentimpl.h"

#include <kapplication.h>
#include <kcursor.h>
#include <kmessagebox.h>
#include <kmimetype.h>
#include <klocale.h>
#include <kdebug.h>
#include <kglobal.h>
#include <qtimer.h>
#include <qpainter.h>
#include "qdict.h"

using namespace khtml;
using namespace DOM;

RenderFrameSet::RenderFrameSet( HTMLFrameSetElementImpl *frameSet)
    : RenderContainer(frameSet)
{
  // init RenderObject attributes
    setInline(false);

  for (int k = 0; k < 2; ++k) {
      m_gridLen[k] = -1;
      m_gridDelta[k] = 0;
      m_gridLayout[k] = 0;
  }

  m_resizing = m_clientresizing= false;

  m_hSplit = -1;
  m_vSplit = -1;

  m_hSplitVar = 0;
  m_vSplitVar = 0;
}

RenderFrameSet::~RenderFrameSet()
{
#ifndef __OOM__
    for (int k = 0; k < 2; ++k) {
        if (m_gridLayout[k]) delete [] m_gridLayout[k];
        if (m_gridDelta[k]) delete [] m_gridDelta[k];
    }
  if (m_hSplitVar)
      delete [] m_hSplitVar;
  if (m_vSplitVar)
      delete [] m_vSplitVar;
#else
    for (int k = 0; k < 2; ++k) {
        if (m_gridLayout[k]) MemoryManager::Free( m_gridLayout[k] );
        if (m_gridDelta[k]) MemoryManager::Free( m_gridDelta[k] );
    }
  if (m_hSplitVar)
      MemoryManager::Free( m_hSplitVar );
  if (m_vSplitVar)
      MemoryManager::Free( m_vSplitVar );
#endif
}

bool RenderFrameSet::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
                                 HitTestAction hitTestAction)
{
    if (hitTestAction != HitTestForeground)
        return false;

    bool inside = RenderContainer::nodeAtPoint(info, _x, _y, _tx, _ty, hitTestAction) ||
                  m_resizing || canResize(_x, _y);
    if (inside && element() && !element()->noResize() && !info.readonly() && !info.innerNode()) {
        info.setInnerNode(element());
        info.setInnerNonSharedNode(element());
    }

    return inside || m_clientresizing;
}

#if NOKIA_CHANGES
void RenderFrameSet::calcMinMaxWidth()
{
    // alternative minmax calculation for framesets
    // this expands the frames to eliminate scrollbars from subframes to make frame usable
    // on small screen devices
    KHTMLAssert( !minMaxKnown() );

#ifdef DEBUG_LAYOUT
    kdDebug( 6040 ) << renderName() << "(RenderFrameSet)::calcMinMaxWidth() this=" << this << endl;
#endif


    m_minWidth = 0;
    m_maxWidth = 0;

    RenderObject *child = firstChild();

    int xMin = 0;
    bool out = false;
    for(int r = 0; r < element()->totalRows() && !out; r++)
    {
        int tempXMin = 0;
        for(int c = 0; c < element()->totalCols(); c++)
        {
            if ( !child ) {
                out = true;
                break;
            }
#ifdef DEBUG_LAYOUT
            kdDebug(0) << "r=" << r << " c=" << c << endl;
#endif
            child->setMinMaxKnown(false);
            child->calcMinMaxWidth();
            int w = child->minWidth();
            if (element()->m_cols && element()->m_cols[c].type == Fixed)
                {
                // for fixed width columns, use fixed value as minimum
                w = QMAX(w,element()->m_cols[c].value);
                }
            tempXMin += w + element()->border();
#ifdef DEBUG_LAYOUT
            kdDebug(0) << " tempXMin=" << tempXMin << endl;
#endif
            child = child->nextSibling();
        }
        tempXMin-=element()->border();
        if (tempXMin>xMin)
            xMin = tempXMin;
    }

    m_minWidth = m_maxWidth = xMin;

    setMinMaxKnown();

#ifdef DEBUG_LAYOUT
    kdDebug( 6040 ) << "RenderFrameSet::calcMinMaxWidth(" << this << "): min = " << m_minWidth << " max = " << m_maxWidth << endl;
#endif
}
#endif

void RenderFrameSet::layout( )
{
    KHTMLAssert( needsLayout() );
    KHTMLAssert( minMaxKnown() );

    if ( !parent()->isFrameSet() ) {
        KHTMLView* view = canvas()->view();
        m_width = view->visibleWidth();
        m_height = view->visibleHeight();
#if NOKIA_CHANGES
        m_width = QMAX(m_width, m_minWidth);
#endif
    }

#ifdef DEBUG_LAYOUT
    kdDebug( 6040 ) << renderName() << "(FrameSet)::layout( ) width=" << width() << ", height=" << height() << endl;
#endif

    int remainingLen[2];
    remainingLen[1] = m_width - (element()->totalCols()-1)*element()->border();
    if(remainingLen[1]<0) remainingLen[1]=0;
    remainingLen[0] = m_height - (element()->totalRows()-1)*element()->border();
    if(remainingLen[0]<0) remainingLen[0]=0;

    int availableLen[2];
    availableLen[0] = remainingLen[0];
    availableLen[1] = remainingLen[1];

    if (m_gridLen[0] != element()->totalRows() || m_gridLen[1] != element()->totalCols()) {
        // number of rows or cols changed
        // need to zero out the deltas
        m_gridLen[0] = element()->totalRows();
        m_gridLen[1] = element()->totalCols();
#ifndef __OOM__
        for (int k = 0; k < 2; ++k) {
            if (m_gridDelta[k]) delete [] m_gridDelta[k];
            m_gridDelta[k] = new int[m_gridLen[k]];
            if (m_gridLayout[k]) delete [] m_gridLayout[k];
            m_gridLayout[k] = new int[m_gridLen[k]];
            for (int i = 0; i < m_gridLen[k]; ++i)
                m_gridDelta[k][i] = 0;
        }
#else
       for (int k = 0; k < 2; ++k) {
            if (m_gridDelta[k]) MemoryManager::Free( m_gridDelta[k] );
           m_gridDelta[k] = (int*)MemoryManager::Calloc( m_gridLen[k], sizeof( int ) );
            if (m_gridLayout[k]) MemoryManager::Free( m_gridLayout[k] );
            m_gridLayout[k] = (int*)MemoryManager::Calloc( m_gridLen[k], sizeof( int ) );
        }
#endif
    }

    for (int k = 0; k < 2; ++k) {
        int totalRelative = 0;
        int totalFixed = 0;
        int totalPercent = 0;
        int countRelative = 0;
        int countPercent = 0;
        int gridLen = m_gridLen[k];
        int* gridDelta = m_gridDelta[k];
        khtml::Length* grid =  k ? element()->m_cols : element()->m_rows;
        int* gridLayout = m_gridLayout[k];

        if (grid) {
            // first distribute the available width for fixed rows, then handle the
            // percentage ones and distribute remaining over relative
            for(int i = 0; i< gridLen; ++i) {
                if (grid[i].isFixed()) {
                    gridLayout[i] = kMin(grid[i].value > 0 ? grid[i].value : 0, remainingLen[k]);
                    remainingLen[k] -= gridLayout[i];
                    totalFixed += gridLayout[i];
                }
                else if(grid[i].isRelative()) {
                    totalRelative += grid[i].value > 1 ? grid[i].value : 1;
                    countRelative++;
                }
                else if (grid[i].isPercent()) {
                    totalPercent += grid[i].value >= 0 ? grid[i].value : 0;
                    countPercent++;
                }
            }

            int currPercent = totalPercent;
            int percentLen = (countRelative && currPercent < 100) ? currPercent * remainingLen[k] / 100 : remainingLen[k];
            for(int i = 0; i < gridLen; i++)
                if (grid[i].isPercent() && grid[i].value >= 0 && currPercent) {
                    gridLayout[i] = grid[i].value * percentLen / currPercent;
                    remainingLen[k] -= gridLayout[i];
                    percentLen -= gridLayout[i];
                    currPercent -= grid[i].value;
                }

            assert(remainingLen[k] >= 0);

            if (countRelative) {
                int remaining = remainingLen[k];
                for (int i = 0; i < gridLen; ++i)
                    if (grid[i].isRelative()) {
                        gridLayout[i] = ((grid[i].value > 1 ? grid[i].value : 1) * remaining) / totalRelative;
                        remainingLen[k] -= gridLayout[i];
                    }
            }

            // distribute the rest
            if (remainingLen[k]) {
                LengthType distributeType = countPercent ? Percent : Fixed;
                int total = countPercent ? totalPercent : totalFixed;
                if (!total) total = 1;
                for (int i = 0; i < gridLen; ++i)
                    if (grid[i].type == distributeType) {
                        int toAdd = (remainingLen[k] * grid[i].value) / total;
                        gridLayout[i] += toAdd;
                    }
            }

            // now we have the final layout, distribute the delta over it
            bool worked = true;
            for (int i = 0; i < gridLen; ++i) {
                if (gridLayout[i] && gridLayout[i] + gridDelta[i] <= 0)
                    worked = false;
                gridLayout[i] += gridDelta[i];
            }
            // now the delta's broke something, undo it and reset deltas
            if (!worked)
                for (int i = 0; i < gridLen; ++i) {
                    gridLayout[i] -= gridDelta[i];
                    gridDelta[i] = 0;
                }
        }
        else
            gridLayout[0] = remainingLen[k];
    }

    positionFrames();

    RenderObject *child = firstChild();
    if ( !child )
    goto end2;

    if(!m_hSplitVar && !m_vSplitVar)
    {
#ifdef DEBUG_LAYOUT
        kdDebug( 6031 ) << "calculationg fixed Splitters" << endl;
#endif
        if(!m_vSplitVar && element()->totalCols() > 1)
        {
#ifndef __OOM__
            m_vSplitVar = new bool[element()->totalCols()];
#else
            m_vSplitVar = (bool*)MemoryManager::Alloc( element()->totalCols() * sizeof( bool ) );
#endif
            for(int i = 0; i < element()->totalCols(); i++) m_vSplitVar[i] = true;
        }
        if(!m_hSplitVar && element()->totalRows() > 1)
        {
#ifndef __OOM__
            m_hSplitVar = new bool[element()->totalRows()];
#else
            m_hSplitVar = (bool*)MemoryManager::Alloc( element()->totalRows() * sizeof( bool ) );
#endif
            for(int i = 0; i < element()->totalRows(); i++) m_hSplitVar[i] = true;
        }

        for(int r = 0; r < element()->totalRows(); r++)
        {
            for(int c = 0; c < element()->totalCols(); c++)
            {
                bool fixed = false;

                if ( child->isFrameSet() )
                  fixed = static_cast<RenderFrameSet *>(child)->element()->noResize();
                else
                  fixed = static_cast<RenderFrame *>(child)->element()->noResize();

                if(fixed)
                {
#ifdef DEBUG_LAYOUT
                    kdDebug( 6031 ) << "found fixed cell " << r << "/" << c << "!" << endl;
#endif
                    if( element()->totalCols() > 1)
                    {
                        if(c>0) m_vSplitVar[c-1] = false;
                        m_vSplitVar[c] = false;
                    }
                    if( element()->totalRows() > 1)
                    {
                        if(r>0) m_hSplitVar[r-1] = false;
                        m_hSplitVar[r] = false;
                    }
                    child = child->nextSibling();
                    if(!child) goto end2;
                }
#ifdef DEBUG_LAYOUT
                else
                    kdDebug( 6031 ) << "not fixed: " << r << "/" << c << "!" << endl;
#endif
            }
        }

    }
    RenderContainer::layout();
 end2:
    setNeedsLayout(false);
}

void RenderFrameSet::positionFrames()
{
  int r;
  int c;

  RenderObject *child = firstChild();
  if ( !child )
    return;

  //  NodeImpl *child = _first;
  //  if(!child) return;

  int yPos = 0;

#if NOKIA_CHANGES
  // calculate frameset height based on actual content height to eliminate scrolling
  bool out = false;
  int widest = 0;
  for(r = 0; r < element()->totalRows() && !out; r++)
  {
    int highest = 0;
    int xPos = 0;
    for(c = 0; c < element()->totalCols(); c++)
    {
      if ( !child ) {
        out = true;
        break;
      }
      child->setPos( xPos, yPos );
#ifdef DEBUG_LAYOUT
      kdDebug(6040) << "child frame at (" << xPos << "/" << yPos << ") size (" << m_gridLayout[1][c] << "/" << m_gridLayout[0][r] << ")" << endl;
#endif
      // has to be resized and itself resize its contents
      child->setWidth( m_gridLayout[1][c] );
      child->setHeight( m_gridLayout[0][r] );
      child->setNeedsLayout(true);
      child->layout();

      if (highest<child->height())
        highest = child->height();

      xPos += child->width() + element()->border();
      child = child->nextSibling();
    }
    if (xPos>widest)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区成人精品| 曰韩精品一区二区| 欧美日韩精品三区| 一本色道久久综合亚洲91| 国产成人丝袜美腿| 国产在线乱码一区二区三区| 精品亚洲免费视频| 国内外成人在线| 国产一区二区91| 国产麻豆成人精品| 国产98色在线|日韩| 成人小视频免费观看| 丁香另类激情小说| 色偷偷一区二区三区| 日本韩国欧美三级| 7777女厕盗摄久久久| 日韩一区二区三区免费看| 日韩一区二区影院| 久久精品亚洲麻豆av一区二区| 国产婷婷色一区二区三区在线| 国产欧美一区二区精品性色 | 日韩国产欧美视频| 欧美aaaaa成人免费观看视频| 另类人妖一区二区av| 国产美女视频91| 色综合中文字幕| 8v天堂国产在线一区二区| 欧美精品一区二区三区蜜臀| 国产精品久久久久久久浪潮网站| 亚洲品质自拍视频| 日本三级韩国三级欧美三级| 豆国产96在线|亚洲| 欧美日韩一级视频| 中文字幕 久热精品 视频在线 | 久久久久国色av免费看影院| 中文字幕日韩精品一区| 亚洲成人三级小说| 成人激情av网| 538在线一区二区精品国产| 国产欧美日韩久久| 亚洲一区二区不卡免费| 精品午夜一区二区三区在线观看| 不卡高清视频专区| 欧美zozo另类异族| 亚洲国产精品综合小说图片区| 国产精品一区二区在线观看不卡 | 日本人妖一区二区| 91亚洲大成网污www| 精品免费日韩av| 亚洲一区在线视频| 不卡一区二区中文字幕| 精品少妇一区二区| 亚洲超碰97人人做人人爱| 丁香啪啪综合成人亚洲小说| 3d成人h动漫网站入口| 亚洲欧美日韩综合aⅴ视频| 国产精一品亚洲二区在线视频| 91精品在线麻豆| 亚洲人成人一区二区在线观看| 国产乱码精品一区二区三区av | 国内精品久久久久影院一蜜桃| 在线观看国产精品网站| 国产女人18水真多18精品一级做| 蜜乳av一区二区三区| 欧美日韩激情在线| 亚洲精品久久久久久国产精华液| 国产91精品欧美| 久久噜噜亚洲综合| 加勒比av一区二区| 精品欧美乱码久久久久久1区2区| 天堂在线亚洲视频| 欧美日韩成人一区二区| 亚洲成a人片综合在线| 欧美在线免费播放| 亚洲激情一二三区| 色偷偷成人一区二区三区91| 国产精品电影一区二区| 99精品视频一区| 亚洲男人的天堂在线aⅴ视频| www.欧美日韩| 综合欧美亚洲日本| 色综合久久88色综合天天免费| 自拍视频在线观看一区二区| 91蜜桃视频在线| 最新热久久免费视频| 91丨porny丨最新| 中文字幕在线观看不卡视频| 91麻豆免费视频| 亚洲一线二线三线视频| 91精品婷婷国产综合久久| 日韩不卡手机在线v区| 日韩欧美国产wwwww| 韩国一区二区视频| 亚洲国产高清在线| 欧美专区在线观看一区| 午夜精品福利一区二区蜜股av| 在线播放一区二区三区| 免费人成精品欧美精品| 久久网站热最新地址| 懂色av中文字幕一区二区三区| 国产精品国产自产拍高清av | 中文欧美字幕免费| 色综合久久久久综合| 日韩成人伦理电影在线观看| 久久久久国产精品人| 97精品久久久午夜一区二区三区| 亚洲永久免费av| www国产亚洲精品久久麻豆| 国产精品996| 亚洲综合激情另类小说区| 91精品国产综合久久香蕉的特点 | 国产精品毛片a∨一区二区三区| 色婷婷国产精品综合在线观看| 日韩综合小视频| 国产精品理论片在线观看| 欧美男同性恋视频网站| 国产福利91精品一区二区三区| 一区二区三区91| 久久这里只有精品6| 欧美日韩另类国产亚洲欧美一级| 国产美女精品人人做人人爽| 亚洲永久免费视频| 国产精品免费av| 日韩一区二区三免费高清| 91视频你懂的| 国产在线播放一区三区四| 一区二区三区免费| 欧美激情综合在线| 欧美一区二区大片| 日本韩国一区二区三区| 成人污视频在线观看| 免费成人小视频| 亚洲午夜久久久久中文字幕久| 中文字幕精品综合| 精品日韩在线一区| 日韩一级片网址| 在线观看免费成人| 99精品一区二区三区| 国产成人av网站| 美女视频黄 久久| 日本午夜一区二区| 日韩精品一二三| 亚洲一区二区三区国产| 亚洲欧美一区二区视频| 国产三级三级三级精品8ⅰ区| 欧美一区二区三区在| 欧美久久久久免费| 在线精品视频免费播放| 日本高清不卡一区| 91蜜桃视频在线| 91成人网在线| 色欧美片视频在线观看| 91麻豆免费在线观看| 91天堂素人约啪| 91在线视频免费观看| 99视频有精品| 91丨九色丨黑人外教| 日本韩国欧美国产| 欧美日韩一区国产| 91.com视频| 精品粉嫩aⅴ一区二区三区四区| 欧美一区二区精品在线| 日韩欧美亚洲国产另类| 亚洲精品一区二区三区影院| 精品久久久三级丝袜| 日本韩国视频一区二区| 99精品国产视频| 一本大道久久精品懂色aⅴ| aaa欧美色吧激情视频| 91性感美女视频| 欧美三级一区二区| 欧美二区三区的天堂| 欧美丰满一区二区免费视频 | 香蕉av福利精品导航| 日本不卡123| 狠狠色伊人亚洲综合成人| 国产成人在线色| 91浏览器在线视频| 911精品国产一区二区在线| 欧美成人福利视频| 国产精品久久久久婷婷二区次| 亚洲你懂的在线视频| 毛片不卡一区二区| 成人激情小说网站| 91高清在线观看| 精品国产一区二区三区不卡| 国产精品日韩成人| 日本视频免费一区| 成人激情av网| 欧美一区二区三区四区在线观看 | 欧日韩精品视频| 欧美一区二区不卡视频| 国产精品色一区二区三区| 一区二区成人在线| 国产一区免费电影| 欧美性生活大片视频| 欧美经典一区二区| 日韩电影在线看| 菠萝蜜视频在线观看一区| 3d动漫精品啪啪|