On Fri, Dec 12, 2014 at 2:02 PM, Daniel Juyung Seo <[email protected]> wrote:
> Hi Thanks for the patch.
>
> Once we agreed to push this feature, we need to make it better.
>
> 1. Do we support this feature only on windows creation time? So no support
> for runtime theme change?

I didn't find a place where we did support the change of the window
layout. If there is any, point it to me and I will fix it.

> On Thu, Dec 11, 2014 at 2:46 PM, Cedric BAIL <[email protected]> wrote:
>>
>> cedric pushed a commit to branch master.
>>
>>
>> http://git.enlightenment.org/core/elementary.git/commit/?id=e07061c5d5a9b1ec79278da82208ad486937b873
>>
>> commit e07061c5d5a9b1ec79278da82208ad486937b873
>> Author: Cedric BAIL <[email protected]>
>> Date:   Thu Dec 11 06:43:53 2014 +0100
>>
>>     elm_win: make it possible to specify alpha window in the theme
>> directly.
>> ---
>>  src/lib/elm_win.c | 78
>> ++++++++++++++++++++++++++++++++++++-------------------
>>  1 file changed, 52 insertions(+), 26 deletions(-)
>>
>> diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
>> index 6d19710..9f70de5 100644
>> --- a/src/lib/elm_win.c
>> +++ b/src/lib/elm_win.c
>> @@ -209,6 +209,8 @@ struct _Elm_Win_Data
>>     Eina_Bool    skip_focus : 1;
>>     Eina_Bool    floating : 1;
>>     Eina_Bool    noblank : 1;
>> +   Eina_Bool    theme_alpha : 1;
>> +   Eina_Bool    application_alpha : 1;
>>  };
>>
>>  static const char SIG_DELETE_REQUEST[] = "delete,request";
>> @@ -345,6 +347,38 @@ elm_process_state_get(void)
>>     return _elm_process_state;
>>  }
>>
>> +static void
>> +_elm_win_apply_alpha(Eo *obj, Elm_Win_Data *sd)
>> +{
>> +   Eina_Bool enabled;
>> +
>> +   enabled = sd->theme_alpha | sd->application_alpha;
>> +   if (sd->img_obj)
>> +     {
>> +        evas_object_image_alpha_set(sd->img_obj, enabled);
>> +        ecore_evas_alpha_set(sd->ee, enabled);
>> +     }
>> +   else
>> +     {
>> +#ifdef HAVE_ELEMENTARY_X
>> +        if (sd->x.xwin)
>> +          {
>> +             if (enabled)
>> +               {
>> +                  if (!ecore_x_screen_is_composited(0))
>> +                    elm_win_shaped_set(obj, enabled);
>> +                  else
>> +                    TRAP(sd, alpha_set, enabled);
>> +               }
>> +             else
>> +               TRAP(sd, alpha_set, enabled);
>> +             _elm_win_xwin_update(sd);
>> +          }
>> +        else
>> +#endif
>> +          TRAP(sd, alpha_set, enabled);
>> +     }
>> +}
>>
>>  static void
>>  _elm_win_state_eval(void *data EINA_UNUSED)
>> @@ -591,7 +625,8 @@ _shot_do(Elm_Win_Data *sd)
>>     flags = _shot_flags_get(sd);
>>     ee = ecore_evas_buffer_new(1, 1);
>>     o = evas_object_image_add(ecore_evas_get(ee));
>> -   evas_object_image_alpha_set(o, ecore_evas_alpha_get(sd->ee));
>> +   evas_object_image_alpha_set(o,
>> +                               sd->theme_alpha | sd->application_alpha);
>>     evas_object_image_size_set(o, w, h);
>>     evas_object_image_data_set(o, pixels);
>>     if (!evas_object_image_save(o, file, key, flags))
>> @@ -3516,6 +3551,20 @@ _elm_win_constructor(Eo *obj, Elm_Win_Data *sd,
>> const char *name, Elm_Win_Type t
>>          eo_do(obj,
>> eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED,
>> NULL));
>>       }
>>
>>
> Here,
>
>
>> +   if (edje_object_data_get(sd->layout, "alpha"))
>> +     {
>> +        const char *s = edje_object_data_get(sd->layout, "alpha");
>> +        if (s)
>> +          {
>>
>
> 2. This duplicated calls look intended.
> Does this really help?

It simplify the code logic and reduce the need to use a long live
variable. The performance impact being nul due to the use of a hash on
edje side.

>> +             if (!strcmp(s, "1") ||
>> +                 !strcmp(s, "true"))
>> +               {
>> +                  sd->application_alpha = 1;
>> +                  _elm_win_apply_alpha(obj, sd);
>> +               }
>> +          }
>> +     }
>> +
>>     evas_object_show(sd->layout);
>>  }
>>
>> @@ -3773,31 +3822,8 @@ _elm_win_shaped_get(Eo *obj EINA_UNUSED,
>> Elm_Win_Data *sd)
>>  EOLIAN static void
>>  _elm_win_alpha_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool enabled)
>>  {
>> -   if (sd->img_obj)
>> -     {
>> -        evas_object_image_alpha_set(sd->img_obj, enabled);
>> -        ecore_evas_alpha_set(sd->ee, enabled);
>> -     }
>> -   else
>> -     {
>> -#ifdef HAVE_ELEMENTARY_X
>> -        if (sd->x.xwin)
>> -          {
>> -             if (enabled)
>> -               {
>> -                  if (!ecore_x_screen_is_composited(0))
>> -                    elm_win_shaped_set(obj, enabled);
>> -                  else
>> -                    TRAP(sd, alpha_set, enabled);
>> -               }
>> -             else
>> -               TRAP(sd, alpha_set, enabled);
>> -             _elm_win_xwin_update(sd);
>> -          }
>> -        else
>> -#endif
>> -          TRAP(sd, alpha_set, enabled);
>> -     }
>> +   sd->application_alpha = enabled;
>> +   _elm_win_apply_alpha(obj, sd);
>>  }
>>
>>  EOLIAN static Eina_Bool
>>
>> --
>>
>>
> Thanks.
>
> Daniel Juyung Seo (SeoZ)
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>



-- 
Cedric BAIL

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to