2021-12-16 10:23:30 +01:00
|
|
|
static const char *version = "$VER: phED Version 0.3";
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
GID_TEXTEDITOR = 0,
|
|
|
|
GID_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
struct phED
|
|
|
|
{
|
|
|
|
char dateiname[256];
|
|
|
|
} phed;
|
|
|
|
|
2021-11-25 11:14:40 +01:00
|
|
|
struct Library *WindowBase = NULL,
|
|
|
|
*LayoutBase = NULL,
|
2021-12-02 10:05:42 +01:00
|
|
|
*RequesterBase = NULL,
|
2021-12-16 10:23:30 +01:00
|
|
|
*AslBase = NULL,
|
2021-11-25 11:14:40 +01:00
|
|
|
*TextFieldBase = NULL;
|
|
|
|
|
|
|
|
void closeLibraries()
|
|
|
|
{
|
|
|
|
if(WindowBase) CloseLibrary((struct Library *) WindowBase);
|
|
|
|
if(TextFieldBase) CloseLibrary((struct Library *) TextFieldBase);
|
|
|
|
if(LayoutBase) CloseLibrary((struct Library *) LayoutBase);
|
2021-12-02 10:05:42 +01:00
|
|
|
if(RequesterBase) CloseLibrary((struct Library *) RequesterBase);
|
2021-12-16 10:23:30 +01:00
|
|
|
if(AslBase) CloseLibrary((struct Library *) AslBase);
|
2021-11-25 11:14:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL openLibraries()
|
|
|
|
{
|
|
|
|
BOOL ret = FALSE;
|
|
|
|
|
|
|
|
if(WindowBase = (struct Library *) OpenLibrary("window.class", 0L))
|
|
|
|
{
|
|
|
|
if(TextFieldBase = (struct Library *) OpenLibrary("gadgets/texteditor.gadget", 0L))
|
|
|
|
{
|
|
|
|
if(LayoutBase = (struct Library *) OpenLibrary("gadgets/layout.gadget", 0L))
|
|
|
|
{
|
2021-12-02 10:05:42 +01:00
|
|
|
if(RequesterBase = (struct Library *) OpenLibrary("requester.class", 0L))
|
|
|
|
{
|
2021-12-16 10:23:30 +01:00
|
|
|
if(AslBase = (struct Library *) OpenLibrary("asl.library", 0L))
|
|
|
|
{
|
|
|
|
ret = TRUE;
|
|
|
|
}
|
2021-12-02 10:05:42 +01:00
|
|
|
}
|
2021-11-25 11:14:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!ret) closeLibraries();
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|