Bug #: 3851
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jul 2005 08:22:21 +0000 (08:22 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jul 2005 08:22:21 +0000 (08:22 +0000)
Submitted by: eseidel
Reviewed by: mjs
        * kwq/KWQPalette.h:
        (QColorGroup::): Enum values added for KDOM.
        (QPalette::): Enum values added for KDOM.
        * kwq/KWQPalette.mm: Added.
        (QPalette::setColor): Added (only supports "active").
        Many of these enum values (particularly ColorGroup)
        may be removed as KDOM gets better integrated with our tree.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3851

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

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQPalette.h
WebCore/kwq/KWQPalette.mm [new file with mode: 0644]

index 38a108a7f6829c01dbc1313e10a8490017c91df3..0454350fc7378163527e35e2c53f2af082f616e9 100644 (file)
@@ -1,3 +1,70 @@
+2005-07-05  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by NOBODY (OOPS!).
+
+        Test cases added: (NONE)
+
+        * khtml/css/parser.y:
+        * kwq/DOM-CSS.mm:
+        (-[DOMRGBColor _color]):
+        * kwq/KWQAccObject.mm:
+        (AXAttributeStringSetStyle):
+        * kwq/KWQColor.h:
+        * kwq/KWQColor.mm:
+        (qRed):
+        (qGreen):
+        (qBlue):
+        (parseHexColor):
+        (QColor::QColor):
+        (nsColor):
+        (cgColor):
+        (QColor::getRgbaF):
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::attributedString):
+        (KWQKHTMLPart::fontAttributesForSelectionStart):
+        (KWQKHTMLPart::bodyBackgroundColor):
+        * kwq/KWQLineEdit.mm:
+        (QLineEdit::setPalette):
+        * kwq/KWQPainter.mm:
+        (QPainter::_setColorFromBrush):
+        (QPainter::_setColorFromPen):
+        (QPainter::drawText):
+        (QPainter::drawHighlightForText):
+        (QPainter::drawLineForText):
+        (QPainter::_fillRect):
+        (QPainter::setShadow):
+        (QPainter::drawFocusRing):
+        * kwq/KWQPalette.h:
+        (QColorGroup::):
+        (QPalette::):
+        * kwq/KWQPalette.mm: Added.
+        (QPalette::setColor):
+        * kwq/KWQPoint.mm:
+        (QPoint::operator CGPoint):
+        (operator*):
+        (operator<<):
+        * kwq/KWQPointArray.h:
+        (QPoint::setX):
+        (QPoint::setY):
+        (QPoint::isNull):
+        (QPoint::operator -=):
+        * kwq/KWQPointArray.mm:
+        (QPointArray::QPointArray):
+        (QPointArray::copy):
+        (QPointArray::boundingRect):
+        (QPointArray::point):
+        * kwq/KWQPtrDict.h:
+        (QPtrDictIterator::operator()):
+        * kwq/KWQRegExp.h:
+        * kwq/KWQRegExp.mm:
+        (QRegExp::match):
+        (QRegExp::cap):
+        * kwq/KWQTextEdit.mm:
+        (QTextEdit::setPalette):
+        * kwq/KWQValueVector.h: Added.
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge selectionColor]):
+
 2005-07-05  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by mjs.
index 38c52f5036af6b01c369cadf095b6a09ab27ff83..8001596e735f470f7f307e0b6c341a430d539af4 100644 (file)
 
 class QColorGroup {
 public:
-    enum ColorRole { 
+    enum ColorRole {
+        Light,
+        Text,
+        Button,
+        Shadow,
+        ButtonText,
+        Dark,
+        Midlight,
         Background,
         Foreground,
         NColorRoles,
@@ -64,11 +71,21 @@ class QPalette {
 public:
     QPalette() { }
     QPalette(const QColor &b, const QColor &f) : m_active(b, f) { }
+    
+    enum ColorGroup {
+        Disabled,
+        Active,
+        Inactive,
+        NColorGroups,
+        Normal = Active
+    };
 
     const QColorGroup &active() const { return m_active; }
 
     const QColor &background() const { return m_active.background(); }
     const QColor &foreground() const { return m_active.foreground(); }
+    
+    void setColor(ColorGroup g, QColorGroup::ColorRole r, const QColor &c);
 
     bool operator==(const QPalette &other) const { return m_active == other.m_active; }
 
diff --git a/WebCore/kwq/KWQPalette.mm b/WebCore/kwq/KWQPalette.mm
new file mode 100644 (file)
index 0000000..a82fe51
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2005 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.
+ *
+ * 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. 
+ */
+
+#import "KWQPalette.h"
+#import "KWQLogging.h"
+
+
+void QPalette::setColor(ColorGroup group, QColorGroup::ColorRole role, const QColor &color)
+{
+    switch (group) {
+        case Active:
+            m_active.setColor(role, color);
+            break;
+        default:
+            LOG(NotYetImplemented, "QPallette::setColor() only supports the 'active' color group!");
+    }
+}
+