Reviewed by Antonio Gomes.
[EFL] Add play / pause button to media control
https://bugs.webkit.org/show_bug.cgi?id=55463
Add play|pause button to media control.
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::edjeGroupFromFormType):
(WebCore::RenderThemeEfl::emitMediaButtonSignal): Added.
(WebCore::RenderThemeEfl::paintMediaPlayButton):
* platform/efl/RenderThemeEfl.h:
2011-03-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Reviewed by Antonio Gomes.
[EFL] Add play / pause button to media control
https://bugs.webkit.org/show_bug.cgi?id=55463
Add play|pause button to media control.
* DefaultTheme/default.edc:
* DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png: Added.
* DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png: Added.
* DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81777
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-03-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add play / pause button to media control
+ https://bugs.webkit.org/show_bug.cgi?id=55463
+
+ Add play|pause button to media control.
+
+ * platform/efl/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::edjeGroupFromFormType):
+ (WebCore::RenderThemeEfl::emitMediaButtonSignal): Added.
+ (WebCore::RenderThemeEfl::paintMediaPlayButton):
+ * platform/efl/RenderThemeEfl.h:
+
2011-03-23 Aparna Nandyal <aparna.nand@wipro.com>
Reviewed by Andreas Kling.
W("search/cancel_button"),
W("slider/vertical"),
W("slider/horizontal"),
+#if ENABLE(VIDEO)
+ W("mediacontrol/playpause_button"),
+#endif
#undef W
0
};
#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
+ return false;
+
+ return true;
+}
+
String RenderThemeEfl::extraMediaControlsStyleSheet()
{
return String(mediaControlsEflUserAgentStyleSheet, sizeof(mediaControlsEflUserAgentStyleSheet));
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)
#ifndef RenderThemeEfl_h
#define RenderThemeEfl_h
+#if ENABLE(VIDEO)
+#include "MediaControlElements.h"
+#endif
#include "RenderTheme.h"
#include <cairo.h>
SearchFieldCancelButton,
SliderVertical,
SliderHorizontal,
+#if ENABLE(VIDEO)
+ MediaPlayPauseButton,
+#endif
FormTypeLast
};
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;
+2011-03-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add play / pause button to media control
+ https://bugs.webkit.org/show_bug.cgi?id=55463
+
+ Add play|pause button to media control.
+
+ * DefaultTheme/default.edc:
+ * DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png: Added.
+ * DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png: Added.
+ * DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc: Added.
+
2011-03-22 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Reviewed by Antonio Gomes.
#include "widget/search/cancel/search_cancel.edc"
#include "widget/search/decoration/search_decoration.edc"
#include "widget/slider/slider.edc"
+#include "widget/mediacontrol/playpausebutton/playpause_button.edc"
}
--- /dev/null
+/*
+ Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia
+ Copyright (C) 2009,2010 ProFUSION embedded systems
+ Copyright (C) 2011 Samsung Electronics
+
+ This file 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 file 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.
+*/
+
+ group {
+ name: "webkit/widget/mediacontrol/playpause_button";
+
+ images {
+ image: "widget/mediacontrol/playpausebutton/playbutton.png" COMP;
+ image: "widget/mediacontrol/playpausebutton/pausebutton.png" COMP;
+ }
+
+ parts {
+ part {
+ name: "playpause_button";
+ type: IMAGE;
+ description { state: "default" 0.0;
+ min: 25 25;
+ }
+ description { state: "play" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "widget/mediacontrol/playpausebutton/playbutton.png";
+ }
+ description { state: "pause" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "widget/mediacontrol/playpausebutton/pausebutton.png";
+ }
+ }
+ }
+
+ programs {
+ program {
+ signal: "play";
+ action: STATE_SET "play" 0.0;
+ target: "playpause_button";
+ }
+ program {
+ signal: "pause";
+ action: STATE_SET "pause" 0.0;
+ target: "playpause_button";
+ }
+ }
+ }