zoukankan      html  css  js  c++  java
  • Cut Down QtWebkit Library

    Code With Trance: Cut Down QtWebkit Library

    2010年3月30日 星期二

    Cut Down QtWebkit Library

    With webkit nightly building(Qtwebkit weekly builds),QtWebkit library's size becomes bigger and bigger,for many of us who use qtwebkit library to code apps,some features of webkit are unnecessary ,such as Html5 support ,JavaScript debugger,WML support,especially SVG.So just remove these feature from webkit and then we can save some rooms when we release our apps.Unlike the entire highly modular of Gecko,Webkit is lightweight renderer that clean code base.That is why google picked webkit rather than gecko as their browser engine.It make our things easy。





    Qt version :4.6.0

    -platform: win32-msvc2008

    Qtwebkit.dll

    The initial size of the: 9673k



    Ater cutting down:5963k



    Step 1. Edit QTDIR\src\3rdparty\webkit\WebCore\WebCore.pro,add following lines


    DEFINES += ENABLE_SVG=0               :disenable SVG support

    DEFINES += ENABLE_RUBY=0             :disenable HTML5 ruby support

    DEFINES += ENABLE_VIDEO=0            :disenable HTML5 media support

    DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0      :disenable Nescape plugins support

    DEFINES += ENABLE_VIDEO=0                                :disenable Web Socket support.

    DEFINES += ENABLE_XSLT=0                                  :disenable XSLT support with QtXmlPatterns

    DEFINES += ENABLE_CHANNEL_MESSAGING=0         :disenable HTML5 channel messaging support

    DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=0     :disenable JavaScript debugger/profiler support

    DEFINES += ENABLE_SQLITE=0                              :disenable sqlite support

    DEFINES += ENABLE_DATABASE=0                          :disenable HTML5 client-side database storage support

    DEFINES += ENABLE_EVENTSOURCE=0                    :disenable HTML5 server-sent events support

    DEFINES += ENABLE_OFFLINE_WEB_APPLICATIONS=0  :disenable HTML5 offline web applications support

    DEFINES += ENABLE_DOM_STORAGE=0                       :disenable HTML5 client-side session and persistent storage support

    DEFINES += ENABLE_ICONDATABASE=0                        :disenable Icon database support

    DEFINES += ENABLE_SHARED_WORKERS=0                   :disenable SharedWorkers support

    DEFINES += ENABLE_WORKERS=0                                :disenable workder support

    DEFINES += ENABLE_WML=0                                        :disenable wml

    DEFINES += ENABLE_XPATH=0                                     :disenable xpath

    DEFINES += ENABLE_XBL=0                                         :disenable xbl

    DEFINES += ENABLE_ORIENTATION_EVENTS=0 :

    DEFINES += ENABLE_DASHBOARD_SUPPORT=0 :

    DEFINES += ENABLE_FILTERS=0 :

    DEFINES += ENABLE_WCSS=0 :

    DEFINES += ENABLE_XHTMLMP=0 :

    DEFINES += ENABLE_DATAGRID=0 :

    DEFINES += ENABLE_SINGLE_THREADED=1 :



    Step 2.when we release our apps,the WebInpector is unuseful for most of people,although it's very convenient for developer.Firstly Remove the following line from WebCore.pro which contains many images for WebInspector compiling.



    RESOURCES += $PWD/../WebCore/inspector/front-end/WebKit.qrc



    then insert these into WebCore.pro



    DEFINES += ENABLE_INSPECTOR=0

    contains(DEFINES, ENABLE_INSPECTOR=) {

    SOURCES -= \

    inspector/ConsoleMessage.cpp \

    inspector/InspectorBackend.cpp \

    inspector/InspectorController.cpp \

    inspector/InspectorDatabaseResource.cpp \

    inspector/InspectorDOMAgent.cpp \

    inspector/InspectorDOMStorageResource.cpp \

    inspector/InspectorFrontend.cpp \

    inspector/InspectorResource.cpp \

    inspector/InspectorTimelineAgent.cpp \

    inspector/TimelineRecordFactory.cpp \

    }


    Tips:follow steps above and nmake may still cause errors。you just find the .cpp and .h files displayed errors and insert the corresponding macro.It will be ok.

    Remember to run QTDIR/demo/browser to test if new QtWebkit4.dll works succesfully.

    Hope you can make it.

  • 相关阅读:
    [图形学] 结束 [Unity Shader] 开始
    [图形学] Chp18 OpenGL表面纹理函数
    [图形学] Chp17 OpenGL光照和表面绘制函数
    [图形学] Chp14 GLU曲面裁剪函数程序示例及样条表示遗留问题
    [图形学] Chp10 OpenGL三维观察程序示例
    [图形学] 问题: 裁剪窗口坐标对应显示窗口中像素是一对一还是一对多?
    [图形学] Chp9 三维几何变换--栈处理函数与矩阵管理函数的区别
    [图形学] 习题8.12 NLN二维线段裁剪算法实现
    [图形学] 习题8.6 线段旋转后使用Cohen-Sutherland算法裁剪
    [图形学] Chp8 使用双缓存创建帧动画
  • 原文地址:https://www.cnblogs.com/lexus/p/2442421.html
Copyright © 2011-2022 走看看