diff options
Diffstat (limited to 'Source/WebCore/platform/efl/RenderThemeEfl.cpp')
-rw-r--r-- | Source/WebCore/platform/efl/RenderThemeEfl.cpp | 65 |
1 files changed, 58 insertions, 7 deletions
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) |