[Gambas-user] Proposal: Add-Ins for the Gambas3 IDE
Benoît Minisini
gambas at ...1...
Tue Aug 14 13:47:30 CEST 2012
Le 14/08/2012 07:10, Bruce a écrit :
> Dear folks,
>
> I hope you can forgive the long post and manage to wade through the
> following.
>
> Introduction
> ------------
> This (the attached) project is a "proof of concept" (herafter "POC") for
> a means to add a capability to the Gambas3 IDE to allow add-in programs
> to be called directly from within the IDE. As a POC, there are many
> unimplemented features and requirements but it suffices to demonstrate
> the concept at a minimal level of complexity.
>
> It has been distributed by Paddys-Hill dot Net in order to guage whether
> there is an initial level of interest in the idea within the Gambas
> community and to garner any feedback regarding the concept or its
> current vision for deployment.
>
> Disclaimer
> ----------
> Subject to the level of interest displayed, Paddys-Hill dot Net may at
> its own discretion continue the development of the concept with view to
> having it included in the public Gambas 3 product. There is no
> guarantee, express or implied in that, that the concept will be
> developed further by Paddys-Hill dot Net.
>
> Background
> ----------
> Over the last years, Paddys-Hill dot Net has developed a set of utility
> programs that assist the Gambas programmer. We imagine the same has
> occurred in other Gambas 3 development organizations and even in the
> case of single developers who use Gambas 3 for their own private
> programming purposes.
> However, our utilities (and we imagine, yours) are not integrated into
> the Gambas IDE and so are not readliy accessible from within the IDE.
> In short, they are stand alone programs (developed mainly in Gambas)
> that are started when needed from menus, desktop icons etc etc.
> Some time ago, (Gambas 2.19??) I started looking into how these utilites
> could be incorporated into the IDE and yet remain outside the core
> Gambas product. In other words, how to "add something in" to the IDE
> without affecting it. I had little success under Gambas 2 and put the
> idea, and work on it, on hold. Recently, I have revitalised the idea
> and we have progressed it to a much more stable base under Gambas 3.
> There is still a lot of work to be done yet though!
>
> Concepts, Requirements and Principals
> -------------------------------------
> 1) The entire management and administration of add-ins should be
> encapsulated and separate from the main IDE code, i.e. in short, it
> should all reside in a Gambas 3 Component.
> 2) The interaction of the IDE with the component must be kept at an
> absolute minimum in order to preserve the stability of the Gambas IDE.
> 3) No add-in should require direct support from the IDE. That is, there
> should be no code changes to the IDE necessary to support a specific
> add-in.
> 4) Add-ins (i.e. the payload part) could be any executable. To expand
> that, I foresee three general types of addins: utilities written in
> Gambas code and run as a normal executable; utilities based on external
> code that are "wrapped" in a Gambas framework to provide the add-in
> infrastructure; and "simple" external utilities/programs where it may be
> "handy" to invoke from within the IDE.
> 5) There "may be" information flow from the IDE to the add-in when it is
> started (handled by the "manager" component) but initially and for some
> forseeable future, there will be no information flow back from the
> add-in to the IDE. This is again so there is no impact on the IDE.
> 6) Add-in management should persist between invocations of the IDE on a
> per user basis. That is, if the user enables an add-in during an IDE
> session, then it should be enabled again automatically when another IDE
> session is started. (In other words, the manager will use the Settings
> component and the users gambas3.config file to store the enabled
> add-ins.)
> 7) Closing the IDE should close all instances of add-ins started and
> running for that session.
>
> The POC project
> ---------------
> The POC is contained in a single source archive attached "addinmeta1".
> It consists of a simple main form (FTest) that emulates the IDE in a
> @@very rudimentary@@ way. (Note: It does contain extraneous matter due
> to where it came from. These other "features" should be ignored.)
> The other major contents are the FAIManager form, which provides the
> administration of add-ins and is the only thing "visible" to our "IDE".
>
> The "IDE" form (FTest) shows that the only changes that would be needed
> in the Gambas IDE. These are :
> * addition of the "Add Ins" menu item in the Tools menu
> * addition of a private global variable "$addinmgr" to reference
> the manager
> * instantiation of the $addinmgr when the IDE form is first
> opened, and
> * a call to the $addinmgr.CloseAll method issued when the IDE is
> closed.
>
> In order to demonstrate the concept, we have also attached a simple
> addin that opens a virtual terminal (woohoo!) Not very useful I know,
> but we are POC'ing here! It is in the "runterminal_simple" autotools
> archive.
>
> To have a look at the demonstration:
> ------------------------------------
> 1) Unpack and install the runterminal_simple app somewhere handy.
> 2) Unpack the addinmeta archive somewhere and open the contained project
> in the Gambas3 IDE. (This is important!)
> 3) Run the project from within the Gambas IDE
> a) Select the File|Open menu item and load one of the source
> files (just to give a feeling of the fake IDE, hereafter called
> the Add-Ins POC)
> b) Select Tools|Add Ins|Manager menu item, this will open the
> Manager
> c) Click on the blue "+" button (Register a new add-in),
> navigate to where you placed the runterminal_simple executable
> and select it (the .gambas file!) and click OK
> d) This registers the addd-in and automatically activates it.
> e) Click the OK button in the Manager form (saves the Settings
> for the add-in, if you click Cancel the add-in is active for the
> current "Add-Ins POC" session only!)
> f) You should now have a new menu item in the Add Ins menu
> "runterm_simple" and clicking on it should (hopefully !) open
> the default terminal for your desktop.
> g) Leave the terminal running and close the "Add-Ins POC". The
> terminal should also close.
> h) IMPORTANT. The POC process will not terminate properly. This
> is because of Issue #306. Just use the "stop run" button in the
> Gambas IDE.
> i) Have a play around with the POC.
>
> Outstanding Items/Bugs/etc
> --------------------------
> Apart from issue #306, there are some other problems evident in the POC.
> Sometimes the terminal will not close, it loses connection with the POC
> somehow. The Manager form is incomplete if you look at the full set of
> properties that need to be massaged to complete the add-in profile. etc
> etc. It's just a POC!
>
> Next Steps
> ----------
> Ours
> ----
> We will be continuing the development of the POC for our own use and if
> people are interested we will release a stable component version for
> Benoit to consider for inclusion.
>
> Yours
> -----
> Please let me know if you think this might be a valuable feature for the
> IDE
> Please let me know if you'd like to help!!!!
>
>
> Thanks for you patience in reading this rather long and large posting
> best regards
> Bruce
>
The ideas are good, but I don't really like the code (no offense!). Far
too complex for my tastes. :-)
I have already think about adding some sort of "actions" to the IDE
tools menu.
These actions would be external programs that receive information about
the project as arguments, and then perform their action, then eventually
return.
As for automatically closing child programs when exiting, I think I
could add an option for that in the Process class. That would be a
useful feature I think.
Please explain exactly what features you need in addition to what I have
just described. Maybe if I implement that, you will just have to
directly use it.
Regards,
--
Benoît Minisini
More information about the User
mailing list