* also distinguish between maximised and fullscreen on GHOST win32.
authorNathan Letwory <nathan@letworyinteractive.com>
Sun, 30 Dec 2007 23:09:33 +0000 (23:09 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Sun, 30 Dec 2007 23:09:33 +0000 (23:09 +0000)
* clean up some warnings (unused vars).

intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
source/blender/windowmanager/intern/wm_window.c

index fc8774f42985091cfdd71e063bdcc1bcd0a9e722..ce1eaf32101983e40fcf8ba374db570c75d3ef53 100644 (file)
@@ -225,7 +225,7 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
 GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const
 {
        POINT point;
 GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const
 {
        POINT point;
-       bool success = ::GetCursorPos(&point) == TRUE;
+       ::GetCursorPos(&point);
        x = point.x;
        y = point.y;
        return GHOST_kSuccess;
        x = point.x;
        y = point.y;
        return GHOST_kSuccess;
index 1931f5a6d5f733ad7266f8c75afef743f44dd475..81a6c89a433e23abaeb105c645165d5044746ecf 100644 (file)
@@ -145,7 +145,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
        }
        if (m_hWnd) {
                // Store a pointer to this class in the window structure
        }
        if (m_hWnd) {
                // Store a pointer to this class in the window structure
-               LONG result = ::SetWindowLongPtr(m_hWnd, GWL_USERDATA, (LONG)this);
+               ::SetWindowLongPtr(m_hWnd, GWL_USERDATA, (LONG_PTR)this);
 
                // Store the device context
                m_hDC = ::GetDC(m_hWnd);
 
                // Store the device context
                m_hDC = ::GetDC(m_hWnd);
@@ -373,7 +373,11 @@ GHOST_TWindowState GHOST_WindowWin32::getState() const
                state = GHOST_kWindowStateMinimized;
        }
        else if (::IsZoomed(m_hWnd)) {
                state = GHOST_kWindowStateMinimized;
        }
        else if (::IsZoomed(m_hWnd)) {
-               state = GHOST_kWindowStateMaximized;
+               LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
+               if((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE))
+                       state = GHOST_kWindowStateMaximized;
+               else
+                       state = GHOST_kWindowStateFullScreen;
        }
        else {
                state = GHOST_kWindowStateNormal;
        }
        else {
                state = GHOST_kWindowStateNormal;
@@ -622,7 +626,7 @@ void GHOST_WindowWin32::loadCursor(bool visible, GHOST_TStandardCursor cursor) c
                }
                
                if (success) {
                }
                
                if (success) {
-                       HCURSOR hCursor = ::SetCursor(::LoadCursor(0, id));
+                       ::SetCursor(::LoadCursor(0, id));
                }
        }
 }
                }
        }
 }
@@ -862,7 +866,7 @@ static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd) {
 static int EnumPixelFormats(HDC hdc) {
        int iPixelFormat;
        int i, n, w, weight = 0;
 static int EnumPixelFormats(HDC hdc) {
        int iPixelFormat;
        int i, n, w, weight = 0;
-       PIXELFORMATDESCRIPTOR pfd, pfd_fallback;
+       PIXELFORMATDESCRIPTOR pfd;
        
        /* we need a device context to do anything */
        if(!hdc) return 0;
        
        /* we need a device context to do anything */
        if(!hdc) return 0;
index 00364414342074e1d14cc08016572eddc3d4d7c3..07efa132a323fce4c9113c249da9e52475988cc7 100644 (file)
@@ -370,7 +370,7 @@ int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
                        case GHOST_kEventWindowMove: {
                                GHOST_RectangleHandle client_rect;
                                int l, t, r, b, scr_w, scr_h;
                        case GHOST_kEventWindowMove: {
                                GHOST_RectangleHandle client_rect;
                                int l, t, r, b, scr_w, scr_h;
-                int wl, wt, wr, wb;
+                               GHOST_TWindowState state;
                                
                                client_rect= GHOST_GetClientBounds(win->ghostwin);
                                GHOST_GetRectangle(client_rect, &l, &t, &r, &b);
                                
                                client_rect= GHOST_GetClientBounds(win->ghostwin);
                                GHOST_GetRectangle(client_rect, &l, &t, &r, &b);
@@ -385,6 +385,17 @@ int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
 
                                if(type!=GHOST_kEventWindowSize)
                                        printf("win move event pos %d %d size %d %d\n", win->posx, win->posy, win->sizex, win->sizey);
 
                                if(type!=GHOST_kEventWindowSize)
                                        printf("win move event pos %d %d size %d %d\n", win->posx, win->posy, win->sizex, win->sizey);
+
+                               state = GHOST_GetWindowState(win->ghostwin);
+
+                               /*if(state==GHOST_kWindowStateNormal)
+                                       printf("window state: normal\n");
+                               else if(state==GHOST_kWindowStateMinimized)
+                                       printf("window state: minimized\n");
+                               else if(state==GHOST_kWindowStateMaximized)
+                                       printf("window state: maximized\n");
+                               else if(state==GHOST_kWindowStateFullScreen)
+                                       printf("window state: fullscreen\n");*/
                                
 //                             window_handle(win, RESHAPE, 1);
                                break;
                                
 //                             window_handle(win, RESHAPE, 1);
                                break;