Subject: Re: [linux-audio-dev] Small example of GUI in .so-files and a more thorough descripting of previous post
From: Erik de Castro Lopo (erikd_AT_zip.com.au)
Date: pe maalis 10 2000 - 17:29:31 EST
Lars Thomas Denstad wrote:
>
> Ok, I see I might not have been specific enough, so I've attached an example
> of what I mean.
>
> You don't really need to do connections to the X-server the way you
> describe, this is how I propose:
>
> If the host application wants to map a coded GUI-file to a plugin (as
> opposed to making a GUI based on exposed ports from the plugin), the host
> loads the user interface (.so-file) specified by the user.
>
> Linking to the widget library is a trivial task, as the host application
> itself needs to link to one (or more(?)) widget libraries in order to show
> itself.
>
> The example I have attached, which is really simple, uses GTK+. The host
> application links staticly to the GTK-libraries using -lgtk -lgdk, the
> GUI-plugin is compiled using --shared -fPIC, and just the stubs with minimal
> functionality (opening a window, setting a callback and displaying a button
> with the label "Hello, host!" compiles to just below 8KB (look below for
> complete instructions on how to compile/run).
>
> I've also sketched out a system where the plugin tells the host about its
> requirements, so that the host doesn't try to initialize the GUI and/or
> open/close it before it knows that it can supply the GUI code.
Anybody interested in this stuff should have a look at the way XMMS
http:://www.xmms.org
does plugins. I recently wrote a plugin for XMMS to allow XMMS to open
any file readable by libsndfile (to be released RSN). The whole excercise
which includes an "About" dialog box was trivial. It dynamically links
to GTK+ and libsndfile. The plugin itself comes to 12k unstripped.
Hope this helps,
Erik
-- +-------------------------------------------------+ Erik de Castro Lopo erikd_AT_zip.com.au +-------------------------------------------------+ "I once worked for a company where as part of the BS5750 "Quality" process I attended a meeting where I was informed that it was Company Policy not to use free software. When I asked him for his written authorisation for me to remove X Windows from our Sun workstations, he backtracked." -- Phil Hunt
This archive was generated by hypermail 2b28 : su maalis 12 2000 - 09:14:06 EST