* Enlightenment SVN <[email protected]> [2011-03-01 08:17:23 -0800]:
> Log:
> e17: allow themes to request argb window frames
>
Gotta love it. Thanks :)
> if your window border theme will use transparency add:
> data { item: "argb" "1" } to the respective border groups
>
>
> Author: jeffdameth
> Date: 2011-03-01 08:17:23 -0800 (Tue, 01 Mar 2011)
> New Revision: 57458
> Trac: http://trac.enlightenment.org/e/changeset/57458
>
> Modified:
> trunk/e/src/bin/e_border.c trunk/e/src/bin/e_border.h
>
> Modified: trunk/e/src/bin/e_border.c
> ===================================================================
> --- trunk/e/src/bin/e_border.c 2011-03-01 14:03:50 UTC (rev 57457)
> +++ trunk/e/src/bin/e_border.c 2011-03-01 16:17:23 UTC (rev 57458)
> @@ -197,6 +197,10 @@
>
> static void _e_border_client_move_resize_send(E_Border *bd);
>
> +static void _e_border_frame_replace(E_Border *bd,
> + Eina_Bool argb);
> +
> +
> /* local subsystem globals */
> static Eina_List *handlers = NULL;
> static Eina_List *borders = NULL;
> @@ -965,6 +969,95 @@
> }
>
> static void
> +_e_border_frame_replace(E_Border *bd, Eina_Bool argb)
> +{
> + Ecore_X_Window win;
> + Ecore_Evas *bg_ecore_evas;
> + char buf[PATH_MAX];
> +
> + bd->argb = argb;
> +
> + win = bd->win;
> + bg_ecore_evas = bd->bg_ecore_evas;
> +
> + /* unregister old frame window */
> + eina_hash_del(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
> + eina_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd);
> +
> + e_focus_setdown(bd);
> + e_bindings_mouse_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
> + e_bindings_wheel_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
> +
> + if (bd->icon_object)
> + evas_object_del(bd->icon_object);
> +
> + evas_object_del(bd->bg_object);
> + e_canvas_del(bg_ecore_evas);
> + ecore_evas_free(bg_ecore_evas);
> +
> + if (bd->pointer)
> + e_object_del(E_OBJECT(bd->pointer));
> +
> + /* create new frame */
> + if (argb)
> + bd->win = ecore_x_window_manager_argb_new(bd->zone->container->win,
> + bd->x, bd->y, bd->w, bd->h);
> + else
> + {
> + bd->win = ecore_x_window_override_new(bd->zone->container->win,
> + bd->x, bd->y, bd->w, bd->h);
> + ecore_x_window_shape_events_select(bd->win, 1);
> + }
> +
> + ecore_x_window_configure(bd->win,
> + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
> + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
> + 0, 0, 0, 0, 0,
> + win, ECORE_X_WINDOW_STACK_BELOW);
> +
> + e_bindings_mouse_grab(E_BINDING_CONTEXT_BORDER, bd->win);
> + e_bindings_wheel_grab(E_BINDING_CONTEXT_BORDER, bd->win);
> + e_focus_setup(bd);
> +
> + bd->bg_ecore_evas = e_canvas_new(e_config->evas_engine_borders, bd->win,
> + 0, 0, bd->w, bd->h, 1, 0,
> + &(bd->bg_win));
> +
> + e_canvas_add(bd->bg_ecore_evas);
> + ecore_x_window_reparent(bd->event_win, bd->win, 0, 0);
> +
> + bd->bg_evas = ecore_evas_get(bd->bg_ecore_evas);
> + ecore_evas_name_class_set(bd->bg_ecore_evas, "E", "Frame_Window");
> + ecore_evas_title_set(bd->bg_ecore_evas, "Enlightenment Frame");
> +
> + ecore_x_window_shape_events_select(bd->bg_win, 1);
> +
> + /* move client with shell win over to new frame */
> + ecore_x_window_reparent(bd->client.shell_win, bd->win,
> + bd->client_inset.l, bd->client_inset.t);
> +
> + bd->pointer = e_pointer_window_new(bd->win, 0);
> +
> + eina_hash_add(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
> + eina_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd);
> +
> + if (bd->visible)
> + {
> + ecore_evas_show(bd->bg_ecore_evas);
> + ecore_x_window_show(bd->win);
> + }
> +
> + bd->bg_object = edje_object_add(bd->bg_evas);
> + snprintf(buf, sizeof(buf), "e/widgets/border/%s/border",
> bd->client.border.name);
> + e_theme_edje_object_set(bd->bg_object, "base/theme/borders", buf);
> +
> + bd->icon_object = e_border_icon_add(bd, bd->bg_evas);
> +
> + /* cleanup old frame */
> + ecore_x_window_free(win);
> +}
> +
> +static void
> _e_border_client_move_resize_send(E_Border *bd)
> {
> if (bd->internal_ecore_evas)
> @@ -6651,17 +6744,34 @@
> e_config_save_queue();
> }
> }
> -
> +
> bd->shaped = 0;
> if (ok)
> {
> - const char *shape_option;
> + const char *shape_option, *argb_option;
> + int use_argb = 0;
>
> - bd->bg_object = o;
> - shape_option = edje_object_data_get(o, "shaped");
> - if ((shape_option) && (!strcmp(shape_option, "1")))
> - bd->shaped = 1;
> + bd->bg_object = o;
> +
> + if (!bd->client.argb)
> + {
> + argb_option = edje_object_data_get(o, "argb");
> + if ((argb_option) && (!strcmp(argb_option, "1")))
> + use_argb = 1;
>
> + if (use_argb != bd->argb)
> + _e_border_frame_replace(bd, use_argb);
> +
> + o = bd->bg_object;
> + }
> +
> + if (!bd->argb)
> + {
> + shape_option = edje_object_data_get(o, "shaped");
> + if ((shape_option) && (!strcmp(shape_option, "1")))
> + bd->shaped = 1;
> + }
> +
> if (bd->client.netwm.name)
> edje_object_part_text_set(o, "e.text.title",
> bd->client.netwm.name);
>
> Modified: trunk/e/src/bin/e_border.h
> ===================================================================
> --- trunk/e/src/bin/e_border.h 2011-03-01 14:03:50 UTC (rev 57457)
> +++ trunk/e/src/bin/e_border.h 2011-03-01 16:17:23 UTC (rev 57458)
> @@ -564,6 +564,8 @@
> unsigned char post_resize : 1;
> unsigned char post_show : 1;
> Ecore_Idle_Enterer *post_job;
> +
> + Eina_Bool argb;
> };
>
> struct _E_Border_Pending_Move_Resize
>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
--
Gustavo Lima Chaves
Computer Engineer @ ProFUSION Embedded Systems
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel