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>
|
||||
|
||||
|
||||
#define CHANGE_GLOBAL_CURSORS
|
||||
|
||||
|
||||
// Forward declarations...
|
||||
static unsigned int mask_for_keystate(BYTE *keyState);
|
||||
|
||||
|
@ -128,26 +125,51 @@ void loadsystemcursors(void)
|
|||
|
||||
void setsystemcursors(HCURSOR cursorId)
|
||||
{
|
||||
#if defined(CHANGE_GLOBAL_CURSORS)
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
if ([defaults objectForKey: @"GSDoesNotChangeSystemMouseCursors"] == NO)
|
||||
{
|
||||
SetSystemCursor(CopyCursor(cursorId), OCR_NORMAL);
|
||||
SetSystemCursor(CopyCursor(cursorId), OCR_IBEAM);
|
||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZEWE);
|
||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENS);
|
||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENESW);
|
||||
SetSystemCursor(CopyCursor(cursorId), OCR_SIZENWSE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void restoresystemcursors(void)
|
||||
{
|
||||
#if defined(CHANGE_GLOBAL_CURSORS)
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
if ([defaults objectForKey: @"GSDoesNotChangeSystemMouseCursors"] == NO)
|
||||
{
|
||||
SetSystemCursor(CopyCursor(g_arrowCursorId), OCR_NORMAL);
|
||||
SetSystemCursor(CopyCursor(g_ibeamCursorId), OCR_IBEAM);
|
||||
SetSystemCursor(CopyCursor(g_sizeweCursorId), OCR_SIZEWE);
|
||||
SetSystemCursor(CopyCursor(g_sizensCursorId), OCR_SIZENS);
|
||||
SetSystemCursor(CopyCursor(g_sizeneswCursorId), OCR_SIZENESW);
|
||||
SetSystemCursor(CopyCursor(g_sizenwseCursorId), OCR_SIZENWSE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
@ -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
|
||||
{
|
||||
self = [super initWithAttributes: info];
|
||||
|
@ -565,10 +573,6 @@ BOOL WINAPI DllMain(HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
|
|||
[self _initWin32Context];
|
||||
[super initWithAttributes: info];
|
||||
|
||||
// Load system cursor resources for overriding system level cursors on
|
||||
// capture and release mouse sequences...
|
||||
loadsystemcursors();
|
||||
|
||||
systemCursors = RETAIN([NSMutableDictionary dictionary]);
|
||||
monitorInfo = RETAIN([NSMutableArray array]);
|
||||
EnumDisplayMonitors(NULL, NULL, (MONITORENUMPROC)LoadDisplayMonitorInfo, (LPARAM)monitorInfo);
|
||||
|
|
Loading…
Reference in a new issue