(C) 1998 AROS - The Amiga Research OS


NAME
#include <intuition/intuition.h>
#include <proto/intuition.h>

BOOL ModifyIDCMP (window , flags)

LOCATION
In IntuitionBase at offset 25

SYNOPSIS
struct Window * window
ULONG flags

FUNCTION
This routine modifies the state of your window's IDCMP (Intuition Direct Communication Message Port).

Depending on the current state in the IDCMPFlags of the window and the specified flags these actions are possible:

IDCMP flags Action 0 0 Nothing happens 0 !=0 The flags are copied in the IDCMPFlags of the window and a MessagePort is created and stored in the UserPort of the window. !=0 0 The IDCMPFlags are cleared and the MessagePort in the UserPort is deleted. !=0 !=0 The flags are copied to the IDCMPFlags of the window.

INPUTS
window
The window to change the IDCMPFlags in.
flags
New flags for the IDCMPFlags of the window. See intuition/intuition.h for the available flags.

RESULT
TRUE if the change could be made and FALSE otherwise.

EXAMPLE

SEE ALSO
OpenWindow(), CloseWindow()

NOTES
You can set up the Window->UserPort to any port of your own before you call ModifyIDCMP(). If IDCMPFlags is non-null but your UserPort is already initialized, Intuition will assume that it's a valid port with task and signal data preset and Intuition won't disturb your set-up at all, Intuition will just allocate the Intuition message port half of it. The converse is true as well: if UserPort is NULL when you call here with IDCMPFlags == NULL, Intuition will deallocate only the Intuition side of the port.

This allows you to use a port that you already have allocated:

- OpenWindow() with IDCMPFlags equal to NULL (open no ports) - set the UserPort variable of your window to any valid port of your own choosing - call ModifyIDCMP with IDCMPFlags set to what you want - then, to clean up later, set UserPort equal to NULL before calling CloseWindow() (leave IDCMPFlags alone) BUT FIRST: you must make sure that no messages sent your window are queued at the port, since they will be returned to the memory free pool.

For an example of how to close a window with a shared IDCMP, see the description for CloseWindow().

BUGS

INTERNALS

HISTORY
19.03.1999 nlorentz
Bugfix (fixes memleak in Open/CloseWindow(): Only create new window->UserPort when window->UserPort == NULL
20.10.1998 hkiel
Amiga Research OS
27.01.1997 ldp
Polish
10.12.1996 aros
Moved #include into first column to allow makedepend to see it.
08.11.1996 aros
All OS function use now Amiga types

Moved intuition-driver protos to intuition_intern.h

24.10.1996 aros
Use the official AROS macros over the __AROS versions.
29.08.1996 digulla
Moved common code from driver to Intuition More docs
23.08.1996 digulla
Added include intuition/intuition.h to user-docs
13.08.1996 digulla
First function for intuition.library