Now that we have printer device it makes sense to build Print module.
[AROS-Contrib.git] / fish / memsnap / icon.c
blobdc7a32fb8e6cbb5ac2e87e0dbae316cf656f425c
1 /*
2 * Routines dealing with processing of Onekey's icon
3 * (be they for tooltypes or AppIcon purposes).
4 *
5 * MWS, Tuesday 13-Oct-92
6 */
7 #include <exec/types.h>
8 #include <dos/dos.h>
9 #include <workbench/startup.h>
10 #include <workbench/workbench.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
13 #include <proto/wb.h>
14 #include <proto/icon.h>
15 #include <string.h>
17 #include "icon.h"
18 static struct DiskObject *onekeyobj;
20 BOOL
21 GetOurIcon(struct WBStartup *WBenchMsg)
23 if (WBenchMsg)
24 onekeyobj = GetDiskObject(WBenchMsg->sm_ArgList->wa_Name);
25 return onekeyobj ? TRUE : FALSE;
28 /* safe to call when open failed, and multiple times */
29 void
30 FreeOurIcon()
32 if (onekeyobj) FreeDiskObject(onekeyobj);
33 onekeyobj = NULL;
36 /* like ArgString() */
37 char *
38 TTString(char *name, char *def)
40 char *what;
41 if (onekeyobj)
42 if ((what = FindToolType(onekeyobj->do_ToolTypes, name)))
43 return what;
44 return def;
47 /* like ArgInt() */
48 LONG
49 TTInt(char *name, LONG def)
51 char *what;
52 if (onekeyobj)
53 if ((what = FindToolType(onekeyobj->do_ToolTypes, name)))
54 StrToLong(what, &def);
55 return def;
58 /* simple extension to ArgXXX routines */
59 BOOL
60 TTBool(char *name, BOOL def)
62 char *s;
64 s = TTString(name, def ? "YES" : "NO");
66 return ((strcmp(s, "YES") == 0) ||
67 (strcmp(s, "TRUE") == 0)) ? TRUE : FALSE;