Re: [gtk-list] Re: Marshallers, _interp, and the Meaning of Life



On Tue, 10 Feb 1998, Jay Bloodworth wrote:

> > 
> > which without marshalling would have looked like
> > static void
> > gtk_real_window_move_resize (GtkObject      *object,
> >                              gpointer        func_data,
> >                              GtkArg         *args)
> > {
> >   gint *x;
> >   gint *y;
> >   gint width;
> >   gint height;
> >   gint *return_val;
> >   
> >   return_val = GTK_RETLOC_BOOL (args[4]);
> >   x = GTK_VALUE_POINTER (args[0]);
> >   y = GTK_VALUE_POINTER (args[1]);
> >   width = GTK_VALUE_INT (args[2]);
> >   height = GTK_VALUE_INT (args[3]);
> >   
> >   [...]
> >   
> >   *return_val = something_that_came_out_of_the_function;
> > }
> > 
> 
> So marshalling basically moves the code that references, casts, and names
> arguments in the GtkArg array into a separate function.  I see how this is
> a big win in terms of program neatness, especially if you aren't concerned
> with the situations that require marshallers.  Are there any other
> advantages to using a marshalling system?

nope, providing the arguments for the invokation on the stack is the only use
of the marshallers. but imagine what code would look like, if you had to sort
out the arguments yourself in each and every signal handler. i guess most of
the signal connections on the application side would be buggy ;)

> 
> Jay
> 

---
ciaoTJ



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