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.

  • 相关阅读:
    MySQL GROUP BY多个字段分组用法详解
    Linux下自动备份MySQL数据库并上传到远程FTP服务器
    mysql服务器主从数据库同步配置(转)
    centos上安装配置java WEB环境_java(转)
    Win7和Vista的安全机制对于应用程序读取配置文件相关操作的影响(虚拟重定向技术)
    firemonkey 手机屏幕自适应程序问题
    Delphi中无边框窗体应用程序使任务栏右键菜单有效的方法
    GetClass与RegisterClass的应用一例
    Delphi中的动态包,有详细建立包的步骤(答案很简单:因为包的功能强大)
    JS开发调试
  • 原文地址:https://www.cnblogs.com/lexus/p/2442421.html
Copyright © 2011-2022 走看看