2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <proto/utility.h>
10 #include <proto/datatypes.h>
11 #include "datatypes_intern.h"
13 /*****************************************************************************
17 AROS_LH1(ULONG
, StartDragSelect
,
20 AROS_LHA(Object
*, o
, A0
),
23 struct Library
*, DataTypesBase
, 50, DataTypes
)
27 Start drag-selection by the user; the drag selection will only start
28 if the object in question supports DTM_SELECT, is in a window or
29 requester and no layout-process is working on the object.
33 o -- data type object in question; may be NULL
37 TRUE if all went OK, FALSE otherwise. If FALSE, IoErr() gives further
40 ERROR_ACTION_NOT_KNOWN -- the object doesn't support DTM_SELECT
41 ERROR_OBJECT_IN_USE -- the object is currently occupied
55 6.8.99 SDuvan implemented
57 *****************************************************************************/
61 struct DTSpecialInfo
*dtsi
;
67 dtsi
= ((struct Gadget
*)o
)->SpecialInfo
;
69 /* Doesn't support drag selection? */
70 if(FindMethod(GetDTMethods(o
), DTM_SELECT
) == NULL
)
72 SetIoErr(ERROR_ACTION_NOT_KNOWN
);
76 ObtainSemaphore(&dtsi
->si_Lock
);
78 if(dtsi
->si_Flags
& DTSIF_LAYOUTPROC
)
81 SetIoErr(ERROR_OBJECT_IN_USE
);
84 dtsi
->si_Flags
|= DTSIF_DRAGSELECT
;
86 ReleaseSemaphore(&dtsi
->si_Lock
);
91 } /* StartDragSelect */