Commits

equalsraf  committed 5011146 Merge with conflicts

Merge branch 'master' into merge-upstream

Conflicts:
src/os_mswin.c
src/vim.h

* Upstream Vim moved some windows clipboard code around

  • Participants
  • Parent commits 4ff851b, 1ada4f9

Comments (0)

Files changed (89)

+# Unixen: object and executable files.
+*.o
+src/vim
+src/qvim
+src/xxd/xxd
+src/auto/if_perl.c
+src/tags
+
+# We do need src/auto/configure.
+src/auto/config.aap
+src/auto/config.cache
+src/auto/config.h
+src/auto/config.log
+src/auto/config.mk
+src/auto/config.status
+src/auto/configure.aap
+src/auto/osdef.h
+src/auto/link.log
+src/auto/link.sed
+src/auto/pathdef.c
+
+# Windows
+*.exe
+*.idb
+*.manifest
+*.exp
+*.obj
+*.pdb
+*.ilk
+*.sln
+*.suo
+*.res
+*.RES
+src/if_perl.c
+src/pathdef.c
+src/Obj*/pathdef.c
+gvimext.dll
+gvimext.lib
+
+# All platforms
+*.rej
+*.orig
+*.log
+*.mo
+*.moc
+*.status
+*.swp
+.*.sw[oplnmk]
+*~
+src/po/vim.pot
+
+# Generated by "make test"
+src/po/*.ck 
+src/testdir/mbyte.vim 
+src/testdir/mzscheme.vim 
+src/testdir/lua.vim 
+src/testdir/small.vim 
+src/testdir/tiny.vim 
+src/testdir/test*.out
+
+# Miscellaneous
+src/qtresources.cpp
+autom4te.cache
+This is README for the Qt GUI - if you want the VIM README check README.txt
+
+# Compiling VIM with the Qt gui
+
+## Building on Linux/BSD systems
+
+For the most part you can build it as you would build vim with support for another gui, just issue the following commands:
+
+    $ ./configure --enable-gui=qt
+    $ make  
+
+All the regular configure options apply. Just don’t forget, you need libqt and libqt4-devel now. Usually you'll want to pass in something like:
+
+    ./configure --prefix=/usr/ --with-features=huge --with-vim-name=qvim --enable-gui=qt
+
+If configure is unable to find Qt, try passing in the Qt base dir as follows:
+
+    ./configure <...> --with-qt-dir=/usr/lib/qt4
+
+The vim binary will be created under **src/vim**.
+
+
+## Building on Windows
+
+As of commit c0956732b437 we have some initial support to build vim-Qt in windows. You can build vim-Qt for windows provided that you have Qt, CMake and an adequate compiler(Mingw or Visual Studio).
+
+Naturally you need to have Qt installed. The best way to do this depends on your setup - check the Qt website for more details and keep in mind that you need to match your Qt library version with your compiler.
+
+
+### Visual Studio 2010
+
+From the VS console:
+
+    $ cmake -G NMake Makefiles PATH_TO_QTVIM\src
+    $ nmake
+
+This will generate a binary, qvim.exe. Keep the runtime folder in the same folder as qvim.exe, otherwise vim will not have access to menus and configuration files.
+
+
+### MinGW
+
+Make sure all mingw tools are in your path (i.e. gcc, mingw32-make), and then from your console:
+
+    $ cmake -G MinGW Makefiles PATH_TO_QTVIM\src
+    $ mingw32-make
+
+
+
+
+
+

File README_qt.txt

+README.md

File runtime/menu.vim

   endif
   unlet s:n
 endif
-if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac")
+if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") || has("gui_qt")
   an 20.470 &Edit.Select\ Fo&nt\.\.\.	:set guifont=*<CR>
 endif
 

File src/CMakeLists.txt

+cmake_minimum_required(VERSION 2.8)
+
+find_package(Qt4 REQUIRED)
+set( QT_USE_QTGUI TRUE )
+include(${QT_USE_FILE} )
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(proto auto . qt)
+
+# pathdef
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pathdef.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/auto/pathdef.c)
+
+#
+# Vim executable
+#
+
+set(VIM_SOURCES buffer.c 
+		blowfish.c 
+		charset.c 
+		diff.c 
+		digraph.c 
+		edit.c 
+		eval.c 
+		ex_cmds.c 
+		ex_cmds2.c 
+		ex_docmd.c 
+		ex_eval.c 
+		ex_getln.c 
+		fileio.c 
+		fold.c 
+		getchar.c 
+		hardcopy.c 
+		hashtab.c 
+		if_cscope.c 
+		if_xcmdsrv.c 
+		main.c 
+		mark.c 
+		memfile.c 
+		memline.c 
+		menu.c 
+		message.c 
+		misc1.c 
+		misc2.c 
+		move.c 
+		mbyte.c 
+		normal.c 
+		ops.c 
+		option.c 
+		popupmnu.c 
+		quickfix.c 
+		regexp.c 
+		screen.c 
+		search.c 
+		sha256.c 
+		spell.c 
+		syntax.c 
+		tag.c 
+		term.c 
+		ui.c 
+		undo.c 
+		window.c 
+		gui.c 
+		netbeans.c 
+		version.c 
+		auto/pathdef.c)
+
+set(GUI_SOURCES gui_qt.cpp )
+set(MOC_SOURCES qt/qvimshell.cpp 
+		qt/mainwindow.cpp 
+		qt/vimaction.cpp 
+		qt/tabbar.cpp 
+		qt/vimaction.cpp 
+		qt/vimscrollbar.cpp 
+		qt/vimwrapper.cpp 
+		qt/fontdialog.cpp
+		qt/colortable.cpp
+		qt/vimevents.cpp
+		qt/scrollarea.cpp)
+
+set(QVIM_RCS qt/icons.qrc)
+QT4_ADD_RESOURCES( QVIM_RC_SRCS ${QVIM_RCS} )
+
+qt4_automoc(${MOC_SOURCES})
+
+
+if(MSVC OR MINGW)
+
+	set(VIM_SOURCES ${VIM_SOURCES} 
+			os_win32.c 
+			os_mswin.c)
+
+	add_definitions(-DWIN32
+			-DNO_X11_INCLUDES
+			-DFEAT_GUI_QT
+			-UHAVE_X11
+			-DFEAT_HUGE
+			-DFEAT_MBYTE
+			-UFEAT_SIGN
+			-D__func__=__FUNCTION__
+			-D_CRT_SECURE_NO_WARNINGS)
+
+	if (MSVC)
+		add_definitions(-wd4099)
+	endif (MSVC)
+
+	set(SOURCES ${VIM_SOURCES} ${GUI_SOURCES} ${MOC_SOURCES} ${QVIM_RC_SRCS})
+
+	if ( CMAKE_BUILD_TYPE STREQUAL "Debug" )
+		message("Building Debug version")
+		add_executable(qvim ${SOURCES})
+	else ( CMAKE_BUILD_TYPE STREQUAL "Debug" )
+		add_executable(qvim WIN32 ${SOURCES})
+	endif ( CMAKE_BUILD_TYPE STREQUAL "Debug" )
+
+	target_link_libraries(qvim ${QT_QTMAIN_LIBRARY} # Link to qtmain.lib to avoid WinMain()
+				   ${QT_LIBRARIES} )	# Link to Qt
+else(MSVC OR MINGW)
+	message(FATAL_ERROR "Could not find Visual Studio or Mingw - are they on the path? This is Windows, right?")
+endif(MSVC OR MINGW)
+
+

File src/Makefile

 NEXTAW_TESTTARGET = gui
 NEXTAW_BUNDLE	=
 
+### Qt
+# We use the following to build
+# - QT_MOC
+# - QT_LIBS
+# - QT_INCPATH
+MOC		= $(QT_MOC)
+QT_LIBS1	= $(QT_LIBS)
+QT_SRC	= gui.c gui_qt.cpp pty.c gui_beval.c \
+			qt/qvimshell.cpp qt/mainwindow.cpp qt/vimaction.cpp qt/scrollarea.cpp \
+			qt/fontdialog.cpp \
+			qt/colortable.cpp \
+			qt/vimwrapper.cpp qt/tabbar.cpp qt/vimscrollbar.cpp \
+			qt/vimevents.cpp
+QT_OBJ	= objects/gui.o objects/gui_qt.o \
+			objects/pty.o objects/gui_beval.o \
+			objects/mainwindow.o objects/qvimshell.o objects/vimaction.o objects/qtresources.o \
+			objects/colortable.o \
+			objects/scrollarea.o objects/fontdialog.o objects/vimwrapper.o \
+			objects/vimevents.o \
+			objects/tabbar.o objects/vimscrollbar.o
+
+QT_DEFS	= -DFEAT_GUI_QT $(NARROW_PROTO) -Iqt -I. $(QT_INCPATH)
+QT_IPATH	= $(GUI_INC_LOC)
+QT_LIBS_DIR = $(GUI_LIB_LOC)
+
+QT_INSTALL  = install_normal install_gui_extra
+
+# Qt needs to be linked using the c++ compiler
+ifdef QT_LIBS
+	CClink=$(CXX)
+endif
+
+
 ### (J)  Sun OpenWindows 3.2 (SunOS 4.1.x) or earlier that produce these ld
 #	 errors:  ld: Undefined symbol
 #		      _get_wmShellWidgetClass
 CARBONGUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET)
 
 # All GUI files
-ALL_GUI_SRC  = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c pty.c
+ALL_GUI_SRC  = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c pty.c gui_qt_cpp qt/qvimshell.cpp qt/mainwindow.cpp qt/vimgui.cpp qt/fontdialog.cpp qt/colortable.cpp
 ALL_GUI_PRO  = gui.pro gui_gtk.pro gui_motif.pro gui_xmdlg.pro gui_athena.pro gui_gtk_x11.pro gui_x11.pro gui_w16.pro gui_w32.pro gui_photon.pro
 
 # }}}
 PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
 POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS)
 
-ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS)
+ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS) ${QT_CFLAGS}
 
 # Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
 # with "-E".
 	$(WORKSHOP_SRC) \
 	$(WSDEBUG_SRC)
 
-TAGS_SRC = *.c *.cpp if_perl.xs
+TAGS_SRC = *.c *.cpp if_perl.xs qt/*.cpp
 
 EXTRA_SRC = hangulin.c if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \
 	    if_python.c if_python3.c if_tcl.c if_ruby.c if_sniff.c \
 objects/gui_athena.o: gui_athena.c
 	$(CCC) -o $@ gui_athena.c
 
+## Qt objects
+objects/gui_qt.o: gui_qt.cpp
+	$(CXX) $(ALL_CFLAGS) -o $@ -c gui_qt.cpp
+
+objects/mainwindow.o: qt/mainwindow.cpp
+	$(MOC) qt/mainwindow.h > mainwindow.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/mainwindow.cpp
+
+objects/qvimshell.o: qt/qvimshell.cpp
+	$(MOC) qt/qvimshell.h > qvimshell.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/qvimshell.cpp
+
+objects/colortable.o: qt/colortable.cpp
+	$(MOC) qt/colortable.h > colortable.moc
+	$(CXX) $(ALL_CFLAGS) -O0 -o $@ -c qt/colortable.cpp # -O0 is needed here
+
+objects/vimaction.o: qt/vimaction.cpp
+	$(MOC) qt/vimaction.h > vimaction.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/vimaction.cpp
+
+objects/qtresources.o: qt/icons.qrc
+	rcc -no-compress qt/icons.qrc -o qtresources.cpp
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qtresources.cpp
+
+objects/vimscrollbar.o: qt/vimscrollbar.cpp
+	$(MOC) qt/vimscrollbar.h > vimscrollbar.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/vimscrollbar.cpp
+
+objects/scrollarea.o: qt/scrollarea.cpp
+	$(MOC) qt/scrollarea.h > scrollarea.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/scrollarea.cpp
+
+objects/vimgui.o: qt/vimgui.cpp
+	$(MOC) qt/vimgui.h > vimgui.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/vimgui.cpp
+
+objects/fontdialog.o: qt/fontdialog.cpp
+	$(MOC) qt/fontdialog.h > fontdialog.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/fontdialog.cpp
+
+objects/vimwrapper.o: qt/vimwrapper.cpp
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/vimwrapper.cpp
+
+objects/vimevents.o: qt/vimevents.cpp
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/vimevents.cpp
+
+objects/tabbar.o: qt/tabbar.cpp
+	$(MOC) qt/tabbar.h > tabbar.moc
+	$(CXX) $(ALL_CFLAGS) -o $@ -c qt/tabbar.cpp
+
 objects/gui_beval.o: gui_beval.c
 	$(CCC) -o $@ gui_beval.c
 

File src/Toolchain-mingw32.cmake

+
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# specify the cross compiler
+SET(CMAKE_C_COMPILER   i686-w64-mingw32-gcc)
+SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
+
+SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32/sys-root/mingw)
+
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET(QT_QMAKE_EXECUTABLE /usr/i686-w64-mingw32/bin/qmake CACHE INTERNAL "" FORCE)
+SET(QT_MOC_EXECUTABLE /usr/i686-w64-mingw32/bin/moc CACHE INTERNAL "" FORCE)
+SET(QT_RCC_EXECUTABLE /usr/i686-w64-mingw32/bin/rcc CACHE INTERNAL "" FORCE)
+SET(QT_UIC_EXECUTABLE /usr/i686-w64-mingw32/bin/uic CACHE INTERNAL "" FORCE)

File src/config.mk.in

 GUI_X_LIBS	= @GUI_X_LIBS@
 MOTIF_LIBNAME	= @MOTIF_LIBNAME@
 GTK_LIBNAME	= @GTK_LIBNAME@
+QT_MOC		= @QT_MOC@
+QT_LIBS		= @QT_LIBS@
+QT_INCPATH	= @QT_INCPATH@
+QT_CXXFLAGS	= @QT_CXXFLAGS@
+QT_CFLAGS	= @QT_CFLAGS@
 
 ### Any OS dependent extra source and object file
 OS_EXTRA_SRC	= @OS_EXTRA_SRC@