Reviewed by Adam Roben.

        Linux/gdk build fixes.

        * platform/GlyphPageTreeNode.h: Fix header guard name.
        * platform/gdk/ChromeClientGdk.h:
        * platform/gdk/CursorGdk.cpp:
        (WebCore::verticalTextCursor):
        (WebCore::cellCursor):
        (WebCore::contextMenuCursor):
        (WebCore::noDropCursor):
        (WebCore::copyCursor):
        (WebCore::progressCursor):
        (WebCore::aliasCursor):
        * platform/gdk/MouseEventGdk.cpp:
        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
        * platform/gdk/PageGdk.cpp: Removed. No longer used.
        * platform/gdk/RenderThemeGdk.cpp:
        (WebCore::RenderThemeGdk::getThemeData):
        (WebCore::RenderThemeGdk::setCheckboxSize):
        (WebCore::RenderThemeGdk::paintCheckbox):
        (WebCore::RenderThemeGdk::setRadioSize):
        (WebCore::RenderThemeGdk::paintRadio):
        (WebCore::RenderThemeGdk::paintButton):
        (WebCore::RenderThemeGdk::adjustTextFieldStyle):
        (WebCore::RenderThemeGdk::paintTextField):
        (WebCore::RenderThemeGdk::paintTextArea):
        (WebCore::RenderThemeGdk::systemFont):
        * platform/gdk/RenderThemeGdk.h:
        * platform/gdk/ScreenGdk.cpp:
        (WebCore::screenDepth):
        (WebCore::screenDepthPerComponent):
        (WebCore::screenIsMonochrome):
        (WebCore::screenRect):
        (WebCore::screenAvailableRect):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ee6ae4a..c145066 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,44 @@
 
         Reviewed by Adam Roben.
 
+        Linux/gdk build fixes.
+
+        * platform/GlyphPageTreeNode.h: Fix header guard name.
+        * platform/gdk/ChromeClientGdk.h:
+        * platform/gdk/CursorGdk.cpp:
+        (WebCore::verticalTextCursor):
+        (WebCore::cellCursor):
+        (WebCore::contextMenuCursor):
+        (WebCore::noDropCursor):
+        (WebCore::copyCursor):
+        (WebCore::progressCursor):
+        (WebCore::aliasCursor):
+        * platform/gdk/MouseEventGdk.cpp:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+        * platform/gdk/PageGdk.cpp: Removed. No longer used.
+        * platform/gdk/RenderThemeGdk.cpp:
+        (WebCore::RenderThemeGdk::getThemeData):
+        (WebCore::RenderThemeGdk::setCheckboxSize):
+        (WebCore::RenderThemeGdk::paintCheckbox):
+        (WebCore::RenderThemeGdk::setRadioSize):
+        (WebCore::RenderThemeGdk::paintRadio):
+        (WebCore::RenderThemeGdk::paintButton):
+        (WebCore::RenderThemeGdk::adjustTextFieldStyle):
+        (WebCore::RenderThemeGdk::paintTextField):
+        (WebCore::RenderThemeGdk::paintTextArea):
+        (WebCore::RenderThemeGdk::systemFont):
+        * platform/gdk/RenderThemeGdk.h:
+        * platform/gdk/ScreenGdk.cpp:
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+        (WebCore::screenIsMonochrome):
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+
+2007-02-08  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
+
+        Reviewed by Adam Roben.
+
         Linux/gdk build fixes for cairo.
 
         * platform/graphics/GraphicsContext.cpp:
diff --git a/WebCore/platform/GlyphPageTreeNode.h b/WebCore/platform/GlyphPageTreeNode.h
index b80d71d..9638b68 100644
--- a/WebCore/platform/GlyphPageTreeNode.h
+++ b/WebCore/platform/GlyphPageTreeNode.h
@@ -26,8 +26,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef GlyphMap_h
-#define GlyphMap_h
+#ifndef GlyphPageTreeNode_h
+#define GlyphPageTreeNode_h
 
 #include <wtf/unicode/Unicode.h>
 #include <wtf/Noncopyable.h>
diff --git a/WebCore/platform/gdk/ChromeClientGdk.h b/WebCore/platform/gdk/ChromeClientGdk.h
index 5308f61..d46eac7 100644
--- a/WebCore/platform/gdk/ChromeClientGdk.h
+++ b/WebCore/platform/gdk/ChromeClientGdk.h
@@ -28,23 +28,25 @@
 
 namespace WebCore {
 
-    class ChromeClientGdk : public ChromeClient, public Shared<ChromeClientGdk> {
+    class ChromeClientGdk : public ChromeClient {
     public:
         virtual ~ChromeClientGdk() { }
-            
-        virtual void setWindowRect(const FloatRect& r);
+
+        virtual void chromeDestroyed();
+
+        virtual void setWindowRect(const FloatRect&);
         virtual FloatRect windowRect();
 
         virtual FloatRect pageRect();
 
         virtual float scaleFactor();
 
-        virtual void ref() { Shared<ChromeClientGdk>::ref(); }
-        virtual void deref() { Shared<ChromeClientGdk>::deref(); }
-
         virtual void focus();
         virtual void unfocus();
 
+        virtual bool canTakeFocus(FocusDirection);
+        virtual void takeFocus(FocusDirection);
+
         virtual Page* createWindow(const FrameLoadRequest&);
         virtual Page* createModalDialog(const FrameLoadRequest&);
         virtual void show();
@@ -54,20 +56,33 @@
 
         virtual void setToolbarsVisible(bool);
         virtual bool toolbarsVisible();
-        
+
         virtual void setStatusbarVisible(bool);
         virtual bool statusbarVisible();
-        
+
         virtual void setScrollbarsVisible(bool);
         virtual bool scrollbarsVisible();
-        
+
         virtual void setMenubarVisible(bool);
         virtual bool menubarVisible();
 
         virtual void setResizable(bool);
 
-    };
+        virtual void addMessageToConsole(const String& message, unsigned int lineNumber,
+                                         const String& sourceID);
 
+        virtual bool canRunBeforeUnloadConfirmPanel();
+        virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
+
+        virtual void closeWindowSoon();
+
+        virtual void runJavaScriptAlert(Frame*, const String&);
+        virtual bool runJavaScriptConfirm(Frame*, const String&);
+        virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
+        virtual void setStatusbarText(const String&);
+        virtual bool shouldInterruptJavaScript();
+
+    };
 }
 
 #endif // ChromeClientGdk_h
diff --git a/WebCore/platform/gdk/CursorGdk.cpp b/WebCore/platform/gdk/CursorGdk.cpp
index f2263ca..38a9cc5 100644
--- a/WebCore/platform/gdk/CursorGdk.cpp
+++ b/WebCore/platform/gdk/CursorGdk.cpp
@@ -34,7 +34,7 @@
 #include <stdlib.h>
 #include <wtf/Assertions.h>
 
-#define notImplemented() do { fprintf(stderr, "%s FIXME: UNIMPLEMENTED %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); } while(0)
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED %s %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); } while(0)
 
 namespace WebCore {
 
@@ -198,6 +198,50 @@
     return c;
 }
 
+const Cursor& verticalTextCursor()
+{
+    // FIXME: optimize the way CursorQt is optmized: only one copy of a given
+    // cursor type
+    static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
+    return c;
+}
+
+const Cursor& cellCursor()
+{
+    static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
+    return c;
+}
+
+const Cursor& contextMenuCursor()
+{
+    static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
+    return c;
+}
+
+const Cursor& noDropCursor()
+{
+    static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
+    return c;
+}
+
+const Cursor& copyCursor()
+{
+    static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
+    return c;
+}
+
+const Cursor& progressCursor()
+{
+    static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
+    return c;
+}
+
+const Cursor& aliasCursor()
+{
+    static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
+    return c;
+}
+
 const Cursor& noneCursor()
 {
     static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
diff --git a/WebCore/platform/gdk/MouseEventGdk.cpp b/WebCore/platform/gdk/MouseEventGdk.cpp
index 6fde2217..2027b7d 100644
--- a/WebCore/platform/gdk/MouseEventGdk.cpp
+++ b/WebCore/platform/gdk/MouseEventGdk.cpp
@@ -27,6 +27,7 @@
 #include "config.h"
 #include "PlatformMouseEvent.h"
 
+#include "SystemTime.h"
 #include <assert.h>
 #include <gdk/gdk.h>
 
@@ -38,23 +39,30 @@
 
 PlatformMouseEvent::PlatformMouseEvent(GdkEvent* event)
 {
+    m_timestamp = currentTime();
+    m_position = IntPoint((int)event->motion.x, (int)event->motion.y);
+    m_globalPosition = IntPoint((int)event->motion.x_root, (int)event->motion.y_root);
+    m_shiftKey = event->button.state & GDK_SHIFT_MASK;
+    m_ctrlKey = event->button.state & GDK_CONTROL_MASK;
+    m_altKey = event->button.state & GDK_MOD1_MASK;
+    m_metaKey = event->button.state & GDK_MOD2_MASK;
+
     switch (event->type) {
         case GDK_MOTION_NOTIFY:
-            m_position = IntPoint((int)event->motion.x, (int)event->motion.y);
-            m_globalPosition = IntPoint((int)event->motion.x_root, (int)event->motion.y_root);
-            m_button = (MouseButton)(-1);
+            m_eventType = MouseEventMoved;
+            m_button = NoButton;
             m_clickCount = 0;
-            m_shiftKey =  event->motion.state & GDK_SHIFT_MASK != 0;
-            m_ctrlKey = event->motion.state & GDK_CONTROL_MASK != 0;
-            m_altKey =  event->motion.state & GDK_MOD1_MASK != 0;
-            m_metaKey = event->motion.state & GDK_MOD2_MASK != 0;
             break;
 
         case GDK_BUTTON_PRESS:
         case GDK_2BUTTON_PRESS:
         case GDK_3BUTTON_PRESS:
         case GDK_BUTTON_RELEASE:
-            if (event->type == GDK_BUTTON_PRESS)
+            m_eventType = MouseEventPressed;
+            if (event->type == GDK_BUTTON_RELEASE) {
+                m_eventType = MouseEventReleased;
+                m_clickCount = 0;
+            } else if (event->type == GDK_BUTTON_PRESS)
                 m_clickCount = 1;
             else if (event->type == GDK_2BUTTON_PRESS)
                 m_clickCount = 2;
@@ -67,13 +75,6 @@
                 m_button = MiddleButton;
             else if (event->button.button == 3)
                 m_button = RightButton;
-
-            m_position = IntPoint((int)event->button.x, (int)event->button.y);
-            m_globalPosition = IntPoint((int)event->button.x_root, (int)event->button.y_root);
-            m_shiftKey = event->button.state & GDK_SHIFT_MASK != 0;
-            m_ctrlKey = event->button.state & GDK_CONTROL_MASK != 0;
-            m_altKey = event->button.state & GDK_MOD1_MASK != 0;
-            m_metaKey = event->button.state & GDK_MOD2_MASK != 0;
             break;
 
         default:
diff --git a/WebCore/platform/gdk/PageGdk.cpp b/WebCore/platform/gdk/PageGdk.cpp
deleted file mode 100644
index 491b563..0000000
--- a/WebCore/platform/gdk/PageGdk.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR
- * 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. 
- */
-
-#include "config.h"
-#include "Page.h"
-
-#include "FloatRect.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include <gdk/gdk.h>
-
-namespace WebCore {
-
-}
-
diff --git a/WebCore/platform/gdk/RenderThemeGdk.cpp b/WebCore/platform/gdk/RenderThemeGdk.cpp
index 0d3a4c3..d175cf3 100644
--- a/WebCore/platform/gdk/RenderThemeGdk.cpp
+++ b/WebCore/platform/gdk/RenderThemeGdk.cpp
@@ -24,11 +24,11 @@
 
 #include "config.h"
 #include "RenderThemeGdk.h"
-#include "RenderPopupMenuGdk.h"
-#include "Document.h"
 
 #include "GraphicsContext.h"
-#include <cairo.h>
+#include "RenderObject.h"
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED %s %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); } while(0)
 
 #define THEME_COLOR 204
 #define THEME_FONT  210
@@ -139,11 +139,58 @@
             result.m_part = TFP_TEXTFIELD;
             result.m_state = determineState(o);
             break;
+        default:
+            // FIXME: much more?
+            break;
     }
 
     return result;
 }
 
+void RenderThemeGdk::setCheckboxSize(RenderStyle*) const 
+{ 
+    notImplemented(); 
+}
+
+bool RenderThemeGdk::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+{
+    // FIXME: is it the right thing to do?
+    return paintButton(o, i, r); 
+}
+
+void RenderThemeGdk::setRadioSize(RenderStyle*) const 
+{ 
+    notImplemented(); 
+}
+
+bool RenderThemeGdk::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+{ 
+    // FIXME: is it the right thing to do?
+    return paintButton(o, i, r); 
+}
+
+bool RenderThemeGdk::paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) 
+{ 
+    // FIXME: should use theme-aware drawing
+    return true;
+}
+
+void RenderThemeGdk::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element* e) const 
+{ 
+    notImplemented(); 
+}
+
+bool RenderThemeGdk::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+{
+    // FIXME: should use theme-aware drawing
+    return true;
+}
+
+bool RenderThemeGdk::paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+{
+    return paintTextField(o, i, r);
+}
+
 void RenderThemeGdk::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const
 {
     addIntrinsicMargins(style);
@@ -151,7 +198,6 @@
 
 void RenderThemeGdk::systemFont(int propId, FontDescription&) const
 {
-
 }
 
 }
diff --git a/WebCore/platform/gdk/RenderThemeGdk.h b/WebCore/platform/gdk/RenderThemeGdk.h
index 0d3602b..c298ab5 100644
--- a/WebCore/platform/gdk/RenderThemeGdk.h
+++ b/WebCore/platform/gdk/RenderThemeGdk.h
@@ -43,12 +43,14 @@
     // A method asking if the theme's controls actually care about redrawing when hovered.
     virtual bool supportsHover(const RenderStyle* style) const { return true; }
 
-    virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
-    { return paintButton(o, i, r); }
+    // System fonts.
+    virtual void systemFont(int propId, FontDescription&) const;
+
+protected:
+    virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
     virtual void setCheckboxSize(RenderStyle* style) const;
 
-    virtual bool paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
-    { return paintButton(o, i, r); }
+    virtual bool paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
     virtual void setRadioSize(RenderStyle* style) const;
 
     virtual void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
@@ -57,8 +59,7 @@
     virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
 
-    // System fonts.
-    virtual void systemFont(int propId, FontDescription&) const;
+    virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
 
 private:
     void addIntrinsicMargins(RenderStyle*) const;
diff --git a/WebCore/platform/gdk/ScreenGdk.cpp b/WebCore/platform/gdk/ScreenGdk.cpp
index 43a5ad1..4a20ec6 100644
--- a/WebCore/platform/gdk/ScreenGdk.cpp
+++ b/WebCore/platform/gdk/ScreenGdk.cpp
@@ -25,24 +25,43 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-// FIXME: should be renamed to ScreenClientGdk.cpp
-
 #include "config.h"
-#include "ScreenClientGdk.h"
+#include "Screen.h"
 
-#include "FloatRect.h"
-#include <gdk/gdk.h>
+#include <stdio.h>
 
-#define notImplemented() do { fprintf(stderr, "%s FIXME: UNIMPLEMENTED %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); } while(0)
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED %s %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); } while(0)
 
 namespace WebCore {
 
-int ScreenClientGdk::depth() { notImplemented(); return 32; }
-int ScreenClientGdk::depthPerComponent() { notImplemented(); return 8; }
+int screenDepth(Widget*) 
+{ 
+    notImplemented(); 
+    return 32;
+}
 
-bool ScreenClientGdk::isMonochrome() { notImplemented(); return false; }
+int screenDepthPerComponent(Widget*)
+{
+    notImplemented();
+    return 8;
+}
 
-FloatRect ScreenClientGdk::rect() { notImplemented(); return FloatRect(); }
-FloatRect ScreenClientGdk::usableRect() { notImplemented(); return FloatRect(); }
+bool screenIsMonochrome(Widget*) 
+{ 
+    notImplemented(); 
+    return false; 
+}
+
+FloatRect screenRect(Widget*) 
+{ 
+    notImplemented();
+    return FloatRect(); 
+}
+
+FloatRect screenAvailableRect(Widget*) 
+{ 
+    notImplemented(); 
+    return FloatRect(); 
+}
 
 }