add reset timer new api / fix hardcording of lib path / fix build on x86_64
authorHyungdeuk Kim <hd3.kim@samsung.com>
Wed, 3 Apr 2013 07:49:14 +0000 (16:49 +0900)
committerHyungdeuk Kim <hd3.kim@samsung.com>
Wed, 3 Apr 2013 07:49:14 +0000 (16:49 +0900)
Change-Id: I7c522dc536100250e374c43c2203891e0efe3290

include/syspopup.h
packaging/syspopup.spec
src/syspopup_core.c
syspopup-app/syspopup-app.c
syspopup-app/syspopup-app.h
syspopup/syspopup.c
syspopup/syspopup_efl.c

index db742ab..6897c5d 100755 (executable)
@@ -120,6 +120,19 @@ int syspopup_reset(bundle *b);
  */
 int syspopup_has_popup(bundle *b);
 
+/**
+ * @brief       This API reset timeout value of system popup.
+ *
+ *             This API reset timeout value of system popup.
+ *
+ * @param[in]   b      bundle received by app_reset handler (included system popup name)
+ * @param[in]   time   timeout time (sec)
+ * @return     0       if success, negative value(<0) if fail
+ * @retval     0       success
+ * @retval     -1      generic error
+ */
+int syspopup_reset_timeout(bundle *b, unsigned int time);
+
 /** @} */
 
 #endif
index 4b7f957..a5d766e 100755 (executable)
@@ -1,9 +1,9 @@
 Name:       syspopup
 Summary:    syspopup package
-Version:    0.0.89
+Version:    0.0.90
 Release:    1
 Group:      System/Libraries
-License:    Apache-2.0
+License:    Apache License, Version 2.0
 Source0:    syspopup-%{version}.tar.gz
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(sqlite3)
@@ -104,3 +104,7 @@ touch %{buildroot}%{_datadir}/popup_noti_term
 %{_libdir}/libsyspopup_caller.so
 %{_includedir}/syspopup_caller.h
 %{_libdir}/pkgconfig/syspopup-caller.pc
+
+%changelog
+* Tue Apr 2 2013 - Hyugdeuk Kim <hd3.kim@samsung.com>
+- Add syspopup_reset_timeout api
\ No newline at end of file
index 262bc95..dc76dca 100755 (executable)
@@ -210,10 +210,13 @@ int _syspopup_reset_timeout(syspopup *sp, syspopup_info_t *info)
 
        if (sp->timeout_id != 0)
                g_source_remove(sp->timeout_id);
-       sp->timeout_id = g_timeout_add_seconds(info->timeout, _timeout_handler,
+
+       if(info->timeout > 0) {
+               sp->timeout_id = g_timeout_add_seconds(info->timeout, _timeout_handler,
                                               (void *)sp->id);
-       _D("add timeout - timeout : id=%d,timeout=%d(sec)", sp->id,
-          info->timeout);
+               _D("add timeout - timeout : id=%d,timeout=%d(sec)", sp->id, 
+                       info->timeout);
+       }
 
        return 0;
 }
index d8e434f..e5d9543 100755 (executable)
 #include "syspopup.h"
 #include "syspopup-app.h"
 
-/*#include <quickpanel.h> */
 #include <time.h>
+
+#include <dlog.h>
+
+#undef LOG_TAG
+#define LOG_TAG "SYSPOPUP-APP"
+
+#define _E(fmt, arg...) LOGE(fmt,##arg)
+#define _D(fmt, arg...) LOGD(fmt,##arg)
+
 /*
 struct quickpanel {
        int type;
@@ -204,7 +212,7 @@ static int __app_terminate(void *data)
 {
        struct appdata *ad = data;
 
-       printf("[SYSPOPUP] %s, %d\n", __func__, __LINE__);
+       _D("__app_terminate called");
 
        if (ad->win)
                evas_object_del(ad->win);
@@ -228,7 +236,7 @@ static int __app_resume(void *data)
 
 static void __prt_recvd_bundle(const char *key, const char *value, void *d)
 {
-       printf("recvd - key: %s, value: %s\n", key, value);
+       _D("recvd - key: %s, value: %s\n", key, value);
 }
 
 static void __response_cb(void *data, Evas_Object * obj, void *event_info)
@@ -312,12 +320,6 @@ int main(int argc, char *argv[])
                .reset = __app_reset,
        };
 
-//     unsetenv("ELM_SCALE");
-
-       /* appcore measure time example */
-       printf("from AUL to %s(): %d msec\n", __func__,
-              appcore_measure_time_from("APP_START_TIME"));
-
        memset(&ad, 0x0, sizeof(struct appdata));
        ops.data = &ad;
 
index 558d4ae..b16cd62 100755 (executable)
@@ -45,7 +45,6 @@ struct appdata {
        bundle *b;
        char title[TITLE_BUF_LEN];
        char content[CONTENT_BUF_LEN];
-
        /* add more variables here */
 };
 
index 0ad0b54..fc14f5a 100755 (executable)
@@ -424,3 +424,33 @@ API int syspopup_has_popup(bundle *b)
                return 0;
 }
 
+API int syspopup_reset_timeout(bundle *b, unsigned int time)
+{
+       const char *popup_name;
+       syspopup_info_t *info;
+       syspopup *sp = NULL;
+       int ret;
+
+       popup_name = _syspopup_get_name_from_bundle(b);
+       if (popup_name == NULL) {
+               _E("popup_name is null");
+               return -1;
+       }
+
+       sp = _syspopup_find(popup_name);
+       if (!sp) {
+               _E("find syspopup error");
+               return -1;
+       } else {
+               info = _syspopup_info_get(popup_name);
+               if (info == NULL) {
+                       _E("get syspopup info error");
+                       return -1;
+               }
+               info->timeout = time;
+               ret = _syspopup_reset_timeout(sp, info);
+       }
+
+       return ret;
+}
+
index 4360b01..38db1f0 100755 (executable)
@@ -132,7 +132,6 @@ API int syspopup_create(bundle *b, syspopup_handler *handler,
                /* Second, keydown event */
                ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
                                        __x_rotate_cb, (void *)id);
-
        }
 
        return 0;