I have some comments on this commit.

1. use 'const' for getters.
I fixed it in svn.
http://trac.enlightenment.org/e/changeset/77978

2. line break at 81th character
I fixed it in svn.
http://trac.enlightenment.org/e/changeset/78019

3. sample
There is no naviframe style which uses "display,mode,compress".
Provide some sample codes in elementary_test.

4. use space after ,
elm_widget_display_mode_set(data,EVAS_DISPLAY_MODE_COMPRESS);
->
elm_widget_display_mode_set(data, EVAS_DISPLAY_MODE_COMPRESS);
Woohyun fixed this.

5. authors
I added you to authors of elementary.
http://trac.enlightenment.org/e/changeset/78021

Thanks.

Daniel Juyung Seo (SeoZ)


On Sun, Oct 14, 2012 at 11:48 PM, Enlightenment SVN
<no-re...@enlightenment.org> wrote:
> Log:
> Modify Elm conformant widget to notify display mode change
>   to child widget related with keypad state change.
>   elm naviframe check this change and deal with this using theme
>
>
> Author:       jypark
> Date:         2012-10-14 07:48:02 -0700 (Sun, 14 Oct 2012)
> New Revision: 77965
> Trac:         http://trac.enlightenment.org/e/changeset/77965
>
> Modified:
>   trunk/elementary/ChangeLog trunk/elementary/NEWS 
> trunk/elementary/src/lib/elc_naviframe.c 
> trunk/elementary/src/lib/elm_conform.c trunk/elementary/src/lib/elm_widget.c 
> trunk/elementary/src/lib/elm_widget.h 
> trunk/elementary/src/lib/elm_widget_naviframe.h
>
> Modified: trunk/elementary/ChangeLog
> ===================================================================
> --- trunk/elementary/ChangeLog  2012-10-14 13:26:40 UTC (rev 77964)
> +++ trunk/elementary/ChangeLog  2012-10-14 14:48:02 UTC (rev 77965)
> @@ -606,3 +606,7 @@
>
>          * Fix the transit to launch the effect directly when elm_transit_go 
> is called.
>
> +2012-10-14  Jiyoun Park (jypark)
> +
> +        * Add display mode change feature related with keypad state chante
> +       to elm conformant and naviframe.
>
> Modified: trunk/elementary/NEWS
> ===================================================================
> --- trunk/elementary/NEWS       2012-10-14 13:26:40 UTC (rev 77964)
> +++ trunk/elementary/NEWS       2012-10-14 14:48:02 UTC (rev 77965)
> @@ -25,6 +25,7 @@
>     * Diskselector handles dyanmic show/hide of icons now like buttons.
>     * Plug widget handles image object deletion
>     * Handle COMPOUND_TEXT cnp
> +   * Conformant widget handles displaymode change related with keypad.
>
>  Fixes:
>
>
> Modified: trunk/elementary/src/lib/elc_naviframe.c
> ===================================================================
> --- trunk/elementary/src/lib/elc_naviframe.c    2012-10-14 13:26:40 UTC (rev 
> 77964)
> +++ trunk/elementary/src/lib/elc_naviframe.c    2012-10-14 14:48:02 UTC (rev 
> 77965)
> @@ -1015,6 +1015,34 @@
>     return it;
>  }
>
> +
> +static void
> +_on_obj_size_hints_changed(void *data, Evas *e, Evas_Object *obj, void 
> *event_info)
> +{
> +   Elm_Naviframe_Item *it;
> +   Evas_Display_Mode dispmode;
> +
> +   ELM_NAVIFRAME_DATA_GET(obj, sd);
> +
> +   it = elm_naviframe_top_item_get(obj);
> +   if (!it) return;
> +
> +   dispmode = evas_object_size_hint_display_mode_get(obj);
> +   if (sd->dispmode == dispmode) return;
> +
> +   sd->dispmode = dispmode;
> +
> +   switch (dispmode)
> +     {
> +      case EVAS_DISPLAY_MODE_COMPRESS:
> +        edje_object_signal_emit(VIEW(it), "display,mode,compress", "");
> +        break;
> +      default:
> +        edje_object_signal_emit(VIEW(it), "display,mode,default", "");
> +        break;
> +     }
> +}
> +
>  static Eina_Bool
>  _elm_naviframe_smart_focus_next(const Evas_Object *obj,
>                                  Elm_Focus_Direction dir,
> @@ -1083,6 +1111,7 @@
>     priv->auto_pushed = EINA_TRUE;
>     priv->freeze_events = EINA_TRUE;
>
> +   evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 
> _on_obj_size_hints_changed, obj);
>     elm_widget_can_focus_set(obj, EINA_FALSE);
>  }
>
>
> Modified: trunk/elementary/src/lib/elm_conform.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_conform.c      2012-10-14 13:26:40 UTC (rev 
> 77964)
> +++ trunk/elementary/src/lib/elm_conform.c      2012-10-14 14:48:02 UTC (rev 
> 77965)
> @@ -446,16 +446,26 @@
>     else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
>       {
>          Ecore_X_Window zone;
> +        Ecore_X_Virtual_Keyboard_State vkb_state;
>
>          DBG("Keyboard Geometry Changed\n");
>          zone = ecore_x_e_illume_zone_get(ev->win);
> -        sd->vkb_state = ecore_x_e_virtual_keyboard_state_get(zone);
> -        if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
> +        vkb_state = ecore_x_e_virtual_keyboard_state_get(zone);
> +        if (sd->vkb_state != vkb_state)
>            {
> -             evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
> -             evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
> +             sd->vkb_state = vkb_state;
> +             if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
> +               {
> +                  evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
> +                  evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
> +                  elm_widget_display_mode_set(data,EVAS_DISPLAY_MODE_NONE);
> +               }
> +             else if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON)
> +               {
> +                  
> elm_widget_display_mode_set(data,EVAS_DISPLAY_MODE_COMPRESS);
> +                  _autoscroll_objects_update(data);
> +               }
>            }
> -        else _autoscroll_objects_update(data);
>       }
>     else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE)
>       {
>
> Modified: trunk/elementary/src/lib/elm_widget.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_widget.c       2012-10-14 13:26:40 UTC (rev 
> 77964)
> +++ trunk/elementary/src/lib/elm_widget.c       2012-10-14 14:48:02 UTC (rev 
> 77965)
> @@ -3533,6 +3533,72 @@
>  /**
>   * @internal
>   *
> + * Returns the widget's Evas_Display_Mode
> + *
> + * @param obj The widget.
> + * @return Evas_Display_Mode of the object.
> + *
> + * @see elm_widget_display_mode_set().
> + * @ingroup Widget
> + **/
> +EAPI Evas_Display_Mode
> +elm_widget_display_mode_get(Evas_Object *obj)
> +{
> +   Evas_Display_Mode new_mode;
> +   Evas_Object *parent;
> +
> +   API_ENTRY return EVAS_DISPLAY_MODE_NONE;
> +
> +   new_mode = evas_object_size_hint_display_mode_get(obj);
> +   parent = elm_widget_parent_get(obj);
> +
> +   if ((new_mode == EVAS_DISPLAY_MODE_INHERIT) && parent)
> +     return elm_widget_display_mode_get(parent);
> +   return new_mode;
> +
> +}
> +
> +/**
> + * @internal
> + *
> + * Sets the widget and child widget's Evas_Display_Mode.
> + *
> + * @param obj The widget.
> + * @param dispmode Evas_Display_Mode to set widget's mode.
> + *
> + * Widgets are resized by several reasons.
> + * Evas_Display_Mode can help for widgets to get more reson of resize.
> + * For example, elm conform widget resize it's contents when keypad state 
> changed.
> + * After keypad showing, conform widget can change child's Evas_Display_Mode.
> + * @ingroup Widget
> + */
> +EAPI void
> +elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode)
> +{
> +   Evas_Display_Mode child_mode;
> +   Evas_Object *child;
> +   Eina_List *l;
> +
> +   API_ENTRY return;
> +
> +   if (elm_widget_display_mode_get(obj) == dispmode) return;
> +   evas_object_size_hint_display_mode_set(obj, dispmode);
> +
> +   //TODO: Need to deal with EVAS_DISPLAY_MODE_INHERIT efficiently.
> +   EINA_LIST_FOREACH (sd->subobjs, l, child)
> +     {
> +        child_mode = evas_object_size_hint_display_mode_get(child);
> +        if (child_mode != EVAS_DISPLAY_MODE_DONT_CHANGE)
> +          {
> +             elm_widget_display_mode_set(child, dispmode);
> +          }
> +     }
> +
> +}
> +
> +/**
> + * @internal
> + *
>   * Allocate a new Elm_Widget_Item-derived structure.
>   *
>   * The goal of this structure is to provide common ground for actions
>
> Modified: trunk/elementary/src/lib/elm_widget.h
> ===================================================================
> --- trunk/elementary/src/lib/elm_widget.h       2012-10-14 13:26:40 UTC (rev 
> 77964)
> +++ trunk/elementary/src/lib/elm_widget.h       2012-10-14 14:48:02 UTC (rev 
> 77965)
> @@ -692,6 +692,8 @@
>  EAPI Evas_Object     *elm_widget_parent2_get(const Evas_Object *obj);
>  EAPI void             elm_widget_parent2_set(Evas_Object *obj, Evas_Object 
> *parent);
>  EAPI void             elm_widget_focus_steal(Evas_Object *obj);
> +EAPI Evas_Display_Mode elm_widget_display_mode_get(Evas_Object *obj);
> +EAPI void             elm_widget_display_mode_set(Evas_Object *obj, 
> Evas_Display_Mode dispmode);
>  EAPI const Elm_Widget_Smart_Class *elm_widget_smart_class_get(void);
>
>  /**
>
> Modified: trunk/elementary/src/lib/elm_widget_naviframe.h
> ===================================================================
> --- trunk/elementary/src/lib/elm_widget_naviframe.h     2012-10-14 13:26:40 
> UTC (rev 77964)
> +++ trunk/elementary/src/lib/elm_widget_naviframe.h     2012-10-14 14:48:02 
> UTC (rev 77965)
> @@ -126,6 +126,7 @@
>     Eina_Inlist          *stack; /* top item is the list's LAST item */
>     Evas_Object          *dummy_edje;
>     Ecore_Animator       *animator;
> +   Evas_Display_Mode     dispmode;
>
>     Eina_Bool             preserve : 1;
>     Eina_Bool             on_deletion : 1;
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to