2017-09-27 22:26 GMT+09:00 Ken Takata <[email protected]>:
> Hi,
>
> 2016/8/10 Wed 22:04:40 UTC+9 Ken Takata wrote:
> > Hi Bram,
> >
> > 2016/3/16 Wed 1:19:07 UTC+9 Ken Takata wrote:
> > > Hi,
> > >
> > > 2015/11/24 Tue 23:19:13 UTC+9 Bram Moolenaar wrote:
> > > > Ken Takata wrote:
> > > >
> > > > > I'm afraid that you are missing the following patch because the
> todo item is
> > > > > not updated:
> > > > > https://groups.google.com/d/msg/vim_dev/_X0cpMreBiw/n4juz5_eBAAJ
> > > > >
> > > > > > BTW, Below is also need to be modified, so that, Abe fixed this.
> > > > > > > Patch for drag&drop reordering of GUI tab pages reordering.
> > > > > > > (Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
> > > > > >
> > > > > > https://gist.github.com/nocd5/165286495c782b815b94
> > > > >
> > > > > The tabline-dnd patch needed to be updated after 7.4.709, and
> Masamichi Abe
> > > > > did it. I confirmed that Masamichi's latest patch works fine with
> 7.4.936
> > > > > (both on Windows and Linux).
> > > > > https://gist.github.com/nocd5/165286495c782b815b94
> > > >
> > > > I'll add the github link to the todo item.
> > >
> > > I have updated the tabline-dnd patch to support GTK3.
> > > Please check the attached patch.
> >
> > I have updated the tabline-dnd patch. An error when using cproto has been
> > fixed. I'm waiting this patch to be included for a long time. I think
> this
> > patch is very useful especially for beginners.
>
> I'm waiting this patch to be merged nearly 4 years...
> I feel sorry to Masamichi, because I suggested to him writing the Windows
> part
> of this patch, and this is the first patch to Vim for him.
>
> This patch is small enough and it won't break existing behavior.
> We can already use D&D on CUI tab pages line. There's no reason to avoid
> supporting D&D on GUI tab pages line.
>
> The patch is not changed from previous one. It is also available at:
> https://bitbucket.org/k_takata/vim-ktakata-mq/src/
> 045f9ace55f8dbfb53de2aacd1387d3e05fb36fd/tabline-dnd.patch?
> at=default&fileviewer=file-view-default
>
> Regards,
> Ken Takata
>
I tried the patch. As far as the GTK+ part was concerned, I didn't run
into any noticeable trouble with it at that time.
As I don't know any of the reasons why the patch hasn't been merged yet, it
is quite possible that what I'm going to write below is utterly beside the
point for the patch to get acknowledged successfully. Still, I think it
nicer if it would be refactored like this:
1. Declare some interface functions, say, gui_has_tabline_dnd(),
gui_tabline_dnd_tabpage_move(), and
gui_tabline_dnd_predicate_on_something(), and then implement them in gui.c
like this:
bool gui_has_tabline_dnd(void) { return gui_mch_has_tabline_dnd(); }
bool gui_tabline_dnd_predicate_on_something(int index) {
return gui_mch_tabline_dnd_predicate_on_something(index);
}
void gui_tabline_dnd_tabpage_move(int index) {
if (gui_has_tabline_dnd()) {
if (gui_tabline_dnd_predicate_on_something(index)) {
tabpace_move(index + 1);
} else {
tabpage_move(index);
}
}
}
(I think you've already got an idea as to what
gui_tabline_dnd_predicate_on_something() stands for. Please rename it to a
nice name representing the predicate better, together with its mch friend.)
2. In __every__ gui_<gui name>.c, give an implementation (or an appropriate
stub in case the GUI in question doesn't support tabline-dnd) to
gui_mch_has_tabline_dnd() and gui_mch_tabline_dnd_predicate_on_something(),
respectively.
3. In the tabline-dnd event/signal handler, replace the logic which
directly invokes tabpage_move() with that using
gui_tabline_dnd_tabpage_move() instead.
Needless to say, this is an off-hand example to briefly illustrate one of
the general ideas of the GUI layer. Please go for it mutatis mutandis if
you like it. As you've already noticed, not only the GUI libraries It
relies on but the GUI layer itself is written in (a kind of) OOP; since C
compilers don't help us with that at all, and since we have neither our own
type system nor class object, we have to manually code all the way what
C++/Objective-C compilers do for us automatically behind the scene.
Good luck,
Kazunobu
>
> --
> --
> 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.
>
--
--
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.