2 Copyright (C) 1995-2016, The AROS Development Team. All rights reserved.
7 #include "alib_intern.h"
8 #include <proto/intuition.h>
9 #include <proto/exec.h>
10 #include <proto/alib.h>
12 static STRPTR
CreateFormatStringFromEasyStruct(struct EasyStruct
*easyStruct
)
15 LONG lentext
= 0, lengadget
= 0;
17 if (easyStruct
->es_TextFormat
) lentext
= STRLEN(easyStruct
->es_TextFormat
);
18 if (easyStruct
->es_GadgetFormat
) lengadget
= STRLEN(easyStruct
->es_GadgetFormat
);
20 format
= AllocVec(lentext
+ lengadget
+ 1, MEMF_PUBLIC
);
21 CopyMem(easyStruct
->es_TextFormat
, format
, lentext
);
22 CopyMem(easyStruct
->es_GadgetFormat
, format
+ lentext
, lengadget
);
23 format
[lentext
+ lengadget
] = '\0';
28 static void FreeFormatString(STRPTR format
)
33 /*****************************************************************************
40 struct Window
*window
,
41 struct EasyStruct
*easyStruct
,
61 *****************************************************************************/
64 STRPTR format
= CreateFormatStringFromEasyStruct(easyStruct
);
66 AROS_SLOWSTACKFORMAT_PRE_USING(IDCMP_ptr
, format
);
67 retval
= EasyRequestArgs(window
, easyStruct
, IDCMP_ptr
, AROS_SLOWSTACKFORMAT_ARG(format
));
68 AROS_SLOWSTACKFORMAT_POST(format
);
70 FreeFormatString(format
);
77 /*****************************************************************************
81 struct Window
* BuildEasyRequest (
84 struct Window
*RefWindow
,
85 struct EasyStruct
*easyStruct
,
105 *****************************************************************************/
107 struct Window
* retval
;
108 STRPTR format
= CreateFormatStringFromEasyStruct(easyStruct
);
110 AROS_SLOWSTACKFORMAT_PRE_USING(IDCMP
, format
);
111 retval
= BuildEasyRequestArgs(RefWindow
, easyStruct
, IDCMP
, AROS_SLOWSTACKFORMAT_ARG(format
));
112 AROS_SLOWSTACKFORMAT_POST(format
);
114 FreeFormatString(format
);
117 } /* BuildEasyRequest */