Re: [E-devel] [EGIT] [core/elementary] master 01/01: elm_focus: added new focus move policy and elm_object_focus_move_policy_set/get

2015-06-02 Thread Daniel Juyung Seo
Hello Woohyun Jung,

I have a strong doubt about this commit.
1. In what case do you need ELM_FOCUS_MOVE_POLICY_KEY_ONLY? It would be
confusing to users if the focus does not move with pointing devices when
you have both pointing and key devices. If you have only key device, there
is nothing you need to do because pointing event would not be triggered.
2. Why do you need to set a separate focus policy per object? Focus is a
general concept used between multiple objects. Having a different focus
move policy per object does not make sense. This would be confusing to
users too.

Thanks,
Daniel Juyung Seo (SeoZ)

On Tue, Jun 2, 2015 at 1:47 PM, WooHyun Jung wh0705.j...@samsung.com
wrote:

 woohyun pushed a commit to branch master.


 http://git.enlightenment.org/core/elementary.git/commit/?id=f0a7fafa5959f7b182100e31cab2a808e3543c9b

 commit f0a7fafa5959f7b182100e31cab2a808e3543c9b
 Author: WooHyun Jung wh0705.j...@samsung.com
 Date:   Tue Jun 2 13:42:00 2015 +0900

 elm_focus: added new focus move policy and
 elm_object_focus_move_policy_set/get

 New focus move policy, ELM_FOCUS_MOVE_POLICY_KEY_ONLY, is added.
 If you set this policy as base focus move policy, objects cannot steal
 focus by using mouse click or mouse in. Only keyboard input (such as
 Left,
 Right, Up, Down, ...) can make focus be moved.
 Additaionally, an object can have its own focus move policy by using
 elm_object_focus_move_policy_set API.

 @feature
 ---
  src/bin/Makefile.am   |  1 +
  src/bin/test.c|  2 ++
  src/lib/elm_config.h  |  3 ++-
  src/lib/elm_focus.h   | 36 
  src/lib/elm_main.c| 15 +++
  src/lib/elm_widget.c  | 38 +++---
  src/lib/elm_widget.eo | 11 +++
  src/lib/elm_widget.h  |  3 +++
  8 files changed, 105 insertions(+), 4 deletions(-)

 diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
 index 3d0a990..fdaafa4 100644
 --- a/src/bin/Makefile.am
 +++ b/src/bin/Makefile.am
 @@ -65,6 +65,7 @@ test_flipselector.c \
  test_floating.c \
  test_focus.c \
  test_focus_custom_chain.c \
 +test_focus_policy.c \
  test_focus_style.c \
  test_gengrid.c \
  test_genlist.c \
 diff --git a/src/bin/test.c b/src/bin/test.c
 index 9a7de33..443d69c 100644
 --- a/src/bin/test.c
 +++ b/src/bin/test.c
 @@ -206,6 +206,7 @@ void test_focus_style(void *data, Evas_Object *obj,
 void *event_info);
  void test_focus_part(void *data, Evas_Object *obj, void *event_info);
  void test_focus3(void *data, Evas_Object *obj, void *event_info);
  void test_focus_object_style(void *data, Evas_Object *obj, void
 *event_info);
 +void test_focus_object_policy(void *data, Evas_Object *obj, void
 *event_info);
  void test_flipselector(void *data, Evas_Object *obj, void *event_info);
  void test_diskselector(void *data, Evas_Object *obj, void *event_info);
  void test_colorselector(void *data, Evas_Object *obj, void *event_info);
 @@ -804,6 +805,7 @@ add_tests:
 ADD_TEST(NULL, Focus, Focus On Part, test_focus_part);
 ADD_TEST(NULL, Focus, Focus 3, test_focus3);
 ADD_TEST(NULL, Focus, Focus Object Style, test_focus_object_style);
 +   ADD_TEST(NULL, Focus, Focus Object Policy,
 test_focus_object_policy);

 //--//
 ADD_TEST(NULL, Naviframe, Naviframe, test_naviframe);
 diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h
 index b069c60..5718790 100644
 --- a/src/lib/elm_config.h
 +++ b/src/lib/elm_config.h
 @@ -1422,7 +1422,8 @@ EAPI void
 elm_config_focus_highlight_clip_disabled_set(Eina_Bool disable);
  typedef enum
  {
 ELM_FOCUS_MOVE_POLICY_CLICK, /** move focus by mouse click or touch.
 Elementary focus is set on mouse click and this is checked at mouse up
 time. (default) */
 -   ELM_FOCUS_MOVE_POLICY_IN /** move focus by mouse in. Elementary focus
 is set on mouse move when the mouse pointer is moved into an object. */
 +   ELM_FOCUS_MOVE_POLICY_IN, /** move focus by mouse in. Elementary
 focus is set on mouse move when the mouse pointer is moved into an object.
 */
 +   ELM_FOCUS_MOVE_POLICY_KEY_ONLY /** move focus by key. Elementary
 focus is set on key input like Left, Right, Up, Down, Tab, or Shift+Tab.*/
  } Elm_Focus_Move_Policy;

  /**
 diff --git a/src/lib/elm_focus.h b/src/lib/elm_focus.h
 index 3aad5e9..29883f7 100644
 --- a/src/lib/elm_focus.h
 +++ b/src/lib/elm_focus.h
 @@ -335,3 +335,39 @@ EAPI const char
 *elm_object_focus_highlight_style_get(const Evas_Object *obj);
   * @since 1.10
   */
  EAPI Elm_Object_Item *elm_object_focused_item_get(const
 Evas_Object *obj);
 +
 +/**
 + * Set the focus movement policy to a given Elementary object.
 + *
 + * @param obj The Elementary object to operate on
 + * @param policy A policy to apply for the focus movement
 + *
 + * @see elm_object_focus_move_policy_get
 + *
 + * @since 1.15
 + *
 + * @ingroup Focus
 + */
 +EAPI void elm_object_focus_move_policy_set(Evas_Object
 *obj, 

Re: [E-devel] [EGIT] [core/elementary] master 01/01: elm_focus: added new focus move policy and elm_object_focus_move_policy_set/get

2015-06-02 Thread woohyun
Hello.
 
In some cases, this new policy is useful.
For example,
 - there are elm_entry and elm_check.
 - elm_entry gets focus and software keyboard is shown. (in the smart phone 
application) 
 - this elm_check is for changing the password mode of elm_entry. (it will 
set/unset password mode) 
 - Without this policy, every clicking of elm_check will set focus to elm_check.
 - software keyboard will be hidden because of losing focus from elm_entry.
 
Many smart phone application does not want to move focus to elm_check in this 
case.
I know this can be implemented by using elm_object_focus_allow_set(check, 
EINA_FALSE).
But this is not good way because elm_check should be accessible when somebody 
uses h/w keyboard only.
 
For this case, other platforms are supporting this special focus move policy, 
too.
 
Thanks :)  
 
-Original Message-
From: Daniel Juyung Seolt;seojuyu...@gmail.comgt; 
To: WooHyun Junglt;wh0705.j...@samsung.comgt;; 
Cc: Enlightenment developer 
listlt;enlightenment-devel@lists.sourceforge.netgt;; 
Sent: 2015-06-02 (화) 18:15:25
Subject: Re: [E-devel] [EGIT] [core/elementary] master 01/01: elm_focus: added 
new focus move policy and elm_object_focus_move_policy_set/get
 
Hello Woohyun Jung,

I have a strong doubt about this commit.
1. In what case do you need ELM_FOCUS_MOVE_POLICY_KEY_ONLY? It would be
confusing to users if the focus does not move with pointing devices when
you have both pointing and key devices. If you have only key device, there
is nothing you need to do because pointing event would not be triggered.
2. Why do you need to set a separate focus policy per object? Focus is a
general concept used between multiple objects. Having a different focus
move policy per object does not make sense. This would be confusing to
users too.

Thanks,
Daniel Juyung Seo (SeoZ)

On Tue, Jun 2, 2015 at 1:47 PM, WooHyun Jung lt;wh0705.j...@samsung.comgt;
wrote:

gt; woohyun pushed a commit to branch master.
gt;
gt;
gt; 
http://git.enlightenment.org/core/elementary.git/commit/?id=f0a7fafa5959f7b182100e31cab2a808e3543c9b
gt;
gt; commit f0a7fafa5959f7b182100e31cab2a808e3543c9b
gt; Author: WooHyun Jung lt;wh0705.j...@samsung.comgt;
gt; Date:   Tue Jun 2 13:42:00 2015 +0900
gt;
gt; elm_focus: added new focus move policy and
gt; elm_object_focus_move_policy_set/get
gt;
gt; New focus move policy, ELM_FOCUS_MOVE_POLICY_KEY_ONLY, is added.
gt; If you set this policy as base focus move policy, objects cannot steal
gt; focus by using mouse click or mouse in. Only keyboard input (such as
gt; Left,
gt; Right, Up, Down, ...) can make focus be moved.
gt; Additaionally, an object can have its own focus move policy by using
gt; elm_object_focus_move_policy_set API.
gt;
gt; @feature
gt; ---
gt;  src/bin/Makefile.am   |  1 +
gt;  src/bin/test.c|  2 ++
gt;  src/lib/elm_config.h  |  3 ++-
gt;  src/lib/elm_focus.h   | 36 
gt;  src/lib/elm_main.c| 15 +++
gt;  src/lib/elm_widget.c  | 38 +++---
gt;  src/lib/elm_widget.eo | 11 +++
gt;  src/lib/elm_widget.h  |  3 +++
gt;  8 files changed, 105 insertions(+), 4 deletions(-)
gt;
gt; diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
gt; index 3d0a990..fdaafa4 100644
gt; --- a/src/bin/Makefile.am
gt; +++ b/src/bin/Makefile.am
gt; @@ -65,6 +65,7 @@ test_flipselector.c \
gt;  test_floating.c \
gt;  test_focus.c \
gt;  test_focus_custom_chain.c \
gt; +test_focus_policy.c \
gt;  test_focus_style.c \
gt;  test_gengrid.c \
gt;  test_genlist.c \
gt; diff --git a/src/bin/test.c b/src/bin/test.c
gt; index 9a7de33..443d69c 100644
gt; --- a/src/bin/test.c
gt; +++ b/src/bin/test.c
gt; @@ -206,6 +206,7 @@ void test_focus_style(void *data, Evas_Object *obj,
gt; void *event_info);
gt;  void test_focus_part(void *data, Evas_Object *obj, void *event_info);
gt;  void test_focus3(void *data, Evas_Object *obj, void *event_info);
gt;  void test_focus_object_style(void *data, Evas_Object *obj, void
gt; *event_info);
gt; +void test_focus_object_policy(void *data, Evas_Object *obj, void
gt; *event_info);
gt;  void test_flipselector(void *data, Evas_Object *obj, void *event_info);
gt;  void test_diskselector(void *data, Evas_Object *obj, void *event_info);
gt;  void test_colorselector(void *data, Evas_Object *obj, void *event_info);
gt; @@ -804,6 +805,7 @@ add_tests:
gt; ADD_TEST(NULL, Focus, Focus On Part, test_focus_part);
gt; ADD_TEST(NULL, Focus, Focus 3, test_focus3);
gt; ADD_TEST(NULL, Focus, Focus Object Style, test_focus_object_style);
gt; +   ADD_TEST(NULL, Focus, Focus Object Policy,
gt; test_focus_object_policy);
gt;
gt; //--//
gt; ADD_TEST(NULL, Naviframe, Naviframe, test_naviframe);
gt; diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h
gt; index b069c60..5718790 100644
gt; --- a/src/lib/elm_config.h
gt; +++ b/src/lib/elm_config.h
gt; @@ -1422,7 +1422,8 @@ EAPI void
gt