upload tizen1.0 source
authorKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:02:00 +0000 (17:02 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:02:00 +0000 (17:02 +0900)
14 files changed:
CMakeLists.txt
data/syspopup_db.sql
debian/changelog [changed mode: 0644->0755]
debian/control
include/simple_util.h
packaging/syspopup.spec
src/syspopup_core.c
syspopup-app/org.tizen.syspopup-app.desktop.in
syspopup-app/syspopup-app.c
syspopup-caller/CMakeLists.txt
syspopup-caller/syspopup_caller.c
syspopup/CMakeLists.txt
syspopup/syspopup.pc.in
test/test.c

index 95bd4f9..373693b 100644 (file)
@@ -20,7 +20,7 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-pkg_check_modules(libpkgs REQUIRED aul dlog bundle sqlite3 glib-2.0 heynoti)
+pkg_check_modules(libpkgs REQUIRED aul dlog bundle sqlite3 glib-2.0 dbus-glib-1)
 
 FOREACH(flag ${libpkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index d5ffc61..7189a31 100755 (executable)
@@ -17,28 +17,12 @@ CREATE TABLE IF NOT EXISTS syspopup_info (
 );
 
 INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"syspopup-app",             2,1,5,0,0,"org.tizen.syspopup-app");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"incoming_call",            2,0,-1,2,2,"org.tizen.incoming_call");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"phone_lock",               2,0,-1,2,2,"org.tizen.screen_lock");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"screen_lock",              1,0,-1,0,2,"org.tizen.screen_lock");
 INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"volume",                   1,1,-1,1,1,"org.tizen.volume");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"alarm",                    1,0,-1,0,2,"org.tizen.alarm");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"timer",                    1,0,5,0,2,"org.tizen.timer");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"schedule_alarm",           1,0,-1,0,2,"org.tizen.schedule_alarm");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"bt-syspopup",              0,0,-1,0,0,"org.tizen.bt-syspopup");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"change_select_network",    0,0,-1,0,0,"org.tizen.change_select_network");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"wifi-qs",                  0,0,-1,0,0,"org.tizen.wifi-qs");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"privacy_lock",             0,0,-1,0,2,"org.tizen.privacy_lock");
+INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"bt-syspopup",               0,0,-1,0,0,"org.tizen.bt-syspopup");
+INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"wifi-qs",                  0,0,-1,0,0,"net.wifi-qs");
 INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"poweroff-syspopup",                0,1,-1,0,0,"org.tizen.poweroff-syspopup");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"drm",                      0,0,5,0,0,"org.tizen.drm-popup");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"active_sync_policy",       0,0,-1,0,0,"org.tizen.active_sync_policy");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"memory_full",              0,1,5,0,0,"org.tizen.memory_full");
 INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"lowmem-syspopup",          0,1,5,0,0,"org.tizen.lowmem-syspopup");
 INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"lowbat-syspopup",          0,1,5,0,0,"org.tizen.lowbat-syspopup");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"charger_conn",             0,1,5,0,0,"org.tizen.charger_conn");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"sim_extraction",           0,1,5,0,0,"org.tizen.sim_extraction");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"time_zone_update",         0,1,5,0,0,"org.tizen.time_zone_update");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"dnet-popup",               0,0,5,0,0,"org.tizen.dnet-popup");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"nfc-syspopup",             0,1,3,0,0,"org.tizen.nfc-sys-popup");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"push-syspopup",            2,0,5,0,0,"org.tizen.push-syspopup");
-INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"alert-3g-syspopup",                0,0,-1,0,0,"org.tizen.alert-3g-syspopup");
+INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"net-popup",                        0,0,-1,0,0,"net.netpopup");
 INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"usb-syspopup",             1,1,-1,2,2,"org.tizen.usb-syspopup");
+INSERT OR REPLACE INTO "syspopup_info" VALUES(NULL,"tickernoti-syspopup",      1,1,-1,2,2,"org.tizen.tickernoti-syspopup");
old mode 100644 (file)
new mode 100755 (executable)
index 2c4d0ca..8956b67
@@ -1,7 +1,7 @@
-syspopup (0.0.67-1) unstable; urgency=low
+syspopup (0.0.74) unstable; urgency=low
 
   * Initial Release.
   * Git: pkgs/s/syspopup
-  * Tag: syspopup_0.0.67-1
+  * Tag: syspopup_0.0.74
 
- -- Sewook Park <sewook7.park@samsung.com>  Wed, 07 Dec 2011 12:55:49 +0900
+ -- Jaeho Lee <jaeho81.lee@samsung.com>  Tue, 20 Mar 2012 14:45:42 +0900
index f262cdd..db77e9c 100644 (file)
@@ -2,7 +2,7 @@ Source: syspopup
 Section: devel
 Priority: extra
 Maintainer: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
-Build-Depends: debhelper (>= 5), libdbus-glib-1-dev, libsqlite3-dev, libx11-dev, libecore-dev, libbundle-dev, dlog-dev, libslp-utilx-dev, libheynoti-dev, sqlite3, libaul-1-dev, libevas-dev, libappcore-efl-dev
+Build-Depends: debhelper (>= 5), libdbus-glib-1-dev, libsqlite3-dev, libx11-dev, libecore-dev, libbundle-dev, dlog-dev, libslp-utilx-dev, sqlite3, libaul-1-dev, libevas-dev, libappcore-efl-dev, libdbus-glib-1-dev
 Standards-Version: 0.1.0 
 
 Package: syspopup-caller-0
@@ -14,7 +14,7 @@ Description: syspopup-caller package
 Package: syspopup-caller-dev
 Section: libs
 Architecture: any
-Depends: syspopup-caller-0 (= ${Source-Version}), libdbus-glib-1-dev, libsqlite3-dev, libbundle-dev, dlog-dev, libheynoti-dev, libaul-1-dev
+Depends: syspopup-caller-0 (= ${Source-Version}), libdbus-glib-1-dev, libsqlite3-dev, libbundle-dev, dlog-dev, libaul-1-dev
 Description: syspopup-caller dev package
 
 Package: syspopup-caller-dbg
@@ -32,7 +32,7 @@ Description: syspopup package
 Package: syspopup-dev
 Section: libs
 Architecture: any
-Depends: syspopup-0 (= ${Source-Version}), libdbus-glib-1-dev, libsqlite3-dev, libbundle-dev, dlog-dev, libheynoti-dev, sqlite3, libslp-utilx-dev, libx11-dev, libecore-dev, libevas-dev, libappcore-efl-dev
+Depends: syspopup-0 (= ${Source-Version}), libdbus-glib-1-dev, libsqlite3-dev, libbundle-dev, dlog-dev, sqlite3, libslp-utilx-dev, libx11-dev, libecore-dev, libevas-dev, libappcore-efl-dev
 Description: syspopup dev package
 
 Package: syspopup-dbg
index 0c24ee0..ecf5ae2 100755 (executable)
@@ -36,5 +36,9 @@
 #define _E(fmt, arg...) LOGE("[%s,%d] "fmt , __FUNCTION__, __LINE__, ##arg)
 #define _D(fmt, arg...) LOGD("[%s,%d] "fmt , __FUNCTION__, __LINE__, ##arg)
 
+#define SYSPOPUP_DBUS_PATH "/syspopup/dbus_handler"
+#define SYSPOPUP_DBUS_SIGNAL_INTERFACE "org.tizen.syspopup.signal"
+#define SYSPOPUP_DBUS_SP_TERM_SIGNAL   "syspopup_term"
+
 #endif
 
index 2972004..befbac7 100644 (file)
@@ -1,9 +1,9 @@
 Name:       syspopup
 Summary:    syspopup package
-Version:       0.0.67
+Version:    0.0.74
 Release:    1
-Group:      TO_BE/FILLED_IN
-License:    Apache-2.0
+Group:      System/Libraries
+License:    Apache License, Version 2.0
 Source0:    syspopup-%{version}.tar.gz
 Requires(post): /sbin/ldconfig
 Requires(post): /bin/touch
@@ -15,7 +15,6 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(utilX)
 BuildRequires:  pkgconfig(dbus-glib-1)
 BuildRequires:  pkgconfig(x11)
-BuildRequires:  pkgconfig(heynoti)
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(evas)
 BuildRequires:  pkgconfig(appcore-efl)
@@ -46,7 +45,7 @@ syspopup-caller package for popup
 %package caller-devel
 Summary:    syspopup-caller development package
 Group:      TO_BE/FILLED_IN
-Requires:   %{name}-devel = %{version}-%{release}
+Requires:   %{name} = %{version}-%{release}
 
 %description caller-devel
 syspopup-caller development package for popup
@@ -64,6 +63,8 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
+mkdir -p %{buildroot}/opt/dbspace
+#sqlite3 $(CURDIR)/debian/tmp/opt/dbspace/.syspopup.db < $(CURDIR)/data/syspopup_db.sql
 touch %{buildroot}%{_datadir}/popup_noti_term
 
 
@@ -74,11 +75,6 @@ touch %{buildroot}%{_datadir}/popup_noti_term
 mkdir -p /opt/dbspace/
 sqlite3 /opt/dbspace/.syspopup.db < /opt/share/syspopup_db.sql
 rm -rf /opt/share/syspopup_db.sql
-chown root:5000 /opt/dbspace/.syspopup.db
-chown root:5000 /opt/dbspace/.syspopup.db-journal
-chmod 664 /opt/dbspace/.syspopup.db
-chmod 664 /opt/dbspace/.syspopup.db-journal
-
 
 %postun -p /sbin/ldconfig
 
index 2e05e3c..262bc95 100755 (executable)
  *
  */
 
-
+#include <stdio.h>
 #include <glib.h>
-#include <heynoti.h>
 #include <stdlib.h>
 #include <string.h>
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
 #include "syspopup_core.h"
 #include "simple_util.h"
 
@@ -33,6 +34,7 @@
 static syspopup *syspopup_head = NULL;
 
 static int initialized = 0;
+static DBusConnection *bus;
 static int noti_fd = -1;
 static int sp_id = 0;
 
@@ -118,31 +120,75 @@ void _syspopup_del(int id)
        }
 }
 
+
+static DBusHandlerResult
+__sys_popup_dbus_signal_filter(DBusConnection *conn, DBusMessage *message,
+                                    void *user_data)
+{
+       const char *sender;
+       const char *interface;
+       int dead_pid;
+
+       DBusError error;
+       dbus_error_init(&error);
+
+       interface = dbus_message_get_interface(message);
+       if (interface == NULL) {
+               _E("reject by security issue - no interface\n");
+               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+       }
+
+       if (dbus_message_is_signal(message, interface,
+                                  SYSPOPUP_DBUS_SP_TERM_SIGNAL)) {
+               if (_term_handler)
+                       _term_handler(NULL);
+
+               _D("term handler has been called");
+       }
+
+       return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+
+
 int _syspopup_init(void (*term_handler) (void *),
                   gboolean(*timeout_handler) (void *))
 {
+       DBusError error;
+       char rule[MAX_LOCAL_BUFSZ];
+
        if (initialized)
                return 0;
 
        _term_handler = term_handler;
        _timeout_handler = timeout_handler;
 
-       noti_fd = heynoti_init();
-       if (noti_fd < 0) {
-               _E("heynoti add failed\n");
+       dbus_error_init(&error);
+       bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
+       if (!bus) {
+               _E("Failed to connect to the D-BUS daemon: %s", error.message);
+               dbus_error_free(&error);
                return -1;
        }
-
-       if (heynoti_subscribe_file(noti_fd, SYSPOPUP_TERM_NOTI_PATH,
-                                  _term_handler, NULL,
-                                  IN_CLOSE_WRITE | IN_DELETE_SELF) < 0) {
-               _E("heynoti subscribe file failed");
+       dbus_connection_setup_with_g_main(bus, NULL);
+
+       snprintf(rule, MAX_LOCAL_BUFSZ,
+                "path='%s',type='signal',interface='%s'", SYSPOPUP_DBUS_PATH,
+                SYSPOPUP_DBUS_SIGNAL_INTERFACE);
+       /* listening to messages */
+       dbus_bus_add_match(bus, rule, &error);
+       if (dbus_error_is_set(&error)) {
+               _E("Fail to rule set: %s", error.message);
+               dbus_error_free(&error);
                return -1;
-       } else {
-               if (heynoti_attach_handler(noti_fd) < 0)
-                       _E("heynoti attach failed");
        }
 
+       if (dbus_connection_add_filter(bus, 
+               __sys_popup_dbus_signal_filter, NULL, NULL) == FALSE)
+               return -1;
+
+       _D("syspopup signal initialized");
+
        initialized = 1;
        return 0;
 }
index 8b1a846..76f8633 100755 (executable)
@@ -2,10 +2,7 @@ Name=@PROJECT_NAME@
 Exec=@BINDIR@/@PROJECT_NAME@
 Icon=@PKGNAME@.png
 Type=Application
-Hidden=true
-X-SLP-BaseLayoutWidth=720
-X-SLP-BaseLayoutHeight=1280
-X-SLP-IsHorizontalScale=1
-X-SLP-TaskManage=false
-X-XLP-Removable=false
+NoDisplay=true
+X-Tizen-TaskManage=false
+X-Tizen-Removable=false
 Version=0.1.0-0
index 8c6d143..d5b3d86 100755 (executable)
@@ -203,6 +203,11 @@ static void __response_cb(void *data, Evas_Object * obj, void *event_info)
        elm_exit();
 }
 
+static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       evas_object_del(obj);
+}
+
 static int __app_reset(bundle *b, void *data)
 {
        struct appdata *ad = data;
@@ -248,9 +253,9 @@ static int __app_reset(bundle *b, void *data)
                                evas_object_size_hint_weight_set(popup,
                                                        EVAS_HINT_EXPAND,
                                                        EVAS_HINT_EXPAND);
-                               elm_popup_mode_set(popup, ELM_POPUP_TYPE_ALERT);
-                               elm_popup_title_label_set(popup, ad->title);
-                               elm_popup_desc_set(popup, ad->content);
+                               evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL);
+                               elm_object_part_text_set(popup, "title,text", ad->title);
+                               elm_object_text_set(popup, ad->content);
                                evas_object_smart_callback_add(popup,
                                                               "response",
                                                               __response_cb,
index 81dee16..47ffb1d 100644 (file)
@@ -20,7 +20,7 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-pkg_check_modules(spcpkgs REQUIRED dlog bundle sqlite3 glib-2.0 heynoti aul)
+pkg_check_modules(spcpkgs REQUIRED dlog bundle sqlite3 glib-2.0 aul dbus-glib-1)
 
 FOREACH(flag ${spcpkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 56c6d13..c5eca62 100755 (executable)
@@ -24,6 +24,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <glib.h>
+#include <dbus/dbus.h>
 #include <aul.h>
 
 #include "syspopup_core.h"
@@ -45,7 +47,7 @@ API int syspopup_launch(char *popup_name, bundle *b)
        info = _syspopup_info_get(popup_name);
        if (info == NULL || info->pkgname == NULL) {
                _E("info or info->pkgname is NULL");
-               if(info)
+               if (info)
                        _syspopup_info_free(info);
                return -1;
        }
@@ -81,9 +83,34 @@ API int syspopup_launch(char *popup_name, bundle *b)
 
 API int syspopup_destroy_all()
 {
-       int fd;
-       fd = open(SYSPOPUP_TERM_NOTI_PATH, O_CREAT | O_TRUNC | O_RDWR, 0644);
-       close(fd);
+       DBusMessage *message;
+       DBusError error;
+       DBusConnection *bus = NULL;
+
+       dbus_error_init(&error);
+       bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
+       if (bus == NULL) {
+               _E("Failed to connect to the D-BUS daemon: %s", error.message);
+               dbus_error_free(&error);
+               return -1;
+       }
+
+       message = dbus_message_new_signal(SYSPOPUP_DBUS_PATH,
+                                         SYSPOPUP_DBUS_SIGNAL_INTERFACE,
+                                         SYSPOPUP_DBUS_SP_TERM_SIGNAL);
+
+       if (dbus_connection_send(bus, message, NULL) == FALSE) {
+               _E("dbus send error");
+               return -1;
+       }
+
+       dbus_connection_flush(bus);
+       dbus_message_unref(message);
+
+       dbus_connection_close(bus);
+
+       _D("send signal done\n");
+
        return 0;
 }
 
index f2fe86c..72a0929 100644 (file)
@@ -20,7 +20,7 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-pkg_check_modules(sppkgs REQUIRED dlog bundle sqlite3 glib-2.0 heynoti evas elementary utilX ecore-x x11 ecore ecore-input)
+pkg_check_modules(sppkgs REQUIRED dlog bundle sqlite3 glib-2.0 evas elementary utilX ecore-x x11 ecore ecore-input dbus-glib-1)
 
 FOREACH(flag ${sppkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 47a35ef..8d5f38a 100644 (file)
@@ -8,6 +8,6 @@ includedir=@INCLUDEDIR@
 Name: libsyspopup
 Description: system popup library for ui 
 Version: @VERSION@
-Requires: dlog bundle sqlite3 glib-2.0 heynoti elementary utilX ecore-x
+Requires: dlog bundle sqlite3 glib-2.0 elementary utilX ecore-x dbus-glib-1
 Libs: -L${libdir} -lsyspopup
 Cflags: -I${includedir}
index b41704a..8bf3163 100755 (executable)
@@ -20,6 +20,7 @@
  *
  */
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include "syspopup_caller.h"