2011-03-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Mar 2011 16:21:29 +0000 (16:21 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Mar 2011 16:21:29 +0000 (16:21 +0000)
        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

Source/WebCore/ChangeLog
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/efl/RenderThemeEfl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/DefaultTheme/default.edc
Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png [new file with mode: 0755]
Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png [new file with mode: 0755]
Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc [new file with mode: 0644]

index 6e21794..cab58ce 100644 (file)
@@ -1,3 +1,18 @@
+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.
index 37497b4..96c259f 100644 (file)
@@ -593,6 +593,9 @@ const char* RenderThemeEfl::edjeGroupFromFormType(FormType type) const
         W("search/cancel_button"),
         W("slider/vertical"),
         W("slider/horizontal"),
+#if ENABLE(VIDEO)
+        W("mediacontrol/playpause_button"),
+#endif
 #undef W
         0
     };
@@ -1045,6 +1048,25 @@ 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 
+        return false;
+
+    return true;
+}
+
 String RenderThemeEfl::extraMediaControlsStyleSheet()
 {
     return String(mediaControlsEflUserAgentStyleSheet, sizeof(mediaControlsEflUserAgentStyleSheet));
@@ -1070,8 +1092,15 @@ bool RenderThemeEfl::paintMediaMuteButton(RenderObject* object, const PaintInfo&
 
 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)
index 9970096..5b80a9e 100644 (file)
@@ -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,9 @@ enum FormType { // KEEP IN SYNC WITH edjeGroupFromFormType()
     SearchFieldCancelButton,
     SliderVertical,
     SliderHorizontal,
+#if ENABLE(VIDEO)
+    MediaPlayPauseButton,
+#endif
     FormTypeLast
 };
 
@@ -182,6 +188,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;
index 47e1b83..60aed72 100644 (file)
@@ -1,3 +1,17 @@
+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.
index 7d750f4..8d81e0f 100644 (file)
@@ -76,4 +76,5 @@ collections {
 #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"
 }
diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png
new file mode 100755 (executable)
index 0000000..b40cfea
Binary files /dev/null and b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png differ
diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png
new file mode 100755 (executable)
index 0000000..b4bc661
Binary files /dev/null and b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png differ
diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc
new file mode 100644 (file)
index 0000000..86b7bca
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+    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";
+         }
+      }
+   }