refactored some code. compiles now without suppresing any warning with gcc-6.3.0.
[AROS.git] / workbench / demos / iconscale.c
blob466d6030a5fc825d0ad919c41459c0d9ff146855
1 /*
2 * Copyright (C) 2012, The AROS Development Team
3 * All right reserved.
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
7 */
9 #include <stdio.h>
10 #include <stdlib.h>
12 #include <workbench/icon.h>
14 #include <proto/exec.h>
15 #include <proto/icon.h>
17 int main(int argc, char **argv)
19 WORD maxw, maxh;
20 ULONG scalebox;
22 if (argc != 3) {
23 printf("Usage:\n%s <width> <height>\n", argv[0]);
24 return EXIT_FAILURE;
27 maxw = strtol(argv[1], NULL, 0);
28 maxh = strtol(argv[2], NULL, 0);
30 if (maxw < 20) maxw = 20;
31 if (maxh < 20) maxh = 20;
33 scalebox = PACK_ICON_SCALEBOX(maxw, maxh);
35 IconControl(NULL, ICONCTRLA_SetGlobalScaleBox, scalebox, TAG_END);
37 return EXIT_SUCCESS;