{
FOCUS_CHAIN_END_NOTIFICATION_EVENT,
REALIZED_ITEMS_NOTIFICATION_EVENT,
+ HIGHLIGHT_NOTIFICATION_EVENT
};
typedef enum _Notification_Type Notification_Type;
#include "flat_navi.h"
#include "logger.h"
+#include "smart_notification.h"
struct _FlatNaviContext {
AtspiAccessible *root;
if (current && !ret) {
DEBUG("Last item reached, pass last item again");
ret = current;
+ smart_notification(FOCUS_CHAIN_END_NOTIFICATION_EVENT, 0, 0);
}
return ret;
}
if (current && !ret) {
DEBUG("first item reached, pass first item again");
ret = current;
+ smart_notification(FOCUS_CHAIN_END_NOTIFICATION_EVENT, 0, 0);
}
return ret;
}
if (current_comp) {
atspi_component_clear_highlight(current_comp, &err);
}
+
+ smart_notification(HIGHLIGHT_NOTIFICATION_EVENT, 0, 0);
+ if (haptic)
+ haptic_vibrate_start(HAPTIC_VIBRATE_DURATION, HAPTIC_VIBRATE_INTENSITY);
+
role = atspi_accessible_get_role(obj, NULL);
if (role != ATSPI_ROLE_PAGE_TAB) {
atspi_component_grab_highlight(comp, &err);
if (context && flat_navi_context_current_get(context) != new_highlighted_obj) {
flat_navi_context_current_set(context, g_object_ref(new_highlighted_obj));
}
- if (haptic)
- haptic_vibrate_start(HAPTIC_VIBRATE_DURATION, HAPTIC_VIBRATE_INTENSITY);
-
}
void clear(gpointer d)
static void _smart_notification_focus_chain_end(void);
static void _smart_notification_realized_items(int start_idx, int end_idx);
+static void _smart_notification_highlight(void);
/**
* @brief Smart Notifications event handler
case REALIZED_ITEMS_NOTIFICATION_EVENT:
_smart_notification_realized_items(start_index, end_index);
break;
+ case HIGHLIGHT_NOTIFICATION_EVENT:
+ _smart_notification_highlight();
+ break;
default:
DEBUG("Gesture type %d not handled in switch", nt);
}
tone_player_start(TONE_TYPE_SUP_CONFIRM, SOUND_TYPE_MEDIA, 200, NULL);
}
+/**
+ * @brief Smart notifications hightlight event handler
+ *
+ */
+static void _smart_notification_highlight(void)
+{
+ if (!status)
+ return;
+
+ DEBUG(RED "Smart notification - HIGHLIGHT" RESET);
+
+ tone_player_stop(0);
+ tone_player_start(TONE_TYPE_PROP_BEEP, SOUND_TYPE_MEDIA, 200, NULL);
+}
+
/**
* @brief Smart notifications realized items event handler
*
check
vconf
elementary
+ capi-media-tone-player
+ capi-system-device
)
FOREACH(flag ${tests_CFLAGS})
${CMAKE_SOURCE_DIR}/src/screen_reader_vconf.c
${CMAKE_SOURCE_DIR}/src/screen_reader_spi.c
${CMAKE_SOURCE_DIR}/src/screen_reader_tts.c
+ ${CMAKE_SOURCE_DIR}/src/screen_reader_haptic.c
+ ${CMAKE_SOURCE_DIR}/src/smart_notification.c
${CMAKE_SOURCE_DIR}/src/flat_navi.c)
ADD_DEFINITIONS(-DSCREEN_READER_FLAT_NAVI_TEST_DUMMY_IMPLEMENTATION)
*/
#include "screen_reader_spi.h"
+#include "screen_reader_haptic.h"
+#include "smart_notification.h"
#include "flat_navi.h"
#include <check.h>
#include <stdio.h>