mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 15:31:14 +00:00
change calls from getWindowLong to getWindowLongPtr for 64bit compatibility
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/branches/gnustep_testplant_branch@40146 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
66866885ef
commit
71864f8dea
9 changed files with 62 additions and 50 deletions
|
@ -47,7 +47,7 @@
|
|||
gsDevice = device;
|
||||
_surface = NULL;
|
||||
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(device, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr(device, GWLP_USERDATA);
|
||||
HDC hDC = GetDC(device);
|
||||
|
||||
if (hDC == NULL)
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
// Whenever this restriction is lifted, we can get rid of it here as well.
|
||||
#if __has_feature(objc_default_synthesize_properties)
|
||||
|
||||
#include <windows.h>
|
||||
#include <GNUstepBase/GSConfig.h>
|
||||
#include <windows.h>
|
||||
|
||||
// C++ header includes...
|
||||
#include <string>
|
||||
|
|
|
@ -49,7 +49,10 @@
|
|||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <ShellAPI.h>
|
||||
#define CINTERFACE
|
||||
#define interface struct
|
||||
#include <shlwapi.h>
|
||||
#undef interface
|
||||
#include <gdiplus/gdiplus.h>
|
||||
|
||||
#include <iostream>
|
||||
|
@ -335,7 +338,7 @@ static NSString * const kButtonActionKey = @"show";
|
|||
{
|
||||
NSLog(@"%s:UUIDString: %@", __PRETTY_FUNCTION__, uuidString);
|
||||
GUID theGUID = { 0 };
|
||||
NSUInteger value = 0;
|
||||
unsigned int value = 0;
|
||||
NSArray *components = [uuidString componentsSeparatedByString: @"-"];
|
||||
NSScanner *scanner1 = [NSScanner scannerWithString: [components objectAtIndex: 0]];
|
||||
NSScanner *scanner2 = [NSScanner scannerWithString: [components objectAtIndex: 1]];
|
||||
|
@ -343,10 +346,10 @@ static NSString * const kButtonActionKey = @"show";
|
|||
NSString *data4 = [[components objectAtIndex: 3] stringByAppendingString: [components objectAtIndex: 4]];
|
||||
NSScanner *scanner4 = [NSScanner scannerWithString: data4];
|
||||
|
||||
[scanner1 scanHexInt: (NSUInteger*)&theGUID.Data1];
|
||||
[scanner2 scanHexInt: (NSUInteger*)&value];
|
||||
[scanner1 scanHexInt: (unsigned int*)&theGUID.Data1];
|
||||
[scanner2 scanHexInt: &value];
|
||||
theGUID.Data2 = (WORD) value;
|
||||
[scanner3 scanHexInt: (NSUInteger*)&value];
|
||||
[scanner3 scanHexInt: &value];
|
||||
theGUID.Data3 = (WORD) value;
|
||||
|
||||
return theGUID;
|
||||
|
|
|
@ -23,7 +23,10 @@
|
|||
#include <Foundation/NSValue.h>
|
||||
|
||||
#include <ShellAPI.h>
|
||||
#define CINTERFACE
|
||||
#define interface struct
|
||||
#include <shlwapi.h>
|
||||
#undef interface
|
||||
//#include <Winuser.h>
|
||||
#include <rpcdce.h>
|
||||
|
||||
|
@ -46,6 +49,12 @@
|
|||
#if !defined(NIN_BALLOONUSERCLICK)
|
||||
#define NIN_BALLOONUSERCLICK (WM_USER + 5)
|
||||
#endif
|
||||
#if !defined(NIN_POPUPOPEN)
|
||||
#define NIN_POPUPOPEN (WM_USER + 6)
|
||||
#endif
|
||||
#if !defined(NIN_POPUPCLOSE)
|
||||
#define NIN_POPUPCLOSE (WM_USER + 7)
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_DLL
|
||||
#define EXPORT __declspec(dllexport)
|
||||
|
@ -767,11 +776,11 @@ GUID guidFromUUIDString(NSString *uuidString)
|
|||
NSString *data4 = [[components objectAtIndex: 3] stringByAppendingString: [components objectAtIndex: 4]];
|
||||
NSScanner *scanner4 = [NSScanner scannerWithString: data4];
|
||||
|
||||
NSUInteger value;
|
||||
[scanner1 scanHexInt: (NSUInteger*)&theGUID.Data1];
|
||||
[scanner2 scanHexInt: (NSUInteger*)&value];
|
||||
unsigned int value;
|
||||
[scanner1 scanHexInt: (unsigned int*)&theGUID.Data1];
|
||||
[scanner2 scanHexInt: &value];
|
||||
theGUID.Data2 = (WORD) value;
|
||||
[scanner3 scanHexInt: (NSUInteger*)&value];
|
||||
[scanner3 scanHexInt: &value];
|
||||
theGUID.Data3 = (WORD) value;
|
||||
|
||||
return theGUID;
|
||||
|
|
|
@ -1030,7 +1030,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
- (void) resizeBackingStoreFor: (HWND)hwnd
|
||||
{
|
||||
#if (BUILD_GRAPHICS==GRAPHICS_winlib)
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong((HWND)hwnd, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)hwnd, GWLP_USERDATA);
|
||||
|
||||
// FIXME: We should check if the size really did change.
|
||||
if (win->useHDC)
|
||||
|
@ -2121,8 +2121,8 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
// Borderless window request...
|
||||
if (wstyle & WS_POPUP)
|
||||
{
|
||||
LONG wstyleOld = GetWindowLong(hwnd, GWL_STYLE);
|
||||
LONG estyleOld = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
LONG wstyleOld = GetWindowLongPtr(hwnd, GWL_STYLE);
|
||||
LONG estyleOld = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
|
||||
LONG wstyleNew = (wstyleOld & ~WS_OVERLAPPEDWINDOW);
|
||||
LONG estyleNew = estyleOld | WS_EX_TOOLWINDOW;
|
||||
|
||||
|
@ -2132,8 +2132,8 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
estyleOld, estyleNew);
|
||||
|
||||
// Modify window style parameters and update the window information...
|
||||
SetWindowLong(hwnd, GWL_STYLE, wstyleNew);
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, estyleNew);
|
||||
SetWindowLongPtr(hwnd, GWL_STYLE, wstyleNew);
|
||||
SetWindowLongPtr(hwnd, GWL_EXSTYLE, estyleNew);
|
||||
SetWindowPos(hwnd, NULL, 0, 0, 0, 0,
|
||||
SWP_FRAMECHANGED | SWP_NOSENDCHANGING | SWP_NOREPOSITION |
|
||||
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||
|
@ -2164,8 +2164,8 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
@"-stylewindow: : called when [self handlesWindowDecorations] == NO");
|
||||
|
||||
NSDebugLLog(@"WTrace", @"stylewindow: %d : %d", style, winNum);
|
||||
SetWindowLong((HWND)winNum, GWL_STYLE, wstyle);
|
||||
SetWindowLong((HWND)winNum, GWL_EXSTYLE, estyle);
|
||||
SetWindowLongPtr((HWND)winNum, GWL_STYLE, wstyle);
|
||||
SetWindowLongPtr((HWND)winNum, GWL_EXSTYLE, estyle);
|
||||
}
|
||||
|
||||
- (void) setbackgroundcolor: (NSColor *)color : (int)win
|
||||
|
@ -2175,7 +2175,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
/** Changes window's the backing store to type */
|
||||
- (void) windowbacking: (NSBackingStoreType)type : (int) winNum
|
||||
{
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong((HWND)winNum, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA);
|
||||
|
||||
NSDebugLLog(@"WTrace", @"windowbacking: %d : %d", type, winNum);
|
||||
#if (BUILD_GRAPHICS==GRAPHICS_winlib)
|
||||
|
@ -2288,7 +2288,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
|
||||
if (op == NSWindowOut)
|
||||
{
|
||||
SetWindowLong((HWND)winNum, OFF_ORDERED, 0);
|
||||
SetWindowLongPtr((HWND)winNum, OFF_ORDERED, 0);
|
||||
ShowWindow((HWND)winNum, SW_HIDE);
|
||||
return;
|
||||
}
|
||||
|
@ -2306,10 +2306,10 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
}
|
||||
|
||||
ShowWindow((HWND)winNum, flag);
|
||||
SetWindowLong((HWND)winNum, OFF_ORDERED, 1);
|
||||
SetWindowLongPtr((HWND)winNum, OFF_ORDERED, 1);
|
||||
|
||||
// Process window leveling...
|
||||
level = GetWindowLong((HWND)winNum, OFF_LEVEL);
|
||||
level = GetWindowLongPtr((HWND)winNum, OFF_LEVEL);
|
||||
|
||||
if (otherWin <= 0)
|
||||
{
|
||||
|
@ -2334,14 +2334,14 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
/* Put this on the same window level as the window we are ordering
|
||||
* it against.
|
||||
*/
|
||||
otherLevel = GetWindowLong((HWND)otherWin, OFF_LEVEL);
|
||||
otherLevel = GetWindowLongPtr((HWND)otherWin, OFF_LEVEL);
|
||||
if (level != otherLevel)
|
||||
{
|
||||
NSDebugLLog(@"WTrace",
|
||||
@"orderwindow: implicitly set level of %d (%d) to that of %d (%d)",
|
||||
winNum, level, otherWin, otherLevel);
|
||||
level = otherLevel;
|
||||
SetWindowLong((HWND)winNum, OFF_LEVEL, level);
|
||||
SetWindowLongPtr((HWND)winNum, OFF_LEVEL, level);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2388,9 +2388,9 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
&& GetClassName((HWND)otherWin, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0)
|
||||
{
|
||||
if (GetWindowLong((HWND)otherWin, OFF_ORDERED) == 1)
|
||||
if (GetWindowLongPtr((HWND)otherWin, OFF_ORDERED) == 1)
|
||||
{
|
||||
otherLevel = GetWindowLong((HWND)otherWin, OFF_LEVEL);
|
||||
otherLevel = GetWindowLongPtr((HWND)otherWin, OFF_LEVEL);
|
||||
NSDebugLLog(@"WTrace", @"orderwindow: found gnustep window %d (%d)",
|
||||
otherWin, otherLevel);
|
||||
if (otherLevel >= level)
|
||||
|
@ -2471,9 +2471,9 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
&& GetClassName((HWND)otherWin, buf, 32) == 18
|
||||
&& strncmp(buf, "GNUstepWindowClass", 18) == 0)
|
||||
{
|
||||
if (GetWindowLong((HWND)otherWin, OFF_ORDERED) == 1)
|
||||
if (GetWindowLongPtr((HWND)otherWin, OFF_ORDERED) == 1)
|
||||
{
|
||||
otherLevel = GetWindowLong((HWND)otherWin, OFF_LEVEL);
|
||||
otherLevel = GetWindowLongPtr((HWND)otherWin, OFF_LEVEL);
|
||||
s = [s stringByAppendingFormat:
|
||||
@"%d (%d)\n", otherWin, otherLevel];
|
||||
}
|
||||
|
@ -2510,7 +2510,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
|
||||
|
||||
#if (BUILD_GRAPHICS==GRAPHICS_winlib)
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong((HWND)winNum, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA);
|
||||
|
||||
if ((win->useHDC)
|
||||
&& (r.right - r.left != r2.right - r2.left)
|
||||
|
@ -2555,10 +2555,10 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
- (void) setwindowlevel: (int) level : (int) winNum
|
||||
{
|
||||
NSDebugLLog(@"WTrace", @"setwindowlevel: %d : %d", level, winNum);
|
||||
if (GetWindowLong((HWND)winNum, OFF_LEVEL) != level)
|
||||
if (GetWindowLongPtr((HWND)winNum, OFF_LEVEL) != level)
|
||||
{
|
||||
SetWindowLong((HWND)winNum, OFF_LEVEL, level);
|
||||
if (GetWindowLong((HWND)winNum, OFF_ORDERED) == YES)
|
||||
SetWindowLongPtr((HWND)winNum, OFF_LEVEL, level);
|
||||
if (GetWindowLongPtr((HWND)winNum, OFF_ORDERED) == YES)
|
||||
{
|
||||
[self orderwindow: NSWindowAbove : 0 : winNum];
|
||||
}
|
||||
|
@ -2567,7 +2567,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
|
||||
- (int) windowlevel: (int) winNum
|
||||
{
|
||||
return GetWindowLong((HWND)winNum, OFF_LEVEL);
|
||||
return GetWindowLongPtr((HWND)winNum, OFF_LEVEL);
|
||||
}
|
||||
|
||||
- (NSArray *) windowlist
|
||||
|
@ -2615,7 +2615,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
/** Set the maximum size of the window */
|
||||
- (void) setmaxsize: (NSSize)size : (int) winNum
|
||||
{
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong((HWND)winNum, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA);
|
||||
POINT p;
|
||||
|
||||
p.x = size.width;
|
||||
|
@ -2625,20 +2625,20 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
// Disable the maximize box if a maximum size is set
|
||||
if (size.width < 10000 || size.height < 10000)
|
||||
{
|
||||
SetWindowLong((HWND)winNum, GWL_STYLE,
|
||||
GetWindowLong((HWND)winNum, GWL_STYLE) ^ WS_MAXIMIZEBOX);
|
||||
SetWindowLongPtr((HWND)winNum, GWL_STYLE,
|
||||
GetWindowLongPtr((HWND)winNum, GWL_STYLE) ^ WS_MAXIMIZEBOX);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLong((HWND)winNum, GWL_STYLE,
|
||||
GetWindowLong((HWND)winNum, GWL_STYLE) | WS_MAXIMIZEBOX);
|
||||
SetWindowLongPtr((HWND)winNum, GWL_STYLE,
|
||||
GetWindowLongPtr((HWND)winNum, GWL_STYLE) | WS_MAXIMIZEBOX);
|
||||
}
|
||||
}
|
||||
|
||||
/** Set the minimum size of the window */
|
||||
- (void) setminsize: (NSSize)size : (int) winNum
|
||||
{
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong((HWND)winNum, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA);
|
||||
POINT p;
|
||||
|
||||
p.x = size.width;
|
||||
|
@ -2654,7 +2654,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
- (void) flushwindowrect: (NSRect)rect : (int)winNum
|
||||
{
|
||||
HWND hwnd = (HWND)winNum;
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(hwnd, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||
|
||||
if (win)
|
||||
{
|
||||
|
@ -2761,15 +2761,15 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
{
|
||||
if (alpha > 0.99)
|
||||
{
|
||||
SetWindowLong((HWND)win, GWL_EXSTYLE,
|
||||
GetWindowLong((HWND)win, GWL_EXSTYLE) & ~WS_EX_LAYERED);
|
||||
SetWindowLongPtr((HWND)win, GWL_EXSTYLE,
|
||||
GetWindowLongPtr((HWND)win, GWL_EXSTYLE) & ~WS_EX_LAYERED);
|
||||
RedrawWindow((HWND)win, NULL, NULL,
|
||||
RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLong((HWND)win, GWL_EXSTYLE,
|
||||
GetWindowLong((HWND)win, GWL_EXSTYLE) | WS_EX_LAYERED);
|
||||
SetWindowLongPtr((HWND)win, GWL_EXSTYLE,
|
||||
GetWindowLongPtr((HWND)win, GWL_EXSTYLE) | WS_EX_LAYERED);
|
||||
SetLayeredWindowAttributes((HWND)win, 0, 255 * alpha, LWA_ALPHA);
|
||||
}
|
||||
}
|
||||
|
@ -3058,15 +3058,15 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
|
||||
- (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win
|
||||
{
|
||||
int extendedStyle = GetWindowLong((HWND)win, GWL_EXSTYLE);
|
||||
int extendedStyle = GetWindowLongPtr((HWND)win, GWL_EXSTYLE);
|
||||
|
||||
if (ignoreMouse)
|
||||
{
|
||||
SetWindowLong((HWND)win, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
|
||||
SetWindowLongPtr((HWND)win, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLong((HWND)win, GWL_EXSTYLE, extendedStyle & ~WS_EX_TRANSPARENT);
|
||||
SetWindowLongPtr((HWND)win, GWL_EXSTYLE, extendedStyle & ~WS_EX_TRANSPARENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
win->useHDC = NO;
|
||||
|
||||
// Save win internals structure pointer for window handle...
|
||||
SetWindowLong(hwnd, GWL_USERDATA, (int)win);
|
||||
SetWindowLongPtr(hwnd, GWLP_USERDATA, (int)win);
|
||||
SetWindowLongPtr(hwnd, IME_INFO, (LONG)ime);
|
||||
|
||||
[self windowbacking: type : (int)hwnd];
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
|
||||
- (void) decodeWM_DESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
|
||||
{
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(hwnd, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||
|
||||
// Clean up window-specific data objects.
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@
|
|||
|
||||
- (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
|
||||
{
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(hwnd, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||
MINMAXINFO *mm;
|
||||
|
||||
if (win != NULL)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
static void
|
||||
invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
|
||||
{
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong((HWND)hwnd, GWL_USERDATA);
|
||||
WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)hwnd, GWLP_USERDATA);
|
||||
|
||||
if (!win->useHDC || win->backingStoreEmpty)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue