Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
/*
|
|
|
|
* Message queues related functions
|
|
|
|
*
|
|
|
|
* Copyright 1993 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This code assumes that there is only one Windows task (hence
|
|
|
|
* one message queue).
|
|
|
|
*/
|
|
|
|
|
|
|
|
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
|
|
|
|
|
1993-09-04 12:09:32 +02:00
|
|
|
#include <stdlib.h>
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
|
Release 0.4.0
Mon Sep 13 05:00:11 1993 Eric Youngdale
* [Makefile] [if1632/relay.c] [include/dlls.h] [selector.c]
[loader/wine.c] [tools/build.c]
Added ability to generate missing functions statistics.
Mon Sep 13 12:09:47 1993 Scott A. Laird (scott@curly)
* [WIN31-APPLETS]
Added new file.
* [if1632/kernel.spec]
Added definitions for GetProfile{Int,String} and SetHandleCount.
* [if1632/keyboard.spec]
Created interface specification for Keyboard driver DLL.
* [if1632/relay.c]
Added keyboard.dll to list of included DLLs.
* [if1632/user.spec]
Added LoadAccelerators definition.
* [loader/resource.c]
Added LoadAccelerators stub.
* [misc/file.c]
Changed OpenFile, and added SetHandleCount (for winfile.exe)
* [misc/keyboard.c]
Added keyboard code.
* [misc/profile.c] [misc/xt.c]
Moved GetPrivateProfile* commands here, and added GetProfile*
commands.
Mon Sep 13 10:24:37 1993 Andrew Bulhak
* [windows/utility.c]
Implemented MulDiv(), OutputDebugString() and wvsprintf()
Fri Sep 10 09:13:30 1993 John Brezak
* [*/Makefile]
Created patch to allow BSD make to build wine.
* [windows/win.c]
Fixed NULL pointer reference.
* [windows/message.c] [misc/xt.c]
Defined HZ to handle system specific timing.
* [windows/graphics.c]
Use M_PI is PI
* [objects/pallete.c]
NetBSD does not have /usr/include/values.h and MAXINT is INT_MAX.
* [dump.c] [ldt.c] [wine.c]
ifdef'ed linux headers for linux compile.
* [loader/ldtlib.c]
Add NetBSD system calls when compiled on that system.
* [loader/selector.c]
Use mmap(MAP_ANON, ...) for NetBSD.
* [if1632/call.S]
Fixed selector assumptions.
Thu Sep 9 20:01:37 1993 David Metcalfe
* [controls/WinButton*] [controls/button.c] [controls/widget.c]
[windows/win.c] [windows/class.c]
Added 3D button control and tied into CreateWindow()
Thu Sep 9 07:35:24 1993 Scott Laird
* [if1632/sound.spec]
Created interface specification for SOUND DLL.
* [if1632/win87em.spec]
Added more functions to the WIN87EM DLL interface specification
* [misc/emulate.c]
Created stubs for the new math emulation functions.
* [misc/sound.c]
Created stubs for the SOUND DLL.
Sun Sep 5 21:02:10 1993 John Burton
* [if1632/kernel.spec]
Added interface specifications for OpenFile, _lclose, _lread, _lopen,
and _lwrite.
* [include/windows.h]
Added OF_ macros
* [misc/file.c]
Implemented OpenFile, _lclose, _lread, _lopen and _lwrite.
Fri Sep 3 18:47:03 1993 Alexandre Julliard
* [windows/dc.c]
Bug fix
* [objects/text.c]
Bug fix
Fri Sep 3 18:47:03 1993 Bob Amstadt
* [objects/linedda.c]
Finished LineDDA().
1993-09-14 18:47:10 +02:00
|
|
|
#ifdef __NetBSD__
|
|
|
|
#define HZ 100
|
|
|
|
#endif
|
|
|
|
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
#include "message.h"
|
|
|
|
#include "win.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define MAX_QUEUE_SIZE 120 /* Max. size of a message queue */
|
|
|
|
|
1993-09-04 12:09:32 +02:00
|
|
|
extern HWND WIN_FindWinToRepaint( HWND hwnd );
|
|
|
|
|
|
|
|
extern Display * XT_display;
|
|
|
|
extern Screen * XT_screen;
|
|
|
|
extern XtAppContext XT_app_context;
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
|
|
|
|
static MESSAGEQUEUE * msgQueue = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MSG_GetMessageType
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int MSG_GetMessageType( int msg )
|
|
|
|
{
|
|
|
|
if ((msg >= WM_KEYFIRST) && (msg <= WM_KEYLAST)) return QS_KEY;
|
|
|
|
else if ((msg >= WM_MOUSEFIRST) && (msg <= WM_MOUSELAST))
|
|
|
|
{
|
|
|
|
if (msg == WM_MOUSEMOVE) return QS_MOUSEMOVE;
|
|
|
|
else return QS_MOUSEBUTTON;
|
|
|
|
}
|
|
|
|
else if (msg == WM_PAINT) return QS_PAINT;
|
|
|
|
else if (msg == WM_TIMER) return QS_TIMER;
|
|
|
|
return QS_POSTMESSAGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MSG_AddMsg
|
|
|
|
*
|
|
|
|
* Add a message to the queue. Return FALSE if queue is full.
|
|
|
|
*/
|
|
|
|
int MSG_AddMsg( MSG * msg, DWORD extraInfo )
|
|
|
|
{
|
|
|
|
int pos, type;
|
|
|
|
|
|
|
|
if (!msgQueue) return FALSE;
|
|
|
|
pos = msgQueue->nextFreeMessage;
|
|
|
|
|
|
|
|
/* No need to store WM_PAINT messages */
|
1993-09-04 12:09:32 +02:00
|
|
|
if (msg->message == WM_PAINT) return TRUE;
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
|
|
|
|
/* Check if queue is full */
|
|
|
|
if ((pos == msgQueue->nextMessage) && (msgQueue->msgCount > 0))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Store message */
|
|
|
|
msgQueue->messages[pos].msg = *msg;
|
|
|
|
msgQueue->messages[pos].extraInfo = extraInfo;
|
|
|
|
|
|
|
|
/* Store message type */
|
|
|
|
type = MSG_GetMessageType( msg->message );
|
|
|
|
msgQueue->status |= type;
|
|
|
|
msgQueue->tempStatus |= type;
|
|
|
|
|
|
|
|
if (pos < msgQueue->queueSize-1) pos++;
|
|
|
|
else pos = 0;
|
|
|
|
msgQueue->nextFreeMessage = pos;
|
|
|
|
msgQueue->msgCount++;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MSG_FindMsg
|
|
|
|
*
|
|
|
|
* Find a message matching the given parameters. Return -1 if none available.
|
|
|
|
*/
|
|
|
|
int MSG_FindMsg( HWND hwnd, int first, int last )
|
|
|
|
{
|
|
|
|
int i, pos = msgQueue->nextMessage;
|
|
|
|
|
|
|
|
if (!msgQueue->msgCount) return -1;
|
|
|
|
if (!hwnd && !first && !last) return pos;
|
|
|
|
|
|
|
|
for (i = 0; i < msgQueue->msgCount; i++)
|
|
|
|
{
|
|
|
|
MSG * msg = &msgQueue->messages[pos].msg;
|
|
|
|
|
|
|
|
if (!hwnd || (msg->hwnd == hwnd))
|
|
|
|
{
|
|
|
|
if (!first && !last) return pos;
|
|
|
|
if ((msg->message >= first) && (msg->message <= last)) return pos;
|
|
|
|
}
|
|
|
|
if (pos < msgQueue->queueSize-1) pos++;
|
|
|
|
else pos = 0;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MSG_RemoveMsg
|
|
|
|
*
|
|
|
|
* Remove a message from the queue (pos must be a valid position).
|
|
|
|
*/
|
|
|
|
void MSG_RemoveMsg( int pos )
|
|
|
|
{
|
1993-09-04 12:09:32 +02:00
|
|
|
int i, type;
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
QMSG * qmsg;
|
|
|
|
|
|
|
|
if (!msgQueue) return;
|
|
|
|
qmsg = &msgQueue->messages[pos];
|
|
|
|
|
|
|
|
if (pos >= msgQueue->nextMessage)
|
|
|
|
{
|
|
|
|
int count = pos - msgQueue->nextMessage;
|
|
|
|
if (count) memmove( &msgQueue->messages[msgQueue->nextMessage+1],
|
|
|
|
&msgQueue->messages[msgQueue->nextMessage],
|
|
|
|
count * sizeof(QMSG) );
|
|
|
|
msgQueue->nextMessage++;
|
|
|
|
if (msgQueue->nextMessage >= msgQueue->queueSize)
|
|
|
|
msgQueue->nextMessage = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int count = msgQueue->nextFreeMessage - pos;
|
|
|
|
if (count) memmove( &msgQueue->messages[pos],
|
|
|
|
&msgQueue->messages[pos+1], count * sizeof(QMSG) );
|
|
|
|
if (msgQueue->nextFreeMessage) msgQueue->nextFreeMessage--;
|
|
|
|
else msgQueue->nextFreeMessage = msgQueue->queueSize-1;
|
|
|
|
}
|
|
|
|
msgQueue->msgCount--;
|
|
|
|
|
|
|
|
/* Recalc status */
|
|
|
|
type = 0;
|
|
|
|
pos = msgQueue->nextMessage;
|
|
|
|
for (i = 0; i < msgQueue->msgCount; i++)
|
|
|
|
{
|
|
|
|
type |= MSG_GetMessageType( msgQueue->messages[pos].msg.message );
|
|
|
|
if (++pos >= msgQueue->queueSize-1) pos = 0;
|
|
|
|
}
|
1993-09-04 12:09:32 +02:00
|
|
|
msgQueue->status = (msgQueue->status & QS_SENDMESSAGE) | type;
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
msgQueue->tempStatus = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SetMessageQueue (USER.266)
|
|
|
|
*/
|
|
|
|
BOOL SetMessageQueue( int size )
|
|
|
|
{
|
|
|
|
int queueSize;
|
|
|
|
|
|
|
|
/* Free the old message queue */
|
|
|
|
if (msgQueue) free(msgQueue);
|
|
|
|
|
|
|
|
if ((size > MAX_QUEUE_SIZE) || (size <= 0)) return FALSE;
|
|
|
|
|
|
|
|
queueSize = sizeof(MESSAGEQUEUE) + size * sizeof(QMSG);
|
|
|
|
msgQueue = (MESSAGEQUEUE *) malloc(queueSize);
|
|
|
|
if (!msgQueue) return FALSE;
|
|
|
|
|
|
|
|
msgQueue->next = 0;
|
|
|
|
msgQueue->hTask = 0;
|
|
|
|
msgQueue->msgSize = sizeof(QMSG);
|
|
|
|
msgQueue->msgCount = 0;
|
|
|
|
msgQueue->nextMessage = 0;
|
|
|
|
msgQueue->nextFreeMessage = 0;
|
|
|
|
msgQueue->queueSize = size;
|
|
|
|
msgQueue->GetMessageTimeVal = 0;
|
|
|
|
msgQueue->GetMessagePosVal = 0;
|
|
|
|
msgQueue->GetMessageExtraInfoVal = 0;
|
|
|
|
msgQueue->lParam = 0;
|
|
|
|
msgQueue->wParam = 0;
|
|
|
|
msgQueue->msg = 0;
|
|
|
|
msgQueue->hWnd = 0;
|
|
|
|
msgQueue->wPostQMsg = 0;
|
|
|
|
msgQueue->wExitCode = 0;
|
|
|
|
msgQueue->InSendMessageHandle = 0;
|
|
|
|
msgQueue->tempStatus = 0;
|
|
|
|
msgQueue->status = 0;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PostQuitMessage (USER.6)
|
|
|
|
*/
|
|
|
|
void PostQuitMessage( int exitCode )
|
|
|
|
{
|
|
|
|
if (!msgQueue) return;
|
|
|
|
msgQueue->wPostQMsg = TRUE;
|
|
|
|
msgQueue->wExitCode = exitCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetQueueStatus (USER.334)
|
|
|
|
*/
|
|
|
|
DWORD GetQueueStatus( int flags )
|
|
|
|
{
|
|
|
|
unsigned long ret = (msgQueue->status << 16) | msgQueue->tempStatus;
|
1993-09-04 12:09:32 +02:00
|
|
|
if (flags & QS_PAINT)
|
|
|
|
{
|
|
|
|
if (WIN_FindWinToRepaint(0)) ret |= QS_PAINT | (QS_PAINT << 16);
|
|
|
|
}
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
msgQueue->tempStatus = 0;
|
|
|
|
return ret & ((flags << 16) | flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetInputState (USER.335)
|
|
|
|
*/
|
|
|
|
BOOL GetInputState()
|
|
|
|
{
|
|
|
|
return msgQueue->status & (QS_KEY | QS_MOUSEBUTTON);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
1993-09-04 12:09:32 +02:00
|
|
|
* MSG_PeekMessage
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
*/
|
1993-09-04 12:09:32 +02:00
|
|
|
BOOL MSG_PeekMessage( LPMSG msg, HWND hwnd, WORD first, WORD last, WORD flags )
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
{
|
|
|
|
int pos;
|
1993-09-04 12:09:32 +02:00
|
|
|
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
/* First handle a WM_QUIT message */
|
|
|
|
if (msgQueue->wPostQMsg)
|
|
|
|
{
|
|
|
|
msg->hwnd = hwnd;
|
|
|
|
msg->message = WM_QUIT;
|
|
|
|
msg->wParam = msgQueue->wExitCode;
|
|
|
|
msg->lParam = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Then handle a message put by SendMessage() */
|
|
|
|
if (msgQueue->status & QS_SENDMESSAGE)
|
|
|
|
{
|
|
|
|
if (!hwnd || (msgQueue->hWnd == hwnd))
|
|
|
|
{
|
|
|
|
if ((!first && !last) ||
|
|
|
|
((msgQueue->msg >= first) && (msgQueue->msg <= last)))
|
|
|
|
{
|
|
|
|
msg->hwnd = msgQueue->hWnd;
|
|
|
|
msg->message = msgQueue->msg;
|
|
|
|
msg->wParam = msgQueue->wParam;
|
|
|
|
msg->lParam = msgQueue->lParam;
|
|
|
|
if (flags & PM_REMOVE) msgQueue->status &= ~QS_SENDMESSAGE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now find a normal message */
|
|
|
|
pos = MSG_FindMsg( hwnd, first, last );
|
|
|
|
if (pos != -1)
|
|
|
|
{
|
|
|
|
QMSG *qmsg = &msgQueue->messages[pos];
|
|
|
|
*msg = qmsg->msg;
|
|
|
|
msgQueue->GetMessageTimeVal = msg->time;
|
|
|
|
msgQueue->GetMessagePosVal = *(DWORD *)&msg->pt;
|
|
|
|
msgQueue->GetMessageExtraInfoVal = qmsg->extraInfo;
|
|
|
|
|
|
|
|
if (flags & PM_REMOVE) MSG_RemoveMsg(pos);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If nothing else, return a WM_PAINT message */
|
1993-09-04 12:09:32 +02:00
|
|
|
if ((!first && !last) || ((first <= WM_PAINT) && (last >= WM_PAINT)))
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
{
|
1993-09-04 12:09:32 +02:00
|
|
|
msg->hwnd = WIN_FindWinToRepaint( hwnd );
|
|
|
|
msg->message = WM_PAINT;
|
|
|
|
msg->wParam = 0;
|
|
|
|
msg->lParam = 0;
|
|
|
|
return (msg->hwnd != 0);
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1993-09-04 12:09:32 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* PeekMessage (USER.109)
|
|
|
|
*/
|
|
|
|
BOOL PeekMessage( LPMSG msg, HWND hwnd, WORD first, WORD last, WORD flags )
|
|
|
|
{
|
|
|
|
while (XtAppPending( XT_app_context ))
|
|
|
|
XtAppProcessEvent( XT_app_context, XtIMAll );
|
|
|
|
|
|
|
|
return MSG_PeekMessage( msg, hwnd, first, last, flags );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetMessage (USER.108)
|
|
|
|
*/
|
|
|
|
BOOL GetMessage( LPMSG msg, HWND hwnd, WORD first, WORD last )
|
|
|
|
{
|
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
if (MSG_PeekMessage( msg, hwnd, first, last, PM_REMOVE )) break;
|
|
|
|
XtAppProcessEvent( XT_app_context, XtIMAll );
|
|
|
|
}
|
|
|
|
|
|
|
|
return (msg->message != WM_QUIT);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* PostMessage (USER.110)
|
|
|
|
*/
|
|
|
|
BOOL PostMessage( HWND hwnd, WORD message, WORD wParam, LONG lParam )
|
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
|
|
|
|
msg.hwnd = hwnd;
|
|
|
|
msg.message = message;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
1993-09-04 12:09:32 +02:00
|
|
|
msg.time = GetTickCount();
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
msg.pt.x = 0;
|
|
|
|
msg.pt.y = 0;
|
|
|
|
|
|
|
|
return MSG_AddMsg( &msg, 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SendMessage (USER.111)
|
|
|
|
*/
|
|
|
|
LONG SendMessage( HWND hwnd, WORD msg, WORD wParam, LONG lParam )
|
|
|
|
{
|
|
|
|
WND * wndPtr = WIN_FindWndPtr( hwnd );
|
1993-09-29 13:21:49 +01:00
|
|
|
if (!wndPtr) return 0;
|
|
|
|
return CallWindowProc( wndPtr->lpfnWndProc, hwnd, msg, wParam, lParam );
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TranslateMessage (USER.113)
|
|
|
|
*/
|
|
|
|
BOOL TranslateMessage( LPMSG msg )
|
|
|
|
{
|
|
|
|
int message = msg->message;
|
|
|
|
|
|
|
|
if ((message == WM_KEYDOWN) || (message == WM_KEYUP) ||
|
|
|
|
(message == WM_SYSKEYDOWN) || (message == WM_SYSKEYUP))
|
|
|
|
{
|
|
|
|
#ifdef DEBUG_MSG
|
|
|
|
printf( "Translating key message\n" );
|
|
|
|
#endif
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DispatchMessage (USER.114)
|
|
|
|
*/
|
|
|
|
LONG DispatchMessage( LPMSG msg )
|
|
|
|
{
|
|
|
|
WND * wndPtr = WIN_FindWndPtr( msg->hwnd );
|
|
|
|
|
|
|
|
#ifdef DEBUG_MSG
|
|
|
|
printf( "Dispatch message hwnd=%08x msg=%d w=%d l=%d time=%u pt=%d,%d\n",
|
|
|
|
msg->hwnd, msg->message, msg->wParam, msg->lParam,
|
|
|
|
msg->time, msg->pt.x, msg->pt.y );
|
|
|
|
#endif
|
1993-09-29 13:21:49 +01:00
|
|
|
if (!wndPtr) return 0;
|
|
|
|
return CallWindowProc( wndPtr->lpfnWndProc, msg->hwnd, msg->message,
|
|
|
|
msg->wParam, msg->lParam );
|
Release 0.2.0
Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh)
* [global.c]
Completed global memory pool API
Sun Jul 11 16:59:52 1993 Alexandre Julliard
* [message.c] [user.c] [user.spec] [windows.h]
Added emulation of Windows message queue.
Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh)
* [build.c] Original by Bob Amstadt
* [callback.c] Original by Bob Amstadt, updates by
Alexandre Julliard
* [dump.c] Original by Bob Amstadt
* [global.c] Original by Bob Amstadt
* [heap.c] Original by Bob Amstadt
* [kernel.c] Original by Bob Amstadt
* [ldt.c] Original by Bob Amstadt
* [ldtlib.c] Original by Bob Amstadt
* [relay.c] Original by Bob Amstadt
* [resource.c] Original by Bob Amstadt, updates by
Alexandre Juliard
* [selector.c] Original by Bob Amstadt, updates by Eric Youngdale
* [user.c] Original by Bob Amstadt
* [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and
Alexandre Julliard
* [wintcl.c] Original by Regents of the University of California,
updates by Peter MacDonald and Alexandre Julliard
* [callback.h] Original by Bob Amstadt
* [dlls.h] Original by Bob Amstadt
* [heap.h] Original by Bob Amstadt
* [neexe.h] Original by Bob Amstadt
* [prototypes.h] Original by Bob Amstadt, updates by
Eric Youngdale
* [segmem.h] Original by Bob Amstadt
* [tkInt.h] Original by Regents of the University of California
* [windows.h] Original by Peter MacDonald, updates by
Alexandre Julliard and Bob Amstadt
* [wine.h] Original by Eric Youngdale
* [kernel.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [gdi.spec] Original by Bob Amstadt, updates by
Alexandre Julliard
* [shell.spec] Original by Bob Amstadt
* [unixlib.spec] Original by Bob Amstadt
* [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard
* [win87em.spec] Original by Bob Amstadt
* [Windows.tcl] Original by Peter MacDonald, updates by
Alexandre Julliard
* [build-spec.txt] Original by Bob Amstadt
* [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
1993-07-15 13:13:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetMessagePos (USER.119)
|
|
|
|
*/
|
|
|
|
DWORD GetMessagePos(void)
|
|
|
|
{
|
|
|
|
return msgQueue->GetMessagePosVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetMessageTime (USER.120)
|
|
|
|
*/
|
|
|
|
LONG GetMessageTime(void)
|
|
|
|
{
|
|
|
|
return msgQueue->GetMessageTimeVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetMessageExtraInfo (USER.288)
|
|
|
|
*/
|
|
|
|
LONG GetMessageExtraInfo(void)
|
|
|
|
{
|
|
|
|
return msgQueue->GetMessageExtraInfoVal;
|
|
|
|
}
|
|
|
|
|