webengine/osswebengine/WebCore/platform/symbian/RenderThemeSymbian.cpp
changeset 5 10e98eab6f85
parent 0 dd21522fd290
child 36 c711bdda59f4
--- a/webengine/osswebengine/WebCore/platform/symbian/RenderThemeSymbian.cpp	Fri May 08 08:25:06 2009 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/RenderThemeSymbian.cpp	Fri Jul 03 15:54:40 2009 +0100
@@ -15,125 +15,26 @@
 *
 */
 
-
-#include "config.h"
+#include "RenderThemeSymbian.h"
+#include "staticobjectscontainer.h"
+// implement Symbian theme here
 
-#include "RenderTheme.h"
-#include "Event.h"
-#include "Document.h"
-#include "Image.h"
-#include "GraphicsContext.h"
-#include <../bidi.h>
-#include <eikenv.h>
-#include "RenderBox.h"
-#include <BitmapTransforms.h>
-#include "WebCoreGraphicsContext.h"
-#include "MaskedBitmap.h"
-#include "BitmapImage.h"
-#include "WebCoreWidget.h"
-// implement Symbian theme here
+
 
 namespace WebCore {
 
-enum {
-    ECheckBoxOn,
-    ECheckBoxOff,
-    ERadioOn,
-    ERadioOff,
-    ESelectArrow
-};
-
-class RenderThemeSymbian : public RenderTheme
-{
-public:
-    RenderThemeSymbian();
-    // A method asking if the theme's controls actually care about redrawing when hovered.
-    bool supportsHover(const RenderStyle*) const { return true; }
-    
-    void setCheckboxSize(RenderStyle*) const;    
-    void setRadioSize(RenderStyle*) const;
-
-    void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
-    void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
-    void adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
-    void adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
-    
-    bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
-    bool paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    bool paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    bool paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
-    bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
-    
-
-    bool isControlStyled(const RenderStyle*, const BorderData&,
-                                 const BackgroundLayer&, const Color&) const;
-    bool controlSupportsTints(const RenderObject*) const;
-    void systemFont(int propId, FontDescription&) const;
-    
-    Color platformActiveSelectionBackgroundColor() const; 
-    Color platformInactiveSelectionBackgroundColor() const;
-    Color platformActiveSelectionForegroundColor() const;
-    Color platformInactiveSelectionForegroundColor() const;
-    
-    void addIntrinsicMargins(RenderStyle*) const;
-    void close();
-    bool supportsFocus(EAppearance) const;
-    void paintButtonDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-
-    bool supportsFocusRing(const RenderStyle*) const;
-    void scaleImage(int type, int scalingFactor);
-    void scaleImageL(int type, int scalingFactor);
-
-    void cancel();
-    void run();
-
-    Image* m_checkBoxOn;
-    Image* m_checkBoxOff;
-    Image* m_scaledCheckBoxOn;
-    Image* m_scaledCheckBoxOff;
-    int m_scalingForCheckBoxOn;
-    int m_scalingForCheckBoxOff;
-
-    Image* m_radioButtonOn;
-    Image* m_radioButtonOff;
-    Image* m_scaledRadioOn;
-    Image* m_scaledRadioOff;
-    int m_scalingForRadioOn;
-    int m_scalingForRadioOff;
-
-    Image* m_selectArrow;
-    Image* m_scaledSelectArrow;
-    int m_scalingForSelectArrow;
-
-    CBitmapScaler* m_bitmapScaler;
-    CActiveSchedulerWait* m_asw;
-};
-
 RenderTheme* theme()
 {
-    static RenderThemeSymbian symbianTheme;
-    return &symbianTheme;
+    return StaticObjectsContainer::instance()->theme();
 }
 
+
+
 MScrollView* scrollView(const RenderObject::PaintInfo& i)
 {
     return &(i.context->platformContext()->view());
 }
 
-class SyncScaler : public CActive
-{
-public:
-    SyncScaler();
-    ~SyncScaler();
-    void init();
-    void RunL();
-    void DoCancel();
-    TInt RunError(TInt aError);
-    int m_error;
-};
-
 SyncScaler::SyncScaler() : CActive (CActive::EPriorityHigh)
 {
     CActiveScheduler::Add(this);
@@ -194,6 +95,48 @@
     m_asw = NULL;
 }
 
+RenderThemeSymbian::~RenderThemeSymbian()
+{
+RDebug::Printf("RenderThemeSymbian::~RenderThemeSymbian");
+
+    delete m_checkBoxOn;
+    m_checkBoxOn = 0;
+    
+    delete m_checkBoxOff;
+    m_checkBoxOff = 0;
+    
+    delete m_scaledCheckBoxOn;
+    m_scaledCheckBoxOn = 0;
+    
+    delete m_scaledCheckBoxOff;
+    m_scaledCheckBoxOff = 0;
+    
+    delete m_radioButtonOn;
+    m_radioButtonOn = 0;
+    
+    delete m_radioButtonOff;
+    m_radioButtonOff = 0;
+     
+    delete m_scaledRadioOn;
+    m_scaledRadioOn = 0;
+     
+    delete m_scaledRadioOff;
+    m_scaledRadioOff = 0;
+     
+    delete m_selectArrow;
+    m_selectArrow = 0;
+     
+    delete m_scaledSelectArrow;
+    m_scaledSelectArrow = 0;
+
+    delete m_bitmapScaler;
+    m_bitmapScaler = 0;
+     
+    delete m_asw;
+    m_asw = 0;
+}
+
+
 void RenderThemeSymbian::systemFont(int propId, FontDescription& fontDescription) const
 {
 }