home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.107 < prev    next >
Encoding:
Internet Message Format  |  2003-10-13  |  69.9 KB

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