]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.107
- use new bonobo patch (20040115)
[packages/vim.git] / 6.2.107
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.107 (extra)
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 6.2.107 (extra)
11 Problem:    The NetBeans interface cannot be used on Win32.
12 Solution:   Add support for the NetBeans for Win32.  Add support for reading
13             XPM files on Win32.  Also fixes that a sign icon with a space in
14             the file name did not work through the NetBeans interface.
15             (Sergey Khorev)
16             Also: avoid repeating error messages when the connection is lost.
17 Files:      Makefile, runtime/doc/netbeans.txt, src/Make_bc5.mak,
18             src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak,
19             src/bigvim.bat, src/feature.h, src/gui_beval.c, src/gui_beval.h,
20             src/gui_w32.c, src/gui_w48.c, src/menu.c, src/nbdebug.c,
21             src/nbdebug.h, src/netbeans.c, src/os_mswin.c, src/os_win32.h,
22             src/proto/gui_beval.pro, src/proto/gui_w32.pro,
23             src/proto/netbeans.pro, src/proto.h, src/version.c, src/vim.h,
24             src/xpm_w32.c, src/xpm_w32.h
25
26
27 *** ../vim-6.2.106/Makefile     Sun Jun  1 12:07:20 2003
28 --- Makefile    Sun Oct 12 12:19:02 2003
29 ***************
30 *** 438,443 ****
31 --- 438,445 ----
32                 src/vim16.rc \
33                 src/vimrun.c \
34                 src/vimtbar.h \
35 +               src/xpm_w32.c \
36 +               src/xpm_w32.h \
37                 src/xxd/Make_bc3.mak \
38                 src/xxd/Make_bc5.mak \
39                 src/xxd/Make_cyg.mak \
40 ***************
41 *** 564,569 ****
42 --- 566,572 ----
43                 src/gui_riscos.h \
44                 src/if_sniff.c \
45                 src/if_sniff.h \
46 +               src/infplist.xml \
47                 src/link.390 \
48                 src/os_beos.c \
49                 src/os_beos.h \
50 *** ../vim-6.2.106/runtime/doc/netbeans.txt     Sun Jun  1 16:04:00 2003
51 --- runtime/doc/netbeans.txt    Fri Sep 12 21:37:19 2003
52 ***************
53 *** 1,4 ****
54 ! *netbeans.txt*  For Vim version 6.2.  Last change: 2003 Jun 01
55   
56   
57                   VIM REFERENCE MANUAL    by Gordon Prieur
58 --- 1,4 ----
59 ! *netbeans.txt*  For Vim version 6.2.  Last change: 2003 Sep 12
60   
61   
62                   VIM REFERENCE MANUAL    by Gordon Prieur
63 ***************
64 *** 67,72 ****
65 --- 67,77 ----
66   ==============================================================================
67   3. Configuring Vim for NetBeans                       *netbeans-configure*
68   
69 + For more help installing vim, please read |usr_90.txt| in the Vim User Manual.
70
71
72 + On Unix
73
74   When running configure without arguments the NetBeans interface should be
75   included.  That is, if the configure check to find out if your system supports
76   the required features succeeds.
77 ***************
78 *** 81,87 ****
79   If Motif support is required the user must supply XPM libraries. See
80   |workshop-xpm| for details on obtaining the latest version of XPM.
81   
82 ! For more help installing vim, please read |usr_90.txt| in the Vim User Manual.
83   
84   ==============================================================================
85   4. Downloading NetBeans                                       *netbeans-download*
86 --- 86,99 ----
87   If Motif support is required the user must supply XPM libraries. See
88   |workshop-xpm| for details on obtaining the latest version of XPM.
89   
90
91 ! On MS-Windows
92
93 ! The Win32 support is now in beta stage.
94
95 ! To use XPM signs on Win32 (e.g. when using with Netbeans) you can compile
96 ! XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/xpm
97 ! (for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
98   
99   ==============================================================================
100   4. Downloading NetBeans                                       *netbeans-download*
101 ***************
102 *** 391,397 ****
103                 Not implemented.
104   
105   setDot off    Make the buffer the current buffer and set the cursor at the
106 !               specified position.
107                 In version 2.1 "lnum/col" can be used instead of "off".
108   
109   setExitDelay seconds
110 --- 411,418 ----
111                 Not implemented.
112   
113   setDot off    Make the buffer the current buffer and set the cursor at the
114 !               specified position.  If there are folds they are opened to
115 !               make the cursor line visible.
116                 In version 2.1 "lnum/col" can be used instead of "off".
117   
118   setExitDelay seconds
119 *** ../vim-6.2.106/src/Make_bc5.mak     Tue May 13 20:21:37 2003
120 --- src/Make_bc5.mak    Fri Sep 12 21:42:02 2003
121 ***************
122 *** 72,77 ****
123 --- 72,80 ----
124   #             (BIG for WIN32, SMALL for DOS16)
125   # WINVER      0x400 or 0x500: minimum Win32 version to support (0x400)
126   # CSCOPE      no or yes: include support for Cscope interface (yes)
127 + # NETBEANS    no or yes: include support for Netbeans interface (yes if GUI
128 + #             is yes)
129 + # XPM         define to path to XPM dir to get support for loading XPM images.
130   
131   ### BOR: root of the BC installation
132   !if ("$(BOR)"=="")
133 ***************
134 *** 114,119 ****
135 --- 117,127 ----
136   CSCOPE = yes
137   !endif
138   
139 + ### NETBEANS: yes to enable NetBeans interface support, no to disable it
140 + !if ("$(NETBEANS)"=="") && ("$(GUI)"=="yes")
141 + NETBEANS = yes
142 + !endif
143
144   ### PERL: uncomment this line if you want perl support in vim
145   # PERL=c:\perl
146   
147 ***************
148 *** 190,196 ****
149         ("$(RUBY)"=="") && \
150         ("$(ICONV)"!="yes") && \
151         ("$(IME)"!="yes") && \
152 !       ("$(MBYTE)"!="yes")
153   FASTCALL = yes
154   !endif
155   
156 --- 198,205 ----
157         ("$(RUBY)"=="") && \
158         ("$(ICONV)"!="yes") && \
159         ("$(IME)"!="yes") && \
160 !       ("$(MBYTE)"!="yes") && \
161 !       ("$(XPM)"=="")
162   FASTCALL = yes
163   !endif
164   
165 ***************
166 *** 372,377 ****
167 --- 381,399 ----
168   DEFINES = $(DEFINES) -DFEAT_CSCOPE
169   !endif
170   
171 + !if ("$(NETBEANS)"=="yes")
172 + DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG
173 + !if ("$(DEBUG)"=="yes")
174 + DEFINES = $(DEFINES) -DNBDEBUG
175 + NBDEBUG_DEP = nbdebug.h nbdebug.c
176 + !endif
177 + !endif
178
179 + !ifdef XPM
180 + DEFINES = $(DEFINES) -DFEAT_XPM_W32
181 + INCLUDE = $(XPM)\include;$(INCLUDE)
182 + !endif
183
184   !if ("$(GUI)"=="yes")
185   DEFINES = $(DEFINES) -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
186   !if ("$(DEBUG)"=="yes")
187 ***************
188 *** 448,454 ****
189   LINK  = $(BOR)\BIN\ILink32
190   !endif
191   CC   = $(BOR)\BIN\Bcc32
192 ! LFLAGS        = -OS -r -Tpe -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
193   LFLAGSDLL  = -Tpd -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
194   CFLAGS = -w-aus -w-par -w-pch -I$(INCLUDE) -d -x- -RT- -k- -Oi $(HEADERS) -f-
195   !endif
196 --- 470,476 ----
197   LINK  = $(BOR)\BIN\ILink32
198   !endif
199   CC   = $(BOR)\BIN\Bcc32
200 ! LFLAGS        = -OS -Tpe -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
201   LFLAGSDLL  = -Tpd -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
202   CFLAGS = -w-aus -w-par -w-pch -I$(INCLUDE) -d -x- -RT- -k- -Oi $(HEADERS) -f-
203   !endif
204 ***************
205 *** 512,518 ****
206         $(OBJDIR)\normal.obj \
207         $(OBJDIR)\ops.obj \
208         $(OBJDIR)\option.obj \
209 -       $(OBJDIR)\pathdef.obj \
210         $(OBJDIR)\quickfix.obj \
211         $(OBJDIR)\regexp.obj \
212         $(OBJDIR)\screen.obj \
213 --- 534,539 ----
214 ***************
215 *** 523,529 ****
216         $(OBJDIR)\ui.obj \
217         $(OBJDIR)\undo.obj \
218         $(OBJDIR)\version.obj \
219 !       $(OBJDIR)\window.obj
220   
221   !if ("$(OLE)"=="yes")
222   vimobj = $(vimobj) \
223 --- 544,551 ----
224         $(OBJDIR)\ui.obj \
225         $(OBJDIR)\undo.obj \
226         $(OBJDIR)\version.obj \
227 !       $(OBJDIR)\window.obj \
228 !       $(OBJDIR)\pathdef.obj
229   
230   !if ("$(OLE)"=="yes")
231   vimobj = $(vimobj) \
232 ***************
233 *** 550,560 ****
234       $(OBJDIR)\if_tcl.obj
235   !endif
236   
237 ! !ifdef CSCOPE
238   vimobj = $(vimobj) \
239       $(OBJDIR)\if_cscope.obj
240   !endif
241   
242   !if ("$(VIMDLL)"=="yes")
243   vimdllobj = $(vimobj)
244   !if ("$(DEBUG)"=="yes")
245 --- 572,592 ----
246       $(OBJDIR)\if_tcl.obj
247   !endif
248   
249 ! !if ("$(CSCOPE)"=="yes")
250   vimobj = $(vimobj) \
251       $(OBJDIR)\if_cscope.obj
252   !endif
253   
254 + !if ("$(NETBEANS)"=="yes")
255 + vimobj = $(vimobj) \
256 +     $(OBJDIR)\netbeans.obj $(OBJDIR)\gui_beval.obj
257 + !endif
258
259 + !ifdef XPM
260 + vimobj = $(vimobj) \
261 +     $(OBJDIR)\xpm_w32.obj
262 + !endif
263
264   !if ("$(VIMDLL)"=="yes")
265   vimdllobj = $(vimobj)
266   !if ("$(DEBUG)"=="yes")
267 ***************
268 *** 620,625 ****
269 --- 652,663 ----
270   !if ("$(CSCOPE)"=="yes")
271   MSG = $(MSG) CSCOPE
272   !endif
273 + !if ("$(NETBEANS)"=="yes")
274 + MSG = $(MSG) NETBEANS
275 + !endif
276 + !ifdef XPM
277 + MSG = $(MSG) XPM
278 + !endif
279   !ifdef PERL
280   MSG = $(MSG) PERL
281   ! if "$(DYNAMIC_PERL)" == "yes"
282 ***************
283 *** 728,733 ****
284 --- 766,774 ----
285   !ifdef TCL
286         -@del tcl.lib
287   !endif
288 + !ifdef XPM
289 +       -@del xpm.lib
290 + !endif
291         cd xxd
292         $(MAKE) /f Make_bc5.mak BOR="$(BOR)" clean
293         cd ..
294 ***************
295 *** 762,767 ****
296 --- 803,811 ----
297   !ifdef TCL
298         $(TCL_LIB_FLAG)tcl.lib+
299   !endif
300 + !ifdef XPM
301 +       xpm.lib+
302 + !endif
303   !if ("$(USEDLL)"=="yes")
304         cw32i.lib
305   !else
306 ***************
307 *** 808,813 ****
308 --- 852,860 ----
309   !ifdef TCL
310         $(TCL_LIB_FLAG)tcl.lib+
311   !endif
312 + !ifdef XPM
313 +       xpm.lib+
314 + !endif
315   !if ("$(USEDLL)"=="yes")
316         cw32i.lib
317   !else
318 ***************
319 *** 842,847 ****
320 --- 889,900 ----
321   $(OBJDIR)\if_tcl.obj: if_tcl.c tcl.lib
322         $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_tcl.c
323   
324 + $(OBJDIR)\xpm_w32.obj: xpm_w32.c xpm.lib
325 +       $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc xpm_w32.c
326
327 + $(OBJDIR)\netbeans.obj: netbeans.c $(NBDEBUG_DEP)
328 +       $(CC) $(CCARG) $(CC1) $(CC2)$@ netbeans.c
329
330   $(OBJDIR)\vim.res: vim.rc version.h tools.bmp tearoff.bmp \
331                 vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
332         $(BRC) -fo$(OBJDIR)\vim.res -i $(BOR)\include -w32 -r vim.rc @&&|
333 ***************
334 *** 876,881 ****
335 --- 929,939 ----
336   
337   ruby.lib: $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
338         coff2omf $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib $@
339
340 + # For some reason, the coff2omf method doesn't work on libXpm.lib, so
341 + # we have to manually generate an import library straight from the DLL.
342 + xpm.lib: $(XPM)\lib\libXpm.lib
343 +       implib -a $@ $(XPM)\bin\libXpm.dll
344   
345   tcl.lib: $(TCL_LIB)
346   !if ("$(DYNAMIC_TCL)" == "yes")
347 *** ../vim-6.2.106/src/Make_cyg.mak     Sun Jul 27 13:40:24 2003
348 --- src/Make_cyg.mak    Fri Sep 12 21:52:50 2003
349 ***************
350 *** 4,10 ****
351   # This compiles Vim as a Windows application.  If you want Vim to run as a
352   # Cygwin application use the Makefile (just like on Unix).
353   #
354 ! # Last updated by Dan Sharp.  Last Change: 2003 Jun 22
355   #
356   # GUI         no or yes: set to yes if you want the GUI version (yes)
357   # PERL                define to path to Perl dir to get Perl support (not defined)
358 --- 4,10 ----
359   # This compiles Vim as a Windows application.  If you want Vim to run as a
360   # Cygwin application use the Makefile (just like on Unix).
361   #
362 ! # Last updated by Dan Sharp.  Last Change: 2003 Sep 12
363   #
364   # GUI         no or yes: set to yes if you want the GUI version (yes)
365   # PERL                define to path to Perl dir to get Perl support (not defined)
366 ***************
367 *** 35,40 ****
368 --- 35,43 ----
369   # WINVER      Lowest Win32 version to support.  (0x400)
370   # CSCOPE      no or yes: to include cscope interface support (yes)
371   # OPTIMIZE    SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
372 + # NETBEANS    no or yes: to include netbeans interface support (yes when GUI
373 + #             is yes)
374 + # XPM         define to path to XPM dir to get XPM image support (not defined) 
375   #>>>>> choose options:
376   ifndef GUI
377   GUI=yes
378 ***************
379 *** 76,81 ****
380 --- 79,90 ----
381   CSCOPE = yes
382   endif
383   
384 + ifndef NETBEANS
385 + ifeq ($(GUI),yes)
386 + NETBEANS = yes
387 + endif
388 + endif
389
390   ifndef OPTIMIZE
391   OPTIMIZE = MAXSPEED
392   endif
393 ***************
394 *** 266,271 ****
395 --- 275,301 ----
396   endif
397   
398   ##############################
399 + ifeq (yes, $(NETBEANS))
400 + DEFINES += -DFEAT_NETBEANS_INTG
401 + EXTRA_OBJS += $(OUTDIR)/netbeans.o $(OUTDIR)/gui_beval.o
402 + EXTRA_LIBS += -lws2_32
403
404 + ifeq (yes, $(DEBUG))
405 + DEFINES += -DNBDEBUG
406 + NBDEBUG_DEP = nbdebug.h nbdebug.c
407 + endif
408
409 + endif
410
411 + ##############################
412 + ifdef XPM
413 + DEFINES += -DFEAT_XPM_W32
414 + INCLUDES += -I$(XPM)/include
415 + EXTRA_OBJS += $(OUTDIR)/xpm_w32.o
416 + EXTRA_LIBS += -L$(XPM)/lib -lXpm
417 + endif
418
419 + ##############################
420   ifeq (yes, $(OLE))
421   DEFINES += -DFEAT_OLE
422   EXTRA_OBJS += $(OUTDIR)/if_ole.o
423 ***************
424 *** 417,422 ****
425 --- 447,455 ----
426   
427   $(OUTDIR)/if_ruby.o:  if_ruby.c $(INCL)
428         $(CC) -c $(CFLAGS) -U_WIN32 if_ruby.c -o $(OUTDIR)/if_ruby.o
429
430 + $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP)
431 +       $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
432   
433   $(OUTDIR)/vimrc.o:    vim.rc version.h gui_w32_rc.h
434         $(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
435 *** ../vim-6.2.106/src/Make_ming.mak    Tue May 27 21:15:20 2003
436 --- src/Make_ming.mak   Fri Sep 12 22:03:17 2003
437 ***************
438 *** 52,59 ****
439   OLE=no
440   # Set the default $(WINVER) to make it work with pre-Win2k
441   WINVER = 0x0400
442 ! #set to yes to enable Cscope support
443   CSCOPE=yes
444   
445   # If the user doesn't want gettext, undefine it.
446   ifeq (no, $(GETTEXT))
447 --- 52,62 ----
448   OLE=no
449   # Set the default $(WINVER) to make it work with pre-Win2k
450   WINVER = 0x0400
451 ! # Set to yes to enable Cscope support
452   CSCOPE=yes
453 + # Set to yes to enable Netbeans support
454 + NETBEANS=$(GUI)
455
456   
457   # If the user doesn't want gettext, undefine it.
458   ifeq (no, $(GETTEXT))
459 ***************
460 *** 270,275 ****
461 --- 273,291 ----
462   DEFINES += -DFEAT_CSCOPE
463   endif
464   
465 + ifeq ($(NETBEANS),yes)
466 + DEFINES += -DFEAT_NETBEANS_INTG
467 + ifeq ($(DEBUG), yes)
468 + DEFINES += -DNBDEBUG
469 + NBDEBUG_INCL = nbdebug.h
470 + NBDEBUG_SRC = nbdebug.c
471 + endif
472 + endif
473
474 + ifdef XPM
475 + CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include
476 + endif
477
478   ifeq ($(DEBUG),yes)
479   CFLAGS += -g -fstack-check
480   DEBUG_SUFFIX=d
481 ***************
482 *** 348,353 ****
483 --- 364,378 ----
484   ifeq ($(CSCOPE),yes)
485   OBJ += $(OUTDIR)/if_cscope.o
486   endif
487 + ifeq ($(NETBEANS),yes)
488 + OBJ += $(OUTDIR)/netbeans.o $(OUTDIR)/gui_beval.o
489 + LIB += -lws2_32
490 + endif
491 + ifdef XPM
492 + OBJ += $(OUTDIR)/xpm_w32.o
493 + # You'll need libXpm.a from http://gnuwin32.sf.net
494 + LIB += -L $(XPM)/lib -lXpm
495 + endif
496   
497   
498   ifeq ($(GUI),yes)
499 ***************
500 *** 487,492 ****
501 --- 512,520 ----
502   if_perl.c: if_perl.xs typemap
503         perl $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
504              $(PERLLIB)/ExtUtils/typemap if_perl.xs > $@
505
506 + $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
507 +       $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
508   
509   pathdef.c: $(INCL)
510   ifneq (sh.exe, $(SHELL))
511 *** ../vim-6.2.106/src/Make_mvc.mak     Sun Aug 10 22:37:55 2003
512 --- src/Make_mvc.mak    Fri Sep 12 22:07:37 2003
513 ***************
514 *** 12,18 ****
515   #     nmake -f Make_mvc.mak
516   # This will build the console version of vim with no additional interfaces.
517   # To add interfaces, define any of the following:
518 ! #     GUI interface: GUI=yes
519   #     OLE interface: OLE=yes (usually with GUI=yes)
520   #     Multibyte support: MBYTE=yes
521   #     IME support: IME=yes    (requires GUI=yes)
522 --- 12,18 ----
523   #     nmake -f Make_mvc.mak
524   # This will build the console version of vim with no additional interfaces.
525   # To add interfaces, define any of the following:
526 ! #     GUI interface: GUI=yes (default is no)
527   #     OLE interface: OLE=yes (usually with GUI=yes)
528   #     Multibyte support: MBYTE=yes
529   #     IME support: IME=yes    (requires GUI=yes)
530 ***************
531 *** 39,52 ****
532   #       TCL_VER=[Tcl version, e.g. 80, 83]  (default is 83)
533   #       TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
534   #         You must set TCL_VER_LONG when you set TCL_VER.
535 - #     Cscope support: CSCOPE=yes
536   #     Debug version: DEBUG=yes
537   #     Mapfile: MAP=[no, yes or lines] (default is yes)
538   #       no:    Don't write a mapfile.
539   #       yes:   Write a normal mapfile.
540   #       lines: Write a mapfile with line numbers (only for VC6 and later)
541   #     SNiFF+ interface: SNIFF=yes
542 ! #     Cscope interface: CSCOPE=yes
543   #     Iconv library support (always dynamically loaded):
544   #       ICONV=[yes or no]  (default is yes)
545   #     Intl library support (always dynamically loaded):
546 --- 39,51 ----
547   #       TCL_VER=[Tcl version, e.g. 80, 83]  (default is 83)
548   #       TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
549   #         You must set TCL_VER_LONG when you set TCL_VER.
550   #     Debug version: DEBUG=yes
551   #     Mapfile: MAP=[no, yes or lines] (default is yes)
552   #       no:    Don't write a mapfile.
553   #       yes:   Write a normal mapfile.
554   #       lines: Write a mapfile with line numbers (only for VC6 and later)
555   #     SNiFF+ interface: SNIFF=yes
556 ! #     Cscope support: CSCOPE=yes
557   #     Iconv library support (always dynamically loaded):
558   #       ICONV=[yes or no]  (default is yes)
559   #     Intl library support (always dynamically loaded):
560 ***************
561 *** 57,62 ****
562 --- 56,63 ----
563   #       Version Support: WINVER=[0x400, 0x500] (default is 0x400)
564   #       Processor Version: CPUNR=[i386, i486, i586, i686] (default is i386)
565   #       Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
566 + #       Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
567 + #       XPM Image Support: XPM=[path to XPM directory]
568   #
569   # You can combine any of these interfaces
570   #
571 ***************
572 *** 173,178 ****
573 --- 174,183 ----
574   MULTITHREADED = yes
575   !endif
576   
577 + !ifndef CSCOPE
578 + CSCOPE = yes
579 + !endif
580
581   !if "$(CSCOPE)" == "yes"
582   # CSCOPE - Include support for Cscope
583   CSCOPE_INCL  = if_cscope.h
584 ***************
585 *** 180,185 ****
586 --- 185,216 ----
587   CSCOPE_DEFS  = -DFEAT_CSCOPE
588   !endif
589   
590 + !ifndef NETBEANS
591 + NETBEANS = $(GUI)
592 + !endif
593
594 + !if "$(NETBEANS)" == "yes"
595 + # NETBEANS - Include support for Netbeans integration
596 + NETBEANS_PRO  = proto/netbeans.pro
597 + NETBEANS_OBJ  = $(OBJDIR)/netbeans.obj $(OBJDIR)/gui_beval.obj
598 + NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
599 + !if "$(DEBUG)" == "yes"
600 + NBDEBUG_DEFS  = -DNBDEBUG
601 + NBDEBUG_INCL  = nbdebug.h
602 + NBDEBUG_SRC   = nbdebug.c
603 + !endif
604 + NETBEANS_LIB   = Ws2_32.lib
605 + !endif
606
607 + !ifdef XPM
608 + # XPM - Include support for XPM signs
609 + # you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
610 + XPM_OBJ   = $(OBJDIR)/xpm_w32.obj
611 + XPM_DEFS  = -DFEAT_XPM_W32
612 + XPM_LIB   = $(XPM)\lib\libXpm.lib
613 + XPM_INC         = -I $(XPM)\include
614 + !endif
615
616   !if defined(USE_MSVCRT)
617   CVARS = $(cvarsdll)
618   !elseif defined(MULTITHREADED)
619 ***************
620 *** 208,215 ****
621   #VIMRUNTIMEDIR = somewhere
622   
623   CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
624 !               $(SNIFF_DEFS) $(CSCOPE_DEFS) $(DEFINES) \
625 !               -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
626   
627   #>>>>> end of choices
628   ###########################################################################
629 --- 239,247 ----
630   #VIMRUNTIMEDIR = somewhere
631   
632   CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
633 !               $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
634 !               $(NBDEBUG_DEFS) $(XPM_DEFS) \
635 !               $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
636   
637   #>>>>> end of choices
638   ###########################################################################
639 ***************
640 *** 285,291 ****
641   !endif # DEBUG
642   
643   INCL =        vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
644 !       proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL)
645   
646   OBJ = \
647         $(OUTDIR)\buffer.obj \
648 --- 317,324 ----
649   !endif # DEBUG
650   
651   INCL =        vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
652 !       proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
653 !       $(NBDEBUG_INCL)
654   
655   OBJ = \
656         $(OUTDIR)\buffer.obj \
657 ***************
658 *** 568,581 ****
659   
660   LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
661   LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB)  user32.lib $(SNIFF_LIB) \
662 !               $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) $(LINK_PDB)
663   
664   all:  $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
665   
666 ! $(VIM): $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) version.c version.h
667         $(CC) $(CFLAGS)  version.c /Fo$(OUTDIR)/version.obj $(PDB)
668         $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
669 !               $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) \
670                 $(OUTDIR)\version.obj $(LINKARGS2)
671   
672   $(VIM).exe: $(VIM)
673 --- 601,616 ----
674   
675   LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
676   LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB)  user32.lib $(SNIFF_LIB) \
677 !               $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) \
678 !               $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
679   
680   all:  $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
681   
682 ! $(VIM): $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
683         $(CC) $(CFLAGS)  version.c /Fo$(OUTDIR)/version.obj $(PDB)
684         $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
685 !               $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
686 !               $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
687                 $(OUTDIR)\version.obj $(LINKARGS2)
688   
689   $(VIM).exe: $(VIM)
690 ***************
691 *** 695,700 ****
692 --- 730,737 ----
693   
694   $(OUTDIR)/gui_w32.obj:        $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
695   
696 + $(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c  $(INCL)
697
698   if_perl.c : if_perl.xs typemap
699         $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) -typemap typemap if_perl.xs > if_perl.c
700   
701 ***************
702 *** 738,743 ****
703 --- 775,782 ----
704   
705   $(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c  $(INCL)
706   
707 + $(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
708
709   $(OUTDIR)/normal.obj: $(OUTDIR) normal.c  $(INCL)
710   
711   $(OUTDIR)/option.obj: $(OUTDIR) option.c  $(INCL)
712 ***************
713 *** 773,778 ****
714 --- 812,820 ----
715   
716   $(OUTDIR)/window.obj: $(OUTDIR) window.c  $(INCL)
717   
718 + $(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
719 +       $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c /Fo$(OUTDIR)/xpm_w32.obj $(PDB)
720
721   $(OUTDIR)/vim.res:    $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
722         $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
723   
724 ***************
725 *** 839,844 ****
726         proto/term.pro \
727         proto/ui.pro \
728         proto/undo.pro \
729 !       proto/window.pro
730   
731   # vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
732 --- 881,887 ----
733         proto/term.pro \
734         proto/ui.pro \
735         proto/undo.pro \
736 !       proto/window.pro \
737 !       $(NETBEANS_PRO)
738   
739   # vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
740 *** ../vim-6.2.106/src/bigvim.bat       Mon Apr 28 21:30:10 2003
741 --- src/bigvim.bat      Fri Sep 12 22:08:59 2003
742 ***************
743 *** 1,3 ****
744   :: command to build big Vim with OLE, Perl, Python and Tcl
745 ! nmake -f make_mvc.mak GUI=yes OLE=yes PERL=E:\perl DYNAMIC_PERL=yes PERL_VER=56 PYTHON=e:\python21 DYNAMIC_PYTHON=yes PYTHON_VER=21 TCL=e:\tcl DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes
746   
747 --- 1,3 ----
748   :: command to build big Vim with OLE, Perl, Python and Tcl
749 ! nmake -f make_mvc.mak GUI=yes OLE=yes PERL=E:\perl DYNAMIC_PERL=yes PERL_VER=56 PYTHON=e:\python21 DYNAMIC_PYTHON=yes PYTHON_VER=21 TCL=e:\tcl DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes XPM=e:\xpm
750   
751 *** ../vim-6.2.106/src/feature.h        Mon Jun 30 22:18:22 2003
752 --- src/feature.h       Fri Sep 12 22:14:26 2003
753 ***************
754 *** 1109,1118 ****
755   #endif
756   
757   /*
758 !  * The Netbeans features currently only work with Motif and GTK.
759    * It also requires +listcmds and +eval.
760    */
761 ! #if ((!defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_GTK)) \
762                 || !defined(FEAT_LISTCMDS) || !defined(FEAT_EVAL)) \
763         && defined(FEAT_NETBEANS_INTG)
764   # undef FEAT_NETBEANS_INTG
765 --- 1109,1118 ----
766   #endif
767   
768   /*
769 !  * The Netbeans features currently only work with Motif and GTK and Win32.
770    * It also requires +listcmds and +eval.
771    */
772 ! #if ((!defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \
773                 || !defined(FEAT_LISTCMDS) || !defined(FEAT_EVAL)) \
774         && defined(FEAT_NETBEANS_INTG)
775   # undef FEAT_NETBEANS_INTG
776 ***************
777 *** 1139,1150 ****
778    *                    Currently only for Athena and Motif.
779    */
780   #if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
781 !                            || defined(FEAT_GUI_GTK)) \
782 !       && (   (defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_GTK)) \
783             || defined(FEAT_SUN_WORKSHOP) \
784             || defined(FEAT_NETBEANS_INTG))
785   # define FEAT_BEVAL
786 ! # if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK)
787   #  define FEAT_XFONTSET
788   # endif
789   #endif
790 --- 1139,1152 ----
791    *                    Currently only for Athena and Motif.
792    */
793   #if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
794 !       || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) \
795 !       && (   (defined(FEAT_TOOLBAR) \
796 !               && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \
797             || defined(FEAT_SUN_WORKSHOP) \
798             || defined(FEAT_NETBEANS_INTG))
799   # define FEAT_BEVAL
800 ! # if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
801 !       && !defined(FEAT_GUI_W32)
802   #  define FEAT_XFONTSET
803   # endif
804   #endif
805 *** ../vim-6.2.106/src/gui_beval.c      Sat May 31 22:30:51 2003
806 --- src/gui_beval.c     Fri Sep 12 22:17:52 2003
807 ***************
808 *** 12,17 ****
809 --- 12,20 ----
810   
811   #if defined(FEAT_BEVAL) || defined(PROTO)
812   
813 + /* on Win32 only gui_mch_get_beval_info is required */
814 + #if !defined(FEAT_GUI_W32) || defined(PROTO)
815
816   #ifdef FEAT_GUI_GTK
817   # include <gdk/gdkkeysyms.h>
818   # include <gtk/gtk.h>
819 ***************
820 *** 194,199 ****
821 --- 197,203 ----
822       return current_beval;
823   }
824   #endif
825 + #endif /* !FEAT_GUI_W32 */
826   
827   #if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) || defined(PROTO)
828   /*
829 ***************
830 *** 256,265 ****
831                     if (VIsual_active
832                             && wp->w_buffer == curwin->w_buffer
833                             && (lnum == spos->lnum
834 !                               ? col >= spos->col
835                                 : lnum > spos->lnum)
836                             && (lnum == epos->lnum
837 !                               ? col <= epos->col
838                                 : lnum < epos->lnum))
839                     {
840                         /* Visual mode and pointing to the line with the
841 --- 260,269 ----
842                     if (VIsual_active
843                             && wp->w_buffer == curwin->w_buffer
844                             && (lnum == spos->lnum
845 !                               ? col >= (int)spos->col
846                                 : lnum > spos->lnum)
847                             && (lnum == epos->lnum
848 !                               ? col <= (int)epos->col
849                                 : lnum < epos->lnum))
850                     {
851                         /* Visual mode and pointing to the line with the
852 ***************
853 *** 300,305 ****
854 --- 304,311 ----
855       return FAIL;
856   }
857   
858 + # if !defined(FEAT_GUI_W32) || defined(PROTO)
859
860   /*
861    * Show a balloon with "mesg".
862    */
863 ***************
864 *** 314,321 ****
865       else
866         undrawBalloon(beval);
867   }
868 ! #endif
869   
870   #if defined(FEAT_BEVAL_TIP) || defined(PROTO)
871   /*
872    * Hide the given balloon.
873 --- 320,329 ----
874       else
875         undrawBalloon(beval);
876   }
877 ! # endif /* FEAT_GUI_W32 */
878 ! #endif /* FEAT_SUN_WORKSHOP || FEAT_NETBEANS_INTG || PROTO */
879   
880 + #if !defined(FEAT_GUI_W32) || defined(PROTO)
881   #if defined(FEAT_BEVAL_TIP) || defined(PROTO)
882   /*
883    * Hide the given balloon.
884 ***************
885 *** 1255,1259 ****
886 --- 1263,1268 ----
887   }
888   
889   #endif /* !FEAT_GUI_GTK */
890 + #endif /* !FEAT_GUI_W32 */
891   
892   #endif /* FEAT_BEVAL */
893 *** ../vim-6.2.106/src/gui_beval.h      Sat Apr 19 16:06:43 2003
894 --- src/gui_beval.h     Mon Sep 29 09:56:44 2003
895 ***************
896 *** 13,19 ****
897   #ifdef FEAT_GUI_GTK
898   # include <gtk/gtkwidget.h>
899   #else
900 ! # include <X11/Intrinsic.h>
901   #endif
902   
903   typedef enum
904 --- 13,21 ----
905   #ifdef FEAT_GUI_GTK
906   # include <gtk/gtkwidget.h>
907   #else
908 ! # if defined(FEAT_GUI_X11)
909 ! #  include <X11/Intrinsic.h>
910 ! # endif
911   #endif
912   
913   typedef enum
914 ***************
915 *** 36,41 ****
916 --- 38,44 ----
917       int                       y;
918       unsigned int      state;          /* Button/Modifier key state */
919   #else
920 + # if !defined(FEAT_GUI_W32)
921       Widget            target;         /* widget we are monitoring */
922       Widget            balloonShell;
923       Widget            balloonLabel;
924 ***************
925 *** 47,58 ****
926       Position          x_root;
927       Position          y_root;
928       int                       state;          /* Button/Modifier key state */
929   #endif
930       int                       ts;             /* tabstop setting for this buffer */
931       char_u            *msg;
932       void              (*msgCB)();
933       void              *clientData;    /* For callback */
934 ! #ifndef FEAT_GUI_GTK
935       Dimension         screen_width;   /* screen width in pixels */
936       Dimension         screen_height;  /* screen height in pixels */
937   #endif
938 --- 50,68 ----
939       Position          x_root;
940       Position          y_root;
941       int                       state;          /* Button/Modifier key state */
942 + # else
943 +     HWND              target;
944 +     HWND              balloon;
945 +     int                       x;
946 +     int                       y;
947 +     BeState           showState;      /* tells us whats currently going on */
948 + # endif
949   #endif
950       int                       ts;             /* tabstop setting for this buffer */
951       char_u            *msg;
952       void              (*msgCB)();
953       void              *clientData;    /* For callback */
954 ! #if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)
955       Dimension         screen_width;   /* screen width in pixels */
956       Dimension         screen_height;  /* screen height in pixels */
957   #endif
958 *** ../vim-6.2.106/src/gui_w32.c        Fri Jul 25 22:43:59 2003
959 --- src/gui_w32.c       Mon Sep 29 11:29:15 2003
960 ***************
961 *** 44,49 ****
962 --- 44,52 ----
963    */
964   #include "gui_w48.c"
965   
966 + #ifdef FEAT_XPM_W32
967 + # include "xpm_w32.h"
968 + #endif
969   
970   #ifdef __MINGW32__
971   /*
972 ***************
973 *** 170,175 ****
974 --- 173,192 ----
975   #endif
976   
977   
978 + #ifdef FEAT_BEVAL
979 + # define ID_BEVAL_TOOLTIP   200
980 + # define BEVAL_TEXT_LEN           MAXPATHL
981
982 + static void make_tooltip __ARGS((BalloonEval *beval, char *text, POINT pt));
983 + static void delete_tooltip __ARGS((BalloonEval *beval));
984 + static VOID CALLBACK BevalTimerProc __ARGS((HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime));
985 + void TrackUserActivity __ARGS((UINT uMsg));
986
987 + static BalloonEval  *cur_beval = NULL;
988 + static UINT       BevalTimerId = 0;
989 + static DWORD      LastActivity = 0;
990 + #endif
991
992   /* Local variables: */
993   
994   #ifdef FEAT_MENU
995 ***************
996 *** 182,188 ****
997   # define USE_SYSMENU_FONT
998   #endif
999   
1000
1001   #define VIM_NAME      "vim"
1002   #define VIM_CLASS     "Vim"
1003   
1004 --- 199,204 ----
1005 ***************
1006 *** 287,293 ****
1007   static TMonitorFromWindow   pMonitorFromWindow = NULL;
1008   static TGetMonitorInfo            pGetMonitorInfo = NULL;
1009   static HANDLE             user32_lib = NULL;
1010
1011   /*
1012    * Return TRUE when running under Windows NT 3.x or Win32s, both of which have
1013    * less fancy GUI APIs.
1014 --- 303,311 ----
1015   static TMonitorFromWindow   pMonitorFromWindow = NULL;
1016   static TGetMonitorInfo            pGetMonitorInfo = NULL;
1017   static HANDLE             user32_lib = NULL;
1018 ! #ifdef FEAT_NETBEANS_INTG
1019 ! int WSInitialized = FALSE; /* WinSock is initialized */
1020 ! #endif
1021   /*
1022    * Return TRUE when running under Windows NT 3.x or Win32s, both of which have
1023    * less fancy GUI APIs.
1024 ***************
1025 *** 512,517 ****
1026 --- 530,557 ----
1027   }
1028   #endif
1029   
1030 + #ifdef FEAT_NETBEANS_INTG
1031 +     static void
1032 + _OnWindowPosChanged(
1033 +     HWND hwnd,
1034 +     const LPWINDOWPOS lpwpos)
1035 + {
1036 +     static int x = 0, y = 0, cx = 0, cy = 0;
1037
1038 +     if (WSInitialized && (lpwpos->x != x || lpwpos->y != y
1039 +                                    || lpwpos->cx != cx || lpwpos->cy != cy))
1040 +     {
1041 +       x = lpwpos->x;
1042 +       y = lpwpos->y;
1043 +       cx = lpwpos->cx;
1044 +       cy = lpwpos->cy;
1045 +         netbeans_frame_moved(x, y);
1046 +     }
1047 +     /* Allow to send WM_SIZE and WM_MOVE */
1048 +     FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, DefWindowProc);
1049 + }
1050 + #endif
1051
1052       static int
1053   _DuringSizing(
1054       HWND hwnd,
1055 ***************
1056 *** 588,593 ****
1057 --- 628,636 ----
1058         HANDLE_MSG(hwnd, WM_VSCROLL,    _OnScroll);
1059         // HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGING,       _OnWindowPosChanging);
1060         HANDLE_MSG(hwnd, WM_ACTIVATEAPP, _OnActivateApp);
1061 + #ifdef FEAT_NETBEANS_INTG
1062 +       HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGED, _OnWindowPosChanged);
1063 + #endif
1064   
1065       case WM_QUERYENDSESSION:  /* System wants to go down. */
1066         gui_shell_closed();     /* Will exit when no changed buffers. */
1067 ***************
1068 *** 838,843 ****
1069 --- 881,914 ----
1070       }
1071   #endif
1072   
1073 + #ifdef FEAT_NETBEANS_INTG
1074 +     {
1075 +       /* stolen from gui_x11.x */
1076 +       int arg;
1077
1078 +       for (arg = 1; arg < *argc; arg++)
1079 +           if (strncmp("-nb", argv[arg], 3) == 0)
1080 +           {
1081 +               usingNetbeans++;
1082 +               netbeansArg = argv[arg];
1083 +               mch_memmove(&argv[arg], &argv[arg + 1],
1084 +                                           (--*argc - arg) * sizeof(char *));
1085 +               break;  /* enough? */
1086 +           }
1087
1088 +       if (usingNetbeans)
1089 +       {
1090 +           WSADATA wsaData;
1091 +           int wsaerr;
1092
1093 +           /* Init WinSock */
1094 +           wsaerr = WSAStartup(MAKEWORD(2, 2), &wsaData);
1095 +           if (wsaerr == 0)
1096 +               WSInitialized = TRUE;
1097 +       }
1098 +     }
1099 + #endif
1100
1101       /* get the OS version info */
1102       os_version.dwOSVersionInfoSize = sizeof(os_version);
1103       GetVersionEx(&os_version); /* this call works on Win32s, Win95 and WinNT */
1104 ***************
1105 *** 1034,1039 ****
1106 --- 1105,1114 ----
1107       s_findrep_struct.wFindWhatLen = MSWIN_FR_BUFSIZE;
1108       s_findrep_struct.wReplaceWithLen = MSWIN_FR_BUFSIZE;
1109   #endif
1110 + #ifdef FEAT_NETBEANS_INTG
1111 +     if (usingNetbeans)
1112 +       netbeans_w32_connect();
1113 + #endif
1114   
1115       return OK;
1116   }
1117 ***************
1118 *** 3359,3368 ****
1119 --- 3434,3451 ----
1120   #endif
1121   
1122   #if defined(FEAT_SIGN_ICONS) || defined(PROTO)
1123
1124 + # ifdef FEAT_XPM_W32
1125 + #  define IMAGE_XPM   100
1126 + # endif
1127
1128   typedef struct _signicon_t
1129   {
1130       HANDLE    hImage;
1131       UINT      uType;
1132 + #ifdef FEAT_XPM_W32
1133 +     HANDLE    hShape; /* Mask bitmap handle */
1134 + #endif
1135   } signicon_t;
1136   
1137       void
1138 ***************
1139 *** 3399,3404 ****
1140 --- 3482,3506 ----
1141         case IMAGE_CURSOR:
1142             DrawIconEx(s_hdc, x, y, (HICON)sign->hImage, w, h, 0, NULL, DI_NORMAL);
1143             break;
1144 + #ifdef FEAT_XPM_W32
1145 +       case IMAGE_XPM:
1146 +           {
1147 +               HDC hdcMem;
1148 +               HBITMAP hbmpOld;
1149
1150 +               hdcMem = CreateCompatibleDC(s_hdc);
1151 +               hbmpOld = (HBITMAP)SelectObject(hdcMem, sign->hShape);
1152 +               /* Make hole */
1153 +               BitBlt(s_hdc, x, y, w, h, hdcMem, 0, 0, SRCAND);
1154
1155 +               SelectObject(hdcMem, sign->hImage);
1156 +               /* Paint sign */
1157 +               BitBlt(s_hdc, x, y, w, h, hdcMem, 0, 0, SRCPAINT);
1158 +               SelectObject(hdcMem, hbmpOld);
1159 +               DeleteDC(hdcMem);
1160 +           }
1161 +           break;
1162 + #endif
1163       }
1164   }
1165   
1166 ***************
1167 *** 3417,3422 ****
1168 --- 3519,3530 ----
1169             case IMAGE_ICON:
1170                 DestroyIcon((HICON)sign->hImage);
1171                 break;
1172 + #ifdef FEAT_XPM_W32
1173 +           case IMAGE_XPM:
1174 +               DeleteObject((HBITMAP)sign->hImage);
1175 +               DeleteObject((HBITMAP)sign->hShape);
1176 +               break;
1177 + #endif
1178         }
1179   }
1180   
1181 ***************
1182 *** 3452,3457 ****
1183 --- 3560,3572 ----
1184             sign.hImage = (HANDLE)LoadImage(NULL, signfile, sign.uType,
1185                     gui.char_width * 2, gui.char_height,
1186                     LR_LOADFROMFILE | LR_CREATEDIBSECTION);
1187 + #ifdef FEAT_XPM_W32
1188 +       if (!STRICMP(ext, ".xpm"))
1189 +       {
1190 +           sign.uType = IMAGE_XPM;
1191 +           LoadXpmImage(signfile, (HBITMAP *)&sign.hImage, (HBITMAP *)&sign.hShape);
1192 +       }
1193 + #endif
1194       }
1195   
1196       psign = NULL;
1197 ***************
1198 *** 3479,3482 ****
1199 --- 3594,3864 ----
1200         vim_free(sign);
1201       }
1202   }
1203
1204 + #if defined(FEAT_BEVAL) || defined(PROTO)
1205
1206 + /* BALLOON-EVAL IMPLEMENTATION FOR WINDOWS.
1207 +  *  Added by Sergey Khorev
1208 +  *
1209 +  * The only reused thing is gui_beval.h and gui_mch_get_beval_info()
1210 +  * from gui_beval.c (note it uses x and y of the BalloonEval struct
1211 +  * to get current mouse position).
1212 +  *
1213 +  * Trying to use as more Windows services as possible, and as less
1214 +  * IE version as possible :)).
1215 +  *
1216 +  * 1) Don't create ToolTip in gui_mch_create_beval_area, only initialize
1217 +  * BalloonEval struct.
1218 +  * 2) Enable/Disable simply create/kill BalloonEval Timer
1219 +  * 3) When there was enough inactivity, timer procedure posts
1220 +  * async request to debugger
1221 +  * 4) gui_mch_post_balloon (invoked from netbeans.c) creates tooltip control
1222 +  * and performs some actions to show it ASAP
1223 +  * 5) WM_NOTOFY:TTN_POP destroys created tooltip
1224 +  */
1225
1226 +     static void
1227 + make_tooltip(beval, text, pt)
1228 +     BalloonEval *beval;
1229 +     char *text;
1230 +     POINT pt;
1231 + {
1232 +     TOOLINFO  ti;
1233
1234 +     beval->balloon = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS,
1235 +           NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
1236 +           CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
1237 +           beval->target, NULL, s_hinst, NULL);
1238
1239 +     SetWindowPos(beval->balloon, HWND_TOPMOST, 0, 0, 0, 0,
1240 +           SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
1241
1242 +     ti.cbSize = sizeof(TOOLINFO);
1243 +     ti.uFlags = TTF_SUBCLASS;
1244 +     ti.hwnd = beval->target;
1245 +     ti.hinst = 0; /* Don't use string resources */
1246 +     ti.uId = ID_BEVAL_TOOLTIP;
1247 +     ti.lpszText = text;
1248
1249 +     /* Limit ballooneval bounding rect to CursorPos neighbourhood */
1250 +     ti.rect.left = pt.x - 3;
1251 +     ti.rect.top = pt.y - 3;
1252 +     ti.rect.right = pt.x + 3;
1253 +     ti.rect.bottom = pt.y + 3;
1254
1255 +     SendMessage(beval->balloon, TTM_ADDTOOL, 0, (LPARAM)&ti);
1256 +     /* Make tooltip appear sooner */
1257 +     SendMessage(beval->balloon, TTM_SETDELAYTIME, TTDT_INITIAL, 10);
1258 +     /*
1259 +      * HACK: force tooltip to appear, because it'll not appear until
1260 +      * first mouse move. D*mn M$
1261 +      */
1262 +     mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
1263 +     mouse_event(MOUSEEVENTF_MOVE, -1, -1, 0, 0);
1264 + }
1265
1266 +     static void
1267 + delete_tooltip(beval)
1268 +     BalloonEval       *beval;
1269 + {
1270 +     DestroyWindow(beval->balloon);
1271 + }
1272
1273 +     static VOID CALLBACK
1274 + BevalTimerProc(hwnd, uMsg, idEvent, dwTime)
1275 +     HWND    hwnd;
1276 +     UINT    uMsg;
1277 +     UINT    idEvent;
1278 +     DWORD   dwTime;
1279 + {
1280 +     POINT     pt;
1281 +     RECT      rect;
1282
1283 +     if (cur_beval == NULL || cur_beval->showState == ShS_SHOWING || !p_beval)
1284 +       return;
1285
1286 +     GetCursorPos(&pt);
1287 +     if (WindowFromPoint(pt) != s_textArea)
1288 +       return;
1289
1290 +     ScreenToClient(s_textArea, &pt);
1291 +     GetClientRect(s_textArea, &rect);
1292 +     if (!PtInRect(&rect, pt))
1293 +       return;
1294
1295 +     if (LastActivity > 0
1296 +           && (dwTime - LastActivity) >= (DWORD)p_bdlay
1297 +           && (cur_beval->showState != ShS_PENDING
1298 +               || abs(cur_beval->x - pt.x) > 3
1299 +               || abs(cur_beval->y - pt.y) > 3))
1300 +     {
1301 +       /* Pointer resting in one place long enough, it's time to show
1302 +        * the tooltip. */
1303 +       cur_beval->showState = ShS_PENDING;
1304 +       cur_beval->x = pt.x;
1305 +       cur_beval->y = pt.y;
1306
1307 +       TRACE0("BevalTimerProc: sending request");
1308
1309 +       if (cur_beval->msgCB != NULL)
1310 +           (*cur_beval->msgCB)(cur_beval, 0);
1311 +     }
1312 + }
1313
1314 +     void
1315 + gui_mch_disable_beval_area(beval)
1316 +     BalloonEval       *beval;
1317 + {
1318 +     TRACE0("gui_mch_disable_beval_area {{{");
1319 +     KillTimer(s_textArea, BevalTimerId);
1320 +     TRACE0("gui_mch_disable_beval_area }}}");
1321 + }
1322
1323 +     void
1324 + gui_mch_enable_beval_area(beval)
1325 +     BalloonEval       *beval;
1326 + {
1327 +     TRACE0("gui_mch_enable_beval_area |||");
1328 +     if (beval == NULL)
1329 +       return;
1330 +     TRACE0("gui_mch_enable_beval_area {{{");
1331 +     BevalTimerId = SetTimer(s_textArea, 0, p_bdlay / 2, (TIMERPROC)BevalTimerProc);
1332 +     TRACE0("gui_mch_enable_beval_area }}}");
1333 + }
1334
1335 +     void
1336 + gui_mch_post_balloon(beval, mesg)
1337 +     BalloonEval       *beval;
1338 +     char_u    *mesg;
1339 + {
1340 +     POINT   pt;
1341 +     TRACE0("gui_mch_post_balloon {{{");
1342 +     if (beval->showState == ShS_SHOWING)
1343 +       return;
1344 +     GetCursorPos(&pt);
1345 +     ScreenToClient(s_textArea, &pt);
1346
1347 +     if (abs(beval->x - pt.x) < 3 && abs(beval->y - pt.y) < 3)
1348 +       /* cursor is still here */
1349 +     {
1350 +       gui_mch_disable_beval_area(cur_beval);
1351 +       beval->showState = ShS_SHOWING;
1352 +       make_tooltip(beval, mesg, pt);
1353 +     }
1354 +     TRACE0("gui_mch_post_balloon }}}");
1355 + }
1356
1357 +     BalloonEval *
1358 + gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
1359 +     void      *target;        /* ignored, always use s_textArea */
1360 +     char_u    *mesg;
1361 +     void      (*mesgCB)__ARGS((BalloonEval *, int));
1362 +     void      *clientData;
1363 + {
1364 +     /* partially stolen from gui_beval.c */
1365 +     BalloonEval       *beval;
1366
1367 +     if (mesg != NULL && mesgCB != NULL)
1368 +     {
1369 +       EMSG(_("E232: Cannot create BalloonEval with both message and callback"));
1370 +       return NULL;
1371 +     }
1372
1373 +     beval = (BalloonEval *)alloc(sizeof(BalloonEval));
1374 +     if (beval != NULL)
1375 +     {
1376 +       beval->target = s_textArea;
1377 +       beval->balloon = NULL;
1378
1379 +       beval->showState = ShS_NEUTRAL;
1380 +       beval->x = 0;
1381 +       beval->y = 0;
1382 +       beval->msg = mesg;
1383 +       beval->msgCB = mesgCB;
1384 +       beval->clientData = clientData;
1385
1386 +       InitCommonControls();
1387
1388 +       cur_beval = beval;
1389
1390 +       if (p_beval)
1391 +           gui_mch_enable_beval_area(beval);
1392
1393 +     }
1394 +     return beval;
1395 + }
1396
1397 +     void
1398 + Handle_WM_Notify(hwnd, pnmh)
1399 +     HWND hwnd;
1400 +     LPNMHDR pnmh;
1401 + {
1402 +     if (pnmh->idFrom != ID_BEVAL_TOOLTIP) /* it is not our tooltip */
1403 +       return;
1404
1405 +     if (cur_beval != NULL)
1406 +     {
1407 +       if (pnmh->code == TTN_SHOW)
1408 +       {
1409 +           TRACE0("TTN_SHOW {{{");
1410 +           TRACE0("TTN_SHOW }}}");
1411 +       }
1412 +       else if (pnmh->code == TTN_POP) /* Before tooltip disappear */
1413 +       {
1414 +           TRACE0("TTN_POP {{{");
1415 +           delete_tooltip(cur_beval);
1416 +           gui_mch_enable_beval_area(cur_beval);
1417 +           TRACE0("TTN_POP }}}");
1418
1419 +           cur_beval->showState = ShS_NEUTRAL;
1420 +       }
1421 +     }
1422 + }
1423
1424 + void TrackUserActivity (uMsg)
1425 +     UINT    uMsg;
1426 + {
1427 +     if ((uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST) ||
1428 +           (uMsg >= WM_KEYFIRST && uMsg <= WM_KEYLAST))
1429 +     {
1430 +       LastActivity = GetTickCount();
1431 +     }
1432 + }
1433
1434 +     void
1435 + gui_mch_destroy_beval_area(beval)
1436 +     BalloonEval       *beval;
1437 + {
1438 +     vim_free(beval);
1439 + }
1440 + #endif /* FEAT_BEVAL */
1441
1442 + #if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
1443 + /*
1444 +  * We have multiple signs to draw at the same location. Draw the
1445 +  * multi-sign indicator (down-arrow) instead. This is the Win32 version.
1446 +  */
1447 +     void
1448 + netbeans_draw_multisign_indicator(int row)
1449 + {
1450 +     int i;
1451 +     int y;
1452 +     int x;
1453
1454 +     x = 0;
1455 +     y = TEXT_Y(row);
1456
1457 +     for (i = 0; i < gui.char_height - 3; i++)
1458 +       SetPixel(s_hdc, x+2, y++, gui.currFgColor);
1459
1460 +     SetPixel(s_hdc, x+0, y, gui.currFgColor);
1461 +     SetPixel(s_hdc, x+2, y, gui.currFgColor);
1462 +     SetPixel(s_hdc, x+4, y++, gui.currFgColor);
1463 +     SetPixel(s_hdc, x+1, y, gui.currFgColor);
1464 +     SetPixel(s_hdc, x+2, y, gui.currFgColor);
1465 +     SetPixel(s_hdc, x+3, y++, gui.currFgColor);
1466 +     SetPixel(s_hdc, x+2, y, gui.currFgColor);
1467 + }
1468 + #endif
1469
1470   #endif
1471 *** ../vim-6.2.106/src/gui_w48.c        Sat Sep 27 19:40:03 2003
1472 --- src/gui_w48.c       Fri Oct  3 15:13:55 2003
1473 ***************
1474 *** 28,34 ****
1475   #ifndef __MINGW32__
1476   # include <shellapi.h>
1477   #endif
1478 ! #ifdef FEAT_TOOLBAR
1479   # include <commctrl.h>
1480   #endif
1481   #ifdef WIN16
1482 --- 28,34 ----
1483   #ifndef __MINGW32__
1484   # include <shellapi.h>
1485   #endif
1486 ! #if defined(FEAT_TOOLBAR) || defined(FEAT_BEVAL)
1487   # include <commctrl.h>
1488   #endif
1489   #ifdef WIN16
1490 ***************
1491 *** 113,123 ****
1492   typedef int UINT;
1493   typedef int WORD;
1494   typedef int WPARAM;
1495 ! typedef void * HINSTANCE;
1496 ! typedef void * HMENU;
1497 ! typedef void * HWND;
1498   typedef void *HDC;
1499   typedef void VOID;
1500   #endif
1501   
1502   #ifndef GET_X_LPARAM
1503 --- 113,125 ----
1504   typedef int UINT;
1505   typedef int WORD;
1506   typedef int WPARAM;
1507 ! typedef void *HINSTANCE;
1508 ! typedef void *HMENU;
1509 ! typedef void *HWND;
1510   typedef void *HDC;
1511   typedef void VOID;
1512 + typedef int LPNMHDR;
1513 + typedef int LONG;
1514   #endif
1515   
1516   #ifndef GET_X_LPARAM
1517 ***************
1518 *** 228,233 ****
1519 --- 230,238 ----
1520       {VK_F20,          'F', 'A'},
1521   
1522       {VK_F21,          'F', 'B'},
1523 + #ifdef FEAT_NETBEANS_INTG
1524 +     {VK_PAUSE,                'F', 'B'},      /* Pause == F21 (see gui_gtk_x11.c) */
1525 + #endif
1526       {VK_F22,          'F', 'C'},
1527       {VK_F23,          'F', 'D'},
1528       {VK_F24,          'F', 'E'},      /* winuser.h defines up to F24 */
1529 ***************
1530 *** 279,284 ****
1531 --- 284,295 ----
1532   static int            s_timed_out = FALSE;
1533   static int            dead_key = 0;   /* 0 - no dead key, 1 - dead key pressed */
1534   
1535 + #ifdef FEAT_BEVAL
1536 + /* balloon-eval WM_NOTIFY_HANDLER */
1537 + void Handle_WM_Notify __ARGS((HWND hwnd, LPNMHDR pnmh));
1538 + void TrackUserActivity __ARGS((UINT uMsg));
1539 + #endif
1540
1541   /*
1542    * For control IME.
1543    */
1544 ***************
1545 *** 900,905 ****
1546 --- 911,920 ----
1547       s_wParam = wParam;
1548       s_lParam = lParam;
1549   
1550 + #ifdef FEAT_BEVAL
1551 +     TrackUserActivity(uMsg);
1552 + #endif
1553
1554       switch (uMsg)
1555       {
1556         HANDLE_MSG(hwnd, WM_LBUTTONDBLCLK,_OnMouseButtonDown);
1557 ***************
1558 *** 919,924 ****
1559 --- 934,944 ----
1560         HANDLE_MSG(hwnd, WM_XBUTTONUP,  _OnMouseMoveOrRelease);
1561   #endif
1562   
1563 + #ifdef FEAT_BEVAL
1564 +       case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam);
1565 +           return TRUE;
1566 + #endif
1567
1568       default:
1569         return DefWindowProc(hwnd, uMsg, wParam, lParam);
1570       }
1571 ***************
1572 *** 1472,1477 ****
1573 --- 1492,1505 ----
1574       }
1575   #endif
1576   
1577 + #ifdef FEAT_NETBEANS_INTG
1578 +     if (msg.message == WM_NETBEANS)
1579 +     {
1580 +       messageFromNetbeansW32();
1581 +       return;
1582 +     }
1583 + #endif
1584
1585   #ifdef FEAT_SNIFF
1586       if (sniff_request_waiting && want_sniff_request)
1587       {
1588 *** ../vim-6.2.106/src/menu.c   Fri Sep 12 20:13:48 2003
1589 --- src/menu.c  Fri Sep 12 21:30:03 2003
1590 ***************
1591 *** 764,770 ****
1592                 menu->silent[i] = menuarg->silent[0];
1593             }
1594         }
1595 ! #if defined(FEAT_TOOLBAR) && (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
1596         /* Need to update the menu tip. */
1597         if (modes & MENU_TIP_MODE)
1598             gui_mch_menu_set_tip(menu);
1599 --- 764,771 ----
1600                 menu->silent[i] = menuarg->silent[0];
1601             }
1602         }
1603 ! #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
1604 !       && (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
1605         /* Need to update the menu tip. */
1606         if (modes & MENU_TIP_MODE)
1607             gui_mch_menu_set_tip(menu);
1608 ***************
1609 *** 942,948 ****
1610         if (modes & MENU_TIP_MODE)
1611         {
1612             free_menu_string(menu, MENU_INDEX_TIP);
1613 ! #if defined(FEAT_TOOLBAR) && (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
1614             /* Need to update the menu tip. */
1615             if (gui.in_use)
1616                 gui_mch_menu_set_tip(menu);
1617 --- 943,950 ----
1618         if (modes & MENU_TIP_MODE)
1619         {
1620             free_menu_string(menu, MENU_INDEX_TIP);
1621 ! #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
1622 !           && (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
1623             /* Need to update the menu tip. */
1624             if (gui.in_use)
1625                 gui_mch_menu_set_tip(menu);
1626 *** ../vim-6.2.106/src/nbdebug.c        Thu Feb 13 16:41:13 2003
1627 --- src/nbdebug.c       Tue Sep 16 11:42:48 2003
1628 ***************
1629 *** 38,45 ****
1630   void           nbtrace(char *, ...);
1631   
1632   static int     lookup(char *);
1633   static int     errorHandler(Display *, XErrorEvent *);
1634
1635   
1636   /*
1637    * nbdebug_wait       -   This function can be used to delay or stop execution of vim.
1638 --- 38,46 ----
1639   void           nbtrace(char *, ...);
1640   
1641   static int     lookup(char *);
1642 + #ifndef FEAT_GUI_W32
1643   static int     errorHandler(Display *, XErrorEvent *);
1644 ! #endif
1645   
1646   /*
1647    * nbdebug_wait       -   This function can be used to delay or stop execution of vim.
1648 ***************
1649 *** 83,93 ****
1650         char            *cp;            /* nb_dlevel pointer */
1651   
1652         if (log_var && (file = getenv(log_var)) != NULL) {
1653 !               char buf[BUFSIZ];
1654   
1655 !               sprintf(buf, "date > %s", file);
1656 !               system(buf);
1657 !               nb_debug = fopen(file, "a");
1658                 if (level_var && (cp = getenv(level_var)) != NULL) {
1659                         nb_dlevel = strtoul(cp, NULL, 0);
1660                 } else {
1661 --- 84,94 ----
1662         char            *cp;            /* nb_dlevel pointer */
1663   
1664         if (log_var && (file = getenv(log_var)) != NULL) {
1665 !               time_t now;
1666   
1667 !               nb_debug = fopen(file, "w");
1668 !               time(&now);
1669 !               fprintf(nb_debug, "%s", asctime(localtime(&now)));
1670                 if (level_var && (cp = getenv(level_var)) != NULL) {
1671                         nb_dlevel = strtoul(cp, NULL, 0);
1672                 } else {
1673 ***************
1674 *** 142,151 ****
1675         char             buf[BUFSIZ];
1676   
1677         expand_env((char_u *) file, (char_u *) buf, BUFSIZ);
1678 !       return (access(buf, F_OK) == 0);
1679   
1680   }    /* end lookup */
1681   
1682   static int
1683   errorHandler(
1684         Display         *dpy,
1685 --- 143,158 ----
1686         char             buf[BUFSIZ];
1687   
1688         expand_env((char_u *) file, (char_u *) buf, BUFSIZ);
1689 !       return
1690 ! #ifndef FEAT_GUI_W32
1691 !               (access(buf, F_OK) == 0);
1692 ! #else
1693 !               (access(buf, 0) == 0);
1694 ! #endif
1695   
1696   }    /* end lookup */
1697   
1698 + #ifndef FEAT_GUI_W32
1699   static int
1700   errorHandler(
1701         Display         *dpy,
1702 ***************
1703 *** 169,175 ****
1704   
1705         return 0;
1706   }
1707
1708   
1709   
1710   #endif /* NBDEBUG */
1711 --- 176,182 ----
1712   
1713         return 0;
1714   }
1715 ! #endif
1716   
1717   
1718   #endif /* NBDEBUG */
1719 *** ../vim-6.2.106/src/nbdebug.h        Thu Feb 13 16:41:13 2003
1720 --- src/nbdebug.h       Fri Sep 12 21:30:03 2003
1721 ***************
1722 *** 45,50 ****
1723 --- 45,52 ----
1724   void           nbdbg(char *, ...);
1725   void           nbtrace(char *, ...);
1726   
1727 + void nbdebug_wait __ARGS((u_int wait_flags, char *wait_var, u_int wait_secs));
1728 + void nbdebug_log_init __ARGS((char *log_var, char *level_var));
1729   
1730   extern FILE   *nb_debug;
1731   extern u_int   nb_dlevel;             /* nb_debug verbosity level */
1732 *** ../vim-6.2.106/src/netbeans.c       Sun Aug 10 22:43:27 2003
1733 --- src/netbeans.c      Mon Sep 15 14:27:09 2003
1734 ***************
1735 *** 2,7 ****
1736 --- 2,8 ----
1737    *
1738    * VIM - Vi IMproved  by Bram Moolenaar
1739    *                    Netbeans integration by David Weatherford
1740 +  *                    Adopted for Win32 by Sergey Khorev
1741    *
1742    * Do ":help uganda"  in Vim to read copying and usage conditions.
1743    * Do ":help credits" in Vim to see a list of people who contributed.
1744 ***************
1745 *** 20,32 ****
1746   #if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
1747   
1748   /* Note: when making changes here also adjust configure.in. */
1749 ! #include <stdarg.h>
1750 ! #include <fcntl.h>
1751 ! #include <netdb.h>
1752 ! #include <netinet/in.h>
1753 ! #include <sys/socket.h>
1754 ! #ifdef HAVE_LIBGEN_H
1755 ! # include <libgen.h>
1756   #endif
1757   
1758   #include "version.h"
1759 --- 21,54 ----
1760   #if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
1761   
1762   /* Note: when making changes here also adjust configure.in. */
1763 ! # include <stdarg.h>
1764 ! # include <fcntl.h>
1765 ! #ifdef WIN32
1766 ! # ifdef DEBUG
1767 ! #  include <tchar.h>  /* for _T definition for TRACEn macros */
1768 ! # endif
1769 ! # include <io.h>
1770 ! # include <winsock2.h>
1771 ! /* WinSock API is separated from C API
1772 !  * So we can't use read, write, errno...
1773 !  */
1774 ! # define sock_errno WSAGetLastError()
1775 ! # define ECONNREFUSED WSAECONNREFUSED
1776 ! # define sock_write(sd, buf, len) send(sd, buf, len, 0)
1777 ! # define sock_read(sd, buf, len) recv(sd, buf, len, 0)
1778 ! # define sock_close(sd) closesocket(sd)
1779 ! # define sleep(t) Sleep(t*1000) /* WinAPI Sleep() accepts milliseconds */
1780 ! #else
1781 ! # include <netdb.h>
1782 ! # include <netinet/in.h>
1783 ! # include <sys/socket.h>
1784 ! # ifdef HAVE_LIBGEN_H
1785 ! #  include <libgen.h>
1786 ! # endif
1787 ! # define sock_errno errno
1788 ! # define sock_write(sd, buf, len) write(sd, buf, len)
1789 ! # define sock_read(sd, buf, len) read(sd, buf, len)
1790 ! # define sock_close(sd) close(sd)
1791   #endif
1792   
1793   #include "version.h"
1794 ***************
1795 *** 69,74 ****
1796 --- 91,100 ----
1797   #ifdef FEAT_GUI_GTK
1798   static gint inputHandler;             /* Cookie for input */
1799   #endif
1800 + #ifdef FEAT_GUI_W32
1801 + static int  inputHandler = -1;                /* simply ret.value of WSAAsyncSelect() */
1802 + extern HWND s_hwnd;                   /* Gvim's Window handle */
1803 + #endif
1804   static int cmdno;                     /* current command number for reply */
1805   static int haveConnection = FALSE;    /* socket is connected and
1806                                            initialization is done */
1807 ***************
1808 *** 160,172 ****
1809 --- 186,234 ----
1810   }
1811   #endif /* FEAT_GUI_GTK */
1812   
1813 + #if defined(FEAT_GUI_W32) || defined(PROTO)
1814 +     void
1815 + netbeans_w32_connect(void)
1816 + {
1817 +     netbeans_connect();
1818 +     if (sd > 0)
1819 +     {
1820 +       /*
1821 +        * Tell Windows we are interested in receiving message when there
1822 +        * is input on the editor connection socket
1823 +        */
1824 +       inputHandler = WSAAsyncSelect(sd, s_hwnd, WM_NETBEANS, FD_READ);
1825 +     }
1826 + }
1827
1828 +     static void
1829 + netbeans_disconnect(void)
1830 + {
1831 +     if (inputHandler == 0)
1832 +     {
1833 +       WSAAsyncSelect(sd, s_hwnd, 0, 0);
1834 +       inputHandler = -1;
1835 +     }
1836 +     sd = -1;
1837 +     haveConnection = FALSE;
1838
1839 +     /* It seems that Motif and GTK versions also need this: */
1840 +     gui_mch_destroy_beval_area(balloonEval);
1841 +     balloonEval = NULL;
1842 + }
1843 + #endif /* FEAT_GUI_W32 */
1844
1845       static void
1846   netbeans_connect(void)
1847   {
1848   #ifdef INET_SOCKETS
1849       struct sockaddr_in        server;
1850       struct hostent *  host;
1851 + # ifdef FEAT_GUI_W32
1852 +     u_short           port;
1853 + # else
1854       int                       port;
1855 + #endif
1856   #else
1857       struct sockaddr_un        server;
1858   #endif
1859 ***************
1860 *** 243,252 ****
1861       /* Connect to server */
1862       if (connect(sd, (struct sockaddr *)&server, sizeof(server)))
1863       {
1864 !       nbdebug(("netbeans_connect: Connect failed with errno %d\n", errno));
1865 !       if (errno == ECONNREFUSED)
1866         {
1867 !           close(sd);
1868   #ifdef INET_SOCKETS
1869             if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
1870             {
1871 --- 305,314 ----
1872       /* Connect to server */
1873       if (connect(sd, (struct sockaddr *)&server, sizeof(server)))
1874       {
1875 !       nbdebug(("netbeans_connect: Connect failed with errno %d\n", sock_errno));
1876 !       if (sock_errno == ECONNREFUSED)
1877         {
1878 !           sock_close(sd);
1879   #ifdef INET_SOCKETS
1880             if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
1881             {
1882 ***************
1883 *** 265,271 ****
1884                 int retries = 36;
1885                 int success = FALSE;
1886                 while (retries--
1887 !                            && ((errno == ECONNREFUSED) || (errno == EINTR)))
1888                 {
1889                     nbdebug(("retrying...\n"));
1890                     sleep(5);
1891 --- 327,333 ----
1892                 int retries = 36;
1893                 int success = FALSE;
1894                 while (retries--
1895 !                            && ((sock_errno == ECONNREFUSED) || (sock_errno == EINTR)))
1896                 {
1897                     nbdebug(("retrying...\n"));
1898                     sleep(5);
1899 ***************
1900 *** 509,522 ****
1901    * Read and process a command from netbeans.
1902    */
1903   /*ARGSUSED*/
1904 ! #ifdef FEAT_GUI_MOTIF
1905       static void
1906   messageFromNetbeans(XtPointer clientData, int *unused1, XtInputId *unused2)
1907 ! #endif
1908 ! #ifdef FEAT_GUI_GTK
1909       static void
1910   messageFromNetbeans(gpointer clientData, gint unused1,
1911                                                     GdkInputCondition unused2)
1912   #endif
1913   {
1914       static char_u     *buf = NULL;
1915 --- 571,590 ----
1916    * Read and process a command from netbeans.
1917    */
1918   /*ARGSUSED*/
1919 ! #if defined(FEAT_GUI_W32) || defined(PROTO)
1920 ! /* Use this one when generating prototypes, the others are static. */
1921 !     void
1922 ! messageFromNetbeansW32()
1923 ! #else
1924 ! # ifdef FEAT_GUI_MOTIF
1925       static void
1926   messageFromNetbeans(XtPointer clientData, int *unused1, XtInputId *unused2)
1927 ! # endif
1928 ! # ifdef FEAT_GUI_GTK
1929       static void
1930   messageFromNetbeans(gpointer clientData, gint unused1,
1931                                                     GdkInputCondition unused2)
1932 + # endif
1933   #endif
1934   {
1935       static char_u     *buf = NULL;
1936 ***************
1937 *** 543,556 ****
1938       /* Keep on reading for as long as there is something to read. */
1939       for (;;)
1940       {
1941 !       len = read(sd, buf, MAXMSGSIZE);
1942         if (len <= 0)
1943             break;      /* error or nothing more to read */
1944   
1945         /* Store the read message in the queue. */
1946         save(buf, len);
1947         readlen += len;
1948
1949         if (len < MAXMSGSIZE)
1950             break;      /* did read everything that's available */
1951       }
1952 --- 611,623 ----
1953       /* Keep on reading for as long as there is something to read. */
1954       for (;;)
1955       {
1956 !       len = sock_read(sd, buf, MAXMSGSIZE);
1957         if (len <= 0)
1958             break;      /* error or nothing more to read */
1959   
1960         /* Store the read message in the queue. */
1961         save(buf, len);
1962         readlen += len;
1963         if (len < MAXMSGSIZE)
1964             break;      /* did read everything that's available */
1965       }
1966 ***************
1967 *** 600,606 ****
1968       {
1969         /* We assume the server knows that we can safely exit! */
1970         if (sd >= 0)
1971 !           close(sd);
1972         /* Disconnect before exiting, Motif hangs in a Select error
1973          * message otherwise. */
1974         netbeans_disconnect();
1975 --- 667,673 ----
1976       {
1977         /* We assume the server knows that we can safely exit! */
1978         if (sd >= 0)
1979 !           sock_close(sd);
1980         /* Disconnect before exiting, Motif hangs in a Select error
1981          * message otherwise. */
1982         netbeans_disconnect();
1983 ***************
1984 *** 612,618 ****
1985       {
1986         /* The IDE is breaking the connection. */
1987         if (sd >= 0)
1988 !           close(sd);
1989         netbeans_disconnect();
1990         return;
1991       }
1992 --- 679,685 ----
1993       {
1994         /* The IDE is breaking the connection. */
1995         if (sd >= 0)
1996 !           sock_close(sd);
1997         netbeans_disconnect();
1998         return;
1999       }
2000 ***************
2001 *** 660,680 ****
2002   struct nbbuf_struct
2003   {
2004       buf_T             *bufp;
2005 - #if 0 /* never used */
2006 -     unsigned int       netbeansOwns:1;
2007 -     unsigned int       fireCaret:1;
2008 - #endif
2009       unsigned int       fireChanges:1;
2010       unsigned int       initDone:1;
2011       unsigned int       modified:1;
2012 - #if 0  /* never used */
2013 -     char              *internalname;
2014 - #endif
2015       char              *displayname;
2016       char_u            *partial_line;
2017       int                       *signmap;
2018 !     ushort             signmaplen;
2019 !     ushort             signmapused;
2020   };
2021   
2022   typedef struct nbbuf_struct nbbuf_T;
2023 --- 727,740 ----
2024   struct nbbuf_struct
2025   {
2026       buf_T             *bufp;
2027       unsigned int       fireChanges:1;
2028       unsigned int       initDone:1;
2029       unsigned int       modified:1;
2030       char              *displayname;
2031       char_u            *partial_line;
2032       int                       *signmap;
2033 !     short_u            signmaplen;
2034 !     short_u            signmapused;
2035   };
2036   
2037   typedef struct nbbuf_struct nbbuf_T;
2038 ***************
2039 *** 796,802 ****
2040         nbdebug(("EVT: %s", buf));
2041   /*    nb_send(buf, "netbeans_end");    avoid "write failed" messages */
2042         if (sd >= 0)
2043 !           write(sd, buf, STRLEN(buf));  /* ignore errors */
2044       }
2045   
2046       /* Give NetBeans a chance to write some clean-up cmds to the socket before
2047 --- 856,862 ----
2048         nbdebug(("EVT: %s", buf));
2049   /*    nb_send(buf, "netbeans_end");    avoid "write failed" messages */
2050         if (sd >= 0)
2051 !           sock_write(sd, buf, STRLEN(buf));  /* ignore errors */
2052       }
2053   
2054       /* Give NetBeans a chance to write some clean-up cmds to the socket before
2055 ***************
2056 *** 811,820 ****
2057       static void
2058   nb_send(char *buf, char *fun)
2059   {
2060       if (sd < 0)
2061 !       EMSG2("E630: %s(): write while not connected", fun);
2062 !     else if (write(sd, buf, STRLEN(buf)) != STRLEN(buf))
2063 !       EMSG2("E631: %s(): write failed", fun);
2064   }
2065   
2066   /*
2067 --- 871,894 ----
2068       static void
2069   nb_send(char *buf, char *fun)
2070   {
2071 +     /* Avoid giving pages full of error messages when the other side has
2072 +      * exited, only mention the first error until the connection works again. */
2073 +     static int did_error = FALSE;
2074
2075       if (sd < 0)
2076 !     {
2077 !       if (!did_error)
2078 !           EMSG2("E630: %s(): write while not connected", fun);
2079 !       did_error = TRUE;
2080 !     }
2081 !     else if (sock_write(sd, buf, STRLEN(buf)) != (int)STRLEN(buf))
2082 !     {
2083 !       if (!did_error)
2084 !           EMSG2("E631: %s(): write failed", fun);
2085 !       did_error = TRUE;
2086 !     }
2087 !     else
2088 !       did_error = FALSE;
2089   }
2090   
2091   /*
2092 ***************
2093 *** 888,893 ****
2094 --- 962,969 ----
2095       char_u *p = txt;
2096       char_u *q = buf;
2097   
2098 +     if (buf == NULL)
2099 +       return NULL;
2100       for (; *p; p++)
2101       {
2102         switch (*p)
2103 ***************
2104 *** 1244,1249 ****
2105 --- 1320,1331 ----
2106             }
2107             else if (args != NULL)
2108             {
2109 +               /* We need to detect EOL style
2110 +                * because addAnno passes char-offset
2111 +                */
2112 +               int    ff_detected = EOL_UNKNOWN;
2113 +               int    buf_was_empty = (buf->bufp->b_ml.ml_flags & ML_EMPTY);
2114
2115                 oldFire = netbeansFireChanges;
2116                 netbeansFireChanges = 0;
2117   
2118 ***************
2119 *** 1295,1308 ****
2120 --- 1377,1413 ----
2121                         nbdebug(("    PARTIAL[%d]: %s\n", lnum, args));
2122                         break;
2123                     }
2124 +                   /* EOL detecting.
2125 +                    * Not sure how to deal with '\n' on Mac
2126 +                    * it will fail already in nl = ... above
2127 +                    */
2128 +                   if (buf_was_empty && /* There is need to detect EOLs */
2129 +                           /* AND: string is empty */
2130 +                           (args == nl
2131 +                            /* OR hasn't '\r' at the end */
2132 +                           || *(nl - 1) != '\r'))
2133 +                       ff_detected = EOL_UNIX;
2134
2135                     *nl = '\0';
2136                     nbdebug(("    INSERT[%d]: %s\n", lnum, args));
2137                     ml_append((linenr_T)(lnum++ - 1), args,
2138                                                      STRLEN(args) + 1, FALSE);
2139                     args = nl + 1;
2140                 }
2141
2142                 appended_lines_mark(pos->lnum - 1, lnum - pos->lnum);
2143   
2144 +               /* We can change initial ff without consequences
2145 +                * Isn't it a kind of hacking?
2146 +                */
2147 +               if (buf_was_empty)
2148 +               {
2149 +                   if (ff_detected == EOL_UNKNOWN)
2150 +                       ff_detected = EOL_DOS;
2151 +                   set_fileformat(ff_detected, OPT_LOCAL);
2152 +                   buf->bufp->b_start_ffc = *buf->bufp->b_p_ff;
2153 +               }
2154
2155                 if (*args)
2156                 {
2157                     /*
2158 ***************
2159 *** 1596,1601 ****
2160 --- 1701,1709 ----
2161             {
2162                 curwin->w_cursor = *pos;
2163                 check_cursor();
2164 + #ifdef FEAT_FOLDING
2165 +               foldOpenCursor();
2166 + #endif
2167             }
2168             else
2169                 nbdebug(("    BAD POSITION in setDot: %s\n", s));
2170 ***************
2171 *** 1661,1666 ****
2172 --- 1769,1775 ----
2173             int typeNum;
2174             char_u *typeName;
2175             char_u *tooltip;
2176 +           char_u *p;
2177             char_u *glyphFile;
2178             int use_fg = 0;
2179             int use_bg = 0;
2180 ***************
2181 *** 1679,1685 ****
2182             args = skipwhite(args + 1);
2183             tooltip = (char_u *)nb_unquote(args, &args);
2184             args = skipwhite(args + 1);
2185 !           glyphFile = (char_u *)nb_unquote(args, &args);
2186             args = skipwhite(args + 1);
2187             if (STRNCMP(args, "none", 4) == 0)
2188                 args += 5;
2189 --- 1788,1798 ----
2190             args = skipwhite(args + 1);
2191             tooltip = (char_u *)nb_unquote(args, &args);
2192             args = skipwhite(args + 1);
2193
2194 !           p = (char_u *)nb_unquote(args, &args);
2195 !           glyphFile = vim_strsave_escaped(p, escape_chars);
2196 !           vim_free(p);
2197
2198             args = skipwhite(args + 1);
2199             if (STRNCMP(args, "none", 4) == 0)
2200                 args += 5;
2201 ***************
2202 *** 2049,2055 ****
2203       char_u    *text;
2204       int               line;
2205       int               col;
2206 !     char      buf[MAXPATHLEN * 2 + 25];
2207       char_u    *p;
2208   
2209       /* Don't do anything when 'ballooneval' is off, messages scrolled the
2210 --- 2192,2198 ----
2211       char_u    *text;
2212       int               line;
2213       int               col;
2214 !     char      buf[MAXPATHL * 2 + 25];
2215       char_u    *p;
2216   
2217       /* Don't do anything when 'ballooneval' is off, messages scrolled the
2218 ***************
2219 *** 2061,2067 ****
2220       {
2221         /* Send debugger request.  Only when the text is of reasonable
2222          * length. */
2223 !       if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHLEN)
2224         {
2225             p = nb_quote(text);
2226             if (p != NULL)
2227 --- 2204,2210 ----
2228       {
2229         /* Send debugger request.  Only when the text is of reasonable
2230          * length. */
2231 !       if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
2232         {
2233             p = nb_quote(text);
2234             if (p != NULL)
2235 ***************
2236 *** 2089,2095 ****
2237       nbdebug(("EVT: %s", cmd));
2238       nb_send(cmd, "netbeans_startup_done");
2239   
2240 ! # if defined(FEAT_BEVAL) && defined(FEAT_GUI_MOTIF)
2241       if (gui.in_use)
2242       {
2243         /*
2244 --- 2232,2239 ----
2245       nbdebug(("EVT: %s", cmd));
2246       nb_send(cmd, "netbeans_startup_done");
2247   
2248 ! #ifdef FEAT_BEVAL
2249 ! # ifdef FEAT_GUI_MOTIF
2250       if (gui.in_use)
2251       {
2252         /*
2253 ***************
2254 *** 2102,2111 ****
2255         if (!p_beval)
2256             gui_mch_disable_beval_area(balloonEval);
2257       }
2258   # endif
2259   }
2260   
2261 ! #if defined(FEAT_GUI_MOTIF) || defined(PROTO)
2262   /*
2263    * Tell netbeans that the window was moved or resized.
2264    */
2265 --- 2246,2263 ----
2266         if (!p_beval)
2267             gui_mch_disable_beval_area(balloonEval);
2268       }
2269 + # else
2270 + #  if defined(FEAT_GUI_W32) && defined(FEAT_BEVAL)
2271 +       balloonEval = gui_mch_create_beval_area(NULL, NULL,
2272 +                                                   &netbeans_beval_cb, NULL);
2273 +       if (!p_beval)
2274 +           gui_mch_disable_beval_area(balloonEval);
2275 + #  endif
2276   # endif
2277 + #endif
2278   }
2279   
2280 ! #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_W32) || defined(PROTO)
2281   /*
2282    * Tell netbeans that the window was moved or resized.
2283    */
2284 ***************
2285 *** 2130,2146 ****
2286       void
2287   netbeans_file_opened(char *filename)
2288   {
2289 !     char buffer[2*MAXPATHLEN];
2290   
2291       if (!haveConnection)
2292         return;
2293   
2294       sprintf(buffer, "0:fileOpened=%d \"%s\" %s %s\n",
2295             0,
2296 !           nb_quote((char_u *)filename),
2297             "F",  /* open in NetBeans */
2298             "F"); /* modified */
2299   
2300       nbdebug(("EVT: %s", buffer));
2301   
2302       nb_send(buffer, "netbeans_file_opened");
2303 --- 2282,2303 ----
2304       void
2305   netbeans_file_opened(char *filename)
2306   {
2307 !     char    buffer[2*MAXPATHL];
2308 !     char_u  *q;
2309   
2310       if (!haveConnection)
2311         return;
2312   
2313 +     q = nb_quote((char_u *)filename);
2314 +     if (q == NULL)
2315 +       return;
2316       sprintf(buffer, "0:fileOpened=%d \"%s\" %s %s\n",
2317             0,
2318 !           (char *)q,
2319             "F",  /* open in NetBeans */
2320             "F"); /* modified */
2321   
2322 +     vim_free(q);
2323       nbdebug(("EVT: %s", buffer));
2324   
2325       nb_send(buffer, "netbeans_file_opened");
2326 ***************
2327 *** 2156,2162 ****
2328   {
2329       int               bufno = nb_getbufno(bufp);
2330       nbbuf_T   *nbbuf = nb_get_buf(bufno);
2331 !     char      buffer[2*MAXPATHLEN];
2332   
2333       if (!haveConnection)
2334         return;
2335 --- 2313,2319 ----
2336   {
2337       int               bufno = nb_getbufno(bufp);
2338       nbbuf_T   *nbbuf = nb_get_buf(bufno);
2339 !     char      buffer[2*MAXPATHL];
2340   
2341       if (!haveConnection)
2342         return;
2343 ***************
2344 *** 2265,2275 ****
2345       newtxt[newlen] = '\0';
2346       p = nb_quote(newtxt);
2347       if (p != NULL)
2348         sprintf((char *)buf, "%d:insert=%d %ld \"%s\"\n", bufno, cmdno, off, p);
2349       vim_free(p);
2350       vim_free(newtxt);
2351 -     nbdebug(("EVT: %s", buf));
2352 -     nb_send((char *)buf, "netbeans_inserted");
2353       vim_free(buf);
2354   }
2355   
2356 --- 2422,2434 ----
2357       newtxt[newlen] = '\0';
2358       p = nb_quote(newtxt);
2359       if (p != NULL)
2360 +     {
2361         sprintf((char *)buf, "%d:insert=%d %ld \"%s\"\n", bufno, cmdno, off, p);
2362 +       nbdebug(("EVT: %s", buf));
2363 +       nb_send((char *)buf, "netbeans_inserted");
2364 +     }
2365       vim_free(p);
2366       vim_free(newtxt);
2367       vim_free(buf);
2368   }
2369   
2370 ***************
2371 *** 2339,2348 ****
2372       void
2373   netbeans_keycommand(int key)
2374   {
2375 !     char      buf[2*MAXPATHLEN];
2376       int               bufno;
2377       char      keyName[60];
2378       long      off;
2379   
2380       if (!haveConnection)
2381         return;
2382 --- 2498,2508 ----
2383       void
2384   netbeans_keycommand(int key)
2385   {
2386 !     char      buf[2*MAXPATHL];
2387       int               bufno;
2388       char      keyName[60];
2389       long      off;
2390 +     char_u    *q;
2391   
2392       if (!haveConnection)
2393         return;
2394 ***************
2395 *** 2355,2365 ****
2396       if (bufno == -1)
2397       {
2398         nbdebug(("got keycommand for non-NetBeans buffer, opening...\n"));
2399         sprintf(buf, "0:fileOpened=%d \"%s\" %s %s\n", 0,
2400 !               curbuf->b_ffname == NULL ? (char_u *)""
2401 !                                                : nb_quote(curbuf->b_ffname),
2402                 "T",  /* open in NetBeans */
2403                 "F"); /* modified */
2404         nbdebug(("EVT: %s", buf));
2405         nb_send(buf, "netbeans_keycommand");
2406   
2407 --- 2515,2530 ----
2408       if (bufno == -1)
2409       {
2410         nbdebug(("got keycommand for non-NetBeans buffer, opening...\n"));
2411 +       q = curbuf->b_ffname == NULL ? (char_u *)""
2412 +                                                : nb_quote(curbuf->b_ffname);
2413 +       if (q == NULL)
2414 +           return;
2415         sprintf(buf, "0:fileOpened=%d \"%s\" %s %s\n", 0,
2416 !               q,
2417                 "T",  /* open in NetBeans */
2418                 "F"); /* modified */
2419 +       if (curbuf->b_ffname != NULL)
2420 +           vim_free(q);
2421         nbdebug(("EVT: %s", buf));
2422         nb_send(buf, "netbeans_keycommand");
2423   
2424 ***************
2425 *** 2372,2377 ****
2426 --- 2537,2547 ----
2427       sprintf(buf, "%d:newDotAndMark=%d %ld %ld\n", bufno, cmdno, off, off);
2428       nbdebug(("EVT: %s", buf));
2429       nb_send(buf, "netbeans_keycommand");
2430
2431 +     /* To work on Win32 you must apply patch to ExtEditor module
2432 +      * from ExtEdCaret.java.diff - make EVT_newDotAndMark handler
2433 +      * more synchronous
2434 +      */
2435   
2436       /* now send keyCommand event */
2437       sprintf(buf, "%d:keyCommand=%d \"%s\"\n", bufno, cmdno, keyName);
2438 *** ../vim-6.2.106/src/os_mswin.c       Mon Aug  4 22:04:43 2003
2439 --- src/os_mswin.c      Fri Sep 12 21:30:03 2003
2440 ***************
2441 *** 163,168 ****
2442 --- 163,169 ----
2443   # endif
2444   #endif
2445   
2446 + extern int WSInitialized;
2447   
2448   /* Don't generate prototypes here, because some systems do have these
2449    * functions. */
2450 ***************
2451 *** 229,234 ****
2452 --- 230,242 ----
2453   
2454   # ifdef FEAT_OLE
2455       UninitOLE();
2456 + # endif
2457 + # ifdef FEAT_NETBEANS_INTG
2458 +     if (WSInitialized)
2459 +     {
2460 +       WSInitialized = FALSE;
2461 +         WSACleanup();
2462 +     }
2463   # endif
2464   #ifdef DYNAMIC_GETTEXT
2465       dyn_libintl_end();
2466 *** ../vim-6.2.106/src/os_win32.h       Wed May  7 22:53:05 2003
2467 --- src/os_win32.h      Fri Sep 12 21:30:03 2003
2468 ***************
2469 *** 140,145 ****
2470 --- 140,146 ----
2471   # define TRACE1(sz, p1)               Trace(_T(sz), p1)
2472   # define TRACE2(sz, p1, p2)   Trace(_T(sz), p1, p2)
2473   # define TRACE3(sz, p1, p2, p3) Trace(_T(sz), p1, p2, p3)
2474 + # define TRACE4(sz, p1, p2, p3, p4) Trace(_T(sz), p1, p2, p3, p4)
2475   
2476   /* In debug version, writes trace messages to debug stream */
2477   void __cdecl
2478 ***************
2479 *** 156,161 ****
2480 --- 157,163 ----
2481   # define TRACE1(sz, p1)
2482   # define TRACE2(sz, p1, p2)
2483   # define TRACE3(sz, p1, p2, p3)
2484 + # define TRACE4(sz, p1, p2, p3, p4)
2485   
2486   #endif /* !_DEBUG */
2487   
2488 *** ../vim-6.2.106/src/proto/gui_w32.pro        Sun Jun  1 12:26:27 2003
2489 --- src/proto/gui_w32.pro       Sat Sep 13 21:28:07 2003
2490 ***************
2491 *** 78,81 ****
2492 --- 78,88 ----
2493   void gui_mch_drawsign __ARGS((int row, int col, int typenr));
2494   void *gui_mch_register_sign __ARGS((char_u *signfile));
2495   void gui_mch_destroy_sign __ARGS((void *sign));
2496 + void gui_mch_disable_beval_area __ARGS((BalloonEval *beval));
2497 + void gui_mch_enable_beval_area __ARGS((BalloonEval *beval));
2498 + void gui_mch_post_balloon __ARGS((BalloonEval *beval, char_u *mesg));
2499 + BalloonEval *gui_mch_create_beval_area __ARGS((void *target, char_u *mesg, void (*mesgCB)(BalloonEval *, int), void *clientData));
2500 + void Handle_WM_Notify __ARGS((HWND hwnd, LPNMHDR pnmh));
2501 + void gui_mch_destroy_beval_area __ARGS((BalloonEval *beval));
2502 + void netbeans_draw_multisign_indicator __ARGS((int row));
2503   /* vim: set ft=c : */
2504 *** ../vim-6.2.106/src/proto/netbeans.pro       Sun Jul 27 14:16:53 2003
2505 --- src/proto/netbeans.pro      Sat Sep 13 21:27:52 2003
2506 ***************
2507 *** 1,6 ****
2508 --- 1,8 ----
2509   /* netbeans.c */
2510   void netbeans_Xt_connect __ARGS((void *context));
2511   void netbeans_gtk_connect __ARGS((void));
2512 + void netbeans_w32_connect __ARGS((void));
2513 + void messageFromNetbeansW32 __ARGS((void));
2514   void netbeans_end __ARGS((void));
2515   void netbeans_startup_done __ARGS((void));
2516   void netbeans_frame_moved __ARGS((int new_x, int new_y));
2517 ***************
2518 *** 13,18 ****
2519 --- 15,21 ----
2520   void netbeans_saved __ARGS((buf_T *bufp));
2521   void netbeans_deleted_all_lines __ARGS((buf_T *bufp));
2522   int netbeans_is_guarded __ARGS((linenr_T top, linenr_T bot));
2523 + void netbeans_draw_multisign_indicator __ARGS((int row));
2524   void netbeans_draw_multisign_indicator __ARGS((int row));
2525   void netbeans_gutter_click __ARGS((linenr_T lnum));
2526   /* vim: set ft=c : */
2527 *** ../vim-6.2.106/src/proto.h  Sat May 24 17:27:36 2003
2528 --- src/proto.h Tue Sep 30 20:57:53 2003
2529 ***************
2530 *** 172,177 ****
2531 --- 172,182 ----
2532   #  ifdef FEAT_GUI_W16
2533   #   include "gui_w16.pro"
2534   #  endif
2535 +     /* Ugly solution for "BalloonEval" not being defined while it's used in
2536 +      * the prototypes. */
2537 + #  ifndef FEAT_BEVAL
2538 + #   define BalloonEval int
2539 + #  endif
2540   #  ifdef FEAT_GUI_W32
2541   #   include "gui_w32.pro"
2542   #  endif
2543 *** ../vim-6.2.106/src/vim.h    Thu Sep 11 21:25:44 2003
2544 --- src/vim.h   Wed Sep 17 22:15:42 2003
2545 ***************
2546 *** 17,23 ****
2547       defined(FEAT_TCL) || \
2548       defined(DYNAMIC_GETTEXT) || \
2549       defined(DYNAMIC_ICONV) || \
2550 !     defined(DYNAMIC_IME)
2551   #  pragma option -pc
2552   # else
2553   #  pragma option -pr
2554 --- 17,24 ----
2555       defined(FEAT_TCL) || \
2556       defined(DYNAMIC_GETTEXT) || \
2557       defined(DYNAMIC_ICONV) || \
2558 !     defined(DYNAMIC_IME) || \
2559 !     defined(XPM)
2560   #  pragma option -pc
2561   # else
2562   #  pragma option -pr
2563 ***************
2564 *** 1463,1468 ****
2565 --- 1470,1479 ----
2566   # ifdef FEAT_GUI_W32
2567   #  ifdef FEAT_OLE
2568   #   define WM_OLE (WM_APP+0)
2569 + #  endif
2570 + #  ifdef FEAT_NETBEANS_INTG
2571 +     /* message for Netbeans socket event */
2572 + #   define WM_NETBEANS (WM_APP+1)
2573   #  endif
2574   # endif
2575   
2576 *** ../vim-6.2.106/src/xpm_w32.c        Sun Sep 14 16:09:21 2003
2577 --- src/xpm_w32.c       Fri Sep 12 21:49:22 2003
2578 ***************
2579 *** 0 ****
2580 --- 1,60 ----
2581 + /*
2582 +  * Load XPM image.
2583 +  *
2584 +  * This function is placed in separate file because Xpm headers conflict with
2585 +  * Vim ones :(
2586 +  *
2587 +  * Written by Sergey Khorev.
2588 +  * http://iamphet.nm.ru/vim/index.html
2589 +  */
2590
2591 + #ifndef WIN32_LEAN_AND_MEAN
2592 + # define WIN32_LEAN_AND_MEAN
2593 + #endif
2594 + #include <windows.h>
2595
2596 + /* reduced def from Vim.h */
2597 + #ifndef __ARGS
2598 + # if defined(__STDC__) || defined(__GNUC__) || defined(WIN3264)
2599 + #  define __ARGS(x) x
2600 + # else
2601 + #  define __ARGS(x) ()
2602 + # endif
2603 + #endif
2604
2605 + #include "xpm_w32.h"
2606
2607 + /* Engage Windows support in libXpm */
2608 + #define FOR_MSW
2609
2610 + #include "xpm.h"
2611
2612 + /*
2613 +  * Tries to load Xpm image from file 'filename'.
2614 +  * If fails return -1.
2615 +  * success - 0 and image and mask BITMAPS
2616 +  */
2617 +     int
2618 + LoadXpmImage(filename, hImage, hShape)
2619 +     char    *filename;
2620 +     HBITMAP *hImage;
2621 +     HBITMAP *hShape;
2622 + {
2623 +     XImage        *img;   /* loaded image */
2624 +     XImage        *shp;  /* shapeimage */
2625 +     XpmAttributes   attr;
2626 +     int                   res;
2627 +     HDC                   hdc = CreateCompatibleDC(NULL);
2628
2629 +     attr.valuemask = 0;
2630 +     res = XpmReadFileToImage(&hdc, filename, &img, &shp, &attr);
2631 +     DeleteDC(hdc);
2632 +     if (res < 0)
2633 +       return -1;
2634 +     else
2635 +     {
2636 +       *hImage = img->bitmap;
2637 +       *hShape = shp->bitmap;
2638 +       return 0;
2639 +     }
2640 + }
2641 *** ../vim-6.2.106/src/xpm_w32.h        Sun Sep 14 16:09:21 2003
2642 --- src/xpm_w32.h       Fri Sep 12 21:49:01 2003
2643 ***************
2644 *** 0 ****
2645 --- 1,7 ----
2646 + /*
2647 +  * Header file for xpm_w32.c
2648 +  */
2649
2650 + #ifndef XPM_W32__H
2651 + int LoadXpmImage __ARGS((char *filename, HBITMAP *hImage, HBITMAP *hShape));
2652 + #endif
2653 *** ../vim-6.2.106/src/version.c        Sat Sep 27 20:18:38 2003
2654 --- src/version.c       Sun Oct 12 16:27:29 2003
2655 ***************
2656 *** 626,629 ****
2657 --- 626,636 ----
2658         "-xterm_save",
2659   #endif
2660 + #ifdef WIN3264
2661 + # ifdef FEAT_XPM_W32
2662 +       "+xpm_w32",
2663 + # else
2664 +       "-xpm_w32",
2665 + # endif
2666 + #endif
2667         NULL
2668   };
2669 ***************
2670 *** 632,633 ****
2671 --- 638,641 ----
2672   {   /* Add new patch number below this line */
2673 + /**/
2674 +     107,
2675   /**/
2676
2677 -- 
2678 If Microsoft would build a car...
2679 ... Occasionally, executing a maneuver such as a left turn
2680 would cause your car to shut down and refuse to restart, in
2681 which case you would have to reinstall the engine.
2682
2683  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
2684 ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
2685 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
2686  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
This page took 0.269162 seconds and 3 git commands to generate.