Hi,

Attached is a patch to add a GTK3 GUI to vim.


1. Build

After applying this patch to the source tree,

$ ./configure --enable-gui=gtk3`; make

Note that the `configure` of the proposed patch chooses gtk2 unless
`--enable-gui=gtk3` is specified.

You'll get a bunch of warnings when compiling the GTK code (more than 1000
lines) due to `__attribute__((deprecated))`.  To ignore them and if you
want to catch other substantial warnings, I'd suggest to replace the above
`make` with

$ make CFLAGS+=-Wno-deprecated-declarations

With this, all "deprecated declarations" warnings should be gone.


2. Runtime/Usage

VimL's `has()` now recognizes `gui_gtk3` as well as `gui_gtk`, although I
haven't added any GTK+ 3-specific runtime stuff so far.

If `gvim` is linked against GTK+ 3.4 or later, tear-off menus are disabled
because those versions have deprecated them.

While the mnemonics are still working as before, the underlines to indicate
mnemonic characters won't appear on the menu items by default if `gvim` is
linked against GTK+ 3.10 or later.  Such usage of underlines has been
deprecated since GTK+ 3.10.

The font selection dialog now filters font families and hence shows
monospace fonts only.  Although I don't know how gvim's font dialog in the
GTK+ 1 era worked with a filter, I restored it in favor of the FIXME in the
comment of `gui_mch_font_dialog()`.



3. Technical Notes

 - The patch was made against ac80999 (v7.4.1180-1-gac80999, i.e., one
commit after Vim 7.4.1180).

 - Roughly speaking, the GTK3 code was added following the guide:
https://developer.gnome.org/gtk3/3.18/gtk-migrating-2-to-3.html , which
should give a clear idea what `GTK_DISABLE_DEPRECATED`,
`GDK_DISABLE_DEPRECATED`, `GSEAL_ENABLE` and `GTK_DISABLE_SINGLE_INCLUDES`
are and why they are heavily used in the patch.

 - For the GTK+ 3 code, all redering is now done with `cairo`; X11-like
stuff such as GC, GraphicsExposure and Visibility event handlings are all
gone.  Similar simplification can be seen in other places, too.  So, one
could say that the whole net GTK+ 3 code is simpler and shorter than that
of GTK+ 2.

 - The patch was developed against GTK+ 3.18.6.  I tried writing the code
in such a way that it would work with older GTK+ 3 versions, but am not
100% sure of that, as GTK+ 3 even changes much between minor versions.

 - I added GTK+ 3 code to netbeans.c and if_mzsch.c so that they can be
compiled successfully with the new GUI.  However, I haven't used the both
yet and currenly have no environment to get them to work for test.  I'd
appreciate it if someone would try the new GUI and check if it works fine
with them.

 - I paid much attention for keeping the existing GTK+ 2 code as it is, and
it was done successfully; the GTK+ 2 GUI shouldn't have any regression
after applying the patch.
----


Any feedback is welcome.

Best regards,
Kazunobu Kuriyama

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: gtk3.patch.gz
Description: GNU Zip compressed data

Raspunde prin e-mail lui