Re: Patch 7.2.442

2010-06-22 Fir de Conversatie James Vega
On Mon, Jun 21, 2010 at 11:35 PM, Bram Moolenaar b...@moolenaar.net wrote:

 James Vega wrote:

 On Sun, Jun 6, 2010 at 4:26 PM, Bram Moolenaar b...@moolenaar.net wrote:
  James Vega wrote:
  Personally, I'd prefer to remove all the GTK 1 code from Vim since GTK 1
  isn't supported by its upstream anymore and has been deprecated for
  years.  As it is, parts of Vim will need to be changed for compatibility
  with GTK 3 when that comes out, and supporting three different GTK
  versions just seems like overkill, in my opinion.
 
  What do others think about removing support for GTK 1?  It makes sense,
  any system where you would try to build Vim 7.3 should be able to
  install GTK 2 libraries.

 Attached is a patch to remove GTK 1 support.  The patch changes
 configure.in, so anyone that tests it will need to run make autoconf
 from the src directory before building.

 Things seem fine from my initial testing, but some extra testing,
 especially from people that use an input method with Vim (even if you
 are using a non-GTK build of gvim), would be useful.  The IM portion of the
 code was a particularly hairy mess of feature ifdefs.

  It will clean up the Vim source code.

 Indeed it did.  This ends up removing about 1% of the total lines of
 code.

 It appears you have removed too much.  In some places the code inside
 #ifdef FEAT_GUI_GTK was removed, but that is also used for GTK2.
 FEAT_GUI_GTK is defined both for GTK 1 and 2.

The places where I removed FEAT_GUI_GTK checks were wherever they were
paired with or inside a !HAVE_GTK2 check, since FEAT_GUI_GTK will only
be defined if HAVE_GTK2 is.

It just happens that a large part of mbyte.c is part of an #else ...
#endif corresponding to HAVE_GTK2 not being defined.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega james...@jamessan.com

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


Re: Patch 7.2.442

2010-06-22 Fir de Conversatie Bram Moolenaar

James Vega wrote:

  On Sun, Jun 6, 2010 at 4:26 PM, Bram Moolenaar b...@moolenaar.net wrote:
   James Vega wrote:
   Personally, I'd prefer to remove all the GTK 1 code from Vim since GTK 1
   isn't supported by its upstream anymore and has been deprecated for
   years.  As it is, parts of Vim will need to be changed for compatibility
   with GTK 3 when that comes out, and supporting three different GTK
   versions just seems like overkill, in my opinion.
  
   What do others think about removing support for GTK 1?  It makes sense,
   any system where you would try to build Vim 7.3 should be able to
   install GTK 2 libraries.
 
  Attached is a patch to remove GTK 1 support.  The patch changes
  configure.in, so anyone that tests it will need to run make autoconf
  from the src directory before building.
 
  Things seem fine from my initial testing, but some extra testing,
  especially from people that use an input method with Vim (even if you
  are using a non-GTK build of gvim), would be useful.  The IM portion of the
  code was a particularly hairy mess of feature ifdefs.
 
   It will clean up the Vim source code.
 
  Indeed it did.  This ends up removing about 1% of the total lines of
  code.
 
  It appears you have removed too much.  In some places the code inside
  #ifdef FEAT_GUI_GTK was removed, but that is also used for GTK2.
  FEAT_GUI_GTK is defined both for GTK 1 and 2.
 
 The places where I removed FEAT_GUI_GTK checks were wherever they were
 paired with or inside a !HAVE_GTK2 check, since FEAT_GUI_GTK will only
 be defined if HAVE_GTK2 is.
 
 It just happens that a large part of mbyte.c is part of an #else ...
 #endif corresponding to HAVE_GTK2 not being defined.

Yes, mbyte.c is confusing.  Context is a long way away, it appears I
missed an #ifdef around code that duplicates a lot of functions.
I'll look again.

-- 
hundred-and-one symptoms of being an internet addict:
228. You spend Saturday night making the counter on your home page
 pass that 2000 mark.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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


Re: Patch 7.2.442

2010-06-21 Fir de Conversatie Bram Moolenaar

James Vega wrote:

 On Sun, Jun 6, 2010 at 4:26 PM, Bram Moolenaar b...@moolenaar.net wrote:
  James Vega wrote:
  Personally, I'd prefer to remove all the GTK 1 code from Vim since GTK 1
  isn't supported by its upstream anymore and has been deprecated for
  years.  As it is, parts of Vim will need to be changed for compatibility
  with GTK 3 when that comes out, and supporting three different GTK
  versions just seems like overkill, in my opinion.
 
  What do others think about removing support for GTK 1?  It makes sense,
  any system where you would try to build Vim 7.3 should be able to
  install GTK 2 libraries.
 
 Attached is a patch to remove GTK 1 support.  The patch changes
 configure.in, so anyone that tests it will need to run make autoconf
 from the src directory before building.
 
 Things seem fine from my initial testing, but some extra testing,
 especially from people that use an input method with Vim (even if you
 are using a non-GTK build of gvim), would be useful.  The IM portion of the
 code was a particularly hairy mess of feature ifdefs.
 
  It will clean up the Vim source code.
 
 Indeed it did.  This ends up removing about 1% of the total lines of
 code.

It appears you have removed too much.  In some places the code inside
#ifdef FEAT_GUI_GTK was removed, but that is also used for GTK2.
FEAT_GUI_GTK is defined both for GTK 1 and 2.

Could you make an update of this patch?

-- 
hundred-and-one symptoms of being an internet addict:
226. You sit down at the computer right after dinner and your spouse
 says See you in the morning.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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


Re: Patch 7.2.442

2010-06-18 Fir de Conversatie Charles Campbell

Bram Moolenaar wrote:

What do others think about removing support for GTK 1?  It makes sense,
any system where you would try to build Vim 7.3 should be able to
install GTK 2 libraries.  It will clean up the Vim source code.

  
May I suggest that if GTK-1 is detected, that a message about the 
problem be issued:


#if defined(FEAT_GUI_GTK)  !defined(HAVE_GTK2)
# error GTK 1 is no longer supported
#endif

or something similar.

Regards,
Chip Campbell


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


Re: Patch 7.2.442

2010-06-18 Fir de Conversatie James Vega
On Fri, Jun 18, 2010 at 2:45 PM, Charles Campbell
charles.e.campb...@nasa.gov wrote:
 Bram Moolenaar wrote:

 What do others think about removing support for GTK 1?  It makes sense,
 any system where you would try to build Vim 7.3 should be able to
 install GTK 2 libraries.  It will clean up the Vim source code.



 May I suggest that if GTK-1 is detected, that a message about the problem be
 issued:

 #if defined(FEAT_GUI_GTK)  !defined(HAVE_GTK2)
 # error GTK 1 is no longer supported
 #endif

If GTK 1 support is removed, then that check would never be true.
FEAT_GUI_GTK is only defined if Vim is being built with a GTK gui,
so it's either being built against GTK 2 or it isn't using GTK.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega james...@jamessan.com

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


Re: Patch 7.2.442

2010-06-14 Fir de Conversatie Anand Hariharan


On Jun 6, 3:26 pm, Bram Moolenaar b...@moolenaar.net wrote:
 James Vega wrote:
  On Sat, Jun 05, 2010 at 10:37:39PM +0200, Patrick Texier wrote:
   Le Sat, 05 Jun 2010 16:16:06 +0200, Bram Moolenaar a écrit dans le
   message 201006051416.o55eg6to002...@masaka.moolenaar.net :

Patch 7.2.442 (after 7.2.201)

   Using Linux/GCC 3.2/GTK 1, I can't compile this patch. I think that
   gtk_selection_clear_targets is not available with GTK 1.

  It isn't and I don't see equivalent functionality in GTK 1's API.  One
  possibility is to keep the old code for builds using GTK 1, which would
  resurface the buggy interaction with OpenOffice.org for anyone still
  building against GTK 1.  Although, OpenOffice.org requires GTK 2, so you
  probably won't run into that problem.

  Personally, I'd prefer to remove all the GTK 1 code from Vim since GTK 1
  isn't supported by its upstream anymore and has been deprecated for
  years.  As it is, parts of Vim will need to be changed for compatibility
  with GTK 3 when that comes out, and supporting three different GTK
  versions just seems like overkill, in my opinion.

   gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)

  You're using a Linux distribution that was released 8 years ago, a year
  and a half after the last release of GTK 1.  I'm surprised this is the
  first new release of a piece of software that hasn't worked.

 What do others think about removing support for GTK 1?  It makes sense,
 any system where you would try to build Vim 7.3 should be able to
 install GTK 2 libraries.  It will clean up the Vim source code.


I do not wish to have the drag n' drop feature, so I explicitly
undefined it in features.h.  The subject patch causes compilation and
link problems with my changes in features.h.

The code could use some in clean-up src/gui_gtk_x11.c and src/option.c

- Anand

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


Re: Patch 7.2.442

2010-06-09 Fir de Conversatie Patrick Texier
On Mon, 07 Jun 2010 23:32:16 +0200, Bram Moolenaar wrote:

Hi Bram,

 Can you say a few words about why you are unable to install GTK 2, but
 are able to build and install Vim 7.3?

No, I don't have Vim 7.3.

I can keep Vim 7.2.441 on my old computer and you can remove GTK 1
support. 
-- 
Patrick Texier

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


Re: Patch 7.2.442

2010-06-08 Fir de Conversatie Matt Wozniski
On Sun, Jun 6, 2010 at 4:26 PM, Bram Moolenaar wrote:

 James Vega wrote:

 On Sat, Jun 05, 2010 at 10:37:39PM +0200, Patrick Texier wrote:
  Le Sat, 05 Jun 2010 16:16:06 +0200, Bram Moolenaar a écrit dans le
  message 201006051416.o55eg6to002...@masaka.moolenaar.net :
 
   Patch 7.2.442 (after 7.2.201)
 
  Using Linux/GCC 3.2/GTK 1, I can't compile this patch. I think that
  gtk_selection_clear_targets is not available with GTK 1.

 It isn't and I don't see equivalent functionality in GTK 1's API.  One
 possibility is to keep the old code for builds using GTK 1, which would
 resurface the buggy interaction with OpenOffice.org for anyone still
 building against GTK 1.  Although, OpenOffice.org requires GTK 2, so you
 probably won't run into that problem.

 Personally, I'd prefer to remove all the GTK 1 code from Vim since GTK 1
 isn't supported by its upstream anymore and has been deprecated for
 years.  As it is, parts of Vim will need to be changed for compatibility
 with GTK 3 when that comes out, and supporting three different GTK
 versions just seems like overkill, in my opinion.

  gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)

 You're using a Linux distribution that was released 8 years ago, a year
 and a half after the last release of GTK 1.  I'm surprised this is the
 first new release of a piece of software that hasn't worked.

 What do others think about removing support for GTK 1?  It makes sense,
 any system where you would try to build Vim 7.3 should be able to
 install GTK 2 libraries.  It will clean up the Vim source code.

I'm a fan of the idea.  I work on systems with the Motif gvim and the
GTK 2 gvim, but I don't think I've ever worked on a system with a GTK1
gvim.  The number of #ifdef's in the GUI code is ridiculous, so I
strongly support anything that will make life easier for Bram and
other contributors.

~Matt

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


Re: Patch 7.2.442

2010-06-07 Fir de Conversatie Patrick Texier
Le Mon, 07 Jun 2010 01:30:02 +0200, Tony Mechelynck a écrit dans le
message 4c0c2f7a.6000...@gmail.com :

 Well, if we find any bug in GTK1, we're on our own, and the only reply 
 we'll get from the GTK developers is Use GTK2 -- GTK1 has long been 
 unsupported. GTK2, like its predecessor, is open-source and ought to be 
 available (either by default or as an option) in any Linux distribution 
 and most other Unix-like OSes. Also it isn't as if it were the only 
 possibility: there are also Athena, Motif, etc.

GTK-1 is my only possibility and works fine. I can't install GTK2 and
Athena doesn't work with French keybord (keys ~ ` ¨/^): I have to use
digraphs for ë ę... I have the same problem with Elvis GUI.

If GTK-1 is removed, please remove the following lines from develop.txt:

78:
Vim tries to help as many users on as many platforms as possible.

84:
- Support many compilers and libraries.  Not everybody is able or
allowed to
  install another compiler or GUI library.
-- 
Patrick Texier

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


Re: Patch 7.2.442

2010-06-07 Fir de Conversatie Christian J. Robinson

On Mon, 7 Jun 2010, Patrick Texier wrote:

GTK-1 is my only possibility and works fine. I can't install GTK2 
and Athena doesn't work with French keybord (keys ~ ` ¨/^): I have 
to use digraphs for ë ę... I have the same problem with Elvis GUI.


Unfortunately your being limited to GTK-1 means you're most likely 
going to have problems with far more than just Vim in the coming 
weeks/months.


If GTK-1 is removed, please remove the following lines from 
develop.txt:


78:
Vim tries to help as many users on as many platforms as possible.


I see no reason to remove this line. Since, as pointed out previously 
in the thread, GTK-1 isn't even supported by the official developers 
any more.  And the wording is as many [...] as possible.



84:
- Support many compilers and libraries.  Not everybody is able or
allowed to install another compiler or GUI library.


Same as above, the wording is many, not all.

The harsh reality is that practicality and feasibility may prevent 
Vim's support of GTK-1 from continuing, even if we want to keep the 
support.


For example, look at :help compile-changes-7 and you'll see that GUI 
support for BeOS and Amiga had to be dropped a while back.


The plus side is that even if GTK-1 support is dropped in 7.3, you can 
still run the latest version of 7.2.



Just out of curiosity, what prevents you from installing, or having 
your system administrator install GTK2?


- Christian

--
Christian J. Robinson hept...@gmail.com

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


Re: Patch 7.2.442

2010-06-07 Fir de Conversatie Dennis Benzinger

Am 06.06.2010 22:26, schrieb Bram Moolenaar:

[...]
What do others think about removing support for GTK 1?  It makes sense,
any system where you would try to build Vim 7.3 should be able to
install GTK 2 libraries.  It will clean up the Vim source code.


Remove it. Anyone who can live with such an old GTK version probably can 
stay with Vim 7.2.



Regards,
Dennis Benzinger

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


Re: Patch 7.2.442

2010-06-06 Fir de Conversatie James Vega
On Sat, Jun 05, 2010 at 10:37:39PM +0200, Patrick Texier wrote:
 Le Sat, 05 Jun 2010 16:16:06 +0200, Bram Moolenaar a écrit dans le
 message 201006051416.o55eg6to002...@masaka.moolenaar.net :
 
  Patch 7.2.442 (after 7.2.201)
 
 Using Linux/GCC 3.2/GTK 1, I can't compile this patch. I think that
 gtk_selection_clear_targets is not available with GTK 1.

It isn't and I don't see equivalent functionality in GTK 1's API.  One
possibility is to keep the old code for builds using GTK 1, which would
resurface the buggy interaction with OpenOffice.org for anyone still
building against GTK 1.  Although, OpenOffice.org requires GTK 2, so you
probably won't run into that problem.

Personally, I'd prefer to remove all the GTK 1 code from Vim since GTK 1
isn't supported by its upstream anymore and has been deprecated for
years.  As it is, parts of Vim will need to be changed for compatibility
with GTK 3 when that comes out, and supporting three different GTK
versions just seems like overkill, in my opinion.

 gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)

You're using a Linux distribution that was released 8 years ago, a year
and a half after the last release of GTK 1.  I'm surprised this is the
first new release of a piece of software that hasn't worked.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega james...@jamessan.com


signature.asc
Description: Digital signature


Re: Patch 7.2.442

2010-06-06 Fir de Conversatie Bram Moolenaar

James Vega wrote:

 On Sat, Jun 05, 2010 at 10:37:39PM +0200, Patrick Texier wrote:
  Le Sat, 05 Jun 2010 16:16:06 +0200, Bram Moolenaar a écrit dans le
  message 201006051416.o55eg6to002...@masaka.moolenaar.net :
  
   Patch 7.2.442 (after 7.2.201)
  
  Using Linux/GCC 3.2/GTK 1, I can't compile this patch. I think that
  gtk_selection_clear_targets is not available with GTK 1.
 
 It isn't and I don't see equivalent functionality in GTK 1's API.  One
 possibility is to keep the old code for builds using GTK 1, which would
 resurface the buggy interaction with OpenOffice.org for anyone still
 building against GTK 1.  Although, OpenOffice.org requires GTK 2, so you
 probably won't run into that problem.
 
 Personally, I'd prefer to remove all the GTK 1 code from Vim since GTK 1
 isn't supported by its upstream anymore and has been deprecated for
 years.  As it is, parts of Vim will need to be changed for compatibility
 with GTK 3 when that comes out, and supporting three different GTK
 versions just seems like overkill, in my opinion.
 
  gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
 
 You're using a Linux distribution that was released 8 years ago, a year
 and a half after the last release of GTK 1.  I'm surprised this is the
 first new release of a piece of software that hasn't worked.

What do others think about removing support for GTK 1?  It makes sense,
any system where you would try to build Vim 7.3 should be able to
install GTK 2 libraries.  It will clean up the Vim source code.

-- 
Hit any key to continue it said, but nothing happened after F sharp.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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


Re: Patch 7.2.442

2010-06-06 Fir de Conversatie sc
On Sunday 06 June 2010 15:26:58 Bram Moolenaar wrote:

 What do others think about removing support for GTK 1?  It
  makes sense, any system where you would try to build Vim 7.3
  should be able to install GTK 2 libraries.  It will clean up
  the Vim source code.

you'll get no argument from me over that -- i love clean code and 
have no use for GTK-1 support

sc

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


Re: Patch 7.2.442

2010-06-06 Fir de Conversatie Lech Lorens
On 06-Jun-2010 Bram Moolenaar b...@moolenaar.net wrote:
 What do others think about removing support for GTK 1?  It makes sense,
 any system where you would try to build Vim 7.3 should be able to
 install GTK 2 libraries.  It will clean up the Vim source code.

I like the idea - remove it.

-- 
Cheers,
Lech

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


Re: Patch 7.2.442

2010-06-06 Fir de Conversatie Christian J. Robinson

On Mon, 7 Jun 2010, Lech Lorens wrote:


On 06-Jun-2010 Bram Moolenaar b...@moolenaar.net wrote:

What do others think about removing support for GTK 1?  It makes 
sense, any system where you would try to build Vim 7.3 should be 
able to install GTK 2 libraries.  It will clean up the Vim source 
code.


I like the idea - remove it.


For what it's worth, I support this idea as well.

- Christian

--
Christian J. Robinson hept...@gmail.com

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


Re: Patch 7.2.442

2010-06-06 Fir de Conversatie Tony Mechelynck

On 06/06/10 22:26, Bram Moolenaar wrote:
[...]

What do others think about removing support for GTK 1?  It makes sense,
any system where you would try to build Vim 7.3 should be able to
install GTK 2 libraries.  It will clean up the Vim source code.



Well, if we find any bug in GTK1, we're on our own, and the only reply 
we'll get from the GTK developers is Use GTK2 -- GTK1 has long been 
unsupported. GTK2, like its predecessor, is open-source and ought to be 
available (either by default or as an option) in any Linux distribution 
and most other Unix-like OSes. Also it isn't as if it were the only 
possibility: there are also Athena, Motif, etc.


And finally, in two of the help paragraphs under |gui-x11-compiling| and 
|gui-x11-gtk|, the GTK2 build of gvim is labeled as experimental. I 
believe that by now it has had enough real-conditions testing not to 
deserve that label anymore.



Best regards,
Tony.
--
Chipmunks roasting on an open fire
Jack Frost ripping up your nose
Yuletide carolers being thrown in the fire
And folks dressed up like buffaloes
Everybody knows a turkey slaughtered in the snow
Helps to make the season right
Tiny tots with their eyes all gouged out
Will find it hard to see tonight
They know that Santa's on his way
He's loaded lots of guns and bullets on his sleigh
And every mother's child is sure to spy
To see if reindeer really scream when they die
And so I'm offering this simple phrase
To kids from one to ninety two
Although it's been said many times, many ways
Merry Christmas, Merry Christmas, Merry Christmas, Fuck you!!

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


Patch 7.2.442

2010-06-05 Fir de Conversatie Bram Moolenaar

Patch 7.2.442 (after 7.2.201)
Problem:Copy/paste with OpenOffice doesn't work.
Solution:   Do not offer the HTML target when it is not supported. (James
Vega)
Files:  src/gui_gtk_x11.c, src/option.c, src/proto/gui_gtk_x11.pro


*** ../vim-7.2.441/src/gui_gtk_x11.c2010-02-11 18:19:32.0 +0100
--- src/gui_gtk_x11.c   2010-06-05 12:42:23.0 +0200
***
*** 1433,1438 
--- 1433,1442 
  }
  #endif /* !HAVE_GTK2 */
  
+ /* Chop off any traiing NUL bytes.  OpenOffice sends these. */
+ while (len  0  text[len - 1] == NUL)
+   --len;
+ 
  clip_yank_selection(motion_type, text, (long)len, cbd);
  received_selection = RS_OK;
  vim_free(tmpbuf);
***
*** 3463,3468 
--- 3467,3532 
  #endif /* FEAT_GUI_TABLINE */
  
  /*
+  * Add selection targets for PRIMARY and CLIPBOARD selections.
+  */
+ void
+ gui_gtk_set_selection_targets(void)
+ {
+ int   i, j = 0;
+ int   n_targets = N_SELECTION_TARGETS;
+ GtkTargetEntry  targets[N_SELECTION_TARGETS];
+ 
+ for (i = 0; i  (int)N_SELECTION_TARGETS; ++i)
+ {
+ #ifdef FEAT_MBYTE
+   /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
+* return something, instead of trying another target. Therefore only
+* offer TARGET_HTML when it works. */
+   if (!clip_html  selection_targets[i].info == TARGET_HTML)
+   n_targets--;
+   else
+ #endif
+   targets[j++] = selection_targets[i];
+ }
+ 
+ gtk_selection_clear_targets(gui.drawarea, (GdkAtom)GDK_SELECTION_PRIMARY);
+ gtk_selection_clear_targets(gui.drawarea, 
(GdkAtom)clip_plus.gtk_sel_atom);
+ gtk_selection_add_targets(gui.drawarea,
+ (GdkAtom)GDK_SELECTION_PRIMARY,
+ targets, n_targets);
+ gtk_selection_add_targets(gui.drawarea,
+ (GdkAtom)clip_plus.gtk_sel_atom,
+ targets, n_targets);
+ }
+ 
+ /*
+  * Set up for receiving DND items.
+  */
+ void
+ gui_gtk_set_dnd_targets(void)
+ {
+ int   i, j = 0;
+ int   n_targets = N_DND_TARGETS;
+ GtkTargetEntry  targets[N_DND_TARGETS];
+ 
+ for (i = 0; i  (int)N_DND_TARGETS; ++i)
+ {
+ #ifdef FEAT_MBYTE
+   if (!clip_html  selection_targets[i].info == TARGET_HTML)
+   n_targets--;
+   else
+ #endif
+   targets[j++] = dnd_targets[i];
+ }
+ 
+ gtk_drag_dest_unset(gui.drawarea);
+ gtk_drag_dest_set(gui.drawarea,
+ GTK_DEST_DEFAULT_ALL,
+ targets, n_targets,
+ GDK_ACTION_COPY);
+ }
+ 
+ /*
   * Initialize the GUI.Create all the windows, set up all the 
callbacks etc.
   * Returns OK for success, FAIL when the GUI can't be started.
   */
***
*** 3925,3939 
  gtk_signal_connect(GTK_OBJECT(gui.drawarea), selection_received,
   GTK_SIGNAL_FUNC(selection_received_cb), NULL);
  
! /*
!  * Add selection targets for PRIMARY and CLIPBOARD selections.
!  */
! gtk_selection_add_targets(gui.drawarea,
! (GdkAtom)GDK_SELECTION_PRIMARY,
! selection_targets, N_SELECTION_TARGETS);
! gtk_selection_add_targets(gui.drawarea,
! (GdkAtom)clip_plus.gtk_sel_atom,
! selection_targets, N_SELECTION_TARGETS);
  
  gtk_signal_connect(GTK_OBJECT(gui.drawarea), selection_get,
   GTK_SIGNAL_FUNC(selection_get_cb), NULL);
--- 3989,3995 
  gtk_signal_connect(GTK_OBJECT(gui.drawarea), selection_received,
   GTK_SIGNAL_FUNC(selection_received_cb), NULL);
  
! gui_gtk_set_selection_targets();
  
  gtk_signal_connect(GTK_OBJECT(gui.drawarea), selection_get,
   GTK_SIGNAL_FUNC(selection_get_cb), NULL);
***
*** 4057,4063 
  return TRUE;
  }
  
- 
  /*
   * Open the GUI window which was created by a call to gui_mch_init().
   */
--- 4113,4118 
***
*** 4225,4237 
   GTK_SIGNAL_FUNC(form_configure_event), NULL);
  
  #ifdef FEAT_DND
! /*
!  * Set up for receiving DND items.
!  */
! gtk_drag_dest_set(gui.drawarea,
! GTK_DEST_DEFAULT_ALL,
! dnd_targets, N_DND_TARGETS,
! GDK_ACTION_COPY);
  
  gtk_signal_connect(GTK_OBJECT(gui.drawarea), drag_data_received,
   GTK_SIGNAL_FUNC(drag_data_received_cb), NULL);
--- 4280,4287 
   GTK_SIGNAL_FUNC(form_configure_event), NULL);
  
  #ifdef FEAT_DND
! /* Set up for receiving DND items. */
! gui_gtk_set_dnd_targets();
  
  gtk_signal_connect(GTK_OBJECT(gui.drawarea), drag_data_received,
   GTK_SIGNAL_FUNC(drag_data_received_cb), NULL

Re: Patch 7.2.442

2010-06-05 Fir de Conversatie Patrick Texier
Le Sat, 05 Jun 2010 16:16:06 +0200, Bram Moolenaar a écrit dans le
message 201006051416.o55eg6to002...@masaka.moolenaar.net :

 Patch 7.2.442 (after 7.2.201)

Using Linux/GCC 3.2/GTK 1, I can't compile this patch. I think that
gtk_selection_clear_targets is not available with GTK 1.

/home/pt/dev/stable/vim72/src/gui_gtk_x11.c:3492: undefined reference to
`gtk_selection_clear_targets'
/home/pt/dev/stable/vim72/src/gui_gtk_x11.c:3493: undefined reference to
`gtk_selection_clear_targets'
collect2: ld returned 1 exit status
link.sh: Linking doesn't work at all, removing auto/link.sed
make[1]: *** [vim] Erreur 1
make[1]: Quitte le répertoire `/home/pt/dev/stable/vim72/src'
make: *** [first] Erreur 2


[...@localhost vim72]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking
--enable-long-long --enable-__cxa_atexit
--enable-languages=c,c++,ada,f77,objc,java
--host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)

-- 
Patrick Texier

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