cleanup 86/38786/1 accepted/tizen/tv/20150429.124044 submit/tizen/20150429.050036
authorPatryk Kaczmarek <patryk.k@samsung.com>
Tue, 28 Apr 2015 11:12:49 +0000 (13:12 +0200)
committerPatryk Kaczmarek <patryk.k@samsung.com>
Tue, 28 Apr 2015 11:53:49 +0000 (13:53 +0200)
   * capi-system-device package deleted
   * haptic support deleted
   * scroll event handle deleted

Change-Id: Ic800ff455835f684e40c367ee2a7d8aee2f43541
Signed-off-by: Patryk Kaczmarek <patryk.k@samsung.com>
13 files changed:
CMakeLists.sub [changed mode: 0755->0644]
CMakeLists.txt [changed mode: 0755->0644]
include/smart_notification.h [deleted file]
org.tizen.screen-reader.xml [changed mode: 0755->0644]
packaging/org.tizen.screen-reader.spec [changed mode: 0755->0644]
res/icons/screen-reader.png [changed mode: 0755->0644]
src/main.c [changed mode: 0755->0644]
src/navigator.c
src/screen_reader.c [changed mode: 0755->0644]
src/screen_reader_haptic.c [deleted file]
src/screen_reader_system.c [deleted file]
src/smart_notification.c [deleted file]
tests/CMakeLists.sub [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 3c37e76..ee3c8d4
@@ -17,7 +17,6 @@ pkg_check_modules(pkgs REQUIRED
        dlog
        vconf
        tts
-       capi-system-device
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
diff --git a/include/smart_notification.h b/include/smart_notification.h
deleted file mode 100644 (file)
index b98ecc6..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef SMART_NOTIFICATION_H_
-#define SMART_NOTIFICATION_H_
-
-/**
- * @brief Type of notification events.
- *
- * @FOCUS_CHAIN_END_NOTIFICATION_EVENT emitted when
- * currnetly focued widget is the last one
- * in focus chain for application current view.
- *
- * @REALIZED_ITEMS_NOTIFICATION_EVENT
- */
-enum _Notification_Type {
-     FOCUS_CHAIN_END_NOTIFICATION_EVENT,
-     REALIZED_ITEMS_NOTIFICATION_EVENT,
-};
-
-typedef enum _Notification_Type Notification_Type;
-
-/**
- * @brief Initializes notification submodule.
- *
- * @description
- * Notification submodule is resposnisle for providing
- * voice output to end user when on of following events
- * occur:
- *
- * 1. User starts scrolling active application view.
- * 2. User finished scrolling (and all scrolling related
- *    animations has stopped) active application view.
- * 3. When user has navigated to the last widget in focus
- *    chain.
- * 4. After scrolling lists, some of item becomes visible
- *
- * @nore
- * 1 and 2 are handled internally by smart navigation submodule.
- * about events 3 and 4 submodule has to be informed by the developer
- * by using smart_notification API.
- */
-void smart_notification_init(void);
-
-/**
- * @brief Notifies smart_notification about UI event.
- *
- * @param nt Type of the occured event.
- * @param start_index Item of the first item that becomes visible
- * after scrolling list widget.
- * @param end_index index of the last item that becomes visible
- * after scrolling list widget.
- *
- * @note start_index and end_index are interpreted only
- * when nt parameter is REALIZED_ITEMS_NOTIFICATION_EVENT
- * @note initializes haptic module.
- */
-void smart_notification(Notification_Type nt, int start_index, int end_index);
-
-/**
- * @brief Shutdowns notification subsystem.
- */
-void smart_notification_shutdown(void);
-
-#endif /* end of include guard: SMART_NOTIFICATION_H_ */
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 60aa805..05df328
@@ -10,7 +10,6 @@ BuildRequires:  at-spi2-core
 BuildRequires:  at-spi2-core-devel
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(capi-appfw-application)
-BuildRequires:  pkgconfig(capi-system-device)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(bundle)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index b9c2360..cf3c3a5 100644 (file)
@@ -9,9 +9,6 @@
 #include "object_cache.h"
 #include "flat_navi.h"
 #include "app_tracker.h"
-#include "smart_notification.h"
-#include "screen_reader_system.h"
-#include "screen_reader_haptic.h"
 
 #define QUICKPANEL_DOWN TRUE
 #define QUICKPANEL_UP FALSE
@@ -94,7 +91,6 @@ static void _focus_next(void)
      {
         flat_navi_context_line_first(context);
         obj = flat_navi_context_first(context);
-        smart_notification(FOCUS_CHAIN_END_NOTIFICATION_EVENT, 0, 0);
      }
    if (obj)
      _current_highlight_object_set(obj);
@@ -123,7 +119,6 @@ static void _focus_prev(void)
      {
         flat_navi_context_line_last(context);
         obj = flat_navi_context_last(context);
-        smart_notification(FOCUS_CHAIN_END_NOTIFICATION_EVENT, 0, 0);
      }
    if (obj)
      _current_highlight_object_set(obj);
@@ -205,8 +200,6 @@ void navigator_init(void)
    window_tracker_register(on_window_activate, NULL);
    window_tracker_active_window_request();
    app_tracker_init();
-   smart_notification_init();
-   system_notifications_init();
    keyboard_tracker_init();
    keyboard_tracker_register(kb_tracker, NULL);
 }
@@ -221,7 +214,5 @@ void navigator_shutdown(void)
    object_cache_shutdown();
    app_tracker_shutdown();
    window_tracker_shutdown();
-   smart_notification_shutdown();
-   system_notifications_shutdown();
    keyboard_tracker_shutdown();
 }
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/src/screen_reader_haptic.c b/src/screen_reader_haptic.c
deleted file mode 100644 (file)
index ef3ad06..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#include <device/haptic.h>
-#include "logger.h"
-#include "smart_notification.h"
-
-static haptic_device_h handle;
-static haptic_effect_h effect_handle;
-
-#define RED  "\x1B[31m"
-#define RESET "\033[0m"
-
-/**
- * @brief Initializer for haptic module
- *
- */
-void haptic_module_init(void)
-{
-    int num;
-
-    if(!device_haptic_get_count(&num))
-      {
-         DEBUG(RED"Haptic device received!"RESET);
-      }
-    else
-      {
-         ERROR("Cannot receive haptic device count");
-         return;
-      }
-
-    if(!device_haptic_open(0, &handle))
-      {
-         DEBUG(RED"Device connected!"RESET);
-      }
-    else
-      {
-         ERROR("Cannot open haptic device");
-      }
-}
-
-/**
- * @brief Disconnect haptic handle
- *
- */
-void haptic_module_disconnect(void)
-{
-    if(!handle)
-      {
-         ERROR("Haptic handle lost");
-         return;
-      }
-    if(!device_haptic_close(handle))
-      {
-         DEBUG("Haptic disconnected");
-      }
-    else
-      {
-         ERROR("Haptic close error");
-      }
-}
-
-/**
- * @brief Start vibrations
- *
- */
-void haptic_vibrate_start(void)
-{
-    if(!handle)
-      {
-         ERROR("Haptic handle lost");
-         return;
-      }
-    if(!device_haptic_vibrate(handle, 1000, 100, &effect_handle))
-      {
-         DEBUG(RED"Vibrations started!"RESET);
-      }
-    else
-      {
-         ERROR("Cannot start vibration");
-      }
-}
-
-/**
- * @brief Stop vibrations
- *
- */
-void haptic_vibrate_stop(void)
-{
-    if(!handle)
-      {
-         ERROR("Haptic handle lost");
-         return;
-      }
-    if(!device_haptic_stop(handle, &effect_handle))
-      {
-         ERROR("Vibrations stopped!");
-      }
-    else
-      {
-         DEBUG(RED"Cannot stop vibration"RESET);
-      }
-}
diff --git a/src/screen_reader_system.c b/src/screen_reader_system.c
deleted file mode 100644 (file)
index 9dfbd86..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#include <device/battery.h>
-#include <device/display.h>
-#include <device/callback.h>
-#include "screen_reader.h"
-#include "screen_reader_tts.h"
-#include "smart_notification.h"
-#include "logger.h"
-
-#define CHARGING "Battery charger connected"
-#define NOT_CHARGING "Battery charger disconnected"
-#define SCREEN_ON "Screen is on"
-#define SCREEN_OFF "Screen is off"
-#define BATTERY_LOW "Battery level is low"
-#define BATTERY_FULL "Battery level is full"
-#define BATTERY_CRITICAL "Battery level is critical"
-
-static void device_system_cb(device_callback_e type, void *value, void *user_data);
-
-/**
- * @brief Initializer for smart notifications
- *
- */
-void system_notifications_init(void)
-{
-    // BATTERY LOW/FULL
-    device_add_callback(DEVICE_CALLBACK_BATTERY_LEVEL, device_system_cb, NULL);
-    // BATTERY CHARGING/NOT-CHARGING
-    device_add_callback(DEVICE_CALLBACK_BATTERY_CHARGING, device_system_cb, NULL);
-    // SCREEN OFF/ON
-    device_add_callback(DEVICE_CALLBACK_DISPLAY_STATE, device_system_cb, NULL);
-}
-
-/**
- * @brief Initializer for smart notifications
- *
- */
-void system_notifications_shutdown(void)
-{
-    // BATTERY LOW/FULL
-    device_remove_callback(DEVICE_CALLBACK_BATTERY_LEVEL, device_system_cb);
-    // BATTERY CHARGING/NOT-CHARGING
-    device_remove_callback(DEVICE_CALLBACK_BATTERY_CHARGING, device_system_cb);
-    // SCREEN OFF/ON
-    device_remove_callback(DEVICE_CALLBACK_DISPLAY_STATE, device_system_cb);
-}
-
-/**
- * @brief Device system callback handler
- *
- * @param type Device callback type
- * @param value UNUSED
- * @param user_data UNUSED
- */
-static void device_system_cb(device_callback_e type, void *value, void *user_data)
-{
-    if(type == DEVICE_CALLBACK_BATTERY_LEVEL)
-      {
-         device_battery_level_e status;
-         if(device_battery_get_level_status(&status))
-           {
-              ERROR("Cannot get battery level status");
-              return;
-           }
-
-         if(status == DEVICE_BATTERY_LEVEL_LOW)
-           {
-              tts_speak(BATTERY_LOW, TRUE);
-           }
-         else if(status == DEVICE_BATTERY_LEVEL_CRITICAL)
-           {
-              tts_speak(BATTERY_CRITICAL, TRUE);
-           }
-         else if(status == DEVICE_BATTERY_LEVEL_FULL)
-           {
-              tts_speak(BATTERY_FULL, TRUE);
-           }
-      }
-    else if(type == DEVICE_CALLBACK_BATTERY_CHARGING)
-      {
-         bool charging;
-         if(device_battery_is_charging(&charging))
-           {
-              ERROR("Cannot check if battery is charging");
-              return;
-           }
-
-         if(charging)
-           {
-              tts_speak(CHARGING, FALSE);
-           }
-         else
-           {
-              tts_speak(NOT_CHARGING, FALSE);
-           }
-      }
-    else if(type == DEVICE_CALLBACK_DISPLAY_STATE)
-      {
-         display_state_e state;
-         if(device_display_get_state(&state))
-           {
-              ERROR("Cannot check if battery is charging");
-              return;
-           }
-
-         if(state == DISPLAY_STATE_NORMAL)
-           {
-              tts_speak(SCREEN_ON, FALSE);
-           }
-         else if(state == DISPLAY_STATE_SCREEN_OFF)
-           {
-              tts_speak(SCREEN_OFF, FALSE);
-           }
-      }
-}
diff --git a/src/smart_notification.c b/src/smart_notification.c
deleted file mode 100644 (file)
index 9d4be52..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-#include <atspi/atspi.h>
-#include <stdio.h>
-#include "logger.h"
-#include "screen_reader_tts.h"
-#include "screen_reader_haptic.h"
-#include "smart_notification.h"
-
-#define RED  "\x1B[31m"
-#define RESET "\033[0m"
-
-#define ITEMS_NOTIFICATION "Visible items from %d to %d"
-
-static gboolean status = FALSE;
-
-static void _smart_notification_focus_chain_end(void);
-static void _smart_notification_realized_items(int start_idx, int end_idx);
-
-/**
- * @brief Smart Notifications event handler
- *
- * @param nt Notification event type
- * @param start_index int first visible items index smart_notification_realized_items
- * @param end_index int last visible items index used for smart_notification_realized_items
- */
-void smart_notification(Notification_Type nt, int start_index, int end_index)
-{
-    if(!status)
-        return;
-
-    switch(nt)
-    {
-        case FOCUS_CHAIN_END_NOTIFICATION_EVENT:
-            _smart_notification_focus_chain_end();
-            break;
-        case REALIZED_ITEMS_NOTIFICATION_EVENT:
-            _smart_notification_realized_items(start_index, end_index);
-            break;
-        default:
-            DEBUG("Gesture type %d not handled in switch", nt);
-    }
-}
-
-/**
- * @brief Used for getting first and last index of visible items
- *
- * @param scrollable_object AtspiAccessible object on which scroll was triggered
- * @param start_index int first visible items index smart_notification_realized_items
- * @param end_index int last visible items index used for smart_notification_realized_items
- */
-void get_realized_items_count(AtspiAccessible *scrollable_object, int *start_idx, int *end_idx)
-{
-    int count_child, jdx;
-    AtspiAccessible *child_iter;
-    AtspiStateType state =  ATSPI_STATE_SHOWING;
-
-    if(!scrollable_object)
-      {
-         DEBUG("No scrollable object");
-         return;
-      }
-
-    count_child = atspi_accessible_get_child_count(scrollable_object, NULL);
-
-    for(jdx = 0; jdx < count_child; jdx++)
-    {
-        child_iter = atspi_accessible_get_child_at_index(scrollable_object, jdx, NULL);
-
-        AtspiStateSet* state_set = atspi_accessible_get_state_set(child_iter);
-
-        gboolean is_visible = atspi_state_set_contains(state_set, state);
-        if(is_visible)
-        {
-            *start_idx = jdx;
-            DEBUG("Item with index %d is visible", jdx);
-        }
-        else
-            DEBUG("Item with index %d is NOT visible", jdx);
-    }
-    *end_idx = *start_idx + 8;
-}
-
-/**
- * @brief Scroll-start/Scroll-end event callback
- *
- * @param event AtspiEvent
- * @param user_data UNUSED
- */
-static void
-_scroll_event_cb(AtspiEvent     *event, void *user_data)
-{
-   if(!status)
-        return;
-
-   int start_index, end_index;
-   start_index = 0;
-   end_index = 0;
-
-   DEBUG("Event: %s: %d, obj: %p: role: %s\n", event->type, event->detail1, event->source,
-         atspi_accessible_get_role_name(event->source, NULL));
-
-   if (!strcmp(event->type, "object:scroll-start"))
-     {
-        DEBUG("Scrolling started");
-        tts_speak("Scrolling started", TRUE);
-     }
-   else if (!strcmp(event->type, "object:scroll-end"))
-     {
-        DEBUG("Scrolling finished");
-        tts_speak("Scrolling finished", FALSE);
-        get_realized_items_count((AtspiAccessible *)event->source, &start_index, &end_index);
-        _smart_notification_realized_items(start_index, end_index);
-     }
-}
-
-/**
- * @brief Initializer for smart notifications
- *
- *
- */
-void smart_notification_init(void)
-{
-    DEBUG("Smart Notification init!");
-
-    AtspiEventListener *listener;
-
-    listener = atspi_event_listener_new(_scroll_event_cb, NULL, NULL);
-    atspi_event_listener_register(listener, "object:scroll-start", NULL);
-    atspi_event_listener_register(listener, "object:scroll-end", NULL);
-
-    haptic_module_init();
-
-    status = TRUE;
-}
-
-/**
- * @brief Smart notifications shutdown
- *
- */
-void smart_notification_shutdown(void)
-{
-    status = FALSE;
-}
-
-/**
- * @brief Smart notifications focus chain event handler
- *
- */
-static void _smart_notification_focus_chain_end(void)
-{
-    if(!status)
-       return;
-
-    DEBUG(RED"Smart notification - FOCUS CHAIN END"RESET);
-}
-
-/**
- * @brief Smart notifications realized items event handler
- *
- */
-static void _smart_notification_realized_items(int start_idx, int end_idx)
-{
-    if(!status)
-       return;
-
-    if(start_idx == end_idx)
-       return;
-
-    DEBUG(RED"Smart notification - Visible items notification"RESET);
-
-    char buf[256];
-
-    snprintf(buf, sizeof(buf), ITEMS_NOTIFICATION, start_idx, end_idx);
-
-    tts_speak(strdup(buf), FALSE);
-}
old mode 100755 (executable)
new mode 100644 (file)