2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 23:08:47 +0000 (23:08 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 23:08:47 +0000 (23:08 +0000)
        Reviewed by Geoff.

        Improve gdk build compiler flags (show warning, no rtti and exceptions).

        * jscore.bkl:

2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by Geoff.

        Improve gdk build compiler options.

        * Bakefiles.bkgen:
        * presets.bkl:

2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by Geoff.

        Fix memory leaks discovered via valgrind. Gdk build fixes.

        * Projects/gdk/webcore-gdk.bkl:
        * make-generated-sources.sh:
        * platform/cairo/ImageCairo.cpp:
        (WebCore::Image::draw):
        * platform/gdk/FrameGdk.cpp:
        (WebCore::FrameGdk::handleGdkEvent):
        * platform/gdk/FrameGdk.h:
        * platform/gdk/PlatformScrollBar.h:
        (WebCore::PlatformScrollbar::horizontalScrollbarHeight):
        (WebCore::PlatformScrollbar::verticalScrollbarWidth):

2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by Geoff.

        Add -exit-after-loading option to make gdklauncher quit after fully loading and rendering
        a page. This allows automatic testing via e.g. valgrind.

        * GdkLauncher/gdklauncher.bkl:
        * GdkLauncher/main.cpp:
        (LauncherFrameGdk::LauncherFrameGdk):
        (LauncherFrameGdk::setExitAfterLoading):
        (LauncherFrameGdk::handledOnloadEvents):
        (handle_event):
        (main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16945 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Bakefiles/Bakefiles.bkgen
Bakefiles/ChangeLog
Bakefiles/presets.bkl
JavaScriptCore/ChangeLog
JavaScriptCore/jscore.bkl
WebCore/ChangeLog
WebCore/Projects/gdk/webcore-gdk.bkl
WebCore/make-generated-sources.sh
WebCore/platform/cairo/ImageCairo.cpp
WebCore/platform/gdk/FrameGdk.cpp
WebCore/platform/gdk/FrameGdk.h
WebCore/platform/gdk/PlatformScrollBar.h
WebKitTools/ChangeLog
WebKitTools/GdkLauncher/gdklauncher.bkl
WebKitTools/GdkLauncher/main.cpp

index 5015a66114c69d8c0992332314506c011ded4596..70a6971246ef8ca2dd5fabc6866a45df861c08f3 100644 (file)
@@ -39,7 +39,7 @@ Build configuration script for Bakefile.
 
     <!-- List of output formats to generate: -->
     <add-formats>
-        msvc,msvs2005,gnu <!-- xcode2 -->
+        gnu <!-- xcode2,msvc,msvs2005 -->
     </add-formats>
 
     <!-- webcore gdk is Unix-only for now, right? -->
index 0dfc6a05ab66b3a8b410ce20ab6c59f6276a0346..cc5a0186712839816a1a46ea36a7a960c135625a 100644 (file)
@@ -1,8 +1,17 @@
+2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
+
+        Reviewed by Geoff.
+
+        Improve gdk build compiler options.
+
+        * Bakefiles.bkgen:
+        * presets.bkl:
+
 2006-10-03  Mark Rowe  <bdash@webkit.org>
 
         Reviewed by Eric.
 
-        Stop Bakefile-generated Makefile from running `pkg-config' multiple times per file.
+        Stop Bakefile-generated Makefile from running pkg-config multiple times per file.
 
         * presets.bkl: Make use of "options" and Python commands to run pkg-config etc up front.
 
index 3fd4622049c9558cb5d686d3b156a392bb4d9309..45fe4528530eb5aff6d483bcadc631efbb1e8996 100644 (file)
@@ -37,10 +37,6 @@ and WebCore. Include this file to use these settings.
 
     <template id="jscore">
         <include>$(SRCDIR)/../JavaScriptCore</include>
-        <if cond="FORMAT in ['msvc', 'msvs2005']">
-            <!-- MSVC chokes on #import, so don't use ForwardingHeaders... -->
-            <include>$(SRCDIR)/../JavaScriptCore/os-win32</include><!-- stdint.h is here -->
-        </if>
         <if cond="FORMAT=='gnu'">
             <ldflags>$(SRCDIR)/../JavaScriptCore/libjscore.a</ldflags>
         </if>
index 3366e3125dbf877cc50cb80fba55acdeea38ae9d..d542a9317c9d1bbe368edfb271db2371de71a16b 100644 (file)
@@ -1,3 +1,11 @@
+2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
+
+        Reviewed by Geoff.
+
+        Improve gdk build compiler flags (show warning, no rtti and exceptions).
+
+        * jscore.bkl:
+
 2006-10-06  Kevin McCullough  <KMcCullough@apple.com>
 
         Reviewed by Brady.
index de4dc29f9ddeccf2b54499a0e29bec0efd306c59..0c62dc7ad71fdd138c4bcd0cf9c4ee3b1732a3bc 100644 (file)
@@ -54,7 +54,6 @@ JavaScriptCore Bakefile project file.
         <include>$(SRCDIR)/bindings</include>
         <include>$(SRCDIR)/bindings/c</include>
         <include>$(SRCDIR)/bindings/jni</include>
-        <include>$(SRCDIR)/kxmlcore</include>
         <include>$(SRCDIR)/DerivedSources/JavaScriptCore</include>
 
         <define>APPLE_CHANGES=1</define>
@@ -100,6 +99,10 @@ JavaScriptCore Bakefile project file.
     <lib id="jscore" template="jscore_base">
         <objects-depend>dftables</objects-depend>
         <pre-build-target>DerivedSources</pre-build-target>
+        <warnings>default</warnings>
+        <cxx-rtti>off</cxx-rtti>
+        <cxx-exceptions>off</cxx-exceptions>
+        <debug-info>on</debug-info>
         <sources>
             $(JSCORE_SOURCES_WTF)
             $(JSCORE_SOURCES_PCRE)
index ba0abbba88d69fdf81a47de503e1385320007f69..aea6d593df10964c015a3f21b00cff9d8013ee6b 100644 (file)
@@ -1,3 +1,20 @@
+2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
+
+        Reviewed by Geoff.
+
+        Fix memory leaks discovered via valgrind. Gdk build fixes.
+
+        * Projects/gdk/webcore-gdk.bkl:
+        * make-generated-sources.sh:
+        * platform/cairo/ImageCairo.cpp:
+        (WebCore::Image::draw):
+        * platform/gdk/FrameGdk.cpp:
+        (WebCore::FrameGdk::handleGdkEvent):
+        * platform/gdk/FrameGdk.h:
+        * platform/gdk/PlatformScrollBar.h:
+        (WebCore::PlatformScrollbar::horizontalScrollbarHeight):
+        (WebCore::PlatformScrollbar::verticalScrollbarWidth):
+
 2006-10-09  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Beth.
index b7e5beae1bc7a7f16811f50676356ef582c14f11..17ee9c0c2ed96aa574423e4d4b2602f1a0c330f7 100644 (file)
         <dirname>.</dirname>
         <pic>on</pic>
         <threading>multi</threading>
-        <warnings>no</warnings>
-               <cxxflags>-w</cxxflags>
+        <warnings>default</warnings>
+        <cxx-rtti>off</cxx-rtti>
+        <cxx-exceptions>off</cxx-exceptions>
+        <debug-info>on</debug-info>
         <include>$(SRCDIR)/platform/gdk</include>
-               <cflags>-w</cflags>
        <define>BUILDING_GDK__</define>
        <define>BUILDING_CAIRO__</define>
                <include>platform/gdk</include>
index 5e2302061f375f04eff4a05d95bf875873ca309a..9d73b407ac3ea50f0544f034101ba91cb3f9bcd3 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+export SOURCE_ROOT=$PWD
 export SRCROOT=$PWD
 export WebCore=$PWD
 export CREATE_HASH_TABLE="$SRCROOT/../JavaScriptCore/kjs/create_hash_table"
@@ -8,5 +9,5 @@ cd DerivedSources/WebCore
 
 # note ENCODINGS_PREFIX needs to be a ws string so it does not turn into
 # a null value
-make -f ../../DerivedSources.make ENCODINGS_FILE=$1 ENCODINGS_PREFIX=" "
+make -f ../../DerivedSources.make ENCODINGS_FILE=$1 ENCODINGS_PREFIX="\" \""
 cd ../..
index e2c0ce0fca016e7e90833ebec6af213d2b1d1c6c..b60617539459740716fd18d6be9ef9b890c5dea3 100644 (file)
@@ -106,6 +106,7 @@ void Image::draw(GraphicsContext* ctxt, const FloatRect& dst, const FloatRect& s
     cairo_rectangle(context, 0, 0, dstRect.width(), dstRect.height());
     cairo_fill(context);
 
+    cairo_pattern_destroy(pattern);
     cairo_restore(context);
 
     startAnimation();
index 63fa835024a4c3ed2f912174634494c2a602795d..14d8cdae7db48ae33295c35fc985675317361d33 100644 (file)
@@ -179,6 +179,7 @@ void FrameGdk::handleGdkEvent(GdkEvent* event)
             GraphicsContext* ctx = new GraphicsContext(cr);
             paint(ctx, IntRect(clip.x, clip.y, clip.width, clip.height));
             delete ctx;
+            cairo_destroy(cr);
             gdk_window_end_paint (event->any.window);
             break;
         }
index bc93cd2d31a8a9283dae1e1b5882df98a5250e6b..a196d504300c7a93781fe6d9444dc0309605a21b 100644 (file)
@@ -45,7 +45,7 @@ class FrameGdk : public Frame, ResourceLoaderClient {
 public:
     FrameGdk(Page*, Element*);
     FrameGdk(GdkDrawable*);
-    ~FrameGdk();
+    virtual ~FrameGdk();
 
     void handleGdkEvent(GdkEvent*);
     virtual bool openURL(const KURL&);
index 5ed974cd1d5bf1380ec73e97d2a8e8dd0027d042..96dcbc9e511a392839c8261659e33d222e54c95c 100644 (file)
@@ -44,6 +44,10 @@ public:
     virtual void setEnabled(bool);
     virtual void paint(GraphicsContext*, const IntRect& damageRect);
 
+    // FIXME: Implement.
+    static int horizontalScrollbarHeight() { return 15; }
+    static int verticalScrollbarWidth() { return 15; }
+
 protected:
     virtual void updateThumbPosition();
     virtual void updateThumbProportion();
index ede04cf27d8930d84ffe89073d41ab81db942cc7..ed69c0d458c8c257dd186504c03e255bb6eec773 100644 (file)
@@ -1,3 +1,18 @@
+2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
+
+        Reviewed by Geoff.
+
+        Add -exit-after-loading option to make gdklauncher quit after fully loading and rendering
+        a page. This allows automatic testing via e.g. valgrind.
+
+        * GdkLauncher/gdklauncher.bkl:
+        * GdkLauncher/main.cpp:
+        (LauncherFrameGdk::LauncherFrameGdk):
+        (LauncherFrameGdk::setExitAfterLoading):
+        (LauncherFrameGdk::handledOnloadEvents):
+        (handle_event):
+        (main):
+
 2006-10-06  David Smith  <catfish.man@gmail.com>
 
         Reviewed by Timothy.
index 3525fcfee89ce5577282a79d6c45e4cf23806aa9..0a722192801f64b78fd274afe1cdb812fb4bfa44 100644 (file)
@@ -61,9 +61,8 @@
         <include>$(TOPDIR)/WebCore/platform/gdk</include>
         <pic>on</pic>
         <threading>multi</threading>
-        <warnings>no</warnings>
-        <cxxflags>-w</cxxflags>
-        <cflags>-w</cflags>
+        <warnings>default</warnings>
+        <debug-info>on</debug-info>
 
         <define>BUILDING_GDK__</define>
         <define>BUILDING_CAIRO__</define>
        <set var="TOPDIR">../..</set>
     <exe id="gdklauncher" template="webcore_gdk_link">        
                <ldflags>-L$(TOPDIR)/WebCore/Projects/gdk -lwebcore-gdk</ldflags>
+        <warnings>default</warnings>
+        <cxx-rtti>off</cxx-rtti>
+        <cxx-exceptions>off</cxx-exceptions>
+        <debug-info>on</debug-info>
         <sources>              
           main.cpp
                </sources>
index f2b8862da07aadcafd0c8c9e7e969a9795102f43..8d4eebbc4d54773c7f0ce12ba5a7e68c98be7b48 100644 (file)
 #include "Document.h"
 #include "DocLoader.h"
 #include "DOMImplementation.h"
-//#include "HTMLDocument.h"
 
 #include "Cache.h"
 #include "EventNames.h"
-//#include "htmlnames.h"
 
 #if SVG_SUPPORT
 #include "SVGNames.h"
 #include "SVGDocumentExtensions.h"
 #endif
 
-//painting
 #include "RenderObject.h"
 #include "GraphicsContext.h"
 
 using namespace WebCore;
 
-static  FrameGdk *frame;
+class LauncherFrameGdk : public FrameGdk
+{
+public:
+    LauncherFrameGdk(Page* page, Element* element) : FrameGdk(page, element), m_exitAfterLoading(false) {}
+    LauncherFrameGdk(GdkDrawable* drawable) : FrameGdk(drawable), m_exitAfterLoading(false) {}
+    virtual void handledOnloadEvents();
+    void setExitAfterLoading(bool exitAfterLoading) { m_exitAfterLoading = exitAfterLoading; }
+private:
+    bool m_exitAfterLoading;
+};
+
+void LauncherFrameGdk::handledOnloadEvents()
+{
+    if (m_exitAfterLoading)
+        gtk_main_quit();
+}
+
+static  LauncherFrameGdk *frame;
 static  GdkWindow *win;
 
 static void handle_event(GdkEvent *event)
 {
-  if (GDK_DELETE == event->type) {
-      gtk_main_quit();
-      return;
-  }
-  frame->handleGdkEvent(event);
+    if (GDK_DELETE == event->type) {
+        gtk_main_quit();
+        return;
+    }
+    frame->handleGdkEvent(event);
 }
 
 int main(int argc, char *argv[]) 
 {
-  GdkWindowAttr attr;
-  char *url;
-  gdk_init(&argc,&argv);
-  gdk_event_handler_set ((GdkEventFunc)handle_event, NULL, NULL);
-
-  attr.width = 800;
-  attr.height = 600;
-  attr.window_type = GDK_WINDOW_TOPLEVEL;
-  attr.wclass = GDK_INPUT_OUTPUT;
-  //see how where we handle motion here need to do the hint stuff
-  attr.event_mask = ((GDK_ALL_EVENTS_MASK^GDK_POINTER_MOTION_HINT_MASK)); 
-  win = gdk_window_new(NULL,&attr,0);
-  frame = new FrameGdk(win);
-  gdk_window_show(win);
-  char *pg = " <html><head><title>Google</title> <body bgcolor=#ffffff text=#000000> <p><font size=-2/>2006 Google Hello bigworld from mike</p></body></html> ";
-  url = "http://www.google.com";
-  if (argc >= 2) 
-      url = argv[1];
+    GdkWindowAttr attr;
+    char *url;
+    gdk_init(&argc,&argv);
+    gdk_event_handler_set ((GdkEventFunc)handle_event, NULL, NULL);
 
-  if (url) {
-    printf("OPENING URL == %s \n", url);
-    frame->openURL(url);
-  } else {
+    attr.width = 800;
+    attr.height = 600;
+    attr.window_type = GDK_WINDOW_TOPLEVEL;
+    attr.wclass = GDK_INPUT_OUTPUT;
+    //see how where we handle motion here need to do the hint stuff
+    attr.event_mask = ((GDK_ALL_EVENTS_MASK^GDK_POINTER_MOTION_HINT_MASK)); 
+    win = gdk_window_new(NULL,&attr,0);
+    frame = new LauncherFrameGdk(win);
+    gdk_window_show(win);
+    char *pg = " <html><head><title>Google</title> <body bgcolor=#ffffff text=#000000> <p><font size=-2/>2006 Google Hello bigworld from mike</p></body></html> ";
+    url = "http://www.google.com";
+    bool exitAfterLoading = false;
+    for (int argPos = 1; argPos < argc; ++argPos) {
+        if (0 == strcmp(argv[argPos], "-exit-after-loading"))
+            exitAfterLoading = true;
+        else
+            url = argv[argPos];
+    }
+    frame->setExitAfterLoading(exitAfterLoading);
+    if (url) {
+        printf("OPENING URL == %s \n", url);
+        frame->openURL(url);
+    } else {
 /*
-    frame->createEmptyDocument();
+  frame->createEmptyDocument();
     frame->document()->open();
     frame->write(pg,strlen(pg));
     frame->document()->close();
 */
-  }
-
-  gtk_main();
-  delete frame;
-  return 0;
+    }
+    
+    gtk_main();
+    delete frame;
+    gdk_window_destroy(win);
+    return 0;
 }