Navigator: compilation warnings removed.
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 3 Dec 2014 10:43:46 +0000 (11:43 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 3 Dec 2014 10:55:34 +0000 (11:55 +0100)
src/navigator.c

index 8d3e648..91da1f1 100644 (file)
@@ -1,4 +1,5 @@
 #include <Ecore_X.h>
+#include <Ecore.h>
 #include <math.h>
 #include "logger.h"
 #include "navigator.h"
@@ -17,7 +18,6 @@
 
 #define DEBUG_MODE
 
-static AtspiAccessible *previous_obj;
 static AtspiAccessible *current_obj;
 static AtspiAccessible *top_window;
 static AtspiScrollable *scrolled_obj;
@@ -92,16 +92,7 @@ void test_debug(AtspiAccessible *current_widget)
     }
 }
 
-static void _scroll_widget(Gesture_Info *info)
-{
-    AtspiAccessible *current_widget = NULL;
-
-    if(current_obj)
-        current_widget = current_obj;
-    else
-        return NULL;
-}
-
+#if 0
 static void object_get_x_y(AtspiAccessible * accessibleObject, int* x, int* y)
 {
     GError * error = NULL;
@@ -146,7 +137,6 @@ static void object_get_wh(AtspiAccessible * accessibleObject, int* width, int* h
 
 static void find_objects(AtspiAccessible* parent, gint x, gint y, gint radius, double* distance, AtspiAccessible **find_app)
 {
-    AtspiAccessible* obj = NULL;
     AtspiAccessible* app = NULL;
     GError* err = NULL;
     int jdx, kdx;
@@ -225,11 +215,11 @@ static AtspiAccessible *get_nearest_widget(AtspiAccessible* app_obj, gint x_cord
 
     return f_app_obj;
 }
+#endif
 
 static void _focus_widget(Gesture_Info *info)
 {
     AtspiAccessible *target_widget = NULL;
-    AtspiComponent *target_component = NULL;
     AtspiComponent *window_component = NULL;
 
     window_component = atspi_accessible_get_component(top_window);
@@ -247,104 +237,6 @@ static void _focus_widget(Gesture_Info *info)
             info->x_begin, info->y_begin);
 }
 
-static AtspiAccessible *_focused_next_widget(void)
-{
-    AtspiAccessible *current_widget = NULL;
-    AtspiComponent *focus_component = NULL;
-    GArray *relations = NULL;
-    AtspiRelation *relation = NULL;
-    AtspiRelationType type;
-    gchar *roleName;
-    int i;
-
-    if(current_obj)
-        current_widget = current_obj;
-    else
-        return NULL;
-
-    relations = atspi_accessible_get_relation_set(current_widget, NULL);
-
-    if (relations->len)
-    {
-        for (i = 0; i < relations->len; i++)
-        {
-            relation = g_array_index (relations, AtspiRelation*, i);
-            type = atspi_relation_get_relation_type(relation);
-
-            if (type == ATSPI_RELATION_FLOWS_TO)
-            {
-                current_widget = atspi_relation_get_target(relation, 0);
-            }
-        }
-    }
-
-    roleName = atspi_accessible_get_role_name(current_widget, NULL);
-
-    focus_component = atspi_accessible_get_component(current_widget);
-
-    ERROR("Target widget role name: %s\n", roleName);
-
-    if (focus_component != NULL && strcmp(roleName, "entry"))
-    {
-        ERROR("Focused widget role: %s\n", roleName);
-            if (atspi_component_grab_highlight(focus_component, NULL))
-                ERROR("Highlighted\n");
-            #ifdef DEBUG_MODE
-                test_debug(current_widget);
-            #endif
-    }
-    return current_widget;
-}
-
-static AtspiAccessible *_focused_prev_widget(void)
-{
-    AtspiAccessible *current_widget = NULL;
-    AtspiComponent *focus_component = NULL;
-    GArray *relations = NULL;
-    AtspiRelation *relation = NULL;
-    AtspiRelationType type;
-    gchar *roleName;
-    int i;
-
-    if(current_obj)
-        current_widget = current_obj;
-    else
-        return NULL;
-
-    relations = atspi_accessible_get_relation_set(current_widget, NULL);
-
-    if (relations->len)
-    {
-        for (i = 0; i < relations->len; i++)
-        {
-            relation = g_array_index (relations, AtspiRelation*, i);
-            type = atspi_relation_get_relation_type(relation);
-
-            if (type == ATSPI_RELATION_FLOWS_FROM)
-            {
-                current_widget = atspi_relation_get_target(relation, 0);
-            }
-        }
-    }
-
-    roleName = atspi_accessible_get_role_name(current_widget, NULL);
-
-    focus_component = atspi_accessible_get_component(current_widget);
-
-    ERROR("Target widget role name: %s\n", roleName);
-
-    if (focus_component != NULL && strcmp(roleName, "entry"))
-    {
-            if (atspi_component_grab_highlight(focus_component, NULL))
-                 ERROR("Highlighted\n");
-            #ifdef DEBUG_MODE
-                test_debug(current_widget);
-            #endif
-    }
-
-    return current_widget;
-}
-
 static void _focus_next(void)
 {
    if (!context)
@@ -465,33 +357,6 @@ static void _value_dec_widget(void)
         ERROR("No value interface supported!\n");
 }
 
-static Eina_Bool
-_timeout(void *data)
-{
-    AtspiAccessible *current_widget = data;
-    AtspiAction *action;
-    gint number;
-    gchar *actionName;
-    gboolean ret = FALSE;
-    int i;
-
-    action = atspi_accessible_get_action(current_widget);
-    number = atspi_action_get_n_actions(action, NULL);
-    ERROR("Number of available action = %d\n", number);
-
-    for (i=0; i<number; i++)
-    {
-        actionName = atspi_action_get_name(action, i, NULL);
-
-        if (!strcmp("release", actionName))
-        {
-            ret = atspi_action_do_action(action, i, NULL);
-            ERROR(ret ? "Action done" : "Action %s failed", actionName);
-        }
-    }
-    return EINA_FALSE;
-}
-
 static void _activate_widget(void)
 {
     //activate the widget
@@ -559,9 +424,6 @@ static void _activate_widget(void)
 static void _quickpanel_change_state(gboolean quickpanel_switch)
 {
     Ecore_X_Window xwin = 0;
-    const char *name = NULL;
-    const char *clas = NULL;
-    int ret;
 
     ERROR(quickpanel_switch ? "QUICKPANEL STATE ON" : "QUICKPANEL STATE OFF");
 
@@ -703,6 +565,8 @@ static void _widget_scroll_end(Gesture_Info *gi)
    scrolled_obj = NULL;
 }
 
+#if 0
+// part of structural navigation
 static void _goto_children_widget(void)
 {
    AtspiAccessible *obj;
@@ -732,6 +596,7 @@ static void _escape_children_widget(void)
    else
      DEBUG("Unable to find hihglightable parent widget");
 }
+#endif
 
 static void _widget_scroll(Gesture_Info *gi)
 {
@@ -790,59 +655,6 @@ static void on_gesture_detected(void *data, Gesture_Info *info)
    }
 }
 
-static void _get_first_focusable_widget(AtspiAccessible* obj)
-{
-    AtspiAccessible *current_widget = NULL;
-    AtspiStateSet *state_set = NULL;
-    AtspiComponent *focus_component = NULL;
-    int i;
-
-    gint nChild;
-    gchar *winName = NULL;
-    gchar *widgetName = NULL;
-    gchar *roleName = NULL;
-
-    if (obj == NULL)
-    {
-        ERROR("No window on top");
-        return;
-    }
-
-    winName = atspi_accessible_get_name(obj, NULL);
-    ERROR("Win name: %s\n", winName);
-
-    nChild = atspi_accessible_get_child_count(obj, NULL);
-    ERROR("Child count of top win: %d\n", nChild);
-
-    for (i = 0; i < nChild; i++)
-    {
-        current_widget = atspi_accessible_get_child_at_index(obj, i, NULL);
-        widgetName = atspi_accessible_get_name(current_widget, NULL);
-        ERROR("Widget name: %s\n", widgetName);
-
-        roleName = atspi_accessible_get_role_name(current_widget, NULL);
-        ERROR("Widget role: %s\n", roleName);
-
-        state_set = atspi_accessible_get_state_set(current_widget);
-        if (ATSPI_IS_STATE_SET(state_set))
-        {
-
-            focus_component = atspi_accessible_get_component(current_widget);
-            if (focus_component != NULL)
-            {
-                ERROR("Focus component is not null\n");
-                if (atspi_component_grab_highlight(focus_component, NULL))
-                    ERROR("Highlighted!\n");
-                return;
-            }
-        }
-    }
-
-    ERROR("Not found any focusable widget");
-
-    return;
-}
-
 static void
 _on_cache_builded(void *data)
 {
@@ -859,7 +671,6 @@ static void on_window_activate(void *data, AtspiAccessible *window)
 {
       ERROR("... on window activate ...");
       top_window = window;
-      AtspiAccessible *obj;
 
       _current_highlight_object_set(NULL);
 
@@ -877,27 +688,6 @@ static void on_window_activate(void *data, AtspiAccessible *window)
       }
 }
 
-static void on_keyboard(void *data, Key k)
-{
-   switch(k)
-   {
-       case KEY_LEFT:
-          _focus_prev();
-          break;
-       case KEY_RIGHT:
-          _focus_next();
-          break;
-       case KEY_UP:
-          _value_inc_widget();
-          break;
-       case KEY_DOWN:
-          _value_dec_widget();
-          break;
-       default:
-         ERROR("Function not implemented for key :%d", k);
-   }
-}
-
 void navigator_init(void)
 {
    // register on gesture_getected
@@ -905,9 +695,6 @@ void navigator_init(void)
    // register on active_window
    window_tracker_register(on_window_activate, NULL);
    window_tracker_active_window_request();
-
-   //keyboard_tracker_init();
-   //keyboard_tracker_register(on_keyboard, NULL);
 }
 void navigator_shutdown(void)
 {
@@ -919,5 +706,4 @@ void navigator_shutdown(void)
         context = NULL;
      }
    object_cache_shutdown();
-   //keyboard_tracker_shutdown();
 }