2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
13 #include <aros/debug.h>
14 #include <proto/exec.h>
15 #include <devices/inputevent.h>
16 #include <exec/memory.h>
19 #define DEBUG_COPYIEVENT(x) x;
21 BOOL
CopyInputEvent(struct InputEvent
*from
, struct InputEvent
*to
, struct CommoditiesBase
*CxBase
);
23 AROS_LH1(VOID
, AddIEvents
,
27 AROS_LHA(struct InputEvent
*, events
, A0
),
31 struct Library
*, CxBase
, 30, Commodities
)
35 Send input events though the commodity hierarchy. After the call the
36 list of InputEvents may be disposed.
40 events -- a NULL-terminated linked list of InputEvents (may be NULL).
56 ******************************************************************************/
68 ObtainSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);
72 msg
= (CxMsg
*)AllocCxStructure(CX_MESSAGE
, CXM_DOUBLE
, CxBase
);
79 if (!CopyInputEvent(events
, msg
->cxm_Data
, GPB(CxBase
)))
81 DEBUG_COPYIEVENT(dprintf("AddIEvents: CopyInputEvent() failed!\n"));
84 ROUTECxMsg(msg
, (CxObj
*) &GPB(CxBase
)->cx_BrokerList
.lh_Head
);
85 AddTail(&GPB(CxBase
)->cx_MessageList
, (struct Node
*)msg
);
87 events
= events
->ie_NextEvent
;
88 } while(events
!= NULL
);
90 ReleaseSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);