summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/efl
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/efl')
-rw-r--r--WebCore/platform/efl/LanguageEfl.cpp (renamed from WebCore/platform/efl/Language.cpp)2
-rw-r--r--WebCore/platform/efl/PlatformKeyboardEventEfl.cpp12
-rw-r--r--WebCore/platform/efl/RenderThemeEfl.cpp35
-rw-r--r--WebCore/platform/efl/RenderThemeEfl.h8
-rw-r--r--WebCore/platform/efl/SharedBufferEfl.cpp2
-rw-r--r--WebCore/platform/efl/SharedTimerEfl.cpp80
-rw-r--r--WebCore/platform/efl/WidgetEfl.cpp2
7 files changed, 119 insertions, 22 deletions
diff --git a/WebCore/platform/efl/Language.cpp b/WebCore/platform/efl/LanguageEfl.cpp
index 1da7925..4b765a6 100644
--- a/WebCore/platform/efl/Language.cpp
+++ b/WebCore/platform/efl/LanguageEfl.cpp
@@ -34,7 +34,7 @@
namespace WebCore {
-String defaultLanguage()
+String platformDefaultLanguage()
{
notImplemented();
return String();
diff --git a/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
index fd84b15..2888b22 100644
--- a/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
+++ b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
@@ -39,7 +39,7 @@
#include <Evas.h>
#include <stdio.h>
#include <wtf/HashMap.h>
-#include <wtf/text/CString.h>
+#include <wtf/text/StringConcatenate.h>
#include <wtf/text/StringHash.h>
namespace WebCore {
@@ -53,7 +53,7 @@ static WindowsKeyMap gWindowsKeyMap;
static void createKeyMap()
{
for (unsigned int i = 1; i < 25; i++) {
- String key = String::format("F%d", i);
+ String key = makeString('F', String::number(i));
gKeyMap.set(key, key);
}
gKeyMap.set("Alt_L", "Alt");
@@ -131,15 +131,15 @@ static void createWindowsKeyMap()
gWindowsKeyMap.set("quotedbl", VK_OEM_7);
// Alphabet
- String alphabet = "abcdefghijklmnopqrstuvwxyz";
+ const char* alphabet = "abcdefghijklmnopqrstuvwxyz";
for (unsigned int i = 0; i < 26; i++) {
- String key = String::format("%c", alphabet[i]);
+ String key(alphabet + i, 1);
gWindowsKeyMap.set(key, VK_A + i);
}
// Digits
for (unsigned int i = 0; i < 10; i++) {
- String key = String::format("%d", i);
+ String key = String::number(i);
gWindowsKeyMap.set(key, VK_0 + i);
}
@@ -161,7 +161,7 @@ static void createWindowsKeyMap()
// F_XX
for (unsigned int i = 1; i < 25; i++) {
- String key = String::format("F%d", i);
+ String key = makeString('F', String::number(i));
gWindowsKeyMap.set(key, VK_F1 + i);
}
}
diff --git a/WebCore/platform/efl/RenderThemeEfl.cpp b/WebCore/platform/efl/RenderThemeEfl.cpp
index 53997be..6076747 100644
--- a/WebCore/platform/efl/RenderThemeEfl.cpp
+++ b/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -35,6 +35,7 @@
#include "Page.h"
#include "RenderBox.h"
#include "RenderObject.h"
+#include "RenderProgress.h"
#include "RenderSlider.h"
#include <wtf/text/CString.h>
@@ -296,6 +297,25 @@ bool RenderThemeEfl::paintThemePart(RenderObject* o, FormType type, const PaintI
msg->val[0] = static_cast<float>(value) / static_cast<float>(max);
msg->val[1] = 0.1;
edje_object_message_send(ce->o, EDJE_MESSAGE_FLOAT_SET, 0, msg);
+#if ENABLE(PROGRESS_TAG)
+ } else if (type == ProgressBar) {
+ RenderProgress* renderProgress = toRenderProgress(o);
+ Edje_Message_Float_Set* msg;
+ int max;
+ double value;
+
+ msg = static_cast<Edje_Message_Float_Set*>(alloca(sizeof(Edje_Message_Float_Set) + sizeof(float)));
+ max = rect.width();
+ value = renderProgress->position();
+
+ msg->count = 2;
+ if (o->style()->direction() == RTL)
+ msg->val[0] = (1.0 - value) * max;
+ else
+ msg->val[0] = 0;
+ msg->val[1] = value;
+ edje_object_message_send(ce->o, EDJE_MESSAGE_FLOAT_SET, 0, msg);
+#endif
}
edje_object_calc_force(ce->o);
@@ -562,6 +582,9 @@ const char* RenderThemeEfl::edjeGroupFromFormType(FormType type) const
W("entry"),
W("checkbox"),
W("combo"),
+#if ENABLE(PROGRESS_TAG)
+ W("progressbar"),
+#endif
W("search/field"),
W("search/decoration"),
W("search/results_button"),
@@ -1008,4 +1031,16 @@ void RenderThemeEfl::systemFont(int propId, FontDescription& fontDescription) co
fontDescription.setItalic(false);
}
+#if ENABLE(PROGRESS_TAG)
+void RenderThemeEfl::adjustProgressBarStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+{
+ style->setBoxShadow(0);
+}
+
+bool RenderThemeEfl::paintProgressBar(RenderObject* o, const PaintInfo& i, const IntRect& rect)
+{
+ return paintThemePart(o, ProgressBar, i, rect);
+}
+#endif
+
}
diff --git a/WebCore/platform/efl/RenderThemeEfl.h b/WebCore/platform/efl/RenderThemeEfl.h
index 478dfc5..087e2aa 100644
--- a/WebCore/platform/efl/RenderThemeEfl.h
+++ b/WebCore/platform/efl/RenderThemeEfl.h
@@ -45,6 +45,9 @@ enum FormType { // KEEP IN SYNC WITH edjeGroupFromFormType()
TextField,
CheckBox,
ComboBox,
+#if ENABLE(PROGRESS_TAG)
+ ProgressBar,
+#endif
SearchField,
SearchFieldDecoration,
SearchFieldResultsButton,
@@ -145,6 +148,11 @@ public:
static void setDefaultFontSize(int size);
+#if ENABLE(PROGRESS_TAG)
+ virtual void adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+ virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
+#endif
+
protected:
static float defaultFontSize;
diff --git a/WebCore/platform/efl/SharedBufferEfl.cpp b/WebCore/platform/efl/SharedBufferEfl.cpp
index 1025e33..23769ab 100644
--- a/WebCore/platform/efl/SharedBufferEfl.cpp
+++ b/WebCore/platform/efl/SharedBufferEfl.cpp
@@ -56,7 +56,7 @@ PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& fi
result = SharedBuffer::create();
result->m_buffer.resize(fileStat.st_size);
- if (result->m_buffer.size() != fileStat.st_size) {
+ if (result->m_buffer.size() != static_cast<unsigned>(fileStat.st_size)) {
fclose(file);
return 0;
}
diff --git a/WebCore/platform/efl/SharedTimerEfl.cpp b/WebCore/platform/efl/SharedTimerEfl.cpp
index 437de64..990d0c8 100644
--- a/WebCore/platform/efl/SharedTimerEfl.cpp
+++ b/WebCore/platform/efl/SharedTimerEfl.cpp
@@ -30,43 +30,97 @@
#include "SharedTimer.h"
#include <Ecore.h>
+#include <pthread.h>
#include <stdio.h>
#include <wtf/Assertions.h>
#include <wtf/CurrentTime.h>
+#include <wtf/MainThread.h>
namespace WebCore {
-static Ecore_Timer *g_sharedTimer = 0;
+static pthread_mutex_t timerMutex = PTHREAD_MUTEX_INITIALIZER;
+static Ecore_Timer *_sharedTimer = 0;
+static Ecore_Pipe *_pipe = 0;
-static void (*g_timerFunction)();
+static void (*_timerFunction)();
+
+struct timerOp {
+ double time;
+ unsigned char op; // 0 - add a timer; 1 - del a timer;
+};
void setSharedTimerFiredFunction(void (*func)())
{
- g_timerFunction = func;
+ _timerFunction = func;
}
static Eina_Bool timerEvent(void*)
{
- if (g_timerFunction)
- g_timerFunction();
+ if (_timerFunction)
+ _timerFunction();
+
+ _sharedTimer = 0;
return ECORE_CALLBACK_CANCEL;
}
-void stopSharedTimer()
+void processTimers(struct timerOp *tOp)
{
- if (g_sharedTimer) {
- ecore_timer_del(g_sharedTimer);
- g_sharedTimer = 0;
+ if (_sharedTimer) {
+ ecore_timer_del(_sharedTimer);
+ _sharedTimer = 0;
}
+
+ if (tOp->op == 1)
+ return;
+
+ double interval = tOp->time - currentTime();
+
+ if (interval <= ecore_animator_frametime_get()) {
+ if (_timerFunction)
+ _timerFunction();
+ return;
+ }
+
+ _sharedTimer = ecore_timer_add(interval, timerEvent, 0);
}
-void setSharedTimerFireTime(double fireTime)
+void pipeHandlerCb(void *data, void *buffer, unsigned int nbyte)
+{
+ ASSERT(nbyte == sizeof(struct timerOp));
+
+ struct timerOp *tOp = (struct timerOp *)buffer;
+ processTimers(tOp);
+}
+
+void stopSharedTimer()
{
- double interval = fireTime - currentTime();
+ struct timerOp tOp;
+ pthread_mutex_lock(&timerMutex);
+ if (!_pipe)
+ _pipe = ecore_pipe_add(pipeHandlerCb, 0);
+ pthread_mutex_unlock(&timerMutex);
- stopSharedTimer();
- g_sharedTimer = ecore_timer_add(interval, timerEvent, 0);
+ tOp.op = 1;
+ ecore_pipe_write(_pipe, &tOp, sizeof(tOp));
+}
+
+void addNewTimer(double fireTime)
+{
+ struct timerOp tOp;
+ pthread_mutex_lock(&timerMutex);
+ if (!_pipe)
+ _pipe = ecore_pipe_add(pipeHandlerCb, 0);
+ pthread_mutex_unlock(&timerMutex);
+
+ tOp.time = fireTime;
+ tOp.op = 0;
+ ecore_pipe_write(_pipe, &tOp, sizeof(tOp));
+}
+
+void setSharedTimerFireTime(double fireTime)
+{
+ addNewTimer(fireTime);
}
}
diff --git a/WebCore/platform/efl/WidgetEfl.cpp b/WebCore/platform/efl/WidgetEfl.cpp
index d82e99e..640e6e3 100644
--- a/WebCore/platform/efl/WidgetEfl.cpp
+++ b/WebCore/platform/efl/WidgetEfl.cpp
@@ -206,7 +206,7 @@ void Widget::setFocus(bool focused)
void Widget::applyFallbackCursor()
{
-#if HAVE_ECORE_X
+#ifdef HAVE_ECORE_X
if (m_data->m_isUsingEcoreX && !m_data->m_cursorGroup.isNull()) {
int shape = cursorStringMap.cursor(m_data->m_cursorGroup.utf8().data());