some fixes to accented characters
[tangerine.git] / rom / intuition / setdmrequest.c
blobae11fad5be22c8bc806a2efc98f3e49103bbcea9
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include "intuition_intern.h"
8 #include "inputhandler_actions.h"
10 struct SetDMRequestActionMsg
12 struct IntuiActionMsg msg;
13 struct Window *window;
14 struct Requester *dmrequest;
15 BOOL success;
18 static VOID int_setdmrequest(struct SetDMRequestActionMsg *msg,
19 struct IntuitionBase *IntuitionBase);
21 /*****************************************************************************
23 NAME */
24 #include <proto/intuition.h>
26 AROS_LH2(BOOL, SetDMRequest,
28 /* SYNOPSIS */
29 AROS_LHA(struct Window * , window, A0),
30 AROS_LHA(struct Requester *, dmrequest, A1),
32 /* LOCATION */
33 struct IntuitionBase *, IntuitionBase, 43, Intuition)
35 /* FUNCTION
36 Try to set the DMRequest of a window.
37 A DMRequest is a requester that appears if the user double-clicks
38 with the menu button.
39 The new DMRequest will only be set if the old DMRequest is not in use.
40 The official way to change the DMRequest is to call ClearDMRequest()
41 until it returns TRUE and then call SetDMRequest().
44 INPUTS
45 window - The window from which the DMRequest is to be set
46 dmrequest - Pointer to the requester
48 RESULT
49 TRUE if old DMRequest was not in use and therefore changed to
50 the new one, or FALSE if the old DMRequest was in use and could
51 not be set to the new one.
53 NOTES
54 If the DMRequest has the POINTREL flag set, the DMR will show up
55 as close to the pointer as possible. The RelLeft/Top fields are
56 used to fine-tune the positioning.
58 EXAMPLE
60 BUGS
62 SEE ALSO
63 ClearDMRequest(), Request()
65 INTERNALS
67 HISTORY
69 *****************************************************************************/
71 AROS_LIBFUNC_INIT
73 struct SetDMRequestActionMsg msg;
75 SANITY_CHECKR(window,FALSE)
76 SANITY_CHECKR(dmrequest,FALSE)
78 msg.window = window;
79 msg.dmrequest = dmrequest;
81 DoSyncAction((APTR)int_setdmrequest, &msg.msg, IntuitionBase);
83 return msg.success;
85 AROS_LIBFUNC_EXIT
86 } /* SetDMRequest */
89 static VOID int_setdmrequest(struct SetDMRequestActionMsg *msg,
90 struct IntuitionBase *IntuitionBase)
92 struct Window *window = msg->window;
93 struct Requester *dmrequest = msg->dmrequest;
94 LONG result;
96 if (window->DMRequest && window->DMRequest->Flags & REQACTIVE)
98 result = FALSE;
100 else
102 window->DMRequest = dmrequest;
103 result = TRUE;
106 msg->success = result;