From 1082f8f8a9c1e6e3dd8a7be82fa4667bc860d056 Mon Sep 17 00:00:00 2001 From: caro Date: Thu, 17 May 2012 08:40:13 +0000 Subject: [PATCH] Ecore_evas: add tranparency support for the GDI engine git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@71193 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++ NEWS | 25 ++++++----- src/lib/ecore_evas/ecore_evas_win32.c | 79 ++++++++++++++++++++++++++++++++++- 3 files changed, 97 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4dfe9da..b8b98f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -645,3 +645,7 @@ * Fix ecore-x randr issues with memory access when building output arrays which are memory segv bugs waiting to crash. + +2012-05-17 Vincent Torri + + * Add transparent support in ecore_evas on Windows (GDI engine only) diff --git a/NEWS b/NEWS index eae3557..1f7c029 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ Ecore 1.3.0 Changes since Ecore 1.2.0: +-------------------------- + +Additions: + * ecore_evas: + - Add transparency support on Windows (GDI engine only) Fixes: * ecore @@ -38,6 +43,16 @@ Additions: - ecore_x_randr_output_mode_del() - Add indicator controls - ecore_x_netwm_icons_set() + - ecore_x_illume_clipboard_state_set() + - ecore_x_illume_clipboard_state_get() + - ecore_x_illume_clipboard_geometry_set() + - ecore_x_illume_clipboard_geometry_get() + - Add indicator rotation and transparency controls + * ecore_evas: + - Add Shm and Egl engines for ecore_evas to draw in Wayland. + - Add Socket and Plug to draw other process area. + - Ability to set pointer for wayland support + - Add override_set support on Windows XP - ecore_evas_window_group_set() - ecore_evas_window_group_get() - ecore_evas_aspect_set() @@ -51,16 +66,6 @@ Additions: - ecore_evas_focus_skip_set() - ecore_evas_focus_skip_get() - ecore_evas_callback_state_change_set() - - ecore_x_illume_clipboard_state_set() - - ecore_x_illume_clipboard_state_get() - - ecore_x_illume_clipboard_geometry_set() - - ecore_x_illume_clipboard_geometry_get() - - Add indicator rotation and transparency controls - * ecore_evas: - - Add Shm and Egl engines for ecore_evas to draw in Wayland. - - Add Socket and Plug to draw other process area. - - Ability to set pointer for wayland support - - Add override_set support on Windows XP * ecore_wayland - Add Ecore_Wayland (backend to support Wayland). * ecore_imf diff --git a/src/lib/ecore_evas/ecore_evas_win32.c b/src/lib/ecore_evas/ecore_evas_win32.c index 86eb9dc..c0f70a2 100644 --- a/src/lib/ecore_evas/ecore_evas_win32.c +++ b/src/lib/ecore_evas/ecore_evas_win32.c @@ -945,6 +945,83 @@ _ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, int on) } #endif /* BUILD_ECORE_EVAS_DIRECT3D */ } +static void +_ecore_evas_win32_alpha_set(Ecore_Evas *ee, int alpha) +{ + alpha = !!alpha; + if ((ee->alpha == alpha)) return; + + if (!strcmp(ee->driver, "software_gdi")) + { +#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI + Evas_Engine_Info_Software_Gdi *einfo; + + einfo = (Evas_Engine_Info_Software_Gdi *)evas_engine_info_get(ee->evas); + if (!einfo) return; + + ee->shaped = 0; + ee->alpha = alpha; + /* ecore_win32_window_free(ee->prop.window); */ + /* ecore_event_window_unregister(ee->prop.window); */ + /* if (ee->alpha) */ + /* { */ + /* if (ee->prop.override) */ + /* ee->prop.window = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); */ + /* else */ + /* ee->prop.window = ecore_x_window_argb_new(ee->engine.x.win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); */ + /* if (!ee->engine.x.mask) */ + /* ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->req.w, ee->req.h, 1); */ + /* } */ + /* else */ + /* { */ + /* if (ee->prop.override) */ + /* ee->prop.window = ecore_win32_window_override_new(ee->engine.win32.win_root, */ + /* ee->req.x, */ + /* ee->req.y, */ + /* ee->req.w, */ + /* ee->req.h); */ + /* else */ + /* ee->prop.window = ecore_win32_window_new(ee->engine.win32.win_root, */ + /* ee->req.x, */ + /* ee->req.y, */ + /* ee->req.w, */ + /* ee->req.h); */ + /* if (ee->engine.win32.mask) ecore_x_pixmap_free(ee->engine.x.mask); */ + /* ee->engine.win32.mask = 0; */ + /* ecore_win32_window_shape_input_mask_set(ee->prop.window, 0); */ + /* } */ + + /* einfo->info.destination_alpha = alpha; */ + einfo->info.region = alpha; + +// if (ee->engine.x.mask) ecore_x_pixmap_free(ee->engine.x.mask); +// ee->engine.x.mask = 0; + /* einfo->info.mask = ee->engine.win32.mask; */ + /* einfo->info.drawable = ee->prop.window; */ + if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) + { + ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); + } + evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h); + /* ecore_win32_window_shape_mask_set(ee->prop.window, 0); */ + /* ecore_event_window_register(ee->prop.window, ee, ee->evas, */ + /* (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, */ + /* (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process, */ + /* (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, */ + /* (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); */ + if (ee->prop.borderless) + ecore_win32_window_borderless_set((struct _Ecore_Win32_Window *)ee->prop.window, ee->prop.borderless); + if (ee->visible) ecore_win32_window_show((struct _Ecore_Win32_Window *)ee->prop.window); + if (ee->prop.focused) ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window); + if (ee->prop.title) + { + ecore_win32_window_title_set((struct _Ecore_Win32_Window *)ee->prop.window, ee->prop.title); + /* ecore_win32_name_set(ee->prop.window, ee->prop.title); */ + } + ecore_win32_window_type_set((struct _Ecore_Win32_Window *)ee->prop.window, ECORE_WIN32_WINDOW_TYPE_NORMAL); +#endif /* BUILD_ECORE_EVAS_SOFTWARE_GDI */ + } +} static Ecore_Evas_Engine_Func _ecore_win32_engine_func = @@ -993,7 +1070,7 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func = NULL, /* _ecore_evas_x_withdrawn_set */ NULL, /* _ecore_evas_x_sticky_set */ NULL, /* _ecore_evas_x_ignore_events_set */ - NULL, /* _ecore_evas_x_alpha_set */ + _ecore_evas_win32_alpha_set, NULL, //transparent NULL, -- 2.7.4