Make page_indicator create page more than 7 45/81745/5
authorjunkyu han <junkyu.han@samsung.com>
Thu, 28 Jul 2016 06:58:00 +0000 (15:58 +0900)
committerjunkyu han <junkyu.han@samsung.com>
Thu, 28 Jul 2016 13:05:48 +0000 (22:05 +0900)
Change-Id: Ieec40a91e44338e835507258ea1e3741095943ce

inc/edc_conf.h
inc/page_indicator.h
res/edje/page_indicator_unit.edc
res/images/page_indicator_center.png [new file with mode: 0755]
src/page_indicator.c

index 0a8d55b..bc14893 100755 (executable)
@@ -41,6 +41,7 @@
 
 // cluster
 #define SIZE_SETTER "size_setter"
+#define CENTER_UNIT_TEXT "center_unit_text"
 #define CLUSTER_BOX "cluster_box"
 #define CLUSTER_BG "cluster_bg"
 #define CLUSTER_ADD_PAGE "cluster_add_page"
 #define SIGNAL_CLUSTER_PICKUP_STATE "cluster_pickup_state"
 
 #define GROUP_PAGE_INDICATOR_UNIT "page_indicator_unit"
-#define SIGNAL_PAGE_IDICATOR_ROTATION_CHANGE "rotation,changed"
-#define SIGNAL_PAGE_IDICATOR_DEFAULT "default,set"
-#define SIGNAL_PAGE_IDICATOR_CURRENT "current,set"
+#define GROUP_PAGE_INDICATOR_UNIT_CENTER "page_indicator_unit_center"
+#define SIGNAL_PAGE_INDICATOR_ROTATION_CHANGE "rotation,changed"
+#define SIGNAL_PAGE_INDICATOR_DEFAULT "default,set"
+#define SIGNAL_PAGE_INDICATOR_CURRENT "current,set"
+#define SIGNAL_PAGE_INDICATOR_UNIT_CLICKED "page_indicator_unit_clicked"
 
 #define GROUP_CLUSTER_PAGE_LY "cluster_page_ly"
 #define GROUP_CLUSTER_ALLPAGE_LY "cluster_allpage_ly"
@@ -73,6 +76,9 @@
 #define SIGNAL_ALLPAGE_DRAG_BG_SHOW "allpage_drag_bg_show"
 #define SIGNAL_ALLPAGE_DRAG_BG_HIDE "allpage_drag_bg_hide"
 
+#define PAGE_INDICATOR_UNIT_BUTTON "unit_button"
+#define PAGE_INDICATOR_UNIT_INDICATING_PAGE "page_indicator_unit_indicating_page"
+
 // apps view
 #define GROUP_APPS_LY "apps_ly"
 #define APPS_VIEW_BG "apps_view_bg"
 #define ADD_WIDGET_VIEWER_PREVIEW_ICON "add_widget_viewer_preview_ICON"
 #define SIGNAL_PREVIEW_CLICKED "preview_clicked"
 
-#define SIGNAL_PAGE_INDICATOR_CLICKED "page_indicator_clicked"
-
 #endif /* __EDC_CONF_H__ */
index bbfe4ed..70a09ce 100755 (executable)
@@ -21,6 +21,8 @@
 #include <Elementary.h>
 
 #define PAGE_INDICATOR_MAX_PAGE_COUNT 7
+#define PAGE_INDICATOR_CENTER_PAGE_INDEX 3
+
 
 typedef struct {
        Evas_Object *scroller;
index c3248e8..c0fe3e2 100755 (executable)
  */
 
 #include "../../inc/edc_conf.h"
+styles {
+       style {
+               name: "page_indicator_style";
+               base: "font=TIZEN:style=BOLD font_size=20 align=center color=#5D5D5D wrap=mixed";
+       }
+}
 
 collections {
        group {
@@ -37,7 +43,8 @@ collections {
                        }
                }
                parts {
-                       part { name: SIZE_SETTER;
+                       part {
+                               name: SIZE_SETTER;
                                type: SWALLOW;
                                description {
                                        state: "default" 0.0;
@@ -49,10 +56,10 @@ collections {
                        part {
                                name: "unit";
                                type: IMAGE;
-
                                description {
                                        state: "default" 0.0;
                                        color: 255 255 255 75;
+                                       fixed: 1 1;
                                        rel1{relative: 0.0 0.0; to:SIZE_SETTER;}
                                        rel2{relative: 1.0 1.0; to:SIZE_SETTER;}
                                        image {
@@ -74,12 +81,24 @@ collections {
                                        }
                                }
                        }
+                       part {
+                               name: "over2";
+                               type: RECT;
+                               repeat_events: 1;
+                               ignore_flags: ON_HOLD;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1{relative: 0.0 0.0; to:SIZE_SETTER;}
+                                       rel2{relative: 1.0 1.0; to:SIZE_SETTER;}
+                                       color: 0 0 0 0;
+                               }
+                       }
                }
                programs {
                        program
                        {
                                name: "indice_set_default";
-                               signal: SIGNAL_PAGE_IDICATOR_DEFAULT;
+                               signal: SIGNAL_PAGE_INDICATOR_DEFAULT;
                                source: SIGNAL_SOURCE;
                                action: STATE_SET "default" 0.0;
                                target: "unit";
@@ -87,14 +106,14 @@ collections {
                        program
                        {
                                name: "indice_set_current";
-                               signal: SIGNAL_PAGE_IDICATOR_CURRENT;
+                               signal: SIGNAL_PAGE_INDICATOR_CURRENT;
                                source: SIGNAL_SOURCE;
                                action: STATE_SET "current" 0.0;
                                target: "unit";
                        }
                        program {
                                name: "rotation,changed";
-                               signal: SIGNAL_PAGE_IDICATOR_ROTATION_CHANGE;
+                               signal: SIGNAL_PAGE_INDICATOR_ROTATION_CHANGE;
                                source: SIGNAL_SOURCE;
                                script {
                                        custom_state(PART:"unit", "default", 0.0);
@@ -104,11 +123,129 @@ collections {
                                }
                        }
                        program {
-                               name: "unit,clicked";
+                               name: "button_click";
                                signal: "mouse,clicked,1";
-                               source: "unit";
-                               action: SIGNAL_EMIT SIGNAL_PAGE_INDICATOR_CLICKED SIGNAL_SOURCE;
+                               source: "over2";
+                               action: SIGNAL_EMIT SIGNAL_PAGE_INDICATOR_UNIT_CLICKED SIGNAL_SOURCE;
                        }
+               } // programs
+   }
+   group {
+               name: GROUP_PAGE_INDICATOR_UNIT_CENTER;
+        data {
+            item: "focus_highlight" "on";
+        }
+               images {
+                       image: "page_indicator_center.png" COMP;
                }
-       }
-}
\ No newline at end of file
+               script {
+                       public alpha;
+
+                       public message(Msg_Type:type, id, ...) {
+                               if (type == MSG_FLOAT_SET)
+                               {
+                                       set_float(alpha, getfarg(3));
+                                       send_message(type, id, getfarg(3));
+                               }
+                       }
+               }
+               parts {
+                       part {
+                               name: SIZE_SETTER;
+                               type: SWALLOW;
+                               description {
+                                       state: "default" 0.0;
+                                       align: 0 0;
+                                       rel1.relative: 0.0 0.0;
+                                       rel2.relative: 1.0 1.0;
+                               }
+                       }
+                       part {
+                               name: "unit";
+                               type: IMAGE;
+                               description {
+                                       state: "default" 0.0;
+                                       color: 255 255 255 75;
+                                       rel1{relative: 0.0 0.0; to:SIZE_SETTER;}
+                                       rel2{relative: 1.0 1.0; to:SIZE_SETTER;}
+                                       image {
+                                               normal: "page_indicator_center.png";
+                                       }
+                                       map {
+                                               on: 1;
+                                               perspective_on: 1;
+                                               smooth: 1;
+                                               alpha: 1;
+                                       }
+                               }
+                               description {
+                                       state: "current" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: 255 255 255 255;
+                                       image {
+                                               normal: "page_indicator_center.png";
+                                       }
+                               }
+                       }
+                       part {
+                               name: "over2";
+                               type: RECT;
+                               repeat_events: 1;
+                               ignore_flags: ON_HOLD;
+                               description {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: CENTER_UNIT_TEXT;
+                               type: TEXTBLOCK;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1{relative: 0.0 0.0; to: "unit";}
+                                       rel2{relative: 1.0 1.0; to: "unit";}
+                                       text {
+                                               style: "page_indicator_style";
+                                               align: 0.5 0.5;
+                                       }
+                                       visible: 1;
+                               }
+                       }
+               }
+               programs {
+                       program
+                       {
+                               name: "indice_set_default";
+                               signal: SIGNAL_PAGE_INDICATOR_DEFAULT;
+                               source: SIGNAL_SOURCE;
+                               action: STATE_SET "default" 0.0;
+                               target: "unit";
+                       }
+                       program
+                       {
+                               name: "indice_set_current";
+                               signal: SIGNAL_PAGE_INDICATOR_CURRENT;
+                               source: SIGNAL_SOURCE;
+                               action: STATE_SET "current" 0.0;
+                               target: "unit";
+                       }
+                       program {
+                               name: "rotation,changed";
+                               signal: SIGNAL_PAGE_INDICATOR_ROTATION_CHANGE;
+                               source: SIGNAL_SOURCE;
+                               script {
+                                       custom_state(PART:"unit", "default", 0.0);
+                                       set_state_val(PART:"unit", STATE_COLOR, 255, 255, 255, round(get_float(alpha)));
+                                       set_state(PART:"unit", "custom", 0.0);
+                               }
+                       }
+                        program {
+                               name: "button_click";
+                               signal: "mouse,clicked,1";
+                               source: "over2";
+                               action: SIGNAL_EMIT SIGNAL_PAGE_INDICATOR_UNIT_CLICKED SIGNAL_SOURCE;
+                        }
+               } // programs
+   }// group
+}
diff --git a/res/images/page_indicator_center.png b/res/images/page_indicator_center.png
new file mode 100755 (executable)
index 0000000..3ad7d3d
Binary files /dev/null and b/res/images/page_indicator_center.png differ
index 22acf60..fea8aaf 100755 (executable)
@@ -24,7 +24,8 @@ static void __page_indicator_scroll_cb(void *data, Evas_Object *obj, void *event
 static void __page_indicator_scroll_anim_stop_cb(void *data, Evas_Object *obj, void *event_info);
 static void __page_indicator_set_current_page(page_indicator_t *page_indicator);
 static void __page_indicator_unit_rotate(Evas_Object *unit, double angle, double alpha);
-static void __page_indicator_unit_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void __page_indicator_unit_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+static int __page_indicator_get_indicator_unit(int page_count, int cur_page);
 
 page_indicator_t * page_indictor_create(Evas_Object *scroller)
 {
@@ -43,7 +44,7 @@ page_indicator_t * page_indictor_create(Evas_Object *scroller)
 
        page_indicator->box = elm_box_add(homescreen_efl_get_win());
        if (!page_indicator->box) {
-               LOGE("page_index->box==NULL");
+               LOGE("page_index->box == NULL");
                free(page_indicator);
                return NULL;
        }
@@ -63,7 +64,7 @@ page_indicator_t * page_indictor_create(Evas_Object *scroller)
                page_indicator->unit[i] = elm_layout_add(homescreen_efl_get_win());
                elm_layout_file_set(page_indicator->unit[i], edj_path, GROUP_PAGE_INDICATOR_UNIT);
                evas_object_size_hint_weight_set(page_indicator->unit[i], EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-               evas_object_resize(page_indicator->unit[i], PAGE_INDICATOR_UNIT, PAGE_INDICATOR_UNIT);
+               elm_object_signal_callback_add(page_indicator->unit[i], SIGNAL_PAGE_INDICATOR_UNIT_CLICKED, SIGNAL_SOURCE, __page_indicator_unit_clicked_cb, page_indicator);
 
                Evas_Object *rect = evas_object_rectangle_add(homescreen_efl_get_win());
                evas_object_color_set(rect, 255, 255, 255, 0);
@@ -72,8 +73,6 @@ page_indicator_t * page_indictor_create(Evas_Object *scroller)
                evas_object_resize(rect, PAGE_INDICATOR_UNIT, PAGE_INDICATOR_UNIT);
                evas_object_show(rect);
                elm_object_part_content_set(page_indicator->unit[i], SIZE_SETTER, rect);
-
-               elm_object_signal_callback_add(page_indicator->unit[i], SIGNAL_PAGE_INDICATOR_CLICKED, SIGNAL_SOURCE, __page_indicator_unit_clicked, page_indicator);
        }
 
        return page_indicator;
@@ -87,19 +86,43 @@ void page_indicator_set_page_count(page_indicator_t *page_indicator, int count)
        }
 
        int i;
-       int width = count * PAGE_INDICATOR_UNIT + (PAGE_INDICATOR_GAP * (count-1));
+       int width = 0;
+       char edj_path[PATH_MAX] = {0, };
+
+       snprintf(edj_path, sizeof(edj_path), "%s", util_get_res_file_path(EDJE_DIR"/page_indicator_unit.edj"));
+
+       if (count < PAGE_INDICATOR_MAX_PAGE_COUNT) {
+               width = count * PAGE_INDICATOR_UNIT + (PAGE_INDICATOR_GAP * (count-1));
+       }
+       else {
+               width = PAGE_INDICATOR_MAX_PAGE_COUNT * PAGE_INDICATOR_UNIT + (PAGE_INDICATOR_GAP * (PAGE_INDICATOR_MAX_PAGE_COUNT - 1));
+       }
        if (page_indicator->page_count == count) {
                return ;
        }
        elm_box_unpack_all(page_indicator->box);
-       for (i = 0 ; i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++) {
-               if (i < count) {
+       LOGD("page count: %d", count);
+
+       if (count > PAGE_INDICATOR_MAX_PAGE_COUNT) {
+               for (i = 0 ; i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++) {
+                       if (i == PAGE_INDICATOR_CENTER_PAGE_INDEX) {
+                               elm_layout_file_set(page_indicator->unit[i], edj_path, GROUP_PAGE_INDICATOR_UNIT_CENTER);
+                       }
                        elm_box_pack_end(page_indicator->box, page_indicator->unit[i]);
                        evas_object_show(page_indicator->unit[i]);
-               } else {
-                       evas_object_move(page_indicator->unit[i], 0, -100);
                }
-
+       } else {
+               for (i = 0 ; i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++) {
+                       if (i < count) {
+                               if (i == PAGE_INDICATOR_CENTER_PAGE_INDEX) {
+                                       elm_layout_file_set(page_indicator->unit[i], edj_path, GROUP_PAGE_INDICATOR_UNIT);
+                               }
+                               elm_box_pack_end(page_indicator->box, page_indicator->unit[i]);
+                               evas_object_show(page_indicator->unit[i]);
+                       } else {
+                               evas_object_move(page_indicator->unit[i], 0, -100);
+                       }
+               }
        }
 
        page_indicator->x = (WINDOW_W - width) / 2;
@@ -108,6 +131,8 @@ void page_indicator_set_page_count(page_indicator_t *page_indicator, int count)
 
        evas_object_resize(page_indicator->box, width, PAGE_INDICATOR_H);
        evas_object_move(page_indicator->box, page_indicator->x, page_indicator->y);
+
+       __page_indicator_set_current_page(page_indicator);
 }
 
 void page_indicator_scroller_resize(page_indicator_t *page_indicator, int width, int height)
@@ -124,48 +149,84 @@ void page_indicator_set_current_page(page_indicator_t *page_indicator, int page_
                return ;
        }
 
-       LOGD("Set Current :%d, old : %d", page_number, page_indicator->current_page);
-
        page_indicator->current_page = page_number;
 
        __page_indicator_set_current_page(page_indicator);
 }
 
+static int __page_indicator_get_indicator_unit(int page_count, int page)
+{
+       int indicator = 0;
+       LOGD("Page count : %d, page index: %d", page_count, page);
+
+       if (page_count > PAGE_INDICATOR_MAX_PAGE_COUNT) {
+               int center_left = PAGE_INDICATOR_CENTER_PAGE_INDEX;
+               int center_right = page_count - 1 - PAGE_INDICATOR_CENTER_PAGE_INDEX;
+
+               if (page < center_left) {
+                       indicator = page;
+               }
+               else if (page >= center_left && page <= center_right) {
+                       indicator = PAGE_INDICATOR_CENTER_PAGE_INDEX;
+               }
+               else {
+                       indicator = page - center_right + PAGE_INDICATOR_CENTER_PAGE_INDEX;
+               }
+       }
+       else {
+               indicator = page;
+       }
+
+       return indicator;
+}
+
 static void __page_indicator_scroll_cb(void *data, Evas_Object *obj, void *event_info)
 {
        int i = 0;
        int x = 0;
-       int from_x = 0, to_x = 0;
-       int from_page = 0;
-       int to_page = 0;
-       double from_page_angle = 0.0;
-       double to_page_angle = 0.0;
+       int max_unit_count = 0;
+       double cur_unit_angle = 0.0;
+       double next_unit_angle = 0.0;
+       int cur_indicator_unit = -1;
+       int next_indicator_unit = -1;
+       int cur_page = 0, next_page = 0;
+       int cur_x = 0, next_x = 0;
 
        page_indicator_t *page_indicator = (page_indicator_t*) data;
+       if (!page_indicator) {
+               LOGE("Invalid page_indicator");
+               return;
+       }
 
        elm_scroller_region_get(obj, &x, NULL, NULL, NULL);
-       from_page = x / page_indicator->w;
-       to_page = (from_page + 1) % page_indicator->page_count;
 
-       from_x = x;
-       to_x = (from_x + page_indicator->w) % (page_indicator->w * page_indicator->page_count);
+       cur_page = x / page_indicator->w;
+       next_page = (cur_page + 1) % page_indicator->page_count;
 
-       to_page_angle = (double)(to_x - (to_page * page_indicator->w)) * 90.0 / page_indicator->w;
-       from_page_angle = (to_page_angle + 90) - 180;
+       cur_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, cur_page);
+       next_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, next_page);
 
-       for (i=0; i < page_indicator->page_count; i++) {
+       cur_x = x;
+       next_x = (cur_x + page_indicator->w) % (page_indicator->w * page_indicator->page_count);
+
+       next_unit_angle = (double)(next_x - next_page * page_indicator->w) / page_indicator->w * 90.0;
+       cur_unit_angle = (next_unit_angle + 90) - 180;
+
+       max_unit_count = page_indicator->page_count < PAGE_INDICATOR_MAX_PAGE_COUNT ? page_indicator->page_count : PAGE_INDICATOR_MAX_PAGE_COUNT;
+       for (i = 0; i < max_unit_count; i++)
+       {
                double angle = 0.0;
                double color = 0.0;
-               if (i == from_page) {
-                       angle = from_page_angle;
-               } else if (i == to_page) {
-                       angle = to_page_angle;
+
+               if (i == cur_indicator_unit) {
+                       angle = cur_unit_angle;
+               } else if (i == next_indicator_unit) {
+                       angle = next_unit_angle;
                } else {
                        angle = 0.0;
                }
 
                color = fabs(angle) * 2 + 75.0;
-
                __page_indicator_unit_rotate(page_indicator->unit[i], angle, color);
        }
 }
@@ -188,16 +249,57 @@ static void __page_indicator_scroll_anim_stop_cb(void *data, Evas_Object *obj, v
 static void __page_indicator_set_current_page(page_indicator_t *page_indicator)
 {
        int i;
-       for (i = 0; i < page_indicator->page_count && i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++) {
+       int cur_indicator_unit = 0;
+       char cur_page_num[1024];
+
+       cur_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, page_indicator->current_page);
+
+       for (i = 0; i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++)
+       {
                Evas_Object *edje = NULL;
                edje = elm_layout_edje_get(page_indicator->unit[i]);
-               if (i == page_indicator->current_page) {
-                       edje_object_signal_emit(edje, SIGNAL_PAGE_IDICATOR_CURRENT, SIGNAL_SOURCE);
+               snprintf(cur_page_num, sizeof(cur_page_num), "%d", page_indicator->current_page + 1);
+               LOGD("Current page is %s, set the number to the page indicator", cur_page_num);
+
+               if (i == cur_indicator_unit) {
+                       edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_CURRENT, SIGNAL_SOURCE);
                }
-               //else if { } // i == center_circle
                else {
-                       edje_object_signal_emit(edje, SIGNAL_PAGE_IDICATOR_DEFAULT, SIGNAL_SOURCE);
+                       edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_DEFAULT, SIGNAL_SOURCE);
+               }
+
+               if (edje_object_part_text_set(elm_layout_edje_get(page_indicator->unit[PAGE_INDICATOR_CENTER_PAGE_INDEX]), CENTER_UNIT_TEXT, cur_page_num) == EINA_FALSE) {
+                       LOGE("Failed to set text on the page indicator");
+               }
+       }
+}
+
+static void __page_indicator_unit_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       unsigned int clicked_indicator_unit = 0;
+       Evas_Object *page_indicator_unit = NULL;
+       page_indicator_t *page_indicator = data;
+       Evas_Object *unit = obj;
+       int i;
+
+       for (i = 0; i < page_indicator->page_count && i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++) {
+               if (unit == page_indicator->unit[i]) {
+                       clicked_indicator_unit = i;
+                       break;
+               }
+       }
+       LOGD("UNIT CLICKED : %dth", clicked_indicator_unit);
+
+       if (page_indicator->page_count > PAGE_INDICATOR_MAX_PAGE_COUNT) {
+               if (clicked_indicator_unit < PAGE_INDICATOR_CENTER_PAGE_INDEX) {
+                       elm_scroller_page_bring_in(page_indicator->scroller, clicked_indicator_unit, 0);
+               } else if (clicked_indicator_unit == PAGE_INDICATOR_CENTER_PAGE_INDEX) {
+                       elm_scroller_page_bring_in(page_indicator->scroller, page_indicator->page_count / 2, 0);
+               } else {
+                       elm_scroller_page_bring_in(page_indicator->scroller, (page_indicator->page_count - PAGE_INDICATOR_MAX_PAGE_COUNT + clicked_indicator_unit), 0);
                }
+       } else {
+               elm_scroller_page_bring_in(page_indicator->scroller, clicked_indicator_unit, 0);
        }
 }
 
@@ -222,7 +324,7 @@ static void __page_indicator_unit_rotate(Evas_Object *unit, double angle, double
        msg->val[1] = alpha;
 
        edje_object_message_send(edje, EDJE_MESSAGE_FLOAT_SET, 1, msg);
-       edje_object_signal_emit(edje, SIGNAL_PAGE_IDICATOR_ROTATION_CHANGE, SIGNAL_SOURCE);
+       edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_ROTATION_CHANGE, SIGNAL_SOURCE);
 
        free(msg);
 }
@@ -237,16 +339,3 @@ void page_indicator_hide(page_indicator_t *page_indicator)
        evas_object_hide(page_indicator->box);
 }
 
-static void __page_indicator_unit_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
-       page_indicator_t *page_indicator = (page_indicator_t*) data;
-       Evas_Object *unit = obj;
-       int i;
-       for (i = 0; i < page_indicator->page_count && i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++) {
-               if (unit == page_indicator->unit[i]) {
-                       elm_scroller_page_bring_in(page_indicator->scroller, i, 0);
-                       break;
-               }
-       }
-}
-