From: Kim Kibum Date: Sun, 29 Apr 2012 08:02:00 +0000 (+0900) Subject: upload tizen1.0 source X-Git-Tag: 2.0_alpha~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30f6165d9adb0f9c9c2f05c16a09e21f6f3a7712;p=platform%2Fcore%2Fbase%2Fsyspopup.git upload tizen1.0 source --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 95bd4f9..373693b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/data/syspopup_db.sql b/data/syspopup_db.sql index d5ffc61..7189a31 100755 --- a/data/syspopup_db.sql +++ b/data/syspopup_db.sql @@ -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"); diff --git a/debian/changelog b/debian/changelog old mode 100644 new mode 100755 index 2c4d0ca..8956b67 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 07 Dec 2011 12:55:49 +0900 + -- Jaeho Lee Tue, 20 Mar 2012 14:45:42 +0900 diff --git a/debian/control b/debian/control index f262cdd..db77e9c 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: syspopup Section: devel Priority: extra Maintainer: Jayoun Lee , Sewook Park , Jaeho Lee -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 diff --git a/include/simple_util.h b/include/simple_util.h index 0c24ee0..ecf5ae2 100755 --- a/include/simple_util.h +++ b/include/simple_util.h @@ -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 diff --git a/packaging/syspopup.spec b/packaging/syspopup.spec index 2972004..befbac7 100644 --- a/packaging/syspopup.spec +++ b/packaging/syspopup.spec @@ -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 diff --git a/src/syspopup_core.c b/src/syspopup_core.c index 2e05e3c..262bc95 100755 --- a/src/syspopup_core.c +++ b/src/syspopup_core.c @@ -20,11 +20,12 @@ * */ - +#include #include -#include #include #include +#include +#include #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; } diff --git a/syspopup-app/org.tizen.syspopup-app.desktop.in b/syspopup-app/org.tizen.syspopup-app.desktop.in index 8b1a846..76f8633 100755 --- a/syspopup-app/org.tizen.syspopup-app.desktop.in +++ b/syspopup-app/org.tizen.syspopup-app.desktop.in @@ -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 diff --git a/syspopup-app/syspopup-app.c b/syspopup-app/syspopup-app.c index 8c6d143..d5b3d86 100755 --- a/syspopup-app/syspopup-app.c +++ b/syspopup-app/syspopup-app.c @@ -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, diff --git a/syspopup-caller/CMakeLists.txt b/syspopup-caller/CMakeLists.txt index 81dee16..47ffb1d 100644 --- a/syspopup-caller/CMakeLists.txt +++ b/syspopup-caller/CMakeLists.txt @@ -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}") diff --git a/syspopup-caller/syspopup_caller.c b/syspopup-caller/syspopup_caller.c index 56c6d13..c5eca62 100755 --- a/syspopup-caller/syspopup_caller.c +++ b/syspopup-caller/syspopup_caller.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #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; } diff --git a/syspopup/CMakeLists.txt b/syspopup/CMakeLists.txt index f2fe86c..72a0929 100644 --- a/syspopup/CMakeLists.txt +++ b/syspopup/CMakeLists.txt @@ -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}") diff --git a/syspopup/syspopup.pc.in b/syspopup/syspopup.pc.in index 47a35ef..8d5f38a 100644 --- a/syspopup/syspopup.pc.in +++ b/syspopup/syspopup.pc.in @@ -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} diff --git a/test/test.c b/test/test.c index b41704a..8bf3163 100755 --- a/test/test.c +++ b/test/test.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include "syspopup_caller.h"