Reviewed by Darin.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jul 2006 01:32:57 +0000 (01:32 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jul 2006 01:32:57 +0000 (01:32 +0000)
        - first check-in of a Gdk shell for testing WebKit

        * GdkLauncher: Added.

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

WebKitTools/ChangeLog
WebKitTools/GdkLauncher/Bakefiles.bkgen [new file with mode: 0644]
WebKitTools/GdkLauncher/ENV [new file with mode: 0644]
WebKitTools/GdkLauncher/gdklauncher.bkl [new file with mode: 0644]
WebKitTools/GdkLauncher/main.cpp [new file with mode: 0644]
WebKitTools/GdkLauncher/mk [new file with mode: 0644]
WebKitTools/GdkLauncher/simple.svg [new file with mode: 0644]
WebKitTools/GdkLauncher/text.html [new file with mode: 0644]

index 40e6afa..39bde8f 100644 (file)
@@ -1,3 +1,11 @@
+2006-06-30  Mike Emmel  <mike.emmel@gmail.com>
+
+        Reviewed by Darin.
+
+        - first check-in of a Gdk shell for testing WebKit
+
+        * GdkLauncher: Added.
+
 2006-06-29  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Darin.
diff --git a/WebKitTools/GdkLauncher/Bakefiles.bkgen b/WebKitTools/GdkLauncher/Bakefiles.bkgen
new file mode 100644 (file)
index 0000000..102d084
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" ?>
+<!-- 
+Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1.  Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer. 
+2.  Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution. 
+3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+    its contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Build configuration script for Bakefile.
+-->
+
+<bakefile-gen>
+
+    <input>
+        gdklauncher.bkl
+    </input>
+
+    <!-- List of output formats to generate: -->
+    <add-formats>
+        gnu
+    </add-formats>
+</bakefile-gen>
diff --git a/WebKitTools/GdkLauncher/ENV b/WebKitTools/GdkLauncher/ENV
new file mode 100644 (file)
index 0000000..43a11df
--- /dev/null
@@ -0,0 +1,4 @@
+export DFBARGS=system=sdl,mode=800x600
+export DFBARGS=system=x11,mode=800x600
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../WebCore/Projects/gdk:/usr/local/lib
+
diff --git a/WebKitTools/GdkLauncher/gdklauncher.bkl b/WebKitTools/GdkLauncher/gdklauncher.bkl
new file mode 100644 (file)
index 0000000..1e4092a
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" ?>
+<!-- $Id: gdklauncher.bkl,v 1.1 2006/04/27 23:38:34 eme018 Exp $ -->
+<!-- generate GnuMakefile with
+       bakefile -f gnu gdkwebcore.bkl
+       consider forcing includes agian
+       CXX = g++  -I. include config.h
+-->
+
+<makefile>
+       <include file="../../Bakefiles/presets.bkl"/>
+
+   <template id="webcore_gdk_link" template="gtk,freetype">
+               
+        <define>APPLE_CHANGES=1</define>
+        <!-- this GC version requires Mach's thread suspend/resume: -->
+        <if cond="PLATFORM_MACOSX=='1'">
+            <define>USE_CONSERVATIVE_GC=0</define>
+        </if>
+        
+        <if cond="PLATFORM_MACOSX=='1'">
+            <define>USE_CONSERVATIVE_GC=1</define>
+        </if> 
+
+        <define>KHTML_XSLT=1</define>
+
+        <if cond="FORMAT=='gnu'">
+            <!-- FIXME: we need proper configure checks -->
+            <define>HAVE_FUNC_ISNAN</define>
+        </if>
+
+        <if cond="PLATFORM_WIN32=='1'">
+            <include>$(SRCDIR)/os-win32</include>
+            <define>HAVE_SYS_TIMEB_H=1</define>
+            <define>HAVE_FLOAT_H=1</define>
+            <define>HAVE_FUNC__FINITE=1</define>
+        </if>
+
+        <include>$(TOPDIR)/JavaScriptCore</include>
+
+        <include>$(TOPDIR)/WebCore/.</include>
+        <include>$(TOPDIR)/WebCore/include</include>
+        <include>$(TOPDIR)/WebCore/DerivedSources/WebCore</include>
+        <include>$(TOPDIR)/WebCore/bindings/js</include>
+        <include>$(TOPDIR)/WebCore/bridge</include>
+        <include>$(TOPDIR)/WebCore/editing</include>
+        <include>$(TOPDIR)/WebCore/html</include>
+        <include>$(TOPDIR)/WebCore/css</include>
+        <include>$(TOPDIR)/WebCore/dom</include>
+        <include>$(TOPDIR)/WebCore/kwq</include>
+        <include>$(TOPDIR)/WebCore/loader</include>
+        <include>$(TOPDIR)/WebCore/page</include>
+        <include>$(TOPDIR)/WebCore/platform</include>
+        <include>$(TOPDIR)/WebCore/platform/image-decoders</include>
+        <include>$(TOPDIR)/WebCore/platform/image-decoders/gif</include>
+        <include>$(TOPDIR)/WebCore/platform/image-decoders/jpeg</include>
+        <include>$(TOPDIR)/WebCore/platform/image-decoders/png</include>
+        <include>$(TOPDIR)/WebCore/platform/image-decoders/zlib</include>
+        <include>$(TOPDIR)/WebCore/rendering</include>
+        <include>$(TOPDIR)/WebCore/xml</include>
+
+        <include>$(TOPDIR)/WebCore/platform/cairo</include>
+        <include>$(TOPDIR)/WebCore/platform/gdk</include>
+        <pic>on</pic>
+        <threading>multi</threading>
+        <warnings>no</warnings>
+        <cxxflags>-w</cxxflags>
+        <cflags>-w</cflags>
+
+        <define>BUILDING_GDK__</define>
+        <define>BUILDING_CAIRO__</define>
+
+   </template>
+
+       <set var="TOPDIR">../..</set>
+    <exe id="gdklauncher" template="webcore_gdk_link">        
+               <ldflags>-L$(TOPDIR)/WebCore/Projects/gdk -lwebcore-gdk</ldflags>
+        <sources>              
+          main.cpp
+               </sources>
+    </exe>
+</makefile>
+
diff --git a/WebKitTools/GdkLauncher/main.cpp b/WebKitTools/GdkLauncher/main.cpp
new file mode 100644 (file)
index 0000000..bfbf80a
--- /dev/null
@@ -0,0 +1,76 @@
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <gdk/gdk.h>
+#include "config.h"
+#include "FrameGdk.h"
+#include "Page.h"
+#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 "XLinkNames.h"
+#include "SVGDocumentExtensions.h"
+#endif
+
+//painting
+#include "RenderObject.h"
+#include "GraphicsContext.h"
+
+
+using namespace WebCore;
+//using namespace HTMLNames;
+
+static  FrameGdk *frame;
+static  GdkWindow *win;
+
+static void handle_event(GdkEvent *event)
+{
+    frame->handleGdkEvent(event);
+}
+
+int
+main(int argc, char *argv[]) 
+{
+  GdkWindowAttr attr;
+  GMainLoop *loop;
+  gdk_init(&argc,&argv);
+  gdk_event_handler_set ((GdkEventFunc)handle_event, NULL, NULL);
+  loop = g_main_loop_new (NULL, TRUE);
+
+  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> ";
+  if( argc >= 2 ) {
+    printf("OPENING URL == %s \n", argv[1]);
+    frame->openURL(argv[1]);
+  } else {
+/*
+    frame->createEmptyDocument();
+    frame->document()->open();
+    frame->write(pg,strlen(pg));
+    frame->document()->close();
+*/
+    frame->openURL("http://www.google.com");
+  }
+
+  while(1) {
+    g_main_loop_run (loop);
+  }
+  return 0;
+}
diff --git a/WebKitTools/GdkLauncher/mk b/WebKitTools/GdkLauncher/mk
new file mode 100644 (file)
index 0000000..4d8ed37
--- /dev/null
@@ -0,0 +1,10 @@
+cd ../../WebCore/Projects/gdk
+make 
+cd -
+
+
+Property changes on: WebKitTools/GdkLauncher/mk
+___________________________________________________________________
+Name: svn:executable
+   + *
+
diff --git a/WebKitTools/GdkLauncher/simple.svg b/WebKitTools/GdkLauncher/simple.svg
new file mode 100644 (file)
index 0000000..30b13ac
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="5cm" height="4cm"
+xmlns="http://www.w3.org/2000/svg">
+<desc>Four separate rectangles
+</desc>
+<rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/>
+<rect x="0.5cm" y="2cm" width="1cm" height="1.5cm"/>
+<rect x="3cm" y="0.5cm" width="1.5cm" height="2cm"/>
+<rect x="3.5cm" y="3cm" width="1cm" height="0.5cm"/>
+<!-- Show outline of canvas using 'rect' element -->
+<rect x=".01cm" y=".01cm" width="4.98cm" height="3.98cm"
+fill="none" stroke="blue" stroke-width=".02cm" />
+</svg>
diff --git a/WebKitTools/GdkLauncher/text.html b/WebKitTools/GdkLauncher/text.html
new file mode 100644 (file)
index 0000000..607df72
--- /dev/null
@@ -0,0 +1,9 @@
+<html>
+<head>
+<title>Hello World</title> 
+<body bgcolor=#00ffff text=#000000> 
+<p>
+Hello world
+</p>
+</body>
+</html>