Moving stuff around: medit-0.99
parent
6f2419c443
commit
a214138f89
|
@ -1,34 +0,0 @@
|
|||
*.orig
|
||||
*.pyc
|
||||
*.rej
|
||||
*.bak
|
||||
*~
|
||||
Makefile.in
|
||||
Makefile.am
|
||||
.Makefile.am.*
|
||||
.globalvars
|
||||
build/
|
||||
autom4te.cache/
|
||||
.hg/
|
||||
po*/dist
|
||||
po*/intltool-update
|
||||
po*/missing
|
||||
po*/notexist
|
||||
po*/pot
|
||||
Makefile.in.in
|
||||
*-old.*
|
||||
*-old
|
||||
moo/mooapp/mooapp-credits.h
|
||||
.hgtags
|
||||
.moo.mprj.session
|
||||
aclocal.m4
|
||||
compile
|
||||
config.guess
|
||||
config.h.in
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
intltool-*.in
|
||||
ltmain.sh
|
||||
missing
|
63
.hgignore
63
.hgignore
|
@ -1,44 +1,25 @@
|
|||
syntax: glob
|
||||
plat/win32/gtk-win/jhbuild/
|
||||
plat/win32/gtk-win/debug/
|
||||
plat/win32/gtk-win/release/
|
||||
plat/win32/gtk-win/tarballs/
|
||||
plat/win32/gtk-win/*.log
|
||||
plat/win32/gtk-win/*~
|
||||
.git/
|
||||
build/
|
||||
*-old
|
||||
*-old.c
|
||||
*.orig
|
||||
*.rej
|
||||
*.bak
|
||||
*.pyc
|
||||
*.tmp
|
||||
*.gmo
|
||||
*.stamp
|
||||
*-gxml.h
|
||||
*~
|
||||
*.a
|
||||
.DS_Store
|
||||
Makefile.in
|
||||
*-enums.[ch]
|
||||
.moo.mprj.session
|
||||
*.ncb
|
||||
*.suo
|
||||
*.vcproj.*
|
||||
vs/Debug/
|
||||
vs/Release/
|
||||
doc/help/*.html
|
||||
doc/help.html
|
||||
doc/help-sections.h
|
||||
doc/medit.1
|
||||
CMakeFiles/
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
moo/mooedit/gtksourceview/*-mangled.*
|
||||
depcomp
|
||||
compile
|
||||
config.guess
|
||||
config.sub
|
||||
configure
|
||||
doc/help.stamp
|
||||
install-sh
|
||||
ltmain.sh
|
||||
m4/intltool.m4
|
||||
m4/libtool.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
missing
|
||||
po-gsv/Makefile.in.in
|
||||
po/Makefile.in.in
|
||||
build/
|
||||
autom4te.cache/
|
||||
aclocal.m4
|
||||
*~
|
||||
*.orig
|
||||
|
||||
syntax: regexp
|
||||
^po(-gsv)?/(Makefile\.in\.in|dist|missing|notexist|pot|intltool-update)$
|
||||
^moo/mooapp/mooapp-credits\.h
|
||||
^moo/mooutils/stock-(moo|medit)\.h
|
||||
^doc/(man-)?medit\.t2t$
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
PROJECT(MOO)
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
FIND_PACKAGE(MooCmake)
|
||||
|
||||
MOO_DEFINE_VERSIONS("0.10.5-unstable")
|
||||
|
||||
SET(MOO_PACKAGE_NAME moo)
|
||||
SET(MOO_EMAIL "emuntyan@sourceforge.net")
|
||||
SET(MOO_COPYRIGHT "2004-2010 Yevgen Muntyan <${MOO_EMAIL}>")
|
||||
SET(PACKAGE_BUGREPORT ${MOO_EMAIL})
|
||||
SET(MOO_PACKAGE_VENDOR ${MOO_EMAIL})
|
||||
|
||||
MOO_OPTION(MOO_BUILD_CTAGS ${MOO_OS_UNIX} "Build Ctags plugin" HIDDEN ${MOO_OS_WIN32} HEADER TRUE)
|
||||
MOO_OPTION(MOO_ENABLE_PROJECT FALSE "Build project plugin" HIDDEN TRUE)
|
||||
MOO_OPTION(MOO_ENABLE_GENERATED_FILES ${MOO_OS_UNIX} "Run gtk-update-icon-cache on install")
|
||||
MOO_OPTION(MOO_BROKEN_GTK_THEME FALSE "Work around bugs in gtk theme" HEADER TRUE)
|
||||
|
||||
MOO_OPTION(MOO_ENABLE_UNIT_TESTS FALSE "Build unit tests" DEFINE TRUE)
|
||||
IF(MOO_ENABLE_UNIT_TESTS)
|
||||
ADD_DEFINITIONS(-DMOO_ENABLE_UNIT_TESTS)
|
||||
ENDIF(MOO_ENABLE_UNIT_TESTS)
|
||||
|
||||
INCLUDE(cmake/gtk.cmake)
|
||||
INCLUDE(cmake/moo.cmake)
|
||||
INCLUDE(cmake/dist.cmake)
|
||||
|
||||
SET(MOO_MODULE_MAJOR_VERSION 1)
|
||||
SET(MOO_MODULE_MINOR_VERSION 0)
|
||||
SET(MOO_MODULE_VERSION \"${MOO_MODULE_MAJOR_VERSION}.${MOO_MODULE_MINOR_VERSION}\")
|
||||
|
||||
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
||||
ADD_DEFINITIONS(-DGETTEXT_PACKAGE=\"moo\")
|
||||
ADD_DEFINITIONS(-DG_LOG_DOMAIN=\"Moo\")
|
||||
INCLUDE_DIRECTORIES(${MOO_BINARY_DIR} ${MOO_BINARY_DIR}/moo ${MOO_SOURCE_DIR}/moo)
|
||||
ADD_DEFINITIONS(${GTK_CFLAGS} ${GTK_CFLAGS_OTHER})
|
||||
|
||||
INCLUDE(config.cmake)
|
||||
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
ADD_SUBDIRECTORY(moo)
|
||||
ADD_SUBDIRECTORY(plugins)
|
||||
ADD_SUBDIRECTORY(medit)
|
||||
|
||||
MOO_ADD_MSG_CATALOG(moo po)
|
||||
MOO_ADD_MSG_CATALOG(moo-gsv po-gsv)
|
||||
|
||||
MOO_WRITE_CONFIG_H(config.h.in config.h @ONLY)
|
||||
|
||||
CONFIGURE_FILE(config-dirs.h.in config-dirs.h @ONLY)
|
||||
|
||||
IF(WIN32)
|
||||
GET_FILENAME_COMPONENT(_MOO_SOURCE_DIR ${MOO_SOURCE_DIR} ABSOLUTE)
|
||||
# TO_NATIVE_PATH damn it! Cmake is such a wonderful piece of language...
|
||||
STRING(REPLACE "/" "\\" _MOO_SOURCE_DIR "${_MOO_SOURCE_DIR}")
|
||||
GET_FILENAME_COMPONENT(_MOO_BINARY_DIR ${MOO_BINARY_DIR} ABSOLUTE)
|
||||
STRING(REPLACE "/" "\\" _MOO_BINARY_DIR "${_MOO_BINARY_DIR}")
|
||||
SET(_MOO_RUN_HOW "@")
|
||||
CONFIGURE_FILE(plat/win32/run-medit.in run-medit.bat)
|
||||
SET(_MOO_RUN_HOW "gdb --args ")
|
||||
CONFIGURE_FILE(plat/win32/run-medit.in run-medit-in-gdb.bat)
|
||||
IF(MOO_ENABLE_UNIT_TESTS)
|
||||
SET(_MOO_RUN_HOW "@")
|
||||
CONFIGURE_FILE(plat/win32/run-tests.in run-tests.bat)
|
||||
ENDIF(MOO_ENABLE_UNIT_TESTS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(NOT WIN32)
|
||||
INSTALL(PROGRAMS plat/unix/xdg-open plat/unix/xdg-email plat/unix/moo-open-html-help DESTINATION ${MOO_DATA_DIR}/scripts)
|
||||
ENDIF(NOT WIN32)
|
|
@ -0,0 +1,13 @@
|
|||
ACLOCAL_AMFLAGS = -I m4 $(ACLOCAL_FLAGS)
|
||||
|
||||
SUBDIRS = po po-gsv doc moo plugins medit
|
||||
|
||||
unix_scripts = \
|
||||
plat/unix/xdg-open \
|
||||
plat/unix/xdg-email \
|
||||
plat/unix/moo-open-html-help
|
||||
EXTRA_DIST = $(unix_scripts)
|
||||
if MOO_OS_UNIX
|
||||
scriptsdir = $(MOO_DATA_DIR)/scripts
|
||||
scripts_DATA = $(unix_scripts)
|
||||
endif MOO_OS_UNIX
|
|
@ -0,0 +1,28 @@
|
|||
[ -z "$ACLOCAL" ] && ACLOCAL=aclocal
|
||||
[ -z "$AUTOCONF" ] && AUTOCONF=autoconf
|
||||
[ -z "$AUTOHEADER" ] && AUTOHEADER=autoheader
|
||||
[ -z "$AUTOMAKE" ] && AUTOMAKE=automake
|
||||
|
||||
workingdir=`pwd`
|
||||
srcdir=`dirname "$0"`
|
||||
srcdir=`cd "$srcdir" && pwd`
|
||||
|
||||
cd "$srcdir"
|
||||
|
||||
# autoreconf --verbose --install --force || exit $!
|
||||
|
||||
run_cmd() {
|
||||
echo "$@"
|
||||
"$@" || exit $!
|
||||
}
|
||||
|
||||
run_cmd libtoolize --copy --force
|
||||
|
||||
run_cmd intltoolize --copy --force
|
||||
echo "sed -e s/@GETTEXT_PACKAGE@/moo-gsv/ po/Makefile.in.in > po-gsv/Makefile.in.in"
|
||||
sed -e s/@GETTEXT_PACKAGE@/@GETTEXT_PACKAGE@-gsv/ po/Makefile.in.in > po-gsv/Makefile.in.in || exit $!
|
||||
|
||||
run_cmd $ACLOCAL --force -I m4 $ACLOCAL_FLAGS
|
||||
run_cmd $AUTOCONF --force
|
||||
run_cmd $AUTOHEADER --force
|
||||
run_cmd $AUTOMAKE --add-missing --copy --force-missing
|
115
cmake/dist.cmake
115
cmake/dist.cmake
|
@ -1,115 +0,0 @@
|
|||
FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake.in
|
||||
"
|
||||
IF(NOT EXISTS \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\")
|
||||
MESSAGE(FATAL_ERROR \"Cannot find install manifest: \\\"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\\\"\")
|
||||
ENDIF(NOT EXISTS \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\")
|
||||
|
||||
FILE(READ \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\" files)
|
||||
STRING(REGEX REPLACE \"\\n\" \";\" files \"\${files}\")
|
||||
FOREACH(file \${files})
|
||||
MESSAGE(STATUS \"Uninstalling \\\"\$ENV{DESTDIR}\${file}\\\"\")
|
||||
IF(EXISTS \"\$ENV{DESTDIR}\${file}\")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND \"\@CMAKE_COMMAND\@\" -E remove \"\$ENV{DESTDIR}\${file}\"
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
IF(NOT rm_retval EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR \"Problem when removing \\\"\$ENV{DESTDIR}\${file}\\\": \${rm_retval}\")
|
||||
ENDIF(NOT rm_retval EQUAL 0)
|
||||
ENDIF(EXISTS \"\$ENV{DESTDIR}\${file}\")
|
||||
ENDFOREACH(file)
|
||||
")
|
||||
CONFIGURE_FILE("${CMAKE_BINARY_DIR}/cmake_uninstall.cmake.in" "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" @ONLY)
|
||||
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# Installation dirs
|
||||
#
|
||||
|
||||
IF(WIN32)
|
||||
IF("${CMAKE_INSTALL_PREFIX}" STREQUAL "C:/Program Files/MOO")
|
||||
SET(CMAKE_INSTALL_PREFIX "C:/Program Files/medit")
|
||||
ELSEIF("${CMAKE_INSTALL_PREFIX}" STREQUAL "C:/Program Files (x86)/MOO")
|
||||
SET(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/medit")
|
||||
ENDIF("${CMAKE_INSTALL_PREFIX}" STREQUAL "C:/Program Files/MOO")
|
||||
ENDIF(WIN32)
|
||||
|
||||
SET(MOO_DATA_DIR ${DATADIR}/moo CACHE PATH "Where data files go")
|
||||
SET(MOO_LIB_DIR ${LIBDIR}/moo CACHE PATH "Where lib files go")
|
||||
SET(MOO_PLUGINS_DIR ${MOO_LIB_DIR}/plugins CACHE PATH "Where plugins go")
|
||||
SET(MOO_TEXT_LANG_FILES_DIR ${MOO_DATA_DIR}/language-specs CACHE PATH "Where lang files go")
|
||||
SET(MOO_DOC_DIR ${DATADIR}/doc/medit CACHE PATH "Where docs go")
|
||||
SET(MOO_HELP_DIR ${MOO_DOC_DIR}/help CACHE PATH "Where html help files go")
|
||||
FOREACH(name BINDIR DATADIR LIBDIR MOO_DATA_DIR MOO_LIB_DIR MOO_PLUGINS_DIR
|
||||
MOO_TEXT_LANG_FILES_DIR LOCALEDIR MOO_DOC_DIR MOO_HELP_DIR)
|
||||
SET(${name}_ABS ${${name}})
|
||||
IF(NOT IS_ABSOLUTE ${${name}})
|
||||
SET(${name}_ABS ${CMAKE_INSTALL_PREFIX}/${${name}})
|
||||
ENDIF(NOT IS_ABSOLUTE ${${name}})
|
||||
MARK_AS_ADVANCED(${name}_ABS)
|
||||
ENDFOREACH(name)
|
||||
|
||||
IF(WIN32)
|
||||
SET(MEDIT_LIBRARIES ${CMAKE_SOURCE_DIR}/../medit-bin-dist CACHE PATH "Where Gtk libraries are located")
|
||||
SET(MEDIT_PYTHON_LIBRARIES ${CMAKE_SOURCE_DIR}/../python-dist CACHE PATH "Where Python is located")
|
||||
IF(EXISTS ${MEDIT_LIBRARIES})
|
||||
INSTALL(DIRECTORY ${MEDIT_LIBRARIES}/ DESTINATION ".")
|
||||
ENDIF(EXISTS ${MEDIT_LIBRARIES})
|
||||
IF(MOO_ENABLE_PYTHON AND EXISTS ${MEDIT_PYTHON_LIBRARIES})
|
||||
INSTALL(DIRECTORY ${MEDIT_PYTHON_LIBRARIES}/ DESTINATION ".")
|
||||
ENDIF(MOO_ENABLE_PYTHON AND EXISTS ${MEDIT_PYTHON_LIBRARIES})
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# CPack
|
||||
#
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "medit")
|
||||
SET(CPACK_PACKAGE_VENDOR ${MOO_PACKAGE_VENDOR})
|
||||
STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${MOO_VERSION})
|
||||
STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\2" CPACK_PACKAGE_VERSION_MINOR ${MOO_VERSION})
|
||||
STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\3" CPACK_PACKAGE_VERSION_PATCH ${MOO_VERSION})
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "medit a text editor")
|
||||
SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${MOO_PACKAGE_VERSION})
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING.GPL)
|
||||
SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README)
|
||||
# SET(CPACK_GENERATOR)
|
||||
SET(CPACK_PACKAGE_EXECUTABLES medit medit)
|
||||
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
|
||||
SET(CPACK_SOURCE_IGNORE_FILES "/plat/win32/gtk-win/;/build/;/[.]hg;/[.]git;/junk/;/vs/;/ugly/;/_build/;/_install/;.*[.]orig$")
|
||||
|
||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "medit")
|
||||
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "medit")
|
||||
# SET(CPACK_NSIS_MUI_ICON)
|
||||
# SET(CPACK_NSIS_MUI_UNIICON)
|
||||
# SET(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/moo/mooutils/pixmaps/medit.ico)
|
||||
# SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS)
|
||||
# SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS)
|
||||
# SET(CPACK_NSIS_COMPRESSOR)
|
||||
SET(CPACK_NSIS_DISPLAY_NAME "medit ${MOO_DISPLAY_VERSION}")
|
||||
SET(CPACK_NSIS_PACKAGE_NAME "medit")
|
||||
# SET(CPACK_NSIS_INSTALLED_ICON_NAME)
|
||||
SET(CPACK_NSIS_HELP_LINK "http://mooedit.sourceforge.net/")
|
||||
SET(CPACK_NSIS_URL_INFO_ABOUT "http://mooedit.sourceforge.net/")
|
||||
SET(CPACK_NSIS_CONTACT ${MOO_PACKAGE_VENDOR})
|
||||
# SET(CPACK_NSIS_CREATE_ICONS_EXTRA)
|
||||
# SET(CPACK_NSIS_DELETE_ICONS_EXTRA)
|
||||
|
||||
IF(WIN32)
|
||||
SET(CPACK_SOURCE_GENERATOR ZIP)
|
||||
SET(CPACK_GENERATOR NSIS ZIP)
|
||||
ELSE(WIN32)
|
||||
SET(CPACK_SOURCE_GENERATOR TBZ2)
|
||||
ENDIF(WIN32)
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
IF(NOT WIN32)
|
||||
CONFIGURE_FILE(${MOO_SOURCE_DIR}/plat/unix/distcheck.in distcheck)
|
||||
ADD_CUSTOM_TARGET(distcheck ${MOO_BINARY_DIR}/distcheck)
|
||||
ENDIF(NOT WIN32)
|
|
@ -1,72 +0,0 @@
|
|||
FIND_PACKAGE(PkgConfig)
|
||||
|
||||
MACRO(_MOO_GET_PKG_CONFIG_VARIABLE cmakevar pkgconfigvar pkgname)
|
||||
MOO_EXEC_OR_DIE("pkg-config --variable=${pkgconfigvar} ${pkgname}"
|
||||
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${pkgconfigvar} ${pkgname}
|
||||
OUTPUT_VARIABLE ${cmakevar})
|
||||
STRING(STRIP ${${cmakevar}} ${cmakevar})
|
||||
ENDMACRO(_MOO_GET_PKG_CONFIG_VARIABLE)
|
||||
|
||||
PKG_CHECK_MODULES(GTK REQUIRED gtk+-2.0>=2.14.0 glib-2.0 gio-2.0 gmodule-2.0 gthread-2.0 gobject-2.0)
|
||||
LIST(APPEND MOO_DEP_LIBS ${GTK_LIBRARIES})
|
||||
INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIRS})
|
||||
ADD_DEFINITIONS(${GTK_DEFINITIONS})
|
||||
LINK_DIRECTORIES(${GTK_LIBRARY_DIRS})
|
||||
|
||||
IF(WIN32 AND EXISTS "$ENV{GTKDIR}")
|
||||
INCLUDE_DIRECTORIES("$ENV{GTKDIR}/include")
|
||||
ENDIF(WIN32 AND EXISTS "$ENV{GTKDIR}")
|
||||
|
||||
MOO_ADD_COMPILE_DEFINITIONS(RELEASE -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT)
|
||||
MOO_ADD_COMPILER_FLAGS(GCC WIN32 -mms-bitfields)
|
||||
|
||||
FIND_PACKAGE(MooPython)
|
||||
|
||||
PKG_CHECK_MODULES(LIBXML2 REQUIRED libxml-2.0)
|
||||
LIST(APPEND MOO_DEP_LIBS ${LIBXML2_LIBRARIES})
|
||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIRS})
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
LINK_DIRECTORIES(${LIBXML2_LIBRARY_DIRS})
|
||||
SET(MOO_USE_XML TRUE)
|
||||
MOO_DEFINE_H(MOO_USE_XML)
|
||||
|
||||
_MOO_GET_PKG_CONFIG_VARIABLE(_moo_gdk_target target gdk-2.0)
|
||||
SET(GDK_X11 FALSE)
|
||||
SET(GDK_WIN32 FALSE)
|
||||
SET(GDK_QUARTZ FALSE)
|
||||
IF("${_moo_gdk_target}" STREQUAL "x11")
|
||||
SET(GDK_X11 TRUE)
|
||||
ELSEIF("${_moo_gdk_target}" STREQUAL "quartz")
|
||||
SET(GDK_QUARTZ TRUE)
|
||||
ELSEIF("${_moo_gdk_target}" STREQUAL "win32")
|
||||
SET(GDK_WIN32 TRUE)
|
||||
ENDIF("${_moo_gdk_target}" STREQUAL "x11")
|
||||
|
||||
SET(MOO_USE_QUARTZ FALSE)
|
||||
IF(GDK_QUARTZ)
|
||||
IF(FALSE)
|
||||
SET(MOO_USE_QUARTZ TRUE)
|
||||
MOO_DEFINE_H(MOO_USE_QUARTZ)
|
||||
ENDIF(FALSE)
|
||||
ENDIF(GDK_QUARTZ)
|
||||
|
||||
MACRO(_MOO_FIND_PROGRAM_OR_DIE varname progname pkgvar pkgname)
|
||||
_MOO_GET_PKG_CONFIG_VARIABLE(_moo_pkg_exec_prefix exec_prefix ${pkgname})
|
||||
IF(pkgvar)
|
||||
_MOO_GET_PKG_CONFIG_VARIABLE(_moo_pkg_prog ${pkgvar} ${pkgname})
|
||||
SET(_moo_prg_names "${_moo_pkg_prog}" ${progname})
|
||||
ELSE(pkgvar)
|
||||
SET(_moo_prg_names ${progname})
|
||||
ENDIF(pkgvar)
|
||||
FIND_PROGRAM(${varname}
|
||||
NAMES ${_moo_prg_names}
|
||||
PATHS "${_moo_pkg_exec_prefix}/bin"
|
||||
DOC "Path to ${progname} executable")
|
||||
MARK_AS_ADVANCED(${varname})
|
||||
IF(NOT ${varname})
|
||||
MOO_ERROR("Could not find ${progname} executable")
|
||||
ENDIF(NOT ${varname})
|
||||
ENDMACRO(_MOO_FIND_PROGRAM_OR_DIE)
|
||||
|
||||
_MOO_FIND_PROGRAM_OR_DIE(GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal glib_genmarshal glib-2.0)
|
||||
_MOO_FIND_PROGRAM_OR_DIE(GDK_PIXBUF_CSOURCE_EXECUTABLE gdk-pixbuf-csource "" gtk+-2.0)
|
|
@ -1,415 +0,0 @@
|
|||
OPTION(MOO_DEV_MODE_CMAKE "Enable developer mode for cmake - bunch of checks, warnings, etc." OFF)
|
||||
MARK_AS_ADVANCED(MOO_DEV_MODE_CMAKE)
|
||||
|
||||
IF(MOO_DEV_MODE_CMAKE)
|
||||
MACRO(MOO_DEBUG)
|
||||
MESSAGE(${ARGN})
|
||||
ENDMACRO(MOO_DEBUG)
|
||||
ELSE(MOO_DEV_MODE_CMAKE)
|
||||
MACRO(MOO_DEBUG)
|
||||
ENDMACRO(MOO_DEBUG)
|
||||
ENDIF(MOO_DEV_MODE_CMAKE)
|
||||
|
||||
MACRO(MOO_ERROR)
|
||||
MESSAGE(FATAL_ERROR ${ARGN})
|
||||
ENDMACRO(MOO_ERROR)
|
||||
|
||||
MACRO(MOO_DEFINE_VERSIONS version)
|
||||
IF(NOT "${version}" MATCHES "^[0-9]+[.][0-9]+[.][0-9]+(-.*)?$")
|
||||
MOO_ERROR("Bad version string '${version}'")
|
||||
ENDIF(NOT "${version}" MATCHES "^[0-9]+[.][0-9]+[.][0-9]+(-.*)?$")
|
||||
STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\1" MOO_MAJOR_VERSION "${version}")
|
||||
STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\2" MOO_MINOR_VERSION "${version}")
|
||||
STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\3" MOO_MICRO_VERSION "${version}")
|
||||
STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\5" MOO_VERSION_SUFFIX "${version}")
|
||||
SET(MOO_VERSION "${MOO_MAJOR_VERSION}.${MOO_MINOR_VERSION}.${MOO_MICRO_VERSION}")
|
||||
IF("${MOO_VERSION_SUFFIX}" STREQUAL "")
|
||||
SET(MOO_PACKAGE_VERSION "${MOO_VERSION}")
|
||||
SET(MOO_DISPLAY_VERSION "${MOO_VERSION}")
|
||||
ELSE("${MOO_VERSION_SUFFIX}" STREQUAL "")
|
||||
SET(MOO_PACKAGE_VERSION "${MOO_VERSION}-${MOO_VERSION_SUFFIX}")
|
||||
SET(MOO_DISPLAY_VERSION "${MOO_VERSION} ${MOO_VERSION_SUFFIX}")
|
||||
ENDIF("${MOO_VERSION_SUFFIX}" STREQUAL "")
|
||||
ENDMACRO(MOO_DEFINE_VERSIONS)
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# Build type
|
||||
#
|
||||
|
||||
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
SET(CMAKE_BUILD_TYPE Release)
|
||||
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
STRING(TOUPPER ${CMAKE_BUILD_TYPE} MOO_BUILD_TYPE)
|
||||
SET(MOO_BUILD_SUBTYPE ${MOO_BUILD_TYPE})
|
||||
IF("${MOO_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO" OR "${MOO_BUILD_TYPE}" STREQUAL "MINSIZEREL")
|
||||
SET(MOO_BUILD_TYPE RELEASE)
|
||||
ELSEIF(NOT "${MOO_BUILD_TYPE}" STREQUAL "DEBUG" AND NOT "${MOO_BUILD_TYPE}" STREQUAL "RELEASE")
|
||||
MOO_ERROR("Unknown build type '${MOO_BUILD_TYPE}'")
|
||||
ENDIF("${MOO_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO" OR "${MOO_BUILD_TYPE}" STREQUAL "MINSIZEREL")
|
||||
MOO_DEBUG(STATUS "MOO_BUILD_TYPE: ${MOO_BUILD_TYPE}")
|
||||
|
||||
IF("${MOO_BUILD_TYPE}" STREQUAL "DEBUG")
|
||||
SET(MOO_DEBUG TRUE)
|
||||
ELSE("${MOO_BUILD_TYPE}" STREQUAL "DEBUG")
|
||||
SET(MOO_DEBUG FALSE)
|
||||
ENDIF("${MOO_BUILD_TYPE}" STREQUAL "DEBUG")
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# MOO_DEFINE_H
|
||||
#
|
||||
|
||||
SET(__MOO_DEFINE_H_FILE__ ${CMAKE_BINARY_DIR}/moo-config.h.in)
|
||||
FILE(WRITE ${__MOO_DEFINE_H_FILE__} "")
|
||||
|
||||
MACRO(MOO_DEFINE_H _moo_varname)
|
||||
SET(_moo_comment)
|
||||
FOREACH(_moo_arg ${ARGN})
|
||||
SET(_moo_comment ${_moo_arg})
|
||||
ENDFOREACH(_moo_arg)
|
||||
IF(_moo_comment)
|
||||
FILE(APPEND ${__MOO_DEFINE_H_FILE__} "/* ${_moo_comment} */\n")
|
||||
ENDIF(_moo_comment)
|
||||
FILE(APPEND ${__MOO_DEFINE_H_FILE__} "#moodefine ${_moo_varname}\n\n")
|
||||
ENDMACRO(MOO_DEFINE_H)
|
||||
|
||||
MACRO(MOO_MAKE_ABSOLUTE_INPUT_FILE file out_var)
|
||||
SET(_moo_maif_abs_file "${file}")
|
||||
IF(NOT EXISTS "${_moo_maif_abs_file}")
|
||||
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_moo_maif_abs_file}")
|
||||
SET(_moo_maif_abs_file ${CMAKE_CURRENT_SOURCE_DIR}/${_moo_maif_abs_file})
|
||||
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_moo_maif_abs_file}")
|
||||
ENDIF(NOT EXISTS "${_moo_maif_abs_file}")
|
||||
IF(NOT EXISTS "${_moo_maif_abs_file}")
|
||||
MOO_ERROR("File '${_moo_maif_abs_file}' does not exist")
|
||||
ENDIF(NOT EXISTS "${_moo_maif_abs_file}")
|
||||
SET(${out_var} "${_moo_maif_abs_file}")
|
||||
ENDMACRO(MOO_MAKE_ABSOLUTE_INPUT_FILE)
|
||||
|
||||
MACRO(MOO_MAKE_ABSOLUTE_OUTPUT_FILE file out_var)
|
||||
SET(_moo_maof_abs_file "${file}")
|
||||
IF(NOT IS_ABSOLUTE "${_moo_maof_abs_file}")
|
||||
SET(_moo_maof_abs_file "${CMAKE_CURRENT_BINARY_DIR}/${_moo_maof_abs_file}")
|
||||
ENDIF(NOT IS_ABSOLUTE "${_moo_maof_abs_file}")
|
||||
SET(${out_var} "${_moo_maof_abs_file}")
|
||||
ENDMACRO(MOO_MAKE_ABSOLUTE_OUTPUT_FILE)
|
||||
|
||||
MACRO(MOO_WRITE_CONFIG_H _moo_in_file _moo_out_file)
|
||||
MOO_MAKE_ABSOLUTE_INPUT_FILE("${_moo_in_file}" _moo_abs_in_file)
|
||||
MOO_MAKE_ABSOLUTE_OUTPUT_FILE("${_moo_out_file}" _moo_abs_out_file)
|
||||
|
||||
FILE(WRITE ${_moo_abs_out_file}-in.moo "#ifndef __CONFIG_H__\n")
|
||||
FILE(APPEND ${_moo_abs_out_file}-in.moo "#define __CONFIG_H__\n\n")
|
||||
FILE(READ ${_moo_abs_in_file} _moo_contents)
|
||||
FILE(APPEND ${_moo_abs_out_file}-in.moo ${_moo_contents})
|
||||
FILE(APPEND ${_moo_abs_out_file}-in.moo "\n")
|
||||
|
||||
FILE(STRINGS ${__MOO_DEFINE_H_FILE__} _moo_wch_lines)
|
||||
FOREACH(_moo_wch_l ${_moo_wch_lines})
|
||||
IF(_moo_wch_l MATCHES "^#moodefine (.*)$")
|
||||
STRING(REGEX REPLACE "^#moodefine (.*)$" "\\1" _moo_wch_var "${_moo_wch_l}")
|
||||
IF(${_moo_wch_var})
|
||||
FILE(APPEND ${_moo_abs_out_file}-in.moo "#define ${_moo_wch_var} 1\n\n")
|
||||
ELSE(${_moo_wch_var})
|
||||
FILE(APPEND ${_moo_abs_out_file}-in.moo "/* #undef ${_moo_wch_var} */\n\n")
|
||||
ENDIF(${_moo_wch_var})
|
||||
ELSE(_moo_wch_l MATCHES "^#moodefine (.*)$")
|
||||
FILE(APPEND ${_moo_abs_out_file}-in.moo "${_moo_wch_l}\n")
|
||||
ENDIF(_moo_wch_l MATCHES "^#moodefine (.*)$")
|
||||
ENDFOREACH(_moo_wch_l)
|
||||
|
||||
FILE(APPEND ${_moo_abs_out_file}-in.moo "#endif /* __CONFIG_H__ */\n")
|
||||
|
||||
CONFIGURE_FILE(${_moo_abs_out_file}-in.moo ${_moo_abs_out_file} ${ARGN})
|
||||
ENDMACRO(MOO_WRITE_CONFIG_H)
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# OS
|
||||
#
|
||||
|
||||
SET(_MOO_KNOWN_PLATFORMS CYGWIN WIN32 DARWIN UNIX FREEBSD BSD LINUX FDO)
|
||||
FOREACH(_moo_os ${_MOO_KNOWN_PLATFORMS})
|
||||
SET(MOO_OS_${_moo_os} FALSE)
|
||||
ENDFOREACH(_moo_os)
|
||||
|
||||
IF(APPLE)
|
||||
SET(MOO_OS_DARWIN TRUE)
|
||||
ENDIF(APPLE)
|
||||
|
||||
IF(CYGWIN)
|
||||
SET(MOO_OS_CYGWIN TRUE)
|
||||
ENDIF(CYGWIN)
|
||||
|
||||
IF(WIN32 OR CYGWIN)
|
||||
SET(MOO_OS_WIN32 TRUE)
|
||||
ENDIF(WIN32 OR CYGWIN)
|
||||
|
||||
IF(UNIX)
|
||||
SET(MOO_OS_UNIX TRUE)
|
||||
ENDIF(UNIX)
|
||||
|
||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
SET(MOO_OS_FDO TRUE)
|
||||
ENDIF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
SET(MOO_OS_FREEBSD TRUE)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "BSD")
|
||||
SET(MOO_OS_BSD TRUE)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "BSD")
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
SET(MOO_OS_LINUX TRUE)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
IF(MOO_OS_DARWIN OR MOO_OS_FREEBSD)
|
||||
SET(MOO_OS_BSD TRUE)
|
||||
ENDIF(MOO_OS_DARWIN OR MOO_OS_FREEBSD)
|
||||
|
||||
IF(MOO_OS_BSD OR MOO_OS_LINUX)
|
||||
SET(MOO_OS_UNIX TRUE)
|
||||
ENDIF(MOO_OS_BSD OR MOO_OS_LINUX)
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# Installation dirs
|
||||
#
|
||||
|
||||
SET(BINDIR bin CACHE PATH "bin")
|
||||
SET(DATADIR share CACHE PATH "share")
|
||||
SET(DESKTOPFILEDIR ${DATADIR}/applications CACHE PATH "share/applications")
|
||||
SET(LIBDIR lib CACHE PATH "lib")
|
||||
SET(LOCALEDIR ${DATADIR}/locale CACHE PATH "Where mo files go")
|
||||
SET(MANDIR ${DATADIR}/man CACHE PATH "Where man pages go")
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# Stuff
|
||||
#
|
||||
|
||||
MACRO(MOO_ADD_GENERATED_FILE stampfile outputfiles)
|
||||
FOREACH(_moo_f ${stampfile} ${outputfiles})
|
||||
GET_FILENAME_COMPONENT(_moo_d ${_moo_f} ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(_moo_d ${_moo_d} PATH)
|
||||
FILE(MAKE_DIRECTORY ${_moo_d})
|
||||
ENDFOREACH(_moo_f)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${stampfile} ${ARGN})
|
||||
MOO_APPEND_DIRECTORY_PROPERTY(MOO_STAMPS ${stampfile})
|
||||
SET_SOURCE_FILES_PROPERTIES(${stampfile} PROPERTIES EXTERNAL_OBJECT 1 GENERATED 1)
|
||||
SET_SOURCE_FILES_PROPERTIES(${outputfiles} PROPERTIES GENERATED 1)
|
||||
MOO_ADD_CLEAN_FILES(${stampfile} ${outputfiles})
|
||||
MOO_APPEND_DIRECTORY_PROPERTY(MOO_BUILT_SOURCES ${stampfile} ${outputfiles})
|
||||
ENDMACRO(MOO_ADD_GENERATED_FILE)
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# Aux macros
|
||||
#
|
||||
|
||||
MACRO(MOO_APPEND_DIRECTORY_PROPERTY prop)
|
||||
GET_DIRECTORY_PROPERTY(_madp_value ${prop})
|
||||
FOREACH(_moo_arg ${ARGN})
|
||||
LIST(APPEND _madp_value ${_moo_arg})
|
||||
ENDFOREACH(_moo_arg)
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ${prop} "${_madp_value}")
|
||||
ENDMACRO(MOO_APPEND_DIRECTORY_PROPERTY)
|
||||
|
||||
MACRO(MOO_ADD_CLEAN_FILES)
|
||||
MOO_APPEND_DIRECTORY_PROPERTY(ADDITIONAL_MAKE_CLEAN_FILES ${ARGN})
|
||||
ENDMACRO(MOO_ADD_CLEAN_FILES)
|
||||
|
||||
# MOO_COLLECT_ARGS(ARG FOO VAR foo ARG BAR VAR bar ARGN ...)
|
||||
# caller: SOME_MACRO(FOO foo1 foo2 foo3 BAR bar1)
|
||||
MACRO(MOO_COLLECT_ARGS)
|
||||
SET(_moo_args)
|
||||
SET(_moo_vars)
|
||||
SET(_moo_argn)
|
||||
|
||||
SET(_moo_what)
|
||||
|
||||
FOREACH(_moo_a ${ARGN})
|
||||
IF("${_moo_what}" STREQUAL "ARG")
|
||||
LIST(APPEND _moo_args ${_moo_a})
|
||||
SET(_moo_what VAR)
|
||||
ELSEIF("${_moo_what}" STREQUAL "VAR")
|
||||
LIST(APPEND _moo_vars ${_moo_a})
|
||||
SET(_moo_what)
|
||||
ELSEIF("${_moo_what}" STREQUAL "ARGN")
|
||||
LIST(APPEND _moo_argn ${_moo_a})
|
||||
ELSEIF("${_moo_a}" STREQUAL "ARG")
|
||||
SET(_moo_what ARG)
|
||||
ELSEIF("${_moo_a}" STREQUAL "ARGN")
|
||||
SET(_moo_what ARGN)
|
||||
ELSE("${_moo_what}" STREQUAL "ARG")
|
||||
MOO_ERROR("bad argument ${moo_a}")
|
||||
ENDIF("${_moo_what}" STREQUAL "ARG")
|
||||
ENDFOREACH(_moo_a)
|
||||
|
||||
# MESSAGE("args: ${_moo_args}")
|
||||
# MESSAGE("vars: ${_moo_vars}")
|
||||
# MESSAGE("argn: ${_moo_argn}")
|
||||
|
||||
SET(_moo_what -1)
|
||||
FOREACH(_moo_arg ${_moo_argn})
|
||||
LIST(FIND _moo_args "${_moo_arg}" _moo_what2)
|
||||
IF(NOT _moo_what2 EQUAL -1)
|
||||
SET(_moo_what ${_moo_what2})
|
||||
ELSE(NOT _moo_what2 EQUAL -1)
|
||||
IF(_moo_what EQUAL -1)
|
||||
MOO_ERROR("Invalid argument ${_moo_arg}")
|
||||
ENDIF(_moo_what EQUAL -1)
|
||||
LIST(GET _moo_vars ${_moo_what} _moo_v)
|
||||
LIST(APPEND ${_moo_v} "${_moo_arg}")
|
||||
ENDIF(NOT _moo_what2 EQUAL -1)
|
||||
ENDFOREACH(_moo_arg)
|
||||
|
||||
LIST(LENGTH _moo_args _moo_nargs)
|
||||
MATH(EXPR _moo_nargs "${_moo_nargs} - 1")
|
||||
FOREACH(_moo_what RANGE ${_moo_nargs})
|
||||
LIST(GET _moo_args ${_moo_what} _moo_a)
|
||||
LIST(GET _moo_vars ${_moo_what} _moo_v)
|
||||
#MOO_DEBUG("${_moo_what}. ${_moo_v}: ${${_moo_v}}")
|
||||
ENDFOREACH(_moo_what)
|
||||
ENDMACRO(MOO_COLLECT_ARGS)
|
||||
|
||||
MACRO(__MOO_SET_SIMPLE_VAR var)
|
||||
SET(${var} ${ARGN})
|
||||
ENDMACRO(__MOO_SET_SIMPLE_VAR)
|
||||
|
||||
# _MOO_COLLECT_ARGS_IMPL(FOO foo setfoo BAR bar setbar ARGN ...)
|
||||
MACRO(_MOO_COLLECT_ARGS_IMPL)
|
||||
SET(_moo__cai_args)
|
||||
SET(_moo__cai_vars)
|
||||
SET(_moo__cai_macros)
|
||||
SET(_moo__cai_argn)
|
||||
|
||||
SET(_moo__cai_what)
|
||||
|
||||
FOREACH(_moo__cai_a ${ARGN})
|
||||
IF("${_moo__cai_what}" STREQUAL "VAR")
|
||||
LIST(APPEND _moo__cai_vars ${_moo__cai_a})
|
||||
SET(_moo__cai_what SETVAR)
|
||||
ELSEIF("${_moo__cai_what}" STREQUAL "SETVAR")
|
||||
LIST(APPEND _moo__cai_macros ${_moo__cai_a})
|
||||
SET(_moo__cai_what)
|
||||
ELSEIF("${_moo__cai_what}" STREQUAL "ARGN")
|
||||
LIST(APPEND _moo__cai_argn ${_moo__cai_a})
|
||||
ELSEIF("${_moo__cai_a}" STREQUAL "ARGN")
|
||||
SET(_moo__cai_what ARGN)
|
||||
ELSE("${_moo__cai_what}" STREQUAL "VAR")
|
||||
LIST(APPEND _moo__cai_args ${_moo__cai_a})
|
||||
SET(_moo__cai_what VAR)
|
||||
ENDIF("${_moo__cai_what}" STREQUAL "VAR")
|
||||
ENDFOREACH(_moo__cai_a)
|
||||
|
||||
# MOO_DEBUG("args: ${_moo__cai_args}")
|
||||
# MOO_DEBUG("vars: ${_moo__cai_vars}")
|
||||
# MOO_DEBUG("macros: ${_moo__cai_macros}")
|
||||
# MOO_DEBUG("argn: ${_moo__cai_argn}")
|
||||
|
||||
SET(_moo__cai_what -1)
|
||||
FOREACH(_moo__cai_arg ${_moo__cai_argn})
|
||||
LIST(FIND _moo__cai_args "${_moo__cai_arg}" _moo__cai_what2)
|
||||
IF(NOT _moo__cai_what2 EQUAL -1)
|
||||
SET(_moo__cai_what ${_moo__cai_what2})
|
||||
ELSE(NOT _moo__cai_what2 EQUAL -1)
|
||||
IF(_moo__cai_what EQUAL -1)
|
||||
MOO_ERROR("Invalid argument ${_moo__cai_arg}")
|
||||
ENDIF(_moo__cai_what EQUAL -1)
|
||||
LIST(GET _moo__cai_vars ${_moo__cai_what} _moo__cai_v)
|
||||
LIST(GET _moo__cai_macros ${_moo__cai_what} _moo__cai_sv)
|
||||
IF("${_moo__cai_sv}" STREQUAL "__MOO_SET_SIMPLE_VAR")
|
||||
# MOO_DEBUG("${_moo__cai_v} = ${_moo__cai_arg}")
|
||||
__MOO_SET_SIMPLE_VAR(${_moo__cai_v} ${_moo__cai_arg})
|
||||
ELSE("${_moo__cai_sv}" STREQUAL "__MOO_SET_SIMPLE_VAR")
|
||||
MOO_ERROR("Invalid argument ${_moo__cai_sv}")
|
||||
ENDIF("${_moo__cai_sv}" STREQUAL "__MOO_SET_SIMPLE_VAR")
|
||||
ENDIF(NOT _moo__cai_what2 EQUAL -1)
|
||||
ENDFOREACH(_moo__cai_arg)
|
||||
|
||||
LIST(LENGTH _moo__cai_args _moo__cai_nargs)
|
||||
MATH(EXPR _moo__cai_nargs "${_moo__cai_nargs} - 1")
|
||||
FOREACH(_moo__cai_what RANGE ${_moo__cai_nargs})
|
||||
LIST(GET _moo__cai_args ${_moo__cai_what} _moo__cai_a)
|
||||
LIST(GET _moo__cai_vars ${_moo__cai_what} _moo__cai_v)
|
||||
# MOO_DEBUG("${_moo__cai_what}. ${_moo__cai_v}: ${${_moo__cai_v}}")
|
||||
ENDFOREACH(_moo__cai_what)
|
||||
ENDMACRO(_MOO_COLLECT_ARGS_IMPL)
|
||||
|
||||
# MOO_COLLECT_SIMPLE_ARGS(FOO foo BAR bar ARGN ...)
|
||||
MACRO(MOO_COLLECT_SIMPLE_ARGS)
|
||||
SET(_moo_csa_impl_argn)
|
||||
|
||||
SET(_moo_csa_argn ${ARGN})
|
||||
SET(_moo_csa_i 0)
|
||||
LIST(LENGTH _moo_csa_argn _moo_csa_nargs)
|
||||
WHILE(_moo_csa_i LESS _moo_csa_nargs)
|
||||
LIST(GET _moo_csa_argn ${_moo_csa_i} _moo_csa_a)
|
||||
IF("${_moo_csa_a}" STREQUAL "ARGN")
|
||||
BREAK()
|
||||
ENDIF("${_moo_csa_a}" STREQUAL "ARGN")
|
||||
MATH(EXPR _moo_csa_i "${_moo_csa_i} + 1")
|
||||
LIST(GET _moo_csa_argn ${_moo_csa_i} _moo_csa_v)
|
||||
LIST(APPEND _moo_csa_impl_argn "${_moo_csa_a}")
|
||||
LIST(APPEND _moo_csa_impl_argn "${_moo_csa_v}")
|
||||
LIST(APPEND _moo_csa_impl_argn __MOO_SET_SIMPLE_VAR)
|
||||
MATH(EXPR _moo_csa_i "${_moo_csa_i} + 1")
|
||||
ENDWHILE(_moo_csa_i LESS _moo_csa_nargs)
|
||||
|
||||
WHILE(_moo_csa_i LESS _moo_csa_nargs)
|
||||
LIST(GET _moo_csa_argn ${_moo_csa_i} _moo_csa_a)
|
||||
LIST(APPEND _moo_csa_impl_argn "${_moo_csa_a}")
|
||||
MATH(EXPR _moo_csa_i "${_moo_csa_i} + 1")
|
||||
ENDWHILE(_moo_csa_i LESS _moo_csa_nargs)
|
||||
|
||||
# MOO_DEBUG("MOO_COLLECT_SIMPLE_ARGS: ${_moo_csa_argn}")
|
||||
# MOO_DEBUG("MOO_COLLECT_SIMPLE_ARGS: ${_moo_csa_impl_argn}")
|
||||
|
||||
_MOO_COLLECT_ARGS_IMPL(${_moo_csa_impl_argn})
|
||||
ENDMACRO(MOO_COLLECT_SIMPLE_ARGS)
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# MOO_OPTION
|
||||
#
|
||||
|
||||
MACRO(MOO_OPTION variable dfltval helpstring)
|
||||
IF(DEFINED __MOO_OPTION_SET_${variable})
|
||||
MOO_ERROR("Option ${variable} is already created")
|
||||
ENDIF(DEFINED __MOO_OPTION_SET_${variable})
|
||||
SET(_moo_option_hidden)
|
||||
SET(_moo_option_header)
|
||||
SET(_moo_option_define)
|
||||
MOO_COLLECT_SIMPLE_ARGS(HIDDEN _moo_option_hidden HEADER _moo_option_header DEFINE _moo_option_define ARGN ${ARGN})
|
||||
IF(NOT _moo_option_hidden)
|
||||
OPTION(${variable} "${helpstring}" "${dfltval}")
|
||||
ELSE(NOT _moo_option_hidden)
|
||||
SET(${variable} "${dfltval}" CACHE BOOL "${helpstring}")
|
||||
MARK_AS_ADVANCED(${variable})
|
||||
ENDIF(NOT _moo_option_hidden)
|
||||
IF(_moo_option_header)
|
||||
# MOO_DEBUG(${variable})
|
||||
MOO_DEFINE_H(${variable} "${helpstring}")
|
||||
ENDIF(_moo_option_header)
|
||||
IF(_moo_option_define AND ${variable})
|
||||
ADD_DEFINITIONS(-D${variable}=1)
|
||||
ENDIF(_moo_option_define AND ${variable})
|
||||
SET(__MOO_OPTION_SET_${variable} 1)
|
||||
# MOO_DEBUG(STATUS "Option ${variable}")
|
||||
ENDMACRO(MOO_OPTION)
|
||||
|
||||
MACRO(MOO_CHECK_OPTION variable)
|
||||
IF(NOT DEFINED __MOO_OPTION_SET_${variable})
|
||||
MOO_ERROR("Option ${variable} is not set")
|
||||
ENDIF(NOT DEFINED __MOO_OPTION_SET_${variable})
|
||||
ENDMACRO(MOO_CHECK_OPTION)
|
||||
|
||||
MOO_OPTION(MOO_DEV_MODE FALSE "Enable developer mode - bunch of checks, warnings, etc." DEFINE 1)
|
||||
|
||||
FIND_PACKAGE(MooCompilers)
|
||||
FIND_PACKAGE(MooCmakeUtils)
|
||||
FIND_PACKAGE(MooI18n)
|
|
@ -1,31 +0,0 @@
|
|||
MACRO(MOO_EXEC_OR_DIE command)
|
||||
EXECUTE_PROCESS(${ARGN}
|
||||
RESULT_VARIABLE __moo_command_result
|
||||
ERROR_VARIABLE __moo_command_error
|
||||
)
|
||||
IF(NOT __moo_command_result EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Command ${command} failed: ${__moo_command_error}")
|
||||
ENDIF(NOT __moo_command_result EQUAL 0)
|
||||
ENDMACRO(MOO_EXEC_OR_DIE)
|
||||
|
||||
MACRO(MOO_COPY_FILE file1 file2)
|
||||
MOO_EXEC_OR_DIE("copy ${file1} ${file2}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${file1} ${file2}
|
||||
)
|
||||
ENDMACRO(MOO_COPY_FILE)
|
||||
|
||||
MACRO(MOO_COPY_IF_CHANGED file1 file2)
|
||||
SET(__moo_do_copy)
|
||||
IF(NOT EXISTS ${file2})
|
||||
SET(__moo_do_copy 1)
|
||||
ELSE(NOT EXISTS ${file2})
|
||||
FILE(READ ${file1} __moo_contents1)
|
||||
FILE(READ ${file2} __moo_contents2)
|
||||
IF(NOT "${__moo_contents1}" STREQUAL "${__moo_contents2}")
|
||||
SET(__moo_do_copy 1)
|
||||
ENDIF(NOT "${__moo_contents1}" STREQUAL "${__moo_contents2}")
|
||||
ENDIF(NOT EXISTS ${file2})
|
||||
IF(__moo_do_copy)
|
||||
MOO_COPY_FILE(${file1} ${file2})
|
||||
ENDIF(__moo_do_copy)
|
||||
ENDMACRO(MOO_COPY_IF_CHANGED)
|
|
@ -1,328 +0,0 @@
|
|||
MACRO(_MOO_JOIN_STRING_LIST outvar sep)
|
||||
SET(_moo__jsl_result)
|
||||
SET(_moo__jsl_first TRUE)
|
||||
FOREACH(_moo__jsl_arg ${ARGN})
|
||||
IF(_moo__jsl_first)
|
||||
SET(_moo__jsl_result "${_moo__jsl_arg}")
|
||||
SET(_moo__jsl_first FALSE)
|
||||
ELSE(_moo__jsl_first)
|
||||
SET(_moo__jsl_result "${_moo__jsl_result}${sep}${_moo__jsl_arg}")
|
||||
ENDIF(_moo__jsl_first)
|
||||
ENDFOREACH(_moo__jsl_arg)
|
||||
SET(${outvar} "${_moo__jsl_result}")
|
||||
ENDMACRO(_MOO_JOIN_STRING_LIST)
|
||||
|
||||
MACRO(_MOO_CHECK_COMPILER_LANG lang var)
|
||||
STRING(TOUPPER ${lang} _moo__ccl_lang)
|
||||
IF("${_moo__ccl_lang}" STREQUAL "ALL")
|
||||
SET(_moo__ccl_langs C CXX)
|
||||
ELSEIF("${_moo__ccl_lang}" STREQUAL "C" OR "${_moo__ccl_lang}" STREQUAL "CXX")
|
||||
SET(_moo__ccl_langs ${_moo__ccl_lang})
|
||||
ELSE("${_moo__ccl_lang}" STREQUAL "ALL")
|
||||
MOO_ERROR("Invalid lang '${lang}'")
|
||||
ENDIF("${_moo__ccl_lang}" STREQUAL "ALL")
|
||||
SET(${var} ${_moo__ccl_langs})
|
||||
ENDMACRO(_MOO_CHECK_COMPILER_LANG)
|
||||
|
||||
MACRO(_MOO_CHECK_BUILD_TYPE build prefix var)
|
||||
STRING(TOUPPER ${build} _moo__cbt_build)
|
||||
IF("${_moo__cbt_build}" STREQUAL "ALL")
|
||||
SET(_moo__cbt_vars ${prefix})
|
||||
ELSEIF("${_moo__cbt_build}" STREQUAL "RELEASE")
|
||||
SET(_moo__cbt_vars ${prefix}_RELEASE ${prefix}_RELWITHDEBINFO ${prefix}_MINSIZEREL)
|
||||
ELSEIF("${_moo__cbt_build}" STREQUAL "RELEASEONLY")
|
||||
SET(_moo__cbt_vars ${prefix}_RELEASE)
|
||||
ELSEIF("${_moo__cbt_build}" STREQUAL "DEBUG" OR "${_moo__cbt_build}" STREQUAL "RELWITHDEBINFO" OR "${_moo__cbt_build}" STREQUAL "MINSIZEREL")
|
||||
SET(_moo__cbt_vars ${prefix}_${_moo__cbt_build})
|
||||
ELSE("${_moo__cbt_build}" STREQUAL "ALL")
|
||||
MOO_ERROR("Invalid build type '${build}'")
|
||||
ENDIF("${_moo__cbt_build}" STREQUAL "ALL")
|
||||
SET(${var} ${_moo__cbt_vars})
|
||||
ENDMACRO(_MOO_CHECK_BUILD_TYPE)
|
||||
|
||||
MACRO(_MOO_GET_COMPILER_CONFIG_ARGS var_lang var_build_prefix var_build_vars var_args)
|
||||
SET(_moo__gcca_langs C CXX)
|
||||
SET(_moo__gcca_args)
|
||||
SET(_moo__gcca_do TRUE)
|
||||
_MOO_CHECK_BUILD_TYPE("ALL" ${var_build_prefix} _moo__gcca_bvars)
|
||||
|
||||
FOREACH(_moo__gcca_arg ${ARGN})
|
||||
IF("${_moo__gcca_arg}" STREQUAL "GCC" OR "${_moo__gcca_arg}" STREQUAL "GNUCC")
|
||||
IF(NOT CMAKE_COMPILER_IS_GNUCC)
|
||||
SET(_moo__gcca_do FALSE)
|
||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
|
||||
ELSEIF("${_moo__gcca_arg}" STREQUAL "MSVC")
|
||||
IF(NOT MSVC)
|
||||
SET(_moo__gcca_do FALSE)
|
||||
ENDIF(NOT MSVC)
|
||||
ELSEIF("${_moo__gcca_arg}" STREQUAL "DEBUG" OR "${_moo__gcca_arg}" STREQUAL "RELEASE" OR
|
||||
"${_moo__gcca_arg}" STREQUAL "RELEASEONLY" OR "${_moo__gcca_arg}" STREQUAL "RELWITHDEBINFO" OR
|
||||
"${_moo__gcca_arg}" STREQUAL "MINSIZEREL")
|
||||
_MOO_CHECK_BUILD_TYPE(${_moo__gcca_arg} ${var_build_prefix} _moo__gcca_bvars)
|
||||
ELSEIF("${_moo__gcca_arg}" STREQUAL "C" OR "${_moo__gcca_arg}" STREQUAL "CXX")
|
||||
SET(_moo__gcca_langs ${_moo__gcca_arg})
|
||||
ELSEIF("${_moo__gcca_arg}" STREQUAL "WIN32" OR "${_moo__gcca_arg}" STREQUAL "UNIX")
|
||||
IF("${_moo__gcca_arg}" STREQUAL "WIN32" AND NOT WIN32)
|
||||
SET(_moo__gcca_do FALSE)
|
||||
ELSEIF("${_moo__gcca_arg}" STREQUAL "UNIX" AND WIN32)
|
||||
SET(_moo__gcca_do FALSE)
|
||||
ENDIF("${_moo__gcca_arg}" STREQUAL "WIN32" AND NOT WIN32)
|
||||
ELSE("${_moo__gcca_arg}" STREQUAL "GCC" OR "${_moo__gcca_arg}" STREQUAL "GNUCC")
|
||||
LIST(APPEND _moo__gcca_args ${_moo__gcca_arg})
|
||||
ENDIF("${_moo__gcca_arg}" STREQUAL "GCC" OR "${_moo__gcca_arg}" STREQUAL "GNUCC")
|
||||
ENDFOREACH(_moo__gcca_arg)
|
||||
|
||||
#MESSAGE("_MOO_GET_COMPILER_CONFIG_ARGS(var_lang=${var_lang}, var_build_prefix=${var_build_prefix}, var_build_vars=${var_build_vars}, var_args=${var_args}, args=${ARGN})")
|
||||
IF(_moo__gcca_do)
|
||||
SET(${var_lang} ${_moo__gcca_langs})
|
||||
SET(${var_build_vars} ${_moo__gcca_bvars})
|
||||
SET(${var_args} ${_moo__gcca_args})
|
||||
#MESSAGE(" var_lang=${_moo__gcca_langs}, var_build_vars=${_moo__gcca_bsfxs}, var_args=${_moo__gcca_args}")
|
||||
ELSE(_moo__gcca_do)
|
||||
SET(${var_lang})
|
||||
SET(${var_build_vars})
|
||||
SET(${var_args})
|
||||
#MESSAGE(" DISABLED")
|
||||
ENDIF(_moo__gcca_do)
|
||||
ENDMACRO(_MOO_GET_COMPILER_CONFIG_ARGS)
|
||||
|
||||
MACRO(MOO_ADD_COMPILER_FLAGS)
|
||||
_MOO_GET_COMPILER_CONFIG_ARGS(_moo_acf_langs "FLAGS" _moo_acf_bvars _moo_acf_args ${ARGN})
|
||||
IF(_moo_acf_args)
|
||||
_MOO_JOIN_STRING_LIST(_moo_acf_flags " " ${_moo_acf_args})
|
||||
FOREACH(_moo_acf_lang ${_moo_acf_langs})
|
||||
FOREACH(_moo_acf_bvar ${_moo_acf_bvars})
|
||||
SET(_moo__acf_var CMAKE_${_moo_acf_lang}_${_moo_acf_bvar})
|
||||
SET(${_moo__acf_var} "${${_moo__acf_var}} ${_moo_acf_flags}")
|
||||
MOO_DEBUG(STATUS "${_moo__acf_var} += ${_moo_acf_flags}")
|
||||
ENDFOREACH(_moo_acf_bvar)
|
||||
ENDFOREACH(_moo_acf_lang)
|
||||
ENDIF(_moo_acf_args)
|
||||
ENDMACRO(MOO_ADD_COMPILER_FLAGS)
|
||||
|
||||
|
||||
INCLUDE(CheckCCompilerFlag)
|
||||
INCLUDE(CheckCXXCompilerFlag)
|
||||
|
||||
MACRO(MOO_COMPILER_FLAG_VAR_NAME flag lang var)
|
||||
STRING(REGEX REPLACE "[-=]" "_" _moo_cfvn_name MOO_${lang}FLAG${flag})
|
||||
STRING(REPLACE "+" "x" _moo_cfvn_name ${_moo_cfvn_name})
|
||||
SET(${var} ${_moo_cfvn_name})
|
||||
ENDMACRO(MOO_COMPILER_FLAG_VAR_NAME)
|
||||
|
||||
MACRO(MOO_CHECK_COMPILER_FLAGS)
|
||||
_MOO_GET_COMPILER_CONFIG_ARGS(_moo_ccf_langs "FLAGS" _moo_ccf_bvars _moo_ccf_args ${ARGN})
|
||||
FOREACH(_moo_ccf_lang ${_moo_ccf_langs})
|
||||
SET(_moo_ccf_good_flags)
|
||||
FOREACH(_moo_ccf_flag ${_moo_ccf_args})
|
||||
MOO_COMPILER_FLAG_VAR_NAME(${_moo_ccf_flag} ${_moo_ccf_lang} _moo_ccf_flag_name)
|
||||
|
||||
IF("${_moo_ccf_lang}" STREQUAL "C")
|
||||
CHECK_C_COMPILER_FLAG("${_moo_ccf_flag}" ${_moo_ccf_flag_name})
|
||||
ELSEIF("${_moo_ccf_lang}" STREQUAL "CXX")
|
||||
CHECK_CXX_COMPILER_FLAG("${_moo_ccf_flag}" ${_moo_ccf_flag_name})
|
||||
ELSE("${_moo_ccf_lang}" STREQUAL "C")
|
||||
MOO_ERROR("Unknown lang '${lang}'")
|
||||
ENDIF("${_moo_ccf_lang}" STREQUAL "C")
|
||||
|
||||
IF(${_moo_ccf_flag_name})
|
||||
LIST(APPEND _moo_ccf_good_flags "${_moo_ccf_flag}")
|
||||
ENDIF(${_moo_ccf_flag_name})
|
||||
ENDFOREACH(_moo_ccf_flag)
|
||||
IF(_moo_ccf_good_flags)
|
||||
_MOO_JOIN_STRING_LIST(_moo_ccf_good_flags " " ${_moo_ccf_good_flags})
|
||||
FOREACH(_moo_ccf_bvar ${_moo_ccf_bvars})
|
||||
SET(_moo_ccf_flags_var CMAKE_${_moo_ccf_lang}_${_moo_ccf_bvar})
|
||||
SET(${_moo_ccf_flags_var} "${${_moo_ccf_flags_var}} ${_moo_ccf_good_flags}")
|
||||
MOO_DEBUG(STATUS "${_moo_ccf_flags_var} += ${_moo_ccf_good_flags}")
|
||||
ENDFOREACH(_moo_ccf_bvar)
|
||||
ENDIF(_moo_ccf_good_flags)
|
||||
ENDFOREACH(_moo_ccf_lang)
|
||||
ENDMACRO(MOO_CHECK_COMPILER_FLAGS)
|
||||
|
||||
|
||||
MACRO(MOO_ADD_COMPILE_DEFINITIONS)
|
||||
_MOO_GET_COMPILER_CONFIG_ARGS(_moo_acd_langs "COMPILE_DEFINITIONS" _moo_acd_bvars _moo_acd_args ${ARGN})
|
||||
SET(_moo_acd_defs)
|
||||
FOREACH(_moo_acd_a ${_moo_acd_args})
|
||||
STRING(REGEX REPLACE "^(-D|/D)" "" _moo_acd_a "${_moo_acd_a}")
|
||||
LIST(APPEND _moo_acd_defs "${_moo_acd_a}")
|
||||
ENDFOREACH(_moo_acd_a)
|
||||
#MESSAGE("MOO_ADD_COMPILE_DEFINITIONS(${ARGN}) => ${_moo_acd_langs}, ${_moo_acd_bvars}, ${_moo_acd_args}")
|
||||
FOREACH(_moo_acd_bvar ${_moo_acd_bvars})
|
||||
SET_PROPERTY(DIRECTORY APPEND PROPERTY ${_moo_acd_bvar} ${_moo_acd_defs})
|
||||
_MOO_JOIN_STRING_LIST(_moo_acd_defs_string " " ${_moo_acd_defs})
|
||||
MOO_DEBUG(STATUS "${_moo_acd_bvar} += ${_moo_acd_defs_string}")
|
||||
ENDFOREACH(_moo_acd_bvar)
|
||||
ENDMACRO(MOO_ADD_COMPILE_DEFINITIONS)
|
||||
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# DEBUG
|
||||
#
|
||||
|
||||
MOO_ADD_COMPILE_DEFINITIONS(DEBUG -DMOO_DEBUG -DDEBUG)
|
||||
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# GCC
|
||||
#
|
||||
|
||||
# Set this first because it may affect checks below
|
||||
IF(MOO_DEV_MODE)
|
||||
MOO_ADD_COMPILER_FLAGS(GCC -Werror)
|
||||
ENDIF(MOO_DEV_MODE)
|
||||
|
||||
MOO_ADD_COMPILER_FLAGS(GCC -Wall -Wextra)
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC -fexceptions -fno-strict-aliasing -fno-strict-overflow)
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC -Wno-missing-field-initializers -Wno-overlength-strings -Wno-missing-declarations)
|
||||
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC DEBUG -ftrapv)
|
||||
|
||||
MOO_ADD_COMPILER_FLAGS(GCC CXX -std=c++98)
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC CXX -fno-rtti)
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC CXX RELEASE -fno-enforce-eh-specs)
|
||||
|
||||
IF(MOO_DEV_MODE)
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC
|
||||
-Wcast-align -Wlogical-op
|
||||
-Wmissing-format-attribute -Wnested-externs -Wlong-long -Wvla
|
||||
-Wuninitialized -Winit-self)
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC CXX -fno-nonansi-builtins -fno-gnu-keywords)
|
||||
MOO_CHECK_COMPILER_FLAGS(GCC CXX
|
||||
-Wctor-dtor-privacy -Wnon-virtual-dtor -Wabi
|
||||
-Wstrict-null-sentinel -Woverloaded-virtual -Wsign-promo
|
||||
)
|
||||
ENDIF(MOO_DEV_MODE)
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Windows
|
||||
#
|
||||
|
||||
MOO_ADD_COMPILE_DEFINITIONS(WIN32 -D__WIN32__ -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -DSTRICT)
|
||||
|
||||
MOO_ADD_COMPILER_FLAGS(MSVC /W4 /GS)
|
||||
MOO_ADD_COMPILER_FLAGS(MSVC CXX /Zc:wchar_t,forScope /GR /EHc /EHsc)
|
||||
|
||||
MOO_ADD_COMPILER_FLAGS(MSVC
|
||||
/wd4221 /wd4204 /wd4996 /wd4244 /wd4055 /wd4127 /wd4100
|
||||
/wd4054 /wd4152 /wd4706 /wd4125 /wd4389 /wd4132 /wd4018
|
||||
)
|
||||
|
||||
IF(MOO_DEV_MODE)
|
||||
MOO_ADD_COMPILER_FLAGS(MSVC /WX)
|
||||
MOO_ADD_COMPILER_FLAGS(MSVC DEBUG /RTCsu /RTCc)
|
||||
ENDIF(MOO_DEV_MODE)
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Mac OS X
|
||||
#
|
||||
|
||||
IF(APPLE)
|
||||
MOO_OPTION(MOO_ENABLE_UNIVERSAL FALSE "Build a universal binary on Mac OS X" HIDDEN !${MOO_OS_DARWIN})
|
||||
ENDIF(APPLE)
|
||||
|
||||
IF(APPLE AND MOO_ENABLE_UNIVERSAL)
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386")
|
||||
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk")
|
||||
ENDIF(APPLE AND MOO_ENABLE_UNIVERSAL)
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Precompiled headers
|
||||
#
|
||||
|
||||
MOO_OPTION(MOO_ENABLE_PCH FALSE "Enable precompiled headers. May be broken.")
|
||||
|
||||
MACRO(__MOO_PCH_GNUCXX_GET_COMPILE_FLAGS outvar target)
|
||||
|
||||
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _moo_varname)
|
||||
LIST(APPEND ${outvar} ${${_moo_varname}})
|
||||
|
||||
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||
IF("${target_type}" STREQUAL "SHARED_LIBRARY")
|
||||
LIST(APPEND ${outvar} -fPIC)
|
||||
ENDIF("${target_type}" STREQUAL "SHARED_LIBRARY")
|
||||
|
||||
GET_DIRECTORY_PROPERTY(includes INCLUDE_DIRECTORIES)
|
||||
FOREACH(item ${includes})
|
||||
LIST(APPEND ${outvar} "-I${item}")
|
||||
ENDFOREACH(item)
|
||||
|
||||
STRING(TOUPPER "COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE}" _moo_varname)
|
||||
GET_DIRECTORY_PROPERTY(flags ${_moo_varname})
|
||||
FOREACH(item ${flags})
|
||||
LIST(APPEND ${outvar} "-D${item}")
|
||||
ENDFOREACH(item)
|
||||
GET_DIRECTORY_PROPERTY(flags COMPILE_DEFINITIONS)
|
||||
FOREACH(item ${flags})
|
||||
LIST(APPEND ${outvar} "-D${item}")
|
||||
ENDFOREACH(item)
|
||||
|
||||
GET_DIRECTORY_PROPERTY(flags DEFINITIONS)
|
||||
LIST(APPEND ${outvar} ${flags})
|
||||
LIST(APPEND ${outvar} ${CMAKE_CXX_FLAGS} )
|
||||
|
||||
SEPARATE_ARGUMENTS(${outvar})
|
||||
ENDMACRO(__MOO_PCH_GNUCXX_GET_COMPILE_FLAGS)
|
||||
|
||||
MACRO(__MOO_PCH_GNUCXX_GET_COMMAND outvar target input output)
|
||||
__MOO_PCH_GNUCXX_GET_COMPILE_FLAGS(_moo_compile_flags target)
|
||||
SET(_moo_pch_compile_command
|
||||
${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${_moo_compile_flags} -x c++-header -o ${output} ${input}
|
||||
)
|
||||
ENDMACRO(__MOO_PCH_GNUCXX_GET_COMMAND)
|
||||
|
||||
MACRO(__MOO_PRECOMPILE_HEADER_GNUCXX header target)
|
||||
SET(_moo_pch_output_dir ${CMAKE_CURRENT_BINARY_DIR}/${header}.gch)
|
||||
SET(_moo_pch_output ${_moo_pch_output_dir}/c++)
|
||||
SET(_moo_pch_input_s ${CMAKE_CURRENT_SOURCE_DIR}/${header})
|
||||
SET(_moo_pch_input_b ${CMAKE_CURRENT_BINARY_DIR}/${header})
|
||||
SET(_moo_pch_lib ${target}_pchlib)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${_moo_pch_input_b} PROPERTIES GENERATED 1)
|
||||
|
||||
MOO_SUBDIR_NAME(_moo_subdir)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_moo_pch_input_b}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_moo_pch_input_s} ${_moo_pch_input_b}
|
||||
DEPENDS ${_moo_pch_input_s}
|
||||
COMMENT "Generating ${_moo_subdir}/${header}"
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(${target}_pch DEPENDS ${_moo_pch_output})
|
||||
ADD_DEPENDENCIES(${target} ${target}_pch)
|
||||
|
||||
__MOO_PCH_GNUCXX_GET_COMMAND(_moo_pch_compile_command ${target} ${_moo_pch_input_b} ${_moo_pch_output})
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_moo_pch_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_moo_pch_output_dir}
|
||||
COMMAND ${_moo_pch_compile_command}
|
||||
DEPENDS ${_moo_pch_input_s} ${_moo_pch_input_b} # ${_moo_pch_lib}
|
||||
COMMENT "Generating ${_moo_subdir}/${header}.gch/c++"
|
||||
)
|
||||
|
||||
GET_TARGET_PROPERTY(_moo_old_flags ${target} COMPILE_FLAGS)
|
||||
IF(NOT _moo_old_flags)
|
||||
SET(_moo_old_flags)
|
||||
ENDIF(NOT _moo_old_flags)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS
|
||||
"-include ${_moo_pch_input_b} -Winvalid-pch ${_moo_old_flags}"
|
||||
)
|
||||
ENDMACRO(__MOO_PRECOMPILE_HEADER_GNUCXX)
|
||||
|
||||
MACRO(MOO_PRECOMPILE_HEADER header target)
|
||||
IF(MOO_ENABLE_PCH)
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
__MOO_PRECOMPILE_HEADER_GNUCXX(${header} ${target})
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
MESSAGE(STATUS "*** IMPLEMENT ME: precompiled headers for this compiler")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ENDIF(MOO_ENABLE_PCH)
|
||||
ENDMACRO(MOO_PRECOMPILE_HEADER)
|
|
@ -1,22 +0,0 @@
|
|||
MACRO(MOO_INSTALL_DESKTOP_FILE)
|
||||
IF(MOO_OS_FDO)
|
||||
FOREACH(_moo_idf_desktop_file ${ARGN})
|
||||
IF("${_moo_idf_desktop_file}" MATCHES "\\.desktop\\.in$")
|
||||
MOO_MAKE_ABSOLUTE_INPUT_FILE("${_moo_idf_desktop_file}" _moo_idf_desktop_file)
|
||||
GET_FILENAME_COMPONENT(_moo_idf_desktop_file_base "${_moo_idf_desktop_file}" NAME_WE)
|
||||
SET(_moo_idf_desktop_file_real "${_moo_idf_desktop_file_base}.desktop")
|
||||
MOO_MAKE_ABSOLUTE_OUTPUT_FILE("${_moo_idf_desktop_file_real}" _moo_idf_desktop_file_real)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${_moo_idf_desktop_file_real}"
|
||||
COMMAND ${MOO_SOURCE_DIR}/moo/mooutils/moo-intltool-merge "${_moo_idf_desktop_file}" "${_moo_idf_desktop_file_real}"
|
||||
MAIN_DEPENDENCY "${_moo_idf_desktop_file}")
|
||||
ADD_CUSTOM_TARGET("gen-${_moo_idf_desktop_file_base}.desktop" ALL
|
||||
DEPENDS "${_moo_idf_desktop_file_real}")
|
||||
INSTALL(FILES "${_moo_idf_desktop_file_real}" DESTINATION "${DESKTOPFILEDIR}")
|
||||
ELSEIF("${_moo_idf_desktop_file}" MATCHES "\\.desktop$")
|
||||
INSTALL(FILES "${_moo_idf_desktop_file}" DESTINATION "${DESKTOPFILEDIR}")
|
||||
ELSE("${_moo_idf_desktop_file}" MATCHES "\\.desktop\\.in$")
|
||||
MOO_ERROR("Don't know what to do with file ${_moo_idf_desktop_file}")
|
||||
ENDIF("${_moo_idf_desktop_file}" MATCHES "\\.desktop\\.in$")
|
||||
ENDFOREACH(_moo_idf_desktop_file)
|
||||
ENDIF(MOO_OS_FDO)
|
||||
ENDMACRO(MOO_INSTALL_DESKTOP_FILE)
|
|
@ -1,100 +0,0 @@
|
|||
MOO_OPTION(ENABLE_NLS TRUE "Enable i18n" HEADER TRUE)
|
||||
|
||||
IF(ENABLE_NLS)
|
||||
FIND_PACKAGE(Gettext)
|
||||
IF(NOT GETTEXT_FOUND)
|
||||
MOO_ERROR("Gettext has not been found, translations will not be enabled")
|
||||
ENDIF(NOT GETTEXT_FOUND)
|
||||
ENDIF(ENABLE_NLS)
|
||||
|
||||
MACRO(MOO_TRANSFORM_INI_FILES outvar)
|
||||
FOREACH(_moo_ini_in_in_file ${ARGN})
|
||||
SET(_moo_ini_in_in_file_abs ${CMAKE_CURRENT_SOURCE_DIR}/${_moo_ini_in_in_file})
|
||||
STRING(REPLACE ".ini.in.in" ".ini.in" _moo_ini_in_file ${_moo_ini_in_in_file})
|
||||
SET(_moo_ini_in_file ${CMAKE_CURRENT_BINARY_DIR}/${_moo_ini_in_file})
|
||||
CONFIGURE_FILE(${_moo_ini_in_in_file} ${_moo_ini_in_file})
|
||||
STRING(REPLACE ".ini.in.in" ".ini" _moo_ini_file ${_moo_ini_in_in_file})
|
||||
SET(_moo_ini_file ${_moo_ini_file})
|
||||
LIST(APPEND ${outvar} ${CMAKE_CURRENT_BINARY_DIR}/${_moo_ini_file})
|
||||
IF(ENABLE_NLS)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_moo_ini_file}
|
||||
COMMAND ${INTLTOOL_MERGE_COMMAND} -d -u -c ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache ${CMAKE_SOURCE_DIR}/po ${_moo_ini_in_file} ${_moo_ini_file}
|
||||
DEPENDS ${_moo_ini_in_file})
|
||||
ELSE(ENABLE_NLS)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_moo_ini_file}
|
||||
COMMAND ${MOO_CMAKE_COMMAND} -D MOO_OS_BSD=${MOO_OS_BSD}
|
||||
-D INPUT_FILE=${_moo_ini_in_file}
|
||||
-D OUTPUT_FILE=${_moo_ini_file}
|
||||
-P ${CMAKE_SOURCE_DIR}/moo/mooutils/moo-intltool-merge.cmake
|
||||
DEPENDS ${_moo_ini_in_file})
|
||||
ENDIF(ENABLE_NLS)
|
||||
ENDFOREACH(_moo_ini_in_in_file)
|
||||
ENDMACRO(MOO_TRANSFORM_INI_FILES)
|
||||
|
||||
MACRO(MOO_ADD_MSG_CATALOG catalogname dir)
|
||||
IF(ENABLE_NLS)
|
||||
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${dir})
|
||||
FILE(GLOB _moo_po_files ${dir}/*.po)
|
||||
SET(_moo_langs)
|
||||
SET(_moo_gmo_files)
|
||||
FOREACH(_moo_po_file ${_moo_po_files})
|
||||
GET_FILENAME_COMPONENT(_moo_lang_code ${_moo_po_file} NAME_WE)
|
||||
LIST(APPEND _moo_langs ${_moo_lang_code})
|
||||
SET(_moo_gmo_file ${CMAKE_BINARY_DIR}/${dir}/${_moo_lang_code}.gmo)
|
||||
LIST(APPEND _moo_gmo_files ${_moo_gmo_file})
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_moo_gmo_file}
|
||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_moo_gmo_file} ${_moo_po_file}
|
||||
DEPENDS ${_moo_po_file})
|
||||
INSTALL(FILES ${_moo_gmo_file} DESTINATION ${LOCALEDIR}/${_moo_lang_code}/LC_MESSAGES/ RENAME ${catalogname}.mo)
|
||||
ENDFOREACH(_moo_po_file)
|
||||
SET_SOURCE_FILES_PROPERTIES(${_moo_gmo_files} PROPERTIES GENERATED 1 EXTERNAL_OBJECT 1)
|
||||
ADD_CUSTOM_TARGET(intl-${catalogname} ALL SOURCES ${_moo_gmo_files})
|
||||
ENDIF(ENABLE_NLS)
|
||||
ENDMACRO(MOO_ADD_MSG_CATALOG)
|
||||
|
||||
IF(ENABLE_NLS)
|
||||
IF(WIN32)
|
||||
MACRO(_MOO_FIND_INTLTOOL_VAR var script)
|
||||
SET(${var} $ENV{${var}})
|
||||
IF(NOT "${var}")
|
||||
FIND_FILE(${var} ${script})
|
||||
ENDIF(NOT "${var}")
|
||||
ENDMACRO(_MOO_FIND_INTLTOOL_VAR)
|
||||
FOREACH(_moo_i18n_tool update extract merge)
|
||||
STRING(TOUPPER ${_moo_i18n_tool} _moo_i18n_TOOL)
|
||||
_MOO_FIND_INTLTOOL_VAR(INTLTOOL_${_moo_i18n_TOOL} intltool-${_moo_i18n_tool})
|
||||
SET(__MOO_INTLTOOL_SCRIPT ${INTLTOOL_${_moo_i18n_TOOL}})
|
||||
CONFIGURE_FILE(${MOO_SOURCE_DIR}/plat/win32/intltool-wrapper.bat.in ${MOO_BINARY_DIR}/intltool-${_moo_i18n_tool}-wrapper.bat)
|
||||
SET(INTLTOOL_${_moo_i18n_TOOL}_COMMAND ${MOO_BINARY_DIR}/intltool-${_moo_i18n_tool}-wrapper.bat)
|
||||
ENDFOREACH(_moo_i18n_tool)
|
||||
ELSE(WIN32)
|
||||
FIND_PROGRAM(INTLTOOL_UPDATE_COMMAND intltool-update)
|
||||
FIND_PROGRAM(INTLTOOL_MERGE_COMMAND intltool-merge)
|
||||
FIND_PROGRAM(INTLTOOL_EXTRACT_COMMAND intltool-extract)
|
||||
ENDIF(WIN32)
|
||||
|
||||
SET(MOO_PO_DIR ${MOO_SOURCE_DIR}/po)
|
||||
|
||||
ADD_CUSTOM_TARGET(
|
||||
intl-check
|
||||
${INTLTOOL_UPDATE_COMMAND} --gettext-package=moo -m
|
||||
WORKING_DIRECTORY ${MOO_PO_DIR}
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(
|
||||
intl-pot
|
||||
COMMAND ${INTLTOOL_UPDATE_COMMAND} --gettext-package=moo -p
|
||||
WORKING_DIRECTORY ${MOO_PO_DIR}
|
||||
)
|
||||
|
||||
FILE(STRINGS ${MOO_PO_DIR}/LINGUAS MOO_PO_LINGUAS)
|
||||
ADD_CUSTOM_TARGET(intl-update-po)
|
||||
FOREACH(_moo_lang ${MOO_PO_LINGUAS})
|
||||
ADD_CUSTOM_TARGET(
|
||||
intl-update-${_moo_lang}-po
|
||||
${INTLTOOL_UPDATE_COMMAND} --gettext-package=moo -d ${_moo_lang}
|
||||
WORKING_DIRECTORY ${MOO_PO_DIR}
|
||||
)
|
||||
ADD_DEPENDENCIES(intl-update-po intl-update-${_moo_lang}-po)
|
||||
ENDFOREACH(_moo_lang)
|
||||
ENDIF(ENABLE_NLS)
|
|
@ -1,52 +0,0 @@
|
|||
MOO_OPTION(MOO_ENABLE_PYTHON TRUE "Enable Python" HEADER TRUE)
|
||||
|
||||
SET(PYTHON_DEV_FOUND FALSE)
|
||||
|
||||
MACRO(MOO_GET_PYTHON_SYSCONFIG_VAR var value error)
|
||||
SET(${error} FALSE)
|
||||
EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}" -c "import distutils.sysconfig; print distutils.sysconfig.get_config_vars('${var}')[0]"
|
||||
RESULT_VARIABLE _moo_gpsv_result
|
||||
OUTPUT_VARIABLE _moo_gpsv_output
|
||||
ERROR_VARIABLE _moo_gpsv_error
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
IF(_moo_gpsv_result EQUAL 0)
|
||||
SET(${value} "${_moo_gpsv_output}")
|
||||
ELSE(_moo_gpsv_result EQUAL 0)
|
||||
SET(${error} TRUE)
|
||||
ENDIF(_moo_gpsv_result EQUAL 0)
|
||||
ENDMACRO(MOO_GET_PYTHON_SYSCONFIG_VAR)
|
||||
|
||||
IF(MOO_ENABLE_PYTHON)
|
||||
PKG_CHECK_MODULES(PYGTK pygtk-2.0)
|
||||
IF(PYGTK_FOUND)
|
||||
_MOO_GET_PKG_CONFIG_VARIABLE(PYGTK_DEFS_DIR defsdir pygtk-2.0)
|
||||
_MOO_GET_PKG_CONFIG_VARIABLE(PYGTK_CODEGEN_DIR codegendir pygtk-2.0)
|
||||
MOO_GET_PYTHON_SYSCONFIG_VAR("INCLUDEPY" _moo_fp_includepy _moo_fp_error)
|
||||
IF(NOT _moo_fp_error)
|
||||
MOO_GET_PYTHON_SYSCONFIG_VAR("VERSION" _moo_fp_pyversion _moo_fp_error)
|
||||
ENDIF(NOT _moo_fp_error)
|
||||
IF(NOT _moo_fp_error AND WIN32)
|
||||
MOO_GET_PYTHON_SYSCONFIG_VAR("prefix" _moo_fp_pyprefix _moo_fp_error)
|
||||
ENDIF(NOT _moo_fp_error AND WIN32)
|
||||
IF(NOT _moo_fp_error)
|
||||
SET(PYTHON_LIBRARIES "python${_moo_fp_pyversion}")
|
||||
FILE(TO_CMAKE_PATH "${_moo_fp_includepy}" PYTHON_INCLUDE_DIRS)
|
||||
FILE(TO_CMAKE_PATH "${_moo_fp_pyprefix}/libs" PYTHON_LIBRARY_DIRS)
|
||||
SET(PYTHON_DEV_FOUND TRUE)
|
||||
ENDIF(NOT _moo_fp_error)
|
||||
ENDIF(PYGTK_FOUND)
|
||||
ENDIF(MOO_ENABLE_PYTHON)
|
||||
|
||||
MOO_DEBUG(STATUS "PYTHON_DEV_FOUND = ${PYTHON_DEV_FOUND}")
|
||||
|
||||
IF(PYTHON_DEV_FOUND)
|
||||
MOO_DEBUG(STATUS "PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}")
|
||||
MOO_DEBUG(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
|
||||
MOO_DEBUG(STATUS "PYTHON_LIBRARY_DIRS = ${PYTHON_LIBRARY_DIRS}")
|
||||
LIST(APPEND MOO_DEP_LIBS ${PYTHON_LIBRARIES})
|
||||
LINK_DIRECTORIES(${PYTHON_LIBRARY_DIRS} ${PYGTK_LIBRARY_DIRS})
|
||||
ELSE(PYTHON_DEV_FOUND)
|
||||
SET(MOO_ENABLE_PYTHON FALSE)
|
||||
ENDIF(PYTHON_DEV_FOUND)
|
||||
|
||||
# -%- strip:true, indent-width:2 -%-
|
|
@ -1,89 +0,0 @@
|
|||
MACRO(MOO_ADD_COMPILE_FLAGS target flags)
|
||||
GET_TARGET_PROPERTY(__moo_prop_value ${target} COMPILE_FLAGS)
|
||||
IF(__moo_prop_value)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS "${flags}")
|
||||
ELSE(__moo_prop_value)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS "${__moo_prop_value} ${flags}")
|
||||
ENDIF(__moo_prop_value)
|
||||
ENDMACRO(MOO_ADD_COMPILE_FLAGS)
|
||||
|
||||
MACRO(MOO_ADD_DEFINITIONS target defs)
|
||||
GET_TARGET_PROPERTY(__moo_prop_value ${target} COMPILE_DEFINITIONS)
|
||||
IF(__moo_prop_value)
|
||||
LIST(APPEND __moo_prop_value ${defs})
|
||||
ELSE(__moo_prop_value)
|
||||
SET(__moo_prop_value ${defs})
|
||||
ENDIF(__moo_prop_value)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "${__moo_prop_value}")
|
||||
ENDMACRO(MOO_ADD_DEFINITIONS)
|
||||
|
||||
# MACRO(MOO_ADD_SOURCE_FILE_SET name subdir)
|
||||
# _MOO_MODULE_SOURCES_VAR_NAMES(${name} _moo_s _moo_bs _moo_st)
|
||||
#
|
||||
# IF(_moo_code_module_created_${name})
|
||||
# MESSAGE(FATAL_ERROR "MOO_ADD_SOURCE_FILE_SET(${name}) called twice")
|
||||
# ENDIF(_moo_code_module_created_${name})
|
||||
# SET(_moo_code_module_created_${name} 1)
|
||||
#
|
||||
# SET(_moo_source_file_prefix "")
|
||||
# IF(NOT "" STREQUAL "${subdir}")
|
||||
# SET(_moo_source_file_prefix "${subdir}/")
|
||||
# ENDIF(NOT "" STREQUAL "${subdir}")
|
||||
#
|
||||
# # SET(${name}_cmake_dummy ${CMAKE_CURRENT_BINARY_DIR}/${name}-cmake-dummy.c)
|
||||
# # ADD_CUSTOM_COMMAND(OUTPUT ${${name}_cmake_dummy}
|
||||
# # COMMAND ${CMAKE_COMMAND} -D LIBNAME=${name} -D OUTPUT=${${name}_cmake_dummy} -P ${CMAKE_SOURCE_DIR}/moo/gendummy.cmake
|
||||
# # DEPENDS ${${name}_stamps} ${CMAKE_SOURCE_DIR}/moo/gendummy.cmake)
|
||||
# # SET_SOURCE_FILES_PROPERTIES(${${name}_cmake_dummy} PROPERTIES GENERATED 1)
|
||||
#
|
||||
# IF(_moo_source_file_prefix)
|
||||
# SET(_moo_sources_set_tmp ${${_moo_s}})
|
||||
# SET(${_moo_s})
|
||||
# FOREACH(_moo_source_file ${_moo_sources_set_tmp})
|
||||
# LIST(APPEND ${_moo_s} "${_moo_source_file_prefix}${_moo_source_file}")
|
||||
# ENDFOREACH(_moo_source_file)
|
||||
# ENDIF(_moo_source_file_prefix)
|
||||
#
|
||||
# LIST(APPEND moo_all_sources ${${_moo_s}} ${${_moo_bs}} ${${_moo_st}})
|
||||
#
|
||||
# ENDMACRO(MOO_ADD_SOURCE_FILE_SET)
|
||||
|
||||
MACRO(MOO_ADD_LIBRARY libname)
|
||||
STRING(TOUPPER ${libname} _mal_mod)
|
||||
GET_DIRECTORY_PROPERTY(_mal_stamps MOO_STAMPS)
|
||||
GET_DIRECTORY_PROPERTY(_mal_built_sources MOO_BUILT_SOURCES)
|
||||
# FOREACH(_moo_source_file ${${_mal_mod}_SOURCES} ${_mal_built_sources})
|
||||
# IF("${_moo_source_file}" MATCHES ".*[.]c$")
|
||||
# IF(NOT "${_moo_source_file}" STREQUAL "moofontsel.c")
|
||||
# set_source_files_properties(${_moo_source_file} PROPERTIES LANGUAGE CXX)
|
||||
# ENDIF(NOT "${_moo_source_file}" STREQUAL "moofontsel.c")
|
||||
# ENDIF("${_moo_source_file}" MATCHES ".*[.]c$")
|
||||
# ENDFOREACH(_moo_source_file)
|
||||
ADD_LIBRARY(${libname} STATIC ${ARGN} ${${_mal_mod}_SOURCES} ${_mal_stamps} ${_mal_built_sources})
|
||||
ENDMACRO(MOO_ADD_LIBRARY)
|
||||
|
||||
MACRO(MOO_ADD_MOO_CODE_MODULE)
|
||||
MOO_ADD_LIBRARY(${ARGN})
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
ENDMACRO(MOO_ADD_MOO_CODE_MODULE)
|
||||
|
||||
MACRO(MOO_WIN32_RESOURCE rc_in module module_sources module_libs)
|
||||
IF(WIN32)
|
||||
SET(_moo_rc_file ${CMAKE_CURRENT_BINARY_DIR}/${module}.rc)
|
||||
SET_SOURCE_FILES_PROPERTIES(${_moo_rc_file} PROPERTIES GENERATED 1)
|
||||
SET(_moo_res_file ${CMAKE_CURRENT_BINARY_DIR}/${module}.res)
|
||||
CONFIGURE_FILE(${rc_in} ${_moo_rc_file} @ONLY)
|
||||
IF(MSVC)
|
||||
LIST(APPEND ${module_sources} ${_moo_rc_file})
|
||||
ELSE(MSVC)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_moo_res_file}
|
||||
COMMAND ${WINDRES_EXECUTABLE} -i ${_moo_rc_file} --input-format=rc -o ${_moo_res_file} -O coff
|
||||
DEPENDS ${_moo_rc_file}
|
||||
)
|
||||
SET_SOURCE_FILES_PROPERTIES(${_moo_res_file} PROPERTIES EXTERNAL_OBJECT 1 GENERATED 1)
|
||||
LIST(APPEND ${module_sources} ${_moo_res_file})
|
||||
LIST(APPEND ${module_libs} ${_moo_res_file})
|
||||
# FIXME rebuilding just doesn't work
|
||||
ENDIF(MSVC)
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(MOO_WIN32_RESOURCE)
|
|
@ -1,72 +0,0 @@
|
|||
FIND_PACKAGE(PythonInterp)
|
||||
IF(NOT PYTHONINTERP_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Python not found")
|
||||
ENDIF(NOT PYTHONINTERP_FOUND)
|
||||
|
||||
IF(WIN32 AND NOT MSVC)
|
||||
FIND_PROGRAM(WINDRES_EXECUTABLE windres
|
||||
DOC "Path to the windres executable")
|
||||
IF(NOT WINDRES_EXECUTABLE)
|
||||
MESSAGE(FATAL_ERROR "Could not find windres")
|
||||
ENDIF(NOT WINDRES_EXECUTABLE)
|
||||
ENDIF(WIN32 AND NOT MSVC)
|
||||
|
||||
SET(MOO_CMAKE_COMMAND "${CMAKE_COMMAND}"
|
||||
-D "MOO_SOURCE_DIR=${MOO_SOURCE_DIR}"
|
||||
-D "MOO_BINARY_DIR=${MOO_BINARY_DIR}"
|
||||
-D "GLIB_GENMARSHAL_EXECUTABLE=${GLIB_GENMARSHAL_EXECUTABLE}"
|
||||
-D "GDK_PIXBUF_CSOURCE_EXECUTABLE=${GDK_PIXBUF_CSOURCE_EXECUTABLE}"
|
||||
-D "PKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE}"
|
||||
-D "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}"
|
||||
)
|
||||
|
||||
CONFIGURE_FILE(${MOO_SOURCE_DIR}/moo/glade2c.cmake.in ${CMAKE_BINARY_DIR}/moo/glade2c.cmake @ONLY)
|
||||
MACRO(MOO_GEN_GXML)
|
||||
FOREACH(_mgg_gladefile ${ARGN})
|
||||
STRING(REGEX REPLACE "(.*)\\.glade" "\\1-gxml.h" _mgg_header ${_mgg_gladefile})
|
||||
SET(_mgg_header_full ${CMAKE_CURRENT_BINARY_DIR}/${_mgg_header})
|
||||
SET(_mgg_header_stamp ${_mgg_header_full}.stamp)
|
||||
MOO_ADD_GENERATED_FILE(
|
||||
${_mgg_header_stamp} ${_mgg_header_full}
|
||||
COMMAND ${MOO_CMAKE_COMMAND} -D INPUT=${_mgg_gladefile} -D OUTPUT=${_mgg_header} -D SRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -P "${CMAKE_BINARY_DIR}/moo/glade2c.cmake"
|
||||
DEPENDS ${_mgg_gladefile} ${CMAKE_BINARY_DIR}/moo/glade2c.cmake ${MOO_GLADE2C_PY}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
ENDFOREACH(_mgg_gladefile)
|
||||
ENDMACRO(MOO_GEN_GXML)
|
||||
|
||||
MACRO(MOO_GEN_ENUMS enummodule)
|
||||
SET(_moo_enum_input ${enummodule}-enums-in.py)
|
||||
SET(_moo_enum_output ${enummodule}-enums)
|
||||
GET_FILENAME_COMPONENT(_moo_enum_gen_py ${CMAKE_SOURCE_DIR}/moo/genenums.py ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(_moo_enum_stamp ${CMAKE_CURRENT_BINARY_DIR}/${_moo_enum_output}.stamp ABSOLUTE)
|
||||
MOO_ADD_GENERATED_FILE(
|
||||
${_moo_enum_stamp}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${_moo_enum_output}.c;${CMAKE_CURRENT_SOURCE_DIR}/${_moo_enum_output}.h"
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${_moo_enum_gen_py} ${enummodule} ${_moo_enum_input} ${_moo_enum_output} ${_moo_enum_stamp}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_moo_enum_input} ${_moo_enum_gen_py}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
ENDMACRO(MOO_GEN_ENUMS)
|
||||
|
||||
MACRO(MOO_GEN_UIXML)
|
||||
FOREACH(uifile ${ARGN})
|
||||
GET_FILENAME_COMPONENT(basename ${uifile} NAME_WE)
|
||||
STRING(REPLACE "-" "_" varname ${basename})
|
||||
SET(varname ${varname}_ui_xml)
|
||||
SET(header ${basename}-ui.h)
|
||||
SET(header_full ${CMAKE_CURRENT_BINARY_DIR}/${header})
|
||||
SET(header_stamp ${header_full}.stamp)
|
||||
MOO_ADD_GENERATED_FILE(
|
||||
${header_stamp} ${header_full}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${MOO_XML2H_PY}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${uifile}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${header}
|
||||
${varname}
|
||||
DEPENDS ${uifile} ${MOO_XML2H_PY}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
ENDFOREACH(uifile)
|
||||
ENDMACRO(MOO_GEN_UIXML)
|
||||
|
||||
# -%- indent-width:2 -%-
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef CONFIG_DIRS_H
|
||||
#define CONFIG_DIRS_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define MOO_DATA_DIR "@MOO_DATA_DIR_ABS@"
|
||||
#define MOO_LIB_DIR "@MOO_LIB_DIR_ABS@"
|
||||
#define MOO_LOCALE_DIR "@LOCALEDIR_ABS@"
|
||||
#define MOO_HELP_DIR "@MOO_HELP_DIR_ABS@"
|
||||
|
||||
#endif /* CONFIG_DIRS_H */
|
61
config.cmake
61
config.cmake
|
@ -1,61 +0,0 @@
|
|||
IF(GDK_X11)
|
||||
FIND_PACKAGE(X11)
|
||||
LIST(APPEND MOO_DEP_LIBS ${X11_LIBRARIES} ${X11_ICE_LIB})
|
||||
ENDIF(GDK_X11)
|
||||
|
||||
INCLUDE(CheckFunctionExists)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
INCLUDE(CheckStructHasMember)
|
||||
|
||||
MACRO(MOO_CHECK_FUNCTIONS)
|
||||
FOREACH(_moo_func ${ARGN})
|
||||
STRING(REGEX REPLACE "[/.-]" "_" _moo_func_var ${_moo_func})
|
||||
STRING(TOUPPER HAVE_${_moo_func_var} _moo_func_var)
|
||||
CHECK_FUNCTION_EXISTS(${_moo_func} ${_moo_func_var})
|
||||
MOO_DEFINE_H(${_moo_func_var})
|
||||
ENDFOREACH(_moo_func)
|
||||
ENDMACRO(MOO_CHECK_FUNCTIONS)
|
||||
|
||||
MACRO(MOO_CHECK_HEADERS)
|
||||
FOREACH(_moo_func ${ARGN})
|
||||
STRING(REGEX REPLACE "[/.-]" "_" _moo_func_var ${_moo_func})
|
||||
STRING(TOUPPER HAVE_${_moo_func_var} _moo_func_var)
|
||||
CHECK_INCLUDE_FILE(${_moo_func} ${_moo_func_var})
|
||||
MOO_DEFINE_H(${_moo_func_var})
|
||||
ENDFOREACH(_moo_func)
|
||||
ENDMACRO(MOO_CHECK_HEADERS)
|
||||
|
||||
MACRO(MOO_CHECK_STRUCT_HAS_MEMBER struct field incfile varname)
|
||||
CHECK_STRUCT_HAS_MEMBER(${struct} ${field} ${incfile} ${varname})
|
||||
MOO_DEFINE_H(${varname})
|
||||
ENDMACRO(MOO_CHECK_STRUCT_HAS_MEMBER)
|
||||
|
||||
|
||||
# for xdgmime
|
||||
MOO_CHECK_FUNCTIONS(getc_unlocked)
|
||||
# for GMappedFile and xdgmime
|
||||
MOO_CHECK_FUNCTIONS(mmap)
|
||||
MOO_CHECK_HEADERS(unistd.h)
|
||||
# for mooappabout.h
|
||||
MOO_CHECK_HEADERS(sys/utsname.h)
|
||||
# for mooapp.c
|
||||
MOO_CHECK_HEADERS(signal.h)
|
||||
MOO_CHECK_FUNCTIONS(signal)
|
||||
# for mooutils-fs.c
|
||||
MOO_CHECK_HEADERS(sys/wait.h)
|
||||
|
||||
|
||||
IF(WIN32)
|
||||
INCLUDE_DIRECTORIES(${MOO_SOURCE_DIR}/moo/mooutils/moowin32/mingw)
|
||||
SET(HAVE_MMAP ON) # using fake mmap on windows
|
||||
# gettimeofday is present in recent mingw
|
||||
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
|
||||
IF(NOT HAVE_GETTIMEOFDAY)
|
||||
SET(HAVE_GETTIMEOFDAY 1)
|
||||
SET(MOO_NEED_GETTIMEOFDAY 1)
|
||||
INCLUDE_DIRECTORIES(${MOO_SOURCE_DIR}/moo/mooutils/moowin32/ms)
|
||||
ENDIF(NOT HAVE_GETTIMEOFDAY)
|
||||
MOO_DEFINE_H(MOO_NEED_GETTIMEOFDAY)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# -%- indent-width:2 -%-
|
238
config.h.in
238
config.h.in
|
@ -1,23 +1,217 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
#ifndef __CONFIG_H__
|
||||
#define __CONFIG_H__
|
||||
|
||||
/* always defined to indicate that i18n is enabled */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* moo */
|
||||
#undef GETTEXT_PACKAGE
|
||||
|
||||
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
|
||||
#undef HAVE_BIND_TEXTDOMAIN_CODESET
|
||||
|
||||
/* configargs.h is created */
|
||||
#undef HAVE_CONFIGARGS_H
|
||||
|
||||
/* Define to 1 if you have the `dcgettext' function. */
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the `FAMMonitorDirectory' function. */
|
||||
#undef HAVE_FAMMONITORDIRECTORY
|
||||
|
||||
/* fam.h has FAMNoExists defined */
|
||||
#undef HAVE_FAMNOEXISTS
|
||||
|
||||
/* Define to 1 if you have the `FAMOpen' function. */
|
||||
#undef HAVE_FAMOPEN
|
||||
|
||||
/* Define to 1 if you have the <fam.h> header file. */
|
||||
#undef HAVE_FAM_H
|
||||
|
||||
/* Define to 1 if you have the `getc_unlocked' function. */
|
||||
#undef HAVE_GETC_UNLOCKED
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `mmap' function. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if libXrender is available. */
|
||||
#undef HAVE_RENDER
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#undef HAVE_SIGNAL_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/utsname.h> header file. */
|
||||
#undef HAVE_SYS_UTSNAME_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* broken gtk theme */
|
||||
#undef MOO_BROKEN_GTK_THEME
|
||||
|
||||
/* MOO_BUILD_APP */
|
||||
#undef MOO_BUILD_APP
|
||||
|
||||
/* MOO_BUILD_EDIT */
|
||||
#undef MOO_BUILD_EDIT
|
||||
|
||||
/* MOO_BUILD_LUA */
|
||||
#undef MOO_BUILD_LUA
|
||||
|
||||
/* MOO_BUILD_UTILS */
|
||||
#undef MOO_BUILD_UTILS
|
||||
|
||||
/* must be 1 */
|
||||
#undef MOO_COMPILATION
|
||||
|
||||
/* MOO_COPYRIGHT */
|
||||
#undef MOO_COPYRIGHT
|
||||
|
||||
/* MOO_DISPLAY_VERSION */
|
||||
#undef MOO_DISPLAY_VERSION
|
||||
|
||||
/* MOO_EMAIL */
|
||||
#undef MOO_EMAIL
|
||||
|
||||
/* Enable unit tests */
|
||||
#undef MOO_ENABLE_UNIT_TESTS
|
||||
|
||||
/* MOO_MAJOR_VERSION */
|
||||
#undef MOO_MAJOR_VERSION
|
||||
|
||||
/* MOO_MICRO_VERSION */
|
||||
#undef MOO_MICRO_VERSION
|
||||
|
||||
/* MOO_MINOR_VERSION */
|
||||
#undef MOO_MINOR_VERSION
|
||||
|
||||
/* MOO_MODULE_MAJOR_VERSION */
|
||||
#undef MOO_MODULE_MAJOR_VERSION
|
||||
|
||||
/* MOO_MODULE_MINOR_VERSION */
|
||||
#undef MOO_MODULE_MINOR_VERSION
|
||||
|
||||
/* MOO_PACKAGE_NAME */
|
||||
#undef MOO_PACKAGE_NAME
|
||||
|
||||
/* use libfam for monitoring files */
|
||||
#undef MOO_USE_FAM
|
||||
|
||||
/* whether libfam is provided by gamin */
|
||||
#undef MOO_USE_GAMIN
|
||||
|
||||
/* use libxml2 */
|
||||
#undef MOO_USE_XML
|
||||
|
||||
/* MOO_VERSION */
|
||||
#undef MOO_VERSION
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* PACKAGE_BUGREPORT */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
#include <moo-config.h>
|
||||
|
||||
#define MOO_BUILD_APP 1
|
||||
#define MOO_BUILD_EDIT 1
|
||||
#define MOO_BUILD_LUA 1
|
||||
#define MOO_BUILD_UTILS 1
|
||||
|
||||
#define MOO_VERSION "@MOO_VERSION@"
|
||||
#define MOO_DISPLAY_VERSION "@MOO_DISPLAY_VERSION@"
|
||||
#define MOO_PACKAGE_VERSION "@MOO_PACKAGE_VERSION@"
|
||||
|
||||
#define MOO_MAJOR_VERSION @MOO_MAJOR_VERSION@
|
||||
#define MOO_MICRO_VERSION @MOO_MICRO_VERSION@
|
||||
#define MOO_MINOR_VERSION @MOO_MINOR_VERSION@
|
||||
#define MOO_MODULE_MAJOR_VERSION @MOO_MODULE_MAJOR_VERSION@
|
||||
#define MOO_MODULE_MINOR_VERSION @MOO_MODULE_MINOR_VERSION@
|
||||
|
||||
#define MOO_OS_NAME "@CMAKE_SYSTEM@"
|
||||
|
||||
#define MOO_EMAIL "@MOO_EMAIL@"
|
||||
#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
|
||||
#define MOO_PACKAGE_NAME "@MOO_PACKAGE_NAME@"
|
||||
#define MOO_COPYRIGHT "@MOO_COPYRIGHT@"
|
||||
#endif // __CONFIG_H__
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
m4_define([_moo_major_version_],[0])
|
||||
m4_define([_moo_minor_version_],[99])
|
||||
m4_define([_moo_micro_version_],[0])
|
||||
m4_define([_moo_version_suffix_],[unstable])
|
||||
m4_define([_moo_module_major_version_],[2])
|
||||
m4_define([_moo_module_minor_version_],[0])
|
||||
m4_define([_moo_version_],[_moo_major_version_._moo_minor_version_._moo_micro_version_])
|
||||
|
||||
m4_if([_moo_version_suffix_],[],[m4_define([_moo_display_version_],[_moo_version_])],[m4_define([_moo_display_version_],[_moo_version_-_moo_version_suffix_])])
|
||||
|
||||
m4_define([_moo_email_],[emuntyan@sourceforge.net])
|
||||
m4_define([_moo_copyright_],[2004-2010 Yevgen Muntyan <_moo_email_>])
|
||||
|
||||
AC_PREREQ([2.65])
|
||||
AC_INIT([medit], [_moo_display_version_], [_moo_email_])
|
||||
AC_GNU_SOURCE
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_SUBST(ACLOCAL_FLAGS)
|
||||
|
||||
AM_INIT_AUTOMAKE([1.11 silent-rules foreign dist-bzip2 dist-zip no-dist-gzip])
|
||||
LT_INIT([disable-shared])
|
||||
|
||||
AC_ARG_ENABLE(release,
|
||||
AC_HELP_STRING([--enable-release],[assume it's a release build]),[
|
||||
MOO_RELEASE_BUILD="$enable_release"
|
||||
],[
|
||||
MOO_RELEASE_BUILD="no"
|
||||
])
|
||||
AM_CONDITIONAL(MOO_RELEASE_BUILD, test "x$MOO_RELEASE_BUILD" = "xMOO_RELEASE_BUILD")
|
||||
|
||||
MOO_MAJOR_VERSION=_moo_major_version_
|
||||
MOO_MINOR_VERSION=_moo_minor_version_
|
||||
MOO_MICRO_VERSION=_moo_micro_version_
|
||||
MOO_MODULE_MAJOR_VERSION=_moo_module_major_version_
|
||||
MOO_MODULE_MINOR_VERSION=_moo_module_minor_version_
|
||||
MOO_VERSION=_moo_version_
|
||||
MOO_DISPLAY_VERSION=_moo_display_version_
|
||||
MOO_EMAIL="_moo_email_"
|
||||
MOO_COPYRIGHT="_moo_copyright_"
|
||||
MOO_PACKAGE_NAME=moo
|
||||
AC_SUBST(MOO_EMAIL)
|
||||
AC_SUBST(MOO_DISPLAY_VERSION)
|
||||
AC_SUBST(MOO_COPYRIGHT)
|
||||
|
||||
GETTEXT_PACKAGE=moo
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[moo])
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
IT_PROG_INTLTOOL
|
||||
IT_PO_SUBDIR([po-gsv])
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MKDIR_P
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
AC_ARG_VAR([WINDRES], [windres])
|
||||
AC_CHECK_TOOL(WINDRES, windres, :)
|
||||
|
||||
AC_ARG_VAR([PYTHON], [Python executable, used to run build scripts])
|
||||
AC_CHECK_PROGS(PYTHON, python, [AC_MSG_ERROR([Python not found])])
|
||||
AC_ARG_VAR([PERL], [Perl executable, used to run build scripts])
|
||||
AC_CHECK_PROGS(PERL, perl, [AC_MSG_ERROR([Perl not found])])
|
||||
|
||||
MOO_AC_FLAGS
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AH_TOP([#ifndef __CONFIG_H__
|
||||
#define __CONFIG_H__])
|
||||
AH_BOTTOM([#include <moo-config.h>
|
||||
#endif // __CONFIG_H__])
|
||||
|
||||
LT_LIB_M
|
||||
|
||||
AC_DEFINE(MOO_BUILD_APP,[1],[MOO_BUILD_APP])
|
||||
AC_DEFINE(MOO_BUILD_EDIT,[1],[MOO_BUILD_EDIT])
|
||||
AC_DEFINE(MOO_BUILD_LUA,[1],[MOO_BUILD_LUA])
|
||||
AC_DEFINE(MOO_BUILD_UTILS,[1],[MOO_BUILD_UTILS])
|
||||
|
||||
AM_CONDITIONAL(MOO_BUILD_CTAGS, [$MOO_OS_UNIX])
|
||||
|
||||
AC_DEFINE_UNQUOTED(MOO_VERSION,["$MOO_VERSION"],[MOO_VERSION])
|
||||
AC_DEFINE_UNQUOTED(MOO_DISPLAY_VERSION,["$MOO_DISPLAY_VERSION"],[MOO_DISPLAY_VERSION])
|
||||
AC_DEFINE_UNQUOTED(MOO_MAJOR_VERSION,[$MOO_MAJOR_VERSION],[MOO_MAJOR_VERSION])
|
||||
AC_DEFINE_UNQUOTED(MOO_MICRO_VERSION,[$MOO_MICRO_VERSION],[MOO_MICRO_VERSION])
|
||||
AC_DEFINE_UNQUOTED(MOO_MINOR_VERSION,[$MOO_MINOR_VERSION],[MOO_MINOR_VERSION])
|
||||
AC_DEFINE_UNQUOTED(MOO_MODULE_MAJOR_VERSION,[$MOO_MODULE_MAJOR_VERSION],[MOO_MODULE_MAJOR_VERSION])
|
||||
AC_DEFINE_UNQUOTED(MOO_MODULE_MINOR_VERSION,[$MOO_MODULE_MINOR_VERSION],[MOO_MODULE_MINOR_VERSION])
|
||||
|
||||
AC_DEFINE_UNQUOTED(MOO_EMAIL,["$MOO_EMAIL"],MOO_EMAIL)
|
||||
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT,["$PACKAGE_BUGREPORT"],PACKAGE_BUGREPORT)
|
||||
AC_DEFINE_UNQUOTED(MOO_PACKAGE_NAME,["$MOO_PACKAGE_NAME"],MOO_PACKAGE_NAME)
|
||||
AC_DEFINE_UNQUOTED(MOO_COPYRIGHT,["$MOO_COPYRIGHT"],MOO_COPYRIGHT)
|
||||
|
||||
MOO_AC_CHECK_OS
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
doc/Makefile
|
||||
po/Makefile.in
|
||||
po-gsv/Makefile.in
|
||||
moo/Makefile
|
||||
moo/xdgmime/Makefile
|
||||
moo/mooutils/Makefile
|
||||
moo/moolua/Makefile
|
||||
moo/moofileview/Makefile
|
||||
moo/gtksourceview/Makefile
|
||||
moo/mooedit/Makefile
|
||||
moo/eggsmclient/Makefile
|
||||
moo/mooapp/Makefile
|
||||
medit/Makefile
|
||||
plugins/Makefile
|
||||
plugins/script/Makefile
|
||||
plugins/usertools/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
|
@ -1,60 +0,0 @@
|
|||
FIND_PACKAGE(Perl)
|
||||
|
||||
GET_FILENAME_COMPONENT(MOO_HELP_FILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/help ABSOLUTE)
|
||||
FILE(MAKE_DIRECTORY ${MOO_HELP_FILES_DIR})
|
||||
|
||||
SET(_moo_build_docs)
|
||||
IF(MOO_DEV_MODE OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/help-sections.h)
|
||||
SET(_moo_build_docs TRUE)
|
||||
MESSAGE(STATUS "Will build docs")
|
||||
ENDIF(MOO_DEV_MODE OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/help-sections.h)
|
||||
|
||||
IF(_moo_build_docs)
|
||||
SET(MOO_HELP_T2T_FILES
|
||||
license.t2t
|
||||
prefs-file.t2t
|
||||
prefs.t2t
|
||||
user-tools.t2t
|
||||
regex.t2t
|
||||
man-medit.t2t
|
||||
)
|
||||
|
||||
GET_FILENAME_COMPONENT(MOO_HELP_T2T_MAIN ${CMAKE_CURRENT_SOURCE_DIR}/medit.t2t ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(MOO_HELP_T2T_MAN ${CMAKE_CURRENT_SOURCE_DIR}/man-medit.t2t ABSOLUTE)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/medit.t2t.in ${MOO_HELP_T2T_MAIN} @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/man-medit.t2t.in ${MOO_HELP_T2T_MAN} @ONLY)
|
||||
|
||||
GET_FILENAME_COMPONENT(MOO_HELP_HTML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/help.html ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(MOO_MAKEDOCS_CMAKE ${CMAKE_CURRENT_SOURCE_DIR}/makedocs.cmake ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(MOO_HELP_MAN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/medit.1 ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(MOO_HELP_SECTIONS_H ${CMAKE_CURRENT_SOURCE_DIR}/help-sections.h ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(MOO_HELP_TXT2TAGS_PY ${CMAKE_CURRENT_SOURCE_DIR}/txt2tags/txt2tags.py ABSOLUTE)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${MOO_HELP_HTML_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -D INPUT_FILE=${MOO_HELP_T2T_MAIN}
|
||||
-D OUTPUT_FILE=${MOO_HELP_HTML_FILE}
|
||||
-D OUTPUT_DIR=${MOO_HELP_FILES_DIR}
|
||||
-D SECTIONS_FILE=${MOO_HELP_SECTIONS_H}
|
||||
-D MAN_INPUT_FILE=${MOO_HELP_T2T_MAN}
|
||||
-D MAN_OUTPUT_FILE=${MOO_HELP_MAN_FILE}
|
||||
-D PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
||||
-D PERL_EXECUTABLE=${PERL_EXECUTABLE}
|
||||
-D TXT2TAGS=${MOO_HELP_TXT2TAGS_PY}
|
||||
-P ${MOO_MAKEDOCS_CMAKE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
MAIN_DEPENDENCY ${MOO_HELP_T2T_MAIN}
|
||||
DEPENDS ${MOO_MAKEDOCS_CMAKE} ${MOO_HELP_T2T_FILES})
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${MOO_HELP_MAN_FILE} PROPERTIES EXTERNAL_OBJECT 1 GENERATED 1)
|
||||
SET_SOURCE_FILES_PROPERTIES(${MOO_HELP_SECTIONS_H} ${MOO_HELP_T2T_MAIN} ${MOO_HELP_T2T_MAN} PROPERTIES GENERATED 1)
|
||||
|
||||
ADD_CUSTOM_TARGET(doc ALL DEPENDS ${MOO_HELP_HTML_FILE})
|
||||
ENDIF(_moo_build_docs)
|
||||
|
||||
INSTALL(DIRECTORY ${MOO_HELP_FILES_DIR}/ DESTINATION ${MOO_HELP_DIR})
|
||||
|
||||
IF(UNIX)
|
||||
INSTALL(FILES medit.1 DESTINATION ${MANDIR}/man1)
|
||||
ENDIF(UNIX)
|
||||
|
||||
# ADD_CUSTOM_TARGET(doc-clean COMMAND ${CMAKE_COMMAND} -E remove ${MOO_DOC_MEDIT_TXT} ${MOO_DOC_HTML_FILE} ${MOO_HELP_SECTIONS_H} ${MOO_DOC_STAMP_FILE})
|
|
@ -0,0 +1,51 @@
|
|||
MOO_HELP_FILES_DIR = $(srcdir)/help
|
||||
|
||||
if MOO_DEV_MODE
|
||||
|
||||
MOO_HELP_T2T_FILES = \
|
||||
license.t2t \
|
||||
prefs-file.t2t \
|
||||
prefs.t2t \
|
||||
user-tools.t2t \
|
||||
regex.t2t \
|
||||
medit.t2t
|
||||
|
||||
man-medit.t2t: man-medit.t2t.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && ./config.status --file=doc/man-medit.t2t
|
||||
mv man-medit.t2t $(srcdir)/man-medit.t2t
|
||||
|
||||
medit.1: man-medit.t2t
|
||||
cd $(srcdir) && $(PYTHON) txt2tags/txt2tags.py --target=man --outfile=medit.1.tmp man-medit.t2t && \
|
||||
mv medit.1.tmp medit.1
|
||||
|
||||
medit.t2t: medit.t2t.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && ./config.status --file=doc/medit.t2t
|
||||
mv medit.t2t $(srcdir)/medit.t2t
|
||||
|
||||
help.html: $(MOO_HELP_T2T_FILES)
|
||||
cd $(srcdir) && $(PYTHON) txt2tags/txt2tags.py --outfile=help.html.tmp medit.t2t && \
|
||||
mv help.html.tmp help.html
|
||||
|
||||
help.stamp: help.html genhelpsections.py
|
||||
$(MKDIR_P) $(MOO_HELP_FILES_DIR)
|
||||
cd $(MOO_HELP_FILES_DIR) && $(PERL) -I.. ../splity/splity.pl -index ../splity/index-template.html -page ../splity/page-template.html ../help.html
|
||||
echo stamp > $(srcdir)/help.stamp
|
||||
cd $(srcdir) && $(PYTHON) genhelpsections.py help.html > help-sections.h.tmp && \
|
||||
( cmp -s help-sections.h.tmp help-sections.h || mv help-sections.h.tmp help-sections.h )
|
||||
rm -f $(srcdir)/help-sections.h.tmp
|
||||
|
||||
all-am: doc
|
||||
doc: help.stamp
|
||||
|
||||
endif
|
||||
|
||||
install-data-local:
|
||||
$(MKDIR_P) $(DESTDIR)$(MOO_HELP_DIR)
|
||||
cd $(srcdir) && $(INSTALL_DATA) help/*.html $(DESTDIR)$(MOO_HELP_DIR)
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(MOO_HELP_DIR)/*.html
|
||||
|
||||
if MOO_OS_UNIX
|
||||
dist_man_MANS = medit.1
|
||||
endif MOO_OS_UNIX
|
|
@ -0,0 +1,20 @@
|
|||
# genhelpsections.py help.html
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
print '#ifndef HELP_SECTIONS_H'
|
||||
print '#define HELP_SECTIONS_H'
|
||||
print ''
|
||||
|
||||
for line in open(sys.argv[1]):
|
||||
m = re.search(r"##(.+)##", line)
|
||||
if m:
|
||||
section = m.group(1)
|
||||
if section.startswith("fake-"):
|
||||
section = section[5:]
|
||||
section_cap = section.replace('-', '_').upper()
|
||||
print '#define HELP_SECTION_%s "%s"' % (section_cap, section)
|
||||
|
||||
print ''
|
||||
print '#endif /* HELP_SECTIONS_H */'
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef HELP_SECTIONS_H
|
||||
#define HELP_SECTIONS_H
|
||||
|
||||
#define HELP_SECTION_PREFS_LANGS_AND_FILTERS "prefs-langs-and-filters"
|
||||
#define HELP_SECTION_PREFS_LANG_OPTIONS "prefs-lang-options"
|
||||
#define HELP_SECTION_PREFS_FILE_FILTERS "prefs-file-filters"
|
||||
#define HELP_SECTION_EDITING_OPTIONS "editing-options"
|
||||
#define HELP_SECTION_SECT_USER_TOOLS "sect-user-tools"
|
||||
#define HELP_SECTION_PREFS_USER_TOOLS "prefs-user-tools"
|
||||
#define HELP_SECTION_USER_TOOLS_FILES "user-tools-files"
|
||||
#define HELP_SECTION_USER_TOOLS_LUA "user-tools-lua"
|
||||
#define HELP_SECTION_USER_TOOLS_SHELL "user-tools-shell"
|
||||
#define HELP_SECTION_PREFS_FILE "prefs-file"
|
||||
#define HELP_SECTION_REGEX "regex"
|
||||
#define HELP_SECTION_REGEX_SEARCH "regex-search"
|
||||
#define HELP_SECTION_APP_LICENSE "app-license"
|
||||
#define HELP_SECTION_GPL "gpl"
|
||||
#define HELP_SECTION_LGPL "lgpl"
|
||||
#define HELP_SECTION_LICENSE_LUA "license-lua"
|
||||
#define HELP_SECTION_LICENSE_LUA_LFS "license-lua-lfs"
|
||||
#define HELP_SECTION_LICENSE_XDG_UTILS "license-xdg-utils"
|
||||
#define HELP_SECTION_DIALOG_REPLACE "dialog-replace"
|
||||
#define HELP_SECTION_DIALOG_FIND "dialog-find"
|
||||
#define HELP_SECTION_PREFS_DIALOG "prefs-dialog"
|
||||
#define HELP_SECTION_PREFS_PLUGINS "prefs-plugins"
|
||||
#define HELP_SECTION_PREFS_ACCELS "prefs-accels"
|
||||
#define HELP_SECTION_PREFS_FILE_SELECTOR "prefs-file-selector"
|
||||
#define HELP_SECTION_DIALOG_FIND_IN_FILES "dialog-find-in-files"
|
||||
#define HELP_SECTION_DIALOG_FIND_FILE "dialog-find-file"
|
||||
#define HELP_SECTION_FILE_SELECTOR "file-selector"
|
||||
|
||||
#endif /* HELP_SECTIONS_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>License</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="regex-search.html">Search</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="gpl.html">GNU General Public License</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H2>License</H2>
|
||||
|
||||
<!-- ##app-license## -->
|
||||
<P>
|
||||
medit as a whole is distributed under the terms of the GNU General
|
||||
Public License, version 2, but most of its code is released under the
|
||||
GNU Lesser General Public License. Full text of these licenses, as well
|
||||
as licenses and acknowledgements for third-party software incorporated
|
||||
in medit, can be found in this section.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="gpl.html">GNU General Public License</a></li>
|
||||
<li><a href="lgpl.html">GNU Lesser General Public License</a></li>
|
||||
<li><a href="license-lua.html">Lua License</a></li>
|
||||
<li><a href="license-lua-lfs.html">LuaFileSystem License</a></li>
|
||||
<li><a href="license-xdg-utils.html">xdg-utils License</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="regex-search.html">Search</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="gpl.html">GNU General Public License</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Editing options</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-file-filters.html">File filters</a></td>
|
||||
<td width="33%" align="center">Up: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="right">Next: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Editing options</H3>
|
||||
|
||||
<!-- ##editing-options## -->
|
||||
<P>
|
||||
medit has some editing options which can be set in the document text,
|
||||
or in the <I>Preferences</I> dialog for sets of files or for given syntax
|
||||
highlighting language.
|
||||
</P>
|
||||
<P>
|
||||
To set the options in the document text, place the following on the first,
|
||||
second or the last line of the document:
|
||||
</P>
|
||||
<PRE>
|
||||
-%- <em>options</em> -%-
|
||||
</PRE>
|
||||
<P>
|
||||
where <I>options</I> is the option string
|
||||
</P>
|
||||
<PRE>
|
||||
<em>key</em>: <em>value</em>; <em>key</em>: <em>value</em>; ...
|
||||
</PRE>
|
||||
<P>
|
||||
(the latter is the format used also in the <I>Preferences</I> dialog).
|
||||
</P>
|
||||
<P>
|
||||
Values can be strings, integers, or booleans.
|
||||
</P>
|
||||
<P>
|
||||
Booleans are <CODE>yes</CODE>, <CODE>no</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, <CODE>1</CODE>, <CODE>0</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
If a string value contains <CODE>:</CODE> character, then the following syntax may be used: <CODE><em>key</em>=/<em>value</em>/</CODE>.
|
||||
Any character may be used instead of slash (and it must not occur in the <I>value</I>).
|
||||
Example: <CODE>word-chars=@-/:@</CODE>
|
||||
</P>
|
||||
<P>
|
||||
The following options are available:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>lang</CODE></TD>
|
||||
<TD>syntax highlighting language to use in this document.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>strip</CODE></TD>
|
||||
<TD>a boolean value, whether trailing whitespace should be removed from the document on save.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>add-newline</CODE></TD>
|
||||
<TD>a boolean value, whether the editor should ensure that saved files have a trailing new line character.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>tab-width</CODE></TD>
|
||||
<TD>displayed width of the Tab character. NOTE: This is not an indentation offset, this is the visual width of a Tab character.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>use-tabs</CODE></TD>
|
||||
<TD>whether the Tab character should be used for indentation.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>indent-width</CODE></TD>
|
||||
<TD>an integer specifying indentation offset used when the Tab key is pressed to indent text.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
medit tries to understand modelines of Vim, Emacs, and Kate text editors, so chances are it will correctly
|
||||
pick up the conventional settings from source files.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-file-filters.html">File filters</a></td>
|
||||
<td width="33%" align="center">Up: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="right">Next: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,379 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>GNU General Public License</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="lgpl.html">GNU Lesser General Public License</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>GNU General Public License</H3>
|
||||
|
||||
<!-- ##gpl## -->
|
||||
<PRE>
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
</PRE>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="lgpl.html">GNU Lesser General Public License</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<TITLE>medit 0.99.0-unstable Manual</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<!--<br><sup>(all sections in one long page)</sup></div>-->
|
||||
|
||||
<H1>medit 0.99.0-unstable Manual</H1>
|
||||
|
||||
|
||||
</DIV>
|
||||
|
||||
<DIV CLASS="body" ID="body">
|
||||
<P>
|
||||
medit 0.99.0-unstable Manual
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<h2 style="margin:0;">Contents:</h2>
|
||||
<ul>
|
||||
<li><a href="prefs-langs-and-filters.html">Selecting editing options and languages</a><ul><li><a href="prefs-lang-options.html">Language-specific options</a></li>
|
||||
<li><a href="prefs-file-filters.html">File filters</a></li>
|
||||
<li><a href="editing-options.html">Editing options</a></li></ul></li>
|
||||
<li><a href="sect-user-tools.html">User-defined Tools</a><ul><li><a href="prefs-user-tools.html">Managing tools</a></li>
|
||||
<li><a href="user-tools-files.html">Storing tools in files</a></li>
|
||||
<li><a href="user-tools-lua.html">Lua scripts</a></li>
|
||||
<li><a href="user-tools-shell.html">Shell scripts</a></li></ul></li>
|
||||
<li><a href="prefs-file.html">Preferences files</a></li>
|
||||
<li><a href="regex.html">Regular expressions</a><ul><li><a href="regex-search.html">Search</a></li></ul></li>
|
||||
<li><a href="app-license.html">License</a><ul><li><a href="gpl.html">GNU General Public License</a></li>
|
||||
<li><a href="lgpl.html">GNU Lesser General Public License</a></li>
|
||||
<li><a href="license-lua.html">Lua License</a></li>
|
||||
<li><a href="license-lua-lfs.html">LuaFileSystem License</a></li>
|
||||
<li><a href="license-xdg-utils.html">xdg-utils License</a></li></ul></li>
|
||||
</ul>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,544 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>GNU Lesser General Public License</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="gpl.html">GNU General Public License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="license-lua.html">Lua License</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>GNU Lesser General Public License</H3>
|
||||
|
||||
<!-- ##lgpl## -->
|
||||
<PRE>
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
</PRE>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="gpl.html">GNU General Public License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="license-lua.html">Lua License</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>LuaFileSystem License</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="license-lua.html">Lua License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="license-xdg-utils.html">xdg-utils License</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>LuaFileSystem License</H3>
|
||||
|
||||
<!-- ##license-lua-lfs## -->
|
||||
<PRE>
|
||||
LuaFileSystem - File System Library for Lua
|
||||
Copyright 2003-2007 PUC-Rio
|
||||
http://www.keplerproject.org/luafilesystem
|
||||
|
||||
LuaFileSystem is a Lua library developed to complement the set of functions
|
||||
related to file systems offered by the standard Lua distribution. LuaFileSystem
|
||||
offers a portable way to access the underlying directory structure and file
|
||||
attributes. LuaFileSystem is free software and uses the same license as Lua 5.1
|
||||
Current version is 1.2.1.
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="license-lua.html">Lua License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="license-xdg-utils.html">xdg-utils License</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Lua License</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="lgpl.html">GNU Lesser General Public License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="license-lua-lfs.html">LuaFileSystem License</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Lua License</H3>
|
||||
|
||||
<!-- ##license-lua## -->
|
||||
<PRE>
|
||||
Lua License
|
||||
-----------
|
||||
|
||||
Lua is licensed under the terms of the MIT license reproduced below.
|
||||
This means that Lua is free software and can be used for both academic
|
||||
and commercial purposes at absolutely no cost.
|
||||
|
||||
For details and rationale, see http://www.lua.org/license.html .
|
||||
|
||||
===============================================================================
|
||||
|
||||
Copyright (C) 1994-2008 Lua.org, PUC-Rio.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
===============================================================================
|
||||
|
||||
(end of COPYRIGHT)
|
||||
</PRE>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="lgpl.html">GNU Lesser General Public License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="license-lua-lfs.html">LuaFileSystem License</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>xdg-utils License</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="license-lua-lfs.html">LuaFileSystem License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>xdg-utils License</H3>
|
||||
|
||||
<!-- ##license-xdg-utils## -->
|
||||
<PRE>
|
||||
Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
|
||||
Copyright 2006, Jeremy White <jwhite@codeweavers.com>
|
||||
|
||||
LICENSE:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
<!-- ##fake-dialog-replace## -->
|
||||
<!-- ##fake-dialog-find## -->
|
||||
<!-- ##fake-prefs-dialog## -->
|
||||
<!-- ##fake-prefs-plugins## -->
|
||||
<!-- ##fake-prefs-accels## -->
|
||||
<!-- ##fake-prefs-file-selector## -->
|
||||
<!-- ##fake-dialog-find-in-files## -->
|
||||
<!-- ##fake-dialog-find-file## -->
|
||||
<!-- ##fake-file-selector## -->
|
||||
</P>
|
||||
</DIV>
|
||||
|
||||
<!-- html code generated by txt2tags 2.5 (http://txt2tags.sf.net) -->
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="license-lua-lfs.html">LuaFileSystem License</a></td>
|
||||
<td width="33%" align="center">Up: <a href="app-license.html">License</a></td>
|
||||
<td width="33%" align="right">Next: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>File filters</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-lang-options.html">Language-specific options</a></td>
|
||||
<td width="33%" align="center">Up: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="right">Next: <a href="editing-options.html">Editing options</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>File filters</H3>
|
||||
|
||||
<!-- ##prefs-file-filters## -->
|
||||
<P>
|
||||
<I>File filters</I> section allows to customize editing options,
|
||||
as well as syntax highlighting language, on per-document basis using regular expressions
|
||||
which are matched against the document filename. Full file paths are used, so one can
|
||||
have per-directory settings.
|
||||
</P>
|
||||
<P>
|
||||
Use dollar if you need to match ends of filenames, e.g. "<CODE>\.doc$</CODE>" will work as "<CODE>*.doc</CODE>"
|
||||
pattern.
|
||||
</P>
|
||||
<P>
|
||||
The filters are applied in the order they appear in the list, one by one. All filters
|
||||
are applied to every file, so several filters may affect options in the same file. In this
|
||||
way one can set some options for a set of files or a directory, then set or modify some
|
||||
additional options for certain files in that set, etc.
|
||||
</P>
|
||||
<P>
|
||||
To add a filter, use <I>New</I> button. Click the filter in the list to
|
||||
select it, then click the <I>Filter</I> or <I>Options</I>
|
||||
part of it to edit. Use <I>Delete</I> button to delete a filter,
|
||||
and <I>Up</I> and <I>Down</I> buttons to change the order in
|
||||
which they are applied.
|
||||
</P>
|
||||
<P>
|
||||
<I>Filter</I> field contains a regular expression matched agains the
|
||||
document filename. If it is found in the filename, then the options from the
|
||||
<I>Options</I> field are applied to the document.
|
||||
</P>
|
||||
<P>
|
||||
<I>Options</I> field contains the options, in format described in the
|
||||
<A href="editing-options.html">Editing options</A> section.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-lang-options.html">Language-specific options</a></td>
|
||||
<td width="33%" align="center">Up: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="right">Next: <a href="editing-options.html">Editing options</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Preferences files</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-shell.html">Shell scripts</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="regex.html">Regular expressions</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H2>Preferences files</H2>
|
||||
|
||||
<!-- ##prefs-file## -->
|
||||
<P>
|
||||
medit preferences are stored in <CODE>$HOME/.config/meditrc</CODE> file.
|
||||
It is an XML file which may be edited to set preferences which have not found
|
||||
their place in the <interface>Preferences</interface> dialog.
|
||||
</P>
|
||||
<P>
|
||||
NOTE: medit reads the preferences file on startup and writes it whenever <I>OK</I>
|
||||
or <I>Apply</I> button is clicked in the <I>Preferences</I> dialog. Therefore, if you
|
||||
modify the preferences file, your changes may be overwritten, and they not take
|
||||
the effect until you restart medit.
|
||||
</P>
|
||||
<P>
|
||||
The following "hidden" settings are available.
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>Editor/window_title</CODE>: Format of the window title. It is a string which may
|
||||
contain format sequences: percent sign followed by a character:
|
||||
<UL>
|
||||
<LI><CODE>%a</CODE>: application name;
|
||||
<LI><CODE>%b</CODE>: current document basename;
|
||||
<LI><CODE>%f</CODE>: full path of the current document;
|
||||
<LI><CODE>%u</CODE>: URI of the current document;
|
||||
<LI><CODE>%s</CODE>: the status of the current document, e.g. "`` [modified]``". It is prefixed
|
||||
with space, so that "<CODE>%b%s</CODE>" will produce a nice string;
|
||||
<LI><CODE>%%</CODE>: the percent character.
|
||||
<P></P>
|
||||
Default value is "<CODE>%a - %f%s</CODE>" which produces something like "<CODE>medit - /home/user/file [modified]</CODE>".
|
||||
<P></P>
|
||||
</UL>
|
||||
<LI><CODE>Editor/window_title_no_doc</CODE>: Same as <CODE>Editor/window_title</CODE>, used when no document is open. Default value is "<CODE>%a</CODE>".
|
||||
<LI><CODE>Editor/tab_width</CODE>: Visual width of the Tab character, 8 by default.
|
||||
</UL>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-shell.html">Shell scripts</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="regex.html">Regular expressions</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Language-specific options</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="center">Up: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-file-filters.html">File filters</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Language-specific options</H3>
|
||||
|
||||
<!-- ##prefs-lang-options## -->
|
||||
<P>
|
||||
Here you can set editing options on per-language basis, as well as define
|
||||
for which file patterns and mime types given language should be used.
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><I>Language</I> combo box</TD>
|
||||
<TD>Choose the language you want to customize. Settings for <CODE>None</CODE> will apply to documents for which no syntax highlighting language was chosen.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><I>Mime types</I></TD>
|
||||
<TD>The given language will be used for files with these mime types, unless the language is chosen based on the filename or overridden in the <I>File filters</I> section.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><I>Extensions</I></TD>
|
||||
<TD>The given language will be used for files whose filenames match these patterns, unless overridden in the <I>File filters</I> section.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><I>Options</I></TD>
|
||||
<TD>Default editing options to use in documents which use the given language. These options can be overridden using <I>File filters</I> section, and options set in the file text have a higher priority as well. See the <A href="editing-options.html">Editing options</A> section for the format of this entry content.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="center">Up: <a href="prefs-langs-and-filters.html">Selecting editing options and languages</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-file-filters.html">File filters</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Selecting editing options and languages</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-lang-options.html">Language-specific options</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H2>Selecting editing options and languages</H2>
|
||||
|
||||
<!-- ##prefs-langs-and-filters## -->
|
||||
<P>
|
||||
<I>Languages and files</I> tab in the <I>Editor</I>
|
||||
section of the <I>Preferences</I> dialog allows customizing
|
||||
how syntax highlighting language and editing options are chosen
|
||||
depending on the document filename, as well as setting editing options for
|
||||
all documents which use given language and choosing file patterns and mime types
|
||||
for which the given language should be used.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="prefs-lang-options.html">Language-specific options</a></li>
|
||||
<li><a href="prefs-file-filters.html">File filters</a></li>
|
||||
<li><a href="editing-options.html">Editing options</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-lang-options.html">Language-specific options</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,164 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Managing tools</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-files.html">Storing tools in files</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Managing tools</H3>
|
||||
|
||||
<!-- ##prefs-user-tools## -->
|
||||
<P>
|
||||
To create a new tool or to modify existing ones, open
|
||||
<I>Preferences</I> dialog and select <I>Tools</I> in the list on the left.
|
||||
</P>
|
||||
<P>
|
||||
Select the tool in the list or click the <I>New</I>
|
||||
button to create a new one. To modify the order in which the tools
|
||||
appear in the <I>Tools</I> menu (or in the document
|
||||
context menu), use <I>Up</I> and <I>Down</I> buttons. To rename a tool,
|
||||
click its name in the list to select it and then click again to
|
||||
edit the name. Use the <I>Delete</I> button to delete a tool.
|
||||
</P>
|
||||
<P>
|
||||
The following controls are available to modify the tools behavior:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><I>Files</I></TD>
|
||||
<TD>Specifies for which files the tool is going to be available.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><I>Options</I></TD>
|
||||
<TD>Specifies under which conditions the tool should be enabled.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><I>Command type</I></TD>
|
||||
<TD>The type of the tool: a Python script, a Lua script, or a shell script.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><I>Code text field</I></TD>
|
||||
<TD>Here you enter the actual script text.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<I>Options</I> entry content is a comma-separated list of the following:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>need-doc</CODE></TD>
|
||||
<TD>the tool needs an open document</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>need-file</CODE></TD>
|
||||
<TD>the tool will not work in new unsaved documents.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>need-save</CODE></TD>
|
||||
<TD>the document will be saved before the command is executed.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>need-save-all</CODE></TD>
|
||||
<TD>all open documents will be saved before the command is executed.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<I>Files</I> entry content can be the following:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>a comma-separated list of file patterns, e.g. "<CODE>*.c,*.h</CODE>";
|
||||
<LI>a comma-separated list of languages prefixed with "<CODE>langs:</CODE>", e.g. "<CODE>langs: c, c++, objc</CODE>";
|
||||
<LI>a regular expression matching document filename prefixed with "<CODE>regex:</CODE>", e.g. the above
|
||||
pattern list may be written as "<CODE>regex:\.[ch]$</CODE>".
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Empty entry means that the tool will be available for all documents.
|
||||
</P>
|
||||
<P>
|
||||
Shell script tools also have the following controls available:
|
||||
</P>
|
||||
<P>
|
||||
<I>Input</I> entry specifies what text from the document should be passed to the command via its standard input:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>None</CODE></TD>
|
||||
<TD>no input text.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>Selected lines</CODE></TD>
|
||||
<TD>the lines containing selection or the line containing the cursor in case when no text is selected.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>Selection</CODE></TD>
|
||||
<TD>exact selected text. This will be different from "Selected lines" if selection does not span whole lines of the document, for instance if it is a single word.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>Whole document</CODE></TD>
|
||||
<TD>whole document contents.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<I>Output</I> entry specifies how the standard output of the command should be redirected.
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>None</CODE></TD>
|
||||
<TD>the command output will be suppressed.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>None, asynchronous</CODE></TD>
|
||||
<TD>the command output will be suppressed, and the command will be executed in background. For instance, you should use this if you need to launch some external program like a web browser.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>Output pane</CODE></TD>
|
||||
<TD>the command output will be displayed in an output pane. This is useful for running programs like compilers, where you want to see the output.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>Insert into the document</CODE></TD>
|
||||
<TD>output will be inserted into the current document at the cursor position. It will replace the text used as an input, if any.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>New document</CODE></TD>
|
||||
<TD>new document will be created and the command output will be inserted into it.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<I>Filter</I> combo. If the output pane is used, then it can be passed through a <I>filter</I>:
|
||||
the filter can match filenames and line numbers, so when you click the text in the
|
||||
output pane it will open the corresponding file. This is used for compilers and similar
|
||||
commands, which output locations of errors in processed files.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-files.html">Storing tools in files</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Search</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="regex.html">Regular expressions</a></td>
|
||||
<td width="33%" align="center">Up: <a href="regex.html">Regular expressions</a></td>
|
||||
<td width="33%" align="right">Next: <a href="app-license.html">License</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Search</H3>
|
||||
|
||||
<!-- ##regex-search## -->
|
||||
<P>
|
||||
Regular expression searches in a document text are limited to single lines, unless the
|
||||
search pattern includes newline. For example, pattern ".*" will match every line in the
|
||||
document, pattern ".*\n.*" will match pairs of consecutive lines. This means that it is
|
||||
mostly impossible to perform searches for text which spawns multiple lines.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="regex.html">Regular expressions</a></td>
|
||||
<td width="33%" align="center">Up: <a href="regex.html">Regular expressions</a></td>
|
||||
<td width="33%" align="right">Next: <a href="app-license.html">License</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Regular expressions</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-file.html">Preferences files</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="regex-search.html">Search</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H2>Regular expressions</H2>
|
||||
|
||||
<!-- ##regex## -->
|
||||
<P>
|
||||
Medit uses regular expressions functionality provided by Glib, which in turn uses
|
||||
<A HREF="http://pcre.org/">PCRE</A> library. See <A HREF="http://library.gnome.org/devel/glib/stable/glib-regex-syntax.html">Glib manual</A>
|
||||
for complete description of regular expressions syntax.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="regex-search.html">Search</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-file.html">Preferences files</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="regex-search.html">Search</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>User-defined Tools</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="editing-options.html">Editing options</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-user-tools.html">Managing tools</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H2>User-defined Tools</H2>
|
||||
|
||||
<!-- ##sect-user-tools## -->
|
||||
<P>
|
||||
medit allows extending its functionality with user-defined
|
||||
<I>tools</I>. It can be a Lua or Python (provided medit has been
|
||||
built with Python support) script which is executed inside medit,
|
||||
or a shell script which can use the text of the open document as
|
||||
its input and/or output.
|
||||
</P>
|
||||
<P>
|
||||
There are some predefined tools which you can use as
|
||||
an example or to modify to suit your needs.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="prefs-user-tools.html">Managing tools</a></li>
|
||||
<li><a href="user-tools-files.html">Storing tools in files</a></li>
|
||||
<li><a href="user-tools-lua.html">Lua scripts</a></li>
|
||||
<li><a href="user-tools-shell.html">Shell scripts</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="editing-options.html">Editing options</a></td>
|
||||
<td width="33%" align="center">Up: <a href="index.html">medit 0.99.0-unstable Manual</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-user-tools.html">Managing tools</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Storing tools in files</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-user-tools.html">Managing tools</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-lua.html">Lua scripts</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Storing tools in files</H3>
|
||||
|
||||
<!-- ##user-tools-files## -->
|
||||
<P>
|
||||
It is possible to create tools without using the <I>Preferences</I> dialog,
|
||||
they can be stored in files in <CODE>tools</CODE> subfolder of the medit data
|
||||
folders (or <CODE>tools-context</CODE> for tools which appear in the document context
|
||||
menu). In particular, on Unix systems you can place files into
|
||||
<CODE>$HOME/.local/share/medit/tools/</CODE> folder.
|
||||
</P>
|
||||
<P>
|
||||
Names of the files in the <CODE>tools</CODE> folder are used as their menu item
|
||||
labels, after stripping first three characters, so you can use trhee-character
|
||||
prefix to affect the order of the menu items, e.g. you can have <CODE>00-Do Something</CODE>,
|
||||
<CODE>01-Another tool</CODE> files to have them in that order in the menu. The files
|
||||
may be of three types: files with extension "<CODE>.py</CODE>", they will be used
|
||||
as Python scripts; files with extension "<CODE>.lua</CODE>", they will be used
|
||||
as Lua scripts; and executable files, they will be executed in the same way
|
||||
as shell commands.
|
||||
</P>
|
||||
<P>
|
||||
To set parameters for a tool, place them on the first or the second line of the file in
|
||||
the following format:
|
||||
</P>
|
||||
<PRE>
|
||||
!! <em>key</em>=<em>value</em>; <em>key</em>=<em>value</em>; ... !!
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
<I>key</I> may be one of the following:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>position</CODE></TD>
|
||||
<TD>it can be <CODE>start</CODE> or <CODE>end</CODE>, and defines whether the menu item will be located at the start or at the end of the menu.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>id</CODE></TD>
|
||||
<TD>the tool identificator.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>name</CODE></TD>
|
||||
<TD>the tool name, i.e. the label used in the menu item. Overrides the file name.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>os</CODE></TD>
|
||||
<TD><CODE>windows</CODE> or <CODE>unix</CODE>. If specified, then the tool will not be used when medit is running on a different operating system.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>accel</CODE></TD>
|
||||
<TD>default keyboard accelerator used to invoke this tool.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>menu</CODE></TD>
|
||||
<TD>the menu to place this tool into. By default the tools are located in the Tools menu, but they can be as well put into any other menu.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>langs</CODE></TD>
|
||||
<TD>comma-separated list of languages for which this tool will be enabled.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>file-filter</CODE></TD>
|
||||
<TD>defines for which files this tool will be enabled. The value has the same format as in the <I>Preferences</I> dialog.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>options</CODE></TD>
|
||||
<TD>same as the <I>Options</I> entry content in the <I>Preferences</I> dialog.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
In addition to these, you can set input and output options for executable files:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>input</CODE></TD>
|
||||
<TD>can be <CODE>none</CODE>, <CODE>lines</CODE>, <CODE>selection</CODE>, or <CODE>doc</CODE>.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>output</CODE></TD>
|
||||
<TD>can be <CODE>none</CODE>, <CODE>async</CODE>, <CODE>pane</CODE>, <CODE>insert</CODE>, or <CODE>new-doc</CODE>.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>filter</CODE></TD>
|
||||
<TD>the output filter name.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="prefs-user-tools.html">Managing tools</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-lua.html">Lua scripts</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Lua scripts</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-files.html">Storing tools in files</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-shell.html">Shell scripts</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Lua scripts</H3>
|
||||
|
||||
<!-- ##user-tools-lua## -->
|
||||
<P>
|
||||
Lua scripts can use the standard Lua library, <CODE>lfs</CODE> library, and <CODE>medit</CODE> package
|
||||
which provides some text editor API. Lua scripts have the following variables and functions available.
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>doc</CODE>: a table with the following fields:
|
||||
</UL>
|
||||
|
||||
<TABLE ALIGN="center" BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>file</CODE></TD>
|
||||
<TD>the document file path.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>name</CODE></TD>
|
||||
<TD>the document file basename.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>dir</CODE></TD>
|
||||
<TD>the document file directory.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>ext</CODE></TD>
|
||||
<TD>the document filename extension including the period.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>base</CODE></TD>
|
||||
<TD>the document filename without the extension: the basename is always <CODE>base..ext</CODE>.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<UL>
|
||||
<LI><CODE>Cut()</CODE>, <CODE>Copy()</CODE>, <CODE>Paste()</CODE>: clipboard operations.
|
||||
<LI><CODE>Backspace()</CODE>, <CODE>Delete()</CODE>: corresponding key actions.
|
||||
<LI><CODE>Up()</CODE>, <CODE>Down()</CODE>, <CODE>Left()</CODE>, <CODE>Right()</CODE>: move cursor as the arrow keys do.
|
||||
<LI><CODE>Selection()</CODE>: returns selected text as a string. Returns <CODE>nil</CODE> when no text is selected.
|
||||
<LI><CODE>Select(n)</CODE>: selects <CODE>n</CODE> characters to the right if <CODE>n</CODE> is positive, and <CODE>-n</CODE> characters to the left if it is negative.
|
||||
<LI><CODE>Insert(...)</CODE>: inserts text at cursor. Namely, it converts each argument to a string and inserts the result into the document.
|
||||
<LI><CODE>NewLine()</CODE>: inserts new line character.
|
||||
<P></P>
|
||||
The following functions are provided for more advanced text manipulation. Position in the
|
||||
document is denoted by the character offset from the beginning of the document, starting
|
||||
from 1, so the first character is at position 1. Functions which take or return ranges use pairs of
|
||||
offsets, a pair <CODE>start</CODE>, <CODE>end</CODE> denotes range of text from
|
||||
<CODE>start</CODE> to <CODE>end</CODE>, <B>not</B> including the character at offset <CODE>end</CODE>. For instance, the
|
||||
single-character range consisting of the first character in the document corresponds to the
|
||||
pair <CODE>1, 2</CODE>. Non-positive offset denotes the end of the document.
|
||||
<P></P>
|
||||
<LI><CODE>InsertText(pos, ...)</CODE>: inserts text at the position <CODE>pos</CODE>.
|
||||
<LI><CODE>DeleteText(start, end)</CODE>: deletes text in the range <CODE>[start..end)</CODE>.
|
||||
<LI><CODE>GetInsert()</CODE>: returns position of the cursor in the document.
|
||||
<LI><CODE>GetSelectionBounds()</CODE>: returns positions of the selection start and end. If no text is
|
||||
selected, returns pair <CODE>pos, pos</CODE> where <CODE>pos</CODE> is the cursor position.
|
||||
<LI><CODE>GetLine([pos])</CODE>: returns line number of the character at the position <CODE>pos</CODE>. If <CODE>pos</CODE>
|
||||
is not specified, it defaults to the cursor position.
|
||||
<LI><CODE>GetPosAtLine(n)</CODE>: returns position at the beginning of the <CODE>n</CODE>-th line.
|
||||
<LI><CODE>LineStart([pos])</CODE>: returns the position of the beginning of the line which contains character at <CODE>pos</CODE>.
|
||||
If <CODE>pos</CODE> is not specified, it defaults to the cursor position.
|
||||
<LI><CODE>LineEnd([pos])</CODE>: returns the position of the end of the line which contains character at <CODE>pos</CODE>.
|
||||
If <CODE>pos</CODE> is not specified, it defaults to the cursor position.
|
||||
<LI><CODE>ForwardLine([pos, [n]])</CODE>: returns the position of the beginning of the next line (or
|
||||
<CODE>n</CODE>-th line if <CODE>n</CODE> is specified). <CODE>pos</CODE> defaults to the cursor position if not
|
||||
specified.
|
||||
<LI><CODE>BackwardLine([pos, [n]])</CODE>: returns the position of the beginning of the previous line
|
||||
(or <CODE>n</CODE>-th line backwards if <CODE>n</CODE> is specified). <CODE>pos</CODE> defaults to the cursor position
|
||||
if not specified.
|
||||
<LI><CODE>GetText(start, end)</CODE>: returns the text in the <CODE>[start..end)</CODE>. If <CODE>start == end</CODE>, it
|
||||
returns an empty string, not <CODE>nil</CODE>.
|
||||
</UL>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-files.html">Storing tools in files</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-shell.html">Shell scripts</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Python scripts</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-files.html">Storing tools in files</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-lua.html">Lua scripts</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Python scripts</H3>
|
||||
|
||||
<!-- ##user-tools-python## -->
|
||||
<P>
|
||||
If medit is built with Python support, then Python scripts have full access to the program
|
||||
internals via builtin <CODE>moo</CODE> module. medit classes extend classes from <CODE>pygtk</CODE>,
|
||||
in particular the <CODE>moo.edit.Edit</CODE> class representing documents extends the
|
||||
<CODE>gtk.TextView</CODE> class, and all editing operations can be implemented using
|
||||
<CODE>pygtk</CODE> API.
|
||||
</P>
|
||||
<P>
|
||||
Python scripts executed from inside medit have <CODE>LIBDIR/plugins/lib</CODE>
|
||||
and <CODE>USERDATADIR/plugins/lib</CODE> directories added to <CODE>sys.path</CODE>,
|
||||
you can place there medit-specific modules to be used from python tools.
|
||||
</P>
|
||||
<P>
|
||||
Python scripts have the following variables predefined:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>doc</CODE></TD>
|
||||
<TD>the current document object.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>window</CODE></TD>
|
||||
<TD>the current editor window.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>buffer</CODE></TD>
|
||||
<TD>the text buffer (a <CODE>moo.edit.TextBuffer</CODE> instance) of the current document.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>editor</CODE></TD>
|
||||
<TD>the <CODE>moo.edit.Editor</CODE> object representing the text editor. Use its methods to open/close files, switch between documents and windows, etc.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>moo</CODE></TD>
|
||||
<TD>the <CODE>moo</CODE> module, already imported so you can omit <CODE>import moo</CODE> statement in scripts.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-files.html">Storing tools in files</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="user-tools-lua.html">Lua scripts</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<title>Shell scripts</title>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV CLASS="header" ID="header">
|
||||
|
||||
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-lua.html">Lua scripts</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-file.html">Preferences files</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<H3>Shell scripts</H3>
|
||||
|
||||
<!-- ##user-tools-shell## -->
|
||||
<P>
|
||||
In addition to the document text passed via standard input,
|
||||
shell scripts have a number of environment variables set. <CODE>$APP_PID</CODE>
|
||||
variable is set to the current process process id, so that opening a file in the
|
||||
same instance of medit is as simple as <CODE>medit filename</CODE> (on the other
|
||||
hand, you will have to use command line options if you need to run a new medit instance).
|
||||
The following environment variables are set when scripts are executed:
|
||||
</P>
|
||||
<TABLE BORDER="1">
|
||||
<TR>
|
||||
<TD><CODE>DOC</CODE></TD>
|
||||
<TD>the document basename.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>DOC_DIR</CODE></TD>
|
||||
<TD>the document file directory. The full file path is <CODE>$DOC_DIR/$DOC</CODE>.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>DOC_BASE</CODE></TD>
|
||||
<TD>the basename without extension.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>DOC_EXT</CODE></TD>
|
||||
<TD>the document filename extension including the period. The basename is always <CODE>$DOC_BASE$DOC_EXT</CODE>.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>LINE</CODE></TD>
|
||||
<TD>the number of the line containing cursor.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>DATA_DIR</CODE></TD>
|
||||
<TD>the user data directory. For example the tools are stored in <CODE>$DATA_DIR/menu.cfg</CODE> file and in files in the <CODE>$DATA_DIR/tools/</CODE> directory.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
Additionally, all processes ran from inside medit will have <CODE>DATADIR/scripts</CODE>
|
||||
directories in <CODE>$PATH</CODE>, so you may place some medit-specific programs
|
||||
or scripts into <CODE>USERDATADIR/scripts/</CODE> to be used from shell script tools.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<table width="100%"><tr valign="top">
|
||||
<td width="33%" align="left">Previous: <a href="user-tools-lua.html">Lua scripts</a></td>
|
||||
<td width="33%" align="center">Up: <a href="sect-user-tools.html">User-defined Tools</a></td>
|
||||
<td width="33%" align="right">Next: <a href="prefs-file.html">Preferences files</a></td>
|
||||
</tr></table>
|
||||
|
||||
</BODY></HTML>
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
MACRO(MOO_EXEC_OR_DIE command)
|
||||
EXECUTE_PROCESS(${ARGN}
|
||||
RESULT_VARIABLE __moo_command_result
|
||||
ERROR_VARIABLE __moo_command_error
|
||||
)
|
||||
IF(NOT __moo_command_result EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Command ${command} failed: ${__moo_command_error}")
|
||||
ENDIF(NOT __moo_command_result EQUAL 0)
|
||||
ENDMACRO(MOO_EXEC_OR_DIE)
|
||||
|
||||
MACRO(RENAME_OR_DIE src dst)
|
||||
MOO_EXEC_OR_DIE("copy ${src} ${dst}" COMMAND ${CMAKE_COMMAND} -E copy ${src} ${dst})
|
||||
MOO_EXEC_OR_DIE("remove ${src}" COMMAND ${CMAKE_COMMAND} -E remove ${src})
|
||||
ENDMACRO(RENAME_OR_DIE)
|
||||
|
||||
MACRO(RENAME_IF_DIFFERENT_OR_DIE src dst)
|
||||
MOO_EXEC_OR_DIE("copy ${src} ${dst}" COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst})
|
||||
MOO_EXEC_OR_DIE("remove ${src}" COMMAND ${CMAKE_COMMAND} -E remove ${src})
|
||||
ENDMACRO(RENAME_IF_DIFFERENT_OR_DIE)
|
||||
|
||||
GET_FILENAME_COMPONENT(DOC_DIR . ABSOLUTE)
|
||||
|
||||
MOO_EXEC_OR_DIE(txt2tags COMMAND ${PYTHON_EXECUTABLE} ${TXT2TAGS} --target=man --outfile=${MAN_OUTPUT_FILE}.tmp ${MAN_INPUT_FILE})
|
||||
RENAME_OR_DIE(${MAN_OUTPUT_FILE}.tmp ${MAN_OUTPUT_FILE})
|
||||
|
||||
MOO_EXEC_OR_DIE(txt2tags COMMAND ${PYTHON_EXECUTABLE} ${TXT2TAGS} --outfile=${OUTPUT_FILE}.tmp ${INPUT_FILE})
|
||||
|
||||
FILE(MAKE_DIRECTORY ${OUTPUT_DIR})
|
||||
MOO_EXEC_OR_DIE(splity COMMAND ${PERL_EXECUTABLE} -I${DOC_DIR} ${DOC_DIR}/splity/splity.pl
|
||||
-index ${DOC_DIR}/splity/index-template.html
|
||||
-page ${DOC_DIR}/splity/page-template.html ${OUTPUT_FILE}.tmp
|
||||
WORKING_DIRECTORY ${OUTPUT_DIR})
|
||||
|
||||
SET(sections)
|
||||
FILE(STRINGS ${OUTPUT_FILE}.tmp lines REGEX "##(.+)##")
|
||||
FOREACH(line ${lines})
|
||||
SET(section)
|
||||
STRING(REGEX REPLACE "^.*##(.+)##.*$" "\\1" section "${line}")
|
||||
IF(section)
|
||||
LIST(APPEND sections ${section})
|
||||
ENDIF(section)
|
||||
ENDFOREACH(line)
|
||||
|
||||
FILE(WRITE ${SECTIONS_FILE}.tmp "#ifndef HELP_SECTIONS_H\n")
|
||||
FILE(APPEND ${SECTIONS_FILE}.tmp "#define HELP_SECTIONS_H\n\n")
|
||||
FOREACH(section ${sections})
|
||||
IF(section MATCHES "fake-")
|
||||
STRING(REPLACE "fake-" "" section ${section})
|
||||
STRING(TOUPPER ${section} SECTION)
|
||||
STRING(REPLACE "-" "_" SECTION ${SECTION})
|
||||
SET(section)
|
||||
ELSE(section MATCHES "fake-")
|
||||
STRING(TOUPPER ${section} SECTION)
|
||||
STRING(REPLACE "-" "_" SECTION ${SECTION})
|
||||
ENDIF(section MATCHES "fake-")
|
||||
FILE(APPEND ${SECTIONS_FILE}.tmp "#define HELP_SECTION_${SECTION} \"${section}\"\n")
|
||||
ENDFOREACH(section)
|
||||
FILE(APPEND ${SECTIONS_FILE}.tmp "\n#endif /* HELP_SECTIONS_H */\n")
|
||||
|
||||
RENAME_IF_DIFFERENT_OR_DIE(${SECTIONS_FILE}.tmp ${SECTIONS_FILE})
|
||||
RENAME_OR_DIE(${OUTPUT_FILE}.tmp ${OUTPUT_FILE})
|
|
@ -0,0 +1,107 @@
|
|||
MEDIT
|
||||
|
||||
August 2010
|
||||
|
||||
%!encoding: UTF-8
|
||||
|
||||
= NAME =
|
||||
|
||||
medit - text editor
|
||||
|
||||
|
||||
= SYNOPSIS =
|
||||
|
||||
**medit** [//OPTION//]... [//FILES//]
|
||||
|
||||
|
||||
= DESCRIPTION =
|
||||
|
||||
**medit** is a text editor.
|
||||
|
||||
|
||||
= OPTIONS =
|
||||
|
||||
: **-n**, **--new-app**
|
||||
run new instance of **medit**. By default **medit** opens //FILES//
|
||||
(or creates a new document if none are given) in an existing instance
|
||||
of application
|
||||
|
||||
: **-s**, **--use-session**[=//yes|no//]
|
||||
load and save session. By default **medit** does it when **-n** is not used.
|
||||
If this option is not given on command line then medit uses the corresponding
|
||||
preferences setting.
|
||||
|
||||
: **--pid** //PID//
|
||||
use existing instance with process id //PID//.
|
||||
|
||||
: **--app-name** //NAME//
|
||||
use instance name //NAME//. If an instance with this name is already running,
|
||||
then it will send files given on the command line to that instance and exit.
|
||||
|
||||
: **-e**, **--encoding** //ENCODING//
|
||||
use provided character encoding to open the file
|
||||
|
||||
: **-l**, **--line** //LINE//
|
||||
open file and position cursor on line //LINE//. Alternatively
|
||||
line number may be specified with filename, e.g.
|
||||
medit foo.txt:12
|
||||
|
||||
: **-r**, **--reload**
|
||||
automatically reload opened file if it was modified on disk by another program.
|
||||
|
||||
: **-w**, **--new-window**
|
||||
open file in a new window.
|
||||
|
||||
: **-t**, **--new-tab**
|
||||
open file in a new tab.
|
||||
|
||||
: **--log-file** //FILE//
|
||||
write debug output into //FILE//. This option is only useful on Windows.
|
||||
|
||||
: **--log-window**
|
||||
show debug output in a log window. This option is only useful on Windows.
|
||||
|
||||
: **--debug** //DOMAINS//
|
||||
enable debug output for //DOMAINS// (if **medit** was compiled with
|
||||
--enable-debug option).
|
||||
|
||||
: **--exec** //STRING//
|
||||
execute python code in //STRING// in an existing instance.
|
||||
|
||||
: **--exec-file** //FILE//
|
||||
execute python file //FILE// in an existing instance.
|
||||
|
||||
: **-h**, **--help**
|
||||
show summary of options.
|
||||
|
||||
: **-v**, **--version**
|
||||
show program version.
|
||||
|
||||
: //FILES//
|
||||
list of files to open. Filenames may include line numbers after colon,
|
||||
e.g. /tmp/file.txt:200. Trailing colon is ignored.
|
||||
|
||||
|
||||
= ENVIRONMENT VARIABLES =
|
||||
|
||||
: MEDIT_PID
|
||||
if set, it is used as --pid argument. When medit spawns a process (e.g. a DVI viewer) it sets
|
||||
MEDIT_PID to its own process id, so the child process may in turn simply use 'medit filename'
|
||||
to open a file (e.g. for inverse DVI search).
|
||||
|
||||
|
||||
= CONTACT =
|
||||
|
||||
http://mooedit.sourceforge.net/contact.html
|
||||
|
||||
|
||||
= AUTHOR =
|
||||
|
||||
Written and maintained by Yevgen Muntyan <emuntyan@sourceforge.net>
|
||||
|
||||
|
||||
% = COPYRIGHT =
|
||||
%
|
||||
% 2004-2010 Yevgen Muntyan <emuntyan@sourceforge.net>
|
||||
%
|
||||
% medit is a free software.
|
|
@ -1,6 +1,6 @@
|
|||
MEDIT
|
||||
|
||||
March 2010
|
||||
August 2010
|
||||
|
||||
%!encoding: UTF-8
|
||||
|
||||
|
@ -102,6 +102,6 @@ Written and maintained by Yevgen Muntyan <@MOO_EMAIL@>
|
|||
|
||||
% = COPYRIGHT =
|
||||
%
|
||||
% Copyright (C) 2004-2008 Yevgen Muntyan <muntyan@tamu.edu>
|
||||
% @MOO_COPYRIGHT@
|
||||
%
|
||||
% medit is a free software.
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
.TH "MEDIT" 1 "August 2010" ""
|
||||
|
||||
.SH NAME
|
||||
.P
|
||||
medit \- text editor
|
||||
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
\fBmedit\fR [\fIOPTION\fR]... [\fIFILES\fR]
|
||||
|
||||
.SH DESCRIPTION
|
||||
.P
|
||||
\fBmedit\fR is a text editor.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-new\-app\fR
|
||||
run new instance of \fBmedit\fR. By default \fBmedit\fR opens \fIFILES\fR
|
||||
(or creates a new document if none are given) in an existing instance
|
||||
of application
|
||||
|
||||
.TP
|
||||
\fB\-s\fR, \fB\-\-use\-session\fR[=\fIyes|no\fR]
|
||||
load and save session. By default \fBmedit\fR does it when \fB\-n\fR is not used.
|
||||
If this option is not given on command line then medit uses the corresponding
|
||||
preferences setting.
|
||||
|
||||
.TP
|
||||
\fB\-\-pid\fR \fIPID\fR
|
||||
use existing instance with process id \fIPID\fR.
|
||||
|
||||
.TP
|
||||
\fB\-\-app\-name\fR \fINAME\fR
|
||||
use instance name \fINAME\fR. If an instance with this name is already running,
|
||||
then it will send files given on the command line to that instance and exit.
|
||||
|
||||
.TP
|
||||
\fB\-e\fR, \fB\-\-encoding\fR \fIENCODING\fR
|
||||
use provided character encoding to open the file
|
||||
|
||||
.TP
|
||||
\fB\-l\fR, \fB\-\-line\fR \fILINE\fR
|
||||
open file and position cursor on line \fILINE\fR. Alternatively
|
||||
line number may be specified with filename, e.g.
|
||||
medit foo.txt:12
|
||||
|
||||
.TP
|
||||
\fB\-r\fR, \fB\-\-reload\fR
|
||||
automatically reload opened file if it was modified on disk by another program.
|
||||
|
||||
.TP
|
||||
\fB\-w\fR, \fB\-\-new\-window\fR
|
||||
open file in a new window.
|
||||
|
||||
.TP
|
||||
\fB\-t\fR, \fB\-\-new\-tab\fR
|
||||
open file in a new tab.
|
||||
|
||||
.TP
|
||||
\fB\-\-log\-file\fR \fIFILE\fR
|
||||
write debug output into \fIFILE\fR. This option is only useful on Windows.
|
||||
|
||||
.TP
|
||||
\fB\-\-log\-window\fR
|
||||
show debug output in a log window. This option is only useful on Windows.
|
||||
|
||||
.TP
|
||||
\fB\-\-debug\fR \fIDOMAINS\fR
|
||||
enable debug output for \fIDOMAINS\fR (if \fBmedit\fR was compiled with
|
||||
\-\-enable\-debug option).
|
||||
|
||||
.TP
|
||||
\fB\-\-exec\fR \fISTRING\fR
|
||||
execute python code in \fISTRING\fR in an existing instance.
|
||||
|
||||
.TP
|
||||
\fB\-\-exec\-file\fR \fIFILE\fR
|
||||
execute python file \fIFILE\fR in an existing instance.
|
||||
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
show summary of options.
|
||||
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
show program version.
|
||||
|
||||
.TP
|
||||
\fIFILES\fR
|
||||
list of files to open. Filenames may include line numbers after colon,
|
||||
e.g. /tmp/file.txt:200. Trailing colon is ignored.
|
||||
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
MEDIT_PID
|
||||
if set, it is used as \-\-pid argument. When medit spawns a process (e.g. a DVI viewer) it sets
|
||||
MEDIT_PID to its own process id, so the child process may in turn simply use 'medit filename'
|
||||
to open a file (e.g. for inverse DVI search).
|
||||
|
||||
.SH CONTACT
|
||||
.P
|
||||
http://mooedit.sourceforge.net/contact.html
|
||||
|
||||
.SH AUTHOR
|
||||
.P
|
||||
Written and maintained by Yevgen Muntyan <emuntyan@sourceforge.net>
|
||||
|
||||
|
||||
.\" man code generated by txt2tags 2.5 (http://txt2tags.sf.net)
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
APPNAME APPVERSION Manual
|
||||
|
||||
|
||||
%! Target : html
|
||||
%! Encoding : UTF-8
|
||||
%! Options : --css-sugar
|
||||
%! Options(html): --mask-email
|
||||
|
||||
%% 'entities'
|
||||
%! Postproc: APPNAME medit
|
||||
%! Postproc: APPVERSION 0.99.0-unstable
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%
|
||||
%% Sections stuff
|
||||
%%
|
||||
%% Convert '== Title ==[anchor]' to '== !!ANCHOR!!anchor!!Title!! ==[anchor]'
|
||||
%! Preproc : '^(=+)\s*(.*)\s+\1\[(.*)\]' '\1 !!ANCHOR!!\3!!\2!! \1[\3]'
|
||||
%% Remove t2t-generated '<A NAME="anchor"></A>'
|
||||
%! Postproc: '<A NAME=".*"></A>' ''
|
||||
%% Convert '<H1>!!ANCHOR!!anchor!!Title!!</H1>' to '<H1><a name="anchor">Title</a></H1><!-- ##anchor## -->',
|
||||
%% ##anchor## is needed for makedocs to generate help-sections.h
|
||||
%! Postproc: '<(H\d)>!!ANCHOR!!(.*)!!(.*)!!</\1>' '<\1><a name="\2">\3</a></\1><!-- ##\2## -->'
|
||||
%% Convert remaining '!!ANCHOR!!anchor!!Title!!' to 'Title'
|
||||
%! Postproc: '!!ANCHOR!!(.*)!!(.*)!!' '\2'
|
||||
%%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%! Postproc: '@em\{(.*?)\}' '<em>\1</em>'
|
||||
%! Postproc: '@comment\{(.*?)\}' '<!-- \1 -->'
|
||||
|
||||
APPNAME APPVERSION Manual
|
||||
|
||||
%!include: prefs.t2t
|
||||
%!include: user-tools.t2t
|
||||
%!include: prefs-file.t2t
|
||||
%!include: regex.t2t
|
||||
%!include: license.t2t
|
||||
|
||||
|
||||
%% Fake help sections
|
||||
@comment{##fake-dialog-replace##}
|
||||
@comment{##fake-dialog-find##}
|
||||
@comment{##fake-prefs-dialog##}
|
||||
@comment{##fake-prefs-plugins##}
|
||||
@comment{##fake-prefs-accels##}
|
||||
@comment{##fake-prefs-file-selector##}
|
||||
@comment{##fake-dialog-find-in-files##}
|
||||
@comment{##fake-dialog-find-file##}
|
||||
@comment{##fake-file-selector##}
|
|
@ -8,7 +8,7 @@ APPNAME APPVERSION Manual
|
|||
|
||||
%% 'entities'
|
||||
%! Postproc: APPNAME medit
|
||||
%! Postproc: APPVERSION @MOO_VERSION@
|
||||
%! Postproc: APPVERSION @MOO_DISPLAY_VERSION@
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
completiondir = $(MOO_DATA_DIR)/completion
|
||||
completion_DATA = \
|
||||
files/gap.lst \
|
||||
files/latex.cfg
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(completion_DATA) \
|
||||
completion.glade \
|
||||
files/texinfo.cfg
|
||||
|
||||
completion_sources = \
|
||||
completion-glade.h \
|
||||
completion-plugin.c \
|
||||
completion.c \
|
||||
completion.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
completion-glade.h
|
||||
|
||||
completion-glade.h: completion.glade $(XML2H)
|
||||
$(SHELL) $(XML2H) COMPLETION_PLUGIN_GLADE_XML $(srcdir)/completion.glade > $@.tmp && \
|
||||
mv $@.tmp $@
|
||||
|
||||
noinst_LTLIBRARIES = libcompletion.la
|
||||
libcompletion_la_SOURCES = $(completion_sources)
|
||||
|
||||
AM_CFLAGS = \
|
||||
-I../../.. \
|
||||
-I$(top_builddir) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS)
|
|
@ -1,256 +0,0 @@
|
|||
/*
|
||||
* completion-plugin.c
|
||||
*
|
||||
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* See COPYING file that comes with this distribution.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include "completion.h"
|
||||
#include "completion-glade.h"
|
||||
#include "mooedit/mooplugin-macro.h"
|
||||
#include "mooedit/plugins/mooeditplugins.h"
|
||||
#include "mooedit/marshals.h"
|
||||
#include "mooutils/mooi18n.h"
|
||||
#include "mooutils/mooprefsdialogpage.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#define AUTO_COMPLETE_PREFS_KEY CMPL_PREFS_ROOT "/auto_complete"
|
||||
#define POPUP_INTERVAL_PREFS_KEY CMPL_PREFS_ROOT "/auto_complete_timeout"
|
||||
|
||||
|
||||
static gboolean cmpl_plugin_init (CmplPlugin *plugin);
|
||||
static void cmpl_plugin_deinit (CmplPlugin *plugin);
|
||||
|
||||
|
||||
static void
|
||||
focused_doc_changed (MooEditor *editor,
|
||||
G_GNUC_UNUSED gpointer whatever,
|
||||
CmplPlugin *plugin)
|
||||
{
|
||||
MooEdit *doc = NULL;
|
||||
|
||||
g_object_get (editor, "focused-doc", &doc, NULL);
|
||||
_cmpl_plugin_set_focused_doc (plugin, doc);
|
||||
|
||||
if (doc)
|
||||
g_object_unref (doc);
|
||||
}
|
||||
|
||||
static void
|
||||
set_auto_complete (CmplPlugin *plugin,
|
||||
gboolean auto_complete)
|
||||
{
|
||||
MooEditor *editor = moo_editor_instance ();
|
||||
|
||||
auto_complete = auto_complete != 0;
|
||||
|
||||
if (auto_complete == plugin->auto_complete)
|
||||
return;
|
||||
|
||||
plugin->auto_complete = auto_complete;
|
||||
|
||||
if (auto_complete)
|
||||
{
|
||||
g_signal_connect (editor, "notify::focused-doc",
|
||||
G_CALLBACK (focused_doc_changed),
|
||||
plugin);
|
||||
focused_doc_changed (editor, NULL, plugin);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (editor, (gpointer) focused_doc_changed, plugin);
|
||||
_cmpl_plugin_set_focused_doc (plugin, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
set_popup_interval (CmplPlugin *plugin,
|
||||
int interval)
|
||||
{
|
||||
if (interval <= 0)
|
||||
{
|
||||
g_warning ("%s: oops", G_STRLOC);
|
||||
interval = DEFAULT_POPUP_TIMEOUT;
|
||||
}
|
||||
|
||||
plugin->popup_interval = interval;
|
||||
}
|
||||
|
||||
static void
|
||||
prefs_notify (const char *key,
|
||||
const GValue *newval,
|
||||
CmplPlugin *plugin)
|
||||
{
|
||||
if (!strcmp (key, AUTO_COMPLETE_PREFS_KEY))
|
||||
set_auto_complete (plugin, g_value_get_boolean (newval));
|
||||
else if (!strcmp (key, POPUP_INTERVAL_PREFS_KEY))
|
||||
set_popup_interval (plugin, g_value_get_int (newval));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
completion_callback (MooEditWindow *window)
|
||||
{
|
||||
CmplPlugin *plugin;
|
||||
MooEdit *doc;
|
||||
|
||||
plugin = moo_plugin_lookup (CMPL_PLUGIN_ID);
|
||||
g_return_if_fail (plugin != NULL);
|
||||
|
||||
doc = moo_edit_window_get_active_doc (window);
|
||||
g_return_if_fail (doc != NULL);
|
||||
|
||||
_completion_complete (plugin, doc, FALSE);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
cmpl_plugin_init (CmplPlugin *plugin)
|
||||
{
|
||||
MooWindowClass *klass = g_type_class_ref (MOO_TYPE_EDIT_WINDOW);
|
||||
MooEditor *editor = moo_editor_instance ();
|
||||
MooUiXml *xml = moo_editor_get_ui_xml (editor);
|
||||
|
||||
g_return_val_if_fail (klass != NULL, FALSE);
|
||||
g_return_val_if_fail (editor != NULL, FALSE);
|
||||
|
||||
moo_window_class_new_action (klass, "CompleteWord", NULL,
|
||||
"display-name", _("Complete Word"),
|
||||
"label", _("Complete Word"),
|
||||
"tooltip", _("Complete Word"),
|
||||
"default-accel", MOO_EDIT_ACCEL_COMPLETE,
|
||||
"closure-callback", completion_callback,
|
||||
"condition::sensitive", "has-open-document",
|
||||
NULL);
|
||||
|
||||
if (xml)
|
||||
{
|
||||
plugin->ui_merge_id = moo_ui_xml_new_merge_id (xml);
|
||||
moo_ui_xml_add_item (xml, plugin->ui_merge_id,
|
||||
"Editor/Menubar/Edit",
|
||||
"CompleteWord", "CompleteWord", -1);
|
||||
}
|
||||
|
||||
plugin->cmpl_quark = g_quark_from_static_string ("moo-completion");
|
||||
_cmpl_plugin_load (plugin);
|
||||
|
||||
moo_prefs_new_key_bool (AUTO_COMPLETE_PREFS_KEY, FALSE);
|
||||
moo_prefs_new_key_int (POPUP_INTERVAL_PREFS_KEY, DEFAULT_POPUP_TIMEOUT);
|
||||
plugin->prefs_notify =
|
||||
moo_prefs_notify_connect (AUTO_COMPLETE_PREFS_KEY,
|
||||
MOO_PREFS_MATCH_PREFIX,
|
||||
(MooPrefsNotify) prefs_notify,
|
||||
plugin, NULL);
|
||||
set_auto_complete (plugin, moo_prefs_get_bool (AUTO_COMPLETE_PREFS_KEY));
|
||||
set_popup_interval (plugin, moo_prefs_get_int (POPUP_INTERVAL_PREFS_KEY));
|
||||
|
||||
g_type_class_unref (klass);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_plugin_deinit (CmplPlugin *plugin)
|
||||
{
|
||||
MooWindowClass *klass = g_type_class_ref (MOO_TYPE_EDIT_WINDOW);
|
||||
MooEditor *editor = moo_editor_instance ();
|
||||
MooUiXml *xml = moo_editor_get_ui_xml (editor);
|
||||
|
||||
_cmpl_plugin_clear (plugin);
|
||||
|
||||
moo_window_class_remove_action (klass, "CompleteWord");
|
||||
|
||||
if (plugin->ui_merge_id)
|
||||
moo_ui_xml_remove_ui (xml, plugin->ui_merge_id);
|
||||
plugin->ui_merge_id = 0;
|
||||
|
||||
moo_prefs_notify_disconnect (plugin->prefs_notify);
|
||||
plugin->prefs_notify = 0;
|
||||
set_auto_complete (plugin, FALSE);
|
||||
|
||||
g_type_class_unref (klass);
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
cmpl_plugin_prefs_page (G_GNUC_UNUSED CmplPlugin *plugin)
|
||||
{
|
||||
MooPrefsPage *page;
|
||||
MooGladeXML *xml;
|
||||
|
||||
xml = moo_glade_xml_new_empty (GETTEXT_PACKAGE);
|
||||
page = moo_prefs_dialog_page_new_from_xml (_("Completion"), NULL,
|
||||
xml, COMPLETION_PLUGIN_GLADE_XML,
|
||||
"page", CMPL_PREFS_ROOT);
|
||||
|
||||
g_object_unref (xml);
|
||||
return GTK_WIDGET (page);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_lang_completion_meth (CmplPlugin *plugin,
|
||||
const char *lang,
|
||||
MooTextCompletion *cmpl)
|
||||
{
|
||||
_cmpl_plugin_set_lang_completion (plugin, lang, cmpl);
|
||||
}
|
||||
|
||||
static void
|
||||
set_doc_completion_meth (CmplPlugin *plugin,
|
||||
MooEdit *doc,
|
||||
MooTextCompletion *cmpl)
|
||||
{
|
||||
_cmpl_plugin_set_doc_completion (plugin, doc, cmpl);
|
||||
}
|
||||
|
||||
|
||||
MOO_PLUGIN_DEFINE_INFO (cmpl,
|
||||
/* Completion plugin name */
|
||||
N_("Completion"),
|
||||
/* Completion plugin description */
|
||||
N_("Provides text completion"),
|
||||
"Yevgen Muntyan <muntyan@tamu.edu>",
|
||||
MOO_VERSION, NULL)
|
||||
MOO_PLUGIN_DEFINE_FULL (Cmpl, cmpl,
|
||||
cmpl_plugin_init, cmpl_plugin_deinit,
|
||||
NULL, NULL, NULL, NULL,
|
||||
cmpl_plugin_prefs_page, 0, 0)
|
||||
|
||||
|
||||
gboolean
|
||||
_moo_completion_plugin_init (void)
|
||||
{
|
||||
GType ptype = cmpl_plugin_get_type ();
|
||||
|
||||
if (!moo_plugin_register (CMPL_PLUGIN_ID,
|
||||
cmpl_plugin_get_type (),
|
||||
&cmpl_plugin_info,
|
||||
NULL))
|
||||
return FALSE;
|
||||
|
||||
moo_plugin_method_new ("set-lang-completion", ptype,
|
||||
G_CALLBACK (set_lang_completion_meth),
|
||||
_moo_marshal_VOID__STRING_OBJECT,
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_STRING,
|
||||
MOO_TYPE_TEXT_COMPLETION);
|
||||
|
||||
moo_plugin_method_new ("set-doc-completion", ptype,
|
||||
G_CALLBACK (set_doc_completion_meth),
|
||||
_moo_marshal_VOID__OBJECT_OBJECT,
|
||||
G_TYPE_NONE, 2,
|
||||
MOO_TYPE_EDIT,
|
||||
MOO_TYPE_TEXT_COMPLETION);
|
||||
|
||||
return TRUE;
|
||||
}
|
|
@ -1,709 +0,0 @@
|
|||
/*
|
||||
* completion.c
|
||||
*
|
||||
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* See COPYING file that comes with this distribution.
|
||||
*/
|
||||
|
||||
#include "completion.h"
|
||||
#include "mooedit/moocompletionsimple.h"
|
||||
#include "mooedit/mookeyfile.h"
|
||||
#include "mooutils/mooutils-misc.h"
|
||||
#include "mooutils/mooutils-fs.h"
|
||||
#include "mooutils/moopython.h"
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
typedef enum {
|
||||
DATA_FILE_SIMPLE,
|
||||
DATA_FILE_CONFIG,
|
||||
DATA_FILE_PYTHON
|
||||
} DataFileType;
|
||||
|
||||
#define DATA_FILE_INVALID ((DataFileType) -1)
|
||||
|
||||
typedef struct {
|
||||
char *path;
|
||||
DataFileType type;
|
||||
time_t mtime;
|
||||
MooTextCompletion *cmpl;
|
||||
} CmplData;
|
||||
|
||||
static CmplData *cmpl_data_new (void);
|
||||
static void cmpl_data_free (CmplData *data);
|
||||
static void cmpl_data_clear (CmplData *data);
|
||||
|
||||
static CmplData *cmpl_plugin_load_data (CmplPlugin *plugin,
|
||||
const char *id);
|
||||
|
||||
|
||||
static GList *
|
||||
parse_words (const char *string,
|
||||
const char *prefix,
|
||||
const char *path)
|
||||
{
|
||||
GList *list = NULL;
|
||||
char **words, **p;
|
||||
|
||||
g_return_val_if_fail (string != NULL, NULL);
|
||||
|
||||
words = g_strsplit_set (string, " \t\r\n", 0);
|
||||
|
||||
for (p = words; p && *p; ++p)
|
||||
{
|
||||
if (p[0][0] && p[0][1])
|
||||
{
|
||||
if (!g_utf8_validate (*p, -1, NULL))
|
||||
{
|
||||
g_critical ("%s: invalid utf8 in '%s'",
|
||||
G_STRLOC, path);
|
||||
}
|
||||
else if (prefix)
|
||||
{
|
||||
list = g_list_prepend (list, g_strdup_printf ("%s%s", prefix, *p));
|
||||
}
|
||||
else
|
||||
{
|
||||
list = g_list_prepend (list, *p);
|
||||
*p = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
g_free (*p);
|
||||
}
|
||||
|
||||
g_free (words);
|
||||
return g_list_reverse (list);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_data_read_simple_file (CmplData *data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GList *list;
|
||||
char *contents;
|
||||
|
||||
g_return_if_fail (data->cmpl == NULL);
|
||||
g_return_if_fail (data->path != NULL);
|
||||
|
||||
g_file_get_contents (data->path, &contents, NULL, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("%s: could not read file '%s': %s",
|
||||
G_STRLOC, data->path, error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
list = parse_words (contents, NULL, data->path);
|
||||
data->cmpl = moo_completion_simple_new_text (list);
|
||||
_moo_message ("read %d words from %s", g_list_length (list), data->path);
|
||||
|
||||
g_free (contents);
|
||||
}
|
||||
|
||||
|
||||
static guint *
|
||||
parse_numbers (const char *string,
|
||||
guint *n_numbers_p)
|
||||
{
|
||||
guint *numbers;
|
||||
guint n_numbers, i;
|
||||
char **pieces, **p;
|
||||
GSList *list = NULL;
|
||||
|
||||
g_return_val_if_fail (string != NULL, NULL);
|
||||
|
||||
pieces = g_strsplit_set (string, " \t,;:", 0);
|
||||
g_return_val_if_fail (pieces != NULL, NULL);
|
||||
|
||||
for (p = pieces; p && *p; ++p)
|
||||
{
|
||||
if (**p)
|
||||
{
|
||||
guint64 n64;
|
||||
guint n;
|
||||
|
||||
errno = 0;
|
||||
n64 = g_ascii_strtoull (*p, NULL, 10);
|
||||
|
||||
if (errno || n64 > 10000)
|
||||
{
|
||||
g_warning ("%s: could not parse number '%s'", G_STRLOC, *p);
|
||||
goto error;
|
||||
}
|
||||
|
||||
n = n64;
|
||||
list = g_slist_prepend (list, GUINT_TO_POINTER (n));
|
||||
}
|
||||
}
|
||||
|
||||
list = g_slist_reverse (list);
|
||||
n_numbers = g_slist_length (list);
|
||||
numbers = g_new (guint, n_numbers);
|
||||
|
||||
for (i = 0; i < n_numbers; ++i)
|
||||
{
|
||||
numbers[i] = GPOINTER_TO_UINT (list->data);
|
||||
list = g_slist_delete_link (list, list);
|
||||
}
|
||||
|
||||
if (n_numbers_p)
|
||||
*n_numbers_p = n_numbers;
|
||||
|
||||
g_strfreev (pieces);
|
||||
return numbers;
|
||||
|
||||
error:
|
||||
g_strfreev (pieces);
|
||||
g_slist_free (list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_data_read_config_file (CmplData *data)
|
||||
{
|
||||
MooKeyFile *key_file;
|
||||
guint i, n_items;
|
||||
MooCompletionGroup *group = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_if_fail (data->cmpl == NULL);
|
||||
g_return_if_fail (data->path != NULL);
|
||||
|
||||
data->cmpl = moo_completion_simple_new_text (NULL);
|
||||
|
||||
key_file = moo_key_file_new_from_file (data->path, &error);
|
||||
|
||||
if (!key_file)
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
n_items = moo_key_file_n_items (key_file);
|
||||
g_return_if_fail (n_items != 0);
|
||||
|
||||
for (i = 0; i < n_items; ++i)
|
||||
{
|
||||
MooKeyFileItem *item;
|
||||
const char *pattern, *prefix, *suffix, *script;
|
||||
const char *groups;
|
||||
guint *parens;
|
||||
guint n_parens;
|
||||
GList *words;
|
||||
|
||||
item = moo_key_file_nth_item (key_file, i);
|
||||
|
||||
pattern = moo_key_file_item_get (item, "pattern");
|
||||
prefix = moo_key_file_item_get (item, "prefix");
|
||||
suffix = moo_key_file_item_get (item, "insert-suffix");
|
||||
script = moo_key_file_item_get (item, "insert-script");
|
||||
|
||||
groups = moo_key_file_item_get (item, "group");
|
||||
groups = groups ? groups : moo_key_file_item_get (item, "groups");
|
||||
groups = groups ? groups : "0";
|
||||
|
||||
if (!pattern)
|
||||
{
|
||||
g_warning ("%s: pattern missing", G_STRLOC);
|
||||
continue;
|
||||
}
|
||||
|
||||
parens = parse_numbers (groups, &n_parens);
|
||||
|
||||
if (!parens)
|
||||
{
|
||||
g_warning ("%s: invalid group string '%s'", G_STRLOC, groups);
|
||||
continue;
|
||||
}
|
||||
|
||||
words = parse_words (moo_key_file_item_get_content (item),
|
||||
prefix, data->path);
|
||||
|
||||
if (!words)
|
||||
{
|
||||
g_warning ("%s: empty group", G_STRLOC);
|
||||
g_free (parens);
|
||||
continue;
|
||||
}
|
||||
|
||||
_moo_message ("read %d words for patttern '%s' from %s",
|
||||
g_list_length (words), pattern, data->path);
|
||||
|
||||
group = moo_completion_simple_new_group (MOO_COMPLETION_SIMPLE (data->cmpl), NULL);
|
||||
moo_completion_group_add_data (group, words);
|
||||
moo_completion_group_set_pattern (group, pattern, parens, n_parens);
|
||||
|
||||
if (script && script[0])
|
||||
moo_completion_group_set_script (group, script);
|
||||
else if (suffix && suffix[0])
|
||||
moo_completion_group_set_suffix (group, suffix);
|
||||
|
||||
g_free (parens);
|
||||
}
|
||||
|
||||
moo_key_file_unref (key_file);
|
||||
|
||||
if (!group)
|
||||
{
|
||||
g_warning ("%s: no completions", G_STRLOC);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_data_read_python_file (CmplData *data)
|
||||
{
|
||||
FILE *file;
|
||||
MooPyObject *dict = NULL;
|
||||
MooPyObject *res = NULL;
|
||||
MooPyObject *py_cmpl = NULL;
|
||||
MooCompletionSimple *cmpl;
|
||||
|
||||
g_return_if_fail (data->cmpl == NULL);
|
||||
g_return_if_fail (data->path != NULL);
|
||||
|
||||
if (!moo_python_running ())
|
||||
return;
|
||||
|
||||
file = _moo_fopen (data->path, "rb");
|
||||
g_return_if_fail (file != NULL);
|
||||
|
||||
dict = moo_python_create_script_dict ("__completion_module__");
|
||||
res = moo_python_run_file (file, data->path, dict, dict);
|
||||
|
||||
fclose (file);
|
||||
|
||||
if (!res)
|
||||
{
|
||||
g_message ("error executing file '%s'", data->path);
|
||||
moo_PyErr_Print ();
|
||||
goto out;
|
||||
}
|
||||
|
||||
py_cmpl = moo_py_dict_get_item (dict, "__completion__");
|
||||
|
||||
if (!py_cmpl)
|
||||
{
|
||||
g_message ("no '__completion__' variable in file '%s'", data->path);
|
||||
goto out;
|
||||
}
|
||||
|
||||
cmpl = moo_gobject_from_py_object (py_cmpl);
|
||||
|
||||
if (!MOO_IS_TEXT_COMPLETION (cmpl))
|
||||
{
|
||||
g_message ("'__completion__' variable in file '%s' is not of type MooTextCompletion", data->path);
|
||||
goto out;
|
||||
}
|
||||
|
||||
data->cmpl = g_object_ref (cmpl);
|
||||
|
||||
out:
|
||||
if (!data->cmpl)
|
||||
data->cmpl = moo_completion_simple_new_text (NULL);
|
||||
|
||||
moo_Py_DECREF (dict);
|
||||
moo_Py_DECREF (res);
|
||||
moo_Py_DECREF (py_cmpl);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_data_read_file (CmplData *data)
|
||||
{
|
||||
g_return_if_fail (data->path != NULL);
|
||||
g_return_if_fail (data->cmpl == NULL);
|
||||
|
||||
switch (data->type)
|
||||
{
|
||||
case DATA_FILE_SIMPLE:
|
||||
cmpl_data_read_simple_file (data);
|
||||
break;
|
||||
case DATA_FILE_CONFIG:
|
||||
cmpl_data_read_config_file (data);
|
||||
break;
|
||||
case DATA_FILE_PYTHON:
|
||||
cmpl_data_read_python_file (data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static CmplData *
|
||||
cmpl_plugin_load_data (CmplPlugin *plugin,
|
||||
const char *id)
|
||||
{
|
||||
CmplData *data;
|
||||
|
||||
g_return_val_if_fail (id != NULL, NULL);
|
||||
|
||||
data = g_hash_table_lookup (plugin->data, id);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
data = cmpl_data_new ();
|
||||
g_hash_table_insert (plugin->data, g_strdup (id), data);
|
||||
}
|
||||
else if (!data->cmpl && data->path)
|
||||
{
|
||||
cmpl_data_read_file (data);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
static CmplData *
|
||||
cmpl_data_new (void)
|
||||
{
|
||||
return g_new0 (CmplData, 1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_data_clear (CmplData *data)
|
||||
{
|
||||
g_free (data->path);
|
||||
if (data->cmpl)
|
||||
g_object_unref (data->cmpl);
|
||||
data->path = NULL;
|
||||
data->cmpl = NULL;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_data_free (CmplData *data)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
cmpl_data_clear (data);
|
||||
g_free (data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_cmpl_plugin_set_lang_completion (CmplPlugin *plugin,
|
||||
const char *lang,
|
||||
MooTextCompletion *cmpl)
|
||||
{
|
||||
CmplData *data;
|
||||
|
||||
g_return_if_fail (!cmpl || MOO_IS_TEXT_COMPLETION (cmpl));
|
||||
|
||||
if (!lang || !lang[0])
|
||||
lang = _moo_lang_id (NULL);
|
||||
|
||||
data = cmpl_data_new ();
|
||||
data->cmpl = g_object_ref (cmpl);
|
||||
g_hash_table_insert (plugin->data, g_strdup (lang), data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_cmpl_plugin_set_doc_completion (CmplPlugin *plugin,
|
||||
MooEdit *doc,
|
||||
MooTextCompletion *cmpl)
|
||||
{
|
||||
g_return_if_fail (MOO_IS_EDIT (doc));
|
||||
g_return_if_fail (!cmpl || MOO_IS_TEXT_COMPLETION (cmpl));
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (doc),
|
||||
plugin->cmpl_quark,
|
||||
g_object_ref (cmpl),
|
||||
g_object_unref);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_plugin_check_file (CmplPlugin *plugin,
|
||||
const char *path,
|
||||
DataFileType type,
|
||||
const char *id)
|
||||
{
|
||||
struct stat buf;
|
||||
CmplData *data;
|
||||
|
||||
/* TODO: filename encoding */
|
||||
|
||||
if (stat (path, &buf) == -1)
|
||||
{
|
||||
int err_no = errno;
|
||||
g_warning ("%s: could not stat file '%s': %s",
|
||||
G_STRLOC, path, g_strerror (err_no));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!S_ISREG (buf.st_mode))
|
||||
{
|
||||
g_warning ("%s: '%s' is not a regular file",
|
||||
G_STRLOC, path);
|
||||
return;
|
||||
}
|
||||
|
||||
data = g_hash_table_lookup (plugin->data, id);
|
||||
|
||||
if (data)
|
||||
{
|
||||
if (data->path && !strcmp (data->path, path) && data->mtime == buf.st_mtime)
|
||||
return;
|
||||
|
||||
cmpl_data_clear (data);
|
||||
}
|
||||
else
|
||||
{
|
||||
data = cmpl_data_new ();
|
||||
g_hash_table_insert (plugin->data, g_strdup (id), data);
|
||||
}
|
||||
|
||||
data->path = g_strdup (path);
|
||||
data->type = type;
|
||||
data->mtime = buf.st_mtime;
|
||||
_moo_message ("found file '%s' for lang '%s'", path, id);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cmpl_plugin_load_dir (CmplPlugin *plugin,
|
||||
const char *path)
|
||||
{
|
||||
GDir *dir;
|
||||
const char *base;
|
||||
|
||||
if (!(dir = g_dir_open (path, 0, NULL)))
|
||||
return;
|
||||
|
||||
while ((base = g_dir_read_name (dir)))
|
||||
{
|
||||
guint i, len;
|
||||
char *file, *name, *id;
|
||||
DataFileType type = DATA_FILE_INVALID;
|
||||
|
||||
const char *suffixes[] = {
|
||||
CMPL_FILE_SUFFIX_LIST,
|
||||
CMPL_FILE_SUFFIX_CONFIG,
|
||||
CMPL_FILE_SUFFIX_PYTHON
|
||||
};
|
||||
DataFileType types[] = {
|
||||
DATA_FILE_SIMPLE,
|
||||
DATA_FILE_CONFIG,
|
||||
DATA_FILE_PYTHON
|
||||
};
|
||||
|
||||
name = g_ascii_strdown (base, -1);
|
||||
len = strlen (name);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (suffixes); ++i)
|
||||
{
|
||||
if (g_str_has_suffix (base, suffixes[i]))
|
||||
{
|
||||
name[len - strlen (suffixes[i])] = 0;
|
||||
|
||||
if (name[0])
|
||||
type = types[i];
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == DATA_FILE_INVALID)
|
||||
continue;
|
||||
|
||||
id = _moo_lang_id_from_name (name);
|
||||
file = g_build_filename (path, base, NULL);
|
||||
|
||||
cmpl_plugin_check_file (plugin, file, type, id);
|
||||
|
||||
g_free (name);
|
||||
g_free (id);
|
||||
g_free (file);
|
||||
}
|
||||
|
||||
g_dir_close (dir);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_cmpl_plugin_load (CmplPlugin *plugin)
|
||||
{
|
||||
char **dirs;
|
||||
guint n_dirs, i;
|
||||
|
||||
plugin->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||
(GDestroyNotify) cmpl_data_free);
|
||||
|
||||
dirs = _moo_strv_reverse (moo_get_data_subdirs (CMPL_DIR, MOO_DATA_SHARE, &n_dirs));
|
||||
|
||||
for (i = 0; i < n_dirs; ++i)
|
||||
cmpl_plugin_load_dir (plugin, dirs[i]);
|
||||
|
||||
g_strfreev (dirs);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_cmpl_plugin_clear (CmplPlugin *plugin)
|
||||
{
|
||||
g_hash_table_destroy (plugin->data);
|
||||
plugin->data = NULL;
|
||||
}
|
||||
|
||||
|
||||
static MooTextCompletion *
|
||||
get_doc_completion (CmplPlugin *plugin,
|
||||
MooEdit *doc)
|
||||
{
|
||||
MooTextCompletion *cmpl = NULL;
|
||||
|
||||
cmpl = g_object_get_qdata (G_OBJECT (doc), plugin->cmpl_quark);
|
||||
|
||||
if (!cmpl)
|
||||
{
|
||||
MooLang *lang;
|
||||
CmplData *data;
|
||||
|
||||
lang = moo_text_view_get_lang (MOO_TEXT_VIEW (doc));
|
||||
|
||||
data = cmpl_plugin_load_data (plugin, _moo_lang_id (lang));
|
||||
g_return_val_if_fail (data != NULL, NULL);
|
||||
|
||||
cmpl = data->cmpl;
|
||||
}
|
||||
|
||||
return cmpl;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
completion_finished (MooTextCompletion *cmpl,
|
||||
CmplPlugin *plugin)
|
||||
{
|
||||
plugin->working = FALSE;
|
||||
g_signal_handlers_disconnect_by_func (cmpl, (gpointer) completion_finished, plugin);
|
||||
}
|
||||
|
||||
void
|
||||
_completion_complete (CmplPlugin *plugin,
|
||||
MooEdit *doc,
|
||||
gboolean automatic)
|
||||
{
|
||||
MooTextCompletion *cmpl;
|
||||
|
||||
g_return_if_fail (!plugin->working);
|
||||
g_return_if_fail (MOO_IS_EDIT (doc));
|
||||
|
||||
cmpl = get_doc_completion (plugin, doc);
|
||||
|
||||
if (cmpl)
|
||||
{
|
||||
plugin->working = TRUE;
|
||||
moo_text_completion_set_doc (cmpl, GTK_TEXT_VIEW (doc));
|
||||
g_signal_connect (cmpl, "finish", G_CALLBACK (completion_finished), plugin);
|
||||
moo_text_completion_try_complete (cmpl, automatic);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
popup_timeout (CmplPlugin *plugin)
|
||||
{
|
||||
plugin->popup_timeout = 0;
|
||||
|
||||
if (!plugin->working)
|
||||
_completion_complete (plugin, plugin->focused_doc, TRUE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
remove_popup_timeout (CmplPlugin *plugin)
|
||||
{
|
||||
if (plugin->popup_timeout)
|
||||
g_source_remove (plugin->popup_timeout);
|
||||
plugin->popup_timeout = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
reinstall_popup_timeout (CmplPlugin *plugin)
|
||||
{
|
||||
remove_popup_timeout (plugin);
|
||||
|
||||
if (!plugin->working)
|
||||
{
|
||||
if (!plugin->popup_timeout)
|
||||
plugin->popup_timeout =
|
||||
_moo_timeout_add (plugin->popup_interval, (GSourceFunc) popup_timeout, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
doc_key_press (CmplPlugin *plugin)
|
||||
{
|
||||
remove_popup_timeout (plugin);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
doc_char_inserted (CmplPlugin *plugin)
|
||||
{
|
||||
reinstall_popup_timeout (plugin);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
connect_doc (CmplPlugin *plugin,
|
||||
MooEdit *doc)
|
||||
{
|
||||
g_signal_connect_swapped (doc, "key-press-event",
|
||||
G_CALLBACK (doc_key_press),
|
||||
plugin);
|
||||
g_signal_connect_swapped (doc, "char-inserted",
|
||||
G_CALLBACK (doc_char_inserted),
|
||||
plugin);
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect_doc (CmplPlugin *plugin,
|
||||
MooEdit *doc)
|
||||
{
|
||||
remove_popup_timeout (plugin);
|
||||
g_signal_handlers_disconnect_by_func (doc, (gpointer) doc_key_press, plugin);
|
||||
g_signal_handlers_disconnect_by_func (doc, (gpointer) doc_char_inserted, plugin);
|
||||
}
|
||||
|
||||
void
|
||||
_cmpl_plugin_set_focused_doc (CmplPlugin *plugin,
|
||||
MooEdit *doc)
|
||||
{
|
||||
if (plugin->focused_doc == doc)
|
||||
return;
|
||||
|
||||
if (plugin->focused_doc)
|
||||
{
|
||||
disconnect_doc (plugin, plugin->focused_doc);
|
||||
plugin->focused_doc = NULL;
|
||||
}
|
||||
|
||||
if (doc)
|
||||
{
|
||||
plugin->focused_doc = doc;
|
||||
connect_doc (plugin, doc);
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!-- Generated with glade3
|
||||
Version: 3.0.0
|
||||
Date: Thu Dec 7 00:28:09 2006
|
||||
User: muntyan
|
||||
Host: munt10
|
||||
-->
|
||||
<glade-interface>
|
||||
<widget class="GtkWindow" id="window1">
|
||||
<child>
|
||||
<widget class="GtkVBox" id="page">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Enable autocompletion</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="moo_prefs_key">auto_complete</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">3</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes" comments="Autocompletion timeout, in milliseconds">Autocompletion timeout, ms:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSpinButton" id="spinbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="adjustment">0 0 10000 1 10 0</property>
|
||||
<property name="numeric">True</property>
|
||||
<property name="moo_prefs_key">auto_complete_timeout</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
* completion.h
|
||||
*
|
||||
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* See COPYING file that comes with this distribution.
|
||||
*/
|
||||
|
||||
#include "mooedit/mooplugin.h"
|
||||
#include "mooedit/mootextcompletion.h"
|
||||
|
||||
#ifndef __COMPLETION_H__
|
||||
#define __COMPLETION_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define CMPL_PLUGIN_ID "Completion"
|
||||
#define CMPL_PREFS_ROOT MOO_PLUGIN_PREFS_ROOT "/" CMPL_PLUGIN_ID
|
||||
#define CMPL_DIR "completion"
|
||||
|
||||
#define CMPL_FILE_SUFFIX_LIST ".lst"
|
||||
#define CMPL_FILE_SUFFIX_CONFIG ".cfg"
|
||||
#define CMPL_FILE_SUFFIX_PYTHON ".py"
|
||||
|
||||
#define DEFAULT_POPUP_TIMEOUT 100
|
||||
|
||||
#define _completion_complete _moo_completion_plugin_complete
|
||||
#define _cmpl_plugin_load _moo_completion_plugin_load
|
||||
#define _cmpl_plugin_clear _moo_completion_plugin_clear
|
||||
#define _cmpl_plugin_set_lang_completion _moo_completion_plugin_set_lang_completion
|
||||
#define _cmpl_plugin_set_doc_completion _moo_completion_plugin_set_doc_completion
|
||||
#define _cmpl_plugin_set_focused_doc _moo_completion_plugin_set_focused_doc
|
||||
#define _cmpl_plugin_set_auto_complete _moo_completion_plugin_set_auto_complete
|
||||
|
||||
|
||||
typedef struct {
|
||||
MooPlugin parent;
|
||||
guint ui_merge_id;
|
||||
GQuark cmpl_quark;
|
||||
GHashTable *data; /* char* -> CompletionData* */
|
||||
|
||||
guint prefs_notify;
|
||||
gboolean auto_complete;
|
||||
MooEdit *focused_doc;
|
||||
guint popup_timeout;
|
||||
int popup_interval;
|
||||
gboolean working;
|
||||
} CmplPlugin;
|
||||
|
||||
|
||||
void _completion_complete (CmplPlugin *plugin,
|
||||
MooEdit *doc,
|
||||
gboolean automatic);
|
||||
|
||||
void _cmpl_plugin_load (CmplPlugin *plugin);
|
||||
void _cmpl_plugin_clear (CmplPlugin *plugin);
|
||||
|
||||
void _cmpl_plugin_set_focused_doc (CmplPlugin *plugin,
|
||||
MooEdit *doc);
|
||||
|
||||
void _cmpl_plugin_set_lang_completion (CmplPlugin *plugin,
|
||||
const char *lang,
|
||||
MooTextCompletion *cmpl);
|
||||
void _cmpl_plugin_set_doc_completion (CmplPlugin *plugin,
|
||||
MooEdit *doc,
|
||||
MooTextCompletion *cmpl);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COMPLETION_H__ */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,44 +0,0 @@
|
|||
[entry]
|
||||
pattern = \\documentclass{(\w*)
|
||||
insert-suffix = }
|
||||
group = 1
|
||||
article report letter book slides
|
||||
|
||||
[entry]
|
||||
pattern = \\(begin|end){(\w*)
|
||||
group = 2
|
||||
insert-suffix = }
|
||||
array center description document enumerate eqnarray equation figure
|
||||
flushleft flushright itemize letter list minipage picture quotation
|
||||
quote table tabular thebibliography theorem titlepage verbatim verse
|
||||
|
||||
[entry]
|
||||
pattern = \\\w*
|
||||
prefix = \
|
||||
addtocounter alph arabic fnsymbol newcounter refstepcounter roman
|
||||
stepcounter setcounter usecounter value label pageref ref newcommand
|
||||
newenvironment newtheorem newfont footnote footnotemark footnotetext
|
||||
flushbottom onecolumn raggedbottom twocolumn newlength setlength
|
||||
addtolength settodepth settoheight settowidth cleardoublepage
|
||||
clearpage enlargethispage fussy hyphenation linebreak newline newpage
|
||||
nolinebreak nopagebreak pagebreak sloppy indent noindent par cdots
|
||||
ddots frac ldots overbrace overline sqrt underbrace underline vdots
|
||||
maketitle author date thanks title pagenumbering pagestyle markboth
|
||||
markright thispagestyle dotfill hfill hrulefill hspace
|
||||
addvspace bigskip medskip smallskip vfill vspace fbox framebox makebox
|
||||
mbox newsavebox parbox raisebox rule savebox sbox usebox part chapter
|
||||
section subsection subsubsection paragraph subparagraph include includeonly
|
||||
input addcontentsline addtocontents typein typeout textrm textit emph
|
||||
textmd textbf textup textsl textsf textsc texttt textnormal mathrm mathbf
|
||||
mathsf mathtt mathit mathnormal mathcal tiny scriptsize footnotesize
|
||||
small normalsize large Large LARGE huge Huge
|
||||
alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu
|
||||
xi omicron pi rho sigma tau upsilon phi varphi chi psi omega
|
||||
Alpha Beta Gamma Delta Epsilon Zeta Eta Theta Iota Kappa Lambda Mu Nu
|
||||
Xi Omicron Pi Rho Sigma Tau Upsilon Phi Chi Psi Omega
|
||||
|
||||
[entry]
|
||||
pattern = \\\w*
|
||||
prefix = \
|
||||
insert-script = Insert(completion, "{}"); Left();
|
||||
begin end documentclass
|
|
@ -1,243 +0,0 @@
|
|||
pattern: @.*
|
||||
prefix: @
|
||||
insert-script: Insert(completion, "{}"); Left();
|
||||
code
|
||||
|
||||
pattern: @.*
|
||||
prefix: @
|
||||
xref
|
||||
WHITESPACE
|
||||
w
|
||||
vtable
|
||||
vskip
|
||||
vindex
|
||||
var
|
||||
value
|
||||
v
|
||||
url
|
||||
uref
|
||||
unnumberedsubsubsec
|
||||
unnumberedsubsec
|
||||
unnumberedsec
|
||||
unnumbered
|
||||
udotaccent
|
||||
ubaraccent
|
||||
u
|
||||
top
|
||||
today{}
|
||||
titlepage
|
||||
titlefont
|
||||
title
|
||||
tindex
|
||||
tieaccent
|
||||
thistitle
|
||||
thispage
|
||||
thisfile
|
||||
thischaptername
|
||||
thischapter
|
||||
TeX{}
|
||||
tex
|
||||
table
|
||||
tab
|
||||
t
|
||||
synindex
|
||||
syncodeindex
|
||||
summarycontents
|
||||
subtitle
|
||||
subsubsection
|
||||
subsubheading
|
||||
subsection
|
||||
subheading
|
||||
strong
|
||||
ss{}
|
||||
sp
|
||||
smalllisp
|
||||
smallexample
|
||||
smallbook
|
||||
shorttitlepage
|
||||
shortcontents
|
||||
settitle
|
||||
setfilename
|
||||
setchapternewpage
|
||||
set
|
||||
section
|
||||
sc
|
||||
samp
|
||||
ringaccent
|
||||
result{}
|
||||
registeredsymbol{}
|
||||
refill
|
||||
ref
|
||||
raisesections
|
||||
r
|
||||
quotation
|
||||
questiondown{}
|
||||
pxref
|
||||
printindex
|
||||
print{}
|
||||
pounds{}
|
||||
point{}
|
||||
pindex
|
||||
paragraphindent
|
||||
page
|
||||
OE{}
|
||||
oe{}
|
||||
oddheading
|
||||
oddfooting
|
||||
O{}
|
||||
o{}
|
||||
noindent
|
||||
node
|
||||
need
|
||||
multitable
|
||||
minus{}
|
||||
menu
|
||||
math
|
||||
majorheading
|
||||
macro
|
||||
lowersections
|
||||
lisp
|
||||
L{}
|
||||
l{}
|
||||
kindex
|
||||
key
|
||||
kbdinputstyle
|
||||
kbd
|
||||
itemx
|
||||
itemize
|
||||
item
|
||||
insertcopying
|
||||
inforef
|
||||
include
|
||||
image
|
||||
ignore
|
||||
iftex
|
||||
ifset
|
||||
ifnottex
|
||||
ifnotinfo
|
||||
ifnothtml
|
||||
ifinfo
|
||||
ifhtml
|
||||
ifclear
|
||||
i
|
||||
hyphenation
|
||||
html
|
||||
headings
|
||||
heading
|
||||
H
|
||||
group
|
||||
ftable
|
||||
format
|
||||
footnotestyle
|
||||
footnote
|
||||
flushright
|
||||
flushleft
|
||||
findex
|
||||
finalout
|
||||
file
|
||||
expansion{}
|
||||
exdent
|
||||
exclamdown{}
|
||||
example
|
||||
everyheading
|
||||
everyfooting
|
||||
evenheading
|
||||
evenfooting
|
||||
error{}
|
||||
equiv{}
|
||||
enumerate
|
||||
end
|
||||
enddots{}
|
||||
emph
|
||||
email
|
||||
dots{}
|
||||
dotaccent
|
||||
dmn
|
||||
display
|
||||
direntry
|
||||
dircategory
|
||||
dfn
|
||||
detailmenu{}
|
||||
defvarx
|
||||
defvar
|
||||
defunx
|
||||
defun
|
||||
deftypevrx
|
||||
deftypevr
|
||||
deftypevarx
|
||||
deftypevar
|
||||
deftypemethodx
|
||||
deftypemethod
|
||||
deftypefunx
|
||||
deftypefun
|
||||
deftypefnx
|
||||
deftypefn
|
||||
deftpx
|
||||
deftp
|
||||
defspecx
|
||||
defspec
|
||||
defopx
|
||||
defoptx
|
||||
defopt
|
||||
defop
|
||||
defmethodx
|
||||
defmethod
|
||||
defmacx
|
||||
defmac
|
||||
defivarx
|
||||
defivar
|
||||
definfoenclose
|
||||
defindex
|
||||
deffnx
|
||||
deffn
|
||||
defcvx
|
||||
defcv
|
||||
defcodeindex
|
||||
copyright{}
|
||||
contents
|
||||
comment
|
||||
clear
|
||||
cite
|
||||
cindex
|
||||
chapter
|
||||
chapheading
|
||||
centerchap
|
||||
center
|
||||
cartouche
|
||||
bye
|
||||
bullet{}
|
||||
b
|
||||
author
|
||||
asis
|
||||
appendixsubsubsec
|
||||
appendixsubsec
|
||||
appendixsection
|
||||
appendixsec
|
||||
appendix
|
||||
afourpaper
|
||||
AE{}
|
||||
ae{}
|
||||
AA{}
|
||||
aa{}
|
||||
*
|
||||
{
|
||||
.
|
||||
?
|
||||
^
|
||||
}
|
||||
"
|
||||
'
|
||||
!
|
||||
:
|
||||
,
|
||||
-
|
||||
=
|
||||
=
|
||||
`
|
||||
|
||||
pattern: @end
|
||||
insert-script: Insert(" ", completion);
|
||||
vtable titlepage tex table smalllisp smallexample quotation multitable
|
||||
menu lisp itemize ignore iftex ifset ifnottex ifnotinfo ifnothtml ifinfo
|
||||
ifhtml ifclear html group ftable format flushright flushleft example
|
||||
enumerate direntry cartouche
|
|
@ -0,0 +1,366 @@
|
|||
# _MOO_AC_CHECK_COMPILER_OPTIONS(options)
|
||||
AC_DEFUN([_MOO_AC_CHECK_COMPILER_OPTIONS],[
|
||||
AC_LANG_PUSH([C])
|
||||
for opt in $1; do
|
||||
AC_MSG_CHECKING(whether compiler accepts $opt)
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $opt"
|
||||
AC_TRY_COMPILE([],[],[MOO_CFLAGS="$MOO_CFLAGS $opt"; MOO_CXXFLAGS="$MOO_CXXFLAGS $opt"; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
done
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
|
||||
AC_DEFUN([_MOO_AC_CHECK_C_COMPILER_OPTIONS],[
|
||||
AC_LANG_PUSH([C])
|
||||
for opt in $1; do
|
||||
AC_MSG_CHECKING(whether C compiler accepts $opt)
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $opt"
|
||||
AC_TRY_COMPILE([],[],[MOO_CFLAGS="$MOO_CFLAGS $opt"; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
done
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
|
||||
AC_DEFUN([_MOO_AC_CHECK_CXX_COMPILER_OPTIONS],[
|
||||
AC_LANG_PUSH([C++])
|
||||
for opt in $1; do
|
||||
AC_MSG_CHECKING(whether C++ compiler accepts $opt)
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $opt"
|
||||
AC_TRY_COMPILE([],[],[MOO_CXXFLAGS="$MOO_CXXFLAGS $opt"; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
done
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
|
||||
AC_DEFUN([MOO_COMPILER],[
|
||||
# icc pretends to be gcc or configure thinks it's gcc, but icc doesn't
|
||||
# error on unknown options, so just don't try gcc options with icc
|
||||
MOO_ICC=false
|
||||
MOO_GCC=false
|
||||
if test "$CC" = "icc"; then
|
||||
MOO_ICC=true
|
||||
elif test "x$GCC" = "xyes"; then
|
||||
MOO_GCC=true
|
||||
fi
|
||||
])
|
||||
|
||||
##############################################################################
|
||||
# MOO_AC_DEBUG()
|
||||
#
|
||||
AC_DEFUN_ONCE([MOO_AC_DEBUG],[
|
||||
|
||||
MOO_DEBUG_ENABLED="no"
|
||||
|
||||
AC_ARG_ENABLE(tests,
|
||||
AC_HELP_STRING([--enable-tests],[build test programs (default = NO)]),[
|
||||
if test "x$enable_tests" = "xno"; then
|
||||
MOO_ENABLE_TESTS="no"
|
||||
else
|
||||
MOO_ENABLE_TESTS="yes"
|
||||
fi
|
||||
],[
|
||||
MOO_ENABLE_TESTS="no"
|
||||
])
|
||||
AM_CONDITIONAL(MOO_ENABLE_TESTS, test x$MOO_ENABLE_TESTS = "xyes")
|
||||
|
||||
AC_ARG_ENABLE(unit-tests,
|
||||
AC_HELP_STRING([--enable-unit-tests],[build unit tests (default = NO)]),[
|
||||
if test "x$enable_unit_tests" = "xno"; then
|
||||
MOO_ENABLE_UNIT_TESTS="no"
|
||||
else
|
||||
MOO_ENABLE_UNIT_TESTS="yes"
|
||||
fi
|
||||
],[
|
||||
MOO_ENABLE_UNIT_TESTS="no"
|
||||
])
|
||||
AM_CONDITIONAL(MOO_ENABLE_UNIT_TESTS, test x$MOO_ENABLE_UNIT_TESTS = "xyes")
|
||||
if test "x$MOO_ENABLE_UNIT_TESTS" = "xyes"; then
|
||||
AC_DEFINE(MOO_ENABLE_UNIT_TESTS, 1, [Enable unit tests])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[enable debug options (default = NO)]),[
|
||||
if test "x$enable_debug" = "xno"; then
|
||||
MOO_DEBUG_ENABLED="no"
|
||||
else
|
||||
MOO_DEBUG_ENABLED="yes"
|
||||
fi
|
||||
],[
|
||||
MOO_DEBUG_ENABLED="no"
|
||||
])
|
||||
AM_CONDITIONAL(MOO_DEBUG_ENABLED, test x$MOO_DEBUG_ENABLED = "xyes")
|
||||
|
||||
AC_ARG_ENABLE(dev-mode,
|
||||
AC_HELP_STRING([--enable-dev-mode],[dev-mode (default = NO, unless --enable-debug is used)]),[
|
||||
if test "x$enable_dev_mode" = "xno"; then
|
||||
MOO_DEV_MODE="no"
|
||||
else
|
||||
MOO_DEV_MODE="yes"
|
||||
fi
|
||||
],[
|
||||
MOO_DEV_MODE="$MOO_DEBUG_ENABLED"
|
||||
])
|
||||
AM_CONDITIONAL(MOO_DEV_MODE, test x$MOO_DEV_MODE = "xyes")
|
||||
|
||||
MOO_COMPILER
|
||||
|
||||
_MOO_AC_CHECK_COMPILER_OPTIONS([dnl
|
||||
-Wall -Wextra -fexceptions -fno-strict-aliasing -fno-strict-overflow dnl
|
||||
-Wno-missing-field-initializers -Wno-overlength-strings -Wno-missing-declarations dnl
|
||||
-Wno-format-y2k -Wno-overlength-strings dnl
|
||||
])
|
||||
_MOO_AC_CHECK_C_COMPILER_OPTIONS([dnl
|
||||
dnl
|
||||
])
|
||||
_MOO_AC_CHECK_CXX_COMPILER_OPTIONS([dnl
|
||||
-std=c++98 -fno-rtti dnl
|
||||
])
|
||||
|
||||
if test "x$MOO_DEBUG_ENABLED" = "xyes"; then
|
||||
_MOO_AC_CHECK_COMPILER_OPTIONS([-ftrapv])
|
||||
else
|
||||
_MOO_AC_CHECK_CXX_COMPILER_OPTIONS([-fno-enforce-eh-specs])
|
||||
fi
|
||||
|
||||
if test "x$MOO_DEV_MODE" = "xyes"; then
|
||||
_MOO_AC_CHECK_COMPILER_OPTIONS([dnl
|
||||
-Werror -Wpointer-arith -Wcast-align -Wsign-compare -Wreturn-type dnl
|
||||
-Wwrite-strings -Wmissing-declarations -Wmissing-format-attribute dnl
|
||||
-Wdisabled-optimization -Wendif-labels -Wlong-long dnl
|
||||
-Wvla -Wuninitialized -Winit-self dnl
|
||||
])
|
||||
# -Wlogical-op triggers warning in strchr() when compiled with optimizations
|
||||
if test "x$MOO_DEBUG_ENABLED" = "xyes"; then
|
||||
_MOO_AC_CHECK_COMPILER_OPTIONS([-Wlogical-op])
|
||||
fi
|
||||
_MOO_AC_CHECK_C_COMPILER_OPTIONS([dnl
|
||||
-Wmissing-prototypes -Wnested-externs dnl
|
||||
])
|
||||
_MOO_AC_CHECK_CXX_COMPILER_OPTIONS([dnl
|
||||
-fno-nonansi-builtins -fno-gnu-keywords dnl
|
||||
-Wctor-dtor-privacy -Wnon-virtual-dtor -Wabi -Wstrict-null-sentinel dnl
|
||||
-Woverloaded-virtual -Wsign-promo dnl
|
||||
])
|
||||
fi
|
||||
|
||||
# m4_foreach([wname],[unused, sign-compare, write-strings],[dnl
|
||||
# m4_define([_moo_WNAME],[MOO_W_NO_[]m4_bpatsubst(m4_toupper(wname),-,_)])
|
||||
# _moo_WNAME=
|
||||
# _MOO_AC_CHECK_COMPILER_OPTIONS(_moo_WNAME,[-Wno-wname])
|
||||
# AC_SUBST(_moo_WNAME)
|
||||
# m4_undefine([_moo_WNAME])
|
||||
# ])
|
||||
|
||||
if test "x$MOO_DEBUG_ENABLED" = "xyes"; then
|
||||
MOO_CPPFLAGS="$MOO_CPPFLAGS -DENABLE_DEBUG -DENABLE_PROFILE -DG_ENABLE_DEBUG dnl
|
||||
-DG_ENABLE_PROFILE -DMOO_DEBUG -DDEBUG"
|
||||
else
|
||||
MOO_CPPFLAGS="$MOO_CPPFLAGS -DNDEBUG=1 -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
|
||||
fi
|
||||
|
||||
if test "x$MOO_ENABLE_TESTS" = "xyes"; then
|
||||
MOO_CPPFLAGS="$MOO_CPPFLAGS -DMOO_ENABLE_TESTS"
|
||||
fi
|
||||
])
|
||||
|
||||
##############################################################################
|
||||
# MOO_AC_SET_DIRS
|
||||
#
|
||||
AC_DEFUN_ONCE([MOO_AC_SET_DIRS],[
|
||||
if test "x$MOO_PACKAGE_NAME" = x; then
|
||||
MOO_PACKAGE_NAME=moo
|
||||
fi
|
||||
|
||||
AC_SUBST(MOO_PACKAGE_NAME)
|
||||
AC_DEFINE_UNQUOTED([MOO_PACKAGE_NAME], "$MOO_PACKAGE_NAME", [package name])
|
||||
|
||||
MOO_DATA_DIR="${datadir}/$MOO_PACKAGE_NAME"
|
||||
AC_SUBST(MOO_DATA_DIR)
|
||||
|
||||
MOO_LIB_DIR="${libdir}/$MOO_PACKAGE_NAME"
|
||||
AC_SUBST(MOO_LIB_DIR)
|
||||
|
||||
MOO_PLUGINS_DIR="${MOO_LIB_DIR}/plugins"
|
||||
AC_SUBST(MOO_PLUGINS_DIR)
|
||||
|
||||
MOO_DOC_DIR="${datadir}/doc/medit"
|
||||
AC_SUBST(MOO_DOC_DIR)
|
||||
MOO_HELP_DIR="${MOO_DOC_DIR}/help"
|
||||
AC_SUBST(MOO_HELP_DIR)
|
||||
|
||||
MOO_TEXT_LANG_FILES_DIR="${MOO_DATA_DIR}/language-specs"
|
||||
AC_SUBST(MOO_TEXT_LANG_FILES_DIR)
|
||||
])
|
||||
|
||||
##############################################################################
|
||||
# _MOO_AC_CHECK_FAM(action-if-found,action-if-not-found)
|
||||
#
|
||||
AC_DEFUN_ONCE([_MOO_AC_CHECK_FAM],[
|
||||
moo_ac_save_CFLAGS="$CFLAGS"
|
||||
moo_ac_save_LIBS="$LIBS"
|
||||
|
||||
if test x$FAM_LIBS = x; then
|
||||
FAM_LIBS=-lfam
|
||||
fi
|
||||
|
||||
CFLAGS="$CFLAGS $FAM_CFLAGS"
|
||||
LIBS="$LIBS $FAM_LIBS"
|
||||
|
||||
AC_CHECK_HEADERS(fam.h,[
|
||||
AC_CHECK_FUNCS([FAMMonitorDirectory FAMOpen],[fam_found=yes],[fam_found=no])
|
||||
],[fam_found=no])
|
||||
|
||||
if test x$fam_found != xno; then
|
||||
AC_SUBST(FAM_CFLAGS)
|
||||
AC_SUBST(FAM_LIBS)
|
||||
|
||||
AC_MSG_CHECKING(for FAM_CFLAGS)
|
||||
if test -z $FAM_CFLAGS; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($FAM_CFLAGS)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for FAM_LIBS)
|
||||
if test -z $FAM_LIBS; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($FAM_LIBS)
|
||||
fi
|
||||
|
||||
AC_CHECK_DECL([FAMNoExists],[
|
||||
AC_DEFINE(HAVE_FAMNOEXISTS, 1, [fam.h has FAMNoExists defined])
|
||||
AC_DEFINE(MOO_USE_GAMIN, 1, [whether libfam is provided by gamin])
|
||||
],[],[#include <fam.h>])
|
||||
|
||||
MOO_FAM_CFLAGS="$FAM_CFLAGS"
|
||||
MOO_FAM_LIBS="$FAM_LIBS"
|
||||
ifelse([$1], , :, [$1])
|
||||
else
|
||||
unset FAM_CFLAGS
|
||||
unset FAM_LIBS
|
||||
MOO_FAM_LIBS=
|
||||
MOO_FAM_CFLAGS=
|
||||
ifelse([$2], , [AC_MSG_ERROR(libfam not found)], [$2])
|
||||
fi
|
||||
|
||||
AC_SUBST(MOO_FAM_CFLAGS)
|
||||
AC_SUBST(MOO_FAM_LIBS)
|
||||
CFLAGS="$moo_ac_save_CFLAGS"
|
||||
LIBS="$moo_ac_save_LIBS"
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([MOO_AC_FAM],[
|
||||
if $MOO_OS_UNIX; then
|
||||
AC_ARG_WITH([fam], AC_HELP_STRING([--with-fam], [whether to use fam or gamin for monitoring files in the editor (default = NO)]), [
|
||||
if test x$with_fam = "xyes"; then
|
||||
MOO_USE_FAM="yes"
|
||||
else
|
||||
MOO_USE_FAM="no"
|
||||
fi
|
||||
],[
|
||||
MOO_USE_FAM="no"
|
||||
])
|
||||
|
||||
if test "$MOO_USE_FAM" = "yes"; then
|
||||
_MOO_AC_CHECK_FAM([moo_has_fam=yes],[moo_has_fam=no])
|
||||
if test x$moo_has_fam = xyes; then
|
||||
MOO_USE_FAM="yes"
|
||||
AC_DEFINE(MOO_USE_FAM, 1, [use libfam for monitoring files])
|
||||
else
|
||||
AC_MSG_ERROR([FAM or gamin not found.])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_FAM, test x$MOO_USE_FAM = "xyes")
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([_MOO_AC_CONFIGARGS_H],[
|
||||
moo_ac_configure_args=`echo "$ac_configure_args" | sed 's/^ //; s/\\""\`\$/\\\\&/g'`
|
||||
cat >configargs.h.tmp <<EOF
|
||||
static const char configure_args@<:@@:>@ = "$moo_ac_configure_args";
|
||||
EOF
|
||||
cmp -s configargs.h configargs.h.tmp || mv configargs.h.tmp configargs.h
|
||||
AC_DEFINE(HAVE_CONFIGARGS_H, 1, [configargs.h is created])
|
||||
])
|
||||
|
||||
##############################################################################
|
||||
# MOO_AC_FLAGS(moo_top_dir)
|
||||
#
|
||||
AC_DEFUN_ONCE([MOO_AC_FLAGS],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
AC_REQUIRE([MOO_AC_SET_DIRS])
|
||||
|
||||
AC_PATH_XTRA
|
||||
MOO_PKG_CHECK_GTK_VERSIONS
|
||||
MOO_AC_DEBUG
|
||||
MOO_AC_FAM
|
||||
|
||||
AC_CHECK_FUNCS_ONCE(getc_unlocked)
|
||||
AC_CHECK_HEADERS(unistd.h sys/utsname.h signal.h)
|
||||
|
||||
if $MOO_OS_WIN32; then
|
||||
AC_DEFINE(HAVE_MMAP, 1, [Fake mmap on win32])
|
||||
else
|
||||
AC_CHECK_FUNCS(mmap)
|
||||
fi
|
||||
|
||||
if $GDK_X11; then
|
||||
AC_CHECK_LIB(Xrender, XRenderFindFormat,[
|
||||
AC_SUBST(RENDER_LIBS, "-lXrender -lXext")
|
||||
AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.])
|
||||
],[
|
||||
AC_SUBST(RENDER_LIBS, "")
|
||||
],[-lXext])
|
||||
fi
|
||||
|
||||
AC_DEFINE(MOO_COMPILATION, 1, [must be 1])
|
||||
|
||||
moo_top_src_dir=`cd $srcdir && pwd`
|
||||
MOO_CFLAGS="$MOO_CFLAGS $GTK_CFLAGS"
|
||||
MOO_CXXFLAGS="$MOO_CXXFLAGS $GTK_CFLAGS"
|
||||
MOO_CPPFLAGS="$MOO_CPPFLAGS -I$moo_top_src_dir/moo -DXDG_PREFIX=_moo_edit_xdg -DG_LOG_DOMAIN=\\\"Moo\\\""
|
||||
MOO_LIBS="$MOO_LIBS $GTK_LIBS $GTHREAD_LIBS $LIBM $RENDER_LIBS"
|
||||
|
||||
if $MOO_OS_WIN32; then
|
||||
MOO_CPPFLAGS="$MOO_CPPFLAGS -DUNICODE -D_UNICODE -DSTRICT -DWIN32_LEAN_AND_MEAN -I$moo_top_src_dir/moo/mooutils/moowin32/mingw"
|
||||
fi
|
||||
|
||||
if test x$MOO_USE_FAM = xyes; then
|
||||
MOO_CFLAGS="$MOO_CFLAGS $MOO_FAM_CFLAGS"
|
||||
MOO_CXXFLAGS="$MOO_CXXFLAGS $MOO_FAM_CFLAGS"
|
||||
MOO_LIBS="$MOO_LIBS $MOO_FAM_LIBS"
|
||||
fi
|
||||
|
||||
MOO_CPPFLAGS="$MOO_CPPFLAGS -DMOO_DATA_DIR=\\\"${MOO_DATA_DIR}\\\" -DMOO_LIB_DIR=\\\"${MOO_LIB_DIR}\\\""
|
||||
MOO_CPPFLAGS="$MOO_CPPFLAGS -DMOO_LOCALE_DIR=\\\"${LOCALEDIR}\\\" -DMOO_HELP_DIR=\\\"${MOO_HELP_DIR}\\\""
|
||||
|
||||
MOO_CFLAGS="$MOO_CFLAGS $XML_CFLAGS"
|
||||
MOO_CXXFLAGS="$MOO_CXXFLAGS $XML_CFLAGS"
|
||||
MOO_LIBS="$MOO_LIBS $XML_LIBS"
|
||||
|
||||
AC_SUBST(MOO_CPPFLAGS)
|
||||
AC_SUBST(MOO_CFLAGS)
|
||||
AC_SUBST(MOO_CXXFLAGS)
|
||||
AC_SUBST(MOO_LIBS)
|
||||
|
||||
_MOO_AC_CONFIGARGS_H
|
||||
|
||||
# MOO_INI_IN_IN_RULE='%.ini.desktop.in: %.ini.desktop.in.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]@'
|
||||
# MOO_INI_IN_RULE='%.ini: %.ini.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]@'
|
||||
# MOO_WIN32_RC_RULE='%.res: %.rc.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]*.rc && cd $(subdir) && $(WINDRES) -i [$]*.rc --input-format=rc -o [$]@ -O coff && rm [$]*.rc'
|
||||
# AC_SUBST(MOO_INI_IN_IN_RULE)
|
||||
# AC_SUBST(MOO_INI_IN_RULE)
|
||||
# AC_SUBST(MOO_WIN32_RC_RULE)
|
||||
|
||||
# MOO_XML2H='$(top_srcdir)/moo/mooutils/xml2h.sh'
|
||||
# MOO_GLADE_SUBDIR_RULE='%-glade.h: glade/%.glade $(MOO_XML2H) ; $(SHELL) $(top_srcdir)/moo/mooutils/xml2h.sh `basename "[$]*" | sed -e "s/-/_/"`_glade_xml [$]< > [$]@.tmp && mv [$]@.tmp [$]@'
|
||||
# MOO_GLADE_RULE='%-glade.h: %.glade $(MOO_XML2H) ; $(SHELL) $(top_srcdir)/moo/mooutils/xml2h.sh `basename "[$]*" | sed -e "s/-/_/"`_glade_xml [$]< > [$]@.tmp && mv [$]@.tmp [$]@'
|
||||
# AC_SUBST(MOO_XML2H)
|
||||
# AC_SUBST(MOO_GLADE_SUBDIR_RULE)
|
||||
# AC_SUBST(MOO_GLADE_RULE)
|
||||
])
|
|
@ -0,0 +1,99 @@
|
|||
##############################################################################
|
||||
# _MOO_SPLIT_VERSION(NAME,version)
|
||||
#
|
||||
AC_DEFUN([_MOO_SPLIT_VERSION],[AC_REQUIRE([LT_AC_PROG_SED])
|
||||
$1[]_VERSION="$2"
|
||||
$1[]_MAJOR_VERSION=`echo "$2" | $SED 's/\([[^.]][[^.]]*\).*/\1/'`
|
||||
$1[]_MINOR_VERSION=`echo "$2" | $SED 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
|
||||
$1[]_MICRO_VERSION=`echo "$2" | $SED 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'`
|
||||
])
|
||||
|
||||
##############################################################################
|
||||
# _MOO_SPLIT_VERSION_PKG(PKG_NAME,pkg-name)
|
||||
#
|
||||
AC_DEFUN([_MOO_SPLIT_VERSION_PKG],[
|
||||
AC_MSG_CHECKING($1 version)
|
||||
_moo_ac_version=`$PKG_CONFIG --modversion $2`
|
||||
_MOO_SPLIT_VERSION([$1],[$_moo_ac_version])
|
||||
AC_MSG_RESULT($[]$1[]_MAJOR_VERSION.$[]$1[]_MINOR_VERSION.$[]$1[]_MICRO_VERSION)
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MOO_CHECK_VERSION(PKG_NAME,pkg-name)
|
||||
#
|
||||
AC_DEFUN([MOO_CHECK_VERSION],[
|
||||
PKG_CHECK_MODULES($1,$2)
|
||||
# _MOO_SPLIT_VERSION_PKG($1,$2)
|
||||
# m4_foreach([num],[2,4,6,8,10,12,14],
|
||||
# [AM_CONDITIONAL($1[]_2_[]num, test $[]$1[]_MINOR_VERSION -ge num)
|
||||
# if test $[]$1[]_MINOR_VERSION -ge num; then
|
||||
# $1[]_2_[]num=yes
|
||||
# fi
|
||||
# ])
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _MOO_CHECK_BROKEN_GTK_THEME
|
||||
#
|
||||
AC_DEFUN([_MOO_CHECK_BROKEN_GTK_THEME],[
|
||||
AC_ARG_WITH([broken-gtk-theme], AC_HELP_STRING([--with-broken-gtk-theme], [Work around bug in gtk theme (Suse 9 has one)]), [
|
||||
if test x$with_broken_gtk_theme = "xyes"; then
|
||||
MOO_BROKEN_GTK_THEME="yes"
|
||||
fi
|
||||
])
|
||||
|
||||
if test x$MOO_BROKEN_GTK_THEME = xyes; then
|
||||
AC_MSG_NOTICE([Broken gtk theme])
|
||||
AC_DEFINE(MOO_BROKEN_GTK_THEME, 1, [broken gtk theme])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MOO_PKG_CHECK_GTK_VERSIONS
|
||||
#
|
||||
AC_DEFUN_ONCE([MOO_PKG_CHECK_GTK_VERSIONS],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
MOO_CHECK_VERSION(GTK, gtk+-2.0)
|
||||
# MOO_CHECK_VERSION(GLIB, glib-2.0)
|
||||
MOO_CHECK_VERSION(GTHREAD, gthread-2.0)
|
||||
# MOO_CHECK_VERSION(GDK, gdk-2.0)
|
||||
|
||||
MOO_CHECK_VERSION(XML, libxml-2.0)
|
||||
AC_DEFINE(MOO_USE_XML, 1, [use libxml2])
|
||||
|
||||
_MOO_CHECK_BROKEN_GTK_THEME
|
||||
|
||||
gdk_target=`$PKG_CONFIG --variable=target gdk-2.0`
|
||||
|
||||
GDK_X11=false
|
||||
GDK_WIN32=false
|
||||
GDK_QUARTZ=false
|
||||
|
||||
case $gdk_target in
|
||||
x11)
|
||||
GDK_X11=true
|
||||
;;
|
||||
quartz)
|
||||
GDK_QUARTZ=true
|
||||
;;
|
||||
win32)
|
||||
GDK_WIN32=true
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(GDK_X11, $GDK_X11)
|
||||
AM_CONDITIONAL(GDK_WIN32, $GDK_WIN32)
|
||||
AM_CONDITIONAL(GDK_QUARTZ, $GDK_QUARTZ)
|
||||
|
||||
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
|
||||
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
|
||||
AC_SUBST(GLIB_GENMARSHAL)
|
||||
AC_SUBST(GLIB_MKENUMS)
|
||||
|
||||
AC_ARG_VAR([GDK_PIXBUF_CSOURCE], [gdk-pixbuf-csource])
|
||||
AC_CHECK_TOOL(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, [AC_MSG_ERROR([gdk-pixbuf-csource not found])])
|
||||
|
||||
])
|
|
@ -0,0 +1,45 @@
|
|||
AC_DEFUN([MOO_AC_CHECK_OS],[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
||||
m4_define([_moo_oses_],[CYGWIN WIN32 MINGW DARWIN UNIX FREEBSD BSD LINUX FDO])
|
||||
|
||||
m4_foreach_w([_moo_os_],_moo_oses_,[dnl
|
||||
MOO_OS_[]_moo_os_=false
|
||||
])
|
||||
|
||||
case $host in
|
||||
*-*-mingw32*)
|
||||
MOO_OS_WIN32=true
|
||||
MOO_OS_NAME="Win32"
|
||||
;;
|
||||
*-*-cygwin*)
|
||||
MOO_OS_CYGWIN=true
|
||||
MOO_OS_NAME="CygWin"
|
||||
;;
|
||||
*-*-darwin*)
|
||||
MOO_OS_DARWIN=true
|
||||
MOO_OS_NAME="Darwin"
|
||||
;;
|
||||
*-*-freebsd*)
|
||||
MOO_OS_FREEBSD=true
|
||||
MOO_OS_NAME="FreeBSD"
|
||||
;;
|
||||
*-*-linux*)
|
||||
MOO_OS_LINUX=true
|
||||
MOO_OS_NAME="Linux"
|
||||
;;
|
||||
*)
|
||||
MOO_OS_UNIX=true
|
||||
MOO_OS_NAME="Unix"
|
||||
;;
|
||||
esac
|
||||
|
||||
if $MOO_OS_WIN32; then : ; else MOO_OS_UNIX=true; fi
|
||||
if $MOO_OS_DARWIN; then MOO_OS_BSD=true; fi
|
||||
if $MOO_OS_FREEBSD; then MOO_OS_BSD=true; fi
|
||||
|
||||
m4_foreach_w([_moo_os_],_moo_oses_,[dnl
|
||||
AM_CONDITIONAL(MOO_OS_[]_moo_os_,[$MOO_OS_[]_moo_os_])
|
||||
])
|
||||
|
||||
])
|
|
@ -0,0 +1,51 @@
|
|||
bin_PROGRAMS = medit
|
||||
|
||||
AM_CPPFLAGS = $(MOO_CPPFLAGS) -I$(top_srcdir) -I$(top_srcdir)/moo -I$(top_srcdir)/doc
|
||||
AM_CFLAGS = $(MOO_CFLAGS)
|
||||
AM_CXXFLAGS = $(MOO_CXXFLAGS)
|
||||
|
||||
# if MOO_ENABLE_UNIT_TESTS
|
||||
# AM_CFLAGS += -DSRCDIR="${CMAKE_SOURCE_DIR}/medit")
|
||||
# endif
|
||||
|
||||
medit_SOURCES = \
|
||||
mem-debug.h \
|
||||
run-tests.h \
|
||||
parse.h \
|
||||
main.c
|
||||
|
||||
EXTRA_medit_SOURCES = \
|
||||
dummy.cpp
|
||||
|
||||
medit_LDADD = ../plugins/libmooeditplugins.la ../moo/libmoo.la $(MOO_LIBS)
|
||||
medit_LDFLAGS =
|
||||
if MOO_OS_WIN32
|
||||
medit_LDFLAGS += -mwindows
|
||||
endif
|
||||
|
||||
# MOO_WIN32_RESOURCE(medit.rc.in medit MEDIT_SOURCES medit_libs)
|
||||
|
||||
# if !MOO_ENABLE_UNIT_TESTS
|
||||
# MEDIT_WIN32 = Win32
|
||||
# endif
|
||||
# SET(MEDIT_WIN32 WIN32)
|
||||
# ENDIF(NOT MOO_ENABLE_UNIT_TESTS)
|
||||
|
||||
# ADD_EXECUTABLE(medit ${MEDIT_WIN32} ${MEDIT_SOURCES})
|
||||
# TARGET_LINK_LIBRARIES(medit ${medit_libs} ${MOO_DEP_LIBS})
|
||||
# INSTALL(TARGETS medit DESTINATION ${BINDIR})
|
||||
|
||||
# IF(MOO_ENABLE_PYTHON)
|
||||
# ADD_DEPENDENCIES(medit python-plugins-ini)
|
||||
# ENDIF(MOO_ENABLE_PYTHON)
|
||||
|
||||
# FIND_PACKAGE(MooDesktopFile)
|
||||
# MOO_INSTALL_DESKTOP_FILE(medit.desktop.in)
|
||||
#
|
||||
# IF(MOO_OS_UNIX)
|
||||
# SET(PIXMAPS_DIR "${DATADIR}/pixmaps")
|
||||
# SET(ICONTHEME_DIR "${DATADIR}/icons/hicolor/48x48/apps")
|
||||
# SET(MEDIT_ICONS "${CMAKE_SOURCE_DIR}/moo/mooutils/pixmaps/medit.png")
|
||||
# INSTALL(FILES ${MEDIT_ICONS} DESTINATION "${PIXMAPS_DIR}")
|
||||
# INSTALL(FILES ${MEDIT_ICONS} DESTINATION "${ICONTHEME_DIR}")
|
||||
# ENDIF(MOO_OS_UNIX)
|
|
@ -29,7 +29,7 @@ medit_SOURCES += main.c
|
|||
# medit_SOURCES += main.c
|
||||
# endif
|
||||
|
||||
if MOO_OS_MINGW
|
||||
if MOO_OS_WIN32
|
||||
medit_LDFLAGS += -mwindows
|
||||
endif
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ medit_app_init_plugins (G_GNUC_UNUSED MooApp *app)
|
|||
#endif
|
||||
moo_plugin_init_builtin ();
|
||||
moo_plugin_read_dirs ();
|
||||
_moo_user_tools_plugin_init ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -22,7 +22,7 @@ VS_VERSION_INFO VERSIONINFO
|
|||
VALUE "LegalCopyright", "@MOO_COPYRIGHT@"
|
||||
VALUE "OriginalFilename", "medit.exe"
|
||||
VALUE "ProductName", "medit"
|
||||
VALUE "ProductVersion", "@MOO_PACKAGE_VERSION@"
|
||||
VALUE "ProductVersion", "@MOO_DISPLAY_VERSION@"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/moo-libs.cmake)
|
||||
|
||||
ADD_DEFINITIONS(-DMOO_COMPILATION -DXDG_PREFIX=_moo_xdg_)
|
||||
INCLUDE_DIRECTORIES(${MOO_SOURCE_DIR}/doc)
|
||||
|
||||
MOO_ADD_GENERATED_FILE(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/marshals.stamp
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/marshals.c;${CMAKE_CURRENT_BINARY_DIR}/marshals.h"
|
||||
COMMAND ${MOO_CMAKE_COMMAND} -P ${MOO_SOURCE_DIR}/moo/genmarshal.cmake
|
||||
DEPENDS marshals.list genmarshal.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
SET(MOO_XML2H_PY ${MOO_SOURCE_DIR}/moo/xml2h.py)
|
||||
SET(MOO_GLADE2C_PY ${MOO_SOURCE_DIR}/moo/glade2c.py)
|
||||
|
||||
ADD_SUBDIRECTORY(mooutils)
|
||||
ADD_SUBDIRECTORY(moolua)
|
||||
ADD_SUBDIRECTORY(moofileview)
|
||||
ADD_SUBDIRECTORY(mooedit)
|
||||
ADD_SUBDIRECTORY(mooapp)
|
||||
|
||||
IF(WIN32)
|
||||
LIST(APPEND MOO_SOURCES moo-dll.c)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(MSVC)
|
||||
SET(moo_gendef_args)
|
||||
IF(MOO_ENABLE_UNIT_TESTS)
|
||||
LIST(APPEND moo_gendef_args test)
|
||||
ENDIF(MOO_ENABLE_UNIT_TESTS)
|
||||
MOO_ADD_GENERATED_FILE(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/moo.def.stamp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/moo.def
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/gendef.py ${CMAKE_CURRENT_BINARY_DIR}/moo.def.tmp ${moo_gendef_args}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/moo.def.tmp ${CMAKE_CURRENT_BINARY_DIR}/moo.def
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/moo.def.tmp
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/moo.def.stamp
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gendef.py
|
||||
)
|
||||
LIST(APPEND MOO_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/moo.def)
|
||||
ENDIF(MSVC)
|
||||
|
||||
MOO_ADD_LIBRARY(moo)
|
|
@ -0,0 +1,43 @@
|
|||
noinst_LTLIBRARIES = libmoo.la
|
||||
|
||||
AM_CPPFLAGS = $(MOO_CPPFLAGS)
|
||||
AM_CFLAGS = $(MOO_CFLAGS)
|
||||
AM_CXXFLAGS = $(MOO_CXXFLAGS)
|
||||
|
||||
libmoo_la_LIBADD = \
|
||||
mooapp/libmooapp.la \
|
||||
eggsmclient/libeggsmclient.la \
|
||||
mooedit/libmooedit.la \
|
||||
gtksourceview/libgtksourceview.la \
|
||||
moofileview/libmoofileview.la \
|
||||
moolua/libmoolua.la \
|
||||
mooutils/libmooutils.la \
|
||||
xdgmime/libxdgmime.la
|
||||
|
||||
libmoo_la_SOURCES = \
|
||||
marshals.c \
|
||||
marshals.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
marshals.stamp \
|
||||
marshals.c \
|
||||
marshals.h
|
||||
|
||||
marshals.stamp: marshals.list
|
||||
echo '#include "marshals.h"' > marshals.c.tmp
|
||||
$(GLIB_GENMARSHAL) --prefix=_moo_marshal --body $(srcdir)/marshals.list >> marshals.c.tmp
|
||||
cmp -s marshals.c.tmp marshals.c || mv marshals.c.tmp marshals.c
|
||||
$(GLIB_GENMARSHAL) --prefix=_moo_marshal --header $(srcdir)/marshals.list > marshals.h.tmp
|
||||
cmp -s marshals.h.tmp marshals.h || mv marshals.h.tmp marshals.h
|
||||
rm -f marshals.c.tmp marshals.h.tmp
|
||||
echo stamp > marshals.stamp
|
||||
|
||||
SUBDIRS = \
|
||||
xdgmime \
|
||||
mooutils \
|
||||
moolua \
|
||||
moofileview \
|
||||
gtksourceview \
|
||||
mooedit \
|
||||
eggsmclient \
|
||||
mooapp
|
30
moo/TODO
30
moo/TODO
|
@ -1,30 +0,0 @@
|
|||
new-app
|
||||
system info command line option
|
||||
|
||||
run file, generic for any language
|
||||
ctrl-pageup
|
||||
|
||||
|
||||
1. Make python plugin use temporary file if the document isn't saved.
|
||||
2. Buffering in MooCmd.
|
||||
3. Queue commands in MooCmdView.
|
||||
4. Shortcuts conflicts and hidden actions shortcuts.
|
||||
|
||||
Editor
|
||||
========
|
||||
|
||||
2. File saving: permissions, backups, symlinks.
|
||||
3. moo_editor_save_tmp(), moo_editor_save_fake() ?
|
||||
|
||||
Disable languages
|
||||
|
||||
|
||||
Terminal
|
||||
========
|
||||
|
||||
0. FIX IT!
|
||||
1. Think about profiles, can they help?
|
||||
2. Terminal settings.
|
||||
|
||||
|
||||
Tools: command line option to create a document with given text, read from stdin maybe?
|
|
@ -0,0 +1,27 @@
|
|||
noinst_LTLIBRARIES = libeggsmclient.la
|
||||
|
||||
AM_CPPFLAGS = $(MOO_CPPFLAGS)
|
||||
AM_CFLAGS = $(MOO_CFLAGS)
|
||||
AM_CXXFLAGS = $(MOO_CXXFLAGS)
|
||||
|
||||
libeggsmclient_la_LIBADD =
|
||||
|
||||
libeggsmclient_la_SOURCES = \
|
||||
eggsmclient.c \
|
||||
eggsmclient.h \
|
||||
eggsmclient-mangle.h \
|
||||
eggsmclient-private.h
|
||||
|
||||
if MOO_OS_WIN32
|
||||
libeggsmclient_la_SOURCES += eggsmclient-win32.c
|
||||
else !MOO_OS_WIN32
|
||||
if MOO_OS_DARWIN
|
||||
libeggsmclient_la_SOURCES += eggsmclient-dummy.c
|
||||
else !MOO_OS_DARWIN
|
||||
AM_CFLAGS += -DEGG_SM_CLIENT_BACKEND_XSMP
|
||||
libeggsmclient_la_SOURCES += eggsmclient-xsmp.c eggdesktopfile.h eggdesktopfile.c
|
||||
libeggsmclient_la_LIBADD += -lICE -lSM
|
||||
endif !MOO_OS_DARWIN
|
||||
endif !MOO_OS_WIN32
|
||||
|
||||
# -%- strip:true -%-
|
325
moo/gendef.py
325
moo/gendef.py
|
@ -1,325 +0,0 @@
|
|||
exports = {}
|
||||
exports['base'] = """\
|
||||
_moo_log
|
||||
moo_set_log_func_file
|
||||
moo_set_log_func_file
|
||||
moo_set_log_func_window
|
||||
_moo_normalize_file_path
|
||||
_moo_normalize_file_path
|
||||
moo_win_plugin_get_type
|
||||
moo_win_plugin_get_type
|
||||
moo_edit_window_remove_pane
|
||||
moo_edit_window_remove_pane
|
||||
moo_edit_window_remove_pane
|
||||
moo_cmd_view_abort
|
||||
moo_line_view_end_line
|
||||
moo_line_view_end_line
|
||||
moo_line_view_write
|
||||
moo_line_view_write
|
||||
moo_line_view_start_line
|
||||
moo_line_view_start_line
|
||||
moo_line_view_set_data
|
||||
moo_line_view_write_line
|
||||
moo_line_view_write_line
|
||||
moo_line_view_set_cursor
|
||||
moo_ui_xml_add_item
|
||||
moo_ui_xml_new_merge_id
|
||||
moo_ui_xml_new_merge_id
|
||||
moo_ui_xml_new_merge_id
|
||||
moo_window_class_new_action
|
||||
moo_window_class_new_action
|
||||
moo_editor_get_ui_xml
|
||||
moo_editor_get_ui_xml
|
||||
moo_editor_instance
|
||||
moo_editor_instance
|
||||
moo_editor_instance
|
||||
moo_edit_window_get_type
|
||||
moo_edit_window_get_type
|
||||
moo_edit_window_get_type
|
||||
moo_edit_window_get_type
|
||||
moo_edit_window_get_type
|
||||
moo_win_plugin_lookup
|
||||
moo_ui_xml_remove_ui
|
||||
moo_ui_xml_remove_ui
|
||||
moo_window_class_remove_action
|
||||
moo_window_class_remove_action
|
||||
moo_combo_set_active
|
||||
moo_combo_get_type
|
||||
moo_help_connect_keys
|
||||
moo_help_connect_keys
|
||||
moo_help_set_id
|
||||
moo_help_set_id
|
||||
moo_help_set_id
|
||||
moo_help_set_id
|
||||
moo_window_set_parent
|
||||
moo_window_set_parent
|
||||
moo_glade_xml_set_property
|
||||
moo_glade_xml_parse_memory
|
||||
moo_glade_xml_parse_memory
|
||||
moo_glade_xml_parse_memory
|
||||
moo_glade_xml_get_widget
|
||||
moo_glade_xml_get_widget
|
||||
moo_glade_xml_get_widget
|
||||
moo_glade_xml_get_widget
|
||||
moo_glade_xml_get_widget
|
||||
moo_glade_xml_new_empty
|
||||
moo_glade_xml_new_empty
|
||||
moo_glade_xml_new_empty
|
||||
moo_glade_xml_new_empty
|
||||
moo_glade_xml_new_empty
|
||||
_moo_file_entry_completion_set_entry
|
||||
_moo_file_entry_completion_get_type
|
||||
moo_history_list_add
|
||||
moo_history_list_is_empty
|
||||
moo_history_list_get
|
||||
moo_text_view_get_selection
|
||||
moo_text_view_get_type
|
||||
moo_edit_window_get_active_doc
|
||||
moo_edit_window_get_active_doc
|
||||
moo_edit_window_get_active_doc
|
||||
_moo_file_entry_completion_set_path
|
||||
moo_edit_get_filename
|
||||
moo_edit_get_filename
|
||||
moo_edit_get_filename
|
||||
moo_big_paned_present_pane
|
||||
moo_line_view_clear
|
||||
moo_line_view_get_type
|
||||
moo_history_combo_commit
|
||||
moo_edit_window_get_pane
|
||||
moo_edit_window_get_pane
|
||||
moo_pane_label_free
|
||||
moo_pane_label_free
|
||||
moo_pane_label_free
|
||||
moo_edit_window_add_pane
|
||||
moo_edit_window_add_pane
|
||||
moo_edit_window_add_pane
|
||||
moo_text_view_lookup_tag
|
||||
moo_line_view_create_tag
|
||||
moo_line_view_create_tag
|
||||
moo_edit_window_add_stop_client
|
||||
moo_cmd_view_get_type
|
||||
moo_pane_label_new
|
||||
moo_pane_label_new
|
||||
moo_pane_label_new
|
||||
moo_history_combo_get_list
|
||||
_moo_file_entry_completion_get_path
|
||||
moo_cmd_view_run_command
|
||||
moo_editor_open_file_line
|
||||
moo_edit_window_get_editor
|
||||
moo_edit_window_get_editor
|
||||
moo_line_view_get_data
|
||||
moo_plugin_register
|
||||
moo_plugin_register
|
||||
moo_plugin_register
|
||||
moo_plugin_register
|
||||
moo_plugin_get_type
|
||||
moo_plugin_get_type
|
||||
moo_plugin_get_type
|
||||
moo_plugin_get_type
|
||||
moo_pane_set_drag_dest
|
||||
moo_pane_set_drag_dest
|
||||
moo_big_paned_find_pane
|
||||
moo_big_paned_find_pane
|
||||
moo_get_named_user_data_file
|
||||
_moo_tree_view_setup_expander
|
||||
moo_editor_open_uri
|
||||
moo_editor_set_active_doc
|
||||
moo_markup_doc_unref
|
||||
moo_markup_doc_unref
|
||||
moo_markup_get_prop
|
||||
moo_markup_get_prop
|
||||
moo_markup_get_prop
|
||||
moo_markup_get_root_element
|
||||
moo_markup_get_root_element
|
||||
moo_markup_parse_file
|
||||
moo_markup_parse_file
|
||||
moo_atom_uri_list
|
||||
moo_edit_get_uri
|
||||
moo_edit_get_display_basename
|
||||
moo_edit_get_display_basename
|
||||
moo_edit_get_display_name
|
||||
moo_edit_window_list_docs
|
||||
moo_edit_window_list_docs
|
||||
moo_edit_get_type
|
||||
moo_edit_get_type
|
||||
moo_edit_get_type
|
||||
moo_edit_get_type
|
||||
_moo_tree_view_select_first
|
||||
_moo_tree_view_select_first
|
||||
_moo_tree_view_select_first
|
||||
moo_save_config_file
|
||||
moo_unlink
|
||||
moo_unlink
|
||||
moo_file_view_get_type
|
||||
_moo_signal_new_cb
|
||||
_moo_file_view_add_target
|
||||
moo_prefs_set_filename
|
||||
moo_open_file
|
||||
moo_editor_open_file
|
||||
moo_mime_type_is_subclass
|
||||
moo_get_mime_type_for_filename
|
||||
moo_get_mime_type_for_file
|
||||
moo_file_view_chdir
|
||||
moo_action_collection_get_action
|
||||
moo_file_view_get_actions
|
||||
moo_ui_xml_insert_markup_before
|
||||
_moo_file_view_setup_button_drag_dest
|
||||
moo_ui_xml_insert_markup
|
||||
moo_ui_xml_insert_markup
|
||||
moo_action_group_add_action
|
||||
moo_file_view_get_ui_xml
|
||||
moo_action_collection_get_group
|
||||
moo_prefs_get_string
|
||||
moo_edit_save
|
||||
moo_edit_save
|
||||
moo_editor_new_file
|
||||
_moo_file_view_get_filenames
|
||||
moo_error_dialog
|
||||
moo_bind_bool_property
|
||||
moo_entry_clear_undo
|
||||
_moo_file_view_drag_finish
|
||||
moo_selection_data_get_pointer
|
||||
_moo_file_view_select_name
|
||||
_moo_get_modifiers
|
||||
moo_edit_is_untitled
|
||||
moo_edit_is_untitled
|
||||
moo_edit_is_untitled
|
||||
moo_edit_save_as
|
||||
moo_overwrite_file_dialog
|
||||
moo_entry_get_type
|
||||
moo_edit_get_encoding
|
||||
moo_edit_save_copy
|
||||
_moo_menu_item_set_accel_label
|
||||
moo_menu_new
|
||||
_moo_menu_item_set_label
|
||||
_moo_file_view_tools_load
|
||||
moo_prefs_create_key
|
||||
_moo_bookmark_mgr_new
|
||||
moo_plugin_method_new
|
||||
_moo_marshal_OBJECT__OBJECT
|
||||
moo_edit_class_remove_action
|
||||
moo_edit_class_new_action
|
||||
moo_edit_window_set_action_filter
|
||||
moo_edit_window_set_action_check
|
||||
moo_window_class_new_group
|
||||
moo_window_class_find_group
|
||||
moo_edit_action_get_type
|
||||
moo_editor_get_doc_ui_xml
|
||||
moo_ui_xml_insert
|
||||
moo_ui_xml_get_node
|
||||
moo_get_data_subdirs
|
||||
moo_get_data_subdirs
|
||||
moo_get_data_subdirs
|
||||
_moo_strv_reverse
|
||||
_moo_strv_reverse
|
||||
moo_save_user_data_file
|
||||
_moo_action_get_window
|
||||
moo_edit_get_window
|
||||
moo_edit_get_window
|
||||
moo_edit_action_get_doc
|
||||
_moo_get_pid_string
|
||||
moo_get_user_data_dir
|
||||
moo_text_view_get_cursor_line
|
||||
moo_text_buffer_get_type
|
||||
moo_text_buffer_add_fold
|
||||
_moo_tree_helper_new
|
||||
moo_prefs_page_new
|
||||
moo_prefs_page_new
|
||||
moo_glade_xml_fill_widget
|
||||
moo_glade_xml_fill_widget
|
||||
_moo_tree_helper_update_model
|
||||
_moo_tree_helper_update_model
|
||||
moo_markup_set_prop
|
||||
moo_markup_create_text_element
|
||||
moo_markup_create_element
|
||||
moo_markup_delete_node
|
||||
moo_markup_get_element
|
||||
moo_prefs_get_markup
|
||||
_moo_tree_helper_set_modified
|
||||
_moo_tree_helper_get_modified
|
||||
_moo_tree_helper_update_widgets
|
||||
_moo_tree_helper_update_widgets
|
||||
moo_markup_get_content
|
||||
_moo_tree_helper_set
|
||||
moo_edit_get_status
|
||||
_moo_convert_string_to_bool
|
||||
moo_line_reader_get_line
|
||||
moo_line_reader_init
|
||||
_moo_tree_helper_get_type
|
||||
_moo_tree_helper_get_type
|
||||
moo_output_filter_get_type
|
||||
moo_file_line_data_free
|
||||
moo_line_view_set_boxed
|
||||
moo_file_line_data_get_type
|
||||
moo_output_filter_get_view
|
||||
_moo_convert_string_to_int
|
||||
moo_file_line_data_new
|
||||
moo_output_filter_get_active_file
|
||||
moo_output_filter_get_active_dirs
|
||||
_moo_text_style_apply_to_tag
|
||||
_moo_text_style_scheme_lookup_style
|
||||
moo_lang_mgr_get_active_scheme
|
||||
moo_lang_mgr_default
|
||||
moo_line_view_lookup_tag
|
||||
lua_close
|
||||
_moo_edit_lua_cleanup
|
||||
lua_pcall
|
||||
_moo_edit_lua_set_doc
|
||||
lua_settop
|
||||
lua_tolstring
|
||||
luaL_loadstring
|
||||
_moo_edit_lua_add_api
|
||||
luaL_openlibs
|
||||
luaL_newstate
|
||||
lua_addpath
|
||||
moo_text_view_set_lang_by_id
|
||||
moo_text_view_set_font_from_string
|
||||
moo_text_view_get_text
|
||||
_moo_tree_helper_connect
|
||||
moo_gettext
|
||||
moo_app_run
|
||||
moo_app_open_files
|
||||
moo_app_load_session
|
||||
moo_app_init
|
||||
moo_app_get_type
|
||||
moo_app_send_files
|
||||
moo_app_send_msg
|
||||
moo_plugin_read_dirs
|
||||
moo_win32_get_app_dir
|
||||
_moo_str_equal
|
||||
moo_editor_new_window
|
||||
moo_editor_get_active_window
|
||||
moo_app_get_editor
|
||||
"""
|
||||
|
||||
exports['test'] = """\
|
||||
moo_test_get_result
|
||||
moo_test_cleanup
|
||||
moo_test_run_tests
|
||||
moo_test_editor
|
||||
moo_test_mooedit_lua_api
|
||||
moo_test_lua
|
||||
moo_test_mooutils_win32
|
||||
moo_test_mooutils_misc
|
||||
moo_test_moo_file_writer
|
||||
moo_test_mooutils_fs
|
||||
moo_test_mooaccel
|
||||
moo_test_gobject
|
||||
moo_test_suite_add_test
|
||||
moo_test_suite_new
|
||||
moo_test_assert_impl
|
||||
moo_test_assert_msg
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
all_exports = [exports['base']]
|
||||
if len(sys.argv) > 2:
|
||||
for a in sys.argv[2:]:
|
||||
all_exports.append(exports[a])
|
||||
|
||||
out = open(sys.argv[1], 'w')
|
||||
print >> out, "EXPORTS"
|
||||
for s in all_exports:
|
||||
out.write(s)
|
||||
out.close()
|
|
@ -1,6 +0,0 @@
|
|||
FILE(WRITE ${OUTPUT} "")
|
||||
FILE(APPEND ${OUTPUT} "/* dummy file to please cmake which doesn't know that files can be generated, for ${LIBNAME} */\n")
|
||||
FILE(APPEND ${OUTPUT} "#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)\n")
|
||||
FILE(APPEND ${OUTPUT} "__attribute__((__unused__))\n")
|
||||
FILE(APPEND ${OUTPUT} "#endif\n")
|
||||
FILE(APPEND ${OUTPUT} "static void _moo_dummy_cmake_func_${LIBNAME} (void) {}\n")
|
|
@ -1,18 +0,0 @@
|
|||
INCLUDE(${MOO_SOURCE_DIR}/cmake/modules/FindMooCmakeUtils.cmake)
|
||||
|
||||
MOO_EXEC_OR_DIE(glib-genmarshal
|
||||
COMMAND ${GLIB_GENMARSHAL_EXECUTABLE} --prefix=_moo_marshal --body ${MOO_SOURCE_DIR}/moo/marshals.list
|
||||
OUTPUT_FILE marshals.c.tmp
|
||||
)
|
||||
MOO_COPY_IF_CHANGED(marshals.c.tmp marshals.c)
|
||||
|
||||
MOO_EXEC_OR_DIE(glib-genmarshal
|
||||
COMMAND ${GLIB_GENMARSHAL_EXECUTABLE} --prefix=_moo_marshal --header ${MOO_SOURCE_DIR}/moo/marshals.list
|
||||
OUTPUT_FILE marshals.h.tmp
|
||||
)
|
||||
MOO_COPY_IF_CHANGED(marshals.h.tmp marshals.h)
|
||||
|
||||
FILE(WRITE marshals.stamp "stamp")
|
||||
|
||||
FILE(REMOVE marshals.h.tmp)
|
||||
FILE(REMOVE marshals.c.tmp)
|
|
@ -1,16 +0,0 @@
|
|||
INCLUDE(@MOO_SOURCE_DIR@/cmake/modules/FindMooCmakeUtils.cmake)
|
||||
|
||||
STRING(REGEX REPLACE "(.*)/[^/]*" "\\1" subdir "${INPUT}")
|
||||
IF(subdir)
|
||||
FILE(MAKE_DIRECTORY ${subdir})
|
||||
ENDIF(subdir)
|
||||
|
||||
MOO_EXEC_OR_DIE("@PYTHON_EXECUTABLE@ @MOO_SOURCE_DIR@/moo/glade2c.py ${SRCDIR}/${INPUT}"
|
||||
COMMAND "@PYTHON_EXECUTABLE@" @MOO_SOURCE_DIR@/moo/glade2c.py ${SRCDIR}/${INPUT}
|
||||
OUTPUT_FILE ${OUTPUT}.tmp
|
||||
)
|
||||
MOO_COPY_IF_CHANGED(${OUTPUT}.tmp ${OUTPUT})
|
||||
|
||||
FILE(WRITE ${OUTPUT}.stamp "stamp")
|
||||
|
||||
FILE(REMOVE ${OUTPUT}.tmp)
|
|
@ -0,0 +1,40 @@
|
|||
noinst_LTLIBRARIES = libgtksourceview.la
|
||||
|
||||
AM_CPPFLAGS = $(MOO_CPPFLAGS)
|
||||
AM_CFLAGS = $(MOO_CFLAGS)
|
||||
AM_CXXFLAGS = $(MOO_CXXFLAGS)
|
||||
|
||||
libgtksourceview_la_SOURCES = \
|
||||
gtksourcecontextengine.c \
|
||||
gtksourcecontextengine.h \
|
||||
gtksourceengine.c \
|
||||
gtksourceengine.h \
|
||||
gtksourceiter.c \
|
||||
gtksourceiter.h \
|
||||
gtksourcelanguage-parser-1.c \
|
||||
gtksourcelanguage-parser-2.c \
|
||||
gtksourcelanguage-private.h \
|
||||
gtksourcelanguage.c \
|
||||
gtksourcelanguage.h \
|
||||
gtksourcelanguagemanager.c \
|
||||
gtksourcelanguagemanager.h \
|
||||
gtksourcestyle-private.h \
|
||||
gtksourcestyle.c \
|
||||
gtksourcestyle.h \
|
||||
gtksourcestylescheme.c \
|
||||
gtksourcestylescheme.h \
|
||||
gtksourcestyleschememanager.c \
|
||||
gtksourcestyleschememanager.h \
|
||||
gtksourceview-utils.c \
|
||||
gtksourceview-utils.h \
|
||||
gtktextregion.c \
|
||||
gtktextregion.h
|
||||
|
||||
libgtksourceview_la_SOURCES += \
|
||||
gtksourceview-i18n.h \
|
||||
gtksourceview-marshal.h \
|
||||
gtksourceview-api.h \
|
||||
gtksourcebuffer.h \
|
||||
gtksourceview.h
|
||||
|
||||
# -%- strip:true -%-
|
|
@ -0,0 +1 @@
|
|||
/* empty */
|
|
@ -238,7 +238,7 @@ gtk_source_language_manager_set_search_path (GtkSourceLanguageManager *lm,
|
|||
tmp = lm->priv->lang_dirs;
|
||||
|
||||
if (dirs == NULL)
|
||||
lm->priv->lang_dirs = _gtk_source_view_get_default_dirs (LANGUAGE_DIR, TRUE);
|
||||
lm->priv->lang_dirs = _gtk_source_view_get_default_dirs (LANGUAGE_DIR);
|
||||
else
|
||||
lm->priv->lang_dirs = g_strdupv (dirs);
|
||||
|
||||
|
@ -262,7 +262,7 @@ gtk_source_language_manager_get_search_path (GtkSourceLanguageManager *lm)
|
|||
g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE_MANAGER (lm), NULL);
|
||||
|
||||
if (lm->priv->lang_dirs == NULL)
|
||||
lm->priv->lang_dirs = _gtk_source_view_get_default_dirs (LANGUAGE_DIR, TRUE);
|
||||
lm->priv->lang_dirs = _gtk_source_view_get_default_dirs (LANGUAGE_DIR);
|
||||
|
||||
return (const gchar * const *)lm->priv->lang_dirs;
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ ensure_languages (GtkSourceLanguageManager *lm)
|
|||
|
||||
filenames = _gtk_source_view_get_file_list ((gchar **)gtk_source_language_manager_get_search_path (lm),
|
||||
LANG_FILE_SUFFIX,
|
||||
TRUE);
|
||||
FALSE);
|
||||
|
||||
for (l = filenames; l != NULL; l = l->next)
|
||||
{
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue