>>>>> "Richard" == Richard Zidlicky <rz / linux-m68k.org> writes:

    Richard> On Tue, Sep 02, 2003 at 07:49:29AM +0900, Basile
    Richard> STARYNKEVITCH wrote:
    >> No, not yet. The problem of having several apps sending
    >> requests to the same Guis is "security": what do you allow to
    >> flow from on app to another (but you could use X selection
    >> mechanism to make different Guis communicate, if you really
    >> want to).

    Richard> this can be really hard depending on the language
    Richard> underlying Guis, python would seem to make any control
    Richard> impossible.

    >> And why do you want to have several apps sending to the same
    >> Guis? (If you really want a general higher level graphical
    >> system, consider contributing to Fresco)

    Richard> would be nice to have on embeded systems that are short
    Richard> on memory or don't have shared libs or simply to cut
    Richard> startup times for some apps.  I assume something like
    Richard> Guis with some really small lisp interpreter (SIOD?)
    Richard> could be very small?

Not really, since Guis requires a scripting language with a binding to
GTK, and GTK is not exactly small. Guis could use SIOD if it had a GTK
binding! Of course, Guis by itself is not very big: the gguis.c file
which provides most of the framework and is reused in pyguis [Guis for
python] and ruguis [Guis for ruby] is 1182 lines and 37366 chars; if
you compile it with -Os you get a 33124 byte gguis.o on my x86 with
gcc-3.3. Both py_gguis.c & ru_gguis.c are about 500 lines each.

You may have a look inside Guis - adding another scripting language
support is quite easy (a few routines to code, notably
interpret_request etc..) but it is useless if the scripting language
cannot call GTK to actually build the graphical user interface! GTK is
already big, and any binding of GTK to any scripting language is also
quite big.


I have a question to Ruby experts; I would like to make a primitive
(coded in C, callable from Ruby) on_end_of_input in my Ruby builtin
modules Guis to be able to code in Ruby script for Guis:

Guis::on_end_of_input do |timeout|
  ## do something useful, for example
  $stderr.printf("goodbye world with timeout %d\n", timeout)
end

Then I want my C routine end_of_input_hook(int timeout) to call the
block passed to on_end_of_input

But I can't figure out:

1. How to call (in C)
  rb_define_module_function (ru_guis_module, "on_eoi", my_on_eoi, 1);
(what is the number of arguments: 1 (the block) or more

2. How to implement it in C
static VALUE  
        my_on_eoi(VALUE self, 
        //other arguments needed??
        )
{
}

(I probably need to use the "call" method with rb_apply but I can't figure how)

-- 

Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la FaýÆncerie, 92340 Bourg La Reine, France