home *** CD-ROM | disk | FTP | other *** search
- /*
- * Routines dealing with processing of program's icon
- * (be they for tooltypes or AppIcon purposes).
- *
- * MWS, Tuesday 13-Oct-92
- */
- #include <exec/types.h>
- #include <dos/dos.h>
- #include <workbench/startup.h>
- #include <workbench/workbench.h>
- #include <proto/exec.h>
- #include <proto/dos.h>
- #include <proto/wb.h>
- #include <proto/icon.h>
- #include <string.h>
-
- #include "icon.h"
- static struct DiskObject *mydiskobj;
-
- BOOL
- GetOurIcon(struct WBStartup *WBenchMsg)
- {
- if (WBenchMsg)
- mydiskobj = GetDiskObject(WBenchMsg->sm_ArgList->wa_Name);
- return mydiskobj ? TRUE : FALSE;
- }
-
- /* safe to call when open failed, and multiple times */
- void
- FreeOurIcon()
- {
- if (mydiskobj) FreeDiskObject(mydiskobj);
- mydiskobj = NULL;
- }
-
- /* like ArgString() */
- char *
- TTString(char *name, char *def)
- {
- char *what;
- if (mydiskobj)
- if (what = FindToolType(mydiskobj->do_ToolTypes, name))
- return what;
- return def;
- }
-
- /* like ArgInt() */
- LONG
- TTInt(char *name, LONG def)
- {
- char *what;
- if (mydiskobj)
- if (what = FindToolType(mydiskobj->do_ToolTypes, name))
- StrToLong(what, &def);
- return def;
- }
-
- /* simple extension to ArgXXX routines */
- BOOL
- TTBool(char *name, BOOL def)
- {
- char *s;
-
- s = TTString(name, def ? "YES" : "NO");
-
- return ((strcmp(s, "YES") == 0) ||
- (strcmp(s, "TRUE") == 0)) ? TRUE : FALSE;
- }
-