Re: Moving main loop to GLib.



This looks great, and will probably clean up the Windows port a bit,
and enable some stuff that I have found hard to implement so far
(script-fu-server, script-fu-console).

Owen Taylor writes:
 > typedef guint (*GInputFunction) (gpointer	    data,
 > 				 gint		    source,
 > 				 GInputCondition  condition);

 >  guint     g_input_add_full (gint                 priority,
 > 			     gint		  source,
 > 			     GInputCondition      condition,
 > 			     GInputFunction       function,
 > 			     gpointer	          data,
 > 			     GDestroyNotify       destroy);

Hmm. This "source" then need not necessarily be a file descriptor, but
some opaque handle that the corresponding GSource knows of? But how
does this function know what GSource should handle this? Shouldn there
be a GSource parameter also?

Do I understand correctly, that there would be one GSource object that
handles the X11 socket, one that handles pipes from plug-ins, one that
handles other sockets (for instance in script-fu-server or yagirc), etc?

On Unix, most GSources could use select() to poll. On Windows, there
would be one GSource that checks for Windows messages, one that checks
for readable pipes (actually pipes are signalled to be readable
through a user message, but I digress), one for sockets, etc.

How will for instance those functions in gimp/libgimp/gimpprotocol.c
that now have an "int fd" parameter look after this change?

--tml



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