summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/efl
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-25 19:08:45 +0100
committerSteve Block <steveblock@google.com>2011-06-08 13:51:31 +0100
commit2bde8e466a4451c7319e3a072d118917957d6554 (patch)
tree28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/platform/efl
parent6939c99b71d9372d14a0c74a772108052e8c48c8 (diff)
downloadexternal_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebCore/platform/efl')
-rw-r--r--Source/WebCore/platform/efl/ContextMenuEfl.cpp14
-rw-r--r--Source/WebCore/platform/efl/ContextMenuItemEfl.cpp16
-rw-r--r--Source/WebCore/platform/efl/FileSystemEfl.cpp8
-rw-r--r--Source/WebCore/platform/efl/GeolocationServiceEfl.cpp80
-rw-r--r--Source/WebCore/platform/efl/GeolocationServiceEfl.h56
-rw-r--r--Source/WebCore/platform/efl/LocalizedStringsEfl.cpp2
-rw-r--r--Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp28
-rw-r--r--Source/WebCore/platform/efl/PlatformMouseEventEfl.cpp52
-rw-r--r--Source/WebCore/platform/efl/RenderThemeEfl.cpp65
-rw-r--r--Source/WebCore/platform/efl/RenderThemeEfl.h11
-rw-r--r--Source/WebCore/platform/efl/ScrollbarEfl.cpp72
-rw-r--r--Source/WebCore/platform/efl/ScrollbarEfl.h4
-rw-r--r--Source/WebCore/platform/efl/WidgetEfl.cpp18
13 files changed, 311 insertions, 115 deletions
diff --git a/Source/WebCore/platform/efl/ContextMenuEfl.cpp b/Source/WebCore/platform/efl/ContextMenuEfl.cpp
index a5c6524..45d1758 100644
--- a/Source/WebCore/platform/efl/ContextMenuEfl.cpp
+++ b/Source/WebCore/platform/efl/ContextMenuEfl.cpp
@@ -2,7 +2,7 @@
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
* Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
+ * Copyright (C) 2011 Samsung Electronics
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,16 +26,12 @@
namespace WebCore {
+#if USE(CROSS_PLATFORM_CONTEXT_MENUS)
ContextMenu::ContextMenu(void* menu)
{
getContextMenuItems(menu, m_items);
}
-ContextMenu::ContextMenu()
-{
- notImplemented();
-}
-
void ContextMenu::getContextMenuItems(void* menu, Vector<ContextMenuItem>& items)
{
notImplemented();
@@ -51,5 +47,11 @@ void* ContextMenu::nativeMenu() const
{
return createNativeMenuFromItems(m_items);
}
+#else
+ContextMenu::ContextMenu()
+{
+ notImplemented();
+}
+#endif
}
diff --git a/Source/WebCore/platform/efl/ContextMenuItemEfl.cpp b/Source/WebCore/platform/efl/ContextMenuItemEfl.cpp
index 5ce8fab..425c6a6 100644
--- a/Source/WebCore/platform/efl/ContextMenuItemEfl.cpp
+++ b/Source/WebCore/platform/efl/ContextMenuItemEfl.cpp
@@ -3,7 +3,7 @@
* Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net>
* Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
* Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
+ * Copyright (C) 2011 Samsung Electronics
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,11 +34,13 @@
namespace WebCore {
-ContextMenuItem::ContextMenuItem(void* const&)
+#if USE(CROSS_PLATFORM_CONTEXT_MENUS)
+void* ContextMenuItem::nativeMenuItem() const
{
notImplemented();
+ return 0;
}
-
+#else
ContextMenuItem::ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String&, ContextMenu*)
{
notImplemented();
@@ -49,12 +51,6 @@ ContextMenuItem::~ContextMenuItem()
notImplemented();
}
-void* ContextMenuItem::nativeMenuItem() const
-{
- notImplemented();
- return 0;
-}
-
ContextMenuItemType ContextMenuItem::type() const
{
notImplemented();
@@ -98,5 +94,5 @@ void ContextMenuItem::setSubMenu(ContextMenu*)
{
notImplemented();
}
-
+#endif
}
diff --git a/Source/WebCore/platform/efl/FileSystemEfl.cpp b/Source/WebCore/platform/efl/FileSystemEfl.cpp
index cb117bc..01c6c67 100644
--- a/Source/WebCore/platform/efl/FileSystemEfl.cpp
+++ b/Source/WebCore/platform/efl/FileSystemEfl.cpp
@@ -67,7 +67,7 @@ CString fileSystemRepresentation(const String& path)
#endif
}
-CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
+String openTemporaryFile(const String& prefix, PlatformFileHandle& handle)
{
char buffer[PATH_MAX];
const char* tmpDir = getenv("TMPDIR");
@@ -75,18 +75,18 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
if (!tmpDir)
tmpDir = "/tmp";
- if (snprintf(buffer, PATH_MAX, "%s/%sXXXXXX", tmpDir, prefix) >= PATH_MAX)
+ if (snprintf(buffer, PATH_MAX, "%s/%sXXXXXX", tmpDir, prefix.utf8().data()) >= PATH_MAX)
goto end;
handle = mkstemp(buffer);
if (handle < 0)
goto end;
- return CString(buffer);
+ return String::fromUTF8(buffer);
end:
handle = invalidPlatformFileHandle;
- return CString();
+ return String();
}
bool unloadModule(PlatformModule module)
diff --git a/Source/WebCore/platform/efl/GeolocationServiceEfl.cpp b/Source/WebCore/platform/efl/GeolocationServiceEfl.cpp
new file mode 100644
index 0000000..0c0e744
--- /dev/null
+++ b/Source/WebCore/platform/efl/GeolocationServiceEfl.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "GeolocationServiceEfl.h"
+
+#if ENABLE(GEOLOCATION)
+#include "NotImplemented.h"
+#include "PositionOptions.h"
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+GeolocationService::FactoryFunction* GeolocationService::s_factoryFunction = &GeolocationServiceEfl::create;
+
+GeolocationService* GeolocationServiceEfl::create(GeolocationServiceClient* client)
+{
+ return new GeolocationServiceEfl(client);
+}
+
+GeolocationServiceEfl::GeolocationServiceEfl(GeolocationServiceClient* client)
+ : GeolocationService(client)
+{
+}
+
+GeolocationServiceEfl::~GeolocationServiceEfl()
+{
+ notImplemented();
+}
+
+bool GeolocationServiceEfl::startUpdating(PositionOptions* options)
+{
+ notImplemented();
+ return false;
+}
+
+void GeolocationServiceEfl::stopUpdating()
+{
+ notImplemented();
+}
+
+void GeolocationServiceEfl::suspend()
+{
+ notImplemented();
+}
+
+void GeolocationServiceEfl::resume()
+{
+ notImplemented();
+}
+
+Geoposition* GeolocationServiceEfl::lastPosition() const
+{
+ return m_lastPosition.get();
+}
+
+PositionError* GeolocationServiceEfl::lastError() const
+{
+ return m_lastError.get();
+}
+
+}
+#endif // ENABLE(GEOLOCATION)
diff --git a/Source/WebCore/platform/efl/GeolocationServiceEfl.h b/Source/WebCore/platform/efl/GeolocationServiceEfl.h
new file mode 100644
index 0000000..e7ac66c
--- /dev/null
+++ b/Source/WebCore/platform/efl/GeolocationServiceEfl.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef GeolocationServiceEfl_h
+#define GeolocationServiceEfl_h
+
+#if ENABLE(GEOLOCATION)
+#include "GeolocationService.h"
+#include "Geoposition.h"
+#include "PositionError.h"
+#include "RefPtr.h"
+
+namespace WebCore {
+
+class GeolocationServiceEfl : public GeolocationService {
+public:
+ static GeolocationService* create(GeolocationServiceClient*);
+ ~GeolocationServiceEfl();
+
+ virtual bool startUpdating(PositionOptions*);
+ virtual void stopUpdating();
+
+ virtual void suspend();
+ virtual void resume();
+
+ virtual Geoposition* lastPosition() const;
+ virtual PositionError* lastError() const;
+
+private:
+ GeolocationServiceEfl(GeolocationServiceClient*);
+
+ RefPtr<Geoposition> m_lastPosition;
+ RefPtr<PositionError> m_lastError;
+
+};
+
+}
+#endif // ENABLE(GEOLOCATION)
+#endif
diff --git a/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp b/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
index 7e852f4..36a9f01 100644
--- a/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
+++ b/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
@@ -241,7 +241,7 @@ String contextMenuItemTagSearchWeb()
return String::fromUTF8("Search the Web");
}
-String contextMenuItemTagLookUpInDictionary()
+String contextMenuItemTagLookUpInDictionary(const String&)
{
return String::fromUTF8("Look Up in Dictionary");
}
diff --git a/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp b/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
index 2888b22..10121df 100644
--- a/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
+++ b/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
@@ -188,15 +188,15 @@ static int windowsKeyCodeForEvasKeyName(String& keyName)
return 0;
}
-PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Down* ev)
+PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Down* event)
: m_type(KeyDown)
- , m_text(String::fromUTF8(ev->string))
- , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
- , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
- , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
- , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+ , m_text(String::fromUTF8(event->string))
+ , m_shiftKey(evas_key_modifier_is_set(event->modifiers, "Shift"))
+ , m_ctrlKey(evas_key_modifier_is_set(event->modifiers, "Control"))
+ , m_altKey(evas_key_modifier_is_set(event->modifiers, "Alt"))
+ , m_metaKey(evas_key_modifier_is_set(event->modifiers, "Meta"))
{
- String keyName = String(ev->key);
+ String keyName = String(event->key);
m_keyIdentifier = keyIdentifierForEvasKeyName(keyName);
m_windowsVirtualKeyCode = windowsKeyCodeForEvasKeyName(keyName);
@@ -205,15 +205,15 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Down* ev)
m_autoRepeat = false;
}
-PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Up* ev)
+PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Up* event)
: m_type(KeyUp)
- , m_text(String::fromUTF8(ev->string))
- , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
- , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
- , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
- , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+ , m_text(String::fromUTF8(event->string))
+ , m_shiftKey(evas_key_modifier_is_set(event->modifiers, "Shift"))
+ , m_ctrlKey(evas_key_modifier_is_set(event->modifiers, "Control"))
+ , m_altKey(evas_key_modifier_is_set(event->modifiers, "Alt"))
+ , m_metaKey(evas_key_modifier_is_set(event->modifiers, "Meta"))
{
- String keyName = String(ev->key);
+ String keyName = String(event->key);
m_keyIdentifier = keyIdentifierForEvasKeyName(keyName);
m_windowsVirtualKeyCode = windowsKeyCodeForEvasKeyName(keyName);
diff --git a/Source/WebCore/platform/efl/PlatformMouseEventEfl.cpp b/Source/WebCore/platform/efl/PlatformMouseEventEfl.cpp
index 53de522..172b493 100644
--- a/Source/WebCore/platform/efl/PlatformMouseEventEfl.cpp
+++ b/Source/WebCore/platform/efl/PlatformMouseEventEfl.cpp
@@ -47,44 +47,44 @@ void PlatformMouseEvent::setClickCount(unsigned int flags)
m_clickCount = 1;
}
-PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Down* ev, IntPoint pos)
- : m_position(IntPoint(ev->canvas.x - pos.x(), ev->canvas.y - pos.y()))
- , m_globalPosition(IntPoint(ev->canvas.x, ev->canvas.y))
- , m_button(MouseButton(ev->button - 1))
+PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Down* event, IntPoint position)
+ : m_position(IntPoint(event->canvas.x - position.x(), event->canvas.y - position.y()))
+ , m_globalPosition(IntPoint(event->canvas.x, event->canvas.y))
+ , m_button(MouseButton(event->button - 1))
, m_eventType(MouseEventPressed)
- , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
- , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
- , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
- , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+ , m_shiftKey(evas_key_modifier_is_set(event->modifiers, "Shift"))
+ , m_ctrlKey(evas_key_modifier_is_set(event->modifiers, "Control"))
+ , m_altKey(evas_key_modifier_is_set(event->modifiers, "Alt"))
+ , m_metaKey(evas_key_modifier_is_set(event->modifiers, "Meta"))
, m_timestamp(currentTime())
{
- setClickCount(ev->flags);
+ setClickCount(event->flags);
}
-PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Up* ev, IntPoint pos)
- : m_position(IntPoint(ev->canvas.x - pos.x(), ev->canvas.y - pos.y()))
- , m_globalPosition(IntPoint(ev->canvas.x, ev->canvas.y))
- , m_button(MouseButton(ev->button - 1))
+PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Up* event, IntPoint position)
+ : m_position(IntPoint(event->canvas.x - position.x(), event->canvas.y - position.y()))
+ , m_globalPosition(IntPoint(event->canvas.x, event->canvas.y))
+ , m_button(MouseButton(event->button - 1))
, m_eventType(MouseEventReleased)
- , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
- , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
- , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
- , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+ , m_shiftKey(evas_key_modifier_is_set(event->modifiers, "Shift"))
+ , m_ctrlKey(evas_key_modifier_is_set(event->modifiers, "Control"))
+ , m_altKey(evas_key_modifier_is_set(event->modifiers, "Alt"))
+ , m_metaKey(evas_key_modifier_is_set(event->modifiers, "Meta"))
, m_timestamp(currentTime())
{
- setClickCount(ev->flags);
+ setClickCount(event->flags);
}
-PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Move* ev, IntPoint pos)
- : m_position(IntPoint(ev->cur.canvas.x - pos.x(), ev->cur.canvas.y - pos.y()))
- , m_globalPosition(IntPoint(ev->cur.canvas.x, ev->cur.canvas.y))
- , m_button(MouseButton(ev->buttons - 1))
+PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Move* event, IntPoint position)
+ : m_position(IntPoint(event->cur.canvas.x - position.x(), event->cur.canvas.y - position.y()))
+ , m_globalPosition(IntPoint(event->cur.canvas.x, event->cur.canvas.y))
+ , m_button(MouseButton(event->buttons - 1))
, m_eventType(MouseEventMoved)
, m_clickCount(0)
- , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
- , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
- , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
- , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+ , m_shiftKey(evas_key_modifier_is_set(event->modifiers, "Shift"))
+ , m_ctrlKey(evas_key_modifier_is_set(event->modifiers, "Control"))
+ , m_altKey(evas_key_modifier_is_set(event->modifiers, "Alt"))
+ , m_metaKey(evas_key_modifier_is_set(event->modifiers, "Meta"))
, m_timestamp(currentTime())
{
}
diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.cpp b/Source/WebCore/platform/efl/RenderThemeEfl.cpp
index 3e8a646..439e377 100644
--- a/Source/WebCore/platform/efl/RenderThemeEfl.cpp
+++ b/Source/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -38,11 +38,21 @@
#include "RenderObject.h"
#include "RenderProgress.h"
#include "RenderSlider.h"
+#include "UserAgentStyleSheets.h"
#include <wtf/text/CString.h>
#include <Ecore_Evas.h>
#include <Edje.h>
+
+#if ENABLE(VIDEO)
+#include "HTMLMediaElement.h"
+#include "HTMLNames.h"
+#endif
+
namespace WebCore {
+#if ENABLE(VIDEO)
+using namespace HTMLNames;
+#endif
// TODO: change from object count to ecore_evas size (bytes)
// TODO: as objects are webpage/user defined and they can be very large.
@@ -273,7 +283,7 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P
applyEdjeStateFromForm(entry->o, controlStatesForRenderer(object));
- cairo = info.context->platformContext();
+ cairo = info.context->platformContext()->cr();
ASSERT(cairo);
// Currently, only sliders needs this message; if other widget ever needs special
@@ -592,6 +602,10 @@ const char* RenderThemeEfl::edjeGroupFromFormType(FormType type) const
W("search/cancel_button"),
W("slider/vertical"),
W("slider/horizontal"),
+#if ENABLE(VIDEO)
+ W("mediacontrol/playpause_button"),
+ W("mediacontrol/mute_button"),
+#endif
#undef W
0
};
@@ -1044,10 +1058,32 @@ bool RenderThemeEfl::paintProgressBar(RenderObject* object, const PaintInfo& inf
#endif
#if ENABLE(VIDEO)
+bool RenderThemeEfl::emitMediaButtonSignal(FormType formType, MediaControlElementType mediaElementType, const IntRect& rect)
+{
+ ThemePartCacheEntry* entry;
+
+ entry = cacheThemePartGet(formType, rect.size());
+ ASSERT(entry);
+ if (!entry)
+ return false;
+
+ if (mediaElementType == MediaPlayButton)
+ edje_object_signal_emit(entry->o, "play", "");
+ else if (mediaElementType == MediaPauseButton)
+ edje_object_signal_emit(entry->o, "pause", "");
+ else if (mediaElementType == MediaMuteButton)
+ edje_object_signal_emit(entry->o, "mute", "");
+ else if (mediaElementType == MediaUnMuteButton)
+ edje_object_signal_emit(entry->o, "sound", "");
+ else
+ return false;
+
+ return true;
+}
+
String RenderThemeEfl::extraMediaControlsStyleSheet()
{
- notImplemented();
- return String();
+ return String(mediaControlsEflUserAgentStyleSheet, sizeof(mediaControlsEflUserAgentStyleSheet));
}
String RenderThemeEfl::formatMediaControlsCurrentTime(float currentTime, float duration) const
@@ -1064,14 +1100,29 @@ bool RenderThemeEfl::paintMediaFullscreenButton(RenderObject* object, const Pain
bool RenderThemeEfl::paintMediaMuteButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
{
- notImplemented();
- return false;
+ Node* mediaNode = object->node() ? object->node()->shadowAncestorNode() : 0;
+ if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagName(audioTag)))
+ return false;
+
+ HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(mediaNode);
+
+ if (!emitMediaButtonSignal(MediaMuteUnMuteButton, mediaElement->muted() ? MediaMuteButton : MediaUnMuteButton, rect))
+ return false;
+
+ return paintThemePart(object, MediaMuteUnMuteButton, info, rect);
}
bool RenderThemeEfl::paintMediaPlayButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
{
- notImplemented();
- return false;
+ Node* node = object->node();
+ if (!node)
+ return false;
+
+ MediaControlPlayButtonElement* button = static_cast<MediaControlPlayButtonElement*>(node);
+ if (!emitMediaButtonSignal(MediaPlayPauseButton, button->displayType(), rect))
+ return false;
+
+ return paintThemePart(object, MediaPlayPauseButton, info, rect);
}
bool RenderThemeEfl::paintMediaSeekBackButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.h b/Source/WebCore/platform/efl/RenderThemeEfl.h
index 9970096..fe8e2d2 100644
--- a/Source/WebCore/platform/efl/RenderThemeEfl.h
+++ b/Source/WebCore/platform/efl/RenderThemeEfl.h
@@ -30,6 +30,9 @@
#ifndef RenderThemeEfl_h
#define RenderThemeEfl_h
+#if ENABLE(VIDEO)
+#include "MediaControlElements.h"
+#endif
#include "RenderTheme.h"
#include <cairo.h>
@@ -55,6 +58,10 @@ enum FormType { // KEEP IN SYNC WITH edjeGroupFromFormType()
SearchFieldCancelButton,
SliderVertical,
SliderHorizontal,
+#if ENABLE(VIDEO)
+ MediaPlayPauseButton,
+ MediaMuteUnMuteButton,
+#endif
FormTypeLast
};
@@ -182,6 +189,10 @@ private:
void applyEdjeStateFromForm(Evas_Object*, ControlStates);
bool paintThemePart(RenderObject*, FormType, const PaintInfo&, const IntRect&);
+#if ENABLE(VIDEO)
+ bool emitMediaButtonSignal(FormType, MediaControlElementType, const IntRect&);
+#endif
+
Page* m_page;
Color m_activeSelectionBackgroundColor;
Color m_activeSelectionForegroundColor;
diff --git a/Source/WebCore/platform/efl/ScrollbarEfl.cpp b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
index e71d1e3..162c2a1 100644
--- a/Source/WebCore/platform/efl/ScrollbarEfl.cpp
+++ b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
@@ -64,50 +64,50 @@ ScrollbarEfl::~ScrollbarEfl()
setEvasObject(0);
}
-static void scrollbarEflEdjeMessage(void* data, Evas_Object* o, Edje_Message_Type type, int id, void* msg)
+static void scrollbarEflEdjeMessage(void* data, Evas_Object* object, Edje_Message_Type messageType, int id, void* message)
{
ScrollbarEfl* that = static_cast<ScrollbarEfl*>(data);
- Edje_Message_Float* m;
- int v;
+ Edje_Message_Float* messageFloat;
+ int value;
if (!id) {
EINA_LOG_ERR("Unknown message id '%d' from scroll bar theme.", id);
return;
}
- if (type != EDJE_MESSAGE_FLOAT) {
+ if (messageType != EDJE_MESSAGE_FLOAT) {
EINA_LOG_ERR("Message id '%d' of incorrect type from scroll bar theme. "
"Expected '%d', got '%d'.",
- id, EDJE_MESSAGE_FLOAT, type);
+ id, EDJE_MESSAGE_FLOAT, messageType);
return;
}
- m = static_cast<Edje_Message_Float*>(msg);
- v = m->val * (that->totalSize() - that->visibleSize());
- that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), v);
+ messageFloat = static_cast<Edje_Message_Float*>(message);
+ value = messageFloat->val * (that->totalSize() - that->visibleSize());
+ that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), value);
}
void ScrollbarEfl::setParent(ScrollView* view)
{
- Evas_Object* o = evasObject();
+ Evas_Object* object = evasObject();
Evas_Coord w, h;
Widget::setParent(view);
- if (!o) {
+ if (!object) {
if (!view)
return;
- o = edje_object_add(view->evas());
- if (!o) {
+ object = edje_object_add(view->evas());
+ if (!object) {
EINA_LOG_ERR("Could not create edje object for view=%p (evas=%p)",
view, view->evas());
return;
}
- edje_object_message_handler_set(o, scrollbarEflEdjeMessage, this);
- setEvasObject(o);
+ edje_object_message_handler_set(object, scrollbarEflEdjeMessage, this);
+ setEvasObject(object);
} else if (!view) {
- evas_object_hide(o);
+ evas_object_hide(object);
return;
}
@@ -117,23 +117,23 @@ void ScrollbarEfl::setParent(ScrollView* view)
if (theme.isEmpty()) {
EINA_LOG_ERR("Could not load theme '%s': no theme path set.", group);
- evas_object_hide(o);
+ evas_object_hide(object);
return;
}
- if (!edje_object_file_set(o, theme.utf8().data(), group)) {
- Edje_Load_Error err = edje_object_load_error_get(o);
- const char* errmsg = edje_load_error_str(err);
+ if (!edje_object_file_set(object, theme.utf8().data(), group)) {
+ Edje_Load_Error err = edje_object_load_error_get(object);
+ const char* errmessage = edje_load_error_str(err);
EINA_LOG_ERR("Could not load theme '%s' from file '%s': #%d '%s'",
- group, theme.utf8().data(), err, errmsg);
+ group, theme.utf8().data(), err, errmessage);
return;
}
- setPlatformWidget(o);
- evas_object_smart_member_add(o, view->evasObject());
- evas_object_show(o);
+ setPlatformWidget(object);
+ evas_object_smart_member_add(object, view->evasObject());
+ evas_object_show(object);
- edje_object_size_min_get(o, &w, &h);
+ edje_object_size_min_get(object, &w, &h);
IntRect rect = frameRect();
rect.setSize(IntSize(w, h));
@@ -168,21 +168,21 @@ void ScrollbarEfl::updateThumbPositionAndProportion()
m_lastTotalSize = tSize;
m_lastVisibleSize = vSize;
- Edje_Message_Float_Set* msg = static_cast<Edje_Message_Float_Set*>
+ Edje_Message_Float_Set* message = static_cast<Edje_Message_Float_Set*>
(alloca(sizeof(Edje_Message_Float_Set) + sizeof(float)));
- msg->count = 2;
+ message->count = 2;
if (tSize - vSize > 0)
- msg->val[0] = pos / (float)(tSize - vSize);
+ message->val[0] = pos / static_cast<float>(tSize - vSize);
else
- msg->val[0] = 0.0;
+ message->val[0] = 0.0;
if (tSize > 0)
- msg->val[1] = vSize / (float)tSize;
+ message->val[1] = vSize / static_cast<float>(tSize);
else
- msg->val[1] = 0.0;
+ message->val[1] = 0.0;
- edje_object_message_send(platformWidget(), EDJE_MESSAGE_FLOAT_SET, 0, msg);
+ edje_object_message_send(platformWidget(), EDJE_MESSAGE_FLOAT_SET, 0, message);
}
void ScrollbarEfl::setFrameRect(const IntRect& rect)
@@ -193,10 +193,10 @@ void ScrollbarEfl::setFrameRect(const IntRect& rect)
void ScrollbarEfl::frameRectsChanged()
{
- Evas_Object* o = platformWidget();
+ Evas_Object* object = platformWidget();
Evas_Coord x, y;
- if (!parent() || !o)
+ if (!parent() || !object)
return;
IntRect rect = frameRect();
@@ -206,11 +206,11 @@ void ScrollbarEfl::frameRectsChanged()
rect.setLocation(parent()->contentsToWindow(rect.location()));
evas_object_geometry_get(root()->evasObject(), &x, &y, 0, 0);
- evas_object_move(o, x + rect.x(), y + rect.y());
- evas_object_resize(o, rect.width(), rect.height());
+ evas_object_move(object, x + rect.x(), y + rect.y());
+ evas_object_resize(object, rect.width(), rect.height());
}
-void ScrollbarEfl::paint(GraphicsContext* context, const IntRect& rect)
+void ScrollbarEfl::paint(GraphicsContext* graphicsContext, const IntRect& damageRect)
{
}
diff --git a/Source/WebCore/platform/efl/ScrollbarEfl.h b/Source/WebCore/platform/efl/ScrollbarEfl.h
index 09dc64f..1f67d2f 100644
--- a/Source/WebCore/platform/efl/ScrollbarEfl.h
+++ b/Source/WebCore/platform/efl/ScrollbarEfl.h
@@ -49,7 +49,7 @@ public:
virtual void frameRectsChanged();
- virtual void paint(GraphicsContext* context, const IntRect& damageRect);
+ virtual void paint(GraphicsContext*, const IntRect&);
protected:
ScrollbarEfl(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
@@ -58,7 +58,7 @@ protected:
virtual void updateThumbPosition();
virtual void updateThumbProportion();
- virtual void setParent(ScrollView* view);
+ virtual void setParent(ScrollView*);
private:
int m_lastPos;
diff --git a/Source/WebCore/platform/efl/WidgetEfl.cpp b/Source/WebCore/platform/efl/WidgetEfl.cpp
index 640e6e3..45d4792 100644
--- a/Source/WebCore/platform/efl/WidgetEfl.cpp
+++ b/Source/WebCore/platform/efl/WidgetEfl.cpp
@@ -183,10 +183,10 @@ void Widget::setFrameRect(const IntRect& rect)
void Widget::frameRectsChanged()
{
- Evas_Object* o = evasObject();
+ Evas_Object* object = evasObject();
Evas_Coord x, y;
- if (!parent() || !o)
+ if (!parent() || !object)
return;
IntRect rect = frameRect();
@@ -196,8 +196,8 @@ void Widget::frameRectsChanged()
rect.setLocation(parent()->contentsToWindow(rect.location()));
evas_object_geometry_get(root()->evasObject(), &x, &y, 0, 0);
- evas_object_move(o, x + rect.x(), y + rect.y());
- evas_object_resize(o, rect.width(), rect.height());
+ evas_object_move(object, x + rect.x(), y + rect.y());
+ evas_object_resize(object, rect.width(), rect.height());
}
void Widget::setFocus(bool focused)
@@ -332,14 +332,14 @@ Ecore_Evas* Widget::ecoreEvas() const
return static_cast<Ecore_Evas*>(evas_data_attach_get(evas()));
}
-void Widget::setEvasObject(Evas_Object *o)
+void Widget::setEvasObject(Evas_Object *object)
{
// FIXME: study platformWidget() and use it
// FIXME: right now platformWidget() requires implementing too much
- if (m_data->m_evasObject == o)
+ if (m_data->m_evasObject == object)
return;
- m_data->m_evasObject = o;
- if (!o) {
+ m_data->m_evasObject = object;
+ if (!object) {
m_data->m_evas = 0;
#ifdef HAVE_ECORE_X
m_data->m_isUsingEcoreX = false;
@@ -347,7 +347,7 @@ void Widget::setEvasObject(Evas_Object *o)
return;
}
- m_data->m_evas = evas_object_evas_get(o);
+ m_data->m_evas = evas_object_evas_get(object);
#ifdef HAVE_ECORE_X
const char *engine = ecore_evas_engine_name_get(ecoreEvas());