Re: [PATCH] GtkLayout for Win32.




Wolfgang Glas <Wolfgang.Glas@hfm.tu-graz.ac.at> writes:

> Hi,
> 
>   I just hacked out a rewrite gtklayout, which is running under Win32 at a first
> glance.
> 
> I uploaded a patch to the gtk+-1.2.4 distribution to ftp.gimp.org and include
> the whole source file gtklayout.c and a README file to this mail and hope, that
> it turns out to be useful.

It would be more useful to send in such a patch as a diff against
the existing gtklayout.c, so we can tell what changed.

> Problem fixed:
>     
>    The Guffaw-scrolling of gtklayout.c was heavily dependent on X11 event calls,
> which wasn't compatible with Win32. 
> 
>    Also Win32 does not support static Gravity, so I implemented a fallback
> scrolling method, which works halfway, but I consider it to be useful because
> I get good results with gtkplot-4.0 under Win32.

I believe this is the wrong approach. All the complexity
of gtklayout.c is an attempt to get around limitations in
X11 that win32 does not share.

  - Windows has call to scroll the contents of a window.
  - Windows does not have coordinate limitations of 32k.

So, basically, gtklayout.c needs to have a separate (much
simpler) implementation on Win32 that takes advantage of
these advantages.
 
> Technicalities:
> 
>   This patch is an all-platform re-write of The guffaw-scrolling 
> in gtklayout.c.
> 
>   As I can't handle configure events for the bin_window using gdk-calls, 
> I decided to mark
> the temporary expose events from the scrolling by a contaminated
> expose-event, which tells the expose-event handler to treat the temporary
> exposures just the way that the original gtklayout.c did.
 
>   I also had to hack a facility to pop the expose events from the gdk
> event stack instead of using X11-filters. This code should be replaced
> by a gdk_event_... call, which works just like XCheckIfEvent or some
> call which extends the possibilities of gdk_event_get_graphics_expose, which
> is far too less flexible for the requirements of guffaw-scrolling.

The problem with this is that the translation from XEvent to
GdkEvent actually affects the state of GDK. So doing this may
screw things up. This is also why I removed the original 
gdk_event_check() call ... it had the possibility of creating
all sorts of weird affects.
 
>   I tested the patch under IRIX-6.5 with gcc-2.95.1 and under Win32
> using Tor Lillquist's gtk+19990828 snapshot. My aim was to port an application
> which uses gtkplot-4.0 to Win32, which succeeded with this patch.
> 
>   At my advice the patch should be carefully tested with a set of X Servers
> and platforms. Maybe the original author Mark Owen should also srtess-test
> the new scrolling source in order to make it a reliable replacement for
> the former version.

Who? ;-)

Regards,
                                        Owen



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