r4722@vps: verhaegs | 2007-05-06 13:11:19 -0400
[cake.git] / workbench / libs / muimaster / mui_requestidcmp.c
blobab0ca30b4bc9b961e8d53f71078c24f94eac85fe
1 /*
2 Copyright © 2002-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <clib/alib_protos.h>
7 #include <proto/muimaster.h>
9 #include <proto/intuition.h>
10 #include <intuition/classusr.h>
12 #include "muimaster_intern.h"
13 #include "mui.h"
15 /*****************************************************************************
17 NAME */
18 AROS_LH2(VOID, MUI_RequestIDCMP,
20 /* SYNOPSIS */
21 AROS_LHA(Object *, obj , A0),
22 AROS_LHA(ULONG , flags, D0),
24 /* LOCATION */
25 struct Library *, MUIMasterBase, 15, MUIMaster)
27 /* FUNCTION
29 For custom class implementors. Valid between MUIM_Setup/MUIM_Cleanup.
30 Indicates that this object wants to receive some events. MUIM_HandleInput
31 will then be called on this object whenever there's a matching event.
33 INPUTS
35 obj -- an object whose class is derived from Area
36 flags -- IDCMP flags
38 RESULT
40 NOTES
42 Deprecated in favor of MUIM_Window_AddEventHandler and MUIM_HandleEvent
43 event handling model (introduced in MUI V16).
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 This is a wrapper around MUIM_Window_RemEventHandler and
54 MUIM_Window_AddEventHandler.
56 HISTORY
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
62 /* Use the Eventhandler to simulate a MUIM_HandleInput */
63 if (muiRenderInfo(obj) && (_flags(obj) & MADF_SETUP) && _win(obj))
65 if (muiAreaData(obj)->mad_hiehn.ehn_Events)
67 DoMethod(_win(obj), MUIM_Window_RemEventHandler, (IPTR)&muiAreaData(obj)->mad_hiehn);
69 muiAreaData(obj)->mad_hiehn.ehn_Events |= flags;
70 if (muiAreaData(obj)->mad_hiehn.ehn_Events)
72 DoMethod(_win(obj), MUIM_Window_AddEventHandler, (IPTR)&muiAreaData(obj)->mad_hiehn);
75 else
77 muiAreaData(obj)->mad_hiehn.ehn_Events |= flags;
80 AROS_LIBFUNC_EXIT
82 } /* MUIA_RequestIDCMP */