Move UsbStdDevDesc back in stack now that it does not get trashed anymore, makes...
[AROS.git] / test / icon / examine.c
blob07a6bcb123faff928ed148fad905c2ef5b52ba4e
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 (long)icon->do_CurrentX, (unsigned long)icon->do_CurrentX,
49 (long)icon->do_CurrentY, (unsigned long)icon->do_CurrentY,
50 icon->do_DrawerData != NULL ? "yes" : "no",
51 (long)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;