@rjd324, Raziel
Yeah, this is easy, you just open application.library (part of OS, so no dependencies), register your app on start, then send notification to screenblanker engine to shut up when need it, and at exit from your app de-register/close application.library.
That easy and few strings:
Open/register:
// application.library (to register app, to enable/disable blankers, etc).
if (!(ApplicationBase = OpenLibrary("application.library", 52))) {
fprintf(stderr,"Failed to open application.library\n");
return FALSE;
}
IApplication = (struct ApplicationIFace *)GetInterface(ApplicationBase, "application", 2, NULL);
// register an app for aplication library
appID = RegisterApplication("Odyssey",
REGAPP_URLIdentifier, "none",
REGAPP_Description, "Odyssey Web Browser",
TAG_END);
DeRegister/Close:
if (ApplicationBase) {
UnregisterApplication(appID, NULL);
DropInterface((struct Interface*)IApplication);
CloseLibrary(ApplicationBase);
ApplicationBase = NULL;
}
So when basics done, you can then send from your app all the notifications to screenblanker engine : and to disabled screenblankers, and to enable them back.
For Odyssey i made this function which pass arguments as "struct screen" and bool TRUE/FALSE for enable/disable screenblanker engine:
void enable_blanker(struct Screen *screen, ULONG enable)
{
if(enable)
{
// enable screenblanker
SetApplicationAttrs(appID,
APPATTR_AllowsBlanker, TRUE,
APPATTR_NeedsGameMode, FALSE,
TAG_END);
}
else
{
// disable screenblanker
SetApplicationAttrs(appID,
APPATTR_AllowsBlanker, FALSE,
APPATTR_NeedsGameMode, TRUE,
TAG_END);
}
}
Then in any place of the Odyssey i can just then:
somethings blblalbalbal
enable_blanker(_screen(obj), FALSE);
something blablablab;
enable_blanker(_screen(obj), TRUE);
And that all