mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-24 12:21:34 +00:00
Update for windows system cursor processing
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/branches/gnustep_testplant_branch@36048 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3390d6a6b9
commit
9e3bd1f431
1 changed files with 41 additions and 37 deletions
|
@ -65,9 +65,6 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
#define CHANGE_GLOBAL_CURSORS
|
|
||||||
|
|
||||||
|
|
||||||
// Forward declarations...
|
// Forward declarations...
|
||||||
static unsigned int mask_for_keystate(BYTE *keyState);
|
static unsigned int mask_for_keystate(BYTE *keyState);
|
||||||
|
|
||||||
|
@ -128,26 +125,51 @@ void loadsystemcursors(void)
|
||||||
|
|
||||||
void setsystemcursors(HCURSOR cursorId)
|
void setsystemcursors(HCURSOR cursorId)
|
||||||
{
|
{
|
||||||
#if defined(CHANGE_GLOBAL_CURSORS)
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
SetSystemCursor(CopyCursor(cursorId), OCR_NORMAL);
|
if ([defaults objectForKey: @"GSDoesNotChangeSystemMouseCursors"] == NO)
|
||||||
SetSystemCursor(CopyCursor(cursorId), OCR_IBEAM);
|
{
|
||||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZEWE);
|
SetSystemCursor(CopyCursor(cursorId), OCR_NORMAL);
|
||||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENS);
|
SetSystemCursor(CopyCursor(cursorId), OCR_IBEAM);
|
||||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENESW);
|
SetSystemCursor(CopyCursor(cursorId), OCR_SIZEWE);
|
||||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENWSE);
|
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENS);
|
||||||
#endif
|
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENESW);
|
||||||
|
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENWSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void restoresystemcursors(void)
|
void restoresystemcursors(void)
|
||||||
{
|
{
|
||||||
#if defined(CHANGE_GLOBAL_CURSORS)
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
SetSystemCursor(CopyCursor(g_arrowCursorId), OCR_NORMAL);
|
if ([defaults objectForKey: @"GSDoesNotChangeSystemMouseCursors"] == NO)
|
||||||
SetSystemCursor(CopyCursor(g_ibeamCursorId), OCR_IBEAM);
|
{
|
||||||
SetSystemCursor(CopyCursor(g_sizeweCursorId), OCR_SIZEWE);
|
SetSystemCursor(CopyCursor(g_arrowCursorId), OCR_NORMAL);
|
||||||
SetSystemCursor(CopyCursor(g_sizensCursorId), OCR_SIZENS);
|
SetSystemCursor(CopyCursor(g_ibeamCursorId), OCR_IBEAM);
|
||||||
SetSystemCursor(CopyCursor(g_sizeneswCursorId), OCR_SIZENESW);
|
SetSystemCursor(CopyCursor(g_sizeweCursorId), OCR_SIZEWE);
|
||||||
SetSystemCursor(CopyCursor(g_sizenwseCursorId), OCR_SIZENWSE);
|
SetSystemCursor(CopyCursor(g_sizensCursorId), OCR_SIZENS);
|
||||||
#endif
|
SetSystemCursor(CopyCursor(g_sizeneswCursorId), OCR_SIZENESW);
|
||||||
|
SetSystemCursor(CopyCursor(g_sizenwseCursorId), OCR_SIZENWSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Need to capture the DLL instance handle....
|
||||||
|
BOOL WINAPI DllMain(HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
|
||||||
|
{
|
||||||
|
switch (dwReason)
|
||||||
|
{
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
// Save the DLL instance handle...
|
||||||
|
g_handleDLL = hinstDLL;
|
||||||
|
|
||||||
|
// Load system cursor resources for overriding system level cursors on
|
||||||
|
// capture and release mouse sequences...
|
||||||
|
loadsystemcursors();
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int istrackingmouse(void)
|
int istrackingmouse(void)
|
||||||
|
@ -542,20 +564,6 @@ BOOL CALLBACK LoadDisplayMonitorInfo(HMONITOR hMonitor,
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Need to capture the DLL instance handle....
|
|
||||||
BOOL WINAPI DllMain(HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
|
|
||||||
{
|
|
||||||
switch (dwReason)
|
|
||||||
{
|
|
||||||
case DLL_PROCESS_ATTACH:
|
|
||||||
g_handleDLL = hinstDLL;
|
|
||||||
break;
|
|
||||||
case DLL_PROCESS_DETACH:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) initWithAttributes: (NSDictionary *)info
|
- (id) initWithAttributes: (NSDictionary *)info
|
||||||
{
|
{
|
||||||
self = [super initWithAttributes: info];
|
self = [super initWithAttributes: info];
|
||||||
|
@ -565,10 +573,6 @@ BOOL WINAPI DllMain(HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
|
||||||
[self _initWin32Context];
|
[self _initWin32Context];
|
||||||
[super initWithAttributes: info];
|
[super initWithAttributes: info];
|
||||||
|
|
||||||
// Load system cursor resources for overriding system level cursors on
|
|
||||||
// capture and release mouse sequences...
|
|
||||||
loadsystemcursors();
|
|
||||||
|
|
||||||
systemCursors = RETAIN([NSMutableDictionary dictionary]);
|
systemCursors = RETAIN([NSMutableDictionary dictionary]);
|
||||||
monitorInfo = RETAIN([NSMutableArray array]);
|
monitorInfo = RETAIN([NSMutableArray array]);
|
||||||
EnumDisplayMonitors(NULL, NULL, (MONITORENUMPROC)LoadDisplayMonitorInfo, (LPARAM)monitorInfo);
|
EnumDisplayMonitors(NULL, NULL, (MONITORENUMPROC)LoadDisplayMonitorInfo, (LPARAM)monitorInfo);
|
||||||
|
|
Loading…
Reference in a new issue