Add a conditional dependency to libwlmessage, and make
bluetooth_notification_client use it if found.
Change-Id: Ic968858bdf52054516d0a3c4365a7c7874ad1916
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
AM_CFLAGS = $(GCC_CFLAGS)
AM_CPPFLAGS = $(GCC_CFLAGS)
AM_CFLAGS = $(GCC_CFLAGS)
AM_CPPFLAGS = $(GCC_CFLAGS)
+if HAVE_WAYLAND
+AM_CPPFLAGS += -DHAVE_WAYLAND
+endif
+
notification_service_SOURCES = \
main.c \
notification_service.c \
notification_service_SOURCES = \
main.c \
notification_service.c \
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <bundle.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <bundle.h>
+#ifdef HAVE_WAYLAND
+#include <libwlmessage.h>
+#endif
typedef enum {
BT_AGENT_ACCEPT,
typedef enum {
BT_AGENT_ACCEPT,
bt_yesno = 1;
char line[4];
bt_yesno = 1;
char line[4];
+#ifdef HAVE_WAYLAND
+ struct wlmessage *wlmessage = wlmessage_create();
+ wlmessage_set_message(wlmessage, "Do you confirm ?");
+ wlmessage_add_button(wlmessage, 1, "Yes");
+ wlmessage_add_button(wlmessage, 0, "No");
+ wlmessage_set_default_button(wlmessage, 1);
+ bt_yesno = wlmessage_show(wlmessage, NULL);
+ wlmessage_destroy(wlmessage);
+
+ if (bt_yesno == 1)
+ (cb_1) (proxy);
+ else if (bt_yesno == 0)
+ (cb_2) (proxy);
+#else
fprintf(stdout, "Do you confirm yes or no ? ");
while ( bt_yesno != 0){
if (!fgets(line, sizeof(line), stdin))
fprintf(stdout, "Do you confirm yes or no ? ");
while ( bt_yesno != 0){
if (!fgets(line, sizeof(line), stdin))
fprintf(stdout," yes or no :");
}
}
fprintf(stdout," yes or no :");
}
}
err = notification_delete_all_by_type("bluetooth-frwk-bt-service", NOTIFICATION_TYPE_NOTI);
if (err != NOTIFICATION_ERROR_NONE) {
fprintf(stdout, "Unable to remove notifications");
err = notification_delete_all_by_type("bluetooth-frwk-bt-service", NOTIFICATION_TYPE_NOTI);
if (err != NOTIFICATION_ERROR_NONE) {
fprintf(stdout, "Unable to remove notifications");
LT_INIT([disable-static])
PKG_PROG_PKG_CONFIG()
LT_INIT([disable-static])
PKG_PROG_PKG_CONFIG()
-PKG_CHECK_MODULES([TIZEN], [eina ecore com-core notification dbus-1 bluetooth-api])
+AC_ARG_ENABLE(wayland, [ --enable-wayland],, enable_wayland=no)
+AM_CONDITIONAL(HAVE_WAYLAND, test x$enable_wayland = xyes)
+if test "x$enable_wayland" = "xyes"; then
+ wayland_libs="libwlmessage"
+fi
+PKG_CHECK_MODULES([TIZEN], [eina ecore com-core notification dbus-1 bluetooth-api $wayland_libs])
AC_SUBST(TIZEN_CFLAGS)
AC_SUBST(TIZEN_LIBS)
AC_SUBST(TIZEN_CFLAGS)
AC_SUBST(TIZEN_LIBS)
Name: notification-service
Summary: Simple notification service
Version: 0.0.3
Name: notification-service
Summary: Simple notification service
Version: 0.0.3
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(bluetooth-api)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(bluetooth-api)
BuildRequires: pkgconfig(bundle)
+%if %{with wayland}
+BuildRequires: pkgconfig(libwlmessage)
+%endif
%{?systemd_requires}
%description
%{?systemd_requires}
%description
%setup -q -n %{name}-%{version}
%build
%setup -q -n %{name}-%{version}
%build
+%if %{with wayland}
+%autogen --enable-wayland
+%else
make %{?_smp_mflags}
%install
make %{?_smp_mflags}
%install