Gtk::Application with a non-unique gtk appl



Hello All,


### context ###
I'm working on the MELT plugin of the GCC compiler, see http://gcc-melt.org/ for more.

I'm adding to MELT the ability to interact with a graphical probe. In broad terms, 
when you invoke the GCC compiler with specific arguments 
  gcc -fplugin=melt -fplugin-arg-melt-mode=probe -c -O your-source.c 
for example, a GTK application is "magically" forked by GCC and communicates with
GCC (actually the cc1 program) to display various information about the compilation.
The probe is communicating thru two textual asynchronous pipes with cc1.

The probe (GPLv3 licensed) is written in C++11 using GtkMM 3.4 & GtkSourcecViewMM; you could find its 
code under contrib/ of the melt-branch of GCC. In particular, see 
http://gcc.gnu.org/viewcvs/branches/melt-branch/contrib/simplemelt-gtkmm-probe.cc

This is a self-contained GtkMM application. A comment near the end of the file shows how to compile it.
The probe is currently in bad state (svn rev 187541); in its previous revision 
svn 187245 it worked a bit better but did not use Gtk::Application but just Gtk::Main..


And my probe GtkMM application wants to parse some arguments, in particular it 
could be invoked by cc1 (thru a user-provided shell script called melt-probe) as
  simple-melt-probe -T --command-from-MELT 5 --request-to-MELT 6 
where 5 is the file descriptor of the pipe from MELT to the probe and 6 
is the file descriptor from the graphical probe to MELT; You might test it
using 0 (for stdin) instead of 5 and 1 (for stdout) instead of 6. The you would
type commands like

   SHOWFILE_pcd "testfile.c" 1


   VERSION_pcd 
   
   
[notice that commands should be ended by two consecutive newlines]

### question ####
I don't understand exactly when should I use the Gtk::Application class, 
and when should I avoid using it and instead use Gtk::Main which is 
marked as deprecated.

In particular, my application has no "uniqueness" requirement. I would imagine 
that some user might want to run a few processes (e.g. a few "instances") of it 
on the same desktop.

Should I still use Gtk::Application for an application which could have several
(unrelated) processes (all running the same ELF executable)? Or is Gtk::Application 
useless (or even harmful) in that case?


Regards.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]