mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Apply modified patch to support windows native event handling
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20785 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
657e38c038
commit
813f640a49
24 changed files with 2735 additions and 1640 deletions
45
Source/win32/NSRunLoopWin32.m
Normal file
45
Source/win32/NSRunLoopWin32.m
Normal file
|
@ -0,0 +1,45 @@
|
|||
#include "config.h"
|
||||
#include "GNUstepBase/preface.h"
|
||||
#include "Foundation/NSRunLoop.h"
|
||||
#include "GNUstepBase/GSRunLoopCtxt.h"
|
||||
|
||||
@implementation NSRunLoop (mingw32)
|
||||
/**
|
||||
* Adds a target to the loop in the specified mode for the
|
||||
* win32 messages.<br />
|
||||
* Only a target+selector is added in one mode. Successive
|
||||
* calls overwrite the previous.<br />
|
||||
*/
|
||||
- (void) addMsgTarget: (id)target
|
||||
withMethod: (SEL)selector
|
||||
forMode: (NSString*)mode
|
||||
{
|
||||
GSRunLoopCtxt *context;
|
||||
|
||||
context = NSMapGet(_contextMap, mode);
|
||||
if (context == nil)
|
||||
{
|
||||
context = [[GSRunLoopCtxt alloc] initWithMode: mode extra: _extra];
|
||||
NSMapInsert(_contextMap, context->mode, context);
|
||||
RELEASE(context);
|
||||
}
|
||||
context->msgTarget = target;
|
||||
context->msgSelector = selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the target of the loop in the specified mode for the
|
||||
* win32 messages.<br />
|
||||
*/
|
||||
- (void) removeMsgForMode: (NSString*)mode
|
||||
{
|
||||
GSRunLoopCtxt *context;
|
||||
|
||||
context = NSMapGet(_contextMap, mode);
|
||||
if (context == nil)
|
||||
{
|
||||
return;
|
||||
}
|
||||
context->msgTarget = nil;
|
||||
}
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue