Alexandre Julliard : wineandroid: Implement SetLayeredWindowAttributes.

Alexandre Julliard julliard at winehq.org
Wed Jun 7 16:24:08 CDT 2017


Module: wine
Branch: master
Commit: 52f53fe82e7cf4bd4b621c9dace8b34d0595a5e2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=52f53fe82e7cf4bd4b621c9dace8b34d0595a5e2

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jun  7 11:26:37 2017 +0200

wineandroid: Implement SetLayeredWindowAttributes.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wineandroid.drv/window.c             | 63 +++++++++++++++++++++++++++++++
 dlls/wineandroid.drv/wineandroid.drv.spec |  2 +
 2 files changed, 65 insertions(+)

diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c
index 78ce952..ef849f8 100644
--- a/dlls/wineandroid.drv/window.c
+++ b/dlls/wineandroid.drv/window.c
@@ -761,6 +761,27 @@ failed:
     return NULL;
 }
 
+/***********************************************************************
+ *           set_surface_layered
+ */
+static void set_surface_layered( struct window_surface *window_surface, BYTE alpha, COLORREF color_key )
+{
+    struct android_window_surface *surface = get_android_surface( window_surface );
+    COLORREF prev_key;
+    BYTE prev_alpha;
+
+    if (window_surface->funcs != &android_surface_funcs) return;  /* we may get the null surface */
+
+    window_surface->funcs->lock( window_surface );
+    prev_key = surface->color_key;
+    prev_alpha = surface->alpha;
+    surface->alpha = alpha;
+    set_color_key( surface, color_key );
+    if (alpha != prev_alpha || surface->color_key != prev_key)  /* refresh */
+        *window_surface->funcs->get_bounds( window_surface ) = surface->header.rect;
+    window_surface->funcs->unlock( window_surface );
+}
+
 
 static WNDPROC desktop_orig_wndproc;
 
@@ -978,6 +999,30 @@ void CDECL ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flag
 
 
 /***********************************************************************
+ *           ANDROID_SetWindowStyle
+ */
+void CDECL ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
+{
+    struct android_win_data *data;
+    DWORD changed = style->styleNew ^ style->styleOld;
+
+    if (hwnd == GetDesktopWindow()) return;
+    if (!(data = get_win_data( hwnd ))) return;
+
+    if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED)) /* changing WS_EX_LAYERED resets attributes */
+    {
+        if (is_argb_surface( data->surface ))
+        {
+            if (data->surface) window_surface_release( data->surface );
+            data->surface = NULL;
+        }
+        else if (data->surface) set_surface_layered( data->surface, 255, CLR_INVALID );
+    }
+    release_win_data( data );
+}
+
+
+/***********************************************************************
  *           ANDROID_SetWindowRgn
  */
 void CDECL ANDROID_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
@@ -993,6 +1038,24 @@ void CDECL ANDROID_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
 }
 
 
+/***********************************************************************
+ *	     ANDROID_SetLayeredWindowAttributes
+ */
+void CDECL ANDROID_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
+{
+    struct android_win_data *data;
+
+    if (!(flags & LWA_ALPHA)) alpha = 255;
+    if (!(flags & LWA_COLORKEY)) key = CLR_INVALID;
+
+    if ((data = get_win_data( hwnd )))
+    {
+        if (data->surface) set_surface_layered( data->surface, alpha, key );
+        release_win_data( data );
+    }
+}
+
+
 /**********************************************************************
  *           ANDROID_WindowMessage
  */
diff --git a/dlls/wineandroid.drv/wineandroid.drv.spec b/dlls/wineandroid.drv/wineandroid.drv.spec
index 766cc2c..8a6e72d 100644
--- a/dlls/wineandroid.drv/wineandroid.drv.spec
+++ b/dlls/wineandroid.drv/wineandroid.drv.spec
@@ -9,7 +9,9 @@
 @ cdecl CreateWindow(long) ANDROID_CreateWindow
 @ cdecl DestroyWindow(long) ANDROID_DestroyWindow
 @ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) ANDROID_MsgWaitForMultipleObjectsEx
+@ cdecl SetLayeredWindowAttributes(long long long long) ANDROID_SetLayeredWindowAttributes
 @ cdecl SetWindowRgn(long long long) ANDROID_SetWindowRgn
+@ cdecl SetWindowStyle(ptr long ptr) ANDROID_SetWindowStyle
 @ cdecl WindowMessage(long long long long) ANDROID_WindowMessage
 @ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) ANDROID_WindowPosChanging
 @ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) ANDROID_WindowPosChanged




More information about the wine-cvs mailing list