Re: Panel applications and libgtop



"Mark R. Bowyer" <Moredhel@earthling.net> writes:

> Just a quick question.  Compiling gnome-core on Solaris gives me loads
> of little panel applets that are esentially useless.  This is because
> they're supposed to be monitoring various system performance measures,
> and do this in *very* system-specific ways.
> 
> But we also have the libgtop library, which is supposed to deliver a
> whole batch of clever little system-non-specific APIs so that you can
> get this information no matter which OS you're running on.
> 
> Am I missing the point here, or should things that go in core be built
> to use gtop, and as such, gtop should be added to gnome-libs?  This
> would solve *so* many cross-platform issues.

I guess you mean LibGTop, the library, here and not GTop, the program ?

No, LibGTop should not be added to gnome-libs - it's a library of its own
like for instance audiofile is.

But, however, if things in gnome-core or gnome-* require to fetch system-
dependant stuff it may be desirable to add this to libgtop if there's a
real need for this.

I mean, if the cross-platform differences are trival like some #ifdefs and
configure checks, it's better to do this directly - see libzvt as an
example for this.

There are two cases in which I think it's most likely the best solution to
add things to LibGTop:

* you need any special privileges to get the requested information at least
  on one particular system (suid root / sgid kmem).

* the code that is used to fetch the information is more or less completely
  different at least on two on the supported systems (this means the #ifdefs
  would include several hundreds of lines).

The problem is that if you add something to LibGTop, the cleanes solution is
to provide an implementation for all supported systems there and make
programs only use libgtop to fetch it.

An example for this is the modemlights applet - libgtop has not yet support
to get modem statistics, it only has ISDN support (since I don't have a modem
to test it with), so the modemlights applets checks whether libgtop is able
to provide the requested information and fetches it directly if using Linux
otherwise.

Martin

-- 
-----------------------------------------------------------------
   Martin Baulig - Angewandte Mathematik - Universitaet Trier
   martin@home-of-linux.org, http://www.home-of-linux.org/
------------------------------------------------------------------



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