Better application.library support in system components

AmigaOS users can make feature requests in this forum.

Better application.library support in system components

Postby blmara » Sat Feb 01, 2014 5:03 pm

Hi! After the latest update of ScreenBlankerEngine there seems to be two registrations of the Engine to application.library. This can be seen both by AppManager by Ami603 and winbar.docky. The latter shows now application 'sys/ScreenBlankerEngine' but clicking the entry in winbar.docky does nothing. Nor it or its preferences can be activated byt AppManager functions. Actually, it seems that most of the system components, including AmiUpdate and others that have some kind of preferences editor, don't listen to application.library messages. By these messages programs could be started, closed, put to front, prefs editor opened, made to create a new document or print a document, as shown in AppManager. For the future it would make the system more consistent if all system components would listen to these messages.

Marko
blmara
 
Posts: 63
Joined: Thu Jun 23, 2011 10:03 am

Re: Better application.library support in system components

Postby trixie » Sat Feb 01, 2014 7:42 pm

@blmara

1) Forget AppManager, there's a much better replacement in the making and almost finished (also replaces Exchange);
2) Otherwise I can only agree with you - take a look what I wrote in the Wiki as a general guidance for programmers.
Smoke me a kipper, I'll be back for breakfast!

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon R5 230 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
trixie
 
Posts: 373
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Better application.library support in system components

Postby ZeroG » Sun Feb 02, 2014 10:12 am

I think it would be a good idea to add a new "application.class" between root.class and window.class that handles this kind of things.
User avatar
ZeroG
 
Posts: 118
Joined: Sat Jun 18, 2011 12:31 pm
Location: Germany

Re: Better application.library support in system components

Postby trixie » Sun Feb 02, 2014 11:25 am

@ZeroG

I think it would be a good idea to add a new "application.class"


Making it a class is only a different way of doing it. Currently, programmers need to use application.library to register their app and report some info about it to the OS - if there was a class, they'd have to do the same, only they'd do it using the object-oriented API. Yes, this application stuff could have been implemented via BOOPSI, like MUI does it. But then again, the functionality wouldn't be available to apps that do not use the BOOPSI framework for their GUI.

between root.class and window.class that handles this kind of things.

As window.class is a direct descendant of rootclass, you can't squeeze another class in between - window.class cannot become a child of application.class unless the former is reworked. But as a stop-gap, it would be possible to write a BOOPSI wrapper for application.library and implement it on the same level as window.class. If anybody gives a damn, that is.
Smoke me a kipper, I'll be back for breakfast!

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon R5 230 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
trixie
 
Posts: 373
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Better application.library support in system components

Postby trixie » Sat Mar 15, 2014 6:33 pm

@ZeroG, blmara

OK, I bit the bullet and started working on the Application Class. It's an object-oriented (BOOPSI) wrapper for the Application Library and various other functionality, and it supports the following features at the moment:
  • Application registration and unregistration.
  • Application Library message processing, using a dedicated AM_HANDLEINPUT method and an Intuition-style event loop.
  • An unlimited number of BOOPSI windows can be added to the application object.
To be implemented soon:
  • Sending messages to other applications or to Ringhio.
  • Automatic creation of the About requester (incl. a custom image).
Future plans:
  • Help system
  • Preferences handling (using the PrefsObjects system)
I'm currently testing the class in various projects of mine, and it still needs some implementation thoughts here and there. Once the concept proves functional and useful, I'll move the entire project over to OpenAmiga.org.
Smoke me a kipper, I'll be back for breakfast!

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon R5 230 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
trixie
 
Posts: 373
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Better application.library support in system components

Postby LyleHaze » Sun Mar 16, 2014 1:19 am

blmara wrote:Hi! .... By these messages programs could be started, ....

Marko


I am new to application library, and have included it in my last few programs, but I am unaware of this particular feature.
How can application.library start a program? If I understand the operation correctly, it is restricted to working with programs
that have registered, and I expect that a program that is not running is not registered either.

Did I miss something here?
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 511
Joined: Sat Jun 18, 2011 5:06 pm
Location: Georgia, USA, just North of the Florida border

Re: Better application.library support in system components

Postby trixie » Sun Mar 16, 2014 1:46 am

@LyleHaze

I am new to application library, and have included it in my last few programs, but I am unaware of this particular feature.
How can application.library start a program?

There is no such feature in Application Library, Marko got it wrong.
Smoke me a kipper, I'll be back for breakfast!

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon R5 230 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
trixie
 
Posts: 373
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Better application.library support in system components

Postby ZeroG » Sun Mar 16, 2014 9:04 am

@trixie
Nice Class, is it possible to add catalog handling to it?
User avatar
ZeroG
 
Posts: 118
Joined: Sat Jun 18, 2011 12:31 pm
Location: Germany

Re: Better application.library support in system components

Postby trixie » Sun Mar 16, 2014 10:29 am

@ZeroG

is it possible to add catalog handling to it?

That is indeed the plan, and the particular implementation idea is the following (to make things as straightforward as possible):

  1. You create (OM_NEW) the application object with some initialization tags, one of them being APPLICATION_BaseName. The basename is required and it is the application name without spaces, i.e. "SuperApp" (such a format is needed for registration: Application Library won't allow spaces in app names).
  2. Still at creation time, the class will look for a catalog whose name is basename + ".catalog", i.e. "SuperApp.catalog". If such catalog file is found, the class will open it and return a struct Catalog pointer in APPLICATION_Catalog.
  3. You can then OM_GET the catalog pointer and provide/update the object's APPLICATION_Description with a localized description string from the catalog.
  4. Then you invoke the launch method, which will register the application and open its window.

EDIT: Automatic catalog handling now implemented!
Last edited by trixie on Sun Mar 16, 2014 2:38 pm, edited 1 time in total.
Smoke me a kipper, I'll be back for breakfast!

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon R5 230 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
trixie
 
Posts: 373
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Better application.library support in system components

Postby chris » Sun Mar 16, 2014 1:12 pm

trixie wrote:@ZeroG

is it possible to add catalog handling to it?

That is indeed the plan, and the particular implementation idea is the following (to make things as straightforward as possible):

  1. You create (OM_NEW) the application object with some initialization tags, one of them being APPLICATION_BaseName. The basename is required and it is the application name without spaces, i.e. "SuperApp" (such a format is needed for registration: Application Library won't allow spaces in app names).
  2. Still at creation time, the class will look for a catalog whose name is basename + ".catalog", i.e. "SuperApp.catalog". If such catalog file is found, the class will open it and return a struct Catalog pointer in APPLICATION_Catalog.
  3. You can then OM_GET the catalog pointer and provide/update the object's APPLICATION_Description with a localized description string from the catalog.
  4. Then you invoke the launch method, which will register the application and open its window.


Hmm, could it automatically open an ARexx port as well, using BaseName? And maybe respond to some default commands like QUIT, or anything application.library supports could be handled exactly as if it had come from there?
chris
 
Posts: 551
Joined: Sat Jun 18, 2011 12:05 pm

Next

Return to AmigaOS Feature Requests

Who is online

Users browsing this forum: No registered users and 6 guests