Made the windows backend compile again and new event polling.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@19917 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2004-08-24 18:53:39 +00:00
parent f4a23121d8
commit 92077fc8bb
3 changed files with 27 additions and 12 deletions

View file

@ -1,3 +1,11 @@
2004-08-24 Fred Kiefer <FredKiefer@gmx.de>
* Source/win32/WIN32Server.m (-windowbounds:): Corrected variable
name, so the fiel compiles again.
(-setupRunLoopInputSourcesForMode:): Added new event polling code
for Cygwin.
* Source/cairo/CairoContext.m (-NSReadPixel:, beep): Removed methods.
2004-08-23 Fred Kiefer <FredKiefer@gmx.de>
* Source/cairo/CairoContext.m (-DPScurrentalpha:,

View file

@ -109,17 +109,6 @@
/* FIXME */
}
- (NSColor *) NSReadPixel: (NSPoint)location
{
/* FIXME */
return nil;
}
- (void) beep
{
/* FIXME: Flash screen? */
}
+ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver
{
NSLog (@"expose");

View file

@ -92,6 +92,23 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
- (void) setupRunLoopInputSourcesForMode: (NSString*)mode
{
#ifdef __CYGWIN__
NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop];
int fdMessageQueue;
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
// Open a file descriptor for the windows message queue
fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
if (fdMessageQueue == -1)
{
NSLog(@"Failed opening %s\n", WIN_MSG_QUEUE_FNAME);
exit(1);
}
[currentRunLoop addEvent: (void*)fdMessageQueue
type: ET_RDESC
watcher: (id<RunLoopEvents>)self
forMode: mode];
#else
// FIXME
NSTimer *timer;
@ -101,6 +118,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
userInfo: nil
repeats: YES];
[[NSRunLoop currentRunLoop] addTimer: timer forMode: mode];
#endif
}
/**
@ -532,7 +550,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
- (NSRect) windowbounds: (int) winNum
{
RECT r;
NSWindow *window = GSWindowWithNumber((int)hwnd);
NSWindow *window = GSWindowWithNumber(winNum);
GetWindowRect((HWND)winNum, &r);
return MSScreenRectToGS(r, [window styleMask], self);