From 9a0c1eb2283305fc13ddc6ba4399e266eed9e04e Mon Sep 17 00:00:00 2001 From: Eli Gottlieb Date: Fri, 9 Jul 2010 20:24:44 -0400 Subject: [PATCH] Put in a couple of fixes that I realized hadn't gotten done when I wrote out the SCRUM stuff in TODO. Added SCRUM listings in TODO. --- TODO | 22 ++++++++++++++++++++++ src/video/win32/SDL_win32events.c | 2 ++ src/video/win32/SDL_win32video.c | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/TODO b/TODO index f310ce227..f7ffa6b94 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,25 @@ +Eli Gottlieb's checklist for the GSOC shaped windows project. Dated July 9, 2010. +1. Enable proper linking of the X11 implementation and test it. +--> Find the place in the build system for platform-specific linking flags. STATUS: BLOODY IMPOSSIBLE. +--> Add a linker flag to bring in libXext.a. STATUS: WILL BE SIMPLE ONCE PREVIOUS STEP IS ACCOMPLISHED (kshemashiach yagia). +2. Build the Win32 implementation of shaped-windows functionality. +--> Add driver functions to the SDL_ShapeDriver in the Win32 driver's SDL_DisplayDevice at the proper point in the code. STATUS: CHECK. +--> Add a hook in the Windows resize-window code to call Win32_ResizeWindowShape(). STATUS: CHECK. +3. Enable building the testeyes program. +--> Reprogram it to use the latest shaped-windows API. STATUS: CHECK. +--> Get it, along with the rest of the test suite in my branch, building successfully. STATUS: REQUIRES X11 IMPLEMENTATION TO LINK PROPERLY AND/OR A BUILD-BUDDY BUILDING AND RUNNING THE TEST FOR ME. +--> Debug testeyes and the platform-specific shaped-window implementations in tandem. STATUS: TO BEGIN, CURRENT SPRINT. +4. Implement the SDL shaped-windows API for Mac OS X using Cocoa. STATUS: NEXT SPRINT. +--> Locate (once more) the API documentation for shaped windows under Cocoa. +--> Design and encode a version of SDL_ShapeData for Cocoa. +--> Write Cocoa_CreateShaper(). +--> Write Cocoa_ResizeWindowShape(). +--> Write Cocoa_SetWindowShape(). +--> If necessary, implement functionality adjunct to SDL_CalculateShapeBitmap() for Cocoa usage. +5. Use testeyes to debug all implementations. STATUS: SPRINT + 2. +--> Debug Cocoa implementation. +--> Debug Win32 implementation. +--> Debug X11 implementation (again). 1.3 release checklist: * http://wiki.libsdl.org/moin.cgi/Roadmap diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index df4a3b722..7a920be45 100644 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -492,6 +492,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) BOOL menu; /* If we allow resizing, let the resize happen naturally */ + if(SDL_IsShapedWindow(data->window)) + SDL_ResizeWindowShape(data->window); if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) { returnCode = 0; break; diff --git a/src/video/win32/SDL_win32video.c b/src/video/win32/SDL_win32video.c index 1ee4f64b2..4e7dc3f5b 100644 --- a/src/video/win32/SDL_win32video.c +++ b/src/video/win32/SDL_win32video.c @@ -28,6 +28,7 @@ #include "../SDL_pixels_c.h" #include "SDL_win32video.h" +#include "SDL_win32shape.h" #include "SDL_d3drender.h" #include "SDL_gdirender.h" @@ -183,6 +184,11 @@ WIN_CreateDevice(int devindex) device->SetWindowGrab = WIN_SetWindowGrab; device->DestroyWindow = WIN_DestroyWindow; device->GetWindowWMInfo = WIN_GetWindowWMInfo; + + device->shape_driver.CreateShaper = Win32_CreateShaper; + device->shape_driver.SetWindowShape = Win32_SetWindowShape; + device->shape_driver.ResizeWindowShape = Win32_ResizeWindowShape; + #ifdef SDL_VIDEO_OPENGL_WGL device->GL_LoadLibrary = WIN_GL_LoadLibrary; device->GL_GetProcAddress = WIN_GL_GetProcAddress;