diff --git a/ChangeLog b/ChangeLog index 86d8569..fc9ad42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-09-08 + + version 0.8.18.1.3: + * Fix encoding and newline selection (a bug NOT in Leafpad, ouch!) + * Support GtkGrid + * Provide a clearsigned SHA1SUMS using + RSA key ID BE8BA819 and DSA key ID E98D6159 + 2011-09-05 version 0.8.18.1.2: diff --git a/Makefile.am b/Makefile.am index e432322..c1f9ef7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1 @@ -SUBDIRS = src data po - -EXTRA_DIST = \ - intltool-extract.in intltool-merge.in intltool-update.in +SUBDIRS = data po src diff --git a/Makefile.in b/Makefile.in index 5be418a..c34ec32 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,15 +35,14 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - compile config.guess config.sub depcomp install-sh missing \ - mkinstalldirs + compile depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -214,10 +213,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = src data po -EXTRA_DIST = \ - intltool-extract.in intltool-merge.in intltool-update.in - +SUBDIRS = data po src all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/README b/README index e1e53aa..860837a 100644 --- a/README +++ b/README @@ -10,7 +10,7 @@ are implemented in the editor. L3afpad is simple to use, is easily compiled, requires few libraries, and starts up quickly. This program is released under the GNU General Public License (GPL) version 2, -see the file 'COPYING' for more information. +see the file 'gpl-2.0.txt' for more information. Features @@ -39,8 +39,6 @@ Simple install procedure: [ Become root if necessary ] # make install-strip # install L3afpad -See the file 'INSTALL' for more detailed information. - Keybindings =========== diff --git a/SHA1SUMS b/SHA1SUMS new file mode 100644 index 0000000..6063ddd --- /dev/null +++ b/SHA1SUMS @@ -0,0 +1,124 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1,SHA512 + +634071380936e4893b0e8cacdfcd344638406575 171 AUTHORS +50a0e2caef12c331a3c95001ffcba51617c3c204 9183 ChangeLog +0beb31ee37259edeb621d345db933f2c827b2a21 22 Makefile.am +32ae3f99a247e614dcad4cfb2156a8d992ab53d0 22228 Makefile.in +04dc937708d52f3b9b6f9a096898c5e23fb80ace 2071 README +e8059be7927ee878a209d09c6b0b882efeb552e1 66001 aclocal.m4 +08e7ff6a0bc9382beae57974c3ac95c9ac565faa 3769 compile +043325a2386905b51ee710e9f087ede0babb1582 2270 config.h.in +95b14b7bc5b26190ce20fcd52e8bd444a24289c7 230835 configure +354c7221d0f6584f3c3bd5a4d269f21429201ee1 883 configure.ac +c5431839bbf6b9730c1909bd298b3de52173da75 247 data/Makefile.am +4497d54143e764fc5a147d6c3f9b9df932f9203c 12544 data/Makefile.in +341ac8179d9307b2769eafc24266c8fcd440a6d8 174 data/l3afpad.desktop.in +8cc36795a560edddf585ab069d7670e5c78213d6 2768 data/l3afpad.png +ed913883150c97b3a48a4363b8609fe577dfed07 4555 data/l3afpad.xpm +6749a6b5ab2b3edd45d38ac560759c641cd50200 18615 depcomp +4cc77b90af91e615a64ae04893fdffa7939db84c 18092 gpl-2.0.txt +d30e962a3de2da09ab0a9a7979bee787922464a1 13663 install-sh +01a6b4bf79aca9b556822601186afab86e8c4fbf 26530 lgpl-2.1.txt +aeef20c1028a7ac4b904dd51b4c40376eba21350 11419 missing +ead91d3c7d4c3ca3172041ce36e23ee487066902 6881 po/ChangeLog +0640d6d14812d6323dbb683259046b95a6c0ceb5 169 po/LINGUAS +ce1c3468fcd9afcacfb197457ae3c40ea97f585f 6911 po/Makefile.in.in +610fcd63bc842d466f948e96e625fb3927202b32 135 po/POTFILES.in +1abde2a0918a5e08502d84047d9bc65c0441bd55 5947 po/bg.po +35501c0eaff18979ef115a04a7e0bdae233f74c9 5264 po/br.po +703fa4b2e5ce144c0b7151a3e702febcb11d5d4d 4898 po/ca.po +709e314887b42431f9a896e39fad05075ed2e1a5 4815 po/cs.po +a1731e206e48a7e76c46867637e997b83e26fced 5486 po/da.po +00f64edde15d34d896ad1b48bd1f967722a51761 5184 po/de.po +12b8e546eff912f3179773711f09f42ee90fbc1b 5864 po/el.po +4164574361f31aaf3180500bf76591da178267ad 4786 po/eo.po +07512d0c7f94052084c3606eb78965f0a7d0078e 4926 po/es.po +068c7f3c38df583613af4341c1a85b61e923fdc4 5005 po/eu.po +aa17b2614a12cdde6d39531db897fcaad7d06955 4943 po/fi.po +a55a52d64efe7db16f39b2203024e4ad412c4a15 5262 po/fr.po +4725e3351924f81bba3f5d0a2a441ebe4b0cbab1 4911 po/ga.po +6aae96a1217e7aec27812d49e4a3b9eb3e59245a 5443 po/gl.po +4cb77cbab55534cd5efd482a24964888614a8ea2 5051 po/he.po +ef5cabced9ffb6808012d4fa69d0627431adb7c8 5180 po/hu.po +e238d626502e32916c62517d11f4040e010905c6 4827 po/id.po +ec625438b4f05e2df23f7a0c3174f5bd72e53907 5022 po/it.po +6b4d5ff8d0c6997e9c8a36f9ec6a0ee97294c07f 5216 po/ja.po +5cf424964a586cb52cbee8e31d0e2c3da88e9ab3 4817 po/ko.po +29a85e608edd8747132bf682f57c06d37d1428da 4918 po/lt.po +03091b5055bab9b1c1853d1040e6b3c6fa07d2ad 5038 po/lv.po +b05e2ad4e44beaac97a26bfe2b631f4964a2a46c 5108 po/nl.po +e8b5410d074596617f28e992caf27199ffa4c2aa 5217 po/nn.po +e909ebe2a7b2ea27617675f0531904302487c42d 6436 po/pl.po +eb67d4c031310274bcb586c69aa857b84631861b 4911 po/pt.po +985fef0047dfbf433334ee9093da1834b9048f1e 5026 po/pt_BR.po +b091b66da6d1e7aad35df9605fb53a7f60838f43 5480 po/ru.po +2efe3079f4b30c4befe9e0ef134cbe7105396054 4975 po/sk.po +6f485449eaa6bb7e8b9fc75ced10929b4f328a33 5149 po/sl.po +e145b2413f6b972bfe1ba5180d4a184c42c9308c 5658 po/sr.po +de20cd84a7e889a1910beaefb1e9185efcbe3c15 4888 po/sv.po +3f1cd9b2bfc2063dd9cbb1b2c98802f2fd86ca5f 6153 po/ta.po +86ebe253dfe474d5064e64c41fada29b6fe18eb4 4951 po/tr.po +bbfba656c7b520c033b440407f3b326af6a7fb70 5782 po/uk.po +5dffb74471a502cdacb8d118175df14812afaaa7 5158 po/vi.po +f480b775778bf342a743124d30c21f205f00d6f4 4982 po/zh_CN.po +a1eac2664221c8757f3d642b93552b52ed0fb6b5 4960 po/zh_TW.po +5436cb3b94928a04328d697be5716f4e71aa4e0f 583 src/Makefile.am +23b1dac1edc2f3a415a6ceeac9c821a05332de37 50150 src/Makefile.in +56b7c80c5f8a17819ab6a078d01197a393755d15 8265 src/callback.c +3d28029623e9d2251392de8c9ab30647be4c38d1 1631 src/callback.h +3fcc1c61e32b6d0611e76bf4f885533482fee487 2582 src/dialog.c +0651e705696688f15d124e86d76e8cd7298393bd 1127 src/dialog.h +a30834e8ff24d95828cf8265b1e3e0feddd204d4 6764 src/dnd.c +5f28dec9ccd8eebb58e25877057576bc6e276e34 909 src/dnd.h +d9dc41cb508b056b4e3848fac280c3335fdda3c7 6723 src/emacs.c +24279f8befe55dce2157382398c97c0040dcb3ac 956 src/emacs.h +c3d84301cd67dcfd7396f60355f54f7c00945dbd 11332 src/encoding.c +6f7d53179676cfa352482a630f1d796a3a00f80c 1422 src/encoding.h +7e271e8064c11df22d5a2f574c4e595c3ac1793a 5855 src/file.c +861011b730c85c185d7a05cd10a1d63520648546 1254 src/file.h +ebd263a67797b54d311ebf60a39482f990a768f9 2245 src/font.c +b73558fe7e17a6cf441d1ff922ee3ee018060643 1070 src/font.h +545fa27823583624fee92eeaa8b8c0b39a8a5870 6885 src/gtkprint.c +be9c382045d0fc1fb5eeabc8ed3493f1736e8f57 1046 src/gtkprint.h +bb9ebe7f9ee8d1e3f0c7663f03d15d30d2ce17f1 17436 src/gtksourceiter.c +1a0550b24ac6dfabcd2b0c5065ab79ad2340c39a 1862 src/gtksourceiter.h +f6b21adcfc00151deba02a4339ea5883a7b8f411 2486 src/hlight.c +828e51d43aaa64cbaa492baf761d053bba6b02dd 1019 src/hlight.h +88ed5855fed283f685d93f6504e0c2717259b8ba 6775 src/indent.c +bb2a52d5a1969da5a312b91bbba32d0489a48871 1334 src/indent.h +fe86394925b4c38a947038c103f7e97f61e6c12c 3057 src/l3afpad.h +3c982692110d9c2fc653efb8e8f4a468ffe115cd 9583 src/linenum.c +6f63e2c07f844c7ba97c77d3e7234d30560a09f0 983 src/linenum.h +7fbac5e5272a0b8277e64b1d131224e783b42e0a 8360 src/main.c +f53a6e54f4121d11fc315c0bebafe5e611738a8d 8598 src/menu.c +a7de57aa7b8e7bc0b97ee70eb7b82543ccef553d 1176 src/menu.h +572e07e6bd163dfc55ddcfd57cf5cabfdb45b9e5 14763 src/search.c +cee72ed3fd94d1637021e9c73602f109f7af06d1 1054 src/search.h +de6b8830c63963736fa5243d9e41e1739238d20d 12527 src/selector.c +5af4e5fa14e8ab0106b07f15a74777124df098a8 1019 src/selector.h +609fd713cef54955274804dadd59d51fbc3e7aa4 10743 src/undo.c +13e3a08982c1aee8ea5bedb3e76ac33f3f161290 1211 src/undo.h +db205a5a6aa876fd5764a3ee1e4bdef8d82c2433 2746 src/utils.c +e700377b8a734da1fc62cde0e735ea3b0be3b3ff 1026 src/utils.h +87454d9941ac4e2f6ca2c9ae689a0c6dbca1b000 11207 src/view.c +f9797a035a29fe5e6f1137d20fb916c573bd1bea 1276 src/view.h +8611757f226b3254ab81a860e194f1704c49a3cf 3068 src/window.c +2b419507bce0a451781183f98de60868071bc2b1 1065 src/window.h +-----BEGIN PGP SIGNATURE----- + +iEYEARECAAYFAk5orUIACgkQdEpXpumNYVmfkACeIdMycslGqug085z9g1QzppGl +ovAAoIxm2wG0MsV2Uvlq5g5U5Qd8TpDdiQIcBAEBCgAGBQJOaK1CAAoJELc3H0m+ +i6gZfzIP/RQ3JfdL6QrC8ekkmMSAeIpsvNmP5Cb7jF8h4cT6Vsp4S53tR6322UzL +MBGVwly6fvOfaU9adhMDGZD9FtkWuWIes61oNlSysyXjxauhrWOpM+aOWUtEKAxr +x0TYk+28rBQU0S5+bQjKGQ+2tzZzRM8uuOEE7tc9gjwHrb+EBJ3chy6D16BnF7uv +gpxyaLckaJYXnc8UJuOpYvAmg3SGfs6YBQn8eO/hLKI3JJdS3wfv4D/TFQL7sPEk +EksiYAYOkmIXsKpLxsAh7Z3TwtYbFg5BDZAYj9vnBY6ngN/SXBUgQtO/GGo5RLNU +bQUeA/Fg+Y9eMVuXD4yfsAQXFUa1WfLDYV5HtCaH4/i8q3cEBk+m0XU253NXLxkN +WIMyPehc2kQCf6mE2xPpiL4Eku5+hbVXQNT6auHVqdULW3dXWX9FLJ0Z9YlplU2+ ++0ox8qd5TJv0conIPTBtkxikl9LbdylsM0WBz0C5M1tbkrfYB7Zdp9n6jUgH3xcT +5eFpLF52ekmxk4UqGBx905NyUQcvCbDHBgXPsC41SMmuoP1SXI9fUAyOSl2Aj8Lw +Vk25Tv9kTgtWVwpTGCALfklQRkPtDA+wPaFJ0PCIpOXBaPr/Uf2EBWfOimaoP4rk +wMzyTosCPOAUrqe86kYjUHjEKFnSVGKwXYQBKVv9j+XKBuY4P/sv +=fHtw +-----END PGP SIGNATURE----- diff --git a/compile b/compile index 1b1d232..c0096a7 100644 --- a/compile +++ b/compile @@ -1,9 +1,10 @@ #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. -scriptversion=2005-05-14.22 +scriptversion=2009-10-06.20; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,8 +18,7 @@ scriptversion=2005-05-14.22 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -103,13 +103,13 @@ if test -z "$ofile" || test -z "$cfile"; then fi # Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. -# Note: use `[/.-]' here to ensure that we don't use the same name +# Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break @@ -124,9 +124,9 @@ trap "rmdir '$lockdir'; exit 1" 1 2 15 ret=$? if test -f "$cofile"; then - mv "$cofile" "$ofile" + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then - mv "${cofile}bj" "$ofile" + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" @@ -138,5 +138,6 @@ exit $ret # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff --git a/config.h.in b/config.h.in index 6009783..a812f69 100644 --- a/config.h.in +++ b/config.h.in @@ -1,12 +1,12 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define if Emacs key theme is enabled. */ +/* Define to 1 if you enable Emacs key theme. */ #undef ENABLE_EMACS /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS -/* Define if print feature is enabled. */ +/* Define to 0 if you disable print. */ #undef ENABLE_PRINT /* Define to 1 if you have the `bind_textdomain_codeset' function. */ diff --git a/configure b/configure index f9df795..e01e23e 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for L3afpad 0.8.18.1.2. +# Generated by GNU Autoconf 2.68 for L3afpad 0.8.18.1.3. # # Report bugs to . # @@ -560,8 +560,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='L3afpad' PACKAGE_TARNAME='l3afpad' -PACKAGE_VERSION='0.8.18.1.2' -PACKAGE_STRING='L3afpad 0.8.18.1.2' +PACKAGE_VERSION='0.8.18.1.3' +PACKAGE_STRING='L3afpad 0.8.18.1.3' PACKAGE_BUGREPORT='caleb@calno.com' PACKAGE_URL='' @@ -1296,7 +1296,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures L3afpad 0.8.18.1.2 to adapt to many kinds of systems. +\`configure' configures L3afpad 0.8.18.1.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1362,7 +1362,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of L3afpad 0.8.18.1.2:";; + short | recursive ) echo "Configuration of L3afpad 0.8.18.1.3:";; esac cat <<\_ACEOF @@ -1459,7 +1459,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -L3afpad configure 0.8.18.1.2 +L3afpad configure 0.8.18.1.3 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1828,7 +1828,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by L3afpad $as_me 0.8.18.1.2, which was +It was created by L3afpad $as_me 0.8.18.1.3, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -4892,7 +4892,7 @@ fi if test "$GCC" = "yes"; then - CFLAGS="$CFLAGS -Wall -Wextra" + CFLAGS="$CFLAGS -Wall" fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 @@ -5238,27 +5238,22 @@ if test "${enable_print+set}" = set; then : enableval=$enable_print; fi -if test "$enable_print" != "no"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= 3.0.10\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.0.10") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then + if test "$enable_print" = "no"; then -$as_echo "#define ENABLE_PRINT 1" >>confdefs.h +$as_echo "#define ENABLE_PRINT 0" >>confdefs.h -fi -fi + fi # Check whether --enable-emacs was given. if test "${enable_emacs+set}" = set; then : enableval=$enable_emacs; -$as_echo "#define ENABLE_EMACS 1" >>confdefs.h - - fi + if test "$enable_emacs" = "yes"; then + +$as_echo "#define ENABLE_EMACS 1" >>confdefs.h + + fi GETTEXT_PACKAGE="$PACKAGE" @@ -6928,7 +6923,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by L3afpad $as_me 0.8.18.1.2, which was +This file was extended by L3afpad $as_me 0.8.18.1.3, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6994,7 +6989,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -L3afpad config.status 0.8.18.1.2 +L3afpad config.status 0.8.18.1.3 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f116c51..00df34a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(L3afpad, 0.8.18.1.2, caleb@calno.com) +AC_INIT(L3afpad, 0.8.18.1.3, caleb@calno.com) AM_INIT_AUTOMAKE($PACKAGE_TARNAME, $PACKAGE_VERSION) AM_CONFIG_HEADER(config.h) AC_PROG_INTLTOOL(, no-xml) # require >= 0.31 for autoreconf AC_PROG_CC if test "$GCC" = "yes"; then - CFLAGS="$CFLAGS -Wall -Wextra" + CFLAGS="$CFLAGS -Wall" fi AM_PROG_CC_C_O @@ -13,19 +13,18 @@ PKG_CHECK_MODULES(GTK, gtk+-3.0) AC_ARG_ENABLE(print, AC_HELP_STRING([--disable-print], [force to disable print feature])) -if test "$enable_print" != "no"; then - PKG_CHECK_EXISTS(gtk+-3.0 >= 3.0.10, - AC_DEFINE(ENABLE_PRINT, 1, [Define if print feature is enabled.])) -fi + if test "$enable_print" = "no"; then + AC_DEFINE(ENABLE_PRINT, 0, [Define to 0 if you disable print.]) + fi AC_ARG_ENABLE(emacs, - AC_HELP_STRING([--enable-emacs], [implement Emacs key theme (experimental)]), - AC_DEFINE(ENABLE_EMACS, 1, [Define if Emacs key theme is enabled.]) -) + AC_HELP_STRING([--enable-emacs], [implement Emacs key theme (experimental)])) + if test "$enable_emacs" = "yes"; then + AC_DEFINE(ENABLE_EMACS, 1, [Define to 1 if you enable Emacs key theme.]) + fi GETTEXT_PACKAGE="$PACKAGE" AC_SUBST(GETTEXT_PACKAGE) -AM_GLIB_GNU_GETTEXT AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR) AC_OUTPUT([ diff --git a/data/Makefile.am b/data/Makefile.am index 909e3cf..39c2774 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,7 +5,3 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) pixmapsdir = $(datadir)/pixmaps pixmaps_DATA = l3afpad.png l3afpad.xpm - -EXTRA_DIST = \ - $(desktop_DATA) $(desktop_in_files) \ - $(pixmaps_DATA) diff --git a/data/Makefile.in b/data/Makefile.in index bcbd3dd..04e74af 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -38,7 +38,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -187,10 +187,6 @@ desktop_in_files = l3afpad.desktop.in desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) pixmapsdir = $(datadir)/pixmaps pixmaps_DATA = l3afpad.png l3afpad.xpm -EXTRA_DIST = \ - $(desktop_DATA) $(desktop_in_files) \ - $(pixmaps_DATA) - all: all-am .SUFFIXES: diff --git a/data/l3afpad.desktop.in b/data/l3afpad.desktop.in index 6f57f5e..0c55cd6 100644 --- a/data/l3afpad.desktop.in +++ b/data/l3afpad.desktop.in @@ -1,5 +1,4 @@ [Desktop Entry] -Encoding=UTF-8 _Name=L3afpad _Comment=Simple text editor Exec=l3afpad %f diff --git a/depcomp b/depcomp index e5f9736..df8eea7 100644 --- a/depcomp +++ b/depcomp @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2007-03-29.01 +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software -# Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. # 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 @@ -17,9 +17,7 @@ scriptversion=2007-03-29.01 # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -87,6 +85,15 @@ if test "$depmode" = dashXmstdout; then depmode=dashmstdout fi +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -192,14 +199,14 @@ sgi) ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' -' ' ' >> $depfile - echo >> $depfile +' ' ' >> "$depfile" + echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile + >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -328,7 +335,12 @@ hp2) if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. - sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi @@ -404,7 +416,7 @@ dashmstdout) # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift @@ -455,32 +467,39 @@ makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift - cleared=no - for arg in "$@"; do + cleared=no eat=no + for arg + do case $cleared in no) set ""; shift cleared=yes ;; esac + if test $eat = yes; then + eat=no + continue + fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done - obj_suffix="`echo $object | sed 's/^.*\././'`" + obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" @@ -500,7 +519,7 @@ cpp) # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift @@ -538,13 +557,27 @@ cpp) msvisualcpp) # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. + # always write the preprocessed file to stdout. "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + IFS=" " for arg do case "$arg" in + -o) + shift + ;; + $object) + shift + ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift @@ -557,16 +590,23 @@ msvisualcpp) ;; esac done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + none) exec "$@" ;; @@ -585,5 +625,6 @@ exit 0 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff --git a/gpl-2.0.txt b/gpl-2.0.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/install-sh b/install-sh index a5897de..6781b98 100644 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2006-12-25.00 +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -515,5 +515,6 @@ done # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff --git a/missing b/missing index 1c8ff70..28055d2 100644 --- a/missing +++ b/missing @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2006-05-10.23 +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -18,9 +18,7 @@ scriptversion=2006-05-10.23 # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -89,6 +87,9 @@ Supported PROGRAM values: tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + Send bug reports to ." exit $? ;; @@ -106,15 +107,22 @@ Send bug reports to ." esac +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect -# the program). +# the program). This is about non-GNU programs, so use $1 not +# $program. case $1 in - lex|yacc) + lex*|yacc*) # Not GNU programs, they don't have --version. ;; - tar) + tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 @@ -138,7 +146,7 @@ esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case $1 in +case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -148,7 +156,7 @@ WARNING: \`$1' is $msg. You should only need it if touch aclocal.m4 ;; - autoconf) + autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the @@ -157,7 +165,7 @@ WARNING: \`$1' is $msg. You should only need it if touch configure ;; - autoheader) + autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want @@ -187,7 +195,7 @@ WARNING: \`$1' is $msg. You should only need it if while read f; do touch "$f"; done ;; - autom4te) + autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the @@ -210,7 +218,7 @@ WARNING: \`$1' is needed, but is $msg. fi ;; - bison|yacc) + bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package @@ -240,7 +248,7 @@ WARNING: \`$1' $msg. You should only need it if fi ;; - lex|flex) + lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package @@ -263,7 +271,7 @@ WARNING: \`$1' is $msg. You should only need it if fi ;; - help2man) + help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the @@ -277,11 +285,11 @@ WARNING: \`$1' is $msg. You should only need it if else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" - exit 1 + exit $? fi ;; - makeinfo) + makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file @@ -310,7 +318,7 @@ WARNING: \`$1' is $msg. You should only need it if touch $file ;; - tar) + tar*) shift # We have already tried tar in the generic part. @@ -363,5 +371,6 @@ exit 0 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff --git a/po/LINGUAS b/po/LINGUAS index 3f758a0..7ddb337 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,5 +1,4 @@ # please keep this list sorted alphabetically -# bg br ca @@ -38,4 +37,3 @@ uk vi zh_CN zh_TW - diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 402a25f..cc8a222 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -129,7 +129,7 @@ install-data-yes: all done # Empty stubs to satisfy archaic automake needs -dvi info tags TAGS ID: +dvi info ctags tags CTAGS TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: diff --git a/po/POTFILES.in b/po/POTFILES.in index 1835cf7..cfd62a8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -7,6 +7,4 @@ src/font.c src/selector.c src/file.c src/search.c - -# files added by intltool-prepare data/l3afpad.desktop.in diff --git a/po/bg.po b/po/bg.po index 9ae5b0f..c0a8236 100644 --- a/po/bg.po +++ b/po/bg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2006-05-20 13:05+0300\n" "Last-Translator: Yavor Doganov \n" "Language-Team: Bulgarian \n" @@ -146,6 +146,10 @@ msgstr "" "Научете повече за нас на http://gnome.cult.bg\n" "Докладвайте за грешки на http://gnome.cult.bg/bugs" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/br.po b/po/br.po index bc6559c..5dcda18 100644 --- a/po/br.po +++ b/po/br.po @@ -8,13 +8,13 @@ msgid "" msgstr "" "Project-Id-Version: L3afpad 0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-07-04 16:58+0100\n" "Last-Translator: Alan Monfort \n" "Language-Team: Breton Team \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Breton\n" "X-Poedit-Country: FRANCE\n" @@ -149,6 +149,10 @@ msgstr "Embanner testennou eeun diazezet war GTK+" msgid "translator-credits" msgstr "Denis ARNAUD " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/ca.po b/po/ca.po index 5a952c4..55c515b 100644 --- a/po/ca.po +++ b/po/ca.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: L3afpad 0.7.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2004-11-04 10:10+0100\n" "Last-Translator: David Rosal \n" "Language-Team: Catalan\n" @@ -140,6 +140,10 @@ msgstr "Editor de text simple, basat en GTK+" msgid "translator-credits" msgstr "David Rosal " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/cs.po b/po/cs.po index f31c5ca..8abce60 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.7.6\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2004-11-18 23:58+0100\n" "Last-Translator: Petr Vysloužil \n" "Language-Team: Czech \n" @@ -140,6 +140,10 @@ msgstr "Jednoduchý GTK+ textový editor" msgid "translator-credits" msgstr "Petr Vyslouzil " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/da.po b/po/da.po index 0fc5bd4..9a860d2 100644 --- a/po/da.po +++ b/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad-0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-08-24 00:00+0100\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" @@ -152,6 +152,10 @@ msgstr "" "Dansk-gruppen \n" "Mere info: http://www.dansk-gruppen.dk" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/de.po b/po/de.po index ab88b17..70536ba 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-06-28 13:12+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" @@ -145,6 +145,10 @@ msgstr "" "Ruediger Arp \n" "Mario Blättermann " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/el.po b/po/el.po index e456e2b..c5f54a8 100644 --- a/po/el.po +++ b/po/el.po @@ -1,4 +1,4 @@ -# Greek translation of l3afpad.pot +# Greek translation of l3afpad.pot # Copyright (C) 2004-2005 Tarot Osuji # This file is distributed under the same license as the l3afpad package. # Stavros Giannouris , 2005-2006 @@ -7,13 +7,13 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2006-04-23 00:52+0200\n" "Last-Translator: Stavros Giannouris \n" "Language-Team: Greek \n" "Language: el\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Greek\n" "X-Poedit-Country: GREECE\n" @@ -142,6 +142,10 @@ msgstr "Ένας απλός επεξεργαστής κειμένου σε GTK+" msgid "translator-credits" msgstr "Σταύρος Γιαννούρης " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/eo.po b/po/eo.po index 73ed963..ffd3053 100644 --- a/po/eo.po +++ b/po/eo.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2010-07-12 20:53+0100\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Esperanto \n" @@ -139,6 +139,10 @@ msgstr "Simpla GTK+-bazita tekstredaktilo" msgid "translator-credits" msgstr "Benno Schulenberg " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/es.po b/po/es.po index 8fd94f3..3cea1f1 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad-0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-06-24 21:49+0200\n" "Last-Translator: Lucas Vieites \n" "Language-Team: Spanish \n" @@ -140,6 +140,10 @@ msgstr "Editor de texto simple" msgid "translator-credits" msgstr "Lucas Vieites " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/eu.po b/po/eu.po index 68092ac..4dfe2e9 100644 --- a/po/eu.po +++ b/po/eu.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-01-14 21:35+0900\n" "Last-Translator: Mikel Olasagasti \n" "Language-Team: Basque \n" @@ -143,6 +143,10 @@ msgstr "GTK+-n oinarritutako testu editore sinplea" msgid "translator-credits" msgstr "Inko Illarramendi " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/fi.po b/po/fi.po index f513662..275d629 100644 --- a/po/fi.po +++ b/po/fi.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2010-12-07 13:02+0200\n" "Last-Translator: Jorma Karvonen \n" "Language-Team: Finnish \n" @@ -142,6 +142,10 @@ msgstr "GTK+-pohjainen yksinkertainen tekstieditori" msgid "translator-credits" msgstr "Eero Tamminen, Jorma Karvonen" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/fr.po b/po/fr.po index 65df6eb..fd44840 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-06-25 10:53-0500\n" "Last-Translator: Marc Veillet \n" "Language-Team: French \n" @@ -143,6 +143,10 @@ msgid "translator-credits" msgstr "" "Luc Pionchon , Marc Veillet 2009 " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/ga.po b/po/ga.po index 3190bd7..b448f63 100644 --- a/po/ga.po +++ b/po/ga.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-01-15 15:46-0500\n" "Last-Translator: Kevin Scannell \n" "Language-Team: Irish \n" @@ -140,6 +140,10 @@ msgstr "Eagarthóir simplí bunaithe ar GTK+" msgid "translator-credits" msgstr "Kevin Scannell " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/gl.po b/po/gl.po index 4733d6e..e8ed365 100644 --- a/po/gl.po +++ b/po/gl.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2010-12-02 10:22+0100\n" "Last-Translator: Leandro Regueiro \n" "Language-Team: Galician \n" @@ -149,6 +149,10 @@ msgstr "" "Proxecto Trasno - Adaptación de software libre á lingua galega: Se desexas\n" "colaborar connosco, podes atopar máis información en " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/he.po b/po/he.po index 316e771..3ef4754 100644 --- a/po/he.po +++ b/po/he.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: L3afpad 0.8.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2005-07-31 22:54+0300\n" "Last-Translator: Yo'av Moshe \n" "Language-Team: Hebrew\n" @@ -140,6 +140,10 @@ msgstr "עורך טקסט פשוט מבוסס GTK+" msgid "translator-credits" msgstr "Yo´av Moshe " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/hu.po b/po/hu.po index d2a3f72..1800c23 100644 --- a/po/hu.po +++ b/po/hu.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad-0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2010-05-04 10:02+0200\n" "Last-Translator: Kalman Kemenczy \n" "Language-Team: Hungarian \n" @@ -145,6 +145,10 @@ msgstr "" "Reviczky Ádám János \n" "Kéménczy Kálmán " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/id.po b/po/id.po index 7b6d0c5..30c8d6a 100644 --- a/po/id.po +++ b/po/id.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-06-25 21:35+0700\n" "Last-Translator: Andhika Padmawan \n" "Language-Team: Indonesian \n" @@ -140,6 +140,10 @@ msgstr "Penyunting teks sederhana berbasis GTK+" msgid "translator-credits" msgstr "Andhika Padmawan , 2008" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/it.po b/po/it.po index df9fbd2..3ba73fb 100644 --- a/po/it.po +++ b/po/it.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad-0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-11-29 18:23+0100\n" "Last-Translator: Vincenzo Campanella \n" "Language-Team: Italian \n" @@ -143,6 +143,10 @@ msgstr "Semplice editor di testi basato su GTK+" msgid "translator-credits" msgstr "Vincenzo Campanella (vinz65@gmail.com)" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/ja.po b/po/ja.po index 1a1a629..fb94fc7 100644 --- a/po/ja.po +++ b/po/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: L3afpad 0.8.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2007-05-06 20:26+0900\n" "Last-Translator: Tarot Osuji \n" "Language-Team: Japanese \n" @@ -140,6 +140,10 @@ msgstr "GTK+ ベースのシンプルなテキストエディタ" msgid "translator-credits" msgstr "Tarot Osuji " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/ko.po b/po/ko.po index 878b68c..bfb68f6 100644 --- a/po/ko.po +++ b/po/ko.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: L3afpad 0.8.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2006-11-01 10:50+0900\n" "Last-Translator: Seo Sanghyeon \n" "Language-Team: Korean\n" @@ -140,6 +140,10 @@ msgstr "GTK+로 만든 간단한 텍스트 편집기" msgid "translator-credits" msgstr "Seo Sanghyeon " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/lt.po b/po/lt.po index d8b693d..e5a1e2e 100644 --- a/po/lt.po +++ b/po/lt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-07-20 21:29-0400\n" "Last-Translator: Gintautas Miliauskas \n" "Language-Team: Lithuanian \n" @@ -140,6 +140,10 @@ msgstr "Paprastas teksto redaktorius paremtas GTK+" msgid "translator-credits" msgstr "Lech Jankovski " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/lv.po b/po/lv.po index e3c30b2..35d4169 100644 --- a/po/lv.po +++ b/po/lv.po @@ -7,13 +7,13 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad-0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-07-30 12:44+0100\n" "Last-Translator: Rihards Priedītis \n" "Language-Team: Latvian \n" "Language: lv\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Latvian\n" "X-Poedit-Country: LATVIA\n" @@ -144,6 +144,10 @@ msgstr "Uz GTK+ balstīts vienkāršā teksta redaktors" msgid "translator-credits" msgstr "Arvis Lācis , 2009" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/nl.po b/po/nl.po index 7d85bc0..19a02ed 100644 --- a/po/nl.po +++ b/po/nl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad-0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-01-15 15:15+0100\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" @@ -145,6 +145,10 @@ msgstr "" "Wouter Van Hemel \n" "Benno Schulenberg " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/nn.po b/po/nn.po index 9e72c1d..aa561b5 100644 --- a/po/nn.po +++ b/po/nn.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-07-03 13:59+0100\n" "Last-Translator: Eivind Ødegård \n" "Language-Team: Norwegian Nynorsk \n" @@ -150,6 +150,10 @@ msgstr "" "\n" "Send feilmeldingar og kommentarar til " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/pl.po b/po/pl.po index 863484b..27f233d 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-06-24 21:36+0100\n" "Last-Translator: Michał Trzebiatowski \n" "Language-Team: Polish \n" @@ -175,6 +175,10 @@ msgstr "Prosty edytor tekstowy oparty na GTK+" msgid "translator-credits" msgstr "Michał Trzebiatowski " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + # src/view.c:62 #: ../src/view.c:62 #, c-format diff --git a/po/pt.po b/po/pt.po index 6a57cab..cd7d0ef 100644 --- a/po/pt.po +++ b/po/pt.po @@ -7,13 +7,13 @@ msgid "" msgstr "" "Project-Id-Version: L3afpad 0.7.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2004-12-28 19:56:59-0300\n" "Last-Translator: Alan Kelon Oliveira de Moraes \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/menu.c:34 @@ -140,6 +140,10 @@ msgstr "Simples editor de texto feito em GTK+" msgid "translator-credits" msgstr "Alan Kelon " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/pt_BR.po b/po/pt_BR.po index 0a64a8a..fc8e74f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-05-07 17:39-0300\n" "Last-Translator: Leslie Harlley Watter \n" "Language-Team: Brazilian Portuguese \n" @@ -140,6 +140,10 @@ msgstr "Editor de texto simples feito em GTK+" msgid "translator-credits" msgstr "Fábio Antunes " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/ru.po b/po/ru.po index bc639ec..5e01f8c 100644 --- a/po/ru.po +++ b/po/ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: L3afpad 0.7.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date:2004-10-24 00:40+0400\n" "Last-Translator: Artem Vakhitov \n" "Language-Team: RUSSIAN \n" @@ -140,6 +140,10 @@ msgstr "Простой текстовый редактор на основе GTK msgid "translator-credits" msgstr "Artem Vakhitov " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/sk.po b/po/sk.po index 12507f9..fcbfb6b 100644 --- a/po/sk.po +++ b/po/sk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.7.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2005-07-10 21:20+0100\n" "Last-Translator: Peter Chabada \n" "Language-Team: Slovak \n" @@ -140,6 +140,10 @@ msgstr "Jednoduchý textový editor" msgid "translator-credits" msgstr "Peter Chabada" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/sl.po b/po/sl.po index cb26ca2..e5ee0db 100644 --- a/po/sl.po +++ b/po/sl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad-0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-04-28 22:31+0100\n" "Last-Translator: Alan Pepelko \n" "Language-Team: Slovenian \n" @@ -146,6 +146,10 @@ msgstr "Preprost urejevalnik besedila temelječ na GTK+" msgid "translator-credits" msgstr "Alan Pepelko " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/sr.po b/po/sr.po index 5a084b2..38c3557 100644 --- a/po/sr.po +++ b/po/sr.po @@ -7,13 +7,13 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-08-31 12:59+0100\n" "Last-Translator: Jay A. Fleming \n" "Language-Team: Serbian \n" "Language: sr\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" @@ -142,6 +142,10 @@ msgstr "Једноставан GTK+ заснован уређивач текст msgid "translator-credits" msgstr "Serbian (sr) — Jay A. Fleming " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/sv.po b/po/sv.po index 6f991db..99535a0 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2005-12-05 20:30+0100\n" "Last-Translator: Isak Savo \n" "Language-Team: Swedish \n" @@ -140,6 +140,10 @@ msgstr "Enkel GTK+-baserad textredigerare" msgid "translator-credits" msgstr "Isak Savo " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/ta.po b/po/ta.po index 5ba0f1b..1b67d8c 100644 --- a/po/ta.po +++ b/po/ta.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.7.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2004-11-25 03:24-0700\n" "Last-Translator: Vijay Durairaj \n" "Language-Team: Tamil \n" @@ -140,6 +140,10 @@ msgstr "GTK+ சார்ந்த ஒரு எளிமையான உரை msgid "translator-credits" msgstr "" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/tr.po b/po/tr.po index 8300635..817a785 100644 --- a/po/tr.po +++ b/po/tr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: tr\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2005-08-05 17:26+0300\n" "Last-Translator: kaya oğuz \n" "Language-Team: Türkçe \n" @@ -142,6 +142,10 @@ msgstr "GTK+ tabanlı basit metin düzenleyicisi" msgid "translator-credits" msgstr "Kaya Oğuz " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/uk.po b/po/uk.po index fa968b1..75ce85b 100644 --- a/po/uk.po +++ b/po/uk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2007-03-13 11:38+0300\n" "Last-Translator: Youri Bulka \n" "Language-Team: Ukrainian \n" @@ -143,6 +143,10 @@ msgstr "Простий текстовий редактор, базований msgid "translator-credits" msgstr "Перекладачі" +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/vi.po b/po/vi.po index 5a0f797..fb3a1dd 100644 --- a/po/vi.po +++ b/po/vi.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.16\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2009-09-19 18:32+0930\n" "Last-Translator: Clytie Siddall \n" "Language-Team: Vietnamese \n" @@ -143,6 +143,10 @@ msgstr "Một trình soạn thảo văn bản đơn giản dựa trên GTK+" msgid "translator-credits" msgstr "Nhóm Việt hoá Phần mềm Tự do " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/zh_CN.po b/po/zh_CN.po index b1d2e79..57b6114 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-01-26 10:12+0800\n" "Last-Translator: LI Daobing \n" "Language-Team: Chinese (simplified) \n" "LI Daobing " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/po/zh_TW.po b/po/zh_TW.po index ca7466c..e67c7c3 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: l3afpad 0.8.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-01 15:36+0800\n" +"POT-Creation-Date: 2011-09-06 17:04+0800\n" "PO-Revision-Date: 2008-03-20 20:21+0800\n" "Last-Translator: Wei-Lun Chao \n" "Language-Team: Chinese (traditional) \n" @@ -144,6 +144,10 @@ msgstr "" "OLS3 \n" "趙惟倫 " +#: ../src/callback.c:323 +msgid "Lɜafpad" +msgstr "Lɜafpad" + #: ../src/view.c:62 #, c-format msgid "Save changes to '%s'?" diff --git a/src/Makefile.in b/src/Makefile.in index 8ccd443..1228a9c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -39,7 +39,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = diff --git a/src/callback.c b/src/callback.c index e2c1ec3..bf2a8d4 100644 --- a/src/callback.c +++ b/src/callback.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -25,7 +25,7 @@ static void set_selection_bound(GtkTextBuffer *buffer, gint start, gint end) { GtkTextIter start_iter, end_iter; - + gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, start); if (end < 0) gtk_text_buffer_get_end_iter(buffer, &end_iter); @@ -56,7 +56,7 @@ void on_file_open(void) FileInfo *fi; gchar *comline; gchar *option = NULL; - + fi = get_fileinfo_from_selector(pub->fi, OPEN); if (fi) { save_config_file(); @@ -73,7 +73,7 @@ void on_file_open(void) #else { FileInfo *fi; - + if (check_text_modification()) return; fi = get_fileinfo_from_selector(pub->fi, OPEN); @@ -109,7 +109,7 @@ gint on_file_save(void) gint on_file_save_as(void) { FileInfo *fi; - + fi = get_fileinfo_from_selector(pub->fi, SAVE); if (fi == NULL) return -1; @@ -125,7 +125,7 @@ gint on_file_save_as(void) // undo_init(sd->mainwin->textview, sd->mainwin->textbuffer, sd->mainwin->menubar); return 0; } -#ifdef ENABLE_PRINT +#if ENABLE_PRINT void on_file_print_preview(void) { create_gtkprint_preview_session(GTK_TEXT_VIEW(pub->mw->view), @@ -214,7 +214,7 @@ static void activate_quick_find(void) { GtkItemFactory *ifactory; static gboolean flag = FALSE; - + if (!flag) { ifactory = gtk_item_factory_from_widget(pub->mw->menubar); gtk_widget_set_sensitive( @@ -263,7 +263,7 @@ void on_option_word_wrap(void) { GtkItemFactory *ifactory; gboolean state; - + ifactory = gtk_item_factory_from_widget(pub->mw->menubar); state = gtk_check_menu_item_get_active( GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item(ifactory, "/M/Options/WordWrap"))); @@ -275,7 +275,7 @@ void on_option_line_numbers(void) { GtkItemFactory *ifactory; gboolean state; - + ifactory = gtk_item_factory_from_widget(pub->mw->menubar); state = gtk_check_menu_item_get_active( GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item(ifactory, "/M/Options/LineNumbers"))); @@ -285,7 +285,7 @@ void on_option_line_numbers(void) void on_option_always_on_top(void) { static gboolean flag = FALSE; - + flag =! flag; gtk_window_set_keep_above(GTK_WINDOW(pub->mw->window), flag); } @@ -294,7 +294,7 @@ void on_option_auto_indent(void) { GtkItemFactory *ifactory; gboolean state; - + ifactory = gtk_item_factory_from_widget(pub->mw->menubar); state = gtk_check_menu_item_get_active( GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item(ifactory, "/M/Options/AutoIndent"))); @@ -311,16 +311,16 @@ void on_help_about(void) NULL }; const gchar *translator_credits = _("translator-credits"); - + translator_credits = strcmp(translator_credits, "translator-credits") ? translator_credits : NULL; - + const gchar *artists[] = { "Lapo Calamandrei ", NULL }; gtk_show_about_dialog(GTK_WINDOW(pub->mw->window), - "program-name", "Lɜafpad", + "program-name", _("Lɜafpad"), "version", PACKAGE_VERSION, "copyright", copyright, "comments", comments, diff --git a/src/callback.h b/src/callback.h index b1b9c3a..2a89376 100644 --- a/src/callback.h +++ b/src/callback.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/dialog.c b/src/dialog.c index 3ef3908..5afe976 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -27,11 +27,11 @@ void run_dialog_message(GtkWidget *window, va_list ap; GtkWidget *dialog; gchar *str; - + va_start(ap, message); str = g_strdup_vprintf(message, ap); va_end(ap); - + dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, type, @@ -42,7 +42,7 @@ void run_dialog_message(GtkWidget *window, GTK_STOCK_OK, GTK_RESPONSE_CANCEL, NULL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL); g_free(str); - + gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } @@ -52,11 +52,11 @@ GtkWidget *create_dialog_message_question(GtkWidget *window, gchar *message, ... va_list ap; GtkWidget *dialog; gchar *str; - + va_start(ap, message); str = g_strdup_vprintf(message, ap); va_end(ap); - + dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, @@ -70,7 +70,7 @@ GtkWidget *create_dialog_message_question(GtkWidget *window, gchar *message, ... NULL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES); g_free(str); - + return dialog; } @@ -80,16 +80,16 @@ gint run_dialog_message_question(GtkWidget *window, gchar *message, ...) GtkWidget *dialog; gchar *str; gint res; - + va_start(ap, message); str = g_strdup_vprintf(message, ap); va_end(ap); - + dialog = create_dialog_message_question(window, str); g_free(str); - + res = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); - + return res; } diff --git a/src/dialog.h b/src/dialog.h index 1702955..8df74ca 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/dnd.c b/src/dnd.c index f9e7281..202852e 100644 --- a/src/dnd.c +++ b/src/dnd.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2006 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -65,7 +65,7 @@ void dnd_init(GtkWidget *widget) static void dnd_open_first_file(gchar *filename) { FileInfo *fi; - + if (check_text_modification()) return; fi = g_malloc(sizeof(FileInfo)); @@ -82,7 +82,7 @@ static void dnd_open_first_file(gchar *filename) set_main_window_title(); // undo_init(sd->mainwin->textview, sd->mainwin->textbuffer, sd->mainwin->menubar); } -} +} #endif #if 0 @@ -101,9 +101,9 @@ static void dnd_drag_data_recieved_handler(GtkWidget *widget, j = 1; #endif DV(g_print("DND start!\n")); - + #if 0 - if (g_strcasecmp(gdk_atom_name(context->targets->data), + if (g_ascii_strcasecmp(gdk_atom_name(context->targets->data), "GTK_TEXT_BUFFER_CONTENTS") != 0) { #endif if (flag_called_once) { @@ -114,8 +114,8 @@ DV(g_print("second drop signal killed.\n")); } else flag_called_once = TRUE; } - -DV({ + +DV({ g_print("info = %d\n", info); g_print("time = %d\n", time); g_print("context->protocol = %d\n", context->protocol); @@ -133,8 +133,8 @@ DV({ g_print("selection_data->format = %d\n", selection_data->format); g_print("selection_data->length = %d\n", selection_data->length); g_print("%s\n", selection_data->data); -}); - +}); + if (selection_data->data && info == TARGET_URI_LIST) { files = g_strsplit((gchar *)selection_data->data, "\n" , -1); while (files[i]) { @@ -169,13 +169,13 @@ DV(g_print(">%s\n", comline)); if (info == TARGET_UTF8_STRING) { undo_set_sequency_reserve(); context->action = GDK_ACTION_MOVE; - } else if (info == TARGET_PLAIN + } else if (info == TARGET_PLAIN && g_utf8_validate((gchar *)selection_data->data, -1, NULL)) { selection_data->type = gdk_atom_intern("UTF8_STRING", FALSE); } } - + return; } @@ -185,7 +185,7 @@ static gboolean dnd_drag_motion_handler(GtkWidget *widget, GList *targets; gchar *name; gboolean flag = FALSE; - + targets = context->targets; while (targets) { name = gdk_atom_name(targets->data); @@ -200,11 +200,11 @@ DV(g_print("%s\n", name)); else context->action = GDK_ACTION_COPY; // g_signal_stop_emission_by_name(widget, "drag_motion"); -*/ +*/ /* if (!flag) { gint bx, by; GtkTextIter iter; - + gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_WIDGET, x, y, &bx, &by); @@ -219,7 +219,7 @@ DV(g_print("%s\n", name)); dnd_mark, &iter); gtk_text_mark_set_visible(dnd_mark, TRUE); } -*/ +*/ return flag; } #endif diff --git a/src/dnd.h b/src/dnd.h index f30e291..5f5282c 100644 --- a/src/dnd.h +++ b/src/dnd.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/emacs.c b/src/emacs.c index e8c2177..fb63a3a 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2006 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -20,7 +20,7 @@ #include "l3afpad.h" #include -#ifdef ENABLE_EMACS +#if ENABLE_EMACS static void cb_key_release_event(GtkWidget *view, GdkEventKey *event) { @@ -105,7 +105,7 @@ static void cb_key_press_event(GtkWidget *view, GdkEventKey *event) static void emacs_key_prefix(void) { gulong id; - + gtk_widget_set_sensitive(pub->mw->menubar, FALSE); // gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(pub->mw->view), FALSE); gtk_text_view_set_editable(GTK_TEXT_VIEW(pub->mw->view), FALSE); @@ -114,13 +114,13 @@ static void emacs_key_prefix(void) G_CALLBACK(cb_key_release_event), NULL); gtk_main(); g_signal_handler_disconnect(G_OBJECT(pub->mw->window), id); - + /* waiting for input sequence */ id = g_signal_connect(G_OBJECT(pub->mw->window), "key-press-event", G_CALLBACK(cb_key_press_event), NULL); gtk_main(); g_signal_handler_disconnect(G_OBJECT(pub->mw->window), id); - + gtk_text_view_set_editable(GTK_TEXT_VIEW(pub->mw->view), TRUE); // gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(pub->mw->view), TRUE); gtk_widget_set_sensitive(pub->mw->menubar, TRUE); @@ -133,7 +133,7 @@ gboolean check_emacs_key_theme(GtkWindow *window, GtkItemFactory *ifactory) gchar *key_theme = NULL; gboolean emacs_flag = FALSE; GtkSettings *settings = gtk_settings_get_default(); - + g_object_get(settings, "gtk-key-theme-name", &key_theme, NULL); if (key_theme) { if (!g_ascii_strcasecmp(key_theme, "Emacs")) @@ -142,7 +142,7 @@ gboolean check_emacs_key_theme(GtkWindow *window, GtkItemFactory *ifactory) } if (!emacs_flag) return FALSE; - + groups = gtk_accel_groups_from_object(G_OBJECT(window)); accel_group = groups->data; if (accel_group) { @@ -150,14 +150,14 @@ gboolean check_emacs_key_theme(GtkWindow *window, GtkItemFactory *ifactory) g_object_unref(accel_group); } accel_group = gtk_accel_group_new(); - + gtk_rc_parse_string ( "binding \"gtk-emacs-text-entry\"" "{\n" "bind \"w\" { \"cut-clipboard\" () }" "}\n" ); - + /* gtk_widget_remove_accelerator( gtk_item_factory_get_widget(ifactory, "/M/File/New"), accel_group, GDK_N, GDK_CONTROL_MASK); @@ -170,7 +170,7 @@ gboolean check_emacs_key_theme(GtkWindow *window, GtkItemFactory *ifactory) gtk_widget_remove_accelerator( gtk_item_factory_get_widget(ifactory, "/M/File/SaveAs"), accel_group, GDK_S, GDK_SHIFT_MASK | GDK_CONTROL_MASK); -#ifdef ENABLE_PRINT +#if ENABLE_PRINT gtk_widget_remove_accelerator( gtk_item_factory_get_widget(ifactory, "/M/File/Print"), accel_group, GDK_P, GDK_CONTROL_MASK); @@ -208,13 +208,13 @@ gboolean check_emacs_key_theme(GtkWindow *window, GtkItemFactory *ifactory) */ gtk_widget_add_accelerator( gtk_item_factory_get_widget(ifactory, "/M/Search/JumpTo"), "activate", accel_group, GDK_G, GDK_MOD1_MASK, GTK_ACCEL_VISIBLE); - + gtk_accel_group_connect( accel_group, GDK_X, GDK_CONTROL_MASK, 0, g_cclosure_new_swap(G_CALLBACK(emacs_key_prefix), NULL, NULL)); - + gtk_window_add_accel_group(GTK_WINDOW(window), accel_group); - + return TRUE; } diff --git a/src/emacs.h b/src/emacs.h index cfee8c6..814968e 100644 --- a/src/emacs.h +++ b/src/emacs.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2006 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/encoding.c b/src/encoding.c index 62b4ce4..75b6995 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -98,7 +98,7 @@ guint get_encoding_code(void) static guint code = END_CODE; const gchar *env; guint i, j = 1; - + if (code == END_CODE) { env = g_getenv("LC_ALL"); if (!env) @@ -118,7 +118,7 @@ guint get_encoding_code(void) if (code == END_CODE) code = 0; } - + return code; } @@ -126,23 +126,23 @@ EncArray *get_encoding_items(guint code) { gint i; static EncArray *array = NULL; - + if (!array) { array = g_malloc(sizeof(EncArray)); for (i = 0; i < ENCODING_MAX_ITEM_NUM; i++) array->item[i] = encoding_table[code][i] ? encoding_table[code][i] : NULL; } - + return array; } const gchar *get_default_charset(void) { const gchar *charset; - + g_get_charset(&charset); - + return charset; } @@ -154,7 +154,7 @@ http://examples.oreilly.com/cjkvinfo/Ch7/DetectCodeType.c void convert_line_ending_to_lf(gchar *text) { gint i, j; - + for (i = 0, j = 0; TRUE; i++, j++) { if (*(text + i) == CR) { *(text + j) = LF; @@ -173,7 +173,7 @@ void convert_line_ending(gchar **text, gint retcode) gchar *buf, *str = *text; const gint len = strlen(str); gint i, j, LFNum = 0; - + switch (retcode) { case CR: while (*str != '\0') { @@ -222,9 +222,9 @@ static const gchar *detect_charset_cylillic(const gchar *text) guint8 c = *text; gboolean noniso = FALSE; guint32 xc = 0, xd = 0, xef = 0; - + const gchar *charset = get_encoding_items(get_encoding_code())->item[OPENI18N]; - + while ((c = *text++) != '\0') { if (c >= 0x80 && c <= 0x9F) noniso = TRUE; @@ -235,21 +235,21 @@ static const gchar *detect_charset_cylillic(const gchar *text) else if (c >= 0xE0) xef++; } - + if (!noniso && ((xc + xef) < xd)) charset = "ISO-8859-5"; else if ((xc + xd) < xef) charset = "CP1251"; - + return charset; } static const gchar *detect_charset_chinese(const gchar *text) { guint8 c = *text; - + const gchar *charset = get_encoding_items(get_encoding_code())->item[IANA]; - + while ((c = *text++) != '\0') { if (c >= 0x81 && c <= 0x87) { charset = "GB18030"; @@ -279,7 +279,7 @@ static const gchar *detect_charset_chinese(const gchar *text) } } } - + return charset; } @@ -287,7 +287,7 @@ static const gchar *detect_charset_japanese(const gchar *text) { guint8 c = *text; gchar *charset = NULL; - + while (charset == NULL && (c = *text++) != '\0') { if (c >= 0x81 && c <= 0x9F) { if (c == 0x8E) /* SS2 */ { @@ -322,10 +322,10 @@ static const gchar *detect_charset_japanese(const gchar *text) else if (c >= 0xF0) break; } - + if (charset == NULL) charset = "EUC-JP"; - + return charset; } @@ -335,7 +335,7 @@ static const gchar *detect_charset_korean(const gchar *text) gboolean noneuc = FALSE; gboolean nonjohab = FALSE; gchar *charset = NULL; - + while (charset == NULL && (c = *text++) != '\0') { if (c >= 0x81 && c < 0x84) { charset = "CP949"; @@ -380,21 +380,21 @@ static const gchar *detect_charset_korean(const gchar *text) if (noneuc && nonjohab) charset = "CP949"; } - + if (charset == NULL) { if (noneuc) charset = "CP949"; else charset = "EUC-KR"; } - + return charset; } static gboolean detect_noniso(const gchar *text) { guint8 c = *text; - + while ((c = *text++) != '\0') { if (c >= 0x80 && c <= 0x9F) return TRUE; @@ -406,7 +406,7 @@ const gchar *detect_charset(const gchar *text) { guint8 c = *text; const gchar *charset = NULL; - + if (g_utf8_validate(text, -1, NULL)) { while ((c = *text++) != '\0') { if (c > 0x7F) { @@ -445,7 +445,7 @@ const gchar *detect_charset(const gchar *text) if (!charset) charset = get_default_charset(); } - + if (!charset) { switch (get_encoding_code()) { case LATINC: @@ -477,9 +477,9 @@ const gchar *detect_charset(const gchar *text) else charset = get_encoding_items(get_encoding_code())->item[OPENI18N]; if (!charset) - charset = get_encoding_items(get_encoding_code())->item[IANA]; + charset = get_encoding_items(get_encoding_code())->item[IANA]; } } - + return charset; } diff --git a/src/encoding.h b/src/encoding.h index c82f287..f2f876b 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/file.c b/src/file.c index 656fd96..a247638 100644 --- a/src/file.c +++ b/src/file.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -31,7 +31,7 @@ gboolean check_file_writable(gchar *filename) { FILE *fp; - + if ((fp = fopen(filename, "a")) != NULL) { fclose(fp); return TRUE; @@ -44,7 +44,7 @@ gchar *get_file_basename(gchar *filename, gboolean bracket) gchar *basename = NULL; gchar *tmp; gboolean exist_flag; - + if (filename) { tmp = g_path_get_basename( g_filename_to_utf8(filename, -1, NULL, NULL, NULL)); @@ -55,7 +55,7 @@ gchar *get_file_basename(gchar *filename, gboolean bracket) tmp = g_strdup(_("Untitled")); exist_flag = FALSE; } - + if (bracket) { if (!exist_flag) { GString *string = g_string_new(tmp); @@ -71,11 +71,11 @@ gchar *get_file_basename(gchar *filename, gboolean bracket) g_string_free(string, TRUE); } } - + if (!basename) basename = g_strdup(tmp); g_free(tmp); - + return basename; } @@ -83,7 +83,7 @@ gchar *parse_file_uri(gchar *uri) { gchar *filename; // gchar **strs; - + if (g_strstr_len(uri, 5, "file:")) filename = g_filename_from_uri(uri, NULL, NULL); else { @@ -98,7 +98,7 @@ gchar *parse_file_uri(gchar *uri) filename = g_strjoinv("\\ ", strs); g_strfreev(strs); } -*/ +*/ return filename; } @@ -110,9 +110,9 @@ gint file_open_real(GtkWidget *view, FileInfo *fi) const gchar *charset; gchar *str = NULL; GtkTextIter iter; - + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); - + if (!g_file_get_contents(fi->filename, &contents, &length, &err)) { if (g_file_test(fi->filename, G_FILE_TEST_EXISTS)) { run_dialog_message(gtk_widget_get_toplevel(view), @@ -124,11 +124,11 @@ gint file_open_real(GtkWidget *view, FileInfo *fi) err = NULL; contents = g_strdup(""); } - + fi->lineend = detect_line_ending(contents); if (fi->lineend != LF) convert_line_ending_to_lf(contents); - + if (fi->charset) charset = fi->charset; else { @@ -149,18 +149,18 @@ gint file_open_real(GtkWidget *view, FileInfo *fi) else str = g_strdup(""); g_free(contents); - + if (charset != fi->charset) { g_free(fi->charset); fi->charset = g_strdup(charset); if (fi->charset_flag) fi->charset_flag = FALSE; } - + // undo_disconnect_signal(textbuffer); // undo_block_signal(buffer); force_block_cb_modified_changed(view); - + gtk_text_buffer_set_text(buffer, "", 0); gtk_text_buffer_get_start_iter(buffer, &iter); gtk_text_buffer_insert(buffer, &iter, str, strlen(str)); @@ -169,11 +169,11 @@ gint file_open_real(GtkWidget *view, FileInfo *fi) gtk_text_buffer_set_modified(buffer, FALSE); gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(view), &iter, 0, FALSE, 0, 0); g_free(str); - + force_unblock_cb_modified_changed(view); menu_sensitivity_from_modified_flag(FALSE); // undo_unblock_signal(buffer); - + return 0; } @@ -184,13 +184,13 @@ gint file_save_real(GtkWidget *view, FileInfo *fi) gchar *str, *cstr; gsize rbytes, wbytes; GError *err = NULL; - + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); - + gtk_text_buffer_get_start_iter(buffer, &start); - gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_get_end_iter(buffer, &end); str = gtk_text_buffer_get_text(buffer, &start, &end, FALSE); - + switch (fi->lineend) { case CR: convert_line_ending(&str, CR); @@ -198,7 +198,7 @@ gint file_save_real(GtkWidget *view, FileInfo *fi) case CR+LF: convert_line_ending(&str, CR+LF); } - + if (!fi->charset) fi->charset = g_strdup(get_default_charset()); cstr = g_convert(str, -1, fi->charset, "UTF-8", &rbytes, &wbytes, &err); @@ -216,7 +216,7 @@ gint file_save_real(GtkWidget *view, FileInfo *fi) g_error_free(err); return -1; } - + fp = fopen(fi->filename, "w"); if (!fp) { run_dialog_message(gtk_widget_get_toplevel(view), @@ -228,10 +228,10 @@ gint file_save_real(GtkWidget *view, FileInfo *fi) GTK_MESSAGE_ERROR, _("Can't write file")); return -1; } - + gtk_text_buffer_set_modified(buffer, FALSE); fclose(fp); g_free(cstr); - + return 0; } diff --git a/src/file.h b/src/file.h index 6809861..cbb7d8b 100644 --- a/src/file.h +++ b/src/file.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/font.c b/src/font.c index bf5fc0b..d80bef6 100644 --- a/src/font.c +++ b/src/font.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -22,7 +22,7 @@ void set_text_font_by_name(GtkWidget *widget, gchar *fontname) { PangoFontDescription *font_desc; - + font_desc = pango_font_description_from_string(fontname); gtk_widget_modify_font(widget, font_desc); pango_font_description_free(font_desc); @@ -31,7 +31,7 @@ void set_text_font_by_name(GtkWidget *widget, gchar *fontname) gchar *get_font_name_from_widget(GtkWidget *widget) /* MUST BE FREED */ { GtkStyle *style; - + style = gtk_widget_get_style(widget); return pango_font_description_to_string(style->font_desc); } @@ -40,7 +40,7 @@ static gchar *get_font_name_by_selector(GtkWidget *window, gchar *current_fontna { GtkWidget *dialog; gchar *fontname; - + dialog = gtk_font_selection_dialog_new(_("Font")); gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window)); gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dialog), current_fontname); @@ -49,14 +49,14 @@ static gchar *get_font_name_by_selector(GtkWidget *window, gchar *current_fontna else fontname = NULL; gtk_widget_destroy(dialog); - + return fontname; } void change_text_font_by_selector(GtkWidget *widget) { gchar *current_fontname, *fontname; - + current_fontname = get_font_name_from_widget(widget); fontname = get_font_name_by_selector( gtk_widget_get_toplevel(widget), current_fontname); @@ -64,7 +64,7 @@ void change_text_font_by_selector(GtkWidget *widget) set_text_font_by_name(widget, fontname); indent_refresh_tab_width(widget); } - + g_free(fontname); g_free(current_fontname); } diff --git a/src/font.h b/src/font.h index b9289fb..4533d96 100644 --- a/src/font.h +++ b/src/font.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/gtkprint.c b/src/gtkprint.c index 815b893..8e673f7 100644 --- a/src/gtkprint.c +++ b/src/gtkprint.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2007 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -31,7 +31,7 @@ static void get_tab_array(PangoTabArray **tabs, { gint xft_dpi, loc; GtkSettings *settings = gtk_settings_get_default(); - + g_object_get(settings, "gtk-xft-dpi", &xft_dpi, NULL); if ((*tabs = gtk_text_view_get_tabs(text_view))) { pango_tab_array_get_tab(*tabs, 0, NULL, &loc); @@ -48,10 +48,10 @@ static void cb_begin_print(GtkPrintOperation *op, GtkTextIter start, end; GtkTextBuffer *buffer = gtk_text_view_get_buffer(data); PangoTabArray *tabs; - + gtk_text_buffer_get_bounds(buffer, &start, &end); text = g_strchomp(gtk_text_buffer_get_text(buffer, &start, &end, FALSE)); - + page_width = gtk_print_context_get_width(ctx); page_height = gtk_print_context_get_height(ctx); font_desc = gtk_style_context_get_font(gtk_widget_get_style_context(data), GTK_STATE_FLAG_NORMAL); @@ -59,21 +59,21 @@ static void cb_begin_print(GtkPrintOperation *op, pango_layout_set_width(layout, page_width * PANGO_SCALE); pango_layout_set_font_description(layout, font_desc); pango_layout_set_text(layout, text, -1); - + get_tab_array(&tabs, ctx, data); if (tabs) { pango_layout_set_tabs(layout, tabs); pango_tab_array_free(tabs); } pango_layout_get_size(layout, NULL, &layout_height); - + line_count = pango_layout_get_line_count(layout); text_height = pango_font_description_get_size(font_desc) / PANGO_SCALE; lines_per_page = page_height / text_height; - + n_pages = (line_count - 1) / lines_per_page + 1; gtk_print_operation_set_n_pages(op, n_pages); - + g_free(text); } @@ -83,19 +83,19 @@ static void cb_draw_page(GtkPrintOperation *op, cairo_t *cr; PangoLayoutLine *line; gint n_line, i, j = 0; - + PangoLayout *layout_lh, *layout_rh; gchar *page_text; gint layout_width; - + cr = gtk_print_context_get_cairo_context(ctx); - + layout_lh = gtk_print_context_create_pango_layout(ctx); pango_layout_set_font_description(layout_lh, font_desc); pango_layout_set_text(layout_lh, page_title, -1); cairo_move_to(cr, 0, - 72 / 25.4 * 10); pango_cairo_show_layout(cr, layout_lh); - + page_text = g_strdup_printf("%d / %d", page_nr + 1, n_pages); layout_rh = gtk_print_context_create_pango_layout(ctx); pango_layout_set_font_description(layout_rh, font_desc); @@ -106,18 +106,18 @@ static void cb_draw_page(GtkPrintOperation *op, page_width - layout_width / PANGO_SCALE, - 72 / 25.4 * 10); pango_cairo_show_layout(cr, layout_rh); g_free(page_text); - + if (line_count > lines_per_page * (page_nr + 1)) n_line = lines_per_page * (page_nr + 1); else n_line = line_count; - + for (i = lines_per_page * page_nr; i < n_line; i++) { line = pango_layout_get_line(layout, i); cairo_move_to(cr, 0, text_height * (j + 1)); pango_cairo_show_layout_line(cr, line); j++; - } + } } static void cb_end_print(GtkPrintOperation *op, @@ -132,12 +132,12 @@ static GtkPrintOperation *create_print_operation(GtkTextView *text_view) { GtkPrintOperation *op; static GtkPageSetup *page_setup = NULL; - + op = gtk_print_operation_new(); - + if (settings) gtk_print_operation_set_print_settings(op, settings); - + if (!page_setup) { page_setup = gtk_page_setup_new(); gtk_page_setup_set_top_margin(page_setup, 25.0, GTK_UNIT_MM); @@ -146,18 +146,18 @@ static GtkPrintOperation *create_print_operation(GtkTextView *text_view) gtk_page_setup_set_right_margin(page_setup, 20.0, GTK_UNIT_MM); } gtk_print_operation_set_default_page_setup(op, page_setup); - + g_signal_connect(op, "begin-print", G_CALLBACK(cb_begin_print), text_view); g_signal_connect(op, "draw-page", G_CALLBACK(cb_draw_page), NULL); g_signal_connect(op, "end-print", G_CALLBACK(cb_end_print), NULL); - + return op; } static void create_error_dialog(GtkTextView *text_view, gchar *message) { GtkWidget *dialog; - + dialog = gtk_message_dialog_new( GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(text_view))), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -177,10 +177,10 @@ void create_gtkprint_session(GtkTextView *text_view, const gchar *title) GtkPrintOperation *op; GtkPrintOperationResult res; GError *err = NULL; - + page_title = title; op = create_print_operation(text_view); - + res = gtk_print_operation_run(op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(text_view))), &err); switch (res) { @@ -194,7 +194,7 @@ void create_gtkprint_session(GtkTextView *text_view, const gchar *title) default: break; } - + g_object_unref(op); } @@ -203,16 +203,16 @@ void create_gtkprint_preview_session(GtkTextView *text_view, const gchar *title) GtkPrintOperation *op; GtkPrintOperationResult res; GError *err = NULL; - + page_title = title; op = create_print_operation(text_view); - + res = gtk_print_operation_run(op, GTK_PRINT_OPERATION_ACTION_PREVIEW, GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(text_view))), &err); if (res == GTK_PRINT_OPERATION_RESULT_ERROR) { create_error_dialog(text_view, err->message); g_error_free(err); } - + g_object_unref(op); } diff --git a/src/gtkprint.h b/src/gtkprint.h index ea73a29..901940a 100644 --- a/src/gtkprint.h +++ b/src/gtkprint.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2007 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/gtksourceiter.c b/src/gtksourceiter.c index 1f3b025..ac2fb54 100644 --- a/src/gtksourceiter.c +++ b/src/gtksourceiter.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- * gtksourceiter.h * - * Copyright (C) 2000, 2002 Paolo Maggi + * Copyright (C) 2000, 2002 Paolo Maggi * Copyright (C) 2002, 2003 Jeroen Zwartepoorte * * This library is free software; you can redistribute it and/or @@ -198,7 +198,7 @@ g_utf8_caselessnmatch (const char *s1, const char *s2, finally_2: g_free (normalized_s1); - g_free (normalized_s2); + g_free (normalized_s2); return ret; } @@ -231,7 +231,7 @@ forward_chars_with_skipping (GtkTextIter *iter, { /* being UTF8 correct sucks; this accounts for extra offsets coming from canonical decompositions of - UTF8 characters (e.g. accented characters) which + UTF8 characters (e.g. accented characters) which g_utf8_normalize() performs */ gunichar *decomp; gsize decomp_len; @@ -512,14 +512,14 @@ strbreakup (const char *string, * @match_start: return location for start of match, or %NULL * @match_end: return location for end of match, or %NULL * @limit: bound for the search, or %NULL for the end of the buffer - * - * Searches forward for @str. Any match is returned by setting - * @match_start to the first character of the match and @match_end to the + * + * Searches forward for @str. Any match is returned by setting + * @match_start to the first character of the match and @match_end to the * first character after the match. The search will not continue past * @limit. Note that a search is a linear or O(n) operation, so you * may wish to use @limit to avoid locking up your UI on large * buffers. - * + * * If the #GTK_SOURCE_SEARCH_VISIBLE_ONLY flag is present, the match may * have invisible text interspersed in @str. i.e. @str will be a * possibly-noncontiguous subsequence of the matched range. similarly, @@ -532,7 +532,7 @@ strbreakup (const char *string, * * Same as gtk_text_iter_forward_search(), but supports case insensitive * searching. - * + * * Return value: whether a match was found **/ gboolean @@ -556,7 +556,7 @@ gtk_source_iter_forward_search (const GtkTextIter *iter, if ((flags & GTK_SOURCE_SEARCH_CASE_INSENSITIVE) == 0) return gtk_text_iter_forward_search (iter, str, flags, match_start, match_end, - limit); + limit); if (limit && gtk_text_iter_compare (iter, limit) >= 0) return FALSE; @@ -632,10 +632,10 @@ gtk_source_iter_forward_search (const GtkTextIter *iter, * @match_start: return location for start of match, or %NULL * @match_end: return location for end of match, or %NULL * @limit: location of last possible @match_start, or %NULL for start of buffer - * + * * Same as gtk_text_iter_backward_search(), but supports case insensitive * searching. - * + * * Return value: whether a match was found **/ gboolean @@ -659,7 +659,7 @@ gtk_source_iter_backward_search (const GtkTextIter *iter, if ((flags & GTK_SOURCE_SEARCH_CASE_INSENSITIVE) == 0) return gtk_text_iter_backward_search (iter, str, flags, match_start, match_end, - limit); + limit); if (limit && gtk_text_iter_compare (iter, limit) <= 0) return FALSE; diff --git a/src/gtksourceiter.h b/src/gtksourceiter.h index c62801a..10366f1 100644 --- a/src/gtksourceiter.h +++ b/src/gtksourceiter.h @@ -1,7 +1,7 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- * gtksourceiter.h * - * Copyright (C) 2000, 2002 Paolo Maggi + * Copyright (C) 2000, 2002 Paolo Maggi * Copyright (C) 2002, 2003 Jeroen Zwartepoorte * * This library is free software; you can redistribute it and/or diff --git a/src/hlight.c b/src/hlight.c index df59e1d..57d6f53 100644 --- a/src/hlight.c +++ b/src/hlight.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -26,7 +26,7 @@ static gboolean searched_flag = FALSE; static void cb_changed(GtkTextBuffer *buffer) { GtkTextIter start, end; - + gtk_text_buffer_get_bounds(buffer, &start, &end); // gtk_text_buffer_remove_tag_by_name(buffer, // "searched", &start, &end); @@ -39,7 +39,7 @@ static void cb_changed(GtkTextBuffer *buffer) static void cb_paste_clipboard(void) { gchar *text; - + text = gtk_clipboard_wait_for_text( gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); if (text) { @@ -82,7 +82,7 @@ void hlight_init(GtkTextBuffer *buffer) G_CALLBACK(cb_changed), NULL); g_signal_handlers_block_by_func(G_OBJECT(buffer), G_CALLBACK(cb_changed), NULL); - + g_signal_connect(G_OBJECT(pub->mw->view), "paste-clipboard", G_CALLBACK(cb_paste_clipboard), NULL); } diff --git a/src/hlight.h b/src/hlight.h index a4b205f..dd94248 100644 --- a/src/hlight.h +++ b/src/hlight.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/indent.c b/src/indent.c index 59c5848..a9d37ea 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -45,7 +45,7 @@ static gchar *compute_indentation(GtkTextBuffer *buffer, GtkTextIter *iter, gint { GtkTextIter start_iter, end_iter; gunichar ch; - + gtk_text_buffer_get_iter_at_line(buffer, &start_iter, line); end_iter = start_iter; ch = gtk_text_iter_get_char(&end_iter); @@ -56,7 +56,7 @@ static gchar *compute_indentation(GtkTextBuffer *buffer, GtkTextIter *iter, gint } if (gtk_text_iter_equal(&start_iter, &end_iter)) return NULL; - + if (iter && gtk_text_iter_compare(iter, &end_iter) < 0) return gtk_text_iter_get_text(&start_iter, iter); return gtk_text_iter_get_text(&start_iter, &end_iter); @@ -66,9 +66,9 @@ void indent_real(GtkWidget *text_view) { GtkTextIter iter; gchar *ind, *str; - + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view)); - + g_signal_emit_by_name(G_OBJECT(buffer), "begin-user-action"); gtk_text_buffer_delete_selection(buffer, TRUE, TRUE); gtk_text_buffer_get_iter_at_mark(buffer, &iter, gtk_text_buffer_get_insert(buffer)); @@ -78,7 +78,7 @@ void indent_real(GtkWidget *text_view) g_signal_emit_by_name(G_OBJECT(buffer), "end-user-action"); g_free(str); g_free(ind); - + gtk_text_view_scroll_mark_onscreen( GTK_TEXT_VIEW(text_view), gtk_text_buffer_get_insert(buffer)); @@ -96,7 +96,7 @@ static gint calculate_real_tab_width(GtkWidget *text_view, guint tab_size) //fro tab_string = g_strnfill(tab_size, 0x20); layout = gtk_widget_create_pango_layout(text_view, tab_string); g_free (tab_string); - + if (layout != NULL) { pango_layout_get_pixel_size(layout, &tab_width, NULL); g_object_unref(G_OBJECT(layout)); @@ -109,7 +109,7 @@ static gint calculate_real_tab_width(GtkWidget *text_view, guint tab_size) //fro void indent_refresh_tab_width(GtkWidget *text_view) { PangoTabArray *tab_array; - + tab_array = pango_tab_array_new(1, TRUE); pango_tab_array_set_tab(tab_array, 0, PANGO_TAB_LEFT, calculate_real_tab_width(text_view, current_tab_width)); @@ -140,7 +140,7 @@ void indent_multi_line_indent(GtkTextBuffer *buffer) GtkTextIter start_iter, end_iter, iter; gint start_line, end_line, i; gboolean pos; - + gtk_text_buffer_get_selection_bounds(buffer, &start_iter, &end_iter); start_line = gtk_text_iter_get_line(&start_iter); end_line = gtk_text_iter_get_line(&end_iter); @@ -155,7 +155,7 @@ void indent_multi_line_indent(GtkTextBuffer *buffer) undo_set_sequency(TRUE); } undo_set_sequency(FALSE); - + gtk_text_buffer_get_iter_at_line(buffer, &start_iter, start_line); gtk_text_buffer_get_iter_at_line(buffer, &end_iter, end_line); if (pos) { @@ -171,11 +171,11 @@ static gint compute_indent_offset_length(const gchar *ind) { guint8 c = *ind; gint len = 1; - + if (c == 0x20) while ((len < current_tab_width) && (c = *++ind) == 0x20) len++; - + return len; } @@ -185,7 +185,7 @@ void indent_multi_line_unindent(GtkTextBuffer *buffer) gint start_line, end_line, i, len; gboolean pos; gchar *ind; - + gtk_text_buffer_get_selection_bounds(buffer, &start_iter, &end_iter); start_line = gtk_text_iter_get_line(&start_iter); end_line = gtk_text_iter_get_line(&end_iter); @@ -210,7 +210,7 @@ void indent_multi_line_unindent(GtkTextBuffer *buffer) i++; } while (i < end_line); undo_set_sequency(FALSE); - + gtk_text_buffer_get_iter_at_line(buffer, &start_iter, start_line); gtk_text_buffer_get_iter_at_line(buffer, &end_iter, end_line); if (pos) { diff --git a/src/indent.h b/src/indent.h index 59aa8c7..a80d82d 100644 --- a/src/indent.h +++ b/src/indent.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/l3afpad.h b/src/l3afpad.h index fd53bd3..3e32e42 100644 --- a/src/l3afpad.h +++ b/src/l3afpad.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -27,6 +27,10 @@ #include #include +#ifndef ENABLE_PRINT +#define ENABLE_PRINT 1 +#endif + #include "window.h" #include "menu.h" #include "callback.h" @@ -44,9 +48,10 @@ #include "dnd.h" #include "utils.h" #include "emacs.h" -#ifdef ENABLE_PRINT +#if ENABLE_PRINT #include "gtkprint.h" #endif +#include #undef GTK_CHECK_MENU_ITEM #define GTK_CHECK_MENU_ITEM @@ -55,8 +60,6 @@ #define gtk_item_factory_from_widget (GtkUIManager*) #define gtk_item_factory_get_item(x,y) GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(x,y)) #define gtk_item_factory_get_widget gtk_ui_manager_get_widget -#if GTK_CHECK_VERSION(3, 0, 0) -#include #define GTK_OPTION_MENU GTK_COMBO_BOX #define GTK_WIDGET_IS_SENSITIVE gtk_widget_is_sensitive #define GTK_WIDGET_VISIBLE gtk_widget_get_visible @@ -65,6 +68,17 @@ #define gtk_option_menu_new gtk_combo_box_text_new #define gtk_option_menu_set_history gtk_combo_box_set_active #define gtk_option_menu_set_menu(x,y) +#ifndef USE_GTK_GRID +#define gtk_orientable_set_orientation(x,y) +#define gtk_widget_set_hexpand(x,y) +#define gtk_widget_set_vexpand(x,y) +#endif +#ifdef USE_GTK_GRID +#undef GTK_BOX +#define GTK_BOX GTK_GRID +#define gtk_hbox_new(x,y) gtk_grid_new() +#define gtk_vbox_new(x,y) gtk_grid_new() +#define gtk_box_pack_start(v,w,x,y,z) gtk_container_add(GTK_CONTAINER(v),w) #endif #if GTK_CHECK_VERSION(3,1,12) #undef GTK_FONT_SELECTION_DIALOG diff --git a/src/linenum.c b/src/linenum.c index ca4d321..644415c 100644 --- a/src/linenum.c +++ b/src/linenum.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -59,13 +59,13 @@ get_lines (GtkTextView *text_view, gint size; #endif gint last_line_num; - + g_array_set_size (buffer_coords, 0); g_array_set_size (numbers, 0); - + /* Get iter at first y */ gtk_text_view_get_line_at_y (text_view, &iter, y1, NULL); - + /* For each iter, get its location and add it to the arrays. * Stop when we pass y2 */ @@ -73,41 +73,41 @@ get_lines (GtkTextView *text_view, #if 0 size = 0; #endif - + while (!gtk_text_iter_is_end (&iter)) { gint y, height; - + gtk_text_view_get_line_yrange (text_view, &iter, &y, &height); - + g_array_append_val (buffer_coords, y); last_line_num = gtk_text_iter_get_line (&iter); g_array_append_val (numbers, last_line_num); - + ++count; - + if ((y + height) >= y2) break; - + gtk_text_iter_forward_line (&iter); } - + if (gtk_text_iter_is_end (&iter)) { gint y, height; gint line_num; - + gtk_text_view_get_line_yrange (text_view, &iter, &y, &height); - + line_num = gtk_text_iter_get_line (&iter); - + if (line_num != last_line_num) { g_array_append_val (buffer_coords, y); g_array_append_val (numbers, line_num); ++count; } } - + *countp = count; } @@ -132,17 +132,17 @@ line_numbers_expose (GtkWidget *widget, cairo_t *event) cairo_t *gc; gint height; #endif - + if (line_number_visible){{{{{ // omit calculation - + text_view = GTK_TEXT_VIEW (widget); - + /* See if this expose is on the line numbers window */ /* left_win = gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_LEFT); right_win = gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_RIGHT); - + if (event->window == left_win) { type = GTK_TEXT_WINDOW_LEFT; @@ -155,48 +155,48 @@ line_numbers_expose (GtkWidget *widget, cairo_t *event) } else return FALSE; -*/ +*/ #if 0 GdkWindow *win; win = gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_LEFT); if (event->window != win) return FALSE; - + // style = gtk_style_copy (widget->style); // style = gtk_style_copy (gtk_widget_get_default_style()); - + y1 = event->area.y; y2 = y1 + event->area.height; #endif - + gtk_text_view_window_to_buffer_coords (text_view, GTK_TEXT_WINDOW_LEFT, 0, y1, NULL, &y1); - + gtk_text_view_window_to_buffer_coords (text_view, GTK_TEXT_WINDOW_LEFT, 0, y2, NULL, &y2); - + numbers = g_array_new (FALSE, FALSE, sizeof (gint)); pixels = g_array_new (FALSE, FALSE, sizeof (gint)); - + get_lines (text_view, y1, y2, pixels, numbers, &count); - + /* a zero-lined document should display a "1"; we don't need to worry about scrolling effects of the text widget in this special case */ - + if (count == 0) { gint y = 0; @@ -205,21 +205,21 @@ line_numbers_expose (GtkWidget *widget, cairo_t *event) g_array_append_val (pixels, y); g_array_append_val (numbers, n); } - + DV({g_print("Painting line numbers %d - %d\n", g_array_index(numbers, gint, 0), g_array_index(numbers, gint, count - 1)); }); - + layout = gtk_widget_create_pango_layout (widget, ""); - + // str = g_strdup_printf ("%d", gtk_text_buffer_get_line_count(text_view->buffer)); g_snprintf (str, sizeof (str), "%d", MAX (99, gtk_text_buffer_get_line_count(gtk_text_view_get_buffer(text_view)))); pango_layout_set_text (layout, str, -1); // g_free (str); - + pango_layout_get_pixel_size (layout, &layout_width, NULL); - + min_number_window_width = calculate_min_number_window_width(widget); if (layout_width > min_number_window_width) gtk_text_view_set_border_window_size (text_view, @@ -231,10 +231,10 @@ DV({g_print("Painting line numbers %d - %d\n", // } justify_width = min_number_window_width - layout_width; } - + pango_layout_set_width (layout, layout_width); pango_layout_set_alignment (layout, PANGO_ALIGN_RIGHT); - + alist = pango_attr_list_new(); attr = pango_attr_foreground_new( #if 1 @@ -251,27 +251,27 @@ DV({g_print("Painting line numbers %d - %d\n", pango_attr_list_insert(alist, attr); pango_layout_set_attributes(layout, alist); pango_attr_list_unref(alist); - + /* Draw fully internationalized numbers! */ - + i = 0; while (i < count) { gint pos; - + gtk_text_view_buffer_to_window_coords (text_view, GTK_TEXT_WINDOW_LEFT, 0, g_array_index (pixels, gint, i), NULL, &pos); - + // str = g_strdup_printf ("%d", g_array_index (numbers, gint, i) + 1); g_snprintf (str, sizeof (str), "%d", g_array_index (numbers, gint, i) + 1); - + pango_layout_set_text (layout, str, -1); - + gtk_paint_layout (gtk_widget_get_style(widget), event, gtk_widget_get_state (widget), @@ -282,20 +282,20 @@ DV({g_print("Painting line numbers %d - %d\n", pos, layout); // g_free (str); - + ++i; } - + g_array_free (pixels, TRUE); g_array_free (numbers, TRUE); - + g_object_unref (G_OBJECT (layout)); // g_object_ref (G_OBJECT (style)); - + /* don't stop emission, need to draw children */ - + }}}}} - + #if 0 gc = gdk_gc_new(event->window); gdk_gc_set_foreground(gc, widget->style->base); @@ -305,10 +305,10 @@ DV({g_print("Painting line numbers %d - %d\n", layout_width + justify_width + margin : 0, 0, submargin, height); - + g_object_unref(gc); #endif - + return FALSE; } diff --git a/src/linenum.h b/src/linenum.h index cb984db..155a46a 100644 --- a/src/linenum.h +++ b/src/linenum.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/main.c b/src/main.c index 46f6969..0a30a9f 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -38,7 +38,7 @@ static void load_config_file(Conf *conf) gchar *path; gchar buf[BUFSIZ]; gchar **num; - + path = g_build_filename(g_get_user_config_dir(), PACKAGE, PACKAGE "rc", NULL); fp = fopen(path, "r"); @@ -76,7 +76,7 @@ void save_config_file(void) gint width, height; gchar *fontname; gboolean wordwrap, linenumbers, autoindent; - + gtk_window_get_size(GTK_WINDOW(pub->mw->window), &width, &height); fontname = get_font_name_from_widget(pub->mw->view); ifactory = gtk_item_factory_from_widget(pub->mw->menubar); @@ -89,7 +89,7 @@ void save_config_file(void) autoindent = gtk_check_menu_item_get_active( GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item(ifactory, "/M/Options/AutoIndent"))); - + path = g_build_filename(g_get_user_config_dir(), PACKAGE, NULL); if (!g_file_test(path, G_FILE_TEST_IS_DIR)) g_mkdir_with_parents(path, 0700); @@ -102,7 +102,7 @@ void save_config_file(void) return; } g_free(path); - + fprintf(fp, "%s\n", PACKAGE_VERSION); fprintf(fp, "%d\n", width); fprintf(fp, "%d\n", height); @@ -111,7 +111,7 @@ void save_config_file(void) fprintf(fp, "%d\n", linenumbers); fprintf(fp, "%d\n", autoindent); fclose(fp); - + g_free(fontname); } @@ -122,13 +122,13 @@ static void parse_args(gint argc, gchar **argv, FileInfo *fi) EncArray *encarray; gint i; GError *error = NULL; - + GOptionContext *context; gchar *opt_codeset = NULL; gint opt_tab_width = 0; gboolean opt_jump = 0; gboolean opt_version = FALSE; - GOptionEntry entries[] = + GOptionEntry entries[] = { { "codeset", 0, 0, G_OPTION_ARG_STRING, &opt_codeset, "Set codeset to open file", "CODESET" }, { "tab-width", 0, 0, G_OPTION_ARG_INT, &opt_tab_width, "Set tab width", "WIDTH" }, @@ -136,14 +136,14 @@ static void parse_args(gint argc, gchar **argv, FileInfo *fi) { "version", 0, 0, G_OPTION_ARG_NONE, &opt_version, "Show version number", NULL }, { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } }; - + context = g_option_context_new("[filename]"); g_option_context_add_main_entries(context, entries, PACKAGE); g_option_context_add_group(context, gtk_get_option_group(TRUE)); g_option_context_set_ignore_unknown_options(context, FALSE); g_option_context_parse(context, &argc, &argv, &error); g_option_context_free(context); - + if (error) { g_print("%s: %s\n", PACKAGE, error->message); g_error_free(error); @@ -167,19 +167,19 @@ static void parse_args(gint argc, gchar **argv, FileInfo *fi) indent_set_default_tab_width(opt_tab_width); if (opt_jump) jump_linenum = opt_jump; - - if (fi->charset - && (g_strcasecmp(fi->charset, get_default_charset()) != 0) - && (g_strcasecmp(fi->charset, "UTF-8") != 0)) { + + if (fi->charset + && (g_ascii_strcasecmp(fi->charset, get_default_charset()) != 0) + && (g_ascii_strcasecmp(fi->charset, "UTF-8") != 0)) { encarray = get_encoding_items(get_encoding_code()); for (i = 0; i < ENCODING_MAX_ITEM_NUM; i++) if (encarray->item[i]) - if (g_strcasecmp(fi->charset, encarray->item[i]) == 0) + if (g_ascii_strcasecmp(fi->charset, encarray->item[i]) == 0) break; if (i == ENCODING_MAX_ITEM_NUM) fi->charset_flag = TRUE; } - + if (argc >= 2) fi->filename = parse_file_uri(argv[1]); } @@ -189,25 +189,25 @@ gint main(gint argc, gchar **argv) Conf *conf; GtkItemFactory *ifactory; gchar *stdin_data = NULL; - + bindtextdomain(PACKAGE, LOCALEDIR); bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); - + pub = g_malloc(sizeof(PublicData)); pub->fi = g_malloc(sizeof(FileInfo)); pub->fi->filename = NULL; pub->fi->charset = NULL; pub->fi->charset_flag = FALSE; pub->fi->lineend = LF; - + parse_args(argc, argv, pub->fi); - + gtk_init(&argc, &argv); g_set_application_name(PACKAGE_NAME); - + pub->mw = create_main_window(); - + conf = g_malloc(sizeof(Conf)); conf->width = 600; conf->height = 400; @@ -215,13 +215,12 @@ gint main(gint argc, gchar **argv) conf->wordwrap = FALSE; conf->linenumbers = FALSE; conf->autoindent = FALSE; - + load_config_file(conf); - + gtk_window_set_default_size( GTK_WINDOW(pub->mw->window), conf->width, conf->height); - set_text_font_by_name(pub->mw->view, conf->fontname); - gtk_window_set_icon_from_file(GTK_WINDOW(pub->mw->window), ICONDIR"/l3afpad.png", NULL); + set_text_font_by_name(pub->mw->view, conf->fontname); ifactory = gtk_item_factory_from_widget(pub->mw->menubar); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM( @@ -234,22 +233,22 @@ gint main(gint argc, gchar **argv) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM( (GtkCheckMenuItem*)gtk_item_factory_get_widget(ifactory, "/M/Options/AutoIndent")), conf->autoindent); - + gtk_widget_show_all(pub->mw->window); g_free(conf->fontname); g_free(conf); - -#ifdef ENABLE_EMACS + +#if ENABLE_EMACS check_emacs_key_theme(GTK_WINDOW(pub->mw->window), ifactory); #endif - + hlight_init(pub->mw->buffer); undo_init(pub->mw->view, gtk_item_factory_get_widget(ifactory, "/M/Edit/Undo"), gtk_item_factory_get_widget(ifactory, "/M/Edit/Redo")); // hlight_init(pub->mw->buffer); dnd_init(pub->mw->view); - + if (pub->fi->filename) file_open_real(pub->mw->view, pub->fi); #ifdef G_OS_UNIX @@ -259,11 +258,11 @@ gint main(gint argc, gchar **argv) if (stdin_data) { gchar *str; GtkTextIter iter; - + str = g_convert(stdin_data, -1, "UTF-8", get_default_charset(), NULL, NULL, NULL); g_free(stdin_data); - + // gtk_text_buffer_set_text(buffer, "", 0); gtk_text_buffer_get_start_iter(pub->mw->buffer, &iter); gtk_text_buffer_insert(pub->mw->buffer, &iter, str, strlen(str)); @@ -273,20 +272,20 @@ gint main(gint argc, gchar **argv) gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(pub->mw->view), &iter, 0, FALSE, 0, 0); g_free(str); } - + if (jump_linenum) { GtkTextIter iter; - + gtk_text_buffer_get_iter_at_line(pub->mw->buffer, &iter, jump_linenum - 1); gtk_text_buffer_place_cursor(pub->mw->buffer, &iter); // gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textview), &iter, 0.1, FALSE, 0.5, 0.5); scroll_to_cursor(pub->mw->buffer, 0.25); } - + set_main_window_title(); // hlight_apply_all(pub->mw->buffer); - + gtk_main(); - + return 0; } diff --git a/src/menu.c b/src/menu.c index 11a7516..61dded9 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2,7 +2,7 @@ * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji * Copyright (C) 2011 Wen-Yen Chuang - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -40,7 +40,7 @@ static GtkActionEntry menu_items[] = { "Open", GTK_STOCK_OPEN, N_("_Open..."), "O", NULL, G_CALLBACK(on_file_open) }, { "Save", GTK_STOCK_SAVE, N_("_Save"), "S", NULL, G_CALLBACK(on_file_save) }, { "SaveAs", GTK_STOCK_SAVE_AS, N_("Save _As..."), "S", NULL, G_CALLBACK(on_file_save_as) }, -#ifdef ENABLE_PRINT +#if ENABLE_PRINT { "PrintPreview", GTK_STOCK_PRINT_PREVIEW, N_("Print Pre_view"), "P", NULL, G_CALLBACK(on_file_print_preview) }, { "Print", GTK_STOCK_PRINT, N_("_Print..."), "P", NULL, G_CALLBACK(on_file_print) }, #endif @@ -71,7 +71,7 @@ static GtkToggleActionEntry toggle_entries[] = }; static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries); -static const gchar *ui_info = +static const gchar *ui_info = "" " " " " @@ -80,9 +80,11 @@ static const gchar *ui_info = " " " " " " +#if ENABLE_PRINT " " " " " " +#endif " " " " " " @@ -120,9 +122,9 @@ static const gchar *ui_info = static gchar *menu_translate(const gchar *path, gpointer data) { gchar *str; - + str = (gchar *)_(path); - + return str; } @@ -152,7 +154,7 @@ GtkWidget *create_menu_bar(GtkWidget *window) GtkItemFactory *ifactory; #if 0 gboolean flag_emacs = FALSE; - + gchar *key_theme = NULL; GtkSettings *settings = gtk_settings_get_default(); if (settings) { @@ -164,7 +166,7 @@ GtkWidget *create_menu_bar(GtkWidget *window) } } #endif - + ifactory = gtk_ui_manager_new(); GtkActionGroup *actions = gtk_action_group_new("Actions"); gtk_action_group_set_translate_func(actions, menu_translate, NULL, NULL); @@ -174,7 +176,7 @@ GtkWidget *create_menu_bar(GtkWidget *window) g_object_unref(actions); gtk_ui_manager_add_ui_from_string(ifactory, ui_info, -1, NULL); gtk_window_add_accel_group(GTK_WINDOW(window), accel_group); - + /* hidden keybinds */ gtk_accel_group_connect( accel_group, GDK_W, GDK_CONTROL_MASK, 0, @@ -194,7 +196,7 @@ GtkWidget *create_menu_bar(GtkWidget *window) gtk_widget_add_accelerator( gtk_item_factory_get_widget(ifactory, "/M/Search/Replace"), "activate", accel_group, GDK_R, GDK_CONTROL_MASK, 0); - + /* initialize sensitivities */ gtk_widget_set_sensitive( gtk_item_factory_get_widget(ifactory, "/M/Search/FindNext"), @@ -202,13 +204,13 @@ GtkWidget *create_menu_bar(GtkWidget *window) gtk_widget_set_sensitive( gtk_item_factory_get_widget(ifactory, "/M/Search/FindPrevious"), FALSE); - + menu_item_save = gtk_item_factory_get_widget(ifactory, "/M/File/Save"); menu_item_cut = gtk_item_factory_get_widget(ifactory, "/M/Edit/Cut"); menu_item_copy = gtk_item_factory_get_widget(ifactory, "/M/Edit/Copy"); menu_item_paste = gtk_item_factory_get_widget(ifactory, "/M/Edit/Paste"); menu_item_delete = gtk_item_factory_get_widget(ifactory, "/M/Edit/Delete"); menu_sensitivity_from_selection_bound(FALSE); - + return (GtkWidget*)ifactory; } diff --git a/src/menu.h b/src/menu.h index 03dfd73..9b4ab1b 100644 --- a/src/menu.h +++ b/src/menu.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/search.c b/src/search.c index aed193c..2a40a2a 100644 --- a/src/search.c +++ b/src/search.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -19,19 +19,8 @@ #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include "dialog.h" -#include "utils.h" -#include "view.h" -#include "undo.h" +#include "l3afpad.h" #include "gtksourceiter.h" -#include "search.h" -#include "hlight.h" static gchar *string_find = NULL; static gchar *string_replace = NULL; @@ -43,13 +32,13 @@ static gboolean hlight_searched_strings(GtkTextBuffer *buffer, gchar *str) gboolean res, retval = FALSE; GtkSourceSearchFlags search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; - + if (!string_find) return FALSE; - + if (!match_case) search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; - + gtk_text_buffer_get_bounds(buffer, &start, &end); /* gtk_text_buffer_remove_tag_by_name(buffer, "searched", &start, &end); @@ -72,7 +61,7 @@ static gboolean hlight_searched_strings(GtkTextBuffer *buffer, gchar *str) replace_mode = FALSE; else */ hlight_toggle_searched(buffer); - + return retval; } @@ -82,21 +71,21 @@ gboolean document_search_real(GtkWidget *textview, gint direction) gboolean res; GtkSourceSearchFlags search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; GtkTextBuffer *textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); - + if (!string_find) return FALSE; - + if (!match_case) search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; - + // if (direction == 0 || !hlight_check_searched()) if (direction == 0 || (direction != 2 && !hlight_check_searched())) hlight_searched_strings(gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)), string_find); - + gtk_text_mark_set_visible( gtk_text_buffer_get_selection_bound( gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview))), FALSE); - + gtk_text_buffer_get_iter_at_mark(textbuffer, &iter, gtk_text_buffer_get_insert(textbuffer)); if (direction < 0) { res = gtk_source_iter_backward_search( @@ -110,7 +99,7 @@ gboolean document_search_real(GtkWidget *textview, gint direction) &iter, string_find, search_flags, &match_start, &match_end, NULL); } /* TODO: both gtk_(text/source)_iter_backward_search works not fine for multi-byte */ - + /* wrap */ /* TODO: define limit NULL -> proper value */ if (!res) { @@ -124,17 +113,17 @@ gboolean document_search_real(GtkWidget *textview, gint direction) &iter, string_find, search_flags, &match_start, &match_end, NULL); } } - + if (res) { gtk_text_buffer_place_cursor(textbuffer, &match_start); gtk_text_buffer_move_mark_by_name(textbuffer, "insert", &match_end); // gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textview), &match_start, 0.1, FALSE, 0.5, 0.5); scroll_to_cursor(textbuffer, 0.05); - } + } else if (direction == 0) run_dialog_message(gtk_widget_get_toplevel(textview), GTK_MESSAGE_WARNING, _("Search string not found")); - + return res; } @@ -145,18 +134,18 @@ static gint document_replace_real(GtkWidget *textview) gboolean res; gint num = 0, offset; GtkWidget *q_dialog = NULL; - GtkSourceSearchFlags search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; + GtkSourceSearchFlags search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; GtkTextBuffer *textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); - + if (!match_case) search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; - + if (replace_all) { gtk_text_buffer_get_iter_at_mark(textbuffer, &iter, gtk_text_buffer_get_insert(textbuffer)); mark_init = gtk_text_buffer_create_mark(textbuffer, NULL, &iter, FALSE); gtk_text_buffer_get_start_iter(textbuffer, &iter); - + gtk_text_buffer_get_end_iter(textbuffer, &match_end); // gtk_text_buffer_remove_tag_by_name(textbuffer, // "replaced", &iter, &match_end); @@ -166,7 +155,7 @@ static gint document_replace_real(GtkWidget *textview) hlight_searched_strings(textbuffer, string_find); hlight_toggle_searched(textbuffer); } - + do { if (replace_all) { res = gtk_source_iter_forward_search( @@ -181,7 +170,7 @@ static gint document_replace_real(GtkWidget *textview) else // res = document_search_real(textview, 0); res = document_search_real(textview, 2); - + if (res) { if (!replace_all) { if (num == 0 && q_dialog == NULL) @@ -227,7 +216,7 @@ static gint document_replace_real(GtkWidget *textview) gtk_text_buffer_get_iter_at_mark( textbuffer, &iter, gtk_text_buffer_get_insert(textbuffer)); - + num++; /* if (replace_all) undo_set_sequency(TRUE); @@ -238,7 +227,7 @@ static gint document_replace_real(GtkWidget *textview) } while (res); if (!hlight_check_searched()) hlight_toggle_searched(textbuffer); - + if (q_dialog) gtk_widget_destroy(q_dialog); /* if (strlen(string_replace)) { @@ -252,7 +241,7 @@ static gint document_replace_real(GtkWidget *textview) _("%d strings replaced"), num); undo_set_sequency(FALSE); } - + return num; } @@ -293,7 +282,7 @@ gint run_dialog_search(GtkWidget *textview, gint mode) GtkWidget *entry_find, *entry_replace = NULL; GtkWidget *check_case, *check_all; gint res; - + if (mode) dialog = gtk_dialog_new_with_buttons(_("Replace"), GTK_WINDOW(gtk_widget_get_toplevel(textview)), @@ -308,7 +297,7 @@ gint run_dialog_search(GtkWidget *textview, gint mode) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_FIND, GTK_RESPONSE_OK, NULL); - + table = gtk_table_new(mode + 2, 2, FALSE); gtk_table_set_row_spacings(GTK_TABLE(table), 8); gtk_table_set_col_spacings(GTK_TABLE(table), 8); @@ -346,7 +335,7 @@ gint run_dialog_search(GtkWidget *textview, gint mode) gtk_entry_set_activates_default(GTK_ENTRY(entry_find), TRUE); if (mode) gtk_entry_set_activates_default(GTK_ENTRY(entry_replace), TRUE); - + check_case = gtk_check_button_new_with_mnemonic(_("_Match case")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_case), match_case); g_signal_connect(check_case, "toggled", G_CALLBACK(toggle_check_case), NULL); @@ -358,8 +347,8 @@ gint run_dialog_search(GtkWidget *textview, gint mode) gtk_table_attach_defaults(GTK_TABLE(table), check_all, 0, 2, 2 + mode, 3 + mode); } gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); - gtk_widget_show_all(table); - + gtk_widget_show_all(table); + res = gtk_dialog_run(GTK_DIALOG(dialog)); if (res == GTK_RESPONSE_OK) { g_free(string_find); @@ -369,9 +358,9 @@ gint run_dialog_search(GtkWidget *textview, gint mode) string_replace = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry_replace))); } } - + gtk_widget_destroy(dialog); - + if (res == GTK_RESPONSE_OK) { if (strlen(string_find)) { if (mode) @@ -380,7 +369,7 @@ gint run_dialog_search(GtkWidget *textview, gint mode) document_search_real(textview, 0); } } - + return res; } @@ -394,15 +383,15 @@ void run_dialog_jump_to(GtkWidget *textview) GtkAdjustment *spinner_adj; GtkTextIter iter; gint num, max_num; - + GtkTextBuffer *textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); - + gtk_text_buffer_get_iter_at_mark(textbuffer, &iter, gtk_text_buffer_get_insert(textbuffer)); num = gtk_text_iter_get_line(&iter) + 1; gtk_text_buffer_get_end_iter(textbuffer, &iter); max_num = gtk_text_iter_get_line(&iter) + 1; - + dialog = gtk_dialog_new_with_buttons(_("Jump To"), GTK_WINDOW(gtk_widget_get_toplevel(textview)), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -423,11 +412,11 @@ void run_dialog_jump_to(GtkWidget *textview) gtk_entry_set_activates_default(GTK_ENTRY(spinner), TRUE); gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1); gtk_table_attach_defaults(GTK_TABLE(table), spinner, 1, 2, 0, 1); - + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_widget_show_all(dialog); - + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { gtk_text_buffer_get_iter_at_line(textbuffer, &iter, gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinner)) - 1); @@ -435,6 +424,6 @@ void run_dialog_jump_to(GtkWidget *textview) // gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textview), &iter, 0.1, FALSE, 0.5, 0.5); scroll_to_cursor(textbuffer, 0.25); } - + gtk_widget_destroy (dialog); } diff --git a/src/search.h b/src/search.h index 208e3c4..3ce7d35 100644 --- a/src/search.h +++ b/src/search.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/selector.c b/src/selector.c index f79338a..91137ce 100644 --- a/src/selector.c +++ b/src/selector.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -46,23 +46,22 @@ static void cb_select_lineend(GtkOptionMenu *option_menu, FileInfo *selected_fi) static GtkWidget *create_lineend_menu(FileInfo *selected_fi) { - GtkWidget *option_menu; - GtkWidget *menu; - GtkWidget *menu_item; + GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING); + GtkTreeIter iter; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + GtkWidget *option_menu = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); gint i; - - option_menu = gtk_option_menu_new(); - menu = gtk_menu_new(); + for (i = 0; i <= 2; i++) { - menu_item = gtk_menu_item_new_with_label(lineend_str[i]); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item); - gtk_widget_show(menu_item); // <- required for width adjustment + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, 0, lineend_str[i], -1); } - gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); - + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (option_menu), renderer, FALSE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (option_menu), renderer, "text", 0, NULL); + g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(cb_select_lineend), selected_fi); - + i = 0; switch (selected_fi->lineend) { case CR+LF: @@ -72,7 +71,7 @@ static GtkWidget *create_lineend_menu(FileInfo *selected_fi) i = 2; } gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), i); - + return option_menu; } @@ -87,7 +86,7 @@ static CharsetTable *get_charset_table(void) static CharsetTable *ctable = NULL; EncArray *encarray; gint i; - + if (!ctable) { ctable = g_malloc(sizeof(CharsetTable)); ctable->num = 0; @@ -105,7 +104,7 @@ static CharsetTable *get_charset_table(void) ctable->num++; } } - + return ctable; } @@ -121,14 +120,14 @@ static GtkWidget *init_menu_item_manual_charset(gchar *manual_charset) { static GtkLabel *label; gchar *str; - + if (other_codeset_title == NULL) other_codeset_title = _("Other Codeset"); - + str = manual_charset ? g_strdup_printf("%s (%s)", other_codeset_title, manual_charset) : g_strdup_printf("%s...", other_codeset_title); - + if (!menu_item_manual_charset) { menu_item_manual_charset = gtk_menu_item_new_with_label(str); label = GTK_LABEL(gtk_bin_get_child(GTK_BIN(menu_item_manual_charset))); @@ -136,7 +135,7 @@ static GtkWidget *init_menu_item_manual_charset(gchar *manual_charset) // gtk_label_set_text(GTK_LABEL(GTK_BIN(menu_item_manual_charset)->child), str); gtk_label_set_text(label, str); g_free(str); - + return menu_item_manual_charset; } @@ -148,7 +147,7 @@ static gboolean get_manual_charset(GtkOptionMenu *option_menu, FileInfo *selecte GtkWidget *entry; GError *err = NULL; gchar *str; - + dialog = gtk_dialog_new_with_buttons(other_codeset_title, GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(option_menu))), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -157,28 +156,31 @@ static gboolean get_manual_charset(GtkOptionMenu *option_menu, FileInfo *selecte NULL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE); - + vbox = gtk_vbox_new(FALSE, 0); + gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL); gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox, FALSE, FALSE, 0); - + label = gtk_label_new_with_mnemonic(_("Code_set:")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); - + entry = gtk_entry_new(); + gtk_widget_set_hexpand (entry, TRUE); + gtk_widget_set_vexpand (entry, TRUE); gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 5); - + gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), GTK_RESPONSE_OK, FALSE); g_signal_connect_after(G_OBJECT(entry), "changed", G_CALLBACK(toggle_sensitivity), NULL); if (selected_fi->charset_flag) gtk_entry_set_text(GTK_ENTRY(entry), selected_fi->charset); - + gtk_widget_show_all(vbox); - + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { g_convert("TEST", -1, "UTF-8", gtk_entry_get_text(GTK_ENTRY(entry)), NULL, NULL, &err); if (err) { @@ -193,15 +195,15 @@ static gboolean get_manual_charset(GtkOptionMenu *option_menu, FileInfo *selecte selected_fi->charset = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); selected_fi->charset_flag = TRUE; gtk_widget_destroy(dialog); - + init_menu_item_manual_charset(selected_fi->charset_flag ? selected_fi->charset : NULL); - + return TRUE; } } gtk_widget_destroy(dialog); - + return FALSE; } @@ -211,7 +213,7 @@ static void cb_select_charset(GtkOptionMenu *option_menu, FileInfo *selected_fi) { CharsetTable *ctable; static guint index_history = 0, prev_history; - + prev_history = index_history; index_history = gtk_option_menu_get_history(option_menu); if (!charset_menu_init_flag) { @@ -235,40 +237,36 @@ static void cb_select_charset(GtkOptionMenu *option_menu, FileInfo *selected_fi) static GtkWidget *create_charset_menu(FileInfo *selected_fi) { - GtkWidget *option_menu; - GtkWidget *menu; - GtkWidget *menu_item; + GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING); + GtkTreeIter iter; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + GtkWidget *option_menu = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); CharsetTable *ctable; guint i; - - option_menu = gtk_option_menu_new(); - menu = gtk_menu_new(); - + if (mode == OPEN) { - menu_item = gtk_menu_item_new_with_label(_("Auto-Detect")); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item); - gtk_widget_show(menu_item); // <- required for width adjustment + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, 0, _("Auto-Detect"), -1); } ctable = get_charset_table(); for (i = 0; i < ctable->num; i++) { - menu_item = gtk_menu_item_new_with_label(ctable->str[i]); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item); - gtk_widget_show(menu_item); // <- required for width adjustment + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, 0, ctable->str[i], -1); } menu_item_manual_charset = NULL; - gtk_menu_shell_append(GTK_MENU_SHELL(menu), - init_menu_item_manual_charset(selected_fi->charset_flag - ? selected_fi->charset : NULL)); - gtk_widget_show(menu_item_manual_charset); // <- required for width adjustment - + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, 0, gtk_menu_item_get_label(GTK_MENU_ITEM(init_menu_item_manual_charset(selected_fi->charset_flag + ? selected_fi->charset : NULL))), -1); + charset_menu_init_flag = TRUE; g_signal_connect(G_OBJECT(option_menu), "changed", G_CALLBACK(cb_select_charset), selected_fi); - gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (option_menu), renderer, FALSE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (option_menu), renderer, "text", 0, NULL); i = 0; if (selected_fi->charset) { do { - if (g_strcasecmp(selected_fi->charset, ctable->charset[i]) == 0) + if (g_ascii_strcasecmp(selected_fi->charset, ctable->charset[i]) == 0) break; i++; } while (i < ctable->num); @@ -283,7 +281,7 @@ static GtkWidget *create_charset_menu(FileInfo *selected_fi) if (mode == SAVE || selected_fi->charset_flag) gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), i); charset_menu_init_flag = FALSE; - + return option_menu; } @@ -296,16 +294,16 @@ static GtkWidget *create_file_selector(FileInfo *selected_fi) GtkWidget *option_menu_charset; GtkWidget *option_menu_lineend; const gchar *title; - + title = mode ? _("Open") : _("Save As"); - + selector = gtk_file_chooser_dialog_new(title, NULL, mode ? GTK_FILE_CHOOSER_ACTION_OPEN : GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, mode ? GTK_STOCK_OPEN : GTK_STOCK_SAVE, GTK_RESPONSE_OK, NULL); gtk_dialog_set_default_response(GTK_DIALOG(selector), GTK_RESPONSE_OK); - + // align = gtk_alignment_new(0.5, 0, 0, 0); align = gtk_alignment_new(1, 0, 0, 0); gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(selector), align); @@ -323,10 +321,10 @@ static GtkWidget *create_file_selector(FileInfo *selected_fi) gtk_table_attach_defaults(GTK_TABLE(table), option_menu_lineend, 2, 3, 0, 1); } gtk_widget_show_all(align); - + if (selected_fi->filename) gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(selector), selected_fi->filename); - + return selector; } @@ -336,7 +334,7 @@ FileInfo *get_fileinfo_from_selector(FileInfo *fi, gint requested_mode) GtkWidget *selector; gchar *basename, *str; gint res, len; - + /* init values */ mode = requested_mode; selected_fi = g_malloc(sizeof(FileInfo)); @@ -346,11 +344,11 @@ FileInfo *get_fileinfo_from_selector(FileInfo *fi, gint requested_mode) fi->charset ? g_strdup(fi->charset) : NULL; selected_fi->charset_flag = fi->charset_flag; selected_fi->lineend = fi->lineend; - + selector = create_file_selector(selected_fi); gtk_window_set_transient_for(GTK_WINDOW(selector), GTK_WINDOW(pub->mw->window)); - + do { res = gtk_dialog_run(GTK_DIALOG(selector)); if (res == GTK_RESPONSE_OK) { @@ -384,15 +382,15 @@ FileInfo *get_fileinfo_from_selector(FileInfo *fi, gint requested_mode) } gtk_widget_hide(selector); } while (GTK_WIDGET_VISIBLE(selector)); - + if (res != GTK_RESPONSE_OK) { if (selected_fi->charset) g_free(selected_fi->charset); selected_fi = NULL; g_free(selected_fi); } - + gtk_widget_destroy(selector); - + return selected_fi; } diff --git a/src/selector.h b/src/selector.h index cd7ac8f..6d995b6 100644 --- a/src/selector.h +++ b/src/selector.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/undo.c b/src/undo.c index 194d79b..3bbb417 100644 --- a/src/undo.c +++ b/src/undo.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -66,16 +66,16 @@ static GList *undo_clear_info_list(GList *info_list) static void undo_append_undo_info(GtkTextBuffer *buffer, gchar command, gint start, gint end, gchar *str) { UndoInfo *ui = g_malloc(sizeof(UndoInfo)); - + ui->command = command; ui->start = start; ui->end = end; // ui->seq = FALSE; ui->seq = seq_reserve; ui->str = str; - + seq_reserve = FALSE; - + undo_list = g_list_append(undo_list, ui); DV(g_print("undo_cb: %d %s (%d-%d)\n", command, str, start, end)); } @@ -86,11 +86,11 @@ static void undo_create_undo_info(GtkTextBuffer *buffer, gchar command, gint sta gboolean seq_flag = FALSE; gchar *str; gint keyval = get_current_keyval(); - + gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, start); gtk_text_buffer_get_iter_at_offset(buffer, &end_iter, end); str = gtk_text_buffer_get_text(buffer, &start_iter, &end_iter, FALSE); - + if (undo_gstr->len) { if ((end - start == 1) && (command == ui_tmp->command)) { switch (keyval) { @@ -139,10 +139,10 @@ static void undo_create_undo_info(GtkTextBuffer *buffer, gchar command, gint sta undo_append_undo_info(buffer, ui_tmp->command, ui_tmp->start, ui_tmp->end, g_strdup(undo_gstr->str)); undo_gstr = g_string_erase(undo_gstr, 0, -1); } - + if (!keyval && prev_keyval) undo_set_sequency(TRUE); - + if (end - start == 1 && ((keyval && keyval < 0xF000) || keyval == GDK_BackSpace || keyval == GDK_Delete || keyval == GDK_Tab)) { @@ -151,9 +151,9 @@ static void undo_create_undo_info(GtkTextBuffer *buffer, gchar command, gint sta ui_tmp->end = end; undo_gstr = g_string_erase(undo_gstr, 0, -1); g_string_append(undo_gstr, str); - } else + } else undo_append_undo_info(buffer, command, start, end, g_strdup(str)); - + redo_list = undo_clear_info_list(redo_list); prev_keyval = keyval; clear_current_keyval(); @@ -165,11 +165,11 @@ static void undo_create_undo_info(GtkTextBuffer *buffer, gchar command, gint sta static void cb_insert_text(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *str) { gint start, end; - + DV( g_print("insert-text\n")); end = gtk_text_iter_get_offset(iter); start = end - g_utf8_strlen(str, -1); - + undo_create_undo_info(buffer, INS, start, end); } @@ -177,11 +177,11 @@ static void cb_delete_range(GtkTextBuffer *buffer, GtkTextIter *start_iter, GtkT { gint start, end; gchar command; - + DV( g_print("delete-range\n")); start = gtk_text_iter_get_offset(start_iter); end = gtk_text_iter_get_offset(end_iter); - + if (get_current_keyval() == GDK_BackSpace) command = BS; else @@ -199,7 +199,7 @@ DV(g_print("undo_reset_modified_step: Reseted modified_step by %d\n", modified_s static void undo_check_modified_step(GtkTextBuffer *buffer) { gboolean flag; - + flag = (modified_step == g_list_length(undo_list)); //g_print("%d - %d = %d\n", modified_step, g_list_length(undo_list), flag); if (gtk_text_buffer_get_modified(buffer) == flag) @@ -224,7 +224,7 @@ static void undo_check_modified_step(GtkTextBuffer *buffer) */ static void cb_begin_user_action(GtkTextBuffer *buffer) { - g_signal_handlers_unblock_by_func(G_OBJECT(buffer), + g_signal_handlers_unblock_by_func(G_OBJECT(buffer), G_CALLBACK(cb_insert_text), NULL); g_signal_handlers_unblock_by_func(G_OBJECT(buffer), G_CALLBACK(cb_delete_range), NULL); @@ -234,7 +234,7 @@ DV(g_print(": keyval = 0x%X\n", get_current_keyval())); static void cb_end_user_action(GtkTextBuffer *buffer) { - g_signal_handlers_block_by_func(G_OBJECT(buffer), + g_signal_handlers_block_by_func(G_OBJECT(buffer), G_CALLBACK(cb_insert_text), NULL); g_signal_handlers_block_by_func(G_OBJECT(buffer), G_CALLBACK(cb_delete_range), NULL); @@ -248,7 +248,7 @@ void undo_clear_all(GtkTextBuffer *buffer) undo_reset_modified_step(buffer); gtk_widget_set_sensitive(undo_w, FALSE); gtk_widget_set_sensitive(redo_w, FALSE); - + ui_tmp->command = INS; undo_gstr = g_string_erase(undo_gstr, 0, -1); prev_keyval = 0; @@ -257,10 +257,10 @@ void undo_clear_all(GtkTextBuffer *buffer) void undo_init(GtkWidget *view, GtkWidget *undo_button, GtkWidget *redo_button) { GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); - + undo_w = undo_button; redo_w = redo_button; - + g_signal_connect_after(G_OBJECT(buffer), "insert-text", G_CALLBACK(cb_insert_text), NULL); g_signal_connect(G_OBJECT(buffer), "delete-range", @@ -270,10 +270,10 @@ void undo_init(GtkWidget *view, GtkWidget *undo_button, GtkWidget *redo_button) g_signal_connect(G_OBJECT(buffer), "end-user-action", G_CALLBACK(cb_end_user_action), NULL); cb_end_user_action(buffer); - + ui_tmp = g_malloc(sizeof(UndoInfo)); undo_gstr = g_string_new(""); - + undo_clear_all(buffer); } @@ -281,7 +281,7 @@ void undo_set_sequency(gboolean seq) { if (g_list_length(undo_list)) ((UndoInfo *)g_list_last(undo_list)->data)->seq = seq; -DV(g_print("\n", seq)); +DV(g_print("\n", seq)); } void undo_set_sequency_reserve(void) @@ -302,7 +302,7 @@ gboolean undo_undo_real(GtkTextBuffer *buffer) { GtkTextIter start_iter, end_iter; UndoInfo *ui; - + undo_flush_temporal_buffer(buffer); if (g_list_length(undo_list)) { // undo_block_signal(buffer); @@ -340,7 +340,7 @@ gboolean undo_redo_real(GtkTextBuffer *buffer) { GtkTextIter start_iter, end_iter; UndoInfo *ri; - + if (g_list_length(redo_list)) { // undo_block_signal(buffer); ri = g_list_last(redo_list)->data; diff --git a/src/undo.h b/src/undo.h index 831b88d..e2d4bd0 100644 --- a/src/undo.h +++ b/src/undo.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/utils.c b/src/utils.c index cd25800..d726f97 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include "l3afpad.h" #include #include #include @@ -37,7 +37,7 @@ gchar *gedit_utils_get_stdin (void) // GnomeVFSResult res; fd_set rfds; struct timeval tv; - + FD_ZERO (&rfds); FD_SET (0, &rfds); @@ -52,7 +52,7 @@ gchar *gedit_utils_get_stdin (void) g_return_val_if_fail (tmp_buf != NULL, FALSE); file_contents = g_string_new (NULL); - + while (feof (stdin) == 0) { buffer_length = fread (tmp_buf, 1, GEDIT_STDIN_BUFSIZE, stdin); @@ -61,8 +61,8 @@ gchar *gedit_utils_get_stdin (void) if (ferror (stdin) != 0) { -// res = gnome_vfs_result_from_errno (); - +// res = gnome_vfs_result_from_errno (); + g_free (tmp_buf); g_string_free (file_contents, TRUE); return NULL; @@ -82,21 +82,25 @@ GtkWidget *create_button_with_stock_image(const gchar *text, const gchar *stock_ GtkWidget *image; GtkWidget *label; GtkWidget *align; - + hbox = gtk_hbox_new(FALSE, 2); - + image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_BUTTON); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); - + label = gtk_label_new_with_mnemonic(text); +#if USE_GTK_GRID + gtk_grid_attach_next_to (GTK_BOX (hbox), label, image, GTK_POS_RIGHT, 1, 1); +#else gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 0); - +#endif + align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_container_add(GTK_CONTAINER(align), hbox); - + button = gtk_button_new(); gtk_container_add(GTK_CONTAINER(button), align); gtk_widget_show_all(button); - + return button; } diff --git a/src/utils.h b/src/utils.h index 864200a..0a1e211 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/view.c b/src/view.c index 4978145..c9ad13c 100644 --- a/src/view.c +++ b/src/view.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -37,7 +37,7 @@ void clear_current_keyval(void) gboolean scroll_to_cursor(GtkTextBuffer *buffer, gdouble within_margin) { GtkTextIter iter; - + // gtk_text_buffer_get_start_iter(buffer, &iter); gtk_text_buffer_get_iter_at_mark(buffer, &iter, gtk_text_buffer_get_insert(buffer)); @@ -56,7 +56,7 @@ gint check_text_modification(void) { gchar *basename, *str; gint res; - + if (gtk_text_buffer_get_modified(pub->mw->buffer)) { basename = get_file_basename(pub->fi->filename, FALSE); str = g_strdup_printf(_("Save changes to '%s'?"), basename); @@ -72,7 +72,7 @@ gint check_text_modification(void) } return -1; } - + return 0; } @@ -80,10 +80,10 @@ gint check_text_modification(void) static gint check_preedit(GtkWidget *view) { gint cursor_pos; - + gtk_im_context_get_preedit_string( GTK_TEXT_VIEW(view)->im_context, NULL, NULL, &cursor_pos); - + return cursor_pos; } #endif @@ -92,7 +92,7 @@ static gboolean check_selection_bound(GtkTextBuffer *buffer) { GtkTextIter start, end; gchar *str, *p; - + if (gtk_text_buffer_get_selection_bounds(buffer, &start, &end)) { str = gtk_text_iter_get_text(&start, &end); p = strchr(str, '\n'); @@ -100,7 +100,7 @@ static gboolean check_selection_bound(GtkTextBuffer *buffer) if (p) return TRUE; } - + return FALSE; } @@ -110,17 +110,17 @@ static gboolean cb_key_press_event(GtkWidget *view, GdkEventKey *event) GtkTextMark *mark; GtkTextIter iter; GdkRectangle prev_rect; - + #if 0 if (check_preedit(view)) return FALSE; #endif - + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); mark = gtk_text_buffer_get_insert(buffer); gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark); gtk_text_view_get_iter_location(GTK_TEXT_VIEW(view), &iter, &prev_rect); - + keyval = 0; //g_print("key-press-event: 0x%X\n", event->keyval); switch (event->keyval) { @@ -131,7 +131,7 @@ static gboolean cb_key_press_event(GtkWidget *view, GdkEventKey *event) gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark); gtk_text_view_get_iter_location(GTK_TEXT_VIEW(view), &iter, &iter_rect); if (iter_rect.y < prev_rect.y) { - gtk_text_view_get_line_at_y(GTK_TEXT_VIEW(view), &iter, + gtk_text_view_get_line_at_y(GTK_TEXT_VIEW(view), &iter, iter_rect.y - iter_rect.height, NULL); gtk_text_buffer_move_mark(buffer, mark, &iter); } @@ -195,7 +195,7 @@ static gboolean cb_key_press_event(GtkWidget *view, GdkEventKey *event) keyval = keyval + 0x10000; //g_print("=================================================\n"); } - + return FALSE; } @@ -203,9 +203,9 @@ static gboolean cb_button_press_event(GtkWidget *view, GdkEventButton *event) { GtkTextIter iter, start, end; gint x, y; - + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); - + if ((event->button) == 3 && (event->type == GDK_BUTTON_PRESS)) { gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(view), gtk_text_view_get_window_type(GTK_TEXT_VIEW(view), event->window), @@ -215,7 +215,7 @@ static gboolean cb_button_press_event(GtkWidget *view, GdkEventButton *event) if (!gtk_text_iter_in_range(&iter, &start, &end)) gtk_text_buffer_place_cursor(buffer, &iter); } - + return FALSE; } @@ -223,7 +223,7 @@ static void cb_modified_changed(GtkTextBuffer *buffer, GtkWidget *view) { gboolean modified_flag, exist_flag = FALSE; gchar *filename, *title; - + modified_flag = gtk_text_buffer_get_modified(buffer); filename = get_file_basename(pub->fi->filename, TRUE); if (modified_flag) @@ -286,14 +286,14 @@ static void cb_focus_event(GtkWidget *view, GdkEventFocus *event) /* static void cb_begin_user_action(GtkTextBuffer *buffer, GtkWidget *view) { - g_signal_handlers_unblock_by_func(G_OBJECT(buffer), + g_signal_handlers_unblock_by_func(G_OBJECT(buffer), G_CALLBACK(cb_modified_changed), view); // g_print("begin-user-action\n"); } static void cb_end_user_action(GtkTextBuffer *buffer, GtkWidget *view) { - g_signal_handlers_block_by_func(G_OBJECT(buffer), + g_signal_handlers_block_by_func(G_OBJECT(buffer), G_CALLBACK(cb_modified_changed), view); gtk_text_view_scroll_mark_onscreen( // TODO: require? GTK_TEXT_VIEW(view), @@ -325,13 +325,13 @@ GtkWidget *create_text_view(void) { GtkWidget *view; GtkTextBuffer *buffer; - + view = gtk_text_view_new(); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); - + // gtk_text_view_set_left_margin(GTK_TEXT_VIEW(view), 1); // gtk_text_view_set_right_margin(GTK_TEXT_VIEW(view), 1); - + g_signal_connect(G_OBJECT(view), "key-press-event", G_CALLBACK(cb_key_press_event), NULL); g_signal_connect(G_OBJECT(view), "button-press-event", @@ -350,7 +350,7 @@ GtkWidget *create_text_view(void) G_CALLBACK(cb_focus_event), NULL); g_signal_connect_after(G_OBJECT(view), "focus-out-event", G_CALLBACK(cb_focus_event), NULL); - + g_signal_connect(G_OBJECT(buffer), "mark-set", G_CALLBACK(cb_mark_changed), NULL); g_signal_connect(G_OBJECT(buffer), "mark-deleted", @@ -364,8 +364,8 @@ GtkWidget *create_text_view(void) g_signal_connect_after(G_OBJECT(buffer), "end-user-action", G_CALLBACK(cb_end_user_action), view); cb_end_user_action(buffer, view); -*/ +*/ linenum_init(view); - + return view; } diff --git a/src/view.h b/src/view.h index 57fd9e3..6dca220 100644 --- a/src/view.h +++ b/src/view.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/window.c b/src/window.c index d64bce7..3a3154e 100644 --- a/src/window.c +++ b/src/window.c @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -33,55 +33,59 @@ MainWin *create_main_window(void) GtkWidget *view; // gint size; // GtkAdjustment *hadj, *vadj; - + MainWin *mw = g_malloc(sizeof(MainWin)); - + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // gtk_window_set_title(GTK_WINDOW(window), PACKAGE_NAME); gtk_widget_set_name(window, PACKAGE_NAME); - + + gtk_window_set_icon_from_file(GTK_WINDOW(window), ICONDIR"/l3afpad.png", NULL); gtk_window_set_default_icon_name(PACKAGE); - + g_signal_connect(G_OBJECT(window), "delete-event", G_CALLBACK(on_file_quit), NULL); g_signal_connect_after(G_OBJECT(window), "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); - + vbox = gtk_vbox_new(FALSE, 0); + gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL); gtk_container_add(GTK_CONTAINER(window), vbox); - + menubar = create_menu_bar(window); gtk_box_pack_start(GTK_BOX(vbox), gtk_item_factory_get_widget(GTK_UI_MANAGER(menubar), "/M"), FALSE, FALSE, 0); - + sw = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_set_hexpand (sw, TRUE); + gtk_widget_set_vexpand (sw, TRUE); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); - + view = create_text_view(); gtk_container_add(GTK_CONTAINER(sw), view); -/* +/* hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(sw)); vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw)); g_signal_connect_after(G_OBJECT(hadj), "value-changed", G_CALLBACK(cb_scroll_event), view); g_signal_connect_after(G_OBJECT(vadj), "value-changed", G_CALLBACK(cb_scroll_event), view); -*/ +*/ mw->window = window; mw->menubar = menubar; mw->view = view; mw->buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); - + return mw; } void set_main_window_title(void) { gchar *title; - + title = get_file_basename(pub->fi->filename, TRUE); gtk_window_set_title(GTK_WINDOW(pub->mw->window), title); g_free(title); diff --git a/src/window.h b/src/window.h index 39224c2..31c3705 100644 --- a/src/window.h +++ b/src/window.h @@ -1,7 +1,7 @@ /* * L3afpad - GTK+ based simple text editor * Copyright (C) 2004-2005 Tarot Osuji - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or