drop support for win32/osx and checkupdate plugin
that plugin has never been built in linux anyway due to logic in configure.ac
This commit is contained in:
parent
f6d7a422f3
commit
b24934e186
|
@ -1,11 +1,7 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
|
||||
SUBDIRS = pluma pixmaps po data plugin-loaders plugins docs tests win32 osx
|
||||
|
||||
if !OS_OSX
|
||||
SUBDIRS += help
|
||||
endif
|
||||
SUBDIRS = pluma pixmaps po data plugin-loaders plugins docs tests help
|
||||
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
|
||||
|
|
182
configure.ac
182
configure.ac
|
@ -32,8 +32,6 @@ AC_PROG_INSTALL
|
|||
AC_PROG_MAKE_SET
|
||||
AC_SYS_LARGEFILE
|
||||
PKG_PROG_PKG_CONFIG
|
||||
# needed on osx
|
||||
AC_PROG_OBJC
|
||||
|
||||
# Initialize libtool
|
||||
LT_PREREQ([2.2.6])
|
||||
|
@ -51,84 +49,10 @@ AC_CHECK_LIB(m, floor)
|
|||
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
|
||||
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
|
||||
|
||||
dnl active plugins for GSettings schema
|
||||
ACTIVE_PLUGINS="'docinfo', 'modelines', 'filebrowser', 'spell', 'time'"
|
||||
AC_SUBST(ACTIVE_PLUGINS)
|
||||
|
||||
dnl toolbar style for GSettings schemas
|
||||
TOOLBAR_STYLE="PLUMA_TOOLBAR_SYSTEM"
|
||||
AC_SUBST(TOOLBAR_STYLE)
|
||||
|
||||
dnl check for win32 platform
|
||||
AC_MSG_CHECKING([for Win32 platform])
|
||||
case "$host" in
|
||||
*-*-mingw*|*-*-cygwin*)
|
||||
platform_win32=yes
|
||||
TOOLBAR_STYLE="PLUMA_TOOLBAR_ICONS"
|
||||
;;
|
||||
*)
|
||||
platform_win32=no
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$platform_win32])
|
||||
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
|
||||
|
||||
AC_MSG_CHECKING([for native Win32])
|
||||
case "$host" in
|
||||
*-*-mingw*)
|
||||
os_win32=yes
|
||||
AC_CHECK_TOOL(WINDRES, windres)
|
||||
ACTIVE_PLUGINS="${ACTIVE_PLUGINS}, 'checkupdate'"
|
||||
;;
|
||||
*)
|
||||
os_win32=no
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$os_win32])
|
||||
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
|
||||
|
||||
dnl check for osx platform
|
||||
AC_MSG_CHECKING([for Mac OS X platform])
|
||||
case "$host" in
|
||||
*-*-darwin*)
|
||||
platform_osx=yes
|
||||
;;
|
||||
*)
|
||||
platform_osx=no
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$platform_osx])
|
||||
AM_CONDITIONAL(PLATFORM_OSX, test "$platform_osx" = "yes")
|
||||
|
||||
dnl check for native osx
|
||||
gdk_windowing=`$PKG_CONFIG --variable=target gdk-2.0`
|
||||
|
||||
AC_MSG_CHECKING([for native Mac OS X])
|
||||
if test "$gdk_windowing" = "quartz"; then
|
||||
os_osx=yes
|
||||
ACTIVE_PLUGINS="${ACTIVE_PLUGINS}, 'checkupdate'"
|
||||
else
|
||||
os_osx=no
|
||||
fi
|
||||
AC_MSG_RESULT([$os_osx])
|
||||
AM_CONDITIONAL(OS_OSX, test "$os_osx" = "yes")
|
||||
|
||||
if test "$platform_osx" = "yes"; then
|
||||
AC_DEFINE([PLATFORM_OSX],[1],[Defined if platform is Mac OSX])
|
||||
fi
|
||||
|
||||
AC_SUBST(DEFAULT_FONT)
|
||||
AC_SUBST(DEFAULT_PRINT_FONT)
|
||||
|
||||
if test "$os_osx" = "yes"; then
|
||||
AC_DEFINE([OS_OSX],[1],[Defined if os is Mac OSX])
|
||||
|
||||
PKG_CHECK_MODULES(IGE_MAC, ige-mac-integration)
|
||||
|
||||
AC_SUBST(IGE_MAC_CFLAGS)
|
||||
AC_SUBST(IGE_MAC_LIBS)
|
||||
fi
|
||||
|
||||
dnl ===============================================================
|
||||
dnl Expanded dirs
|
||||
dnl ===============================================================
|
||||
|
@ -164,16 +88,10 @@ dnl ================================================================
|
|||
dnl Use gvfs metadata or the old xml file store.
|
||||
dnl ================================================================
|
||||
|
||||
if test "x$os_osx" != "xno" || test "x$os_win32" != "xno"; then
|
||||
gvfs_metadata_default="no"
|
||||
else
|
||||
gvfs_metadata_default="yes"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([gvfs-metadata],
|
||||
AS_HELP_STRING([--enable-gvfs-metadata], [Enable using gvfs to store metadata]),
|
||||
[enable_gvfs_metadata=$enableval],
|
||||
[enable_gvfs_metadata=$gvfs_metadata_default])
|
||||
[enable_gvfs_metadata=yes])
|
||||
|
||||
AM_CONDITIONAL(ENABLE_GVFS_METADATA, test "x$enable_gvfs_metadata" != "xno")
|
||||
|
||||
|
@ -181,36 +99,6 @@ if test "x$enable_gvfs_metadata" != "xno"; then
|
|||
AC_DEFINE([ENABLE_GVFS_METADATA], [1], [Define to enable using gvfs metadata])
|
||||
fi
|
||||
|
||||
dnl ================================================================
|
||||
dnl check update plugin
|
||||
dnl ================================================================
|
||||
|
||||
AC_ARG_ENABLE([updater],
|
||||
AS_HELP_STRING([--disable-updater],[Disable check update plugin (default: enabled)]),
|
||||
[enable_updater=$enableval],
|
||||
[enable_updater=yes])
|
||||
|
||||
if test "x$enable_updater" != "xno"; then
|
||||
PKG_CHECK_MODULES(LIBSOUP, \
|
||||
libsoup-2.4,
|
||||
have_libsoup=yes,
|
||||
have_libsoup=no)
|
||||
|
||||
if test "x$have_libsoup" = "xyes"; then
|
||||
if test "x$os_win32" = "xyes"; then
|
||||
enable_updater=yes
|
||||
elif test "x$os_osx" = "xyes"; then
|
||||
enable_updater=yes
|
||||
else
|
||||
enable_updater=no
|
||||
fi
|
||||
else
|
||||
enable_updater=no
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_UPDATER, test x"$enable_updater" = "xyes")
|
||||
|
||||
dnl ================================================================
|
||||
dnl spell plugins checks: enchant and iso-codes
|
||||
dnl ================================================================
|
||||
|
@ -300,15 +188,7 @@ PKG_CHECK_MODULES(PLUMA, [
|
|||
mate-desktop-2.0 >= 1.9.0
|
||||
])
|
||||
|
||||
if test "$os_osx" = "no" &&
|
||||
test "$os_win32" = "no"; then
|
||||
PKG_CHECK_MODULES(X11, [
|
||||
x11
|
||||
])
|
||||
else
|
||||
X11_CFLAGS=
|
||||
X11_LIBS=
|
||||
fi
|
||||
PKG_CHECK_MODULES(X11, [x11])
|
||||
|
||||
PLUMA_CFLAGS="$PLUMA_CFLAGS $X11_CFLAGS"
|
||||
PLUMA_LIBS="$PLUMA_LIBS $X11_LIBS"
|
||||
|
@ -316,15 +196,7 @@ PLUMA_LIBS="$PLUMA_LIBS $X11_LIBS"
|
|||
AC_SUBST(PLUMA_CFLAGS)
|
||||
AC_SUBST(PLUMA_LIBS)
|
||||
|
||||
if test "$os_osx" = "no" &&
|
||||
test "$os_win32" = "no"; then
|
||||
PKG_CHECK_MODULES(EGG_SMCLIENT, [
|
||||
sm >= 1.0.0
|
||||
])
|
||||
else
|
||||
EGG_SMCLIENT_CFLAGS=
|
||||
EGG_SMCLIENT_LIBS=
|
||||
fi
|
||||
PKG_CHECK_MODULES(EGG_SMCLIENT, [sm >= 1.0.0])
|
||||
|
||||
AC_SUBST(EGG_SMCLIENT_CFLAGS)
|
||||
AC_SUBST(EGG_SMCLIENT_LIBS)
|
||||
|
@ -361,20 +233,14 @@ if test "x$have_python" != "xno"; then
|
|||
PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
|
||||
PYTHON_LIBS="-lpython$PYTHON_VERSION"
|
||||
|
||||
if test "$os_win32" = yes; then
|
||||
PYTHON_LIBS=`echo $PYTHON_LIBS | sed 's/\.//g'`
|
||||
PYTHON_LIB_LOC="-I$PY_EXEC_PREFIX/libs"
|
||||
PYTHON_CFLAGS="-I$PY_EXEC_PREFIX/include"
|
||||
PYTHON_EXTRA_LIBS=
|
||||
else
|
||||
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
|
||||
PYTHON_LIB_LOC="-L$libdir/python$PYTHON_VERSION/config"
|
||||
PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
|
||||
PYTHON_MAKEFILE="$libdir/python$PYTHON_VERSION/config/Makefile"
|
||||
PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
|
||||
PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
|
||||
PYTHON_EXTRA_LIBS="$PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
|
||||
fi
|
||||
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
|
||||
PYTHON_LIB_LOC="-L$libdir/python$PYTHON_VERSION/config"
|
||||
PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
|
||||
PYTHON_MAKEFILE="$libdir/python$PYTHON_VERSION/config/Makefile"
|
||||
PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
|
||||
PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
|
||||
PYTHON_EXTRA_LIBS="$PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
|
||||
|
||||
AC_SUBST([PYTHON_LIBS])
|
||||
AC_SUBST([PYTHON_LIB_LOC])
|
||||
AC_SUBST([PYTHON_CFLAGS])
|
||||
|
@ -481,22 +347,9 @@ if test "x$enable_deprecations" = "xyes"; then
|
|||
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
|
||||
fi
|
||||
|
||||
# on win32 plugins must be able to resolve all symbols at link time
|
||||
# so we create a lib
|
||||
if test "$platform_win32" = yes; then
|
||||
PLUMA_IMPLIB="-lpluma"
|
||||
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -Wl,\$(top_builddir)/pluma/libpluma.a"
|
||||
LOADER_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -Wl,\$(top_builddir)/pluma/libpluma.a"
|
||||
if test "$os_win32" = yes; then
|
||||
PLUGIN_LIBTOOL_FLAGS="${PLUGIN_LIBTOOL_FLAGS} -mwindows"
|
||||
LOADER_LIBTOOL_FLAGS="${LOADER_LIBTOOL_FLAGS} -mwindows"
|
||||
fi
|
||||
else
|
||||
PLUMA_IMPLIB=""
|
||||
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
|
||||
LOADER_LIBTOOL_FLAGS="-module -avoid-version"
|
||||
fi
|
||||
AC_SUBST(PLUMA_IMPLIB)
|
||||
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
|
||||
LOADER_LIBTOOL_FLAGS="-module -avoid-version"
|
||||
|
||||
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
|
||||
AC_SUBST(LOADER_LIBTOOL_FLAGS)
|
||||
|
||||
|
@ -519,7 +372,6 @@ docs/Makefile
|
|||
docs/reference/Makefile
|
||||
pluma/dialogs/Makefile
|
||||
pluma/smclient/Makefile
|
||||
pluma/osx/Makefile
|
||||
pluma/Makefile
|
||||
help/Makefile
|
||||
pixmaps/Makefile
|
||||
|
@ -529,7 +381,6 @@ plugin-loaders/python/Makefile
|
|||
plugin-loaders/python/bindings/Makefile
|
||||
plugins/Makefile
|
||||
plugins/changecase/Makefile
|
||||
plugins/checkupdate/Makefile
|
||||
plugins/docinfo/Makefile
|
||||
plugins/externaltools/data/Makefile
|
||||
plugins/externaltools/Makefile
|
||||
|
@ -551,10 +402,7 @@ plugins/taglist/Makefile
|
|||
plugins/time/Makefile
|
||||
po/Makefile.in
|
||||
tests/Makefile
|
||||
win32/pluma.iss
|
||||
win32/Makefile
|
||||
osx/Info.plist
|
||||
osx/Makefile])
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
|
|
|
@ -9,4 +9,4 @@ Description: pluma
|
|||
Requires: gtksourceview-@GTK_API_VERSION@
|
||||
Version: @VERSION@
|
||||
Cflags: -I${includedir}/pluma
|
||||
Libs: -L${libdir} @PLUMA_IMPLIB@
|
||||
Libs: -L${libdir}
|
||||
|
|
|
@ -1,260 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>pluma</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>@VERSION@ Copyright 2009, pluma</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>pluma.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.mate.pluma</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>@VERSION@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@VERSION@</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright 2009 pluma, GNU General Public License.</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.4</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>*</string>
|
||||
<string>F</string>
|
||||
<string>F90</string>
|
||||
<string>Filemaker</string>
|
||||
<string>M</string>
|
||||
<string>act3</string>
|
||||
<string>ada</string>
|
||||
<string>applescript</string>
|
||||
<string>as</string>
|
||||
<string>asm</string>
|
||||
<string>asp</string>
|
||||
<string>awk</string>
|
||||
<string>bak</string>
|
||||
<string>bash</string>
|
||||
<string>b</string>
|
||||
<string>bf</string>
|
||||
<string>brainfuck</string>
|
||||
<string>c</string>
|
||||
<string>cgi</string>
|
||||
<string>c++</string>
|
||||
<string>cfm</string>
|
||||
<string>cob</string>
|
||||
<string>conf</string>
|
||||
<string>cp</string>
|
||||
<string>cpp</string>
|
||||
<string>cs</string>
|
||||
<string>csh</string>
|
||||
<string>css</string>
|
||||
<string>CSS</string>
|
||||
<string>csv</string>
|
||||
<string>custom</string>
|
||||
<string>cxx</string>
|
||||
<string>def</string>
|
||||
<string>default</string>
|
||||
<string>do</string>
|
||||
<string>dtd</string>
|
||||
<string>dxf</string>
|
||||
<string>enc</string>
|
||||
<string>eps</string>
|
||||
<string>err</string>
|
||||
<string>f</string>
|
||||
<string>f90</string>
|
||||
<string>fcgi</string>
|
||||
<string>for</string>
|
||||
<string>fs</string>
|
||||
<string>fscript</string>
|
||||
<string>gcc</string>
|
||||
<string>h</string>
|
||||
<string>hpgl</string>
|
||||
<string>htm</string>
|
||||
<string>HTM</string>
|
||||
<string>html</string>
|
||||
<string>ics</string>
|
||||
<string>idl</string>
|
||||
<string>inc</string>
|
||||
<string>ini</string>
|
||||
<string>java</string>
|
||||
<string>javascript</string>
|
||||
<string>js</string>
|
||||
<string>las</string>
|
||||
<string>lasso</string>
|
||||
<string>latex</string>
|
||||
<string>lgt</string>
|
||||
<string>lisp</string>
|
||||
<string>log</string>
|
||||
<string>ltx</string>
|
||||
<string>lua</string>
|
||||
<string>m</string>
|
||||
<string>m1s</string>
|
||||
<string>mel</string>
|
||||
<string>m4</string>
|
||||
<string>mk</string>
|
||||
<string>mm</string>
|
||||
<string>msl</string>
|
||||
<string>mtl</string>
|
||||
<string>mws</string>
|
||||
<string>mx</string>
|
||||
<string>mxo</string>
|
||||
<string>mysql</string>
|
||||
<string>njs</string>
|
||||
<string>p</string>
|
||||
<string>ps</string>
|
||||
<string>pas</string>
|
||||
<string>pch</string>
|
||||
<string>php</string>
|
||||
<string>php3</string>
|
||||
<string>php4</string>
|
||||
<string>phtml</string>
|
||||
<string>pl</string>
|
||||
<string>plist</string>
|
||||
<string>pm</string>
|
||||
<string>pod</string>
|
||||
<string>postgresql</string>
|
||||
<string>pike</string>
|
||||
<string>pp</string>
|
||||
<string>pro</string>
|
||||
<string>py</string>
|
||||
<string>python</string>
|
||||
<string>pyw</string>
|
||||
<string>r</string>
|
||||
<string>rb</string>
|
||||
<string>rc</string>
|
||||
<string>reb</string>
|
||||
<string>rebol</string>
|
||||
<string>rsp</string>
|
||||
<string>rtf</string>
|
||||
<string>ruby</string>
|
||||
<string>rxp</string>
|
||||
<string>s</string>
|
||||
<string>sgml</string>
|
||||
<string>sh</string>
|
||||
<string>shtm</string>
|
||||
<string>shtml</string>
|
||||
<string>sieve</string>
|
||||
<string>sl</string>
|
||||
<string>strings</string>
|
||||
<string>sty</string>
|
||||
<string>sps</string>
|
||||
<string>spss</string>
|
||||
<string>sql</string>
|
||||
<string>SQL</string>
|
||||
<string>st</string>
|
||||
<string>svg</string>
|
||||
<string>tab</string>
|
||||
<string>tcl</string>
|
||||
<string>tcsh</string>
|
||||
<string>tex</string>
|
||||
<string>text</string>
|
||||
<string>txt</string>
|
||||
<string>types</string>
|
||||
<string>uue</string>
|
||||
<string>v</string>
|
||||
<string>vbs</string>
|
||||
<string>vcard</string>
|
||||
<string>vcs</string>
|
||||
<string>verilog</string>
|
||||
<string>vhd</string>
|
||||
<string>vhdl</string>
|
||||
<string>vrm</string>
|
||||
<string>vrml</string>
|
||||
<string>wmk</string>
|
||||
<string>x</string>
|
||||
<string>xhtml</string>
|
||||
<string>xml</string>
|
||||
<string>xsl</string>
|
||||
<string>xslt</string>
|
||||
<string>yaml</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>plumadoc</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/base64</string>
|
||||
<string>application/dxf</string>
|
||||
<string>application/php</string>
|
||||
<string>application/plain</string>
|
||||
<string>application/postscript</string>
|
||||
<string>application/rtf</string>
|
||||
<string>application/vnd.hp-hpgl</string>
|
||||
<string>application/x-bsh</string>
|
||||
<string>application/x-csh</string>
|
||||
<string>application/x-javascript</string>
|
||||
<string>application/x-latex</string>
|
||||
<string>application/x-meme</string>
|
||||
<string>application/x-pointplus</string>
|
||||
<string>application/x-rtf</string>
|
||||
<string>application/x-seelogo</string>
|
||||
<string>application/x-sh</string>
|
||||
<string>application/x-shar</string>
|
||||
<string>application/x-tcl</string>
|
||||
<string>application/x-tex</string>
|
||||
<string>application/x-vrml</string>
|
||||
<string>application/xml</string>
|
||||
<string>image/svg+xml</string>
|
||||
<string>image/svg-xml</string>
|
||||
<string>image/vnd.dwg</string>
|
||||
<string>image/x-dwg</string>
|
||||
<string>image/x-xpixmap</string>
|
||||
<string>model/vrml</string>
|
||||
<string>text/asp</string>
|
||||
<string>text/calendar</string>
|
||||
<string>text/css</string>
|
||||
<string>text/directory</string>
|
||||
<string>text/html</string>
|
||||
<string>text/javascript</string>
|
||||
<string>text/pascal</string>
|
||||
<string>text/php</string>
|
||||
<string>text/plain</string>
|
||||
<string>text/richtext</string>
|
||||
<string>text/sgml</string>
|
||||
<string>text/vcard</string>
|
||||
<string>text/x-asm</string>
|
||||
<string>text/x-c</string>
|
||||
<string>text/x-fortran</string>
|
||||
<string>text/x-h</string>
|
||||
<string>text/x-java-source</string>
|
||||
<string>text/x-m</string>
|
||||
<string>text/x-pascal</string>
|
||||
<string>text/x-perl-script</string>
|
||||
<string>text/x-php-script</string>
|
||||
<string>text/x-script.csh</string>
|
||||
<string>text/x-script.perl-module</string>
|
||||
<string>text/x-script.perl</string>
|
||||
<string>text/x-script.phyton</string>
|
||||
<string>text/x-script.sh</string>
|
||||
<string>text/x-script.tcl</string>
|
||||
<string>text/x-script.tcsh</string>
|
||||
<string>text/x-server-parsed-html</string>
|
||||
<string>text/x-sgml</string>
|
||||
<string>text/x-uuencode</string>
|
||||
<string>text/x-vcalendar</string>
|
||||
<string>text/x-vcard</string>
|
||||
<string>text/xml</string>
|
||||
<string>x-world/x-vrml</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Pluma Document</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>****</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,3 +0,0 @@
|
|||
EXTRA_DIST = Info.plist.in
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
|
@ -1,6 +1,5 @@
|
|||
DIST_SUBDIRS = \
|
||||
changecase \
|
||||
checkupdate \
|
||||
docinfo \
|
||||
externaltools \
|
||||
filebrowser \
|
||||
|
@ -16,6 +15,7 @@ DIST_SUBDIRS = \
|
|||
SUBDIRS = \
|
||||
changecase \
|
||||
docinfo \
|
||||
externaltools \
|
||||
filebrowser \
|
||||
modelines \
|
||||
sort \
|
||||
|
@ -24,19 +24,10 @@ SUBDIRS = \
|
|||
|
||||
if ENABLE_PYTHON
|
||||
SUBDIRS += pythonconsole snippets quickopen
|
||||
|
||||
if !OS_WIN32
|
||||
SUBDIRS += externaltools
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
if ENABLE_ENCHANT
|
||||
SUBDIRS += spell
|
||||
endif
|
||||
|
||||
if ENABLE_UPDATER
|
||||
SUBDIRS += checkupdate
|
||||
endif
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
# pluma win32 updater
|
||||
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(LIBSOUP_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS)
|
||||
|
||||
plugin_LTLIBRARIES = libcheckupdate.la
|
||||
|
||||
libcheckupdate_la_SOURCES = \
|
||||
pluma-check-update-plugin.h \
|
||||
pluma-check-update-plugin.c
|
||||
|
||||
libcheckupdate_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
|
||||
libcheckupdate_la_LIBADD = $(PLUMA_LIBS) $(LIBSOUP_LIBS)
|
||||
|
||||
plugin_in_files = checkupdate.pluma-plugin.desktop.in
|
||||
|
||||
%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
|
||||
|
||||
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
|
||||
|
||||
@INTLTOOL_XML_NOMERGE_RULE@
|
||||
gsettings_SCHEMAS = org.mate.pluma.plugins.checkupdate.gschema.xml
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
%.gschema.xml.in: %.gschema.xml.in.in Makefile
|
||||
$(AM_V_GEN) $(SED) -e 's^\@GETTEXT_PACKAGE\@^$(GETTEXT_PACKAGE)^g' < $< > $@
|
||||
|
||||
EXTRA_DIST = $(plugin_in_files) $(gsettings_SCHEMAS).in.in
|
||||
|
||||
CLEANFILES = $(plugin_DATA) $(gsettings_SCHEMAS).in $(gsettings_SCHEMAS)
|
||||
|
||||
DISTCLEANFILES = $(plugin_DATA) $(gsettings_SCHEMAS).in $(gsettings_SCHEMAS)
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
|
@ -1,9 +0,0 @@
|
|||
[Pluma Plugin]
|
||||
Module=checkupdate
|
||||
IAge=2
|
||||
_Name=Check update
|
||||
_Description=Check for latest version of pluma
|
||||
Icon=pluma-plugin
|
||||
Authors=Ignacio Casal Quinteiro <icq@gnome.org>
|
||||
Copyright=Copyright © 2009 Ignacio Casal Quinteiro
|
||||
Website=http://www.mate-desktop.org
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<schemalist gettext-domain="@GETTEXT_PACKAGE@">
|
||||
<schema id="org.mate.pluma.plugins.checkupdate" path="/org/mate/pluma/plugins/checkupdate/">
|
||||
<key name="ignore-version" type="s">
|
||||
<default>''</default>
|
||||
<_summary>Version to ignore until the next version is released</_summary>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
|
@ -1,663 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2009 - Ignacio Casal Quinteiro <icq@gnome.org>
|
||||
*
|
||||
* 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, 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 St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "pluma-check-update-plugin.h"
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include <pluma/pluma-utils.h>
|
||||
#include <libsoup/soup.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
#define SETTINGS_SCHEMA "org.mate.pluma.plugins.checkupdate"
|
||||
#define SETTINGS_IGNORE_VERSION "ignore-version"
|
||||
|
||||
#define WINDOW_DATA_KEY "PlumaCheckUpdatePluginWindowData"
|
||||
|
||||
#define VERSION_PLACE "<a href=\"[0-9]\\.[0-9]+/\">"
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define PLUMA_URL "http://pub.mate-desktop.org/sources/pluma/"
|
||||
#define FILE_REGEX "pluma\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe"
|
||||
#else
|
||||
#define PLUMA_URL "http://pub.mate-desktop.org/sources/pluma/"
|
||||
#define FILE_REGEX "pluma\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg"
|
||||
#endif
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include "pluma/osx/pluma-osx.h"
|
||||
#endif
|
||||
|
||||
#define PLUMA_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
|
||||
PLUMA_TYPE_CHECK_UPDATE_PLUGIN, \
|
||||
PlumaCheckUpdatePluginPrivate))
|
||||
|
||||
PLUMA_PLUGIN_REGISTER_TYPE (PlumaCheckUpdatePlugin, pluma_check_update_plugin)
|
||||
|
||||
struct _PlumaCheckUpdatePluginPrivate
|
||||
{
|
||||
SoupSession *session;
|
||||
|
||||
GSettings *settings;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PlumaCheckUpdatePlugin *plugin;
|
||||
|
||||
gchar *url;
|
||||
gchar *version;
|
||||
} WindowData;
|
||||
|
||||
static void
|
||||
free_window_data (gpointer data)
|
||||
{
|
||||
WindowData *window_data;
|
||||
|
||||
if (data == NULL)
|
||||
return;
|
||||
|
||||
window_data = (WindowData *)data;
|
||||
|
||||
g_free (window_data->url);
|
||||
g_free (window_data->version);
|
||||
g_slice_free (WindowData, data);
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_check_update_plugin_init (PlumaCheckUpdatePlugin *plugin)
|
||||
{
|
||||
plugin->priv = PLUMA_CHECK_UPDATE_PLUGIN_GET_PRIVATE (plugin);
|
||||
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"PlumaCheckUpdatePlugin initializing");
|
||||
|
||||
plugin->priv->session = soup_session_async_new ();
|
||||
|
||||
plugin->priv->settings = g_settings_new (SETTINGS_SCHEMA);
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_check_update_plugin_dispose (GObject *object)
|
||||
{
|
||||
PlumaCheckUpdatePlugin *plugin = PLUMA_CHECK_UPDATE_PLUGIN (object);
|
||||
|
||||
if (plugin->priv->session != NULL)
|
||||
{
|
||||
g_object_unref (plugin->priv->session);
|
||||
plugin->priv->session = NULL;
|
||||
}
|
||||
|
||||
if (plugin->priv->settings != NULL)
|
||||
{
|
||||
g_object_unref (G_OBJECT (plugin->priv->settings));
|
||||
|
||||
plugin->priv->settings = NULL;
|
||||
}
|
||||
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"PlumaCheckUpdatePlugin disposing");
|
||||
|
||||
G_OBJECT_CLASS (pluma_check_update_plugin_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_check_update_plugin_finalize (GObject *object)
|
||||
{
|
||||
pluma_debug_message (DEBUG_PLUGINS,
|
||||
"PlumaCheckUpdatePlugin finalizing");
|
||||
|
||||
G_OBJECT_CLASS (pluma_check_update_plugin_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
set_contents (GtkWidget *infobar,
|
||||
GtkWidget *contents)
|
||||
{
|
||||
GtkWidget *content_area;
|
||||
|
||||
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar));
|
||||
gtk_container_add (GTK_CONTAINER (content_area), contents);
|
||||
}
|
||||
|
||||
static void
|
||||
set_message_area_text_and_icon (GtkWidget *message_area,
|
||||
const gchar *icon_stock_id,
|
||||
const gchar *primary_text,
|
||||
const gchar *secondary_text)
|
||||
{
|
||||
GtkWidget *hbox_content;
|
||||
GtkWidget *image;
|
||||
GtkWidget *vbox;
|
||||
gchar *primary_markup;
|
||||
gchar *secondary_markup;
|
||||
GtkWidget *primary_label;
|
||||
GtkWidget *secondary_label;
|
||||
|
||||
hbox_content = gtk_hbox_new (FALSE, 8);
|
||||
gtk_widget_show (hbox_content);
|
||||
|
||||
image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG);
|
||||
gtk_widget_show (image);
|
||||
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 6);
|
||||
gtk_widget_show (vbox);
|
||||
gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
|
||||
|
||||
primary_markup = g_strdup_printf ("<b>%s</b>", primary_text);
|
||||
primary_label = gtk_label_new (primary_markup);
|
||||
g_free (primary_markup);
|
||||
gtk_widget_show (primary_label);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
|
||||
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
|
||||
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
|
||||
gtk_widget_set_can_focus (primary_label, TRUE);
|
||||
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
|
||||
|
||||
if (secondary_text != NULL)
|
||||
{
|
||||
secondary_markup = g_strdup_printf ("<small>%s</small>",
|
||||
secondary_text);
|
||||
secondary_label = gtk_label_new (secondary_markup);
|
||||
g_free (secondary_markup);
|
||||
gtk_widget_show (secondary_label);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0);
|
||||
gtk_widget_set_can_focus (secondary_label, TRUE);
|
||||
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
|
||||
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
|
||||
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
|
||||
}
|
||||
|
||||
set_contents (message_area, hbox_content);
|
||||
}
|
||||
|
||||
static void
|
||||
on_response_cb (GtkWidget *infobar,
|
||||
gint response_id,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
if (response_id == GTK_RESPONSE_YES)
|
||||
{
|
||||
GError *error = NULL;
|
||||
WindowData *data;
|
||||
|
||||
data = g_object_get_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY);
|
||||
|
||||
#ifdef OS_OSX
|
||||
pluma_osx_show_url (data->url);
|
||||
#else
|
||||
gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)),
|
||||
data->url,
|
||||
GDK_CURRENT_TIME,
|
||||
&error);
|
||||
#endif
|
||||
if (error != NULL)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
_("There was an error displaying the URI."));
|
||||
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||
"%s", error->message);
|
||||
|
||||
g_signal_connect (G_OBJECT (dialog),
|
||||
"response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
NULL);
|
||||
|
||||
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
else if (response_id == GTK_RESPONSE_NO)
|
||||
{
|
||||
WindowData *data;
|
||||
|
||||
data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
|
||||
|
||||
g_settings_set_string (data->plugin->priv->settings,
|
||||
SETTINGS_IGNORE_VERSION,
|
||||
data->version);
|
||||
}
|
||||
|
||||
g_object_set_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY,
|
||||
NULL);
|
||||
|
||||
gtk_widget_destroy (infobar);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_infobar (PlumaWindow *window,
|
||||
const gchar *version)
|
||||
{
|
||||
GtkWidget *infobar;
|
||||
gchar *message;
|
||||
|
||||
GtkWidget *button;
|
||||
|
||||
infobar = gtk_info_bar_new ();
|
||||
|
||||
button = pluma_gtk_button_new_with_stock_icon (_("_Download"),
|
||||
GTK_STOCK_SAVE);
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_info_bar_add_action_widget (GTK_INFO_BAR (infobar),
|
||||
button,
|
||||
GTK_RESPONSE_YES);
|
||||
|
||||
button = pluma_gtk_button_new_with_stock_icon (_("_Ignore Version"),
|
||||
GTK_STOCK_DISCARD);
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_info_bar_add_action_widget (GTK_INFO_BAR (infobar),
|
||||
button,
|
||||
GTK_RESPONSE_NO);
|
||||
|
||||
gtk_info_bar_add_button (GTK_INFO_BAR (infobar),
|
||||
GTK_STOCK_CANCEL,
|
||||
GTK_RESPONSE_CANCEL);
|
||||
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar),
|
||||
GTK_MESSAGE_INFO);
|
||||
|
||||
message = g_strdup_printf ("%s (%s)", _("There is a new version of pluma"), version);
|
||||
set_message_area_text_and_icon (infobar,
|
||||
"gtk-dialog-info",
|
||||
message,
|
||||
_("You can download the new version of pluma"
|
||||
" by clicking on the download button or"
|
||||
" ignore that version and wait for a new one"));
|
||||
|
||||
g_free (message);
|
||||
|
||||
g_signal_connect (infobar, "response",
|
||||
G_CALLBACK (on_response_cb),
|
||||
window);
|
||||
|
||||
return infobar;
|
||||
}
|
||||
|
||||
static void
|
||||
pack_infobar (GtkWidget *window,
|
||||
GtkWidget *infobar)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
|
||||
vbox = gtk_bin_get_child (GTK_BIN (window));
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), infobar, FALSE, FALSE, 0);
|
||||
gtk_box_reorder_child (GTK_BOX (vbox), infobar, 2);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
get_file (const gchar *text,
|
||||
const gchar *regex_place)
|
||||
{
|
||||
GRegex *regex;
|
||||
GMatchInfo *match_info;
|
||||
gchar *word = NULL;
|
||||
|
||||
regex = g_regex_new (regex_place, 0, 0, NULL);
|
||||
g_regex_match (regex, text, 0, &match_info);
|
||||
while (g_match_info_matches (match_info))
|
||||
{
|
||||
g_free (word);
|
||||
|
||||
word = g_match_info_fetch (match_info, 0);
|
||||
|
||||
g_match_info_next (match_info, NULL);
|
||||
}
|
||||
g_match_info_free (match_info);
|
||||
g_regex_unref (regex);
|
||||
|
||||
return word;
|
||||
}
|
||||
|
||||
static void
|
||||
get_numbers (const gchar *version,
|
||||
gint *major,
|
||||
gint *minor,
|
||||
gint *micro)
|
||||
{
|
||||
gchar **split;
|
||||
gint num = 2;
|
||||
|
||||
if (micro != NULL)
|
||||
num = 3;
|
||||
|
||||
split = g_strsplit (version, ".", num);
|
||||
*major = atoi (split[0]);
|
||||
*minor = atoi (split[1]);
|
||||
if (micro != NULL)
|
||||
*micro = atoi (split[2]);
|
||||
|
||||
g_strfreev (split);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
newer_version (const gchar *v1,
|
||||
const gchar *v2,
|
||||
gboolean with_micro)
|
||||
{
|
||||
gboolean newer = FALSE;
|
||||
gint major1, minor1, micro1;
|
||||
gint major2, minor2, micro2;
|
||||
|
||||
if (v1 == NULL || v2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (with_micro)
|
||||
{
|
||||
get_numbers (v1, &major1, &minor1, µ1);
|
||||
get_numbers (v2, &major2, &minor2, µ2);
|
||||
}
|
||||
else
|
||||
{
|
||||
get_numbers (v1, &major1, &minor1, NULL);
|
||||
get_numbers (v2, &major2, &minor2, NULL);
|
||||
}
|
||||
|
||||
if (major1 > major2)
|
||||
{
|
||||
newer = TRUE;
|
||||
}
|
||||
else if (minor1 > minor2 && major1 == major2)
|
||||
{
|
||||
newer = TRUE;
|
||||
}
|
||||
else if (with_micro && micro1 > micro2 && minor1 == minor2)
|
||||
{
|
||||
newer = TRUE;
|
||||
}
|
||||
|
||||
return newer;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
parse_file_version (const gchar *file)
|
||||
{
|
||||
gchar *p, *aux;
|
||||
|
||||
p = (gchar *)file;
|
||||
|
||||
while (*p != '\0' && !g_ascii_isdigit (*p))
|
||||
{
|
||||
p++;
|
||||
}
|
||||
|
||||
if (*p == '\0')
|
||||
return NULL;
|
||||
|
||||
aux = g_strrstr (p, "-");
|
||||
if (aux == NULL)
|
||||
aux = g_strrstr (p, ".");
|
||||
|
||||
return g_strndup (p, aux - p);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
get_ignore_version (PlumaCheckUpdatePlugin *plugin)
|
||||
{
|
||||
return g_settings_get_string (plugin->priv->settings,
|
||||
SETTINGS_IGNORE_VERSION);
|
||||
}
|
||||
|
||||
static void
|
||||
parse_page_file (SoupSession *session,
|
||||
SoupMessage *msg,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
if (msg->status_code == SOUP_STATUS_OK)
|
||||
{
|
||||
gchar *file;
|
||||
gchar *file_version;
|
||||
gchar *ignore_version;
|
||||
WindowData *data;
|
||||
|
||||
data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
|
||||
|
||||
file = get_file (msg->response_body->data, FILE_REGEX);
|
||||
file_version = parse_file_version (file);
|
||||
ignore_version = get_ignore_version (data->plugin);
|
||||
|
||||
if (newer_version (file_version, VERSION, TRUE) &&
|
||||
(ignore_version == NULL || *ignore_version == '\0' ||
|
||||
newer_version (file_version, ignore_version, TRUE)))
|
||||
{
|
||||
GtkWidget *infobar;
|
||||
WindowData *data;
|
||||
gchar *file_url;
|
||||
|
||||
data = g_object_get_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY);
|
||||
|
||||
file_url = g_strconcat (data->url, file, NULL);
|
||||
|
||||
g_free (data->url);
|
||||
data->url = file_url;
|
||||
data->version = g_strdup (file_version);
|
||||
|
||||
infobar = create_infobar (window, file_version);
|
||||
pack_infobar (GTK_WIDGET (window), infobar);
|
||||
gtk_widget_show (infobar);
|
||||
}
|
||||
|
||||
g_free (ignore_version);
|
||||
g_free (file_version);
|
||||
g_free (file);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_object_set_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_unstable (const gchar *version)
|
||||
{
|
||||
gchar **split;
|
||||
gint minor;
|
||||
gboolean unstable = TRUE;;
|
||||
|
||||
split = g_strsplit (version, ".", 2);
|
||||
minor = atoi (split[1]);
|
||||
g_strfreev (split);
|
||||
|
||||
if ((minor % 2) == 0)
|
||||
unstable = FALSE;
|
||||
|
||||
return unstable;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
get_file_page_version (const gchar *text,
|
||||
const gchar *regex_place)
|
||||
{
|
||||
GRegex *regex;
|
||||
GMatchInfo *match_info;
|
||||
GString *string = NULL;
|
||||
gchar *unstable = NULL;
|
||||
gchar *stable = NULL;
|
||||
|
||||
regex = g_regex_new (regex_place, 0, 0, NULL);
|
||||
g_regex_match (regex, text, 0, &match_info);
|
||||
while (g_match_info_matches (match_info))
|
||||
{
|
||||
gint end;
|
||||
gint i;
|
||||
|
||||
g_match_info_fetch_pos (match_info, 0, NULL, &end);
|
||||
|
||||
string = g_string_new ("");
|
||||
|
||||
i = end;
|
||||
while (text[i] != '/')
|
||||
{
|
||||
string = g_string_append_c (string, text[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (is_unstable (string->str))
|
||||
{
|
||||
g_free (unstable);
|
||||
unstable = g_string_free (string, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_free (stable);
|
||||
stable = g_string_free (string, FALSE);
|
||||
}
|
||||
|
||||
g_match_info_next (match_info, NULL);
|
||||
}
|
||||
g_match_info_free (match_info);
|
||||
g_regex_unref (regex);
|
||||
|
||||
if ((PLUMA_MINOR_VERSION % 2) == 0)
|
||||
{
|
||||
g_free (unstable);
|
||||
|
||||
return stable;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We need to check that stable isn't newer than unstable */
|
||||
if (newer_version (stable, unstable, FALSE))
|
||||
{
|
||||
g_free (unstable);
|
||||
|
||||
return stable;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_free (stable);
|
||||
|
||||
return unstable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
parse_page_version (SoupSession *session,
|
||||
SoupMessage *msg,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
if (msg->status_code == SOUP_STATUS_OK)
|
||||
{
|
||||
gchar *version;
|
||||
SoupMessage *msg2;
|
||||
WindowData *data;
|
||||
|
||||
data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
|
||||
|
||||
version = get_file_page_version (msg->response_body->data,
|
||||
VERSION_PLACE);
|
||||
|
||||
data->url = g_strconcat (PLUMA_URL, version, "/", NULL);
|
||||
g_free (version);
|
||||
msg2 = soup_message_new ("GET", data->url);
|
||||
|
||||
soup_session_queue_message (session, msg2,
|
||||
(SoupSessionCallback)parse_page_file,
|
||||
window);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_object_set_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
impl_activate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
SoupMessage *msg;
|
||||
WindowData *data;
|
||||
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
data = g_slice_new (WindowData);
|
||||
data->plugin = PLUMA_CHECK_UPDATE_PLUGIN (plugin);
|
||||
data->url = NULL;
|
||||
data->version = NULL;
|
||||
|
||||
g_object_set_data_full (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY,
|
||||
data,
|
||||
free_window_data);
|
||||
|
||||
msg = soup_message_new ("GET", PLUMA_URL);
|
||||
|
||||
soup_session_queue_message (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session, msg,
|
||||
(SoupSessionCallback)parse_page_version,
|
||||
window);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_deactivate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
|
||||
pluma_debug (DEBUG_PLUGINS);
|
||||
|
||||
soup_session_abort (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session);
|
||||
|
||||
g_object_set_data (G_OBJECT (window),
|
||||
WINDOW_DATA_KEY,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_check_update_plugin_class_init (PlumaCheckUpdatePluginClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (PlumaCheckUpdatePluginPrivate));
|
||||
|
||||
object_class->finalize = pluma_check_update_plugin_finalize;
|
||||
object_class->dispose = pluma_check_update_plugin_dispose;
|
||||
|
||||
plugin_class->activate = impl_activate;
|
||||
plugin_class->deactivate = impl_deactivate;
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2009 - Ignacio Casal Quinteiro <icq@gnome.org>
|
||||
*
|
||||
* 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, 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 St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_CHECK_UPDATE_PLUGIN_H__
|
||||
#define __PLUMA_CHECK_UPDATE_PLUGIN_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define PLUMA_TYPE_CHECK_UPDATE_PLUGIN (pluma_check_update_plugin_get_type ())
|
||||
#define PLUMA_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePlugin))
|
||||
#define PLUMA_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePluginClass))
|
||||
#define IS_PLUMA_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN))
|
||||
#define IS_PLUMA_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_CHECK_UPDATE_PLUGIN))
|
||||
#define PLUMA_CHECK_UPDATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePluginClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _PlumaCheckUpdatePluginPrivate PlumaCheckUpdatePluginPrivate;
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _PlumaCheckUpdatePlugin PlumaCheckUpdatePlugin;
|
||||
|
||||
struct _PlumaCheckUpdatePlugin
|
||||
{
|
||||
PlumaPlugin parent_instance;
|
||||
|
||||
/*< private >*/
|
||||
PlumaCheckUpdatePluginPrivate *priv;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _PlumaCheckUpdatePluginClass PlumaCheckUpdatePluginClass;
|
||||
|
||||
struct _PlumaCheckUpdatePluginClass
|
||||
{
|
||||
PlumaPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType pluma_check_update_plugin_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* All the plugins must implement this function */
|
||||
G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_CHECK_UPDATE_PLUGIN_H__ */
|
|
@ -2,31 +2,14 @@ TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/pluma-tool-merge.pl
|
|||
|
||||
tools_in_files = \
|
||||
build.tool.in \
|
||||
remove-trailing-spaces.tool.in
|
||||
|
||||
tools_in_linux = \
|
||||
open-terminal-here.tool.in \
|
||||
remove-trailing-spaces.tool.in \
|
||||
run-command.tool.in \
|
||||
search-recursive.tool.in \
|
||||
switch-c.tool.in
|
||||
|
||||
tools_in_osx = \
|
||||
open-terminal-here-osx.tool.in
|
||||
|
||||
tools_in_win32 =
|
||||
|
||||
install_tools_in_files = $(tools_in_files)
|
||||
|
||||
if PLATFORM_OSX
|
||||
install_tools_in_files += $(tools_in_osx)
|
||||
else
|
||||
if PLATFORM_WIN32
|
||||
install_tools_in_files += $(tools_in_win32)
|
||||
else
|
||||
install_tools_in_files += $(tools_in_linux)
|
||||
endif
|
||||
endif
|
||||
|
||||
desktop_in_files = $(install_tools_in_files:.tool.in=.desktop.in)
|
||||
desktop_files = $(install_tools_in_files:.tool.in=.desktop)
|
||||
|
||||
|
@ -34,10 +17,7 @@ tools_SCRIPTS = $(install_tools_in_files:.tool.in=)
|
|||
toolsdir = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/tools
|
||||
|
||||
all_tools_in_files = \
|
||||
$(tools_in_files) \
|
||||
$(tools_in_linux) \
|
||||
$(tools_in_osx) \
|
||||
$(tools_in_win32)
|
||||
$(tools_in_files)
|
||||
|
||||
all_desktop_in_files = $(all_tools_in_files:.tool.in=.desktop.in)
|
||||
all_desktop_files = $(all_tools_in_files:.tool.in=.desktop)
|
||||
|
@ -63,5 +43,4 @@ DISTCLEANFILES = \
|
|||
$(all_desktop_files) \
|
||||
$(all_tools_files)
|
||||
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
[Pluma Tool]
|
||||
_Name=Open terminal here
|
||||
_Comment=Open a terminal in the document location
|
||||
Input=nothing
|
||||
Output=output-panel
|
||||
Applicability=local
|
||||
Save-files=nothing
|
||||
Languages=
|
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/osascript
|
||||
|
||||
set the_path to system attribute "PLUMA_CURRENT_DOCUMENT_DIR"
|
||||
set cmd to "cd " & quoted form of the_path
|
||||
|
||||
tell application "System Events" to set terminalIsRunning to exists application process "Terminal"
|
||||
|
||||
tell application "Terminal"
|
||||
activate
|
||||
|
||||
if terminalIsRunning is true then
|
||||
do script with command cmd
|
||||
else
|
||||
do script with command cmd in window 1
|
||||
end if
|
||||
end tell
|
|
@ -2257,7 +2257,6 @@ model_iterate_next_files_cb (GFileEnumerator * enumerator,
|
|||
* FIXME: This is temporarly, it is a bug in gio:
|
||||
* http://bugzilla.gnome.org/show_bug.cgi?id=565924
|
||||
*/
|
||||
#ifndef G_OS_WIN32
|
||||
if (g_file_is_native (parent->file) && dir->monitor == NULL) {
|
||||
dir->monitor = g_file_monitor_directory (parent->file,
|
||||
G_FILE_MONITOR_NONE,
|
||||
|
@ -2271,7 +2270,6 @@ model_iterate_next_files_cb (GFileEnumerator * enumerator,
|
|||
parent);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
model_check_dummy (dir->model, parent);
|
||||
model_end_loading (dir->model, parent);
|
||||
|
|
|
@ -41,14 +41,8 @@
|
|||
#include "pluma-spell-language-dialog.h"
|
||||
#include "pluma-automatic-spell-checker.h"
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <pluma/pluma-metadata-manager.h>
|
||||
#define PLUMA_METADATA_ATTRIBUTE_SPELL_LANGUAGE "spell-language"
|
||||
#define PLUMA_METADATA_ATTRIBUTE_SPELL_ENABLED "spell-enabled"
|
||||
#else
|
||||
#define PLUMA_METADATA_ATTRIBUTE_SPELL_LANGUAGE "metadata::pluma-spell-language"
|
||||
#define PLUMA_METADATA_ATTRIBUTE_SPELL_ENABLED "metadata::pluma-spell-enabled"
|
||||
#endif
|
||||
|
||||
#define WINDOW_DATA_KEY "PlumaSpellPluginWindowData"
|
||||
#define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_1"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
/* FIXME: we should rewrite the parser to avoid using DOM */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
@ -602,45 +602,38 @@ TagList* create_taglist(const gchar* data_dir)
|
|||
return taglist;
|
||||
}
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
const gchar* home;
|
||||
const gchar* envvar;
|
||||
const gchar* home;
|
||||
const gchar* envvar;
|
||||
|
||||
/* load user's taglists */
|
||||
/* load user's taglists */
|
||||
|
||||
/* legacy dir */
|
||||
home = g_get_home_dir ();
|
||||
if (home != NULL)
|
||||
{
|
||||
pdir = g_build_filename (home,
|
||||
USER_PLUMA_TAGLIST_PLUGIN_LOCATION_LEGACY,
|
||||
NULL);
|
||||
parse_taglist_dir (pdir);
|
||||
g_free (pdir);
|
||||
}
|
||||
/* legacy dir */
|
||||
home = g_get_home_dir ();
|
||||
if (home != NULL)
|
||||
{
|
||||
pdir = g_build_filename (home,
|
||||
USER_PLUMA_TAGLIST_PLUGIN_LOCATION_LEGACY,
|
||||
NULL);
|
||||
parse_taglist_dir (pdir);
|
||||
g_free (pdir);
|
||||
}
|
||||
|
||||
/* Support old libmate env var */
|
||||
envvar = g_getenv ("MATE22_USER_DIR");
|
||||
if (envvar != NULL)
|
||||
{
|
||||
pdir = g_build_filename (envvar,
|
||||
USER_PLUMA_TAGLIST_PLUGIN_LOCATION,
|
||||
NULL);
|
||||
parse_taglist_dir (pdir);
|
||||
g_free (pdir);
|
||||
}
|
||||
else if (home != NULL)
|
||||
{
|
||||
pdir = g_build_filename(home, ".config", USER_PLUMA_TAGLIST_PLUGIN_LOCATION, NULL);
|
||||
parse_taglist_dir(pdir);
|
||||
g_free (pdir);
|
||||
}
|
||||
|
||||
#else
|
||||
pdir = g_build_filename(g_get_user_config_dir(), "pluma", "taglist", NULL);
|
||||
/* Support old libmate env var */
|
||||
envvar = g_getenv ("MATE22_USER_DIR");
|
||||
if (envvar != NULL)
|
||||
{
|
||||
pdir = g_build_filename (envvar,
|
||||
USER_PLUMA_TAGLIST_PLUGIN_LOCATION,
|
||||
NULL);
|
||||
parse_taglist_dir (pdir);
|
||||
g_free (pdir);
|
||||
}
|
||||
else if (home != NULL)
|
||||
{
|
||||
pdir = g_build_filename(home, ".config", USER_PLUMA_TAGLIST_PLUGIN_LOCATION, NULL);
|
||||
parse_taglist_dir(pdir);
|
||||
g_free(pdir);
|
||||
#endif
|
||||
g_free (pdir);
|
||||
}
|
||||
|
||||
/* load system's taglists */
|
||||
parse_taglist_dir(data_dir);
|
||||
|
|
|
@ -72,9 +72,7 @@ static const gchar *formats[] =
|
|||
"%a %d %b %Y %H:%M:%S",
|
||||
"%d/%m/%Y",
|
||||
"%d/%m/%y",
|
||||
#ifndef G_OS_WIN32
|
||||
"%D", /* This one is not supported on win32 */
|
||||
#endif
|
||||
"%D",
|
||||
"%A %d %B %Y",
|
||||
"%A %B %d %Y",
|
||||
"%Y-%m-%d",
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
SUBDIRS = dialogs smclient
|
||||
|
||||
if OS_OSX
|
||||
SUBDIRS += osx
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = pluma
|
||||
|
||||
noinst_LTLIBRARIES = libpluma.la
|
||||
|
@ -14,7 +10,6 @@ AM_CPPFLAGS = \
|
|||
-I$(srcdir) \
|
||||
-I$(srcdir)/smclient \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(IGE_MAC_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS) \
|
||||
-DDATADIR=\""$(datadir)"\" \
|
||||
|
@ -23,16 +18,9 @@ AM_CPPFLAGS = \
|
|||
pluma_SOURCES = \
|
||||
pluma.c
|
||||
|
||||
pluma_LDADD = libpluma.la $(PLUMA_LIBS) $(IGE_MAC_LIBS) $(EGG_SMCLIENT_LIBS)
|
||||
pluma_LDADD = libpluma.la $(PLUMA_LIBS) $(EGG_SMCLIENT_LIBS)
|
||||
|
||||
if PLATFORM_WIN32
|
||||
pluma_LDFLAGS = -Wl,--export-all-symbols -Wl,--out-implib,libpluma.a
|
||||
if OS_WIN32
|
||||
pluma_LDFLAGS += -mwindows
|
||||
endif
|
||||
else
|
||||
pluma_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
|
||||
endif
|
||||
|
||||
libpluma_la_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
|
||||
|
||||
|
@ -43,24 +31,12 @@ libpluma_la_LIBADD = \
|
|||
# PLUMA_LIBS must be the last to ensure correct order on some platforms
|
||||
libpluma_la_LIBADD += $(PLUMA_LIBS) -lICE
|
||||
|
||||
if OS_OSX
|
||||
pluma_LDFLAGS += -framework Carbon
|
||||
|
||||
libpluma_la_LIBADD += osx/libosx.la
|
||||
endif
|
||||
|
||||
BUILT_SOURCES = \
|
||||
pluma-enum-types.c \
|
||||
pluma-enum-types.h \
|
||||
pluma-marshal.c \
|
||||
pluma-marshal.h
|
||||
|
||||
if OS_WIN32
|
||||
pluma-res.o: pluma.rc
|
||||
$(WINDRES) -i pluma.rc --input-format=rc -o pluma-res.o -O coff
|
||||
|
||||
pluma_LDADD += pluma-res.o
|
||||
endif
|
||||
|
||||
NOINST_H_FILES = \
|
||||
pluma-close-button.h \
|
||||
|
@ -222,20 +198,10 @@ CLEANFILES = $(BUILT_SOURCES)
|
|||
dist-hook:
|
||||
cd $(distdir); rm -f $(BUILT_SOURCES)
|
||||
|
||||
install-exec-hook:
|
||||
if PLATFORM_WIN32
|
||||
$(mkinstalldirs) "$(DESTDIR)$(libdir)"
|
||||
$(INSTALL_DATA) libpluma.a "$(DESTDIR)$(libdir)"
|
||||
endif
|
||||
|
||||
if !OS_WIN32
|
||||
BACON_DIR=$(srcdir)/../../libbacon/src/
|
||||
BACON_FILES=bacon-message-connection.h bacon-message-connection.c
|
||||
|
||||
regenerate-built-sources:
|
||||
BACONFILES="$(BACON_FILES)" BACONDIR="$(BACON_DIR)" $(top_srcdir)/pluma/update-from-bacon.sh
|
||||
else
|
||||
BACON_DIR=
|
||||
endif
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/pluma \
|
||||
-I$(top_builddir)/pluma \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(IGE_MAC_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libosx.la
|
||||
|
||||
libosx_la_LDFLAGS = -framework Carbon -framework ApplicationServices -framework Cocoa
|
||||
libosx_la_LIBADD = -lobjc
|
||||
libosx_la_CFLAGS = -xobjective-c
|
||||
|
||||
libosx_la_SOURCES = \
|
||||
pluma-osx.c \
|
||||
pluma-osx.h \
|
||||
pluma-osx-delegate.m \
|
||||
pluma-osx-delegate.h
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
|
@ -1,16 +0,0 @@
|
|||
#ifndef PLUMA_OSX_DELEGATE_H_
|
||||
#define PLUMA_OSX_DELEGATE_H_
|
||||
|
||||
#import <Foundation/NSAppleEventManager.h>
|
||||
|
||||
@interface PlumaOSXDelegate : NSObject
|
||||
{
|
||||
}
|
||||
|
||||
-(id) init;
|
||||
-(void) openFiles:(NSAppleEventDescriptor*)event
|
||||
withReply:(NSAppleEventDescriptor*)reply;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* PLUMA_OSX_DELEGATE_H_ */
|
|
@ -1,84 +0,0 @@
|
|||
#import "pluma-osx-delegate.h"
|
||||
#import <Foundation/NSAppleEventManager.h>
|
||||
#import <Foundation/NSAppleEventDescriptor.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#include <glib.h>
|
||||
#include <pluma/pluma-app.h>
|
||||
#include <pluma/pluma-commands.h>
|
||||
|
||||
@implementation PlumaOSXDelegate
|
||||
-(id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager];
|
||||
|
||||
[em setEventHandler:self
|
||||
andSelector:@selector(openFiles:withReply:)
|
||||
forEventClass:kCoreEventClass
|
||||
andEventID:kAEOpenDocuments];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static PlumaWindow *
|
||||
get_window(NSAppleEventDescriptor *event)
|
||||
{
|
||||
PlumaApp *app = pluma_app_get_default ();
|
||||
return pluma_app_get_active_window (app);
|
||||
}
|
||||
|
||||
- (void)openFiles:(NSAppleEventDescriptor*)event
|
||||
withReply:(NSAppleEventDescriptor*)reply
|
||||
{
|
||||
NSAppleEventDescriptor *fileList = [event paramDescriptorForKeyword:keyDirectObject];
|
||||
NSInteger i;
|
||||
GSList *uris = NULL;
|
||||
|
||||
if (!fileList)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 1; i <= [fileList numberOfItems]; ++i)
|
||||
{
|
||||
NSAppleEventDescriptor *fileAliasDesc = [fileList descriptorAtIndex:i];
|
||||
NSAppleEventDescriptor *fileURLDesc;
|
||||
NSData *fileURLData;
|
||||
gchar *url;
|
||||
|
||||
if (!fileAliasDesc)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
fileURLDesc = [fileAliasDesc coerceToDescriptorType:typeFileURL];
|
||||
|
||||
if (!fileURLDesc)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
fileURLData = [fileURLDesc data];
|
||||
|
||||
if (!fileURLData)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
url = g_strndup([fileURLData bytes], [fileURLData length]);
|
||||
uris = g_slist_prepend (uris, url);
|
||||
}
|
||||
|
||||
if (uris != NULL)
|
||||
{
|
||||
PlumaWindow *window = get_window (event);
|
||||
pluma_commands_load_uris (window, uris, NULL, 0);
|
||||
|
||||
g_slist_foreach (uris, (GFunc)g_free, NULL);
|
||||
g_slist_free (uris);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,94 +0,0 @@
|
|||
#include "pluma-osx.h"
|
||||
#include <gdk/gdkquartz.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#import "pluma-osx-delegate.h"
|
||||
|
||||
void
|
||||
pluma_osx_set_window_title (PlumaWindow *window,
|
||||
gchar const *title,
|
||||
PlumaDocument *document)
|
||||
{
|
||||
NSWindow *native;
|
||||
|
||||
g_return_if_fail (PLUMA_IS_WINDOW (window));
|
||||
|
||||
if (GTK_WIDGET (window)->window == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
native = gdk_quartz_window_get_nswindow (GTK_WIDGET (window)->window);
|
||||
|
||||
if (document)
|
||||
{
|
||||
bool ismodified;
|
||||
|
||||
if (pluma_document_is_untitled (document))
|
||||
{
|
||||
[native setRepresentedURL:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
const gchar *uri = pluma_document_get_uri (document);
|
||||
NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:uri]];
|
||||
|
||||
[native setRepresentedURL:nsurl];
|
||||
}
|
||||
|
||||
ismodified = !pluma_document_is_untouched (document);
|
||||
[native setDocumentEdited:ismodified];
|
||||
}
|
||||
else
|
||||
{
|
||||
[native setRepresentedURL:nil];
|
||||
[native setDocumentEdited:false];
|
||||
}
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), title);
|
||||
}
|
||||
|
||||
gboolean
|
||||
pluma_osx_show_url (const gchar *url)
|
||||
{
|
||||
return [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url]]];
|
||||
}
|
||||
|
||||
gboolean
|
||||
pluma_osx_show_help (const gchar *link_id)
|
||||
{
|
||||
gchar *link;
|
||||
gboolean ret;
|
||||
|
||||
if (link_id)
|
||||
{
|
||||
link = g_strdup_printf ("http://library.gnome.org/users/pluma/stable/%s",
|
||||
link_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
link = g_strdup ("http://library.gnome.org/users/pluma/stable/");
|
||||
}
|
||||
|
||||
ret = pluma_osx_show_url (link);
|
||||
g_free (link);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_delegate (PlumaOSXDelegate *delegate)
|
||||
{
|
||||
[delegate dealloc];
|
||||
}
|
||||
|
||||
void
|
||||
pluma_osx_init(PlumaApp *app)
|
||||
{
|
||||
PlumaOSXDelegate *delegate = [[PlumaOSXDelegate alloc] init];
|
||||
|
||||
g_object_set_data_full (G_OBJECT (app),
|
||||
"PlumaOSXDelegate",
|
||||
delegate,
|
||||
(GDestroyNotify)destroy_delegate);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef __PLUMA_OSX_H__
|
||||
#define __PLUMA_OSX_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <pluma/pluma-window.h>
|
||||
#include <pluma/pluma-app.h>
|
||||
|
||||
void pluma_osx_init (PlumaApp *app);
|
||||
|
||||
void pluma_osx_set_window_title (PlumaWindow *window,
|
||||
gchar const *title,
|
||||
PlumaDocument *document);
|
||||
|
||||
gboolean pluma_osx_show_url (const gchar *url);
|
||||
gboolean pluma_osx_show_help (const gchar *link_id);
|
||||
|
||||
#endif /* __PLUMA_OSX_H__ */
|
|
@ -46,10 +46,6 @@
|
|||
#include "pluma-enum-types.h"
|
||||
#include "pluma-dirs.h"
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include <ige-mac-integration.h>
|
||||
#endif
|
||||
|
||||
#define PLUMA_PAGE_SETUP_FILE "pluma-page-setup"
|
||||
#define PLUMA_PRINT_SETTINGS_FILE "pluma-print-settings"
|
||||
|
||||
|
@ -440,14 +436,6 @@ window_destroy (PlumaWindow *window,
|
|||
*/
|
||||
if (app->priv->windows == NULL)
|
||||
{
|
||||
#ifdef OS_OSX
|
||||
if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "pluma-is-quitting-all")))
|
||||
{
|
||||
/* Create hidden proxy window on OS X to handle the menu */
|
||||
pluma_app_create_window (app, NULL);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
/* Last window is gone... save some settings and exit */
|
||||
ensure_user_config_dir ();
|
||||
|
||||
|
|
|
@ -1647,11 +1647,6 @@ close_confirmation_dialog_response_handler (PlumaCloseConfirmationDialog *dlg,
|
|||
PLUMA_IS_QUITTING,
|
||||
GBOOLEAN_TO_POINTER (FALSE));
|
||||
|
||||
#ifdef OS_OSX
|
||||
g_object_set_data (G_OBJECT (window),
|
||||
PLUMA_IS_QUITTING_ALL,
|
||||
GINT_TO_POINTER (FALSE));
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1734,10 +1729,6 @@ _pluma_cmd_file_close (GtkAction *action,
|
|||
|
||||
if (active_tab == NULL)
|
||||
{
|
||||
#ifdef OS_OSX
|
||||
/* Close the window on OS X */
|
||||
gtk_widget_destroy (GTK_WIDGET (window));
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1829,53 +1820,12 @@ _pluma_cmd_file_close_all (GtkAction *action,
|
|||
file_close_all (window, FALSE);
|
||||
}
|
||||
|
||||
/* Quit */
|
||||
#ifdef OS_OSX
|
||||
static void
|
||||
quit_all ()
|
||||
{
|
||||
GList *windows;
|
||||
GList *item;
|
||||
PlumaApp *app;
|
||||
|
||||
app = pluma_app_get_default ();
|
||||
windows = g_list_copy ((GList *)pluma_app_get_windows (app));
|
||||
|
||||
for (item = windows; item; item = g_list_next (item))
|
||||
{
|
||||
PlumaWindow *window = PLUMA_WINDOW (item->data);
|
||||
|
||||
g_object_set_data (G_OBJECT (window),
|
||||
PLUMA_IS_QUITTING_ALL,
|
||||
GINT_TO_POINTER (TRUE));
|
||||
|
||||
if (!(pluma_window_get_state (window) &
|
||||
(PLUMA_WINDOW_STATE_SAVING |
|
||||
PLUMA_WINDOW_STATE_PRINTING |
|
||||
PLUMA_WINDOW_STATE_SAVING_SESSION)))
|
||||
{
|
||||
file_close_all (window, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free (windows);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
_pluma_cmd_file_quit (GtkAction *action,
|
||||
PlumaWindow *window)
|
||||
{
|
||||
pluma_debug (DEBUG_COMMANDS);
|
||||
|
||||
#ifdef OS_OSX
|
||||
if (action != NULL)
|
||||
{
|
||||
quit_all ();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
g_return_if_fail (!(pluma_window_get_state (window) &
|
||||
(PLUMA_WINDOW_STATE_SAVING |
|
||||
PLUMA_WINDOW_STATE_PRINTING |
|
||||
|
|
|
@ -22,15 +22,11 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "pluma-dirs.h"
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include <ige-mac-bundle.h>
|
||||
#endif
|
||||
|
||||
gchar* pluma_dirs_get_user_config_dir(void)
|
||||
{
|
||||
gchar* config_dir = NULL;
|
||||
|
@ -73,102 +69,17 @@ gchar* pluma_dirs_get_user_accels_file(void)
|
|||
|
||||
gchar* pluma_dirs_get_pluma_data_dir(void)
|
||||
{
|
||||
gchar* data_dir;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
gchar* win32_dir;
|
||||
|
||||
win32_dir = g_win32_get_package_installation_directory_of_module(NULL);
|
||||
|
||||
data_dir = g_build_filename(win32_dir, "share", "pluma", NULL);
|
||||
|
||||
g_free(win32_dir);
|
||||
|
||||
#elif defined(OS_OSX)
|
||||
|
||||
IgeMacBundle* bundle = ige_mac_bundle_get_default();
|
||||
|
||||
if (ige_mac_bundle_get_is_app_bundle(bundle))
|
||||
{
|
||||
const gchar* bundle_data_dir = ige_mac_bundle_get_datadir(bundle);
|
||||
|
||||
data_dir = g_build_filename(bundle_data_dir, "pluma", NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
data_dir = g_build_filename(DATADIR, "pluma", NULL);
|
||||
}
|
||||
#else
|
||||
data_dir = g_build_filename(DATADIR, "pluma", NULL);
|
||||
#endif
|
||||
|
||||
return data_dir;
|
||||
return g_build_filename(DATADIR, "pluma", NULL);
|
||||
}
|
||||
|
||||
gchar* pluma_dirs_get_pluma_locale_dir(void)
|
||||
{
|
||||
gchar* locale_dir;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
gchar* win32_dir;
|
||||
|
||||
win32_dir = g_win32_get_package_installation_directory_of_module(NULL);
|
||||
|
||||
locale_dir = g_build_filename(win32_dir, "share", "locale", NULL);
|
||||
|
||||
g_free(win32_dir);
|
||||
|
||||
#elif defined(OS_OSX)
|
||||
|
||||
IgeMacBundle *bundle = ige_mac_bundle_get_default();
|
||||
|
||||
if (ige_mac_bundle_get_is_app_bundle(bundle))
|
||||
{
|
||||
locale_dir = g_strdup(ige_mac_bundle_get_localedir(bundle));
|
||||
}
|
||||
else
|
||||
{
|
||||
locale_dir = g_build_filename(DATADIR, "locale", NULL);
|
||||
}
|
||||
#else
|
||||
locale_dir = g_build_filename(DATADIR, "locale", NULL);
|
||||
#endif
|
||||
|
||||
return locale_dir;
|
||||
return g_build_filename(DATADIR, "locale", NULL);
|
||||
}
|
||||
|
||||
gchar* pluma_dirs_get_pluma_lib_dir(void)
|
||||
{
|
||||
gchar* lib_dir;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
gchar* win32_dir;
|
||||
|
||||
win32_dir = g_win32_get_package_installation_directory_of_module(NULL);
|
||||
|
||||
lib_dir = g_build_filename(win32_dir, "lib", "pluma", NULL);
|
||||
|
||||
g_free(win32_dir);
|
||||
|
||||
#elif defined(OS_OSX)
|
||||
IgeMacBundle* bundle = ige_mac_bundle_get_default();
|
||||
|
||||
if (ige_mac_bundle_get_is_app_bundle(bundle))
|
||||
{
|
||||
const gchar* path = ige_mac_bundle_get_resourcesdir(bundle);
|
||||
lib_dir = g_build_filename(path, "lib", "pluma", NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
lib_dir = g_build_filename(LIBDIR, "pluma", NULL);
|
||||
}
|
||||
#else
|
||||
lib_dir = g_build_filename(LIBDIR, "pluma", NULL);
|
||||
#endif
|
||||
|
||||
return lib_dir;
|
||||
return g_build_filename(LIBDIR, "pluma", NULL);
|
||||
}
|
||||
|
||||
gchar* pluma_dirs_get_pluma_plugins_dir(void)
|
||||
|
|
|
@ -51,15 +51,9 @@ G_BEGIN_DECLS
|
|||
#define PLUMA_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_DOCUMENT))
|
||||
#define PLUMA_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PLUMA_TYPE_DOCUMENT, PlumaDocumentClass))
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define PLUMA_METADATA_ATTRIBUTE_POSITION "position"
|
||||
#define PLUMA_METADATA_ATTRIBUTE_ENCODING "encoding"
|
||||
#define PLUMA_METADATA_ATTRIBUTE_LANGUAGE "language"
|
||||
#else
|
||||
#define PLUMA_METADATA_ATTRIBUTE_POSITION "metadata::pluma-position"
|
||||
#define PLUMA_METADATA_ATTRIBUTE_ENCODING "metadata::pluma-encoding"
|
||||
#define PLUMA_METADATA_ATTRIBUTE_LANGUAGE "metadata::pluma-language"
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -68,11 +62,7 @@ typedef enum
|
|||
PLUMA_DOCUMENT_NEWLINE_TYPE_CR_LF
|
||||
} PlumaDocumentNewlineType;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define PLUMA_DOCUMENT_NEWLINE_TYPE_DEFAULT PLUMA_DOCUMENT_NEWLINE_TYPE_CR_LF
|
||||
#else
|
||||
#define PLUMA_DOCUMENT_NEWLINE_TYPE_DEFAULT PLUMA_DOCUMENT_NEWLINE_TYPE_LF
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include "osx/pluma-osx.h"
|
||||
#endif
|
||||
|
||||
gboolean
|
||||
pluma_help_display (GtkWindow *parent,
|
||||
const gchar *name, /* "pluma" if NULL */
|
||||
|
@ -53,17 +49,6 @@ pluma_help_display (GtkWindow *parent,
|
|||
|
||||
g_return_val_if_fail ((parent == NULL) || GTK_IS_WINDOW (parent), FALSE);
|
||||
|
||||
#ifdef OS_OSX
|
||||
if (name == NULL || strcmp(name, "pluma.xml") == NULL || strcmp(name, "pluma") == 0)
|
||||
{
|
||||
return pluma_osx_show_help (link_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (name == NULL)
|
||||
name = "pluma";
|
||||
else if (strcmp (name, "pluma.xml") == 0)
|
||||
|
@ -73,18 +58,10 @@ pluma_help_display (GtkWindow *parent,
|
|||
name = "pluma";
|
||||
}
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
if (link_id)
|
||||
link = g_strdup_printf ("help:%s/%s", name, link_id);
|
||||
else
|
||||
link = g_strdup_printf ("help:%s", name);
|
||||
#else
|
||||
if (link_id)
|
||||
link = g_strdup_printf ("http://library.gnome.org/users/pluma/stable/%s",
|
||||
link_id);
|
||||
else
|
||||
link = g_strdup ("http://library.gnome.org/users/pluma/stable/");
|
||||
#endif
|
||||
|
||||
ret = gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (parent)),
|
||||
link,
|
||||
|
|
|
@ -114,13 +114,8 @@ static const GtkActionEntry pluma_menu_entries[] =
|
|||
N_("Search forwards for the same text"), G_CALLBACK (_pluma_cmd_search_find_next) },
|
||||
{ "SearchFindPrevious", NULL, N_("Find Pre_vious"), "<shift><control>G",
|
||||
N_("Search backwards for the same text"), G_CALLBACK (_pluma_cmd_search_find_prev) },
|
||||
#ifndef OS_OSX
|
||||
{ "SearchReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace..."), "<control>H",
|
||||
N_("Search for and replace text"), G_CALLBACK (_pluma_cmd_search_replace) },
|
||||
#else
|
||||
{ "SearchReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace..."), "<control><alt>F",
|
||||
N_("Search for and replace text"), G_CALLBACK (_pluma_cmd_search_replace) },
|
||||
#endif
|
||||
{ "SearchClearHighlight", NULL, N_("_Clear Highlight"), "<shift><control>K",
|
||||
N_("Clear highlighting of search matches"), G_CALLBACK (_pluma_cmd_search_clear_highlight) },
|
||||
{ "SearchGoToLine", GTK_STOCK_JUMP_TO, N_("Go to _Line..."), "<control>I",
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
#include "pluma-prefs-manager.h"
|
||||
#include "pluma-message-bus.h"
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include <ige-mac-integration.h>
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* WindowPrivate is in a separate .h so that we can access it from pluma-commands */
|
||||
|
@ -111,10 +107,6 @@ struct _PlumaWindowPrivate
|
|||
|
||||
GFile *default_location;
|
||||
|
||||
#ifdef OS_OSX
|
||||
IgeMacMenuGroup *mac_menu_group;
|
||||
#endif
|
||||
|
||||
gboolean removing_tabs : 1;
|
||||
gboolean dispose_has_run : 1;
|
||||
};
|
||||
|
|
|
@ -61,10 +61,6 @@
|
|||
#include "pluma-dirs.h"
|
||||
#include "pluma-status-combo-box.h"
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include "osx/pluma-osx.h"
|
||||
#endif
|
||||
|
||||
#define LANGUAGE_NONE (const gchar *)"LangNone"
|
||||
#define PLUMA_UIFILE "pluma-ui.xml"
|
||||
#define TAB_WIDTH_DATA "PlumaWindowTabWidthData"
|
||||
|
@ -159,58 +155,6 @@ save_panes_state (PlumaWindow *window)
|
|||
pluma_prefs_manager_set_bottom_panel_active_page (pane_page);
|
||||
}
|
||||
|
||||
#ifdef OS_OSX
|
||||
static GtkMenuItem *
|
||||
ui_manager_menu_item (GtkUIManager *uimanager,
|
||||
const gchar *path)
|
||||
{
|
||||
return GTK_MENU_ITEM (gtk_ui_manager_get_widget (uimanager, path));
|
||||
}
|
||||
|
||||
static void
|
||||
add_mac_root_menu (PlumaWindow *window)
|
||||
{
|
||||
if (window->priv->mac_menu_group != NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
window->priv->mac_menu_group = ige_mac_menu_add_app_menu_group ();
|
||||
|
||||
ige_mac_menu_add_app_menu_item (window->priv->mac_menu_group,
|
||||
ui_manager_menu_item (window->priv->manager, "/ui/MenuBar/HelpMenu/HelpAboutMenu"),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
remove_mac_root_menu (PlumaWindow *window)
|
||||
{
|
||||
if (window->priv->mac_menu_group == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ige_mac_menu_remove_app_menu_group (window->priv->mac_menu_group);
|
||||
window->priv->mac_menu_group = NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pluma_window_focus_in_event (GtkWidget *widget,
|
||||
GdkEventFocus *event)
|
||||
{
|
||||
add_mac_root_menu (PLUMA_WINDOW (widget));
|
||||
return GTK_WIDGET_CLASS (pluma_window_parent_class)->focus_in_event (widget, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pluma_window_focus_out_event (GtkWidget *widget,
|
||||
GdkEventFocus *event)
|
||||
{
|
||||
remove_mac_root_menu (PLUMA_WINDOW (widget));
|
||||
return GTK_WIDGET_CLASS (pluma_window_parent_class)->focus_out_event (widget, event);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
pluma_window_dispose (GObject *object)
|
||||
{
|
||||
|
@ -292,10 +236,6 @@ pluma_window_dispose (GObject *object)
|
|||
*/
|
||||
pluma_plugins_engine_garbage_collect (pluma_plugins_engine_get_default ());
|
||||
|
||||
#ifdef OS_OSX
|
||||
remove_mac_root_menu (window);
|
||||
#endif
|
||||
|
||||
G_OBJECT_CLASS (pluma_window_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
@ -403,11 +343,6 @@ pluma_window_class_init (PlumaWindowClass *klass)
|
|||
widget_class->configure_event = pluma_window_configure_event;
|
||||
widget_class->key_press_event = pluma_window_key_press_event;
|
||||
|
||||
#ifdef OS_OSX
|
||||
widget_class->focus_in_event = pluma_window_focus_in_event;
|
||||
widget_class->focus_out_event = pluma_window_focus_out_event;
|
||||
#endif
|
||||
|
||||
signals[TAB_ADDED] =
|
||||
g_signal_new ("tab_added",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
|
@ -2183,11 +2118,7 @@ set_title (PlumaWindow *window)
|
|||
|
||||
if (window->priv->active_tab == NULL)
|
||||
{
|
||||
#ifdef OS_OSX
|
||||
pluma_osx_set_window_title (window, "pluma", NULL);
|
||||
#else
|
||||
gtk_window_set_title (GTK_WINDOW (window), "pluma");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2267,11 +2198,7 @@ set_title (PlumaWindow *window)
|
|||
name);
|
||||
}
|
||||
|
||||
#ifdef OS_OSX
|
||||
pluma_osx_set_window_title (window, title, doc);
|
||||
#else
|
||||
gtk_window_set_title (GTK_WINDOW (window), title);
|
||||
#endif
|
||||
|
||||
g_free (dirname);
|
||||
g_free (name);
|
||||
|
@ -2583,14 +2510,8 @@ set_sensitivity_according_to_window_state (PlumaWindow *window)
|
|||
window->priv->num_tabs > 0);
|
||||
if (!gtk_action_group_get_sensitive (window->priv->close_action_group))
|
||||
{
|
||||
#ifdef OS_OSX
|
||||
/* On OS X, File Close is always sensitive */
|
||||
gtk_action_group_set_sensitive (window->priv->close_action_group,
|
||||
TRUE);
|
||||
#else
|
||||
gtk_action_group_set_sensitive (window->priv->close_action_group,
|
||||
window->priv->num_tabs > 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3212,11 +3133,8 @@ update_sensitivity_according_to_open_tabs (PlumaWindow *window)
|
|||
gtk_action_set_sensitive (action,
|
||||
window->priv->num_tabs > 1);
|
||||
|
||||
/* Do not set close action insensitive on OS X */
|
||||
#ifndef OS_OSX
|
||||
gtk_action_group_set_sensitive (window->priv->close_action_group,
|
||||
window->priv->num_tabs != 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3840,27 +3758,6 @@ check_window_is_active (PlumaWindow *window,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef OS_OSX
|
||||
static void
|
||||
setup_mac_menu (PlumaWindow *window)
|
||||
{
|
||||
GtkAction *action;
|
||||
|
||||
gtk_widget_hide (window->priv->menubar);
|
||||
action = gtk_ui_manager_get_action (window->priv->manager, "/ui/MenuBar/HelpMenu/HelpAboutMenu");
|
||||
|
||||
gtk_action_set_label (action, _("About pluma"));
|
||||
|
||||
ige_mac_menu_set_menu_bar (GTK_MENU_SHELL (window->priv->menubar));
|
||||
ige_mac_menu_set_quit_menu_item (ui_manager_menu_item (window->priv->manager, "/ui/MenuBar/FileMenu/FileQuitMenu"));
|
||||
|
||||
ige_mac_menu_set_preferences_menu_item (ui_manager_menu_item (window->priv->manager, "/ui/MenuBar/EditMenu/EditPreferencesMenu"));
|
||||
|
||||
add_mac_root_menu (window);
|
||||
ige_mac_menu_connect_window_key_handler (GTK_WINDOW (window));
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
connect_notebook_signals (PlumaWindow *window,
|
||||
GtkWidget *notebook)
|
||||
|
@ -4042,10 +3939,6 @@ pluma_window_init (PlumaWindow *window)
|
|||
|
||||
update_sensitivity_according_to_open_tabs (window);
|
||||
|
||||
#ifdef OS_OSX
|
||||
setup_mac_menu (window);
|
||||
#endif
|
||||
|
||||
pluma_debug_message (DEBUG_WINDOW, "END");
|
||||
}
|
||||
|
||||
|
|
102
pluma/pluma.c
102
pluma/pluma.c
|
@ -40,10 +40,7 @@
|
|||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
#include <gdk/gdkx.h>
|
||||
#endif
|
||||
|
||||
#include "pluma-app.h"
|
||||
#include "pluma-commands.h"
|
||||
|
@ -59,34 +56,15 @@
|
|||
#include "eggsmclient.h"
|
||||
#include "eggdesktopfile.h"
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define SAVE_DATADIR DATADIR
|
||||
#undef DATADIR
|
||||
#include <io.h>
|
||||
#include <conio.h>
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#include <windows.h>
|
||||
#define DATADIR SAVE_DATADIR
|
||||
#undef SAVE_DATADIR
|
||||
#endif
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include <ige-mac-dock.h>
|
||||
#include <ige-mac-integration.h>
|
||||
#include "osx/pluma-osx.h"
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_GVFS_METADATA
|
||||
#include "pluma-metadata-manager.h"
|
||||
#endif
|
||||
|
||||
static guint32 startup_timestamp = 0;
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
#include "bacon-message-connection.h"
|
||||
|
||||
static guint32 startup_timestamp = 0;
|
||||
|
||||
static BaconMessageConnection *connection;
|
||||
#endif
|
||||
|
||||
/* command line */
|
||||
static gint line_position = 0;
|
||||
|
@ -234,7 +212,6 @@ get_startup_timestamp (void)
|
|||
return (retval > 0) ? retval : 0;
|
||||
}
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
static GdkDisplay *
|
||||
display_open_if_needed (const gchar *name)
|
||||
{
|
||||
|
@ -400,13 +377,11 @@ on_message_received (const char *message,
|
|||
if (!gtk_widget_get_realized (GTK_WIDGET (window)))
|
||||
gtk_widget_realize (GTK_WIDGET (window));
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (startup_timestamp <= 0)
|
||||
startup_timestamp = gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (window)));
|
||||
|
||||
gdk_x11_window_set_user_time (gtk_widget_get_window (GTK_WIDGET (window)),
|
||||
startup_timestamp);
|
||||
#endif
|
||||
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
|
||||
|
@ -513,35 +488,6 @@ send_bacon_message (void)
|
|||
|
||||
g_string_free (command, TRUE);
|
||||
}
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static void
|
||||
setup_path (void)
|
||||
{
|
||||
gchar *path;
|
||||
gchar *installdir;
|
||||
gchar *bin;
|
||||
|
||||
installdir = g_win32_get_package_installation_directory_of_module (NULL);
|
||||
|
||||
bin = g_build_filename (installdir,
|
||||
"bin", NULL);
|
||||
g_free (installdir);
|
||||
|
||||
/* Set PATH to include the pluma executable's folder */
|
||||
path = g_build_path (";",
|
||||
bin,
|
||||
g_getenv ("PATH"),
|
||||
NULL);
|
||||
g_free (bin);
|
||||
|
||||
if (!g_setenv ("PATH", path, TRUE))
|
||||
g_warning ("Could not set PATH for pluma");
|
||||
|
||||
g_free (path);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
|
@ -576,33 +522,6 @@ main (int argc, char *argv[])
|
|||
g_option_context_add_group (context, gtk_get_option_group (FALSE));
|
||||
g_option_context_add_group (context, egg_sm_client_get_option_group ());
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
setup_path ();
|
||||
|
||||
/* If we open pluma from a console get the stdout printing */
|
||||
if (fileno (stdout) != -1 &&
|
||||
_get_osfhandle (fileno (stdout)) != -1)
|
||||
{
|
||||
/* stdout is fine, presumably redirected to a file or pipe */
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
|
||||
|
||||
AttachConsole_t p_AttachConsole =
|
||||
(AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"),
|
||||
"AttachConsole");
|
||||
|
||||
if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS))
|
||||
{
|
||||
freopen ("CONOUT$", "w", stdout);
|
||||
dup2 (fileno (stdout), 1);
|
||||
freopen ("CONOUT$", "w", stderr);
|
||||
dup2 (fileno (stderr), 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
if (!g_option_context_parse (context, &argc, &argv, &error))
|
||||
|
@ -616,7 +535,6 @@ main (int argc, char *argv[])
|
|||
|
||||
g_option_context_free (context);
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
pluma_debug_message (DEBUG_APP, "Create bacon connection");
|
||||
|
||||
connection = bacon_message_connection_new ("pluma");
|
||||
|
@ -655,7 +573,6 @@ main (int argc, char *argv[])
|
|||
{
|
||||
g_warning ("Cannot create the 'pluma' connection.");
|
||||
}
|
||||
#endif
|
||||
|
||||
pluma_debug_message (DEBUG_APP, "Set icon");
|
||||
|
||||
|
@ -669,14 +586,8 @@ main (int argc, char *argv[])
|
|||
icon_dir);
|
||||
g_free (icon_dir);
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
/* Set the associated .desktop file */
|
||||
egg_set_desktop_file (DATADIR "/applications/pluma.desktop");
|
||||
#else
|
||||
/* manually set name and icon */
|
||||
g_set_application_name("Pluma");
|
||||
gtk_window_set_default_icon_name ("accessories-text-editor");
|
||||
#endif
|
||||
|
||||
/* Load user preferences */
|
||||
pluma_debug_message (DEBUG_APP, "Init prefs manager");
|
||||
|
@ -690,10 +601,6 @@ main (int argc, char *argv[])
|
|||
pluma_debug_message (DEBUG_APP, "Init session manager");
|
||||
pluma_session_init ();
|
||||
|
||||
#ifdef OS_OSX
|
||||
ige_mac_menu_set_global_key_handler_enabled (FALSE);
|
||||
#endif
|
||||
|
||||
if (pluma_session_is_restored ())
|
||||
restored = pluma_session_load ();
|
||||
|
||||
|
@ -735,14 +642,9 @@ main (int argc, char *argv[])
|
|||
|
||||
pluma_debug_message (DEBUG_APP, "Start gtk-main");
|
||||
|
||||
#ifdef OS_OSX
|
||||
pluma_osx_init(pluma_app_get_default ());
|
||||
#endif
|
||||
gtk_main();
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
bacon_message_connection_free (connection);
|
||||
#endif
|
||||
|
||||
/* We kept the original engine reference here. So let's unref it to
|
||||
* finalize it properly.
|
||||
|
|
|
@ -1,18 +1,7 @@
|
|||
if OS_WIN32
|
||||
platform_sources = eggsmclient-win32.c
|
||||
platform_logout_test_ldflags = -mwindows
|
||||
else
|
||||
if OS_OSX
|
||||
platform_defines = -xobjective-c
|
||||
platform_ldflags = -framework Carbon
|
||||
platform_sources = eggsmclient-osx.c
|
||||
else
|
||||
platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP
|
||||
platform_libs = libeggdesktopfile.la
|
||||
platform_ltlibraries = libeggdesktopfile.la
|
||||
platform_sources = eggsmclient-xsmp.c
|
||||
endif
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\""EggSMClient"\" \
|
||||
|
@ -45,8 +34,6 @@ libeggdesktopfile_la_SOURCES = \
|
|||
eggdesktopfile.h
|
||||
|
||||
EXTRA_DIST = \
|
||||
eggsmclient-osx.c \
|
||||
eggsmclient-win32.c \
|
||||
eggsmclient-xsmp.c
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
|
|
@ -1,235 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2007 Novell, Inc.
|
||||
* Copyright (C) 2008 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* EggSMClientOSX
|
||||
*
|
||||
* For details on the OS X logout process, see:
|
||||
* http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/BootProcess.html#//apple_ref/doc/uid/20002130-114618
|
||||
*
|
||||
* EggSMClientOSX registers for the kAEQuitApplication AppleEvent; the
|
||||
* handler we register (quit_requested()) will be invoked from inside
|
||||
* the quartz event-handling code (specifically, from inside
|
||||
* [NSApplication nextEventMatchingMask]) when an AppleEvent arrives.
|
||||
* We use AESuspendTheCurrentEvent() and AEResumeTheCurrentEvent() to
|
||||
* allow asynchronous / non-main-loop-reentering processing of the
|
||||
* quit request. (These are part of the Carbon framework; it doesn't
|
||||
* seem to be possible to handle AppleEvents asynchronously from
|
||||
* Cocoa.)
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "eggsmclient-private.h"
|
||||
#include <glib.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreServices/CoreServices.h>
|
||||
|
||||
#define EGG_TYPE_SM_CLIENT_OSX (egg_sm_client_osx_get_type ())
|
||||
#define EGG_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSX))
|
||||
#define EGG_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass))
|
||||
#define EGG_IS_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_OSX))
|
||||
#define EGG_IS_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_OSX))
|
||||
#define EGG_SM_CLIENT_OSX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass))
|
||||
|
||||
typedef struct _EggSMClientOSX EggSMClientOSX;
|
||||
typedef struct _EggSMClientOSXClass EggSMClientOSXClass;
|
||||
|
||||
struct _EggSMClientOSX {
|
||||
EggSMClient parent;
|
||||
|
||||
AppleEvent quit_event, quit_reply;
|
||||
gboolean quit_requested, quitting;
|
||||
};
|
||||
|
||||
struct _EggSMClientOSXClass
|
||||
{
|
||||
EggSMClientClass parent_class;
|
||||
|
||||
};
|
||||
|
||||
static void sm_client_osx_startup (EggSMClient *client,
|
||||
const char *client_id);
|
||||
static void sm_client_osx_will_quit (EggSMClient *client,
|
||||
gboolean will_quit);
|
||||
static gboolean sm_client_osx_end_session (EggSMClient *client,
|
||||
EggSMClientEndStyle style,
|
||||
gboolean request_confirmation);
|
||||
|
||||
static pascal OSErr quit_requested (const AppleEvent *, AppleEvent *, long);
|
||||
|
||||
G_DEFINE_TYPE (EggSMClientOSX, egg_sm_client_osx, EGG_TYPE_SM_CLIENT)
|
||||
|
||||
static void
|
||||
egg_sm_client_osx_init (EggSMClientOSX *osx)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
static void
|
||||
egg_sm_client_osx_class_init (EggSMClientOSXClass *klass)
|
||||
{
|
||||
EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass);
|
||||
|
||||
sm_client_class->startup = sm_client_osx_startup;
|
||||
sm_client_class->will_quit = sm_client_osx_will_quit;
|
||||
sm_client_class->end_session = sm_client_osx_end_session;
|
||||
}
|
||||
|
||||
EggSMClient *
|
||||
egg_sm_client_osx_new (void)
|
||||
{
|
||||
return g_object_new (EGG_TYPE_SM_CLIENT_OSX, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
sm_client_osx_startup (EggSMClient *client,
|
||||
const char *client_id)
|
||||
{
|
||||
AEInstallEventHandler (kCoreEventClass, kAEQuitApplication,
|
||||
NewAEEventHandlerUPP (quit_requested),
|
||||
(long)GPOINTER_TO_SIZE (client), false);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
idle_quit_requested (gpointer client)
|
||||
{
|
||||
egg_sm_client_quit_requested (client);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static pascal OSErr
|
||||
quit_requested (const AppleEvent *aevt, AppleEvent *reply, long refcon)
|
||||
{
|
||||
EggSMClient *client = GSIZE_TO_POINTER ((gsize)refcon);
|
||||
EggSMClientOSX *osx = GSIZE_TO_POINTER ((gsize)refcon);
|
||||
|
||||
g_return_val_if_fail (!osx->quit_requested, userCanceledErr);
|
||||
|
||||
/* FIXME AEInteractWithUser? */
|
||||
|
||||
osx->quit_requested = TRUE;
|
||||
AEDuplicateDesc (aevt, &osx->quit_event);
|
||||
AEDuplicateDesc (reply, &osx->quit_reply);
|
||||
AESuspendTheCurrentEvent (aevt);
|
||||
|
||||
/* Don't emit the "quit_requested" signal immediately, since we're
|
||||
* called from a weird point in the guts of gdkeventloop-quartz.c
|
||||
*/
|
||||
g_idle_add (idle_quit_requested, client);
|
||||
return noErr;
|
||||
}
|
||||
|
||||
static pascal OSErr
|
||||
quit_requested_resumed (const AppleEvent *aevt, AppleEvent *reply, long refcon)
|
||||
{
|
||||
EggSMClientOSX *osx = GSIZE_TO_POINTER ((gsize)refcon);
|
||||
|
||||
osx->quit_requested = FALSE;
|
||||
return osx->quitting ? noErr : userCanceledErr;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
idle_will_quit (gpointer client)
|
||||
{
|
||||
EggSMClientOSX *osx = (EggSMClientOSX *)client;
|
||||
|
||||
/* Resume the event with a new handler that will return a value to
|
||||
* the system.
|
||||
*/
|
||||
AEResumeTheCurrentEvent (&osx->quit_event, &osx->quit_reply,
|
||||
NewAEEventHandlerUPP (quit_requested_resumed),
|
||||
(long)GPOINTER_TO_SIZE (client));
|
||||
AEDisposeDesc (&osx->quit_event);
|
||||
AEDisposeDesc (&osx->quit_reply);
|
||||
|
||||
if (osx->quitting)
|
||||
egg_sm_client_quit (client);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
sm_client_osx_will_quit (EggSMClient *client,
|
||||
gboolean will_quit)
|
||||
{
|
||||
EggSMClientOSX *osx = (EggSMClientOSX *)client;
|
||||
|
||||
g_return_if_fail (osx->quit_requested);
|
||||
|
||||
osx->quitting = will_quit;
|
||||
|
||||
/* Finish in an idle handler since the caller might have called
|
||||
* egg_sm_client_will_quit() from inside the "quit_requested" signal
|
||||
* handler, but may not expect the "quit" signal to arrive during
|
||||
* the _will_quit() call.
|
||||
*/
|
||||
g_idle_add (idle_will_quit, client);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sm_client_osx_end_session (EggSMClient *client,
|
||||
EggSMClientEndStyle style,
|
||||
gboolean request_confirmation)
|
||||
{
|
||||
static const ProcessSerialNumber loginwindow_psn = { 0, kSystemProcess };
|
||||
AppleEvent event = { typeNull, NULL }, reply = { typeNull, NULL };
|
||||
AEAddressDesc target;
|
||||
AEEventID id;
|
||||
OSErr err;
|
||||
|
||||
switch (style)
|
||||
{
|
||||
case EGG_SM_CLIENT_END_SESSION_DEFAULT:
|
||||
case EGG_SM_CLIENT_LOGOUT:
|
||||
id = request_confirmation ? kAELogOut : kAEReallyLogOut;
|
||||
break;
|
||||
case EGG_SM_CLIENT_REBOOT:
|
||||
id = request_confirmation ? kAEShowRestartDialog : kAERestart;
|
||||
break;
|
||||
case EGG_SM_CLIENT_SHUTDOWN:
|
||||
id = request_confirmation ? kAEShowShutdownDialog : kAEShutDown;
|
||||
break;
|
||||
}
|
||||
|
||||
err = AECreateDesc (typeProcessSerialNumber, &loginwindow_psn,
|
||||
sizeof (loginwindow_psn), &target);
|
||||
if (err != noErr)
|
||||
{
|
||||
g_warning ("Could not create descriptor for loginwindow: %d", err);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
err = AECreateAppleEvent (kCoreEventClass, id, &target,
|
||||
kAutoGenerateReturnID, kAnyTransactionID,
|
||||
&event);
|
||||
AEDisposeDesc (&target);
|
||||
if (err != noErr)
|
||||
{
|
||||
g_warning ("Could not create logout AppleEvent: %d", err);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
err = AESend (&event, &reply, kAENoReply, kAENormalPriority,
|
||||
kAEDefaultTimeout, NULL, NULL);
|
||||
AEDisposeDesc (&event);
|
||||
if (err == noErr)
|
||||
AEDisposeDesc (&reply);
|
||||
|
||||
return err == noErr;
|
||||
}
|
|
@ -33,22 +33,8 @@ void egg_sm_client_quit_requested (EggSMClient *client);
|
|||
void egg_sm_client_quit_cancelled (EggSMClient *client);
|
||||
void egg_sm_client_quit (EggSMClient *client);
|
||||
|
||||
#if defined (GDK_WINDOWING_X11)
|
||||
# ifdef EGG_SM_CLIENT_BACKEND_XSMP
|
||||
GType egg_sm_client_xsmp_get_type (void);
|
||||
EggSMClient *egg_sm_client_xsmp_new (void);
|
||||
# endif
|
||||
# ifdef EGG_SM_CLIENT_BACKEND_DBUS
|
||||
GType egg_sm_client_dbus_get_type (void);
|
||||
EggSMClient *egg_sm_client_dbus_new (void);
|
||||
# endif
|
||||
#elif defined (GDK_WINDOWING_WIN32)
|
||||
GType egg_sm_client_win32_get_type (void);
|
||||
EggSMClient *egg_sm_client_win32_new (void);
|
||||
#elif defined (GDK_WINDOWING_QUARTZ)
|
||||
GType egg_sm_client_osx_get_type (void);
|
||||
EggSMClient *egg_sm_client_osx_new (void);
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -1,353 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2007 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* EggSMClientWin32
|
||||
*
|
||||
* For details on the Windows XP logout process, see:
|
||||
* http://msdn.microsoft.com/en-us/library/aa376876.aspx.
|
||||
*
|
||||
* Vista adds some new APIs which EggSMClient does not make use of; see
|
||||
* http://msdn.microsoft.com/en-us/library/ms700677(VS.85).aspx
|
||||
*
|
||||
* When shutting down, Windows sends every top-level window a
|
||||
* WM_QUERYENDSESSION event, which the application must respond to
|
||||
* synchronously, saying whether or not it will quit. To avoid main
|
||||
* loop re-entrancy problems (and to avoid having to muck about too
|
||||
* much with the guts of the gdk-win32 main loop), we watch for this
|
||||
* event in a separate thread, which then signals the main thread and
|
||||
* waits for the main thread to handle the event. Since we don't want
|
||||
* to require g_thread_init() to be called, we do this all using
|
||||
* Windows-specific thread methods.
|
||||
*
|
||||
* After the application handles the WM_QUERYENDSESSION event,
|
||||
* Windows then sends it a WM_ENDSESSION event with a TRUE or FALSE
|
||||
* parameter indicating whether the session is or is not actually
|
||||
* going to end now. We handle this from the other thread as well.
|
||||
*
|
||||
* As mentioned above, Vista introduces several additional new APIs
|
||||
* that don't fit into the (current) EggSMClient API. Windows also has
|
||||
* an entirely separate shutdown-notification scheme for non-GUI apps,
|
||||
* which we also don't handle here.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "eggsmclient-private.h"
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define UNICODE
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#define EGG_TYPE_SM_CLIENT_WIN32 (egg_sm_client_win32_get_type ())
|
||||
#define EGG_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32))
|
||||
#define EGG_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class))
|
||||
#define EGG_IS_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_WIN32))
|
||||
#define EGG_IS_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_WIN32))
|
||||
#define EGG_SM_CLIENT_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class))
|
||||
|
||||
typedef struct _EggSMClientWin32 EggSMClientWin32;
|
||||
typedef struct _EggSMClientWin32Class EggSMClientWin32Class;
|
||||
|
||||
struct _EggSMClientWin32 {
|
||||
EggSMClient parent;
|
||||
|
||||
HANDLE message_event, response_event;
|
||||
|
||||
volatile GSourceFunc event;
|
||||
volatile gboolean will_quit;
|
||||
};
|
||||
|
||||
struct _EggSMClientWin32Class
|
||||
{
|
||||
EggSMClientClass parent_class;
|
||||
|
||||
};
|
||||
|
||||
static void sm_client_win32_startup (EggSMClient *client,
|
||||
const char *client_id);
|
||||
static void sm_client_win32_will_quit (EggSMClient *client,
|
||||
gboolean will_quit);
|
||||
static gboolean sm_client_win32_end_session (EggSMClient *client,
|
||||
EggSMClientEndStyle style,
|
||||
gboolean request_confirmation);
|
||||
|
||||
static GSource *g_win32_handle_source_add (HANDLE handle, GSourceFunc callback,
|
||||
gpointer user_data);
|
||||
static gboolean got_message (gpointer user_data);
|
||||
static void sm_client_thread (gpointer data);
|
||||
|
||||
G_DEFINE_TYPE (EggSMClientWin32, egg_sm_client_win32, EGG_TYPE_SM_CLIENT)
|
||||
|
||||
static void
|
||||
egg_sm_client_win32_init (EggSMClientWin32 *win32)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
static void
|
||||
egg_sm_client_win32_class_init (EggSMClientWin32Class *klass)
|
||||
{
|
||||
EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass);
|
||||
|
||||
sm_client_class->startup = sm_client_win32_startup;
|
||||
sm_client_class->will_quit = sm_client_win32_will_quit;
|
||||
sm_client_class->end_session = sm_client_win32_end_session;
|
||||
}
|
||||
|
||||
EggSMClient *
|
||||
egg_sm_client_win32_new (void)
|
||||
{
|
||||
return g_object_new (EGG_TYPE_SM_CLIENT_WIN32, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
sm_client_win32_startup (EggSMClient *client,
|
||||
const char *client_id)
|
||||
{
|
||||
EggSMClientWin32 *win32 = (EggSMClientWin32 *)client;
|
||||
|
||||
win32->message_event = CreateEvent (NULL, FALSE, FALSE, NULL);
|
||||
win32->response_event = CreateEvent (NULL, FALSE, FALSE, NULL);
|
||||
g_win32_handle_source_add (win32->message_event, got_message, win32);
|
||||
_beginthread (sm_client_thread, 0, client);
|
||||
}
|
||||
|
||||
static void
|
||||
sm_client_win32_will_quit (EggSMClient *client,
|
||||
gboolean will_quit)
|
||||
{
|
||||
EggSMClientWin32 *win32 = (EggSMClientWin32 *)client;
|
||||
|
||||
win32->will_quit = will_quit;
|
||||
SetEvent (win32->response_event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sm_client_win32_end_session (EggSMClient *client,
|
||||
EggSMClientEndStyle style,
|
||||
gboolean request_confirmation)
|
||||
{
|
||||
UINT uFlags = EWX_LOGOFF;
|
||||
|
||||
switch (style)
|
||||
{
|
||||
case EGG_SM_CLIENT_END_SESSION_DEFAULT:
|
||||
case EGG_SM_CLIENT_LOGOUT:
|
||||
uFlags = EWX_LOGOFF;
|
||||
break;
|
||||
case EGG_SM_CLIENT_REBOOT:
|
||||
uFlags = EWX_REBOOT;
|
||||
break;
|
||||
case EGG_SM_CLIENT_SHUTDOWN:
|
||||
uFlags = EWX_POWEROFF;
|
||||
break;
|
||||
}
|
||||
|
||||
/* There's no way to make ExitWindowsEx() show a logout dialog, so
|
||||
* we ignore @request_confirmation.
|
||||
*/
|
||||
|
||||
#ifdef SHTDN_REASON_FLAG_PLANNED
|
||||
ExitWindowsEx (uFlags, SHTDN_REASON_FLAG_PLANNED);
|
||||
#else
|
||||
ExitWindowsEx (uFlags, 0);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* callbacks from logout-listener thread */
|
||||
|
||||
static gboolean
|
||||
emit_quit_requested (gpointer smclient)
|
||||
{
|
||||
gdk_threads_enter ();
|
||||
egg_sm_client_quit_requested (smclient);
|
||||
gdk_threads_leave ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
emit_quit (gpointer smclient)
|
||||
{
|
||||
EggSMClientWin32 *win32 = smclient;
|
||||
|
||||
gdk_threads_enter ();
|
||||
egg_sm_client_quit (smclient);
|
||||
gdk_threads_leave ();
|
||||
|
||||
SetEvent (win32->response_event);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
emit_quit_cancelled (gpointer smclient)
|
||||
{
|
||||
EggSMClientWin32 *win32 = smclient;
|
||||
|
||||
gdk_threads_enter ();
|
||||
egg_sm_client_quit_cancelled (smclient);
|
||||
gdk_threads_leave ();
|
||||
|
||||
SetEvent (win32->response_event);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
got_message (gpointer smclient)
|
||||
{
|
||||
EggSMClientWin32 *win32 = smclient;
|
||||
|
||||
win32->event (win32);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Windows HANDLE GSource */
|
||||
|
||||
typedef struct {
|
||||
GSource source;
|
||||
GPollFD pollfd;
|
||||
} GWin32HandleSource;
|
||||
|
||||
static gboolean
|
||||
g_win32_handle_source_prepare (GSource *source, gint *timeout)
|
||||
{
|
||||
*timeout = -1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
g_win32_handle_source_check (GSource *source)
|
||||
{
|
||||
GWin32HandleSource *hsource = (GWin32HandleSource *)source;
|
||||
|
||||
return hsource->pollfd.revents;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
g_win32_handle_source_dispatch (GSource *source, GSourceFunc callback, gpointer user_data)
|
||||
{
|
||||
return (*callback) (user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
g_win32_handle_source_finalize (GSource *source)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
GSourceFuncs g_win32_handle_source_funcs = {
|
||||
g_win32_handle_source_prepare,
|
||||
g_win32_handle_source_check,
|
||||
g_win32_handle_source_dispatch,
|
||||
g_win32_handle_source_finalize
|
||||
};
|
||||
|
||||
static GSource *
|
||||
g_win32_handle_source_add (HANDLE handle, GSourceFunc callback, gpointer user_data)
|
||||
{
|
||||
GWin32HandleSource *hsource;
|
||||
GSource *source;
|
||||
|
||||
source = g_source_new (&g_win32_handle_source_funcs, sizeof (GWin32HandleSource));
|
||||
hsource = (GWin32HandleSource *)source;
|
||||
hsource->pollfd.fd = (int)handle;
|
||||
hsource->pollfd.events = G_IO_IN;
|
||||
hsource->pollfd.revents = 0;
|
||||
g_source_add_poll (source, &hsource->pollfd);
|
||||
|
||||
g_source_set_callback (source, callback, user_data, NULL);
|
||||
g_source_attach (source, NULL);
|
||||
return source;
|
||||
}
|
||||
|
||||
/* logout-listener thread */
|
||||
|
||||
LRESULT CALLBACK
|
||||
sm_client_win32_window_procedure (HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
EggSMClientWin32 *win32 =
|
||||
(EggSMClientWin32 *)GetWindowLongPtr (hwnd, GWLP_USERDATA);
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_QUERYENDSESSION:
|
||||
win32->event = emit_quit_requested;
|
||||
SetEvent (win32->message_event);
|
||||
|
||||
WaitForSingleObject (win32->response_event, INFINITE);
|
||||
return win32->will_quit;
|
||||
|
||||
case WM_ENDSESSION:
|
||||
if (wParam)
|
||||
{
|
||||
/* The session is ending */
|
||||
win32->event = emit_quit;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Nope, the session *isn't* ending */
|
||||
win32->event = emit_quit_cancelled;
|
||||
}
|
||||
|
||||
SetEvent (win32->message_event);
|
||||
WaitForSingleObject (win32->response_event, INFINITE);
|
||||
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return DefWindowProc (hwnd, message, wParam, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sm_client_thread (gpointer smclient)
|
||||
{
|
||||
HINSTANCE instance;
|
||||
WNDCLASSEXW wcl;
|
||||
ATOM klass;
|
||||
HWND window;
|
||||
MSG msg;
|
||||
|
||||
instance = GetModuleHandle (NULL);
|
||||
|
||||
memset (&wcl, 0, sizeof (WNDCLASSEX));
|
||||
wcl.cbSize = sizeof (WNDCLASSEX);
|
||||
wcl.lpfnWndProc = sm_client_win32_window_procedure;
|
||||
wcl.hInstance = instance;
|
||||
wcl.lpszClassName = L"EggSmClientWindow";
|
||||
klass = RegisterClassEx (&wcl);
|
||||
|
||||
window = CreateWindowEx (0, MAKEINTRESOURCE (klass),
|
||||
L"EggSmClientWindow", 0,
|
||||
10, 10, 50, 50, GetDesktopWindow (),
|
||||
NULL, instance, NULL);
|
||||
SetWindowLongPtr (window, GWLP_USERDATA, (LONG_PTR)smclient);
|
||||
|
||||
/* main loop */
|
||||
while (GetMessage (&msg, NULL, 0, 0))
|
||||
DispatchMessage (&msg);
|
||||
}
|
|
@ -320,23 +320,7 @@ egg_sm_client_get (void)
|
|||
if (global_client_mode != EGG_SM_CLIENT_MODE_DISABLED &&
|
||||
!sm_client_disable)
|
||||
{
|
||||
#if defined (GDK_WINDOWING_WIN32)
|
||||
global_client = egg_sm_client_win32_new ();
|
||||
#elif defined (GDK_WINDOWING_QUARTZ)
|
||||
global_client = egg_sm_client_osx_new ();
|
||||
#else
|
||||
/* If both D-Bus and XSMP are compiled in, try XSMP first
|
||||
* (since it supports state saving) and fall back to D-Bus
|
||||
* if XSMP isn't available.
|
||||
*/
|
||||
# ifdef EGG_SM_CLIENT_BACKEND_XSMP
|
||||
global_client = egg_sm_client_xsmp_new ();
|
||||
# endif
|
||||
# ifdef EGG_SM_CLIENT_BACKEND_DBUS
|
||||
if (!global_client)
|
||||
global_client = egg_sm_client_dbus_new ();
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Fallback: create a dummy client, so that callers don't have
|
||||
|
|
|
@ -47,9 +47,6 @@ pluma/pluma-view.c
|
|||
pluma/pluma-window.c
|
||||
plugins/changecase/changecase.pluma-plugin.desktop.in
|
||||
plugins/changecase/pluma-changecase-plugin.c
|
||||
plugins/checkupdate/checkupdate.pluma-plugin.desktop.in
|
||||
plugins/checkupdate/pluma-check-update-plugin.c
|
||||
plugins/checkupdate/org.mate.pluma.plugins.checkupdate.gschema.xml.in.in
|
||||
plugins/docinfo/docinfo.pluma-plugin.desktop.in
|
||||
[type: gettext/glade]plugins/docinfo/docinfo.ui
|
||||
plugins/docinfo/pluma-docinfo-plugin.c
|
||||
|
|
|
@ -359,7 +359,6 @@ test_remote ()
|
|||
saver_test_data_new (DEFAULT_REMOTE_URI, "hello world\n\n", NULL));
|
||||
}
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
static void
|
||||
check_permissions (GFile *file,
|
||||
guint permissions)
|
||||
|
@ -455,7 +454,6 @@ test_local_permissions ()
|
|||
test_permissions (DEFAULT_LOCAL_URI, 0666);
|
||||
test_permissions (DEFAULT_LOCAL_URI, 0760);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
test_local_unowned_directory ()
|
||||
|
@ -483,7 +481,6 @@ test_remote_unowned_directory ()
|
|||
NULL));
|
||||
}
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
static void
|
||||
test_remote_permissions ()
|
||||
{
|
||||
|
@ -548,8 +545,6 @@ test_remote_unowned_group ()
|
|||
test_unowned_group (UNOWNED_GROUP_REMOTE_URI);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
check_unowned_directory ()
|
||||
{
|
||||
|
@ -665,7 +660,6 @@ check_unowned_group ()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
if ((g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE) & ACCESSPERMS) != 0660)
|
||||
{
|
||||
g_object_unref (unowned);
|
||||
|
@ -674,7 +668,6 @@ check_unowned_group ()
|
|||
g_object_unref (info);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
g_object_unref (info);
|
||||
g_object_unref (unowned);
|
||||
|
@ -721,7 +714,6 @@ int main (int argc,
|
|||
/* g_test_add_func ("/document-saver/remote-unowned-group", test_remote_unowned_group); */
|
||||
}
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
g_test_add_func ("/document-saver/local-permissions", test_local_permissions);
|
||||
|
||||
if (have_unowned_group)
|
||||
|
@ -730,7 +722,6 @@ int main (int argc,
|
|||
}
|
||||
|
||||
g_test_add_func ("/document-saver/remote-permissions", test_remote_permissions);
|
||||
#endif
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
# Stuff to build the Windows installer:
|
||||
EXTRA_DIST = pluma.iss.in build-installer.sh querymodules.bat
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
17
win32/README
17
win32/README
|
@ -1,17 +0,0 @@
|
|||
To create the Windows installer for pluma, ideally all you have to do is to run
|
||||
the build-installer script, after having installed all dependencies to the
|
||||
correct places (that means precompiled ones to /, and self-built
|
||||
ones to /local/). Also, you will need to have Python at C:\Python25.
|
||||
The Inno Setup compiler (iscc) needs to be in your PATH.
|
||||
|
||||
There are many paths hardcoded to fit my own build environment. Feel free to
|
||||
generalize the script, to make it more adaptive to other environments.
|
||||
|
||||
The script takes an argument which is the revision number of the installer. If
|
||||
it is not given, then it uses 1 as revision number. The revision number should
|
||||
be increased every time the installer for the same pluma version is updated,
|
||||
and be reset to 1 for a new pluma version.
|
||||
|
||||
Ignacio Casal Quinteiro <nacho.resa@gmail.com>
|
||||
|
||||
This script was based in Armin Burgmeier script for glom.
|
|
@ -1,258 +0,0 @@
|
|||
#!/bin/sh
|
||||
echo "You need to execute this on a Windows machine within msys (http://www.mingw.org)"
|
||||
echo "You also need InnoSetup (http://www.innosetup.org) with iscc in your PATH"
|
||||
echo "You need to have python, pygobject, pycairo and pygtk installed into C:\\Python26"
|
||||
echo "Make sure pluma and all its dependencies have been installed correctly to /local"
|
||||
echo "You can specify the paths by yourself:"
|
||||
echo "./build-installer.sh VERSION GTK_PREFIX PLUMA_PREFIX GTKSOURCEVIEW_PREFIX PYTHON_PREFIX MISC_PREFIX ASPELL_PREFIX WINDOWS_PREFIX"
|
||||
|
||||
# we assume glib, gtk etc were installed in the root while pluma and gtksourceview
|
||||
# in /local
|
||||
#FIXME we need to figure out a way for autodetecting this
|
||||
if test "$#" = 7; then
|
||||
_gtk_prefix="$2"
|
||||
_gtksourceview_prefix="$3"
|
||||
_pluma_prefix="$4"
|
||||
_python_prefix="$5"
|
||||
_misc_prefix="$6"
|
||||
_aspell_prefix="$7"
|
||||
_windows_prefix="$8"
|
||||
else
|
||||
_gtk_prefix="/c/gtk"
|
||||
_gtksourceview_prefix="/usr/local"
|
||||
_pluma_prefix="/usr/local"
|
||||
_python_prefix="/c/Python26"
|
||||
_misc_prefix="/usr"
|
||||
_aspell_prefix="/c/Aspell"
|
||||
_windows_prefix="/c/WINDOWS/system32"
|
||||
fi
|
||||
|
||||
if test "$1" = '--help'; then
|
||||
echo "VERSION: The version of the installer"
|
||||
echo "GTK_PREFIX: The path for gtk, by default /c/gtk"
|
||||
echo "PLUMA_PREFIX: The path for pluma, by default /usr/local"
|
||||
echo "GTKSOURCEVIEW_PREFIX: The path for gtksourceview, by default /usr/local"
|
||||
echo "PYTHON_PREFIX: The path for python, by default /c/Python25"
|
||||
echo "MISC_PREFIX: The path for the rest of dependencies: i.e: enchant: by default /usr"
|
||||
echo "ASPELL_PREFIX: The path for Aspell: by default /c/Aspell"
|
||||
exit
|
||||
fi
|
||||
|
||||
revision=$1
|
||||
if test "$revision" = ''; then
|
||||
echo "Installer revision not provided, assuming 1"
|
||||
revision=1
|
||||
fi
|
||||
|
||||
echo "Cleanup..."
|
||||
if test -e installer; then
|
||||
rm installer -Rf || exit;
|
||||
fi
|
||||
|
||||
mkdir -p installer || exit
|
||||
|
||||
echo "Copying the docs..."
|
||||
mkdir -p installer/pluma/share/doc || exit
|
||||
cp ../COPYING installer/pluma/share/doc || exit
|
||||
cp ../AUTHORS installer/pluma/share/doc || exit
|
||||
cp ../README installer/pluma/share/doc || exit
|
||||
|
||||
echo "Copying gtk DLL files..."
|
||||
|
||||
#----------------------------- gtk ------------------------------------
|
||||
mkdir -p installer/gtk/bin
|
||||
|
||||
cp "${_gtk_prefix}/bin/libglib-2.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libgio-2.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libgmodule-2.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libgobject-2.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libgthread-2.0-0.dll" installer/gtk/bin || exit
|
||||
|
||||
# TODO: We can probably omit these, as we do not use g_spawn on Windows anymore
|
||||
cp "${_gtk_prefix}/bin/gspawn-win32-helper.exe" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/gspawn-win32-helper-console.exe" installer/gtk/bin || exit
|
||||
|
||||
cp "${_gtk_prefix}/bin/libatk-1.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libcairo-2.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libpng12-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libjpeg-7.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libtiff-3.dll" installer/gtk/bin || exit
|
||||
|
||||
cp "${_gtk_prefix}/bin/libpango-1.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libpangocairo-1.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libpangowin32-1.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libpangoft2-1.0-0.dll" installer/gtk/bin || exit
|
||||
|
||||
cp "${_gtk_prefix}/bin/libgdk-win32-2.0-0.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libgdk_pixbuf-2.0-0.dll" installer/gtk/bin || exit
|
||||
|
||||
cp "${_gtk_prefix}/bin/libgtk-win32-2.0-0.dll" installer/gtk/bin || exit
|
||||
|
||||
cp "${_gtk_prefix}/bin/libgailutil-18.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libfontconfig-1.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/libexpat-1.dll" installer/gtk/bin || exit
|
||||
cp "${_gtk_prefix}/bin/freetype6.dll" installer/gtk/bin || exit
|
||||
|
||||
echo "Stripping DLL files..."
|
||||
strip installer/gtk/bin/*.dll || exit
|
||||
strip installer/gtk/bin/*.exe || exit
|
||||
|
||||
#Copy zlib1 after stripping, as we strip this library it makes crash pluma
|
||||
cp "${_gtk_prefix}/bin/zlib1.dll" installer/gtk/bin || exit
|
||||
|
||||
#-------------------------------- pluma ------------------------------------
|
||||
echo "Copying misc DLL files..."
|
||||
mkdir -p installer/pluma/bin
|
||||
|
||||
cp "${_misc_prefix}/bin/libgettextpo-0.dll" installer/pluma/bin || exit
|
||||
|
||||
cp "${_misc_prefix}/bin/libMateCORBA-2-0.dll" installer/pluma/bin || exit
|
||||
cp "${_misc_prefix}/bin/libMateCORBACosNaming-2-0.dll" installer/pluma/bin || exit
|
||||
cp "${_misc_prefix}/bin/libMateCORBA-imodule-2-0.dll" installer/pluma/bin || exit
|
||||
|
||||
cp "${_misc_prefix}/bin/libmateconf-2-4.dll" installer/pluma/bin || exit
|
||||
|
||||
cp "${_misc_prefix}/bin/libenchant.dll" installer/pluma/bin || exit
|
||||
cp "${_misc_prefix}/bin/libsoup-2.4-1.dll" installer/pluma/bin || exit
|
||||
|
||||
cp "${_gtksourceview_prefix}/bin/libgtksourceview-2.0-0.dll" installer/pluma/bin || exit
|
||||
|
||||
echo "Stripping DLL files..."
|
||||
strip installer/pluma/bin/*.dll || exit
|
||||
|
||||
|
||||
# stripping libxml2.dll renders it unusable (although not changing it in size).
|
||||
# We therefore copy it after having stripped the rest. Same with the other DLLs
|
||||
# here. Perhaps those were built with MSVC.
|
||||
cp "${_misc_prefix}/bin/libxml2-2.dll" installer/pluma/bin || exit
|
||||
cp "${_misc_prefix}/bin/intl.dll" installer/pluma/bin || exit
|
||||
cp "${_misc_prefix}/bin/iconv.dll" installer/pluma/bin || exit
|
||||
|
||||
|
||||
echo "Copying Python..."
|
||||
|
||||
# TODO: Find out Windows directory somehow, we should use WINDIR substuting c:\?
|
||||
cp ${_windows_prefix}/python26.dll installer/pluma/bin || exit
|
||||
|
||||
# We through all python modules into python/. pluma sets PYTHONPATH accordingly.
|
||||
mkdir -p installer/python || exit
|
||||
|
||||
# Copy the dlls needed to run python
|
||||
cp -R ${_python_prefix}/DLLs installer/python || exit
|
||||
|
||||
# TODO: Perhaps some scripts need more python modules.
|
||||
mkdir -p installer/python/Lib || exit
|
||||
cp ${_python_prefix}/Lib/*.py installer/python/Lib || exit
|
||||
|
||||
mkdir -p installer/python/Lib/encodings || exit
|
||||
cp ${_python_prefix}/Lib/encodings/*.py installer/python/Lib/encodings || exit
|
||||
|
||||
cp -R ${_python_prefix}/Lib/site-packages installer/python/Lib || exit
|
||||
|
||||
cp -R ${_python_prefix}/Lib/xml installer/python/Lib || exit
|
||||
|
||||
mkdir -p installer/python/Lib/sqlite3 || exit
|
||||
cp ${_python_prefix}/Lib/sqlite3/*.py installer/python/Lib/sqlite3 || exit
|
||||
|
||||
echo "Copying modules..."
|
||||
|
||||
cp "${_gtk_prefix}/bin/gtk-query-immodules-2.0.exe" installer/gtk/bin || exit
|
||||
|
||||
mkdir -p installer/gtk/lib/gtk-2.0/2.10.0/engines || exit
|
||||
cp "${_gtk_prefix}/lib/gtk-2.0/2.10.0/engines/libwimp.dll" installer/gtk/lib/gtk-2.0/2.10.0/engines || exit
|
||||
strip installer/gtk/lib/gtk-2.0/2.10.0/engines/libwimp.dll || exit
|
||||
|
||||
mkdir -p installer/gtk/lib/gtk-2.0/2.10.0/loaders || exit
|
||||
cp "${_gtk_prefix}/lib/gtk-2.0/2.10.0/loaders/"*.dll installer/gtk/lib/gtk-2.0/2.10.0/loaders || exit
|
||||
strip installer/gtk/lib/gtk-2.0/2.10.0/loaders/*.dll || exit
|
||||
cp "${_gtk_prefix}/bin/gdk-pixbuf-query-loaders.exe" installer/gtk/bin || exit
|
||||
|
||||
# Gail
|
||||
mkdir -p installer/gtk/lib/gtk-2.0/modules || exit
|
||||
cp "${_gtk_prefix}/lib/gtk-2.0/modules/libgail.dll" installer/gtk/lib/gtk-2.0/modules || exit
|
||||
strip installer/gtk/lib/gtk-2.0/modules/libgail.dll
|
||||
|
||||
# TODO: Can we omit this?
|
||||
mkdir -p installer/gtk/etc/gtk-2.0
|
||||
#cp "${_gtk_prefix}/etc/gtk-2.0/gtk.immodules" installer/etc/gtk-2.0 || exit -1
|
||||
cp "${_gtk_prefix}/etc/gtk-2.0/gdk-pixbuf.loaders" installer/gtk/etc/gtk-2.0 || exit -1
|
||||
|
||||
mkdir -p installer/gtk/share/themes || exit
|
||||
cp -R "${_gtk_prefix}/share/themes/MS-Windows" installer/gtk/share/themes || exit
|
||||
mkdir -p installer/gtk/etc/gtk-2.0 || exit
|
||||
echo "gtk-theme-name = \"MS-Windows\"" > installer/gtk/etc/gtk-2.0/gtkrc || exit
|
||||
|
||||
# Enchant
|
||||
mkdir -p installer/pluma/lib/enchant || exit
|
||||
cp "${_misc_prefix}/lib/enchant/"* installer/pluma/lib/enchant || exit
|
||||
strip installer/pluma/lib/enchant/*.dll || exit
|
||||
mkdir -p installer/pluma/share/enchant || exit
|
||||
cp "${_misc_prefix}/share/enchant/"* installer/pluma/share/enchant || exit
|
||||
|
||||
# Iso codes
|
||||
mkdir -p installer/pluma/share/iso-codes || exit
|
||||
cp "${_misc_prefix}/share/iso-codes/"* installer/pluma/share/iso-codes || exit
|
||||
mkdir -p installer/pluma/share/xml/iso-codes || exit
|
||||
cp "${_misc_prefix}/share/xml/iso-codes/"* installer/pluma/share/xml/iso-codes || exit
|
||||
|
||||
echo "Copying locales..."
|
||||
|
||||
# We need to keep the locale files from share/locale in share/locale and those
|
||||
# from lib/locale in lib/locale:
|
||||
mkdir -p installer/locale/share/ || exit
|
||||
cp "${_gtk_prefix}/share/locale" installer/locale/share/ -R || exit
|
||||
cp "${_pluma_prefix}/share/locale" installer/locale/share/ -R || exit
|
||||
cp "${_misc_prefix}/share/locale" installer/locale/share/ -R || exit
|
||||
|
||||
find installer/locale/share/locale/ -type f | grep -v atk10.mo | grep -v gtk20.mo | grep -v MateConf2.mo | grep -v glib20.mo | grep -v pluma.mo | grep -v gtk20.mo | grep -v gtk20-properties.mo | grep -v gtksourceview-2.0.mo | grep -v iso_*.mo | xargs rm
|
||||
find installer/locale/share/locale -type d | xargs rmdir -p --ignore-fail-on-non-empty
|
||||
|
||||
echo "Copying executable..."
|
||||
cp "${_pluma_prefix}/bin/pluma.exe" installer/pluma/bin || exit
|
||||
strip installer/pluma/bin/pluma.exe || exit
|
||||
|
||||
|
||||
echo "Copying shared data (ui files, icons, etc.)..."
|
||||
|
||||
mkdir -p installer/pluma/share/gtksourceview-2.0 || exit
|
||||
cp -R "${_gtksourceview_prefix}/share/gtksourceview-2.0/language-specs" installer/pluma/share/gtksourceview-2.0 || exit
|
||||
cp -R "${_gtksourceview_prefix}/share/gtksourceview-2.0/styles" installer/pluma/share/gtksourceview-2.0 || exit
|
||||
|
||||
#GtkBuilder files and xml files
|
||||
mkdir -p installer/pluma/share/pluma/ui || exit
|
||||
cp "${_pluma_prefix}/share/pluma/ui/"* installer/pluma/share/pluma/ui || exit
|
||||
|
||||
#Icons & logo
|
||||
mkdir -p installer/pluma/share/pluma/icons || exit
|
||||
cp "${_pluma_prefix}/share/pluma/icons/pluma-plugin.png" installer/pluma/share/pluma/icons || exit
|
||||
|
||||
#Plugins
|
||||
mkdir -p installer/pluma/share/pluma/plugins || exit
|
||||
cp -R "${_pluma_prefix}/share/pluma/plugins/"* installer/pluma/share/pluma/plugins || exit
|
||||
mkdir -p installer/pluma/lib/pluma/plugins || exit
|
||||
cp -R "${_pluma_prefix}/lib/pluma/plugins/"* installer/pluma/lib/pluma/plugins || exit
|
||||
mkdir -p installer/pluma/lib/pluma/plugin-loaders || exit
|
||||
cp -R "${_pluma_prefix}/lib/pluma/plugin-loaders/"* installer/pluma/lib/pluma/plugin-loaders || exit
|
||||
|
||||
#MateConf
|
||||
mkdir -p installer/pluma/etc/mateconf/schemas || exit
|
||||
cp "${_pluma_prefix}/etc/mateconf/schemas/"* installer/pluma/etc/mateconf/schemas || exit
|
||||
cp -R "${_misc_prefix}/etc/mateconf/"* installer/pluma/etc/mateconf/ || exit
|
||||
mkdir -p installer/pluma/lib/MateConf/2
|
||||
cp "${_misc_prefix}/lib/MateConf/2/"* installer/pluma/lib/MateConf/2 || exit
|
||||
strip installer/pluma/lib/MateConf/2/*.dll || exit
|
||||
mkdir -p installer/pluma/libexec || exit
|
||||
cp "${_misc_prefix}/libexec/mateconfd-2.exe" installer/pluma/libexec || exit
|
||||
|
||||
#Aspell
|
||||
mkdir -p installer/pluma/data || exit
|
||||
cp "${_aspell_prefix}/data/"* installer/pluma/data || exit
|
||||
cp "${_aspell_prefix}/bin/aspell-15.dll" installer/pluma/bin/libaspell-15.dll || exit
|
||||
|
||||
echo "Creating installer..."
|
||||
|
||||
perl -pe "s/INSTALLERREVISION/$revision/" pluma.iss > installer/pluma.iss || exit
|
||||
#cp installer || exit
|
||||
iscc installer/pluma.iss || exit
|
||||
|
||||
echo "Done"
|
|
@ -1,60 +0,0 @@
|
|||
[Setup]
|
||||
AppName=pluma
|
||||
AppVerName=pluma @VERSION@
|
||||
DefaultDirName={pf}\pluma
|
||||
DefaultGroupName=pluma
|
||||
UninstallDisplayIcon={app}\pluma.exe
|
||||
Uninstallable=yes
|
||||
AppPublisher=MATE
|
||||
AppPublisherURL=http:\\www.mate-desktop.org\
|
||||
AppVersion=@VERSION@
|
||||
OutputBaseFilename=pluma-setup-@VERSION@-INSTALLERREVISION
|
||||
LicenseFile=pluma\share\doc\COPYING
|
||||
|
||||
[Components]
|
||||
Name: "gtk"; Description: "GTK+ runtime environment"; Types: full compact custom; Flags: fixed
|
||||
Name: "main"; Description: "Pluma"; Types: full compact custom; Flags: fixed
|
||||
|
||||
; TODO: Enable languages separately
|
||||
Name: "python"; Description: "Python runtime and modules"; Types: full compact custom; Flags: fixed
|
||||
Name: "locale"; Description: "Translations"; Types: full compact custom; Flags: fixed
|
||||
|
||||
[Tasks]
|
||||
Name: common; Description: "For all users"; Components: main; Flags: exclusive
|
||||
Name: user; Description: "For the current user only"; Components: main; Flags: exclusive unchecked
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
|
||||
[Icons]
|
||||
; Common task icons
|
||||
Name: "{commonprograms}\{groupname}\pluma"; Filename: "{app}\bin\pluma.exe"; Tasks: common
|
||||
Name: "{commonprograms}\{groupname}\Uninstall pluma"; Filename: "{uninstallexe}"; Tasks: common
|
||||
Name: "{commondesktop}\pluma"; Filename: "{app}\bin\pluma.exe"; Tasks: desktopicon
|
||||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\pluma"; Filename: "{app}\bin\pluma.exe"; Tasks: quicklaunchicon
|
||||
|
||||
; User task icons
|
||||
Name: "{userprograms}\{groupname}\pluma"; Filename: "{app}\bin\pluma.exe"; Tasks: user
|
||||
Name: "{userprograms}\{groupname}\Uninstall pluma"; Filename: "{uninstallexe}"; Tasks: user
|
||||
|
||||
[Files]
|
||||
|
||||
; All files
|
||||
Source: "gtk\*"; DestDir: "{app}\"; Components: gtk; Flags: recursesubdirs
|
||||
Source: "pluma\*"; DestDir: "{app}\"; Components: main; Flags: recursesubdirs
|
||||
Source: "python\*"; DestDir: "{app}\bin"; Components: python; Flags: recursesubdirs
|
||||
Source: "locale\*"; DestDir: "{app}\"; Components: locale; Flags: recursesubdirs
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\bin\querymodules.bat"; StatusMsg: "Querying modules..."; Flags: runhidden
|
||||
|
||||
[Code]
|
||||
{ Remove generated files not generated by the installer }
|
||||
|
||||
// Skip Components selection, all components are required anyway
|
||||
function ShouldSkipPage(CurPageID: Integer): Boolean;
|
||||
begin
|
||||
if CurPageID = wpSelectComponents then
|
||||
Result := True
|
||||
else
|
||||
Result := False;
|
||||
end;
|
|
@ -1,3 +0,0 @@
|
|||
rem pango-querymodules.exe > ../etc/pango/pango.modules
|
||||
gdk-pixbuf-query-loaders.exe > ../etc/gtk-2.0/gdk-pixbuf.loaders
|
||||
gtk-query-immodules-2.0.exe > ../etc/gtk-2.0/gtk.immodules
|
Loading…
Reference in New Issue