Re: plug/socket and Win32

At 16:41 18.04.01 -0400, Owen Taylor wrote:
>I'm working currently on some major changes to plug/socket on
>X11, and wanted to get some advice on the handling of Win32.
>I've basically always considered Plug/Socket to be X-specific
>code, and certainly they are that way now, except that at
>some point, a bit of non-functioning Win32 code was added to
It appears to me that the main problem for not fully implementing 
it on windoze was not a lack of ability but a lack of requirement.
Neither Gimp nor Dia does use GtkPlug/GtkSocket and there seems to
be not even a test/demo program in Gtk+.

To port it one of my requirements would be to understand what it 
is supposed to do. The win32 code in gtkplug.c looks ok, but could
probably be improved for readability by some new Gdk functions, i.e.

- gdk_set_focus
- gdk_forward_key_press
- gdk_forward_event

>I don't have a good sense of whether full-featured plug/socket
>like embedding is possible on Win32; I remember seeing at
>some point that it wasn't part of the then-current version
>of Tk but they had ideas about how to do it in the future.
If I understood the code correctly it is basicly relaying messages
from one window to another processes window, isn't it ?

Interprocess communication via messages is (was) quite common on 
win(32) so there should be no real problems in porting it.

>There are various ways to approach handling cross-platform
>portability issues for GTK+:
> - Try to move the platform specific parts to GDK. The trouble
>   with this is that the protocol on X11 is quite high-level
>   and contains such toolkit-dependent notions as accelerators,
>   modality, sensitivity, and so forth.
> - Simply provide a separate gtk/plug.c gtksocket.c for each platform
>   that implements embedding. The amount of code that would be shared
>   between platforms is probably minimal.
I would suggest a sollution between this to avoid unnecassary code 
duplication : 
- Gdk functions for simple functionality as noted above
- gtksocket-<X11|win32>.c for complex higher level logic, but 
  gtksocket.c could probably stay for cross platform code

>My plan at the current time is to simply remove the current
>Win32 code from Plug/Socket, since I don't think #ifdefs
>are the right way to make it portable in any case. If the
>code is needed in the future, it can be retrieved from 
Fine with me. Temporary excluding GtkPlug/Socket from the Gtk-win32 
build will only break PyGtk on my harddisk.

>So, I'd appreciate hearing what your thoughts are, if any, in
>terms of getting plug/socket working on Win32.
Thanks for asking,
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert

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