Re: plug/socket and Win32



At 17:06 19.04.01 -0400, Owen Taylor wrote:
>
>Hans Breuer <hans breuer org> writes:
>
>> At 16:41 18.04.01 -0400, Owen Taylor wrote:
>> >
>> > [...]
>> >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
>> >gtkplug.c.
> 
>> 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
>
>In GTK+-2.0 (as of a recent commit, but planned for a while) none of
>this functionality is used by the X11 port, (except maybe for fallback
>compatibility with GTK+-1.2 embedding.)  GTK+ now uses the XEMBED
>protocol which mostly works by exchanging client messages.
>
>So, I don't see the point in encapsulating this functionality in GDK,
>when it isn't something that you want cross-platform.
>
I've attached a patch, which isn't really meant for inclusion, but
basically works; despite of the fact, that g_spawn_async for win32
is somewhat broken. (It works, if I start the testsocket_child
by hand and there seems to be a problem with size request handling)

The win32 implementation does follow the XEMBED protocol - it
is only tanslating it to native windows messages. As a result
the cross platform parts in gtk(plug|socket).c are still much
bigger than the #ifdef's
 
>The right approach for Win32 is to figure out how to do
>inter-application embedding in Win32, then figure out what primitives
>you need for that. Not to take the primitives from the X11 port and
>try and use them verbatim for Win32.
>
As I tried to point out in my previous mail, doing cross application
communication via windows messages is (was) quite common. Though the
*modern* way may be OLE, aka COM, aka ActiveX (, aka .NET :). 
But that would give a much more powerful and complex "solution", or 
simply overkill for GtkPlug/GtkSocket. 
Additionally I would not suggest to do this with plain "C", but using 
C++ and ATL for such things, which would obviously gives some really 
bad portability issues ...

Regards,
	Hans

Attachment: gtk-plug-socket-2001-05-06-hb.zip
Description: Zip archive

-------- 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]