[Release] livebox.web-provider-1.19 submit/tizen_2.1/20130503.122649
authorYunchan Cho <yunchan.cho@samsung.com>
Wed, 1 May 2013 04:17:58 +0000 (13:17 +0900)
committerYunchan Cho <yunchan.cho@samsung.com>
Fri, 3 May 2013 12:25:09 +0000 (21:25 +0900)
Change-Id: Ic687b413ae02bb5e239688a3a124459606d0fc56

data/web_provider_reset_db.sh
packaging/livebox.web-provider.spec
src/API/WebProviderDB.h
src/API/web_provider_livebox_info.cpp
src/API/web_provider_livebox_info.h
src/Core/Box.cpp
src/Core/BoxUpdateTimer.cpp
src/Core/BoxUpdateTimer.h
src/Core/Util/ITimer.h
src/Plugin/AppBoxPlugin/AppBoxRenderView.cpp

index 33a35c0..ba0553b 100644 (file)
 #    limitations under the License.
 #
 
-for name in web_provider
-do
-    rm -f /opt/dbspace/.$name.db
-    rm -f /opt/dbspace/.$name.db-journal
-    SQL="PRAGMA journal_mode = PERSIST;"
-    sqlite3 /opt/dbspace/.$name.db "$SQL"
-    SQL=".read /usr/share/web-provider/"$name"_db.sql"
-    sqlite3 /opt/dbspace/.$name.db "$SQL"
-    touch /opt/dbspace/.$name.db-journal
-    chown 0:6026 /opt/dbspace/.$name.db
-    chown 0:6026 /opt/dbspace/.$name.db-journal
-    chmod 660 /opt/dbspace/.$name.db
-    chmod 660 /opt/dbspace/.$name.db-journal
-done
+web_provider_db="/opt/usr/dbspace/.web_provider.db"
+web_provider_sql="/usr/share/web-provider/web_provider_db.sql"
+
+if [ -f $web_provider_db ]; then
+    echo "DB already exists."
+else
+    echo "create web livebox DB..."
+    rm -f $web_provider_db
+    rm -f $web_provider_db-journal
+    sql="PRAGMA journal_mode = PERSIST;"
+    sqlite3 $web_provider_db "$sql"
+    sql=".read "$web_provider_sql
+    sqlite3 $web_provider_db "$sql"
+    touch $web_provider_db-journal
+    chown 0:6026 $web_provider_db
+    chown 0:6026 $web_provider_db-journal
+    chmod 660 $web_provider_db
+    chmod 660 $web_provider_db-journal
+    echo "finish creation of db."
+fi
index 3514836..d57dc19 100644 (file)
@@ -1,6 +1,6 @@
 Name: livebox.web-provider
 Summary: web framework for livebox 
-Version: 1.18
+Version: 1.19
 Release: 1
 Group: main/app
 License: Flora License, Version 1.1
@@ -61,7 +61,6 @@ mkdir -p %{buildroot}%{app_data}
 
 %post
 killall -9 web-provider
-echo "create web livebox DB..."
 /usr/bin/web_provider_reset_db.sh
 if [ -f /usr/lib/rpm-plugins/msm.so ]; then
         echo "smack setting..."
index 3ba4494..e6f14f6 100644 (file)
@@ -23,7 +23,7 @@
 #include <string>
 #include "SqliteDB.h"
 
-const std::string dbPath("/opt/dbspace/.web_provider.db");
+const std::string dbPath("/opt/usr/dbspace/.web_provider.db");
 
 class WebProviderDB : public SqliteDB {
     public:
index cdddef7..77f738a 100644 (file)
@@ -231,14 +231,6 @@ int web_provider_livebox_insert_box_info(
     return 0;
 }
 
-int web_provider_livebox_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type)
-{
-    return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0, 0);
-}
-
 int web_provider_livebox_delete_by_box_id(const char* box_id)
 {
     if (!box_id) {
@@ -322,36 +314,3 @@ int web_provider_livebox_delete_by_type(const char* type)
     handle->closeDB();
     return 0;
 }
-
-const char* web_provider_info_get_default_type()
-{
-    return web_provider_livebox_get_default_type();
-}
-
-const char* web_provider_info_get_box_type(const char* box_id)
-{
-    return web_provider_livebox_get_box_type(box_id);
-}
-
-int web_provider_info_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type)
-{
-    return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0, 0);
-}
-
-int web_provider_info_delete_by_box_id(const char* box_id)
-{
-    return web_provider_livebox_delete_by_box_id(box_id);
-}
-
-int web_provider_info_delete_by_app_id(const char* app_id)
-{
-    return web_provider_livebox_delete_by_app_id(app_id);
-}
-
-int web_provider_info_delete_by_type(const char* type)
-{
-    return web_provider_livebox_delete_by_type(type);
-}
index 91951fc..4d569bd 100644 (file)
@@ -42,24 +42,10 @@ EXPORT_API int web_provider_livebox_insert_box_info(
         int auto_launch, 
         int mouse_event,
         int pd_fast_open);
-DEPRECATED_API int web_provider_livebox_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type);
 EXPORT_API int web_provider_livebox_delete_by_box_id(const char* box_id);
 EXPORT_API int web_provider_livebox_delete_by_app_id(const char* app_id);
 EXPORT_API int web_provider_livebox_delete_by_type(const char* type);
 
-DEPRECATED_API const char* web_provider_info_get_default_type();
-DEPRECATED_API const char* web_provider_info_get_box_type(const char* box_id);
-DEPRECATED_API int web_provider_info_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type);
-DEPRECATED_API int web_provider_info_delete_by_box_id(const char* box_id);
-DEPRECATED_API int web_provider_info_delete_by_app_id(const char* app_id);
-DEPRECATED_API int web_provider_info_delete_by_type(const char* type);
-
 #ifdef __cplusplus
 }
 #endif
index 2e51dab..cefcce6 100644 (file)
@@ -140,7 +140,7 @@ bool Box::resume()
 
     try {
         m_currentTab = true;
-        m_updateTimer->start();
+        m_updateTimer->resume();
         m_view->resumeBox();
     } catch (...) {
         return false;
@@ -159,7 +159,7 @@ bool Box::pause(bool background)
         if (!background) {
             m_currentTab = false;
         }
-        m_updateTimer->stop();
+        m_updateTimer->pause();
         m_view->pauseBox();
     } catch (...) {
         return false;
@@ -219,10 +219,6 @@ bool Box::update()
 {
     LogD("enter");
 
-    if (!m_currentTab) {
-        return false;
-    }
-    // reload box
     m_boxBuffer->startCanvasUpdate();
     RenderInfoPtr renderInfo = makeRenderInfo(renderTypeUpdate);
     m_view->showBox(renderInfo);
index f2ed775..b503f89 100644 (file)
@@ -21,7 +21,7 @@
 #include <Core/Util/Log.h>
 #include "BoxUpdateTimer.h"
 
-#define UPDATE_TIME_MIN 10.0
+#define UPDATE_TIME_MIN 60.0
 
 BoxUpdateTimer::BoxUpdateTimer(float period, Ecore_Task_Cb callback, void* data)
     : m_period(period)
@@ -43,6 +43,10 @@ void BoxUpdateTimer::start()
         return;
     }
 
+    if (m_timer) {
+        stop();
+    }
+
     m_timer = ecore_timer_add(m_period, m_callback, m_data); 
 }
 
@@ -52,6 +56,18 @@ void BoxUpdateTimer::stop()
     m_timer = NULL;
 }
 
+void BoxUpdateTimer::resume()
+{
+    LogD("enter");
+    ecore_timer_thaw(m_timer);
+}
+
+void BoxUpdateTimer::pause()
+{
+    LogD("enter");
+    ecore_timer_freeze(m_timer);
+}
+
 void BoxUpdateTimer::restart()
 {
     if (m_timer) {
index e5e5582..655dd51 100644 (file)
@@ -31,6 +31,8 @@ class BoxUpdateTimer: public ITimer {
         };
         void start();
         void stop();
+        void resume();
+        void pause();
         void restart();
         void setPeriod(float period);
         ~BoxUpdateTimer();
index 7362b94..c6595cb 100644 (file)
@@ -26,6 +26,8 @@ class ITimer {
     public:
         virtual void start() = 0;
         virtual void stop() = 0;
+        virtual void resume() = 0;
+        virtual void pause() = 0;
         virtual void restart() = 0;
         virtual void setPeriod(float period) = 0;
 
index 523820c..f0bec40 100644 (file)
@@ -255,7 +255,13 @@ void AppBoxRenderView::hidePd()
 
 Evas_Object* AppBoxRenderView::getBoxWebView()
 {
-    return m_boxWrt->GetCurrentWebview();
+    if (!m_pdHelper) {
+        return m_boxWrt->GetCurrentWebview();
+    } else {
+        // Here, we can't use GetCurrentWebView() of wrt-core to get Box' webview,
+        // because in the non fast-open, GetCurrentWebview() returns PD's webview.
+        return m_pdHelper->getBoxWebView();
+    }
 }
 
 Evas_Object* AppBoxRenderView::getPdWebView()