add casts to zune macros to silence some warnings
[tangerine.git] / test / icon / examine.c
blob8ff91bb0597babc0f28b9271a9d9124149ba333e
1 #include <workbench/workbench.h>
2 #include <workbench/icon.h>
4 #include <proto/icon.h>
6 #include <stdio.h>
8 int main(int argc, char **argv)
10 const char * const typeNames[] =
12 NULL, /* not used */
13 "WBDISK", /* 1 */
14 "WBDRAWER", /* 2 */
15 "WBTOOL", /* 3 */
16 "WBPROJECT", /* 4 */
17 "WBGARBAGE", /* 5 */
18 "WBDEVICE", /* 6 */
19 "WBKICK", /* 7 */
20 "WBAPPICON" /* 8 */
23 if (argc == 2)
25 LONG isDefault = FALSE;
26 struct DiskObject *icon = GetIconTags
28 argv[1],
29 ICONGETA_FailIfUnavailable, FALSE,
30 ICONGETA_IsDefaultIcon, (IPTR) &isDefault,
31 TAG_DONE
34 if (icon != NULL)
36 printf
38 "Name: %s\n"
39 "Fake icon: %s\n"
40 "Type: %s (%d)\n"
41 "Default tool: %s\n"
42 "Position: x = %ld (0x%lx), y = %ld (0x%lx)\n"
43 "Drawer data: %s\n"
44 "Stack size: %ld\n"
45 "Tooltypes: %s\n\n",
46 argv[1], isDefault ? "yes" : "no",
47 typeNames[icon->do_Type], icon->do_Type, icon->do_DefaultTool,
48 icon->do_CurrentX, icon->do_CurrentX,
49 icon->do_CurrentY, icon->do_CurrentY,
50 icon->do_DrawerData != NULL ? "yes" : "no",
51 icon->do_StackSize,
52 icon->do_ToolTypes != NULL ? "yes" : "no"
55 if (icon->do_ToolTypes != NULL)
57 char *tt = NULL;
58 int i = 0;
60 printf("Tooltype data:\n");
62 while ((tt = icon->do_ToolTypes[i]) != NULL)
64 printf("%s\n", tt);
65 i++;
69 FreeDiskObject(icon);
71 else
73 printf("ERROR: Failed to open icon.\n");
74 return 20;
77 else
79 printf("Usage: %s <name> (without trailing \".info\")\n", argv[0]);
82 return 0;