Merge changes I1c44532b,I22477f1c
authorChunEon Park <chuneon.park@samsung.com>
Wed, 21 Sep 2011 08:44:57 +0000 (17:44 +0900)
committerGerrit Code Review <git@Maetan>
Wed, 21 Sep 2011 08:44:57 +0000 (17:44 +0900)
* changes:
  [ctxpopup] Resolve TC Build Break
  Prevent Detected Bug Fix: DEADCODE

TC/elm_ts/ctxpopup/Makefile
src/lib/elc_ctxpopup.c

index cbf81ca..6a42008 100755 (executable)
@@ -1,27 +1,25 @@
 CC ?= gcc
 
-TARGETS = uts_elm_ctxpopup_add_func \
-         uts_elm_ctxpopup_horizontal_set \
-         uts_elm_ctxpopup_horizontal_get \
-         uts_elm_ctxpopup_item_append \
-         uts_elm_ctxpopup_item_icon_set \
-         uts_elm_ctxpopup_item_label_set \
-         uts_elm_ctxpopup_item_del \
-         uts_elm_ctxpopup_item_disabled_set \
-     uts_elm_ctxpopup_item_disabled_get \
-     uts_elm_ctxpopup_clear \
-         uts_elm_ctxpopup_item_label_get \
-         uts_elm_ctxpopup_item_icon_get \
-     uts_elm_ctxpopup_direction_priority_set \
-     uts_elm_ctxpopup_direction_priority_get \
-         uts_elm_ctxpopup_content_set \
-     uts_elm_ctxpopup_content_unset \
-         uts_elm_ctxpopup_hover_parent_set \
-         uts_elm_ctxpopup_hover_parent_get
-           
-
-
-PKGS = elementary
+TARGETS = utc_UIFW_elm_ctxpopup_add_func \
+         utc_UIFW_elm_ctxpopup_horizontal_set_func \
+         utc_UIFW_elm_ctxpopup_horizontal_get_func \
+         utc_UIFW_elm_ctxpopup_item_append_func \
+         utc_UIFW_elm_ctxpopup_item_icon_set_func \
+         utc_UIFW_elm_ctxpopup_item_label_set_func \
+         utc_UIFW_elm_ctxpopup_item_del_func \
+         utc_UIFW_elm_ctxpopup_item_disabled_set_func \
+         utc_UIFW_elm_ctxpopup_item_disabled_get_func \
+         utc_UIFW_elm_ctxpopup_clear_func \
+         utc_UIFW_elm_ctxpopup_item_label_get_func \
+         utc_UIFW_elm_ctxpopup_item_icon_get_func \
+         utc_UIFW_elm_ctxpopup_direction_priority_set_func \
+         utc_UIFW_elm_ctxpopup_direction_priority_get_func \
+         utc_UIFW_elm_ctxpopup_content_set_func \
+         utc_UIFW_elm_ctxpopup_content_unset_func \
+         utc_UIFW_elm_ctxpopup_hover_parent_set_func \
+         utc_UIFW_elm_ctxpopup_hover_parent_get_func
+
+PKGS = elementary evas
 
 LDFLAGS = `pkg-config --libs $(PKGS)`
 LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
@@ -34,8 +32,8 @@ CFLAGS += -Wall
 
 all: $(TARGETS)
 
-$(TARGET): %: %.c
-       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+$(TARGETS): %: %.c
+       $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
 
 clean:
        rm -f $(TARGETS)
index a890dec..c667b55 100644 (file)
@@ -407,60 +407,65 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
    //In this case, all directions are invalid because of lack of space.
    if (idx == 4)
      {
-        //TODO 1: Find the largest space direction.
         Evas_Coord length[2];
 
-        length[0] = pos.y - hover_area.y;
-        length[1] = (hover_area.y + hover_area.h) - pos.y;
-
-        if (length[0] > length[1])
-           idx = ELM_CTXPOPUP_DIRECTION_UP;
+        if(!wd->horizontal)
+          {
+             length[0] = pos.y - hover_area.y;
+             length[1] = (hover_area.y + hover_area.h) - pos.y;
+
+             // ELM_CTXPOPUP_DIRECTION_UP
+             if (length[0] > length[1])
+               {
+                  _adjust_pos_x(&pos, &base_size, &hover_area);
+                  pos.y -= base_size.y;
+                  arrow = ELM_CTXPOPUP_DIRECTION_UP;
+                  if (pos.y < (hover_area.y + arrow_size.y))
+                    {
+                       base_size.y -= ((hover_area.y + arrow_size.y) - pos.y);
+                       pos.y = hover_area.y + arrow_size.y;
+                    }
+               }
+             //ELM_CTXPOPUP_DIRECTION_DOWN
+             else
+               {
+                  _adjust_pos_x(&pos, &base_size, &hover_area);
+                  arrow = ELM_CTXPOPUP_DIRECTION_DOWN;
+                  if ((pos.y + arrow_size.y + base_size.y) >
+                      (hover_area.y + hover_area.h))
+                     base_size.y -=
+                        ((pos.y + arrow_size.y + base_size.y) -
+                         (hover_area.y + hover_area.h));
+               }
+          }
         else
-           idx = ELM_CTXPOPUP_DIRECTION_DOWN;
-
-        //TODO 2: determine x , y
-        switch (idx)
           {
-           case ELM_CTXPOPUP_DIRECTION_UP:
-              _adjust_pos_x(&pos, &base_size, &hover_area);
-              pos.y -= base_size.y;
-              arrow = ELM_CTXPOPUP_DIRECTION_DOWN;
-              if (pos.y < hover_area.y + arrow_size.y)
-                {
-                   base_size.y -= ((hover_area.y + arrow_size.y) - pos.y);
-                   pos.y = hover_area.y + arrow_size.y;
-                }
-              break;
-           case ELM_CTXPOPUP_DIRECTION_LEFT:
-              _adjust_pos_y(&pos, &base_size, &hover_area);
-              pos.x -= base_size.x;
-              arrow = ELM_CTXPOPUP_DIRECTION_RIGHT;
-              if (pos.x < hover_area.x + arrow_size.x)
-                {
-                   base_size.x -= ((hover_area.x + arrow_size.x) - pos.x);
-                   pos.x = hover_area.x + arrow_size.x;
-                }
-              break;
-           case ELM_CTXPOPUP_DIRECTION_RIGHT:
-              _adjust_pos_y(&pos, &base_size, &hover_area);
-              arrow = ELM_CTXPOPUP_DIRECTION_LEFT;
-              if (pos.x + arrow_size.x + base_size.x >
-                  hover_area.x + hover_area.w)
-                 base_size.x -=
-                    ((pos.x + arrow_size.x + base_size.x) -
-                     (hover_area.x + hover_area.w));
-              break;
-           case ELM_CTXPOPUP_DIRECTION_DOWN:
-              _adjust_pos_x(&pos, &base_size, &hover_area);
-              arrow = ELM_CTXPOPUP_DIRECTION_UP;
-              if (pos.y + arrow_size.y + base_size.y >
-                  hover_area.y + hover_area.h)
-                 base_size.y -=
-                    ((pos.y + arrow_size.y + base_size.y) -
-                     (hover_area.y + hover_area.h));
-              break;
-           default:
-              break;
+             length[0] = pos.x - hover_area.x;
+             length[1] = (hover_area.x + hover_area.w) - pos.x;
+
+             //ELM_CTXPOPUP_DIRECTION_LEFT
+             if (length[0] > length[1])
+               {
+                  _adjust_pos_y(&pos, &base_size, &hover_area);
+                  pos.x -= base_size.x;
+                  arrow = ELM_CTXPOPUP_DIRECTION_LEFT;
+                  if (pos.x < (hover_area.x + arrow_size.x))
+                    {
+                       base_size.x -= ((hover_area.x + arrow_size.x) - pos.x);
+                       pos.x = hover_area.x + arrow_size.x;
+                    }
+               }
+             //ELM_CTXPOPUP_DIRECTION_RIGHT
+             else
+               {
+                  _adjust_pos_y(&pos, &base_size, &hover_area);
+                  arrow = ELM_CTXPOPUP_DIRECTION_RIGHT;
+                  if (pos.x + (arrow_size.x + base_size.x) >
+                      hover_area.x + hover_area.w)
+                     base_size.x -=
+                        ((pos.x + arrow_size.x + base_size.x) -
+                         (hover_area.x + hover_area.w));
+               }
           }
      }