├── .bzrignore ├── .gitignore ├── ABOUT-NLS ├── AUTHORS ├── COPYING ├── ChangeLog ├── ChangeLog.2004-2006 ├── HACKING ├── INSTALL ├── Makefile.am ├── NEWS ├── README.in ├── README.md ├── REQUIREMENTS ├── autogen.sh ├── config.rpath ├── configure.ac ├── data ├── Makefile.am └── alltray.desktop.in ├── devel-autogen.sh ├── doc └── crash-help.txt ├── gettext.h ├── images ├── Makefile.am ├── alltray.png ├── alltray.xcf.bz2 ├── alltray_128.png ├── alltray_16.png ├── alltray_32.png ├── alltray_64.png ├── alltray_ctt.xpm ├── alltray_huge.png ├── alltray_icon.png ├── alltray_logo.png ├── alltray_lp.png ├── alltray_old.png └── bg.png ├── intl ├── ChangeLog ├── Makefile.in ├── VERSION ├── bindtextdom.c ├── config.charset ├── dcgettext.c ├── dcigettext.c ├── dcngettext.c ├── dgettext.c ├── dngettext.c ├── eval-plural.h ├── explodename.c ├── export.h ├── finddomain.c ├── gettext.c ├── gettextP.h ├── gmo.h ├── hash-string.c ├── hash-string.h ├── intl-compat.c ├── intl-exports.c ├── l10nflist.c ├── langprefs.c ├── libgnuintl.h.in ├── libintl.rc ├── loadinfo.h ├── loadmsgcat.c ├── localcharset.c ├── localcharset.h ├── locale.alias ├── localealias.c ├── localename.c ├── lock.c ├── lock.h ├── log.c ├── ngettext.c ├── os2compat.c ├── os2compat.h ├── osdep.c ├── plural-exp.c ├── plural-exp.h ├── plural.c ├── plural.y ├── printf-args.c ├── printf-args.h ├── printf-parse.c ├── printf-parse.h ├── printf.c ├── ref-add.sin ├── ref-del.sin ├── relocatable.c ├── relocatable.h ├── textdomain.c ├── tsearch.c ├── tsearch.h ├── vasnprintf.c ├── vasnprintf.h ├── vasnwprintf.h ├── version.c ├── wprintf-parse.h └── xsize.h ├── m4 ├── codeset.m4 ├── gettext.m4 ├── glibc2.m4 ├── glibc21.m4 ├── iconv.m4 ├── intdiv0.m4 ├── intl.m4 ├── intldir.m4 ├── intlmacosx.m4 ├── intmax.m4 ├── inttypes-pri.m4 ├── inttypes_h.m4 ├── lcmessage.m4 ├── lib-ld.m4 ├── lib-link.m4 ├── lib-prefix.m4 ├── lock.m4 ├── longlong.m4 ├── nls.m4 ├── po.m4 ├── printf-posix.m4 ├── progtest.m4 ├── size_max.m4 ├── stdint_h.m4 ├── uintmax_t.m4 ├── visibility.m4 ├── wchar_t.m4 ├── wint_t.m4 └── xsize.m4 ├── man ├── Makefile.am └── alltray.1.in ├── po ├── LINGUAS ├── Makefile.in.in ├── Makevars ├── Makevars.template ├── POTFILES ├── POTFILES.in ├── Rules-quot ├── alltray.pot ├── ar.po ├── bg.po ├── boldquot.sed ├── cs.po ├── da.po ├── de.po ├── en@boldquot.header ├── en@quot.header ├── en_GB.po ├── en_US.po ├── es.po ├── fi.po ├── fr.po ├── gl.po ├── he.po ├── hi.po ├── insert-header.sin ├── it.po ├── nl.po ├── pl.po ├── pt.po ├── pt_BR.po ├── quot.sed ├── remove-potcdate.sin ├── ru.po ├── sv.po ├── tr.po ├── uk.po └── zh_CN.po ├── src ├── About.vala ├── AllTray.vala ├── Application.vala ├── AttachHelper.vala ├── Ctt.vala ├── GtkStatusIcon.vala ├── Hotkey.vala ├── Makefile.am ├── Process.vala ├── PromptDialog.vala ├── alltray-ctt-helper.c ├── alltray-ctt-helper.h ├── alltray-ctt-interpreter.c ├── alltray-ctt-interpreter.h ├── alltray-ctt-windowlist.c ├── alltray-ctt-windowlist.h ├── gtop_glue.c ├── gtop_glue.h ├── x11_glue.c └── x11_glue.h ├── tests ├── 1.png ├── 2.png ├── GtkDemandsAttention.vala ├── GtkIconChange.vala └── Makefile.am ├── utils ├── build-full-debug.sh ├── build-release.sh ├── clean-tree.sh ├── latest-rev.py └── release-changelog.sh └── vapi ├── Makefile.am ├── alltray.vapi ├── gtop_glue.vapi └── x11_glue.vapi /.bzrignore: -------------------------------------------------------------------------------- 1 | missing 2 | ltmain.sh 3 | install-sh 4 | depcomp 5 | configure 6 | config.h.in 7 | aclocal.m4 8 | doc/src-docs 9 | alltray 10 | src/AllTray.[ch] 11 | src/Application.[ch] 12 | src/Debug.[ch] 13 | src/Process.[ch] 14 | src/TrayIcon.[ch] 15 | src/AttachHelper.[ch] 16 | src/PromptDialog.[ch] 17 | *.stamp 18 | Makefile 19 | Makefile.in 20 | README 21 | config.h 22 | config.log 23 | config.status 24 | stamp-h1 25 | man/alltray.1 26 | man/*.ps 27 | .deps 28 | data/alltray.desktop 29 | autom4te.cache 30 | tests/*.c 31 | tests/GtkDemandsAttention 32 | tests/GtkIconChange 33 | *.gcov 34 | *.gcda 35 | *.gcno 36 | *.gmo 37 | stamp-po 38 | AllTrayCttHelper.c 39 | alltray-ctt-helper 40 | compile 41 | Ctt.c 42 | src/GtkStatusIcon.c 43 | src/About.c 44 | src/Hotkey.c 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | missing 2 | ltmain.sh 3 | install-sh 4 | depcomp 5 | configure 6 | config.h.in 7 | aclocal.m4 8 | doc/src-docs 9 | alltray 10 | src/AllTray.[ch] 11 | src/Application.[ch] 12 | src/Debug.[ch] 13 | src/Process.[ch] 14 | src/TrayIcon.[ch] 15 | src/AttachHelper.[ch] 16 | src/PromptDialog.[ch] 17 | *.stamp 18 | Makefile 19 | Makefile.in 20 | README 21 | config.h 22 | config.log 23 | config.status 24 | stamp-h1 25 | man/alltray.1 26 | man/*.ps 27 | .deps 28 | data/alltray.desktop 29 | autom4te.cache 30 | tests/*.c 31 | tests/GtkDemandsAttention 32 | tests/GtkIconChange 33 | *.gcov 34 | *.gcda 35 | *.gcno 36 | *.gmo 37 | stamp-po 38 | AllTrayCttHelper.c 39 | alltray-ctt-helper 40 | compile 41 | Ctt.c 42 | src/GtkStatusIcon.c 43 | src/About.c 44 | src/Hotkey.c 45 | *.o 46 | src/.deps 47 | 48 | config.guess 49 | config.sub 50 | 51 | .DS_Store 52 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | This file contains a list of files and the copyright(s) which are held on 2 | those files, and the license under which those contribution(s) were made. 3 | Unless otherwise specified, the copyright license is the GNU GPL v3. 4 | 5 | Last-Updated: 2011-Jun-14 6 | 7 | AllTray: 8 | Author: Michael B. Trausch 9 | Maintainer: Michael B. Trausch 10 | License: GNU GPL v3 11 | 12 | CREDITS 13 | ======= 14 | 15 | AllTray was originally written by Jochen Baier and was released under 16 | the GPL v2 (or later) license. The original AllTray icon was created by 17 | Eugene Alex , and the original AllTray man page was 18 | created by Carlos C. Soto . 19 | 20 | None of the original components exists as it used to; in particular, a 21 | new icon was created and the man page was completely rewritten. The 22 | AllTray source code is (currently) being re-written as well to bring it 23 | up-to-date and make it consistent with itself. 24 | -------------------------------------------------------------------------------- /HACKING: -------------------------------------------------------------------------------- 1 | How to Help! 2 | ============ 3 | 4 | So, you'd like to help work on AllTray? There is a feature that you 5 | really would like, or a bug that is in your way, and you'd like to 6 | go ahead and take a shot at fixing it? No problem! Contributions 7 | are welcome, so long as you're willing to license them under the 8 | terms of the GNU GPL 3.0 as published by the Free Software 9 | Foundation. 10 | 11 | AllTray[1] uses the git[2] revision control system, and the 12 | “blessed” repository is hosted on github[3]. 13 | 14 | Also, AllTray uses Vala[4] for (most) of its code. There is some 15 | small parts that are written in C and not generated by the Vala 16 | compiler. If you intend on doing any development, you’ll need the 17 | Vala compiler. Currently, AllTray uses the Vala 0.10.x series; 18 | series both older and newer than Vala 0.10.x are untested and 19 | unsupported at this time. If you are on an Ubuntu 11.04 system, 20 | Vala 0.10.x is available from the default package manager sources, 21 | simply install the valac-0.10 package. 22 | 23 | Contributing to AllTray 24 | ----------------------- 25 | 26 | If you are interested in working on AllTray, use GitHub to "fork" 27 | the source code. Then you can "git clone" your forked version, and 28 | when you're finished with your contribution, you can submit a pull 29 | request on GitHub. 30 | 31 | If you need help with this process, you can email me 32 | , or join the #git or #github channels on the 33 | FreeNode IRC network. You can also join #alltray, but I am not 34 | always there (I do try to be there regularly, however). 35 | 36 | Bugs are (at the moment) still on Launchpad; that will likely change 37 | as the transition to GitHub becomes more complete. 38 | 39 | Code Formatting 40 | --------------- 41 | 42 | Code formatting is pretty easy---follow the implicit guidelines that 43 | you get from reading the existing code, so that I do not need to 44 | modify it in order to pull/merge it. If in doubt, though, go ahead 45 | and do whatever feels right---if there is a problem, it'll be 46 | addressed when the pull request is reviewed. 47 | 48 | Translations 49 | ------------ 50 | 51 | AllTray currently is written in American English. Some parts of the 52 | program may not (yet) be flexible enough for translation or 53 | localization in any way at all; if this is the case, it is 54 | considered to be a bug. I am hoping by the time 0.8.0 is released 55 | that AllTray will at least be fully translatable, so that people can 56 | use Launchpad’s Translations to submit translations for the code. 57 | 58 | I may also require help to manage the translations, and some 59 | pointers to education on working with the requisite tools to make it 60 | happen. If you think you want that job, let me know. 61 | 62 | Currently, I am looking for something other than Launchpad 63 | Translations/Rosetta to do the translations. But I don't want to 64 | lose any translators in the process---everyone has been very 65 | helpful! Please send me ideas. 66 | 67 | Contact Info 68 | ------------ 69 | 70 | There is an IRC channel: #alltray on FreeNode. I can be found there 71 | whenever I am online, and many times when I am not. Currently, 72 | there is no traffic in that channel. People are welcome to change 73 | this. :) I try to be in the IRC channel as much as possible, but I 74 | do sometimes forget. 75 | 76 | You can contact me via XMPP/Google Talk at , as 77 | well. Or by email, at the same address. 78 | 79 | Other Information 80 | ----------------- 81 | 82 | As we get closer to a release of 0.8.0, there will be more 83 | information around. If there is anything missing, please ask! 84 | 85 | Links 86 | ===== 87 | 88 | [1] http://launchpad.net/alltray 89 | [2] http://git-scm.com/ 90 | [3] https://github.com/mbt/alltray 91 | [4] http://live.gnome.org/Vala 92 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = config.rpath ChangeLog.2004-2006 REQUIREMENTS HACKING 2 | 3 | SUBDIRS = intl po images man src vapi data 4 | 5 | ACLOCAL_AMFLAGS = -I m4 6 | -------------------------------------------------------------------------------- /README.in: -------------------------------------------------------------------------------- 1 | AllTray @PACKAGE_VERSION@ README 2 | Copyright (c) 2009 Michael B. Trausch 3 | 4 | For installation instructions, please read REQUIREMENTS for system 5 | and dependency requirements, then read INSTALL. 6 | 7 | If you're looking to start playing with the source code, please read 8 | HACKING. 9 | 10 | For information on this release, known issues, quirks, etc., please 11 | read the NEWS file. 12 | 13 | For information on operating system support, please look below 14 | (after the “Quick Introduction” section). 15 | 16 | Please send bug reports to: 17 | @PACKAGE_BUGREPORT@ 18 | 19 | Quick Introduction 20 | ================== 21 | 22 | AllTray is used for docking application software---such as Evolution, 23 | your Web browser or terminal emulation software---into your system tray/ 24 | notification area. This makes it possible to keep your desktop 25 | uncluttered when the software you are using needs to continue running, 26 | but you don't want to continue to see the window(s) in your taskbar or 27 | window list. 28 | 29 | Do note that at this time, there are issues with KDE 4.x and AllTray 30 | interacting with each other; windows do not properly become totally 31 | hidden in this environment, and that means that things act a bit 32 | strange currently. Using AllTray with KDE 4.x is not (yet) recommended. 33 | KDE is aware of the issue and working to find a solution to the problem. 34 | 35 | Operating System Support 36 | ======================== 37 | 38 | Currently, AllTray is only officially supported on GNU/Linux 39 | systems. There is some support (possibly, maybe) for FreeBSD, but I 40 | can't seem to test it because the X server under FreeBSD keeps dying 41 | on me. I'd like to also support: 42 | 43 | * NetBSD, 44 | * OpenBSD, and 45 | * OpenSolaris 46 | 47 | At the very least. I don't have access to any proprietary UNIX 48 | systems with X on them to see if it works (or if I can make it work) 49 | on them, so volunteers would be greatly appreciated for any other 50 | systems. 51 | 52 | If you have have the time, and you have a system that AllTray can be 53 | made to run on (e.g., a POSIX or UNIX-like or UNIX system with the X 54 | Window System and a compliant window manager and system tray 55 | implementation, such as GNOME), you can help by looking at the 56 | unix_process code and creating an implementation for your platform 57 | and adding some code to configure.ac to support detection of that 58 | platform, so the proper code is compiled in at build-time for that 59 | system when configured on that system. 60 | 61 | Before you start work, please file a bug on Launchpad for that 62 | system and assign it to yourself, so that it's known that you're 63 | working on that functionality. When you've completed it, please 64 | upload a branch back up to bzr and propose that it be merged in with 65 | AllTray's trunk branch. 66 | 67 | At that point, it will be reviewed and (likely) merged. 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AllTray 2 | ======= 3 | 4 | This is AllTray. AllTray is an application which docks other 5 | application software into the system tray (“notification area”) of a 6 | desktop environment such as GNOME, KDE, or XFCE. It aims to be 7 | independent of both desktop environment and window manager. Old 8 | releases are available, and currently the project is focusing on 9 | updating the source code to become more fully compliant with existing 10 | desktop standards, as well as being refactored. 11 | 12 | Requirements 13 | ------------ 14 | 15 | See the REQUIREMENTS file in the tree to see what build and run-time 16 | requirements are. However, as long as you have all of the 17 | requirements met, AllTray will build with the standard `configure && 18 | make && make install` process. 19 | 20 | Feedback 21 | -------- 22 | 23 | AllTray is currently in the process of moving to GitHub. Much of its 24 | infrastructure has been hosted at Launchpad for the past few years, 25 | which was a significant improvement from where it was at Sourceforge. 26 | Of course, Launchpad is built around the Bazaar DVCS, not git, so it 27 | is not likely that it will continue to be the home for AllTray (aside 28 | perhaps from translations, but that would require that there be some 29 | sort of really good bidirectional interface for git↔bzr interaction; 30 | git-bzr is not that). 31 | 32 | History and Future 33 | ------------------ 34 | 35 | AllTray has had a very long history. It was originally written by 36 | Jochen Baier, who (as best as I can tell) has left the world of UNIX 37 | and UNIX-like software and gone to the world of Windows. In late 2008 38 | I took over AllTray and began to rewrite it to update it to better 39 | align with modern standards found in the X11 environment. 40 | 41 | The new development branch of AllTray, the 0.7.Xdev series, has taken 42 | a very long time to work on. However, it is nearing completion: 43 | several key features have been reimplmented, and old features that no 44 | longer make sense have been removed. No longer does AllTray rely on 45 | window-manager specific tricks to function, which should improve the 46 | experience for everyone. That is not to say that new AllTray is 47 | bug-free: it almost certainly is not. 48 | 49 | Version 0.7.5dev was released on July 14, 2011. Work on 0.7.6dev is 50 | nearing completion already as of July 20, 2011. 0.7.6dev will be 51 | released within the next couple of weeks, and it is likely to be the 52 | last development release before the next stable—the first stable 53 | release of AllTray since I took it over in 2008. Exciting! 54 | 55 | Contributions 56 | ------------- 57 | 58 | Of course, I welcome any contributions. Please send pull requests if 59 | you have contributions! :-) -------------------------------------------------------------------------------- /REQUIREMENTS: -------------------------------------------------------------------------------- 1 | Requirements and Depenedencies 2 | ============================== 3 | 4 | For Release Builds 5 | ------------------ 6 | 7 | Release builds are tarball releases, which contain a ./configure script. 8 | 9 | * Required libraries: 10 | - gtk 2.12 or better, glib and gobject and headers 11 | - libwnck and headers 12 | - libgtop and headers 13 | - libXext and headers 14 | - libXpm and headers 15 | - libXcursor and headers 16 | 17 | For Development 18 | --------------- 19 | 20 | For development, you need all of the above things, plus the following: 21 | 22 | * GNU Bazaar 2.0 or later. 23 | 24 | * The GNU build system utilities (autoconf and automake). GNU 25 | autoconf must be at least 2.62 and GNU automake must be at least 26 | 1.11. 27 | 28 | * GNU gettext, if you intend on making any modifications to the 29 | language files. 30 | 31 | * The Vala compiler, 0.10.x series. Newer releases won't work 32 | unless you're updating AllTray's source code to build with newer 33 | versions of Vala. NOTE: For a release build, you only need Vala 34 | if you modify a *.vala file, but for builds from the DVCS system, 35 | the Vala files are _not_ precompiled. 36 | 37 | Runtime requirements 38 | -------------------- 39 | 40 | * An EWMH and ICCCM compliant desktop environment and software. If 41 | AllTray is deficient in implementing these standards in any way, 42 | that is a bug in AllTray. If AllTray is used with software that 43 | is non-compliant, the results are undefined. 44 | 45 | * Target applications _absolutely_ must have _NET_WM_PID set on 46 | their windows or there is absolutely no hope that AllTray will 47 | work with them. 48 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Generate the build system for AllTray. 4 | # 5 | 6 | if [ "$1" = "--no-configure" ]; then 7 | autoreconf --force --install 8 | else 9 | printf "I will run ./configure after generating it and pass it all options\n" 10 | printf "you pass to me. Send me a SIGINT and re-run me if you want to pass\n" 11 | printf "any configure options.\n\n" 12 | 13 | autoreconf --force --install 14 | ./configure "$@" 15 | fi 16 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # 2 | # This file needs to be processed with autoconf to produce ./configure. 3 | # 4 | # The preferred way to do this is to use the project-local autogen.sh 5 | # script. 6 | # 7 | 8 | # Initialize autoconf 9 | AC_INIT([AllTray], [0.7.5dev+], [https://launchpad.net/alltray/+filebug]) 10 | 11 | # Initialize automake 12 | AM_INIT_AUTOMAKE(foreign check-news -Wall) 13 | 14 | # Minimum required version of autoconf 15 | AC_PREREQ(2.60) 16 | 17 | AC_CONFIG_HEADERS([config.h]) 18 | AC_CONFIG_SRCDIR([src/AllTray.vala]) 19 | 20 | # Check for programs necessary to build and install AllTray. 21 | AC_PROG_CC 22 | AM_PROG_CC_C_O 23 | AC_GNU_SOURCE 24 | AM_GNU_GETTEXT 25 | AC_PROG_SED 26 | AM_PROG_VALAC([0.14.0]) 27 | AC_PROG_INSTALL 28 | 29 | # pkg-config checks need to be inserted here. 30 | PKG_CHECK_MODULES(X11, x11,, AC_MSG_ERROR([X11 is required])) 31 | PKG_CHECK_MODULES(XCURSOR, xcursor,, AC_MSG_ERROR([Xcursor is required])) 32 | PKG_CHECK_MODULES(GLIB, glib-2.0,,AC_MSG_ERROR([glib-2.0 is required])) 33 | PKG_CHECK_MODULES(GOBJECT, gobject-2.0,,AC_MSG_ERROR([gobject-2.0 is required])) 34 | PKG_CHECK_MODULES(GIO, gio-2.0,,AC_MSG_ERROR([gio-2.0 is required])) 35 | PKG_CHECK_MODULES(GTOP, libgtop-2.0,,AC_MSG_ERROR([libgtop-2.0 is required])) 36 | PKG_CHECK_MODULES(WNCK, libwnck-1.0,,AC_MSG_ERROR([libwnck-1.0 is required])) 37 | PKG_CHECK_MODULES(GTK, gtk+-2.0,,AC_MSG_ERROR([gtk+-2.0 is required])) 38 | 39 | # XXX: Only required for Close-To-Tray. Should be optional. 40 | PKG_CHECK_MODULES(XPM, xpm,, AC_MSG_ERROR([xpm is required])) 41 | PKG_CHECK_MODULES(XEXT, xext,, AC_MSG_ERROR([xext is required])) 42 | 43 | AC_SUBST(X11_CFLAGS) 44 | AC_SUBST(X11_LIBS) 45 | AC_SUBST(XCURSOR_CFLAGS) 46 | AC_SUBST(XCURSOR_LIBS) 47 | AC_SUBST(XPM_CFLAGS) 48 | AC_SUBST(XPM_LIBS) 49 | AC_SUBST(GLIB_CFLAGS) 50 | AC_SUBST(GLIB_LIBS) 51 | AC_SUBST(GOBJECT_CFLAGS) 52 | AC_SUBST(GOBJECT_LIBS) 53 | AC_SUBST(GIO_CFLAGS) 54 | AC_SUBST(GIO_LIBS) 55 | AC_SUBST(GTOP_CFLAGS) 56 | AC_SUBST(GTOP_LIBS) 57 | AC_SUBST(WNCK_CFLAGS) 58 | AC_SUBST(WNCK_LIBS) 59 | AC_SUBST(GTK_CFLAGS) 60 | AC_SUBST(GTK_LIBS) 61 | 62 | # XXX: Only required for Close-To-Tray. Should be optional. 63 | AC_SUBST(XEXT_CFLAGS) 64 | AC_SUBST(XEXT_LIBS) 65 | 66 | AC_SUBST(pkglib) 67 | AC_SUBST(VALAC) 68 | 69 | GETTEXT_PACKAGE=${PACKAGE} 70 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "${GETTEXT_PACKAGE}", [GETTEXT_PACKAGE]) 71 | 72 | AC_DEFINE_UNQUOTED(ALLTRAY_COMPILE_FLAGS, "${CFLAGS}", [CFLAGS]) 73 | AC_DEFINE_UNQUOTED(ALLTRAY_C_COMPILER, "$(${CC} --version|head -1)", [Compiler]) 74 | 75 | if test -f $VALAC -a -x $VALAC; then 76 | AC_DEFINE_UNQUOTED(ALLTRAY_VALA_COMPILER, "$($VALAC --version)", [Vala ver]) 77 | else 78 | AC_DEFINE_UNQUOTED(ALLTRAY_VALA_COMPILER, "Not installed", [Vala ver]) 79 | fi 80 | 81 | AC_DEFINE_UNQUOTED(ALLTRAY_COMPILE_OS, "$(uname -s)", 82 | [Build OS Kernel and Name]) 83 | AC_DEFINE_UNQUOTED(ALLTRAY_COMPILE_OS_REL, "$(uname -r)", [Build OS Release]) 84 | AC_DEFINE_UNQUOTED(ALLTRAY_COMPILE_OS_VER, "$(uname -v)", 85 | [Build OS Version]) 86 | AC_DEFINE_UNQUOTED(ALLTRAY_COMPILE_OS_HOST, "$(hostname -f)", 87 | [Build OS hostname]) 88 | AC_DEFINE_UNQUOTED(ALLTRAY_COMPILE_BUILD_DATE, "$(TZ=UTC date)", 89 | [Build Date (UTC)]) 90 | AC_DEFINE_UNQUOTED(ALLTRAY_COMPILE_BUILD_DATE_EUS, 91 | "$(TZ=EST5EDT date)", [Build Date (Author's Timezone)]) 92 | AC_DEFINE_UNQUOTED(ALLTRAY_CONFIGURE_FLAGS, "$ac_configure_args", [Conf flags]) 93 | AC_DEFINE_UNQUOTED(ALLTRAY_COPYRIGHT_YEARS, 94 | ["2009, 2010, 2011"], [Copyright years]) 95 | 96 | if test -d .bzr; then 97 | BZR_BRANCH_NAME="$(bzr version-info|grep ^branch-nick|cut -f2 -d' ')" 98 | BZR_REV_ID="$(bzr version-info|grep ^revision-id|cut -f2 -d' ')" 99 | BZR_REVISION="$(bzr version-info|grep ^revno|cut -f2 -d' ')" 100 | 101 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_BUILD, "TRUE", [Set if built from bzr tree]) 102 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_BRANCH, 103 | "$BZR_BRANCH_NAME", [Branch this was built from]) 104 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_REVID, 105 | "$BZR_REV_ID", [Revision ID we are built from]) 106 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_REVISION, 107 | "$BZR_REVISION", [Revision number we are built from]) 108 | else 109 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_BUILD, "FALSE", [TRUE if built from branch]) 110 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_BRANCH, 111 | "$BZR_BRANCH_NAME", [Branch this was built from]) 112 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_REVID, 113 | "$BZR_REV_ID", [Revision ID we are built from]) 114 | AC_DEFINE_UNQUOTED(ALLTRAY_BZR_REVISION, 115 | "BZR_REVISION", [Revision number we are built from]) 116 | fi 117 | 118 | AC_DEFINE_UNQUOTED(ALLTRAY_LICENSE, "$(cat COPYING|tr '\n' '|'|sed 's,|,\\n,g;s,",\\",g')", [The GNU GPL License Text]) 119 | 120 | # Configuration wrap-up. 121 | AC_CONFIG_FILES([README 122 | Makefile 123 | images/Makefile 124 | data/alltray.desktop 125 | data/Makefile 126 | intl/Makefile 127 | man/Makefile 128 | po/Makefile.in 129 | src/Makefile 130 | vapi/Makefile 131 | man/alltray.1]) 132 | AC_OUTPUT 133 | 134 | # Configuration results report 135 | printf "\nConfiguration results (%s %s)\n\n" "$PACKAGE_NAME" "$PACKAGE_VERSION" 136 | 137 | printf "C Compiler:\t%s\n" "$CC" 138 | 139 | if [[ -f $VALAC -a -x $VALAC ]]; then 140 | printf "Vala Compiler:\t%s\n" "$(${VALAC} --version)" 141 | else 142 | printf "Vala Compiler:\tNot installed.\n" 143 | fi 144 | 145 | printf "%s version:\t%s\n" "$CC" "$(${CC} --version|head -1)" 146 | printf "C Flags:\t%s\n" "$CFLAGS" 147 | printf "Install path:\t%s\n" "$prefix" 148 | printf "bzr info:\t%s %s\n" "$BZR_BRANCH_NAME" "$BZR_REV_ID" 149 | printf "\n" 150 | 151 | -------------------------------------------------------------------------------- /data/Makefile.am: -------------------------------------------------------------------------------- 1 | # Automake file 2 | applicationsdir = $(datadir)/applications 3 | dist_applications_DATA = alltray.desktop 4 | EXTRA_DIST = alltray.desktop.in 5 | -------------------------------------------------------------------------------- /data/alltray.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=AllTray @PACKAGE_VERSION@ 4 | GenericName=AllTray @PACKAGE_VERSION@ 5 | Comment=Dock everything to the system tray/notification area. 6 | Exec=alltray -a 7 | Icon=alltray.png 8 | Terminal=false 9 | Type=Application 10 | Categories=Application;Utility; 11 | StartupNotify=false 12 | -------------------------------------------------------------------------------- /devel-autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ./autogen.sh CFLAGS="-ggdb -O0 -Wall" 3 | -------------------------------------------------------------------------------- /doc/crash-help.txt: -------------------------------------------------------------------------------- 1 | 2 | If AllTray crashes and your windows are hidden, you _can_ recover. 3 | Follow these instructions: 4 | 5 | * Get the XID(s) of the windows that are gone from view: 6 | 7 | $ wnckprop --list 8 | 9 | * For each of the windows that are hidden, run: 10 | 11 | $ wnckprop --unminimize --unskip-tasklist --window={WINDOW_ID} 12 | 13 | Replace {WINDOW_ID} with the number from --list. 14 | 15 | That will get your window back, so that you can use it without having 16 | to kill the process entirely. :) 17 | 18 | You _shouldn't_ have to do this with a stable release. It may be 19 | expected of development releases, though, so it's nice to know this. 20 | Either way, AllTray has a zero-crash policy: If you get a crash, check 21 | to see that the bug is reported. If you aren't sure, report it again. 22 | Thanks! 23 | -------------------------------------------------------------------------------- /images/Makefile.am: -------------------------------------------------------------------------------- 1 | # Automake file 2 | pixmapdir = $(datadir)/pixmaps 3 | 4 | dist_pixmap_DATA = alltray.png \ 5 | alltray_32.png \ 6 | alltray_64.png \ 7 | alltray_128.png \ 8 | alltray_icon.png \ 9 | alltray_ctt.xpm 10 | EXTRA_DIST = $(dist_pixmap_DATA) 11 | -------------------------------------------------------------------------------- /images/alltray.png: -------------------------------------------------------------------------------- 1 | alltray_32.png -------------------------------------------------------------------------------- /images/alltray.xcf.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray.xcf.bz2 -------------------------------------------------------------------------------- /images/alltray_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_128.png -------------------------------------------------------------------------------- /images/alltray_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_16.png -------------------------------------------------------------------------------- /images/alltray_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_32.png -------------------------------------------------------------------------------- /images/alltray_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_64.png -------------------------------------------------------------------------------- /images/alltray_ctt.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * atcttxpm[] = { 3 | "16 16 108 2", 4 | " c None", 5 | ". c #512FB2", 6 | "+ c #5636B3", 7 | "@ c #624AB3", 8 | "# c #6C5EB1", 9 | "$ c #7871B1", 10 | "% c #512FB3", 11 | "& c #7668A3", 12 | "* c #634CB4", 13 | "= c #6E5FB1", 14 | "- c #7973B2", 15 | "; c #8586B0", 16 | "> c #909AB0", 17 | ", c #512EB3", 18 | "' c #5231B3", 19 | ") c #89859A", 20 | "! c #516436", 21 | "~ c #635B84", 22 | "{ c #6E60B3", 23 | "] c #7B75B2", 24 | "^ c #8788B1", 25 | "/ c #919BB0", 26 | "( c #95A2AF", 27 | "_ c #6243B8", 28 | ": c #79846A", 29 | "< c #4C5B44", 30 | "[ c #675E8C", 31 | "} c #7063B3", 32 | "| c #7B76B1", 33 | "1 c #8284AD", 34 | "2 c #DADBDA", 35 | "3 c #D4D6D7", 36 | "4 c #96A3B0", 37 | "5 c #4F2DB2", 38 | "6 c #5B3FAB", 39 | "7 c #625395", 40 | "8 c #7269B1", 41 | "9 c #6771A3", 42 | "0 c #7178A5", 43 | "a c #8084A8", 44 | "b c #E5E5E3", 45 | "c c #E0E1DF", 46 | "d c #9AA4AF", 47 | "e c #5B3EB3", 48 | "f c #8684B9", 49 | "g c #A7B4CB", 50 | "h c #8590B5", 51 | "i c #8185A8", 52 | "j c #A8B0BC", 53 | "k c #9BA4AD", 54 | "l c #5B40B3", 55 | "m c #8E8DBD", 56 | "n c #8F9BBB", 57 | "o c #A5A8C7", 58 | "p c #7C809E", 59 | "q c #97A3B1", 60 | "r c #502EB3", 61 | "s c #5A3FB1", 62 | "t c #6A5BA9", 63 | "u c #6B62A9", 64 | "v c #76739F", 65 | "w c #CACBCF", 66 | "x c #CFCFD0", 67 | "y c #93A0AE", 68 | "z c #94A1AF", 69 | "A c #9EAAB6", 70 | "B c #B2BBC4", 71 | "C c #5332B1", 72 | "D c #ABAAB4", 73 | "E c #CACDC9", 74 | "F c #827CA4", 75 | "G c #8482B2", 76 | "H c #AEAEB0", 77 | "I c #96A0A9", 78 | "J c #9CA8B4", 79 | "K c #A3AFBA", 80 | "L c #BEC6CE", 81 | "M c #B8C0C9", 82 | "N c #97A4B1", 83 | "O c #5130B2", 84 | "P c #A096C7", 85 | "Q c #9A99A3", 86 | "R c #7268AF", 87 | "S c #8280B1", 88 | "T c #8B92B0", 89 | "U c #A8B2BD", 90 | "V c #B3BDC5", 91 | "W c #A2ADB9", 92 | "X c #ACB6C0", 93 | "Y c #5F47B2", 94 | "Z c #6B5CAF", 95 | "` c #776EB1", 96 | " . c #8281B1", 97 | ".. c #8991AD", 98 | "+. c #C0C8CF", 99 | "@. c #A7B1BC", 100 | "#. c #6C5DB1", 101 | "$. c #7870B1", 102 | "%. c #8383B1", 103 | "&. c #BCC1D1", 104 | "*. c #B4BDC6", 105 | "=. c #A3AEBA", 106 | "-. c #96A3AF", 107 | ";. c #8585B1", 108 | ">. c #ABB2C5", 109 | ",. c #919FAC", 110 | "'. c #96A2B0", 111 | "). c #929BB0", 112 | " ", 113 | " . + @ # $ ", 114 | " . % & * = - ; > ", 115 | " , ' ) ! ~ { ] ^ / ( ", 116 | " % _ : < [ } | 1 2 3 4 ", 117 | " . 5 6 7 8 9 0 a b c d 4 ", 118 | " % % % e f g h i j k ( ( 4 ", 119 | " , . % l m n o p q 4 4 4 4 ", 120 | " r ' s t u v w x y z A B ", 121 | " r C D E F G H I J K L M N ", 122 | " O P Q R S T U V W X ( ( ", 123 | " Y Z ` ...+.@.A ( 4 4 ", 124 | " #.$.%.&.*.=.( 4 -. ", 125 | " $ ;.>.,.( 4 '.4 ", 126 | " ).-.( ( ", 127 | " "}; 128 | -------------------------------------------------------------------------------- /images/alltray_huge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_huge.png -------------------------------------------------------------------------------- /images/alltray_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_icon.png -------------------------------------------------------------------------------- /images/alltray_logo.png: -------------------------------------------------------------------------------- 1 | alltray_64.png -------------------------------------------------------------------------------- /images/alltray_lp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_lp.png -------------------------------------------------------------------------------- /images/alltray_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/alltray_old.png -------------------------------------------------------------------------------- /images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/images/bg.png -------------------------------------------------------------------------------- /intl/ChangeLog: -------------------------------------------------------------------------------- 1 | 2007-11-07 GNU 2 | 3 | * Version 0.17 released. 4 | 5 | -------------------------------------------------------------------------------- /intl/VERSION: -------------------------------------------------------------------------------- 1 | GNU gettext library from gettext-0.17 2 | -------------------------------------------------------------------------------- /intl/dcgettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dcgettext(3) function. 2 | Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | #ifdef _LIBC 25 | # include 26 | #else 27 | # include "libgnuintl.h" 28 | #endif 29 | 30 | /* @@ end of prolog @@ */ 31 | 32 | /* Names for the libintl functions are a problem. They must not clash 33 | with existing names and they should follow ANSI C. But this source 34 | code is also used in GNU C Library where the names have a __ 35 | prefix. So we have to make a difference here. */ 36 | #ifdef _LIBC 37 | # define DCGETTEXT __dcgettext 38 | # define DCIGETTEXT __dcigettext 39 | #else 40 | # define DCGETTEXT libintl_dcgettext 41 | # define DCIGETTEXT libintl_dcigettext 42 | #endif 43 | 44 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 45 | locale. */ 46 | char * 47 | DCGETTEXT (const char *domainname, const char *msgid, int category) 48 | { 49 | return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); 50 | } 51 | 52 | #ifdef _LIBC 53 | /* Alias for function name in GNU C Library. */ 54 | INTDEF(__dcgettext) 55 | weak_alias (__dcgettext, dcgettext); 56 | #endif 57 | -------------------------------------------------------------------------------- /intl/dcngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dcngettext(3) function. 2 | Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | #ifdef _LIBC 25 | # include 26 | #else 27 | # include "libgnuintl.h" 28 | #endif 29 | 30 | /* @@ end of prolog @@ */ 31 | 32 | /* Names for the libintl functions are a problem. They must not clash 33 | with existing names and they should follow ANSI C. But this source 34 | code is also used in GNU C Library where the names have a __ 35 | prefix. So we have to make a difference here. */ 36 | #ifdef _LIBC 37 | # define DCNGETTEXT __dcngettext 38 | # define DCIGETTEXT __dcigettext 39 | #else 40 | # define DCNGETTEXT libintl_dcngettext 41 | # define DCIGETTEXT libintl_dcigettext 42 | #endif 43 | 44 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 45 | locale. */ 46 | char * 47 | DCNGETTEXT (const char *domainname, 48 | const char *msgid1, const char *msgid2, unsigned long int n, 49 | int category) 50 | { 51 | return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); 52 | } 53 | 54 | #ifdef _LIBC 55 | /* Alias for function name in GNU C Library. */ 56 | weak_alias (__dcngettext, dcngettext); 57 | #endif 58 | -------------------------------------------------------------------------------- /intl/dgettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dgettext(3) function. 2 | Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | 25 | #include 26 | 27 | #ifdef _LIBC 28 | # include 29 | #else 30 | # include "libgnuintl.h" 31 | #endif 32 | 33 | /* @@ end of prolog @@ */ 34 | 35 | /* Names for the libintl functions are a problem. They must not clash 36 | with existing names and they should follow ANSI C. But this source 37 | code is also used in GNU C Library where the names have a __ 38 | prefix. So we have to make a difference here. */ 39 | #ifdef _LIBC 40 | # define DGETTEXT __dgettext 41 | # define DCGETTEXT INTUSE(__dcgettext) 42 | #else 43 | # define DGETTEXT libintl_dgettext 44 | # define DCGETTEXT libintl_dcgettext 45 | #endif 46 | 47 | /* Look up MSGID in the DOMAINNAME message catalog of the current 48 | LC_MESSAGES locale. */ 49 | char * 50 | DGETTEXT (const char *domainname, const char *msgid) 51 | { 52 | return DCGETTEXT (domainname, msgid, LC_MESSAGES); 53 | } 54 | 55 | #ifdef _LIBC 56 | /* Alias for function name in GNU C Library. */ 57 | weak_alias (__dgettext, dgettext); 58 | #endif 59 | -------------------------------------------------------------------------------- /intl/dngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dngettext(3) function. 2 | Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | 25 | #include 26 | 27 | #ifdef _LIBC 28 | # include 29 | #else 30 | # include "libgnuintl.h" 31 | #endif 32 | 33 | /* @@ end of prolog @@ */ 34 | 35 | /* Names for the libintl functions are a problem. They must not clash 36 | with existing names and they should follow ANSI C. But this source 37 | code is also used in GNU C Library where the names have a __ 38 | prefix. So we have to make a difference here. */ 39 | #ifdef _LIBC 40 | # define DNGETTEXT __dngettext 41 | # define DCNGETTEXT __dcngettext 42 | #else 43 | # define DNGETTEXT libintl_dngettext 44 | # define DCNGETTEXT libintl_dcngettext 45 | #endif 46 | 47 | /* Look up MSGID in the DOMAINNAME message catalog of the current 48 | LC_MESSAGES locale and skip message according to the plural form. */ 49 | char * 50 | DNGETTEXT (const char *domainname, 51 | const char *msgid1, const char *msgid2, unsigned long int n) 52 | { 53 | return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); 54 | } 55 | 56 | #ifdef _LIBC 57 | /* Alias for function name in GNU C Library. */ 58 | weak_alias (__dngettext, dngettext); 59 | #endif 60 | -------------------------------------------------------------------------------- /intl/eval-plural.h: -------------------------------------------------------------------------------- 1 | /* Plural expression evaluation. 2 | Copyright (C) 2000-2003, 2007 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef STATIC 20 | #define STATIC static 21 | #endif 22 | 23 | /* Evaluate the plural expression and return an index value. */ 24 | STATIC 25 | unsigned long int 26 | internal_function 27 | plural_eval (const struct expression *pexp, unsigned long int n) 28 | { 29 | switch (pexp->nargs) 30 | { 31 | case 0: 32 | switch (pexp->operation) 33 | { 34 | case var: 35 | return n; 36 | case num: 37 | return pexp->val.num; 38 | default: 39 | break; 40 | } 41 | /* NOTREACHED */ 42 | break; 43 | case 1: 44 | { 45 | /* pexp->operation must be lnot. */ 46 | unsigned long int arg = plural_eval (pexp->val.args[0], n); 47 | return ! arg; 48 | } 49 | case 2: 50 | { 51 | unsigned long int leftarg = plural_eval (pexp->val.args[0], n); 52 | if (pexp->operation == lor) 53 | return leftarg || plural_eval (pexp->val.args[1], n); 54 | else if (pexp->operation == land) 55 | return leftarg && plural_eval (pexp->val.args[1], n); 56 | else 57 | { 58 | unsigned long int rightarg = plural_eval (pexp->val.args[1], n); 59 | 60 | switch (pexp->operation) 61 | { 62 | case mult: 63 | return leftarg * rightarg; 64 | case divide: 65 | #if !INTDIV0_RAISES_SIGFPE 66 | if (rightarg == 0) 67 | raise (SIGFPE); 68 | #endif 69 | return leftarg / rightarg; 70 | case module: 71 | #if !INTDIV0_RAISES_SIGFPE 72 | if (rightarg == 0) 73 | raise (SIGFPE); 74 | #endif 75 | return leftarg % rightarg; 76 | case plus: 77 | return leftarg + rightarg; 78 | case minus: 79 | return leftarg - rightarg; 80 | case less_than: 81 | return leftarg < rightarg; 82 | case greater_than: 83 | return leftarg > rightarg; 84 | case less_or_equal: 85 | return leftarg <= rightarg; 86 | case greater_or_equal: 87 | return leftarg >= rightarg; 88 | case equal: 89 | return leftarg == rightarg; 90 | case not_equal: 91 | return leftarg != rightarg; 92 | default: 93 | break; 94 | } 95 | } 96 | /* NOTREACHED */ 97 | break; 98 | } 99 | case 3: 100 | { 101 | /* pexp->operation must be qmop. */ 102 | unsigned long int boolarg = plural_eval (pexp->val.args[0], n); 103 | return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); 104 | } 105 | } 106 | /* NOTREACHED */ 107 | return 0; 108 | } 109 | -------------------------------------------------------------------------------- /intl/explodename.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1995-1998, 2000-2001, 2003, 2005, 2007 Free Software Foundation, Inc. 2 | Contributed by Ulrich Drepper , 1995. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "loadinfo.h" 28 | 29 | /* On some strange systems still no definition of NULL is found. Sigh! */ 30 | #ifndef NULL 31 | # if defined __STDC__ && __STDC__ 32 | # define NULL ((void *) 0) 33 | # else 34 | # define NULL 0 35 | # endif 36 | #endif 37 | 38 | /* @@ end of prolog @@ */ 39 | 40 | /* Split a locale name NAME into a leading language part and all the 41 | rest. Return a pointer to the first character after the language, 42 | i.e. to the first byte of the rest. */ 43 | static char *_nl_find_language (const char *name); 44 | 45 | static char * 46 | _nl_find_language (const char *name) 47 | { 48 | while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.') 49 | ++name; 50 | 51 | return (char *) name; 52 | } 53 | 54 | 55 | int 56 | _nl_explode_name (char *name, 57 | const char **language, const char **modifier, 58 | const char **territory, const char **codeset, 59 | const char **normalized_codeset) 60 | { 61 | char *cp; 62 | int mask; 63 | 64 | *modifier = NULL; 65 | *territory = NULL; 66 | *codeset = NULL; 67 | *normalized_codeset = NULL; 68 | 69 | /* Now we determine the single parts of the locale name. First 70 | look for the language. Termination symbols are `_', '.', and `@'. */ 71 | mask = 0; 72 | *language = cp = name; 73 | cp = _nl_find_language (*language); 74 | 75 | if (*language == cp) 76 | /* This does not make sense: language has to be specified. Use 77 | this entry as it is without exploding. Perhaps it is an alias. */ 78 | cp = strchr (*language, '\0'); 79 | else 80 | { 81 | if (cp[0] == '_') 82 | { 83 | /* Next is the territory. */ 84 | cp[0] = '\0'; 85 | *territory = ++cp; 86 | 87 | while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@') 88 | ++cp; 89 | 90 | mask |= XPG_TERRITORY; 91 | } 92 | 93 | if (cp[0] == '.') 94 | { 95 | /* Next is the codeset. */ 96 | cp[0] = '\0'; 97 | *codeset = ++cp; 98 | 99 | while (cp[0] != '\0' && cp[0] != '@') 100 | ++cp; 101 | 102 | mask |= XPG_CODESET; 103 | 104 | if (*codeset != cp && (*codeset)[0] != '\0') 105 | { 106 | *normalized_codeset = _nl_normalize_codeset (*codeset, 107 | cp - *codeset); 108 | if (*normalized_codeset == NULL) 109 | return -1; 110 | else if (strcmp (*codeset, *normalized_codeset) == 0) 111 | free ((char *) *normalized_codeset); 112 | else 113 | mask |= XPG_NORM_CODESET; 114 | } 115 | } 116 | } 117 | 118 | if (cp[0] == '@') 119 | { 120 | /* Next is the modifier. */ 121 | cp[0] = '\0'; 122 | *modifier = ++cp; 123 | 124 | if (cp[0] != '\0') 125 | mask |= XPG_MODIFIER; 126 | } 127 | 128 | if (*territory != NULL && (*territory)[0] == '\0') 129 | mask &= ~XPG_TERRITORY; 130 | 131 | if (*codeset != NULL && (*codeset)[0] == '\0') 132 | mask &= ~XPG_CODESET; 133 | 134 | return mask; 135 | } 136 | -------------------------------------------------------------------------------- /intl/export.h: -------------------------------------------------------------------------------- 1 | 2 | #if @HAVE_VISIBILITY@ && BUILDING_LIBINTL 3 | #define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default"))) 4 | #else 5 | #define LIBINTL_DLL_EXPORTED 6 | #endif 7 | -------------------------------------------------------------------------------- /intl/gettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of gettext(3) function. 2 | Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #ifdef _LIBC 24 | # define __need_NULL 25 | # include 26 | #else 27 | # include /* Just for NULL. */ 28 | #endif 29 | 30 | #include "gettextP.h" 31 | #ifdef _LIBC 32 | # include 33 | #else 34 | # include "libgnuintl.h" 35 | #endif 36 | 37 | /* @@ end of prolog @@ */ 38 | 39 | /* Names for the libintl functions are a problem. They must not clash 40 | with existing names and they should follow ANSI C. But this source 41 | code is also used in GNU C Library where the names have a __ 42 | prefix. So we have to make a difference here. */ 43 | #ifdef _LIBC 44 | # define GETTEXT __gettext 45 | # define DCGETTEXT INTUSE(__dcgettext) 46 | #else 47 | # define GETTEXT libintl_gettext 48 | # define DCGETTEXT libintl_dcgettext 49 | #endif 50 | 51 | /* Look up MSGID in the current default message catalog for the current 52 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 53 | text). */ 54 | char * 55 | GETTEXT (const char *msgid) 56 | { 57 | return DCGETTEXT (NULL, msgid, LC_MESSAGES); 58 | } 59 | 60 | #ifdef _LIBC 61 | /* Alias for function name in GNU C Library. */ 62 | weak_alias (__gettext, gettext); 63 | #endif 64 | -------------------------------------------------------------------------------- /intl/gmo.h: -------------------------------------------------------------------------------- 1 | /* Description of GNU message catalog format: general file layout. 2 | Copyright (C) 1995, 1997, 2000-2002, 2004, 2006 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef _GETTEXT_H 20 | #define _GETTEXT_H 1 21 | 22 | #include 23 | 24 | /* @@ end of prolog @@ */ 25 | 26 | /* The magic number of the GNU message catalog format. */ 27 | #define _MAGIC 0x950412de 28 | #define _MAGIC_SWAPPED 0xde120495 29 | 30 | /* Revision number of the currently used .mo (binary) file format. */ 31 | #define MO_REVISION_NUMBER 0 32 | #define MO_REVISION_NUMBER_WITH_SYSDEP_I 1 33 | 34 | /* The following contortions are an attempt to use the C preprocessor 35 | to determine an unsigned integral type that is 32 bits wide. An 36 | alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but 37 | as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work 38 | when cross-compiling. */ 39 | 40 | #if __STDC__ 41 | # define UINT_MAX_32_BITS 4294967295U 42 | #else 43 | # define UINT_MAX_32_BITS 0xFFFFFFFF 44 | #endif 45 | 46 | /* If UINT_MAX isn't defined, assume it's a 32-bit type. 47 | This should be valid for all systems GNU cares about because 48 | that doesn't include 16-bit systems, and only modern systems 49 | (that certainly have ) have 64+-bit integral types. */ 50 | 51 | #ifndef UINT_MAX 52 | # define UINT_MAX UINT_MAX_32_BITS 53 | #endif 54 | 55 | #if UINT_MAX == UINT_MAX_32_BITS 56 | typedef unsigned nls_uint32; 57 | #else 58 | # if USHRT_MAX == UINT_MAX_32_BITS 59 | typedef unsigned short nls_uint32; 60 | # else 61 | # if ULONG_MAX == UINT_MAX_32_BITS 62 | typedef unsigned long nls_uint32; 63 | # else 64 | /* The following line is intended to throw an error. Using #error is 65 | not portable enough. */ 66 | "Cannot determine unsigned 32-bit data type." 67 | # endif 68 | # endif 69 | #endif 70 | 71 | 72 | /* Header for binary .mo file format. */ 73 | struct mo_file_header 74 | { 75 | /* The magic number. */ 76 | nls_uint32 magic; 77 | /* The revision number of the file format. */ 78 | nls_uint32 revision; 79 | 80 | /* The following are only used in .mo files with major revision 0 or 1. */ 81 | 82 | /* The number of strings pairs. */ 83 | nls_uint32 nstrings; 84 | /* Offset of table with start offsets of original strings. */ 85 | nls_uint32 orig_tab_offset; 86 | /* Offset of table with start offsets of translated strings. */ 87 | nls_uint32 trans_tab_offset; 88 | /* Size of hash table. */ 89 | nls_uint32 hash_tab_size; 90 | /* Offset of first hash table entry. */ 91 | nls_uint32 hash_tab_offset; 92 | 93 | /* The following are only used in .mo files with minor revision >= 1. */ 94 | 95 | /* The number of system dependent segments. */ 96 | nls_uint32 n_sysdep_segments; 97 | /* Offset of table describing system dependent segments. */ 98 | nls_uint32 sysdep_segments_offset; 99 | /* The number of system dependent strings pairs. */ 100 | nls_uint32 n_sysdep_strings; 101 | /* Offset of table with start offsets of original sysdep strings. */ 102 | nls_uint32 orig_sysdep_tab_offset; 103 | /* Offset of table with start offsets of translated sysdep strings. */ 104 | nls_uint32 trans_sysdep_tab_offset; 105 | }; 106 | 107 | /* Descriptor for static string contained in the binary .mo file. */ 108 | struct string_desc 109 | { 110 | /* Length of addressed string, not including the trailing NUL. */ 111 | nls_uint32 length; 112 | /* Offset of string in file. */ 113 | nls_uint32 offset; 114 | }; 115 | 116 | /* The following are only used in .mo files with minor revision >= 1. */ 117 | 118 | /* Descriptor for system dependent string segment. */ 119 | struct sysdep_segment 120 | { 121 | /* Length of addressed string, including the trailing NUL. */ 122 | nls_uint32 length; 123 | /* Offset of string in file. */ 124 | nls_uint32 offset; 125 | }; 126 | 127 | /* Pair of a static and a system dependent segment, in struct sysdep_string. */ 128 | struct segment_pair 129 | { 130 | /* Size of static segment. */ 131 | nls_uint32 segsize; 132 | /* Reference to system dependent string segment, or ~0 at the end. */ 133 | nls_uint32 sysdepref; 134 | }; 135 | 136 | /* Descriptor for system dependent string. */ 137 | struct sysdep_string 138 | { 139 | /* Offset of static string segments in file. */ 140 | nls_uint32 offset; 141 | /* Alternating sequence of static and system dependent segments. 142 | The last segment is a static segment, including the trailing NUL. */ 143 | struct segment_pair segments[1]; 144 | }; 145 | 146 | /* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF, 147 | regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */ 148 | #define SEGMENTS_END ((nls_uint32) ~0) 149 | 150 | /* @@ begin of epilog @@ */ 151 | 152 | #endif /* gettext.h */ 153 | -------------------------------------------------------------------------------- /intl/hash-string.c: -------------------------------------------------------------------------------- 1 | /* Implements a string hashing function. 2 | Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, write to the Free 17 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | # include 22 | #endif 23 | 24 | /* Specification. */ 25 | #include "hash-string.h" 26 | 27 | 28 | /* Defines the so called `hashpjw' function by P.J. Weinberger 29 | [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 30 | 1986, 1987 Bell Telephone Laboratories, Inc.] */ 31 | unsigned long int 32 | __hash_string (const char *str_param) 33 | { 34 | unsigned long int hval, g; 35 | const char *str = str_param; 36 | 37 | /* Compute the hash value for the given string. */ 38 | hval = 0; 39 | while (*str != '\0') 40 | { 41 | hval <<= 4; 42 | hval += (unsigned char) *str++; 43 | g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); 44 | if (g != 0) 45 | { 46 | hval ^= g >> (HASHWORDBITS - 8); 47 | hval ^= g; 48 | } 49 | } 50 | return hval; 51 | } 52 | -------------------------------------------------------------------------------- /intl/hash-string.h: -------------------------------------------------------------------------------- 1 | /* Description of GNU message catalog format: string hashing function. 2 | Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | /* @@ end of prolog @@ */ 20 | 21 | /* We assume to have `unsigned long int' value with at least 32 bits. */ 22 | #define HASHWORDBITS 32 23 | 24 | 25 | #ifndef _LIBC 26 | # ifdef IN_LIBINTL 27 | # define __hash_string libintl_hash_string 28 | # else 29 | # define __hash_string hash_string 30 | # endif 31 | #endif 32 | 33 | /* Defines the so called `hashpjw' function by P.J. Weinberger 34 | [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 35 | 1986, 1987 Bell Telephone Laboratories, Inc.] */ 36 | extern unsigned long int __hash_string (const char *str_param); 37 | -------------------------------------------------------------------------------- /intl/intl-compat.c: -------------------------------------------------------------------------------- 1 | /* intl-compat.c - Stub functions to call gettext functions from GNU gettext 2 | Library. 3 | Copyright (C) 1995, 2000-2003, 2005 Software Foundation, Inc. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | # include 22 | #endif 23 | 24 | #include "gettextP.h" 25 | 26 | /* @@ end of prolog @@ */ 27 | 28 | /* This file redirects the gettext functions (without prefix) to those 29 | defined in the included GNU libintl library (with "libintl_" prefix). 30 | It is compiled into libintl in order to make the AM_GNU_GETTEXT test 31 | of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which 32 | has the redirections primarily in the include file. 33 | It is also compiled into libgnuintl so that libgnuintl.so can be used 34 | as LD_PRELOADable library on glibc systems, to provide the extra 35 | features that the functions in the libc don't have (namely, logging). */ 36 | 37 | 38 | #undef gettext 39 | #undef dgettext 40 | #undef dcgettext 41 | #undef ngettext 42 | #undef dngettext 43 | #undef dcngettext 44 | #undef textdomain 45 | #undef bindtextdomain 46 | #undef bind_textdomain_codeset 47 | 48 | 49 | /* When building a DLL, we must export some functions. Note that because 50 | the functions are only defined for binary backward compatibility, we 51 | don't need to use __declspec(dllimport) in any case. */ 52 | #if HAVE_VISIBILITY && BUILDING_DLL 53 | # define DLL_EXPORTED __attribute__((__visibility__("default"))) 54 | #elif defined _MSC_VER && BUILDING_DLL 55 | # define DLL_EXPORTED __declspec(dllexport) 56 | #else 57 | # define DLL_EXPORTED 58 | #endif 59 | 60 | 61 | DLL_EXPORTED 62 | char * 63 | gettext (const char *msgid) 64 | { 65 | return libintl_gettext (msgid); 66 | } 67 | 68 | 69 | DLL_EXPORTED 70 | char * 71 | dgettext (const char *domainname, const char *msgid) 72 | { 73 | return libintl_dgettext (domainname, msgid); 74 | } 75 | 76 | 77 | DLL_EXPORTED 78 | char * 79 | dcgettext (const char *domainname, const char *msgid, int category) 80 | { 81 | return libintl_dcgettext (domainname, msgid, category); 82 | } 83 | 84 | 85 | DLL_EXPORTED 86 | char * 87 | ngettext (const char *msgid1, const char *msgid2, unsigned long int n) 88 | { 89 | return libintl_ngettext (msgid1, msgid2, n); 90 | } 91 | 92 | 93 | DLL_EXPORTED 94 | char * 95 | dngettext (const char *domainname, 96 | const char *msgid1, const char *msgid2, unsigned long int n) 97 | { 98 | return libintl_dngettext (domainname, msgid1, msgid2, n); 99 | } 100 | 101 | 102 | DLL_EXPORTED 103 | char * 104 | dcngettext (const char *domainname, 105 | const char *msgid1, const char *msgid2, unsigned long int n, 106 | int category) 107 | { 108 | return libintl_dcngettext (domainname, msgid1, msgid2, n, category); 109 | } 110 | 111 | 112 | DLL_EXPORTED 113 | char * 114 | textdomain (const char *domainname) 115 | { 116 | return libintl_textdomain (domainname); 117 | } 118 | 119 | 120 | DLL_EXPORTED 121 | char * 122 | bindtextdomain (const char *domainname, const char *dirname) 123 | { 124 | return libintl_bindtextdomain (domainname, dirname); 125 | } 126 | 127 | 128 | DLL_EXPORTED 129 | char * 130 | bind_textdomain_codeset (const char *domainname, const char *codeset) 131 | { 132 | return libintl_bind_textdomain_codeset (domainname, codeset); 133 | } 134 | -------------------------------------------------------------------------------- /intl/intl-exports.c: -------------------------------------------------------------------------------- 1 | /* List of exported symbols of libintl on Cygwin. 2 | Copyright (C) 2006 Free Software Foundation, Inc. 3 | Written by Bruno Haible , 2006. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | /* IMP(x) is a symbol that contains the address of x. */ 21 | #define IMP(x) _imp__##x 22 | 23 | /* Ensure that the variable x is exported from the library, and that a 24 | pseudo-variable IMP(x) is available. */ 25 | #define VARIABLE(x) \ 26 | /* Export x without redefining x. This code was found by compiling a \ 27 | snippet: \ 28 | extern __declspec(dllexport) int x; int x = 42; */ \ 29 | asm (".section .drectve\n"); \ 30 | asm (".ascii \" -export:" #x ",data\"\n"); \ 31 | asm (".data\n"); \ 32 | /* Allocate a pseudo-variable IMP(x). */ \ 33 | extern int x; \ 34 | void * IMP(x) = &x; 35 | 36 | VARIABLE(libintl_version) 37 | -------------------------------------------------------------------------------- /intl/langprefs.c: -------------------------------------------------------------------------------- 1 | /* Determine the user's language preferences. 2 | Copyright (C) 2004-2006 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | /* Written by Bruno Haible . */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | # include 23 | #endif 24 | 25 | #include 26 | 27 | #if HAVE_CFPREFERENCESCOPYAPPVALUE 28 | # include 29 | # include 30 | # include 31 | # include 32 | # include 33 | extern void _nl_locale_name_canonicalize (char *name); 34 | #endif 35 | 36 | /* Determine the user's language preferences, as a colon separated list of 37 | locale names in XPG syntax 38 | language[_territory][.codeset][@modifier] 39 | The result must not be freed; it is statically allocated. 40 | The LANGUAGE environment variable does not need to be considered; it is 41 | already taken into account by the caller. */ 42 | 43 | const char * 44 | _nl_language_preferences_default (void) 45 | { 46 | #if HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ 47 | { 48 | /* Cache the preferences list, since CoreFoundation calls are expensive. */ 49 | static const char *cached_languages; 50 | static int cache_initialized; 51 | 52 | if (!cache_initialized) 53 | { 54 | CFTypeRef preferences = 55 | CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"), 56 | kCFPreferencesCurrentApplication); 57 | if (preferences != NULL 58 | && CFGetTypeID (preferences) == CFArrayGetTypeID ()) 59 | { 60 | CFArrayRef prefArray = (CFArrayRef)preferences; 61 | int n = CFArrayGetCount (prefArray); 62 | char buf[256]; 63 | size_t size = 0; 64 | int i; 65 | 66 | for (i = 0; i < n; i++) 67 | { 68 | CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i); 69 | if (element != NULL 70 | && CFGetTypeID (element) == CFStringGetTypeID () 71 | && CFStringGetCString ((CFStringRef)element, 72 | buf, sizeof (buf), 73 | kCFStringEncodingASCII)) 74 | { 75 | _nl_locale_name_canonicalize (buf); 76 | size += strlen (buf) + 1; 77 | /* Most GNU programs use msgids in English and don't ship 78 | an en.mo message catalog. Therefore when we see "en" 79 | in the preferences list, arrange for gettext() to 80 | return the msgid, and ignore all further elements of 81 | the preferences list. */ 82 | if (strcmp (buf, "en") == 0) 83 | break; 84 | } 85 | else 86 | break; 87 | } 88 | if (size > 0) 89 | { 90 | char *languages = (char *) malloc (size); 91 | 92 | if (languages != NULL) 93 | { 94 | char *p = languages; 95 | 96 | for (i = 0; i < n; i++) 97 | { 98 | CFTypeRef element = 99 | CFArrayGetValueAtIndex (prefArray, i); 100 | if (element != NULL 101 | && CFGetTypeID (element) == CFStringGetTypeID () 102 | && CFStringGetCString ((CFStringRef)element, 103 | buf, sizeof (buf), 104 | kCFStringEncodingASCII)) 105 | { 106 | _nl_locale_name_canonicalize (buf); 107 | strcpy (p, buf); 108 | p += strlen (buf); 109 | *p++ = ':'; 110 | if (strcmp (buf, "en") == 0) 111 | break; 112 | } 113 | else 114 | break; 115 | } 116 | *--p = '\0'; 117 | 118 | cached_languages = languages; 119 | } 120 | } 121 | } 122 | cache_initialized = 1; 123 | } 124 | if (cached_languages != NULL) 125 | return cached_languages; 126 | } 127 | #endif 128 | 129 | return NULL; 130 | } 131 | -------------------------------------------------------------------------------- /intl/libintl.rc: -------------------------------------------------------------------------------- 1 | /* Resources for intl.dll */ 2 | 3 | #include 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 7 | PRODUCTVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 8 | FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */ 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L /* VS_FF_DEBUG */ 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */ 15 | FILETYPE 0x2L /* VFT_DLL */ 16 | FILESUBTYPE 0x0L /* VFT2_UNKNOWN */ 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "04090000" /* Lang = US English, Charset = ASCII */ 21 | BEGIN 22 | VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\0" 23 | VALUE "CompanyName", "Free Software Foundation\0" 24 | VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista and Windows 95/98/ME\0" 25 | VALUE "FileVersion", PACKAGE_VERSION_STRING "\0" 26 | VALUE "InternalName", "intl.dll\0" 27 | VALUE "LegalCopyright", "Copyright (C) 1995-2007\0" 28 | VALUE "LegalTrademarks", "\0" 29 | VALUE "OriginalFilename", "intl.dll\0" 30 | VALUE "ProductName", "libintl: accessing NLS message catalogs\0" 31 | VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x0409, 0 /* US English, ASCII */ 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /intl/localcharset.h: -------------------------------------------------------------------------------- 1 | /* Determine a canonical name for the current locale's character encoding. 2 | Copyright (C) 2000-2003 Free Software Foundation, Inc. 3 | This file is part of the GNU CHARSET Library. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | #ifndef _LOCALCHARSET_H 21 | #define _LOCALCHARSET_H 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | /* Determine the current locale's character encoding, and canonicalize it 30 | into one of the canonical names listed in config.charset. 31 | The result must not be freed; it is statically allocated. 32 | If the canonical name cannot be determined, the result is a non-canonical 33 | name. */ 34 | extern const char * locale_charset (void); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | 42 | #endif /* _LOCALCHARSET_H */ 43 | -------------------------------------------------------------------------------- /intl/locale.alias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/intl/locale.alias -------------------------------------------------------------------------------- /intl/log.c: -------------------------------------------------------------------------------- 1 | /* Log file output. 2 | Copyright (C) 2003, 2005 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | /* Written by Bruno Haible . */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | # include 23 | #endif 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | /* Handle multi-threaded applications. */ 30 | #ifdef _LIBC 31 | # include 32 | #else 33 | # include "lock.h" 34 | #endif 35 | 36 | /* Print an ASCII string with quotes and escape sequences where needed. */ 37 | static void 38 | print_escaped (FILE *stream, const char *str) 39 | { 40 | putc ('"', stream); 41 | for (; *str != '\0'; str++) 42 | if (*str == '\n') 43 | { 44 | fputs ("\\n\"", stream); 45 | if (str[1] == '\0') 46 | return; 47 | fputs ("\n\"", stream); 48 | } 49 | else 50 | { 51 | if (*str == '"' || *str == '\\') 52 | putc ('\\', stream); 53 | putc (*str, stream); 54 | } 55 | putc ('"', stream); 56 | } 57 | 58 | static char *last_logfilename = NULL; 59 | static FILE *last_logfile = NULL; 60 | __libc_lock_define_initialized (static, lock) 61 | 62 | static inline void 63 | _nl_log_untranslated_locked (const char *logfilename, const char *domainname, 64 | const char *msgid1, const char *msgid2, int plural) 65 | { 66 | FILE *logfile; 67 | 68 | /* Can we reuse the last opened logfile? */ 69 | if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) 70 | { 71 | /* Close the last used logfile. */ 72 | if (last_logfilename != NULL) 73 | { 74 | if (last_logfile != NULL) 75 | { 76 | fclose (last_logfile); 77 | last_logfile = NULL; 78 | } 79 | free (last_logfilename); 80 | last_logfilename = NULL; 81 | } 82 | /* Open the logfile. */ 83 | last_logfilename = (char *) malloc (strlen (logfilename) + 1); 84 | if (last_logfilename == NULL) 85 | return; 86 | strcpy (last_logfilename, logfilename); 87 | last_logfile = fopen (logfilename, "a"); 88 | if (last_logfile == NULL) 89 | return; 90 | } 91 | logfile = last_logfile; 92 | 93 | fprintf (logfile, "domain "); 94 | print_escaped (logfile, domainname); 95 | fprintf (logfile, "\nmsgid "); 96 | print_escaped (logfile, msgid1); 97 | if (plural) 98 | { 99 | fprintf (logfile, "\nmsgid_plural "); 100 | print_escaped (logfile, msgid2); 101 | fprintf (logfile, "\nmsgstr[0] \"\"\n"); 102 | } 103 | else 104 | fprintf (logfile, "\nmsgstr \"\"\n"); 105 | putc ('\n', logfile); 106 | } 107 | 108 | /* Add to the log file an entry denoting a failed translation. */ 109 | void 110 | _nl_log_untranslated (const char *logfilename, const char *domainname, 111 | const char *msgid1, const char *msgid2, int plural) 112 | { 113 | __libc_lock_lock (lock); 114 | _nl_log_untranslated_locked (logfilename, domainname, msgid1, msgid2, plural); 115 | __libc_lock_unlock (lock); 116 | } 117 | -------------------------------------------------------------------------------- /intl/ngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of ngettext(3) function. 2 | Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #ifdef _LIBC 24 | # define __need_NULL 25 | # include 26 | #else 27 | # include /* Just for NULL. */ 28 | #endif 29 | 30 | #include "gettextP.h" 31 | #ifdef _LIBC 32 | # include 33 | #else 34 | # include "libgnuintl.h" 35 | #endif 36 | 37 | #include 38 | 39 | /* @@ end of prolog @@ */ 40 | 41 | /* Names for the libintl functions are a problem. They must not clash 42 | with existing names and they should follow ANSI C. But this source 43 | code is also used in GNU C Library where the names have a __ 44 | prefix. So we have to make a difference here. */ 45 | #ifdef _LIBC 46 | # define NGETTEXT __ngettext 47 | # define DCNGETTEXT __dcngettext 48 | #else 49 | # define NGETTEXT libintl_ngettext 50 | # define DCNGETTEXT libintl_dcngettext 51 | #endif 52 | 53 | /* Look up MSGID in the current default message catalog for the current 54 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 55 | text). */ 56 | char * 57 | NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n) 58 | { 59 | return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); 60 | } 61 | 62 | #ifdef _LIBC 63 | /* Alias for function name in GNU C Library. */ 64 | weak_alias (__ngettext, ngettext); 65 | #endif 66 | -------------------------------------------------------------------------------- /intl/os2compat.c: -------------------------------------------------------------------------------- 1 | /* OS/2 compatibility functions. 2 | Copyright (C) 2001-2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #define OS2_AWARE 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | /* A version of getenv() that works from DLLs */ 29 | extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); 30 | 31 | char * 32 | _nl_getenv (const char *name) 33 | { 34 | unsigned char *value; 35 | if (DosScanEnv (name, &value)) 36 | return NULL; 37 | else 38 | return value; 39 | } 40 | 41 | /* A fixed size buffer. */ 42 | char libintl_nl_default_dirname[MAXPATHLEN+1]; 43 | 44 | char *_nlos2_libdir = NULL; 45 | char *_nlos2_localealiaspath = NULL; 46 | char *_nlos2_localedir = NULL; 47 | 48 | static __attribute__((constructor)) void 49 | nlos2_initialize () 50 | { 51 | char *root = getenv ("UNIXROOT"); 52 | char *gnulocaledir = getenv ("GNULOCALEDIR"); 53 | 54 | _nlos2_libdir = gnulocaledir; 55 | if (!_nlos2_libdir) 56 | { 57 | if (root) 58 | { 59 | size_t sl = strlen (root); 60 | _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); 61 | memcpy (_nlos2_libdir, root, sl); 62 | memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); 63 | } 64 | else 65 | _nlos2_libdir = LIBDIR; 66 | } 67 | 68 | _nlos2_localealiaspath = gnulocaledir; 69 | if (!_nlos2_localealiaspath) 70 | { 71 | if (root) 72 | { 73 | size_t sl = strlen (root); 74 | _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); 75 | memcpy (_nlos2_localealiaspath, root, sl); 76 | memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); 77 | } 78 | else 79 | _nlos2_localealiaspath = LOCALE_ALIAS_PATH; 80 | } 81 | 82 | _nlos2_localedir = gnulocaledir; 83 | if (!_nlos2_localedir) 84 | { 85 | if (root) 86 | { 87 | size_t sl = strlen (root); 88 | _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); 89 | memcpy (_nlos2_localedir, root, sl); 90 | memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); 91 | } 92 | else 93 | _nlos2_localedir = LOCALEDIR; 94 | } 95 | 96 | if (strlen (_nlos2_localedir) <= MAXPATHLEN) 97 | strcpy (libintl_nl_default_dirname, _nlos2_localedir); 98 | } 99 | -------------------------------------------------------------------------------- /intl/os2compat.h: -------------------------------------------------------------------------------- 1 | /* OS/2 compatibility defines. 2 | This file is intended to be included from config.h 3 | Copyright (C) 2001-2002 Free Software Foundation, Inc. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | /* When included from os2compat.h we need all the original definitions */ 21 | #ifndef OS2_AWARE 22 | 23 | #undef LIBDIR 24 | #define LIBDIR _nlos2_libdir 25 | extern char *_nlos2_libdir; 26 | 27 | #undef LOCALEDIR 28 | #define LOCALEDIR _nlos2_localedir 29 | extern char *_nlos2_localedir; 30 | 31 | #undef LOCALE_ALIAS_PATH 32 | #define LOCALE_ALIAS_PATH _nlos2_localealiaspath 33 | extern char *_nlos2_localealiaspath; 34 | 35 | #endif 36 | 37 | #undef HAVE_STRCASECMP 38 | #define HAVE_STRCASECMP 1 39 | #define strcasecmp stricmp 40 | #define strncasecmp strnicmp 41 | 42 | /* We have our own getenv() which works even if library is compiled as DLL */ 43 | #define getenv _nl_getenv 44 | 45 | /* Older versions of gettext used -1 as the value of LC_MESSAGES */ 46 | #define LC_MESSAGES_COMPAT (-1) 47 | -------------------------------------------------------------------------------- /intl/osdep.c: -------------------------------------------------------------------------------- 1 | /* OS dependent parts of libintl. 2 | Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #if defined __CYGWIN__ 20 | # include "intl-exports.c" 21 | #elif defined __EMX__ 22 | # include "os2compat.c" 23 | #else 24 | /* Avoid AIX compiler warning. */ 25 | typedef int dummy; 26 | #endif 27 | -------------------------------------------------------------------------------- /intl/plural-exp.c: -------------------------------------------------------------------------------- 1 | /* Expression parsing for plural form selection. 2 | Copyright (C) 2000-2001, 2003, 2005-2007 Free Software Foundation, Inc. 3 | Written by Ulrich Drepper , 2000. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | # include 22 | #endif 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "plural-exp.h" 29 | 30 | #if (defined __GNUC__ && !(__APPLE_CC__ > 1) && !defined __cplusplus) \ 31 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) 32 | 33 | /* These structs are the constant expression for the germanic plural 34 | form determination. It represents the expression "n != 1". */ 35 | static const struct expression plvar = 36 | { 37 | .nargs = 0, 38 | .operation = var, 39 | }; 40 | static const struct expression plone = 41 | { 42 | .nargs = 0, 43 | .operation = num, 44 | .val = 45 | { 46 | .num = 1 47 | } 48 | }; 49 | struct expression GERMANIC_PLURAL = 50 | { 51 | .nargs = 2, 52 | .operation = not_equal, 53 | .val = 54 | { 55 | .args = 56 | { 57 | [0] = (struct expression *) &plvar, 58 | [1] = (struct expression *) &plone 59 | } 60 | } 61 | }; 62 | 63 | # define INIT_GERMANIC_PLURAL() 64 | 65 | #else 66 | 67 | /* For compilers without support for ISO C 99 struct/union initializers: 68 | Initialization at run-time. */ 69 | 70 | static struct expression plvar; 71 | static struct expression plone; 72 | struct expression GERMANIC_PLURAL; 73 | 74 | static void 75 | init_germanic_plural () 76 | { 77 | if (plone.val.num == 0) 78 | { 79 | plvar.nargs = 0; 80 | plvar.operation = var; 81 | 82 | plone.nargs = 0; 83 | plone.operation = num; 84 | plone.val.num = 1; 85 | 86 | GERMANIC_PLURAL.nargs = 2; 87 | GERMANIC_PLURAL.operation = not_equal; 88 | GERMANIC_PLURAL.val.args[0] = &plvar; 89 | GERMANIC_PLURAL.val.args[1] = &plone; 90 | } 91 | } 92 | 93 | # define INIT_GERMANIC_PLURAL() init_germanic_plural () 94 | 95 | #endif 96 | 97 | void 98 | internal_function 99 | EXTRACT_PLURAL_EXPRESSION (const char *nullentry, 100 | const struct expression **pluralp, 101 | unsigned long int *npluralsp) 102 | { 103 | if (nullentry != NULL) 104 | { 105 | const char *plural; 106 | const char *nplurals; 107 | 108 | plural = strstr (nullentry, "plural="); 109 | nplurals = strstr (nullentry, "nplurals="); 110 | if (plural == NULL || nplurals == NULL) 111 | goto no_plural; 112 | else 113 | { 114 | char *endp; 115 | unsigned long int n; 116 | struct parse_args args; 117 | 118 | /* First get the number. */ 119 | nplurals += 9; 120 | while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) 121 | ++nplurals; 122 | if (!(*nplurals >= '0' && *nplurals <= '9')) 123 | goto no_plural; 124 | #if defined HAVE_STRTOUL || defined _LIBC 125 | n = strtoul (nplurals, &endp, 10); 126 | #else 127 | for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) 128 | n = n * 10 + (*endp - '0'); 129 | #endif 130 | if (nplurals == endp) 131 | goto no_plural; 132 | *npluralsp = n; 133 | 134 | /* Due to the restrictions bison imposes onto the interface of the 135 | scanner function we have to put the input string and the result 136 | passed up from the parser into the same structure which address 137 | is passed down to the parser. */ 138 | plural += 7; 139 | args.cp = plural; 140 | if (PLURAL_PARSE (&args) != 0) 141 | goto no_plural; 142 | *pluralp = args.res; 143 | } 144 | } 145 | else 146 | { 147 | /* By default we are using the Germanic form: singular form only 148 | for `one', the plural form otherwise. Yes, this is also what 149 | English is using since English is a Germanic language. */ 150 | no_plural: 151 | INIT_GERMANIC_PLURAL (); 152 | *pluralp = &GERMANIC_PLURAL; 153 | *npluralsp = 2; 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /intl/plural-exp.h: -------------------------------------------------------------------------------- 1 | /* Expression parsing and evaluation for plural form selection. 2 | Copyright (C) 2000-2003, 2005-2007 Free Software Foundation, Inc. 3 | Written by Ulrich Drepper , 2000. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | #ifndef _PLURAL_EXP_H 21 | #define _PLURAL_EXP_H 22 | 23 | #ifndef internal_function 24 | # define internal_function 25 | #endif 26 | 27 | #ifndef attribute_hidden 28 | # define attribute_hidden 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | 36 | enum expression_operator 37 | { 38 | /* Without arguments: */ 39 | var, /* The variable "n". */ 40 | num, /* Decimal number. */ 41 | /* Unary operators: */ 42 | lnot, /* Logical NOT. */ 43 | /* Binary operators: */ 44 | mult, /* Multiplication. */ 45 | divide, /* Division. */ 46 | module, /* Modulo operation. */ 47 | plus, /* Addition. */ 48 | minus, /* Subtraction. */ 49 | less_than, /* Comparison. */ 50 | greater_than, /* Comparison. */ 51 | less_or_equal, /* Comparison. */ 52 | greater_or_equal, /* Comparison. */ 53 | equal, /* Comparison for equality. */ 54 | not_equal, /* Comparison for inequality. */ 55 | land, /* Logical AND. */ 56 | lor, /* Logical OR. */ 57 | /* Ternary operators: */ 58 | qmop /* Question mark operator. */ 59 | }; 60 | 61 | /* This is the representation of the expressions to determine the 62 | plural form. */ 63 | struct expression 64 | { 65 | int nargs; /* Number of arguments. */ 66 | enum expression_operator operation; 67 | union 68 | { 69 | unsigned long int num; /* Number value for `num'. */ 70 | struct expression *args[3]; /* Up to three arguments. */ 71 | } val; 72 | }; 73 | 74 | /* This is the data structure to pass information to the parser and get 75 | the result in a thread-safe way. */ 76 | struct parse_args 77 | { 78 | const char *cp; 79 | struct expression *res; 80 | }; 81 | 82 | 83 | /* Names for the libintl functions are a problem. This source code is used 84 | 1. in the GNU C Library library, 85 | 2. in the GNU libintl library, 86 | 3. in the GNU gettext tools. 87 | The function names in each situation must be different, to allow for 88 | binary incompatible changes in 'struct expression'. Furthermore, 89 | 1. in the GNU C Library library, the names have a __ prefix, 90 | 2.+3. in the GNU libintl library and in the GNU gettext tools, the names 91 | must follow ANSI C and not start with __. 92 | So we have to distinguish the three cases. */ 93 | #ifdef _LIBC 94 | # define FREE_EXPRESSION __gettext_free_exp 95 | # define PLURAL_PARSE __gettextparse 96 | # define GERMANIC_PLURAL __gettext_germanic_plural 97 | # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural 98 | #elif defined (IN_LIBINTL) 99 | # define FREE_EXPRESSION libintl_gettext_free_exp 100 | # define PLURAL_PARSE libintl_gettextparse 101 | # define GERMANIC_PLURAL libintl_gettext_germanic_plural 102 | # define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural 103 | #else 104 | # define FREE_EXPRESSION free_plural_expression 105 | # define PLURAL_PARSE parse_plural_expression 106 | # define GERMANIC_PLURAL germanic_plural 107 | # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression 108 | #endif 109 | 110 | extern void FREE_EXPRESSION (struct expression *exp) 111 | internal_function; 112 | extern int PLURAL_PARSE (void *arg); 113 | extern struct expression GERMANIC_PLURAL attribute_hidden; 114 | extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, 115 | const struct expression **pluralp, 116 | unsigned long int *npluralsp) 117 | internal_function; 118 | 119 | #if !defined (_LIBC) && !defined (IN_LIBINTL) && !defined (IN_LIBGLOCALE) 120 | extern unsigned long int plural_eval (const struct expression *pexp, 121 | unsigned long int n); 122 | #endif 123 | 124 | 125 | #ifdef __cplusplus 126 | } 127 | #endif 128 | 129 | #endif /* _PLURAL_EXP_H */ 130 | -------------------------------------------------------------------------------- /intl/printf-args.h: -------------------------------------------------------------------------------- 1 | /* Decomposed printf argument list. 2 | Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef _PRINTF_ARGS_H 20 | #define _PRINTF_ARGS_H 21 | 22 | /* This file can be parametrized with the following macros: 23 | ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. 24 | PRINTF_FETCHARGS Name of the function to be declared. 25 | STATIC Set to 'static' to declare the function static. */ 26 | 27 | /* Default parameters. */ 28 | #ifndef PRINTF_FETCHARGS 29 | # define PRINTF_FETCHARGS printf_fetchargs 30 | #endif 31 | 32 | /* Get size_t. */ 33 | #include 34 | 35 | /* Get wchar_t. */ 36 | #if HAVE_WCHAR_T 37 | # include 38 | #endif 39 | 40 | /* Get wint_t. */ 41 | #if HAVE_WINT_T 42 | # include 43 | #endif 44 | 45 | /* Get va_list. */ 46 | #include 47 | 48 | 49 | /* Argument types */ 50 | typedef enum 51 | { 52 | TYPE_NONE, 53 | TYPE_SCHAR, 54 | TYPE_UCHAR, 55 | TYPE_SHORT, 56 | TYPE_USHORT, 57 | TYPE_INT, 58 | TYPE_UINT, 59 | TYPE_LONGINT, 60 | TYPE_ULONGINT, 61 | #if HAVE_LONG_LONG_INT 62 | TYPE_LONGLONGINT, 63 | TYPE_ULONGLONGINT, 64 | #endif 65 | TYPE_DOUBLE, 66 | TYPE_LONGDOUBLE, 67 | TYPE_CHAR, 68 | #if HAVE_WINT_T 69 | TYPE_WIDE_CHAR, 70 | #endif 71 | TYPE_STRING, 72 | #if HAVE_WCHAR_T 73 | TYPE_WIDE_STRING, 74 | #endif 75 | TYPE_POINTER, 76 | TYPE_COUNT_SCHAR_POINTER, 77 | TYPE_COUNT_SHORT_POINTER, 78 | TYPE_COUNT_INT_POINTER, 79 | TYPE_COUNT_LONGINT_POINTER 80 | #if HAVE_LONG_LONG_INT 81 | , TYPE_COUNT_LONGLONGINT_POINTER 82 | #endif 83 | #if ENABLE_UNISTDIO 84 | /* The unistdio extensions. */ 85 | , TYPE_U8_STRING 86 | , TYPE_U16_STRING 87 | , TYPE_U32_STRING 88 | #endif 89 | } arg_type; 90 | 91 | /* Polymorphic argument */ 92 | typedef struct 93 | { 94 | arg_type type; 95 | union 96 | { 97 | signed char a_schar; 98 | unsigned char a_uchar; 99 | short a_short; 100 | unsigned short a_ushort; 101 | int a_int; 102 | unsigned int a_uint; 103 | long int a_longint; 104 | unsigned long int a_ulongint; 105 | #if HAVE_LONG_LONG_INT 106 | long long int a_longlongint; 107 | unsigned long long int a_ulonglongint; 108 | #endif 109 | float a_float; 110 | double a_double; 111 | long double a_longdouble; 112 | int a_char; 113 | #if HAVE_WINT_T 114 | wint_t a_wide_char; 115 | #endif 116 | const char* a_string; 117 | #if HAVE_WCHAR_T 118 | const wchar_t* a_wide_string; 119 | #endif 120 | void* a_pointer; 121 | signed char * a_count_schar_pointer; 122 | short * a_count_short_pointer; 123 | int * a_count_int_pointer; 124 | long int * a_count_longint_pointer; 125 | #if HAVE_LONG_LONG_INT 126 | long long int * a_count_longlongint_pointer; 127 | #endif 128 | #if ENABLE_UNISTDIO 129 | /* The unistdio extensions. */ 130 | const uint8_t * a_u8_string; 131 | const uint16_t * a_u16_string; 132 | const uint32_t * a_u32_string; 133 | #endif 134 | } 135 | a; 136 | } 137 | argument; 138 | 139 | typedef struct 140 | { 141 | size_t count; 142 | argument *arg; 143 | } 144 | arguments; 145 | 146 | 147 | /* Fetch the arguments, putting them into a. */ 148 | #ifdef STATIC 149 | STATIC 150 | #else 151 | extern 152 | #endif 153 | int PRINTF_FETCHARGS (va_list args, arguments *a); 154 | 155 | #endif /* _PRINTF_ARGS_H */ 156 | -------------------------------------------------------------------------------- /intl/printf-parse.h: -------------------------------------------------------------------------------- 1 | /* Parse printf format string. 2 | Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef _PRINTF_PARSE_H 20 | #define _PRINTF_PARSE_H 21 | 22 | #include "printf-args.h" 23 | 24 | 25 | /* Flags */ 26 | #define FLAG_GROUP 1 /* ' flag */ 27 | #define FLAG_LEFT 2 /* - flag */ 28 | #define FLAG_SHOWSIGN 4 /* + flag */ 29 | #define FLAG_SPACE 8 /* space flag */ 30 | #define FLAG_ALT 16 /* # flag */ 31 | #define FLAG_ZERO 32 32 | 33 | /* arg_index value indicating that no argument is consumed. */ 34 | #define ARG_NONE (~(size_t)0) 35 | 36 | /* A parsed directive. */ 37 | typedef struct 38 | { 39 | const char* dir_start; 40 | const char* dir_end; 41 | int flags; 42 | const char* width_start; 43 | const char* width_end; 44 | size_t width_arg_index; 45 | const char* precision_start; 46 | const char* precision_end; 47 | size_t precision_arg_index; 48 | char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ 49 | size_t arg_index; 50 | } 51 | char_directive; 52 | 53 | /* A parsed format string. */ 54 | typedef struct 55 | { 56 | size_t count; 57 | char_directive *dir; 58 | size_t max_width_length; 59 | size_t max_precision_length; 60 | } 61 | char_directives; 62 | 63 | 64 | /* Parses the format string. Fills in the number N of directives, and fills 65 | in directives[0], ..., directives[N-1], and sets directives[N].dir_start 66 | to the end of the format string. Also fills in the arg_type fields of the 67 | arguments and the needed count of arguments. */ 68 | #ifdef STATIC 69 | STATIC 70 | #else 71 | extern 72 | #endif 73 | int printf_parse (const char *format, char_directives *d, arguments *a); 74 | 75 | #endif /* _PRINTF_PARSE_H */ 76 | -------------------------------------------------------------------------------- /intl/ref-add.sin: -------------------------------------------------------------------------------- 1 | # Add this package to a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | ta 25 | :a 26 | s/ @PACKAGE@ / @PACKAGE@ / 27 | tb 28 | s/ $/ @PACKAGE@ / 29 | :b 30 | s/^/# Packages using this file:/ 31 | } 32 | -------------------------------------------------------------------------------- /intl/ref-del.sin: -------------------------------------------------------------------------------- 1 | # Remove this package from a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | s/ @PACKAGE@ / / 25 | s/^/# Packages using this file:/ 26 | } 27 | -------------------------------------------------------------------------------- /intl/relocatable.h: -------------------------------------------------------------------------------- 1 | /* Provide relocatable packages. 2 | Copyright (C) 2003, 2005 Free Software Foundation, Inc. 3 | Written by Bruno Haible , 2003. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | #ifndef _RELOCATABLE_H 21 | #define _RELOCATABLE_H 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | 28 | /* This can be enabled through the configure --enable-relocatable option. */ 29 | #if ENABLE_RELOCATABLE 30 | 31 | /* When building a DLL, we must export some functions. Note that because 32 | this is a private .h file, we don't need to use __declspec(dllimport) 33 | in any case. */ 34 | #if HAVE_VISIBILITY && BUILDING_DLL 35 | # define RELOCATABLE_DLL_EXPORTED __attribute__((__visibility__("default"))) 36 | #elif defined _MSC_VER && BUILDING_DLL 37 | # define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) 38 | #else 39 | # define RELOCATABLE_DLL_EXPORTED 40 | #endif 41 | 42 | /* Sets the original and the current installation prefix of the package. 43 | Relocation simply replaces a pathname starting with the original prefix 44 | by the corresponding pathname with the current prefix instead. Both 45 | prefixes should be directory names without trailing slash (i.e. use "" 46 | instead of "/"). */ 47 | extern RELOCATABLE_DLL_EXPORTED void 48 | set_relocation_prefix (const char *orig_prefix, 49 | const char *curr_prefix); 50 | 51 | /* Returns the pathname, relocated according to the current installation 52 | directory. */ 53 | extern const char * relocate (const char *pathname); 54 | 55 | /* Memory management: relocate() leaks memory, because it has to construct 56 | a fresh pathname. If this is a problem because your program calls 57 | relocate() frequently, think about caching the result. */ 58 | 59 | /* Convenience function: 60 | Computes the current installation prefix, based on the original 61 | installation prefix, the original installation directory of a particular 62 | file, and the current pathname of this file. Returns NULL upon failure. */ 63 | extern const char * compute_curr_prefix (const char *orig_installprefix, 64 | const char *orig_installdir, 65 | const char *curr_pathname); 66 | 67 | #else 68 | 69 | /* By default, we use the hardwired pathnames. */ 70 | #define relocate(pathname) (pathname) 71 | 72 | #endif 73 | 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif /* _RELOCATABLE_H */ 80 | -------------------------------------------------------------------------------- /intl/textdomain.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the textdomain(3) function. 2 | Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include 24 | #include 25 | 26 | #include "gettextP.h" 27 | #ifdef _LIBC 28 | # include 29 | #else 30 | # include "libgnuintl.h" 31 | #endif 32 | 33 | /* Handle multi-threaded applications. */ 34 | #ifdef _LIBC 35 | # include 36 | # define gl_rwlock_define __libc_rwlock_define 37 | # define gl_rwlock_wrlock __libc_rwlock_wrlock 38 | # define gl_rwlock_unlock __libc_rwlock_unlock 39 | #else 40 | # include "lock.h" 41 | #endif 42 | 43 | /* @@ end of prolog @@ */ 44 | 45 | 46 | /* Names for the libintl functions are a problem. They must not clash 47 | with existing names and they should follow ANSI C. But this source 48 | code is also used in GNU C Library where the names have a __ 49 | prefix. So we have to make a difference here. */ 50 | #ifdef _LIBC 51 | # define TEXTDOMAIN __textdomain 52 | # ifndef strdup 53 | # define strdup(str) __strdup (str) 54 | # endif 55 | #else 56 | # define TEXTDOMAIN libintl_textdomain 57 | #endif 58 | 59 | /* Lock variable to protect the global data in the gettext implementation. */ 60 | gl_rwlock_define (extern, _nl_state_lock attribute_hidden) 61 | 62 | /* Set the current default message catalog to DOMAINNAME. 63 | If DOMAINNAME is null, return the current default. 64 | If DOMAINNAME is "", reset to the default of "messages". */ 65 | char * 66 | TEXTDOMAIN (const char *domainname) 67 | { 68 | char *new_domain; 69 | char *old_domain; 70 | 71 | /* A NULL pointer requests the current setting. */ 72 | if (domainname == NULL) 73 | return (char *) _nl_current_default_domain; 74 | 75 | gl_rwlock_wrlock (_nl_state_lock); 76 | 77 | old_domain = (char *) _nl_current_default_domain; 78 | 79 | /* If domain name is the null string set to default domain "messages". */ 80 | if (domainname[0] == '\0' 81 | || strcmp (domainname, _nl_default_default_domain) == 0) 82 | { 83 | _nl_current_default_domain = _nl_default_default_domain; 84 | new_domain = (char *) _nl_current_default_domain; 85 | } 86 | else if (strcmp (domainname, old_domain) == 0) 87 | /* This can happen and people will use it to signal that some 88 | environment variable changed. */ 89 | new_domain = old_domain; 90 | else 91 | { 92 | /* If the following malloc fails `_nl_current_default_domain' 93 | will be NULL. This value will be returned and so signals we 94 | are out of core. */ 95 | #if defined _LIBC || defined HAVE_STRDUP 96 | new_domain = strdup (domainname); 97 | #else 98 | size_t len = strlen (domainname) + 1; 99 | new_domain = (char *) malloc (len); 100 | if (new_domain != NULL) 101 | memcpy (new_domain, domainname, len); 102 | #endif 103 | 104 | if (new_domain != NULL) 105 | _nl_current_default_domain = new_domain; 106 | } 107 | 108 | /* We use this possibility to signal a change of the loaded catalogs 109 | since this is most likely the case and there is no other easy we 110 | to do it. Do it only when the call was successful. */ 111 | if (new_domain != NULL) 112 | { 113 | ++_nl_msg_cat_cntr; 114 | 115 | if (old_domain != new_domain && old_domain != _nl_default_default_domain) 116 | free (old_domain); 117 | } 118 | 119 | gl_rwlock_unlock (_nl_state_lock); 120 | 121 | return new_domain; 122 | } 123 | 124 | #ifdef _LIBC 125 | /* Alias for function name in GNU C Library. */ 126 | weak_alias (__textdomain, textdomain); 127 | #endif 128 | -------------------------------------------------------------------------------- /intl/tsearch.h: -------------------------------------------------------------------------------- 1 | /* Binary tree data structure. 2 | Copyright (C) 2006 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef _TSEARCH_H 20 | #define _TSEARCH_H 21 | 22 | #if HAVE_TSEARCH 23 | 24 | /* Get tseach(), tfind(), tdelete(), twalk() declarations. */ 25 | #include 26 | 27 | #else 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* See , 34 | 35 | for details. */ 36 | 37 | typedef enum 38 | { 39 | preorder, 40 | postorder, 41 | endorder, 42 | leaf 43 | } 44 | VISIT; 45 | 46 | /* Searches an element in the tree *VROOTP that compares equal to KEY. 47 | If one is found, it is returned. Otherwise, a new element equal to KEY 48 | is inserted in the tree and is returned. */ 49 | extern void * tsearch (const void *key, void **vrootp, 50 | int (*compar) (const void *, const void *)); 51 | 52 | /* Searches an element in the tree *VROOTP that compares equal to KEY. 53 | If one is found, it is returned. Otherwise, NULL is returned. */ 54 | extern void * tfind (const void *key, void *const *vrootp, 55 | int (*compar) (const void *, const void *)); 56 | 57 | /* Searches an element in the tree *VROOTP that compares equal to KEY. 58 | If one is found, it is removed from the tree, and its parent node is 59 | returned. Otherwise, NULL is returned. */ 60 | extern void * tdelete (const void *key, void **vrootp, 61 | int (*compar) (const void *, const void *)); 62 | 63 | /* Perform a depth-first, left-to-right traversal of the tree VROOT. 64 | The ACTION function is called: 65 | - for non-leaf nodes: 3 times, before the left subtree traversal, 66 | after the left subtree traversal but before the right subtree traversal, 67 | and after the right subtree traversal, 68 | - for leaf nodes: once. 69 | The arguments passed to ACTION are: 70 | 1. the node; it can be casted to a 'const void * const *', i.e. into a 71 | pointer to the key, 72 | 2. an indicator which visit of the node this is, 73 | 3. the level of the node in the tree (0 for the root). */ 74 | extern void twalk (const void *vroot, 75 | void (*action) (const void *, VISIT, int)); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif 82 | 83 | #endif /* _TSEARCH_H */ 84 | -------------------------------------------------------------------------------- /intl/vasnprintf.h: -------------------------------------------------------------------------------- 1 | /* vsprintf with automatic memory allocation. 2 | Copyright (C) 2002-2004 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef _VASNPRINTF_H 20 | #define _VASNPRINTF_H 21 | 22 | /* Get va_list. */ 23 | #include 24 | 25 | /* Get size_t. */ 26 | #include 27 | 28 | #ifndef __attribute__ 29 | /* This feature is available in gcc versions 2.5 and later. */ 30 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ 31 | # define __attribute__(Spec) /* empty */ 32 | # endif 33 | /* The __-protected variants of `format' and `printf' attributes 34 | are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ 35 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) 36 | # define __format__ format 37 | # define __printf__ printf 38 | # endif 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /* Write formatted output to a string dynamically allocated with malloc(). 46 | You can pass a preallocated buffer for the result in RESULTBUF and its 47 | size in *LENGTHP; otherwise you pass RESULTBUF = NULL. 48 | If successful, return the address of the string (this may be = RESULTBUF 49 | if no dynamic memory allocation was necessary) and set *LENGTHP to the 50 | number of resulting bytes, excluding the trailing NUL. Upon error, set 51 | errno and return NULL. 52 | 53 | When dynamic memory allocation occurs, the preallocated buffer is left 54 | alone (with possibly modified contents). This makes it possible to use 55 | a statically allocated or stack-allocated buffer, like this: 56 | 57 | char buf[100]; 58 | size_t len = sizeof (buf); 59 | char *output = vasnprintf (buf, &len, format, args); 60 | if (output == NULL) 61 | ... error handling ...; 62 | else 63 | { 64 | ... use the output string ...; 65 | if (output != buf) 66 | free (output); 67 | } 68 | */ 69 | extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) 70 | __attribute__ ((__format__ (__printf__, 3, 4))); 71 | extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) 72 | __attribute__ ((__format__ (__printf__, 3, 0))); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* _VASNPRINTF_H */ 79 | -------------------------------------------------------------------------------- /intl/vasnwprintf.h: -------------------------------------------------------------------------------- 1 | /* vswprintf with automatic memory allocation. 2 | Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef _VASNWPRINTF_H 20 | #define _VASNWPRINTF_H 21 | 22 | /* Get va_list. */ 23 | #include 24 | 25 | /* Get wchar_t, size_t. */ 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* Write formatted output to a string dynamically allocated with malloc(). 33 | You can pass a preallocated buffer for the result in RESULTBUF and its 34 | size in *LENGTHP; otherwise you pass RESULTBUF = NULL. 35 | If successful, return the address of the string (this may be = RESULTBUF 36 | if no dynamic memory allocation was necessary) and set *LENGTHP to the 37 | number of resulting bytes, excluding the trailing NUL. Upon error, set 38 | errno and return NULL. */ 39 | extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...); 40 | extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _VASNWPRINTF_H */ 47 | -------------------------------------------------------------------------------- /intl/version.c: -------------------------------------------------------------------------------- 1 | /* libintl library version. 2 | Copyright (C) 2005 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "libgnuintl.h" 24 | 25 | /* Version number: (major<<16) + (minor<<8) + subminor */ 26 | int libintl_version = LIBINTL_VERSION; 27 | -------------------------------------------------------------------------------- /intl/wprintf-parse.h: -------------------------------------------------------------------------------- 1 | /* Parse printf format string. 2 | Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifndef _WPRINTF_PARSE_H 20 | #define _WPRINTF_PARSE_H 21 | 22 | #include "printf-args.h" 23 | 24 | 25 | /* Flags */ 26 | #define FLAG_GROUP 1 /* ' flag */ 27 | #define FLAG_LEFT 2 /* - flag */ 28 | #define FLAG_SHOWSIGN 4 /* + flag */ 29 | #define FLAG_SPACE 8 /* space flag */ 30 | #define FLAG_ALT 16 /* # flag */ 31 | #define FLAG_ZERO 32 32 | 33 | /* arg_index value indicating that no argument is consumed. */ 34 | #define ARG_NONE (~(size_t)0) 35 | 36 | /* A parsed directive. */ 37 | typedef struct 38 | { 39 | const wchar_t* dir_start; 40 | const wchar_t* dir_end; 41 | int flags; 42 | const wchar_t* width_start; 43 | const wchar_t* width_end; 44 | size_t width_arg_index; 45 | const wchar_t* precision_start; 46 | const wchar_t* precision_end; 47 | size_t precision_arg_index; 48 | wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */ 49 | size_t arg_index; 50 | } 51 | wchar_t_directive; 52 | 53 | /* A parsed format string. */ 54 | typedef struct 55 | { 56 | size_t count; 57 | wchar_t_directive *dir; 58 | size_t max_width_length; 59 | size_t max_precision_length; 60 | } 61 | wchar_t_directives; 62 | 63 | 64 | /* Parses the format string. Fills in the number N of directives, and fills 65 | in directives[0], ..., directives[N-1], and sets directives[N].dir_start 66 | to the end of the format string. Also fills in the arg_type fields of the 67 | arguments and the needed count of arguments. */ 68 | #ifdef STATIC 69 | STATIC 70 | #else 71 | extern 72 | #endif 73 | int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a); 74 | 75 | #endif /* _WPRINTF_PARSE_H */ 76 | -------------------------------------------------------------------------------- /intl/xsize.h: -------------------------------------------------------------------------------- 1 | /* xsize.h -- Checked size_t computations. 2 | 3 | Copyright (C) 2003 Free Software Foundation, Inc. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | #ifndef _XSIZE_H 21 | #define _XSIZE_H 22 | 23 | /* Get size_t. */ 24 | #include 25 | 26 | /* Get SIZE_MAX. */ 27 | #include 28 | #if HAVE_STDINT_H 29 | # include 30 | #endif 31 | 32 | /* The size of memory objects is often computed through expressions of 33 | type size_t. Example: 34 | void* p = malloc (header_size + n * element_size). 35 | These computations can lead to overflow. When this happens, malloc() 36 | returns a piece of memory that is way too small, and the program then 37 | crashes while attempting to fill the memory. 38 | To avoid this, the functions and macros in this file check for overflow. 39 | The convention is that SIZE_MAX represents overflow. 40 | malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc 41 | implementation that uses mmap --, it's recommended to use size_overflow_p() 42 | or size_in_bounds_p() before invoking malloc(). 43 | The example thus becomes: 44 | size_t size = xsum (header_size, xtimes (n, element_size)); 45 | void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); 46 | */ 47 | 48 | /* Convert an arbitrary value >= 0 to type size_t. */ 49 | #define xcast_size_t(N) \ 50 | ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) 51 | 52 | /* Sum of two sizes, with overflow check. */ 53 | static inline size_t 54 | #if __GNUC__ >= 3 55 | __attribute__ ((__pure__)) 56 | #endif 57 | xsum (size_t size1, size_t size2) 58 | { 59 | size_t sum = size1 + size2; 60 | return (sum >= size1 ? sum : SIZE_MAX); 61 | } 62 | 63 | /* Sum of three sizes, with overflow check. */ 64 | static inline size_t 65 | #if __GNUC__ >= 3 66 | __attribute__ ((__pure__)) 67 | #endif 68 | xsum3 (size_t size1, size_t size2, size_t size3) 69 | { 70 | return xsum (xsum (size1, size2), size3); 71 | } 72 | 73 | /* Sum of four sizes, with overflow check. */ 74 | static inline size_t 75 | #if __GNUC__ >= 3 76 | __attribute__ ((__pure__)) 77 | #endif 78 | xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) 79 | { 80 | return xsum (xsum (xsum (size1, size2), size3), size4); 81 | } 82 | 83 | /* Maximum of two sizes, with overflow check. */ 84 | static inline size_t 85 | #if __GNUC__ >= 3 86 | __attribute__ ((__pure__)) 87 | #endif 88 | xmax (size_t size1, size_t size2) 89 | { 90 | /* No explicit check is needed here, because for any n: 91 | max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ 92 | return (size1 >= size2 ? size1 : size2); 93 | } 94 | 95 | /* Multiplication of a count with an element size, with overflow check. 96 | The count must be >= 0 and the element size must be > 0. 97 | This is a macro, not an inline function, so that it works correctly even 98 | when N is of a wider tupe and N > SIZE_MAX. */ 99 | #define xtimes(N, ELSIZE) \ 100 | ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) 101 | 102 | /* Check for overflow. */ 103 | #define size_overflow_p(SIZE) \ 104 | ((SIZE) == SIZE_MAX) 105 | /* Check against overflow. */ 106 | #define size_in_bounds_p(SIZE) \ 107 | ((SIZE) != SIZE_MAX) 108 | 109 | #endif /* _XSIZE_H */ 110 | -------------------------------------------------------------------------------- /m4/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial 2 (gettext-0.16) 2 | dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([AM_LANGINFO_CODESET], 10 | [ 11 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 12 | [AC_TRY_LINK([#include ], 13 | [char* cs = nl_langinfo(CODESET); return !cs;], 14 | am_cv_langinfo_codeset=yes, 15 | am_cv_langinfo_codeset=no) 16 | ]) 17 | if test $am_cv_langinfo_codeset = yes; then 18 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 19 | [Define if you have and nl_langinfo(CODESET).]) 20 | fi 21 | ]) 22 | -------------------------------------------------------------------------------- /m4/glibc2.m4: -------------------------------------------------------------------------------- 1 | # glibc2.m4 serial 1 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.0 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gt_GLIBC2], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, 13 | ac_cv_gnu_library_2, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ >= 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2=yes, 24 | ac_cv_gnu_library_2=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC2) 28 | GLIBC2="$ac_cv_gnu_library_2" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /m4/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 3 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.1 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gl_GLIBC21], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 13 | ac_cv_gnu_library_2_1, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2_1=yes, 24 | ac_cv_gnu_library_2_1=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC21) 28 | GLIBC21="$ac_cv_gnu_library_2_1" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /m4/intdiv0.m4: -------------------------------------------------------------------------------- 1 | # intdiv0.m4 serial 2 (gettext-0.17) 2 | dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([gt_INTDIV0], 10 | [ 11 | AC_REQUIRE([AC_PROG_CC])dnl 12 | AC_REQUIRE([AC_CANONICAL_HOST])dnl 13 | 14 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], 15 | gt_cv_int_divbyzero_sigfpe, 16 | [ 17 | gt_cv_int_divbyzero_sigfpe= 18 | changequote(,)dnl 19 | case "$host_os" in 20 | macos* | darwin[6-9]* | darwin[1-9][0-9]*) 21 | # On MacOS X 10.2 or newer, just assume the same as when cross- 22 | # compiling. If we were to perform the real test, 1 Crash Report 23 | # dialog window would pop up. 24 | case "$host_cpu" in 25 | i[34567]86 | x86_64) 26 | gt_cv_int_divbyzero_sigfpe="guessing yes" ;; 27 | esac 28 | ;; 29 | esac 30 | changequote([,])dnl 31 | if test -z "$gt_cv_int_divbyzero_sigfpe"; then 32 | AC_TRY_RUN([ 33 | #include 34 | #include 35 | 36 | static void 37 | sigfpe_handler (int sig) 38 | { 39 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ 40 | exit (sig != SIGFPE); 41 | } 42 | 43 | int x = 1; 44 | int y = 0; 45 | int z; 46 | int nan; 47 | 48 | int main () 49 | { 50 | signal (SIGFPE, sigfpe_handler); 51 | /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ 52 | #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) 53 | signal (SIGTRAP, sigfpe_handler); 54 | #endif 55 | /* Linux/SPARC yields signal SIGILL. */ 56 | #if defined (__sparc__) && defined (__linux__) 57 | signal (SIGILL, sigfpe_handler); 58 | #endif 59 | 60 | z = x / y; 61 | nan = y / y; 62 | exit (1); 63 | } 64 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, 65 | [ 66 | # Guess based on the CPU. 67 | changequote(,)dnl 68 | case "$host_cpu" in 69 | alpha* | i[34567]86 | x86_64 | m68k | s390*) 70 | gt_cv_int_divbyzero_sigfpe="guessing yes";; 71 | *) 72 | gt_cv_int_divbyzero_sigfpe="guessing no";; 73 | esac 74 | changequote([,])dnl 75 | ]) 76 | fi 77 | ]) 78 | case "$gt_cv_int_divbyzero_sigfpe" in 79 | *yes) value=1;; 80 | *) value=0;; 81 | esac 82 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, 83 | [Define if integer division by zero raises signal SIGFPE.]) 84 | ]) 85 | -------------------------------------------------------------------------------- /m4/intldir.m4: -------------------------------------------------------------------------------- 1 | # intldir.m4 serial 1 (gettext-0.16) 2 | dnl Copyright (C) 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | AC_PREREQ(2.52) 17 | 18 | dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. 19 | AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) 20 | -------------------------------------------------------------------------------- /m4/intlmacosx.m4: -------------------------------------------------------------------------------- 1 | # intlmacosx.m4 serial 1 (gettext-0.17) 2 | dnl Copyright (C) 2004-2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Checks for special options needed on MacOS X. 17 | dnl Defines INTL_MACOSX_LIBS. 18 | AC_DEFUN([gt_INTL_MACOSX], 19 | [ 20 | dnl Check for API introduced in MacOS X 10.2. 21 | AC_CACHE_CHECK([for CFPreferencesCopyAppValue], 22 | gt_cv_func_CFPreferencesCopyAppValue, 23 | [gt_save_LIBS="$LIBS" 24 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 25 | AC_TRY_LINK([#include ], 26 | [CFPreferencesCopyAppValue(NULL, NULL)], 27 | [gt_cv_func_CFPreferencesCopyAppValue=yes], 28 | [gt_cv_func_CFPreferencesCopyAppValue=no]) 29 | LIBS="$gt_save_LIBS"]) 30 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then 31 | AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, 32 | [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) 33 | fi 34 | dnl Check for API introduced in MacOS X 10.3. 35 | AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, 36 | [gt_save_LIBS="$LIBS" 37 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 38 | AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], 39 | [gt_cv_func_CFLocaleCopyCurrent=yes], 40 | [gt_cv_func_CFLocaleCopyCurrent=no]) 41 | LIBS="$gt_save_LIBS"]) 42 | if test $gt_cv_func_CFLocaleCopyCurrent = yes; then 43 | AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, 44 | [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) 45 | fi 46 | INTL_MACOSX_LIBS= 47 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then 48 | INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" 49 | fi 50 | AC_SUBST([INTL_MACOSX_LIBS]) 51 | ]) 52 | -------------------------------------------------------------------------------- /m4/intmax.m4: -------------------------------------------------------------------------------- 1 | # intmax.m4 serial 3 (gettext-0.16) 2 | dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the system has the 'intmax_t' type, but don't attempt to 9 | dnl find a replacement if it is lacking. 10 | 11 | AC_DEFUN([gt_TYPE_INTMAX_T], 12 | [ 13 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 14 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 15 | AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, 16 | [AC_TRY_COMPILE([ 17 | #include 18 | #include 19 | #if HAVE_STDINT_H_WITH_UINTMAX 20 | #include 21 | #endif 22 | #if HAVE_INTTYPES_H_WITH_UINTMAX 23 | #include 24 | #endif 25 | ], [intmax_t x = -1; 26 | return !x;], 27 | gt_cv_c_intmax_t=yes, 28 | gt_cv_c_intmax_t=no)]) 29 | if test $gt_cv_c_intmax_t = yes; then 30 | AC_DEFINE(HAVE_INTMAX_T, 1, 31 | [Define if you have the 'intmax_t' type in or .]) 32 | fi 33 | ]) 34 | -------------------------------------------------------------------------------- /m4/inttypes-pri.m4: -------------------------------------------------------------------------------- 1 | # inttypes-pri.m4 serial 4 (gettext-0.16) 2 | dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_PREREQ(2.52) 10 | 11 | # Define PRI_MACROS_BROKEN if exists and defines the PRI* 12 | # macros to non-string values. This is the case on AIX 4.3.3. 13 | 14 | AC_DEFUN([gt_INTTYPES_PRI], 15 | [ 16 | AC_CHECK_HEADERS([inttypes.h]) 17 | if test $ac_cv_header_inttypes_h = yes; then 18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], 19 | gt_cv_inttypes_pri_broken, 20 | [ 21 | AC_TRY_COMPILE([#include 22 | #ifdef PRId32 23 | char *p = PRId32; 24 | #endif 25 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) 26 | ]) 27 | fi 28 | if test "$gt_cv_inttypes_pri_broken" = yes; then 29 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, 30 | [Define if exists and defines unusable PRI* macros.]) 31 | PRI_MACROS_BROKEN=1 32 | else 33 | PRI_MACROS_BROKEN=0 34 | fi 35 | AC_SUBST([PRI_MACROS_BROKEN]) 36 | ]) 37 | -------------------------------------------------------------------------------- /m4/inttypes_h.m4: -------------------------------------------------------------------------------- 1 | # inttypes_h.m4 serial 7 2 | dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | gl_cv_header_inttypes_h=yes, 20 | gl_cv_header_inttypes_h=no)]) 21 | if test $gl_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /m4/lcmessage.m4: -------------------------------------------------------------------------------- 1 | # lcmessage.m4 serial 4 (gettext-0.14.2) 2 | dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1995. 18 | 19 | # Check whether LC_MESSAGES is available in . 20 | 21 | AC_DEFUN([gt_LC_MESSAGES], 22 | [ 23 | AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, 24 | [AC_TRY_LINK([#include ], [return LC_MESSAGES], 25 | gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) 26 | if test $gt_cv_val_LC_MESSAGES = yes; then 27 | AC_DEFINE(HAVE_LC_MESSAGES, 1, 28 | [Define if your file defines LC_MESSAGES.]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/lib-ld.m4: -------------------------------------------------------------------------------- 1 | # lib-ld.m4 serial 3 (gettext-0.13) 2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl Subroutines of libtool.m4, 8 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision 9 | dnl with libtool.m4. 10 | 11 | dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. 12 | AC_DEFUN([AC_LIB_PROG_LD_GNU], 13 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, 14 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. 15 | case `$LD -v 2>&1 conf$$.sh 35 | echo "exit 0" >>conf$$.sh 36 | chmod +x conf$$.sh 37 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 38 | PATH_SEPARATOR=';' 39 | else 40 | PATH_SEPARATOR=: 41 | fi 42 | rm -f conf$$.sh 43 | fi 44 | ac_prog=ld 45 | if test "$GCC" = yes; then 46 | # Check if gcc -print-prog-name=ld gives a path. 47 | AC_MSG_CHECKING([for ld used by GCC]) 48 | case $host in 49 | *-*-mingw*) 50 | # gcc leaves a trailing carriage return which upsets mingw 51 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 52 | *) 53 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 54 | esac 55 | case $ac_prog in 56 | # Accept absolute paths. 57 | [[\\/]* | [A-Za-z]:[\\/]*)] 58 | [re_direlt='/[^/][^/]*/\.\./'] 59 | # Canonicalize the path of ld 60 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` 61 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do 62 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` 63 | done 64 | test -z "$LD" && LD="$ac_prog" 65 | ;; 66 | "") 67 | # If it fails, then pretend we aren't using GCC. 68 | ac_prog=ld 69 | ;; 70 | *) 71 | # If it is relative, then search for the first ld in PATH. 72 | with_gnu_ld=unknown 73 | ;; 74 | esac 75 | elif test "$with_gnu_ld" = yes; then 76 | AC_MSG_CHECKING([for GNU ld]) 77 | else 78 | AC_MSG_CHECKING([for non-GNU ld]) 79 | fi 80 | AC_CACHE_VAL(acl_cv_path_LD, 81 | [if test -z "$LD"; then 82 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" 83 | for ac_dir in $PATH; do 84 | test -z "$ac_dir" && ac_dir=. 85 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 86 | acl_cv_path_LD="$ac_dir/$ac_prog" 87 | # Check to see if the program is GNU ld. I'd rather use --version, 88 | # but apparently some GNU ld's only accept -v. 89 | # Break only if it was the GNU/non-GNU ld that we prefer. 90 | case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in 91 | *GNU* | *'with BFD'*) 92 | test "$with_gnu_ld" != no && break ;; 93 | *) 94 | test "$with_gnu_ld" != yes && break ;; 95 | esac 96 | fi 97 | done 98 | IFS="$ac_save_ifs" 99 | else 100 | acl_cv_path_LD="$LD" # Let the user override the test with a path. 101 | fi]) 102 | LD="$acl_cv_path_LD" 103 | if test -n "$LD"; then 104 | AC_MSG_RESULT($LD) 105 | else 106 | AC_MSG_RESULT(no) 107 | fi 108 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 109 | AC_LIB_PROG_LD_GNU 110 | ]) 111 | -------------------------------------------------------------------------------- /m4/longlong.m4: -------------------------------------------------------------------------------- 1 | # longlong.m4 serial 13 2 | dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_LONG_LONG_INT if 'long long int' works. 10 | # This fixes a bug in Autoconf 2.61, but can be removed once we 11 | # assume 2.62 everywhere. 12 | 13 | # Note: If the type 'long long int' exists but is only 32 bits large 14 | # (as on some very old compilers), HAVE_LONG_LONG_INT will not be 15 | # defined. In this case you can treat 'long long int' like 'long int'. 16 | 17 | AC_DEFUN([AC_TYPE_LONG_LONG_INT], 18 | [ 19 | AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], 20 | [AC_LINK_IFELSE( 21 | [_AC_TYPE_LONG_LONG_SNIPPET], 22 | [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. 23 | dnl If cross compiling, assume the bug isn't important, since 24 | dnl nobody cross compiles for this platform as far as we know. 25 | AC_RUN_IFELSE( 26 | [AC_LANG_PROGRAM( 27 | [[@%:@include 28 | @%:@ifndef LLONG_MAX 29 | @%:@ define HALF \ 30 | (1LL << (sizeof (long long int) * CHAR_BIT - 2)) 31 | @%:@ define LLONG_MAX (HALF - 1 + HALF) 32 | @%:@endif]], 33 | [[long long int n = 1; 34 | int i; 35 | for (i = 0; ; i++) 36 | { 37 | long long int m = n << i; 38 | if (m >> i != n) 39 | return 1; 40 | if (LLONG_MAX / 2 < m) 41 | break; 42 | } 43 | return 0;]])], 44 | [ac_cv_type_long_long_int=yes], 45 | [ac_cv_type_long_long_int=no], 46 | [ac_cv_type_long_long_int=yes])], 47 | [ac_cv_type_long_long_int=no])]) 48 | if test $ac_cv_type_long_long_int = yes; then 49 | AC_DEFINE([HAVE_LONG_LONG_INT], 1, 50 | [Define to 1 if the system has the type `long long int'.]) 51 | fi 52 | ]) 53 | 54 | # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. 55 | # This fixes a bug in Autoconf 2.61, but can be removed once we 56 | # assume 2.62 everywhere. 57 | 58 | # Note: If the type 'unsigned long long int' exists but is only 32 bits 59 | # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT 60 | # will not be defined. In this case you can treat 'unsigned long long int' 61 | # like 'unsigned long int'. 62 | 63 | AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], 64 | [ 65 | AC_CACHE_CHECK([for unsigned long long int], 66 | [ac_cv_type_unsigned_long_long_int], 67 | [AC_LINK_IFELSE( 68 | [_AC_TYPE_LONG_LONG_SNIPPET], 69 | [ac_cv_type_unsigned_long_long_int=yes], 70 | [ac_cv_type_unsigned_long_long_int=no])]) 71 | if test $ac_cv_type_unsigned_long_long_int = yes; then 72 | AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, 73 | [Define to 1 if the system has the type `unsigned long long int'.]) 74 | fi 75 | ]) 76 | 77 | # Expands to a C program that can be used to test for simultaneous support 78 | # of 'long long' and 'unsigned long long'. We don't want to say that 79 | # 'long long' is available if 'unsigned long long' is not, or vice versa, 80 | # because too many programs rely on the symmetry between signed and unsigned 81 | # integer types (excluding 'bool'). 82 | AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], 83 | [ 84 | AC_LANG_PROGRAM( 85 | [[/* Test preprocessor. */ 86 | #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) 87 | error in preprocessor; 88 | #endif 89 | #if ! (18446744073709551615ULL <= -1ull) 90 | error in preprocessor; 91 | #endif 92 | /* Test literals. */ 93 | long long int ll = 9223372036854775807ll; 94 | long long int nll = -9223372036854775807LL; 95 | unsigned long long int ull = 18446744073709551615ULL; 96 | /* Test constant expressions. */ 97 | typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) 98 | ? 1 : -1)]; 99 | typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 100 | ? 1 : -1)]; 101 | int i = 63;]], 102 | [[/* Test availability of runtime routines for shift and division. */ 103 | long long int llmax = 9223372036854775807ll; 104 | unsigned long long int ullmax = 18446744073709551615ull; 105 | return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) 106 | | (llmax / ll) | (llmax % ll) 107 | | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) 108 | | (ullmax / ull) | (ullmax % ull));]]) 109 | ]) 110 | -------------------------------------------------------------------------------- /m4/nls.m4: -------------------------------------------------------------------------------- 1 | # nls.m4 serial 3 (gettext-0.15) 2 | dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1995-2000. 18 | dnl Bruno Haible , 2000-2003. 19 | 20 | AC_PREREQ(2.50) 21 | 22 | AC_DEFUN([AM_NLS], 23 | [ 24 | AC_MSG_CHECKING([whether NLS is requested]) 25 | dnl Default is enabled NLS 26 | AC_ARG_ENABLE(nls, 27 | [ --disable-nls do not use Native Language Support], 28 | USE_NLS=$enableval, USE_NLS=yes) 29 | AC_MSG_RESULT($USE_NLS) 30 | AC_SUBST(USE_NLS) 31 | ]) 32 | -------------------------------------------------------------------------------- /m4/printf-posix.m4: -------------------------------------------------------------------------------- 1 | # printf-posix.m4 serial 3 (gettext-0.17) 2 | dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the printf() function supports POSIX/XSI format strings with 9 | dnl positions. 10 | 11 | AC_DEFUN([gt_PRINTF_POSIX], 12 | [ 13 | AC_REQUIRE([AC_PROG_CC]) 14 | AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], 15 | gt_cv_func_printf_posix, 16 | [ 17 | AC_TRY_RUN([ 18 | #include 19 | #include 20 | /* The string "%2$d %1$d", with dollar characters protected from the shell's 21 | dollar expansion (possibly an autoconf bug). */ 22 | static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; 23 | static char buf[100]; 24 | int main () 25 | { 26 | sprintf (buf, format, 33, 55); 27 | return (strcmp (buf, "55 33") != 0); 28 | }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, 29 | [ 30 | AC_EGREP_CPP(notposix, [ 31 | #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ 32 | notposix 33 | #endif 34 | ], gt_cv_func_printf_posix="guessing no", 35 | gt_cv_func_printf_posix="guessing yes") 36 | ]) 37 | ]) 38 | case $gt_cv_func_printf_posix in 39 | *yes) 40 | AC_DEFINE(HAVE_POSIX_PRINTF, 1, 41 | [Define if your printf() function supports format strings with positions.]) 42 | ;; 43 | esac 44 | ]) 45 | -------------------------------------------------------------------------------- /m4/progtest.m4: -------------------------------------------------------------------------------- 1 | # progtest.m4 serial 4 (gettext-0.14.2) 2 | dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1996. 18 | 19 | AC_PREREQ(2.50) 20 | 21 | # Search path for a program which passes the given test. 22 | 23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, 24 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) 25 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], 26 | [ 27 | # Prepare PATH_SEPARATOR. 28 | # The user is always right. 29 | if test "${PATH_SEPARATOR+set}" != set; then 30 | echo "#! /bin/sh" >conf$$.sh 31 | echo "exit 0" >>conf$$.sh 32 | chmod +x conf$$.sh 33 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 34 | PATH_SEPARATOR=';' 35 | else 36 | PATH_SEPARATOR=: 37 | fi 38 | rm -f conf$$.sh 39 | fi 40 | 41 | # Find out how to test for executable files. Don't use a zero-byte file, 42 | # as systems may use methods other than mode bits to determine executability. 43 | cat >conf$$.file <<_ASEOF 44 | #! /bin/sh 45 | exit 0 46 | _ASEOF 47 | chmod +x conf$$.file 48 | if test -x conf$$.file >/dev/null 2>&1; then 49 | ac_executable_p="test -x" 50 | else 51 | ac_executable_p="test -f" 52 | fi 53 | rm -f conf$$.file 54 | 55 | # Extract the first word of "$2", so it can be a program name with args. 56 | set dummy $2; ac_word=[$]2 57 | AC_MSG_CHECKING([for $ac_word]) 58 | AC_CACHE_VAL(ac_cv_path_$1, 59 | [case "[$]$1" in 60 | [[\\/]]* | ?:[[\\/]]*) 61 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 62 | ;; 63 | *) 64 | ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR 65 | for ac_dir in ifelse([$5], , $PATH, [$5]); do 66 | IFS="$ac_save_IFS" 67 | test -z "$ac_dir" && ac_dir=. 68 | for ac_exec_ext in '' $ac_executable_extensions; do 69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 70 | echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD 71 | if [$3]; then 72 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" 73 | break 2 74 | fi 75 | fi 76 | done 77 | done 78 | IFS="$ac_save_IFS" 79 | dnl If no 4th arg is given, leave the cache variable unset, 80 | dnl so AC_PATH_PROGS will keep looking. 81 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" 82 | ])dnl 83 | ;; 84 | esac])dnl 85 | $1="$ac_cv_path_$1" 86 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 87 | AC_MSG_RESULT([$]$1) 88 | else 89 | AC_MSG_RESULT(no) 90 | fi 91 | AC_SUBST($1)dnl 92 | ]) 93 | -------------------------------------------------------------------------------- /m4/size_max.m4: -------------------------------------------------------------------------------- 1 | # size_max.m4 serial 6 2 | dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([gl_SIZE_MAX], 10 | [ 11 | AC_CHECK_HEADERS(stdint.h) 12 | dnl First test whether the system already has SIZE_MAX. 13 | AC_MSG_CHECKING([for SIZE_MAX]) 14 | AC_CACHE_VAL([gl_cv_size_max], [ 15 | gl_cv_size_max= 16 | AC_EGREP_CPP([Found it], [ 17 | #include 18 | #if HAVE_STDINT_H 19 | #include 20 | #endif 21 | #ifdef SIZE_MAX 22 | Found it 23 | #endif 24 | ], gl_cv_size_max=yes) 25 | if test -z "$gl_cv_size_max"; then 26 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider 27 | dnl than the type 'unsigned long'. Try hard to find a definition that can 28 | dnl be used in a preprocessor #if, i.e. doesn't contain a cast. 29 | AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], 30 | [#include 31 | #include ], size_t_bits_minus_1=) 32 | AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], 33 | [#include ], fits_in_uint=) 34 | if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then 35 | if test $fits_in_uint = 1; then 36 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type 37 | dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. 38 | AC_TRY_COMPILE([#include 39 | extern size_t foo; 40 | extern unsigned long foo; 41 | ], [], fits_in_uint=0) 42 | fi 43 | dnl We cannot use 'expr' to simplify this expression, because 'expr' 44 | dnl works only with 'long' integers in the host environment, while we 45 | dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. 46 | if test $fits_in_uint = 1; then 47 | gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" 48 | else 49 | gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" 50 | fi 51 | else 52 | dnl Shouldn't happen, but who knows... 53 | gl_cv_size_max='((size_t)~(size_t)0)' 54 | fi 55 | fi 56 | ]) 57 | AC_MSG_RESULT([$gl_cv_size_max]) 58 | if test "$gl_cv_size_max" != yes; then 59 | AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], 60 | [Define as the maximum value of type 'size_t', if the system doesn't define it.]) 61 | fi 62 | ]) 63 | 64 | dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. 65 | dnl Remove this when we can assume autoconf >= 2.61. 66 | m4_ifdef([AC_COMPUTE_INT], [], [ 67 | AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) 68 | ]) 69 | -------------------------------------------------------------------------------- /m4/stdint_h.m4: -------------------------------------------------------------------------------- 1 | # stdint_h.m4 serial 6 2 | dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_STDINT_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_STDINT_H], 13 | [ 14 | AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | gl_cv_header_stdint_h=yes, 20 | gl_cv_header_stdint_h=no)]) 21 | if test $gl_cv_header_stdint_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /m4/uintmax_t.m4: -------------------------------------------------------------------------------- 1 | # uintmax_t.m4 serial 10 2 | dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | AC_PREREQ(2.13) 10 | 11 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' 12 | # if it is not already defined in or . 13 | 14 | AC_DEFUN([gl_AC_TYPE_UINTMAX_T], 15 | [ 16 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 17 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 18 | if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then 19 | AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) 20 | test $ac_cv_type_unsigned_long_long_int = yes \ 21 | && ac_type='unsigned long long' \ 22 | || ac_type='unsigned long' 23 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, 24 | [Define to unsigned long or unsigned long long 25 | if and don't define.]) 26 | else 27 | AC_DEFINE(HAVE_UINTMAX_T, 1, 28 | [Define if you have the 'uintmax_t' type in or .]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/visibility.m4: -------------------------------------------------------------------------------- 1 | # visibility.m4 serial 1 (gettext-0.15) 2 | dnl Copyright (C) 2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | dnl Tests whether the compiler supports the command-line option 10 | dnl -fvisibility=hidden and the function and variable attributes 11 | dnl __attribute__((__visibility__("hidden"))) and 12 | dnl __attribute__((__visibility__("default"))). 13 | dnl Does *not* test for __visibility__("protected") - which has tricky 14 | dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on 15 | dnl MacOS X. 16 | dnl Does *not* test for __visibility__("internal") - which has processor 17 | dnl dependent semantics. 18 | dnl Does *not* test for #pragma GCC visibility push(hidden) - which is 19 | dnl "really only recommended for legacy code". 20 | dnl Set the variable CFLAG_VISIBILITY. 21 | dnl Defines and sets the variable HAVE_VISIBILITY. 22 | 23 | AC_DEFUN([gl_VISIBILITY], 24 | [ 25 | AC_REQUIRE([AC_PROG_CC]) 26 | CFLAG_VISIBILITY= 27 | HAVE_VISIBILITY=0 28 | if test -n "$GCC"; then 29 | AC_MSG_CHECKING([for simple visibility declarations]) 30 | AC_CACHE_VAL(gl_cv_cc_visibility, [ 31 | gl_save_CFLAGS="$CFLAGS" 32 | CFLAGS="$CFLAGS -fvisibility=hidden" 33 | AC_TRY_COMPILE( 34 | [extern __attribute__((__visibility__("hidden"))) int hiddenvar; 35 | extern __attribute__((__visibility__("default"))) int exportedvar; 36 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); 37 | extern __attribute__((__visibility__("default"))) int exportedfunc (void);], 38 | [], 39 | gl_cv_cc_visibility=yes, 40 | gl_cv_cc_visibility=no) 41 | CFLAGS="$gl_save_CFLAGS"]) 42 | AC_MSG_RESULT([$gl_cv_cc_visibility]) 43 | if test $gl_cv_cc_visibility = yes; then 44 | CFLAG_VISIBILITY="-fvisibility=hidden" 45 | HAVE_VISIBILITY=1 46 | fi 47 | fi 48 | AC_SUBST([CFLAG_VISIBILITY]) 49 | AC_SUBST([HAVE_VISIBILITY]) 50 | AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], 51 | [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) 52 | ]) 53 | -------------------------------------------------------------------------------- /m4/wchar_t.m4: -------------------------------------------------------------------------------- 1 | # wchar_t.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wchar_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WCHAR_T], 12 | [ 13 | AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, 14 | [AC_TRY_COMPILE([#include 15 | wchar_t foo = (wchar_t)'\0';], , 16 | gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) 17 | if test $gt_cv_c_wchar_t = yes; then 18 | AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /m4/wint_t.m4: -------------------------------------------------------------------------------- 1 | # wint_t.m4 serial 2 (gettext-0.17) 2 | dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wint_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WINT_T], 12 | [ 13 | AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, 14 | [AC_TRY_COMPILE([ 15 | /* Tru64 with Desktop Toolkit C has a bug: must be included before 16 | . 17 | BSD/OS 4.0.1 has a bug: , and must be included 18 | before . */ 19 | #include 20 | #include 21 | #include 22 | #include 23 | wint_t foo = (wchar_t)'\0';], , 24 | gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) 25 | if test $gt_cv_c_wint_t = yes; then 26 | AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /m4/xsize.m4: -------------------------------------------------------------------------------- 1 | # xsize.m4 serial 3 2 | dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | AC_DEFUN([gl_XSIZE], 8 | [ 9 | dnl Prerequisites of lib/xsize.h. 10 | AC_REQUIRE([gl_SIZE_MAX]) 11 | AC_REQUIRE([AC_C_INLINE]) 12 | AC_CHECK_HEADERS(stdint.h) 13 | ]) 14 | -------------------------------------------------------------------------------- /man/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = alltray.1 2 | EXTRA_DIST = $(man_MANS) 3 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | de en_US en_GB es it pl 2 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=ngettext:1,2 \ 12 | --from-code=UTF-8 -L C\# 13 | 14 | # This is the copyright holder that gets inserted into the header of the 15 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 16 | # package. (Note that the msgstr strings, extracted from the package's 17 | # sources, belong to the copyright holder of the package.) Translators are 18 | # expected to transfer the copyright for their translations to this person 19 | # or entity, or to disclaim their copyright. The empty string stands for 20 | # the public domain; in this case the translators are expected to disclaim 21 | # their copyright. 22 | COPYRIGHT_HOLDER = Michael B. Trausch 23 | 24 | # This is the email address or URL to which the translators shall report 25 | # bugs in the untranslated strings: 26 | # - Strings which are not entire sentences, see the maintainer guidelines 27 | # in the GNU gettext documentation, section 'Preparing Strings'. 28 | # - Strings which use unclear terms or require additional context to be 29 | # understood. 30 | # - Strings which make invalid assumptions about notation of date, time or 31 | # money. 32 | # - Pluralisation problems. 33 | # - Incorrect English spelling. 34 | # - Incorrect formatting. 35 | # It can be your email address, or a mailing list address where translators 36 | # can write to without being subscribed, or the URL of a web page through 37 | # which the translators can contact you. 38 | MSGID_BUGS_ADDRESS = https://launchpad.net/alltray/+filebug 39 | 40 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 41 | # message catalogs shall be used. It is usually empty. 42 | EXTRA_LOCALE_CATEGORIES = 43 | -------------------------------------------------------------------------------- /po/Makevars.template: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Free Software Foundation, Inc. 22 | 23 | # This is the email address or URL to which the translators shall report 24 | # bugs in the untranslated strings: 25 | # - Strings which are not entire sentences, see the maintainer guidelines 26 | # in the GNU gettext documentation, section 'Preparing Strings'. 27 | # - Strings which use unclear terms or require additional context to be 28 | # understood. 29 | # - Strings which make invalid assumptions about notation of date, time or 30 | # money. 31 | # - Pluralisation problems. 32 | # - Incorrect English spelling. 33 | # - Incorrect formatting. 34 | # It can be your email address, or a mailing list address where translators 35 | # can write to without being subscribed, or the URL of a web page through 36 | # which the translators can contact you. 37 | MSGID_BUGS_ADDRESS = 38 | 39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 40 | # message catalogs shall be used. It is usually empty. 41 | EXTRA_LOCALE_CATEGORIES = 42 | -------------------------------------------------------------------------------- /po/POTFILES: -------------------------------------------------------------------------------- 1 | ../src/AllTray.vala \ 2 | ../src/Application.vala \ 3 | ../src/AttachHelper.vala \ 4 | ../src/Debug.vala \ 5 | ../src/Process.vala \ 6 | ../src/PromptDialog.vala 7 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files which contain translatable strings. 2 | 3 | src/AllTray.vala 4 | src/Application.vala 5 | src/AttachHelper.vala 6 | src/Debug.vala 7 | src/Process.vala 8 | src/PromptDialog.vala 9 | -------------------------------------------------------------------------------- /po/Rules-quot: -------------------------------------------------------------------------------- 1 | # Special Makefile rules for English message catalogs with quotation marks. 2 | 3 | DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot 4 | 5 | .SUFFIXES: .insert-header .po-update-en 6 | 7 | en@quot.po-create: 8 | $(MAKE) en@quot.po-update 9 | en@boldquot.po-create: 10 | $(MAKE) en@boldquot.po-update 11 | 12 | en@quot.po-update: en@quot.po-update-en 13 | en@boldquot.po-update: en@boldquot.po-update-en 14 | 15 | .insert-header.po-update-en: 16 | @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 17 | if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 18 | tmpdir=`pwd`; \ 19 | echo "$$lang:"; \ 20 | ll=`echo $$lang | sed -e 's/@.*//'`; \ 21 | LC_ALL=C; export LC_ALL; \ 22 | cd $(srcdir); \ 23 | if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ 24 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 25 | rm -f $$tmpdir/$$lang.new.po; \ 26 | else \ 27 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 28 | :; \ 29 | else \ 30 | echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 31 | exit 1; \ 32 | fi; \ 33 | fi; \ 34 | else \ 35 | echo "creation of $$lang.po failed!" 1>&2; \ 36 | rm -f $$tmpdir/$$lang.new.po; \ 37 | fi 38 | 39 | en@quot.insert-header: insert-header.sin 40 | sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header 41 | 42 | en@boldquot.insert-header: insert-header.sin 43 | sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header 44 | 45 | mostlyclean: mostlyclean-quot 46 | mostlyclean-quot: 47 | rm -f *.insert-header 48 | -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | # This catalog furthermore displays the text between the quotation marks in 24 | # bold face, assuming the VT100/XTerm escape sequences. 25 | # 26 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /src/About.vala: -------------------------------------------------------------------------------- 1 | /* -*- mode: vala; c-basic-offset: 2; tab-width: 8; -*- 2 | * About.vala - AllTray about dialog 3 | * Copyright (c) 2011 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | using GLib; 7 | using Gtk; 8 | 9 | namespace AllTray { 10 | public class AboutDialog : Gtk.AboutDialog { 11 | public AboutDialog() { 12 | this.program_name = "AllTray"; 13 | 14 | this.version = Build.PACKAGE_VERSION; 15 | 16 | this.website = "http://alltray.trausch.us/"; 17 | this.copyright = 18 | _("Copyright © %s").printf(Build.ALLTRAY_COPYRIGHT_YEARS); 19 | this.comments = _("Dock applications in the system tray."); 20 | this.license = Build.ALLTRAY_LICENSE; 21 | this.response.connect(() => { this.destroy(); }); 22 | this.show_all(); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/AttachHelper.vala: -------------------------------------------------------------------------------- 1 | /* -*- mode: vala; c-basic-offset: 2; tab-width: 8; -*- 2 | * AttachHelper.vala - Helper class to attach to a running process 3 | * Copyright (c) 2009 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | using GLib; 7 | using Gtk; 8 | 9 | namespace AllTray { 10 | public class AttachHelper : GLib.Object { 11 | private static AttachHelper _sInstance; 12 | 13 | private static unowned Wnck.Window _chosen_window; 14 | public static int target_process; 15 | public static bool success; 16 | 17 | public static bool get_target_window() { 18 | _sInstance = new AttachHelper(); 19 | _chosen_window = null; 20 | target_process = 0; 21 | success = false; 22 | 23 | _sInstance.run(); 24 | return(false); 25 | } 26 | 27 | public AttachHelper() { 28 | // 29 | } 30 | 31 | // Based on get_target() in wnckprop, part of libwnck 32 | // Original language: C, original license: LGPLv2 33 | public void run() { 34 | Gdk.GrabStatus status; 35 | Gdk.Cursor curCross; 36 | Gdk.Window rootWindow; 37 | 38 | rootWindow = Gdk.get_default_root_window(); 39 | rootWindow.add_filter(target_filter); 40 | curCross = new Gdk.Cursor(Gdk.CursorType.CROSS); 41 | 42 | status = Gdk.pointer_grab(rootWindow, false, 43 | Gdk.EventMask.BUTTON_PRESS_MASK, null, 44 | curCross, Gdk.CURRENT_TIME); 45 | 46 | if(status != Gdk.GrabStatus.SUCCESS) { 47 | GLib.warning(_("Pointer grab failed")); 48 | clean_up(); 49 | return; 50 | } 51 | 52 | status = Gdk.keyboard_grab(rootWindow, false, Gdk.CURRENT_TIME); 53 | if(status != Gdk.GrabStatus.SUCCESS) { 54 | GLib.warning(_("Pointer grab failed")); 55 | clean_up(); 56 | return; 57 | } 58 | 59 | Gdk.flush(); 60 | } 61 | 62 | private Gdk.FilterReturn target_filter(Gdk.XEvent xev, 63 | Gdk.Event ev) { 64 | // Thanks to Jürg Billeter for helping to get this right. 65 | unowned X.Event* real_xev = (X.Event*)(&xev); 66 | 67 | switch(real_xev->type) { 68 | case X.EventType.ButtonPress: 69 | handle_button_press_event(ref real_xev->xkey); 70 | clean_up(); 71 | return(Gdk.FilterReturn.REMOVE); 72 | case X.EventType.KeyPress: 73 | // all are abort keys currently. 74 | clean_up(); 75 | return(Gdk.FilterReturn.REMOVE); 76 | default: 77 | break; 78 | } 79 | 80 | return(Gdk.FilterReturn.CONTINUE); 81 | } 82 | 83 | private void handle_button_press_event(ref X.KeyEvent ev) { 84 | // 0 == None 85 | if(ev.subwindow == 0) return; 86 | 87 | ulong xwin = ev.subwindow; 88 | success = true; 89 | Program.WnckScreen.force_update(); 90 | _chosen_window = get_managed(xwin); 91 | 92 | StringBuilder sb = new StringBuilder(); 93 | sb.append_printf(_("Got window 0x%08lx"), xwin); 94 | debug("%s", sb.str); 95 | 96 | target_process = _chosen_window.get_pid(); 97 | sb.truncate(0); 98 | sb.append_printf(_("Window 0x%08lx pid = %d"), xwin, target_process); 99 | debug("%s", sb.str); 100 | 101 | Gtk.main_quit(); 102 | } 103 | 104 | private unowned Wnck.Window? get_managed(ulong xwin) { 105 | return(c_find_managed_window(xwin, Gdk.Display.get_default())); 106 | } 107 | 108 | private void clean_up() { 109 | Gdk.pointer_ungrab(Gdk.CURRENT_TIME); 110 | Gdk.keyboard_ungrab(Gdk.CURRENT_TIME); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/Ctt.vala: -------------------------------------------------------------------------------- 1 | /* -*- mode: vala; c-basic-offset: 2; tab-width: 8; -*- 2 | * AllTrayCtt.vala - CTT support for AllTray 3 | * Copyright (c) 2009 Michael B. Trausch 4 | */ 5 | using GLib; 6 | 7 | namespace AllTray { 8 | public errordomain AllTrayCttError { 9 | SPAWN_HELPER_FAILED, 10 | CTT_ATTACH_FAILED, 11 | CTT_DETACH_FAILED, 12 | STATUS_FAILED, 13 | FAILED 14 | } 15 | 16 | public class Ctt { 17 | private Pid _child_pid; 18 | private int _child_stdin_fd; 19 | private int _child_stdout_fd; 20 | private FileStream _child_stdin; 21 | private IOChannel _child_stdout_channel; 22 | 23 | internal signal void activate(ulong XID); 24 | 25 | public Ctt() { 26 | debug("in Ctt() constructor"); 27 | SpawnFlags child_flags = (SpawnFlags.SEARCH_PATH | 28 | SpawnFlags.DO_NOT_REAP_CHILD); 29 | 30 | try { 31 | debug("spawning alltray-ctt-helper (using $PATH)"); 32 | GLib.Process.spawn_async_with_pipes(null, 33 | { "alltray-ctt-helper" }, 34 | null, 35 | child_flags, 36 | null, 37 | out this._child_pid, 38 | out this._child_stdin_fd, 39 | out this._child_stdout_fd, 40 | null); 41 | } catch (SpawnError se) { 42 | try { 43 | debug("spawning alltray-ctt-helper (not using $PATH)"); 44 | child_flags = (SpawnFlags.DO_NOT_REAP_CHILD); 45 | GLib.Process.spawn_async_with_pipes(null, 46 | { "alltray-ctt-helper" }, 47 | null, 48 | child_flags, 49 | null, 50 | out this._child_pid, 51 | out this._child_stdin_fd, 52 | out this._child_stdout_fd, 53 | null); 54 | } catch(SpawnError se) { 55 | debug(_("Failed to spawn CTT helper process, CTT disabled")); 56 | stderr.printf(_("CTT unavailable: failed to spawn helper process\n")); 57 | Program._ctt_enabled = false; 58 | } 59 | } 60 | 61 | debug(_("CTT subprocess pid = %d"), _child_pid); 62 | debug(_("opening input IOChannel from CTT helper")); 63 | 64 | this._child_stdout_channel = 65 | new IOChannel.unix_new(this._child_stdout_fd); 66 | this._child_stdout_channel.add_watch(IOCondition.IN | IOCondition.HUP, 67 | this._read_from_helper); 68 | 69 | debug(_("opening write pipe to CTT helper")); 70 | this._child_stdin = FileStream.fdopen(this._child_stdin_fd, "w"); 71 | 72 | ChildWatch.add(this._child_pid, this._helper_died); 73 | } 74 | 75 | private bool _read_from_helper(IOChannel ch, IOCondition cond) { 76 | // A reply, or a CTT message. For now, throw away non-CTT messages. 77 | string line; 78 | size_t line_len; 79 | size_t terminator_pos; 80 | IOStatus status; 81 | 82 | if(cond == IOCondition.HUP) { 83 | debug(_("helper pipe has been hung up on")); 84 | return(false); 85 | } 86 | 87 | debug(_("reading from CTT")); 88 | 89 | try { 90 | status = ch.read_line(out line, out line_len, out terminator_pos); 91 | } catch(ConvertError e) { 92 | debug(_("read from helper failed: convert error")); 93 | return(false); 94 | } catch(IOChannelError e) { 95 | debug(_("read from helper failed: I/O error")); 96 | return(false); 97 | } 98 | if(status != IOStatus.NORMAL) { 99 | debug(_("read from CTT not NORMAL IOStatus, removing")); 100 | return(false); 101 | } 102 | 103 | debug(_("read ``%s'' from CTT"), line.chomp()); 104 | 105 | string[] parts = line.chomp().split(" ", 2); 106 | debug(_("Parts: [%s] [%s]"), parts[0], parts[1]); 107 | 108 | if(parts[0] == "CTT") { 109 | ulong XID = (ulong)uint64.parse(parts[1]); 110 | activate(XID); 111 | } 112 | return(true); 113 | } 114 | 115 | public void attach(ulong window_id) { 116 | debug(_("attach called for XID 0x%lx"), window_id); 117 | this._child_stdin.printf("ATTACH %lu\n", window_id); 118 | this._child_stdin.flush(); 119 | } 120 | 121 | public void detach(ulong window_id) { 122 | debug(_("detach called for XID 0x%lx"), window_id); 123 | this._child_stdin.printf("DETACH %lu\n", window_id); 124 | this._child_stdin.flush(); 125 | } 126 | 127 | private void _helper_died(Pid p, int return_status) { 128 | debug(_("helper process %d died, status = %d"), p, return_status); 129 | stderr.printf("Helper child %d died with status %d\n", p, return_status); 130 | } 131 | } 132 | } -------------------------------------------------------------------------------- /src/GtkStatusIcon.vala: -------------------------------------------------------------------------------- 1 | /* -*- mode: vala; c-basic-offset: 2; tab-width: 8; -*- 2 | * GtkStatusIcon.vala - GTK+ status icon widget and menu 3 | * Copyright (c) 2011 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | using GLib; 7 | using Gtk; 8 | 9 | namespace AllTray { 10 | public errordomain GtkStatusIconError { 11 | FAILED 12 | } 13 | 14 | public class GtkStatusIcon : StatusIcon { 15 | public signal void hide_all(); 16 | public signal void show_all(); 17 | public signal void toggle_app_visibility(); 18 | public signal void toggle_window_visibility(Wnck.Window w); 19 | 20 | private AllTray.Application _app; 21 | 22 | public GtkStatusIcon(Application app, Gdk.Pixbuf pixbuf, string tooltip) { 23 | this._app = app; 24 | this.set_from_pixbuf(pixbuf); 25 | this.set_tooltip(tooltip); 26 | 27 | // Connect to signals from AllTray.Application that we need. 28 | this._app.icon_changed.connect(this.set_from_pixbuf); 29 | this.popup_menu.connect(this.on_popup_menu); 30 | this.activate.connect(this.on_activate); 31 | } 32 | 33 | public void set_tooltip(string tooltip) { 34 | base.set_tooltip_markup("AllTray: %s".printf(tooltip)); 35 | } 36 | 37 | private void on_activate() { 38 | if(this.blinking == true) this.blinking = false; 39 | toggle_app_visibility(); 40 | } 41 | 42 | private void on_popup_menu(uint button, uint activate_time) { 43 | Gtk.Menu pm = new Gtk.Menu(); 44 | 45 | Gtk.MenuItem miToggle = new Gtk.MenuItem.with_label(_("Toggle Visibility")); 46 | Gtk.MenuItem miSep0 = new SeparatorMenuItem(); 47 | Gtk.MenuItem miShowAll = new Gtk.MenuItem.with_label(_("Force Show All")); 48 | Gtk.MenuItem miHideAll = new Gtk.MenuItem.with_label(_("Force Hide All")); 49 | Gtk.MenuItem miUndock = new Gtk.MenuItem.with_label(_("Undock")); 50 | Gtk.MenuItem miSep1 = new SeparatorMenuItem(); 51 | Gtk.MenuItem miAbout = new Gtk.MenuItem.with_label(_("About AllTray...")); 52 | 53 | miToggle.set_submenu(create_window_list()); 54 | 55 | pm.append(miToggle); miToggle.show(); 56 | pm.append(miSep0); miSep0.show(); 57 | pm.append(miShowAll); miShowAll.show(); 58 | miShowAll.activate.connect(() => { show_all(); }); 59 | pm.append(miHideAll); miHideAll.show(); 60 | miHideAll.activate.connect(() => { hide_all(); }); 61 | pm.append(miUndock); miUndock.show(); 62 | miUndock.activate.connect(() => { show_all(); Posix.exit(0); }); 63 | pm.append(miSep1); miSep1.show(); 64 | pm.append(miAbout); miAbout.show(); 65 | miAbout.activate.connect(() => { new AllTray.AboutDialog(); }); 66 | 67 | pm.popup(null, null, null, button, activate_time); 68 | } 69 | 70 | private Gtk.Menu create_window_list() { 71 | Gtk.Menu ret = new Gtk.Menu(); 72 | Gtk.MenuItem miAllWindows = new Gtk.MenuItem.with_label(_("All Windows")); 73 | miAllWindows.activate.connect(() => { 74 | toggle_app_visibility(); 75 | }); 76 | Gtk.MenuItem miSep0 = new SeparatorMenuItem(); 77 | 78 | ret.append(miAllWindows); miAllWindows.show(); 79 | ret.append(miSep0); miSep0.show(); 80 | 81 | unowned List ws = this._app.wnck_app.get_windows(); 82 | foreach(Wnck.Window w in ws) { 83 | Gtk.MenuItem miW = new Gtk.MenuItem.with_label(w.get_name()); 84 | miW.set_data("target_window", w); 85 | miW.activate.connect((miW) => { 86 | Wnck.Window mw = 87 | (Wnck.Window)miW.get_data("target_window"); 88 | toggle_window_visibility(mw); 89 | }); 90 | 91 | ret.append(miW); miW.show(); 92 | } 93 | 94 | return(ret); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # Automake file for AllTray 2 | 3 | bin_PROGRAMS = alltray alltray-ctt-helper 4 | 5 | alltray_CFLAGS = @X11_CFLAGS@ @GLIB_CFLAGS@ @GOBJECT_CFLAGS@ @WNCK_CFLAGS@ \ 6 | -DWNCK_I_KNOW_THIS_IS_UNSTABLE \ 7 | -DG_DISABLE_SINGLE_INCLUDES @GTOP_CFLAGS@ @GIO_CFLAGS@ \ 8 | -include ../config.h -DLOCALE_DIR=\"@localedir@\" 9 | 10 | alltray_LDADD = @X11_LIBS@ @GLIB_LIBS@ @GOBJECT_LIBS@ @WNCK_LIBS@ \ 11 | @GTOP_LIBS@ @GIO_LIBS@ 12 | 13 | alltray_SOURCES = About.vala \ 14 | AllTray.vala \ 15 | Application.vala \ 16 | AttachHelper.vala \ 17 | GtkStatusIcon.vala \ 18 | Hotkey.vala \ 19 | Process.vala \ 20 | PromptDialog.vala \ 21 | Ctt.vala \ 22 | x11_glue.c \ 23 | gtop_glue.c 24 | 25 | alltray_ctt_helper_CFLAGS = @X11_CFLAGS@ @XPM_CFLAGS@ @XEXT_CFLAGS@ \ 26 | @XCURSOR_CFLAGS@ 27 | 28 | alltray_ctt_helper_LDADD = @X11_LIBS@ @XPM_LIBS@ @XEXT_LIBS@ \ 29 | @XCURSOR_LIBS@ 30 | 31 | alltray_ctt_helper_SOURCES = alltray-ctt-helper.c \ 32 | alltray-ctt-interpreter.c \ 33 | alltray-ctt-windowlist.c 34 | 35 | MAINTAINERCLEANFILES = $(alltray_VALASOURCES:.vala=.c) \ 36 | $(alltray_ctt_helper_VALASOURCES:.vala=.c) \ 37 | alltray.stamp 38 | 39 | EXTRA_DIST = $(alltray_VALASOURCES) \ 40 | x11_glue.h \ 41 | gtop_glue.h \ 42 | alltray-ctt-interpreter.h \ 43 | alltray-ctt-helper.h \ 44 | alltray-ctt-windowlist.h \ 45 | alltray.stamp 46 | 47 | alltray_VALAFLAGS = --vapidir $(srcdir)/../vapi --pkg alltray --pkg gdk-2.0 \ 48 | --pkg gdk-x11-2.0 --pkg x11 --pkg gtk+-2.0 --pkg libwnck-1.0 \ 49 | --pkg x11_glue --pkg posix --pkg gtop_glue -X "-I header" 50 | 51 | -------------------------------------------------------------------------------- /src/PromptDialog.vala: -------------------------------------------------------------------------------- 1 | /* -*- mode: vala; c-basic-offset: 2; tab-width: 8; -*- 2 | * PromptDialog.vala - Dialog window to prompt the user to select an app 3 | * Copyright (c) 2009 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | using GLib; 7 | using Gtk; 8 | 9 | namespace AllTray { 10 | public class PromptDialog : Gtk.Dialog { 11 | private Label _lblPrompt; 12 | 13 | public PromptDialog() { 14 | this.title = _("Select an Application"); 15 | this.has_separator = false; 16 | this.border_width = 5; 17 | //set_default_size(250, 50); 18 | create_widgets(); 19 | } 20 | 21 | private void create_widgets() { 22 | string labelText 23 | = _("Click on a window of the software you wish to dock.\n\nNote: do not click on the window border itself. Click inside\nthe window; particularly on Compiz, clicking on the title bar\nor the other sides of the window border DOES NOT WORK."); 24 | 25 | _lblPrompt = new Label(labelText); 26 | this.vbox.pack_start(_lblPrompt, false, true, 0); 27 | show_all(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/alltray-ctt-helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * alltray-ctt-helper.h - Helper public interface. 3 | * Copyright © 2011 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation. 5 | */ 6 | #ifndef __ALLTRAY_CTT_HELPER_H_INCLUDED__ 7 | #define __ALLTRAY_CTT_HELPER_H_INCLUDED__ 8 | 9 | #include 10 | 11 | Window ctt_make_window(Display *dpy, Window parent); 12 | void ctt_destroy_window(Display *dpy, Window parent); 13 | 14 | #endif /* __ALLTRAY_CTT_HELPER_H_INCLUDED__ */ 15 | -------------------------------------------------------------------------------- /src/alltray-ctt-interpreter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * alltray-ctt-interpreter.h - Interpreter public interface. 3 | * Copyright © 2011 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation. 5 | */ 6 | #ifndef __ALLTRAY_CTT_INTERPRETER_H_INCLUDED__ 7 | #define __ALLTRAY_CTT_INTERPRETER_H_INCLUDED__ 8 | 9 | #include 10 | #include 11 | 12 | enum ACI_COMMAND { 13 | ACI_INVALID = 0, 14 | ACI_HELLO, 15 | ACI_ATTACH, 16 | ACI_DETACH, 17 | ACI_STATUS, 18 | ACI_EXIT 19 | }; 20 | 21 | typedef struct alltray_ctt_command alltray_ctt_command; 22 | 23 | alltray_ctt_command *aci_parse_command(char *cmdline, int cmdline_len); 24 | bool aci_interpret_command(Display *dpy, alltray_ctt_command *cmd); 25 | 26 | #endif /* __ALLTRAY_CTT_INTERPRETER_H_INCLUDED__ */ 27 | -------------------------------------------------------------------------------- /src/alltray-ctt-windowlist.c: -------------------------------------------------------------------------------- 1 | /* 2 | * alltray-ctt-windowlist.c - Window list 3 | * Copyright © 2011 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | struct alltray_ctt_windowlist_node { 13 | Display *dpy; 14 | Window ctt; 15 | Window parent; 16 | 17 | struct alltray_ctt_windowlist_node *next; 18 | struct alltray_ctt_windowlist_node *prev; 19 | }; 20 | 21 | static struct alltray_ctt_windowlist_node *first; 22 | 23 | #define WL_NODE_SIZE ((sizeof(struct alltray_ctt_windowlist_node))) 24 | 25 | /** 26 | * Creates a new windowlist node. 27 | */ 28 | static struct alltray_ctt_windowlist_node * 29 | windowlist_node_new(Display *dpy, Window ctt, Window parent) { 30 | struct alltray_ctt_windowlist_node *retval = calloc(1, WL_NODE_SIZE); 31 | if(retval == NULL) abort(); 32 | 33 | retval->dpy = dpy; 34 | retval->ctt = ctt; 35 | retval->parent = parent; 36 | 37 | return(retval); 38 | } 39 | 40 | /** 41 | * Frees a node's allocated storage. 42 | */ 43 | static bool 44 | windowlist_node_free(struct alltray_ctt_windowlist_node *node) { 45 | free(node); 46 | return(true); 47 | } 48 | 49 | /** 50 | * Finds a node in the list by parent window ID number. 51 | * 52 | * Returns NULL if no node with the specified parent ID number exists. 53 | */ 54 | static struct alltray_ctt_windowlist_node * 55 | windowlist_find_by_parent_window(Window parent) { 56 | struct alltray_ctt_windowlist_node *retval = NULL; 57 | struct alltray_ctt_windowlist_node *cur = first; 58 | 59 | while(cur != NULL) { 60 | if(cur->parent == parent) break; 61 | cur = cur->next; 62 | } 63 | 64 | return(cur); 65 | } 66 | 67 | /** 68 | * Finds a node in the list by CTT window ID number. 69 | * 70 | * Returns NULL if no node with the specified CTT ID number exists. 71 | */ 72 | static struct alltray_ctt_windowlist_node * 73 | windowlist_find_by_ctt_window(Window ctt) { 74 | struct alltray_ctt_windowlist_node *retval = NULL; 75 | struct alltray_ctt_windowlist_node *cur = first; 76 | 77 | while(cur != NULL) { 78 | if(cur->ctt == ctt) break; 79 | cur = cur->next; 80 | } 81 | 82 | return(cur); 83 | } 84 | 85 | /** 86 | * Appends a new node to the windowlist. 87 | */ 88 | static bool 89 | windowlist_append(struct alltray_ctt_windowlist_node *node) { 90 | if(first == NULL) { 91 | first = node; 92 | first->prev = NULL; 93 | first->next = NULL; 94 | } else { 95 | struct alltray_ctt_windowlist_node *cur = first; 96 | while(cur->next != NULL) cur = cur->next; 97 | cur->next = node; 98 | node->prev = cur; 99 | node->next = NULL; 100 | } 101 | 102 | return(true); 103 | } 104 | 105 | /** 106 | * Removes a node from the windowlist. 107 | */ 108 | static bool 109 | windowlist_remove(struct alltray_ctt_windowlist_node *node) { 110 | struct alltray_ctt_windowlist_node *cur = first; 111 | 112 | while((cur != node) && (cur != NULL)) cur = cur->next; 113 | if(cur == NULL) return(true); 114 | 115 | struct alltray_ctt_windowlist_node *previous, *next; 116 | previous = cur->prev; 117 | next = cur->next; 118 | 119 | if(previous != NULL) previous->next = cur->next; 120 | if(next != NULL) next->prev = cur->prev; 121 | 122 | if((previous == NULL) && (next == NULL)) { 123 | first = NULL; 124 | return(true); 125 | } 126 | 127 | if(next == NULL) previous->next = NULL; 128 | if(previous == NULL) { 129 | next->prev = NULL; 130 | first = next; 131 | } 132 | 133 | return(true); 134 | } 135 | 136 | int 137 | alltray_ctt_windowlist_len() { 138 | int len = 0; 139 | if(first != NULL) { 140 | struct alltray_ctt_windowlist_node *cur = first; 141 | while(cur != NULL) { 142 | len++; 143 | cur = cur->next; 144 | } 145 | } 146 | 147 | return(len); 148 | } 149 | 150 | bool 151 | alltray_ctt_windowlist_add(Display *dpy, Window ctt, Window parent) { 152 | struct alltray_ctt_windowlist_node *new_node = windowlist_node_new(dpy, ctt, 153 | parent); 154 | return(windowlist_append(new_node)); 155 | } 156 | 157 | bool 158 | alltray_ctt_windowlist_del(Window parent) { 159 | struct alltray_ctt_windowlist_node *node = 160 | windowlist_find_by_parent_window(parent); 161 | 162 | if(node != NULL) { 163 | windowlist_remove(node); 164 | windowlist_node_free(node); 165 | } 166 | 167 | return(true); 168 | } 169 | 170 | Window 171 | alltray_ctt_windowlist_get_ctt_for_parent(Window parent) { 172 | Window retval = 0; 173 | 174 | struct alltray_ctt_windowlist_node *node = 175 | windowlist_find_by_parent_window(parent); 176 | 177 | if(node != NULL) retval = node->ctt; 178 | 179 | return(retval); 180 | } 181 | 182 | Window 183 | alltray_ctt_windowlist_get_parent_for_ctt(Window ctt) { 184 | Window retval = 0; 185 | 186 | struct alltray_ctt_windowlist_node *node = 187 | windowlist_find_by_ctt_window(ctt); 188 | 189 | if(node != NULL) retval = node->parent; 190 | 191 | return(retval); 192 | } 193 | 194 | bool 195 | alltray_ctt_windowlist_get_all_parents(int *count, Window **list) { 196 | if(*list != NULL) return(false); 197 | int i = 0; 198 | 199 | *count = alltray_ctt_windowlist_len(); 200 | *list = calloc(*count, sizeof(Window)); 201 | if(*list == NULL) abort(); 202 | 203 | struct alltray_ctt_windowlist_node *cur = first; 204 | while(cur != NULL) { 205 | (*list)[i] = cur->parent; 206 | i++; 207 | cur = cur->next; 208 | } 209 | 210 | return(true); 211 | } 212 | -------------------------------------------------------------------------------- /src/alltray-ctt-windowlist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * alltray-ctt-windowlist.h - Window list header 3 | * Copyright © 2011 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | #ifndef __ALLTRAY_CTT_WINDOWLIST_H_INCLUDED__ 7 | #define __ALLTRAY_CTT_WINDOWLIST_H_INCLUDED__ 8 | 9 | bool alltray_ctt_windowlist_add(Display *dpy, Window ctt, Window parent); 10 | bool alltray_ctt_windowlist_del(Window parent); 11 | int alltray_ctt_windowlist_len(); 12 | 13 | Window alltray_ctt_windowlist_get_ctt_for_parent(Window parent); 14 | Window alltray_ctt_windowlist_get_parent_for_ctt(Window ctt); 15 | bool alltray_ctt_windowlist_get_all_parents(int *len, Window **parents); 16 | 17 | #endif /* __ALLTRAY_CTT_WINDOWLIST_H_INCLUDED__ */ 18 | -------------------------------------------------------------------------------- /src/gtop_glue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * gtop_glue.c - Use the libgtop library, but I am too lazy/annoyed to try 3 | * to figure out how the ^#!! I'm supposed to bind it to Vala. 4 | * Copyright (C) 2009 Michael B. Trausch 5 | * License: GNU LGPL 3.0 as published by the Free Software Foundation. 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | int 16 | alltray_get_ppid_for(int pid) { 17 | glibtop_proc_uid *buffer = 18 | (glibtop_proc_uid*)g_malloc0(sizeof(glibtop_proc_uid)); 19 | 20 | glibtop_get_proc_uid(buffer, (pid_t)pid); 21 | int retval = buffer->ppid; 22 | free(buffer); 23 | 24 | return(retval); 25 | } 26 | 27 | void 28 | alltray_get_processes_in_pgrp(int pgrp, int **procs, int *procs_len) { 29 | pid_t *retval = NULL; 30 | gint64 wanted_pgid = (gint64)pgrp; 31 | 32 | glibtop_proclist *proclist_info = 33 | (glibtop_proclist *)g_malloc0(sizeof(glibtop_proclist)); 34 | 35 | retval = glibtop_get_proclist(proclist_info, GLIBTOP_KERN_PROC_PGRP, 36 | wanted_pgid); 37 | *procs_len = proclist_info->number; 38 | free(proclist_info); 39 | 40 | *procs = retval; 41 | } 42 | 43 | /* 44 | * Return a newly-allocated string that contains the name of the 45 | * process for the given PID. This means that the caller owns the 46 | * variable. 47 | */ 48 | char * 49 | alltray_get_process_name(int pid) { 50 | char *retval = NULL; 51 | glibtop_proc_state *glbuf = NULL; 52 | 53 | glbuf = (glibtop_proc_state *)g_malloc0(sizeof(glibtop_proc_state)); 54 | glibtop_get_proc_state(glbuf, pid); 55 | 56 | retval = g_strndup(glbuf->cmd, 40); 57 | free(glbuf); 58 | 59 | return(retval); 60 | } 61 | -------------------------------------------------------------------------------- /src/gtop_glue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gtop_glue.h - Use the libgtop library, but I am too lazy/annoyed to try 3 | * to figure out how the ^#!! I'm supposed to bind it to Vala. 4 | * Copyright (C) 2009 Michael B. Trausch 5 | * License: GNU LGPL 3.0 as published by the Free Software Foundation. 6 | */ 7 | #ifndef __gtop_glue_h_included__ 8 | #define __gtop_glue_h_included__ 9 | 10 | int alltray_get_ppid_for(int pid); 11 | void alltray_get_processes_in_pgrp(int pgrp, int **procs, int *procs_len); 12 | char *alltray_get_process_name(int pid); 13 | 14 | #endif /* __gtop_glue_h_included__ */ 15 | -------------------------------------------------------------------------------- /src/x11_glue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * x11_glue.c - X11 "glue" code for AllTray 3 | * Copyright (c) 2009 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Fondation 5 | */ 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "x11_glue.h" 13 | 14 | static gboolean wm_state_set (Window window); 15 | 16 | // Nearly directly from wnckprop.c in libwnck. 17 | WnckWindow * 18 | alltray_find_managed_window(Window window, GdkDisplay *gdk_display) { 19 | Window root; 20 | Window parent; 21 | Window *kids = NULL; 22 | WnckWindow *retval; 23 | guint nkids; 24 | int result; 25 | Display *x11_display = NULL; 26 | 27 | if(wm_state_set(window)) { 28 | return(wnck_window_get(window)); 29 | } 30 | 31 | gdk_error_trap_push(); 32 | x11_display = gdk_x11_display_get_xdisplay(gdk_display); 33 | result = XQueryTree(x11_display, window, &root, &parent, &kids, &nkids); 34 | if(gdk_error_trap_pop() || !result) { 35 | return NULL; 36 | } 37 | 38 | retval = NULL; 39 | int i; 40 | for(i = 0; i < nkids; i++) { 41 | if(wm_state_set(kids[i])) { 42 | retval = wnck_window_get(kids[i]); 43 | break; 44 | } 45 | 46 | retval = alltray_find_managed_window(kids[i], gdk_display); 47 | if(retval != NULL) break; 48 | } 49 | 50 | if(kids) XFree(kids); 51 | return(retval); 52 | } 53 | 54 | static gboolean 55 | wm_state_set (Window window) 56 | { 57 | Atom wm_state; 58 | gulong nitems; 59 | gulong bytes_after; 60 | gulong *prop; 61 | Atom ret_type = None; 62 | int ret_format; 63 | int err, result; 64 | 65 | wm_state = gdk_x11_get_xatom_by_name ("WM_STATE"); 66 | 67 | gdk_error_trap_push (); 68 | result = XGetWindowProperty (gdk_display, 69 | window, 70 | wm_state, 71 | 0, G_MAXLONG, 72 | False, wm_state, &ret_type, &ret_format, &nitems, 73 | &bytes_after, (gpointer) &prop); 74 | err = gdk_error_trap_pop (); 75 | if (err != Success || 76 | result != Success) 77 | return FALSE; 78 | 79 | XFree (prop); 80 | 81 | if (ret_type != wm_state) 82 | return FALSE; 83 | 84 | return TRUE; 85 | } 86 | 87 | /// UNUSED? 88 | static Atom _net_wm_pid; 89 | static gulong find_window(GPid pid, Display *d, Window w); 90 | 91 | gulong 92 | alltray_get_x11_window_from_pid(GPid pid, Display *d) { 93 | Window root_win = XDefaultRootWindow(d); 94 | _net_wm_pid = XInternAtom(d, "_NET_WM_PID", True); 95 | 96 | if(_net_wm_pid == None) { 97 | // Error: this atom isn't defined?! What are they _doing_? 98 | g_critical("AllTray can't find _NET_WM_PID!"); 99 | return(0); 100 | } 101 | 102 | return(find_window(pid, d, root_win)); 103 | } 104 | 105 | static gulong 106 | get_window_leader(Display *d, Window w) { 107 | Atom type; 108 | int format; 109 | int status; 110 | gulong nItems; 111 | gulong bytesAfter; 112 | guchar *prop_ret = NULL; 113 | Atom wm_client_leader = XInternAtom(d, "WM_CLIENT_LEADER", True); 114 | gulong retval = 0; 115 | 116 | status = 117 | XGetWindowProperty(d, w, wm_client_leader, 0, 1, False, XA_WINDOW, 118 | &type, &format, &nItems, &bytesAfter, &prop_ret); 119 | 120 | if(status == Success) { 121 | if(prop_ret != 0) { 122 | retval = *((unsigned long *)prop_ret); 123 | return(retval); 124 | } 125 | } 126 | 127 | return(0); 128 | } 129 | 130 | static gulong 131 | find_window(GPid pid, Display *d, Window w) { 132 | Atom type; 133 | int format; 134 | int status; 135 | gulong nItems; 136 | gulong bytesAfter; 137 | guchar *prop_ret = NULL; 138 | Atom _net_wm_pid = XInternAtom(d, "_NET_WM_PID", True); 139 | 140 | status = 141 | XGetWindowProperty(d, w, _net_wm_pid, 0, 1, False, XA_CARDINAL, 142 | &type, &format, &nItems, &bytesAfter, &prop_ret); 143 | 144 | if(status == Success) { 145 | if(prop_ret != 0) { 146 | GPid returned_pid = *((unsigned long *)prop_ret); 147 | if(returned_pid == pid) return(w); 148 | } 149 | } else { 150 | return(0); 151 | } 152 | 153 | /* 154 | * If we are still here, we need to continue searching... 155 | */ 156 | Window root, parent; 157 | Window *child; 158 | guint child_count; 159 | 160 | if(XQueryTree(d, w, &root, &parent, &child, &child_count) != 0) { 161 | guint i; 162 | for(i = 0; i < child_count; i++) { 163 | guint retval = find_window(pid, d, child[i]); 164 | if(retval != 0) { 165 | retval = get_window_leader(d, retval); 166 | return(get_window_leader(d, retval)); 167 | } 168 | } 169 | } 170 | 171 | return(0); 172 | } 173 | -------------------------------------------------------------------------------- /src/x11_glue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * x11_glue.h 3 | */ 4 | #ifndef __x11_glue_included__ 5 | #define __x11_glue_included__ 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | gulong alltray_get_x11_window_from_pid(GPid pid, Display *d); 14 | WnckWindow *alltray_find_managed_window(Window window, GdkDisplay *gdk_display); 15 | 16 | #endif /* __x11_glue_included__ */ 17 | -------------------------------------------------------------------------------- /tests/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/tests/1.png -------------------------------------------------------------------------------- /tests/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbt/alltray/396b9be1aa088a32631ab5767ecd9fced2f3ecb7/tests/2.png -------------------------------------------------------------------------------- /tests/GtkDemandsAttention.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * GtkDemandsAttention.vala - provide a window that always demands attention. 3 | * Copyright (C) 2009 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | using GLib; 7 | using Posix; 8 | 9 | namespace AllTray.Test { 10 | public class Test : Object { 11 | Gtk.Window w; 12 | Gtk.Button b; 13 | 14 | public static int main(string[] args) { 15 | bool status = Gtk.init_check(ref args); 16 | if(!status) { 17 | stderr.printf("Oops, cannot run.\n"); 18 | exit(1); 19 | } 20 | 21 | Test obj = new Test(); 22 | return(0); 23 | } 24 | 25 | public Test() { 26 | w = new Gtk.Window(Gtk.WindowType.TOPLEVEL); 27 | w.set_default_size(300, 50); 28 | w.title = "Urgency Test"; 29 | b = new Gtk.Button.with_label("Click"); 30 | 31 | b.clicked += (source) => { 32 | w.set_urgency_hint(!w.get_urgency_hint()); 33 | }; 34 | 35 | b.destroy += Gtk.main_quit; 36 | 37 | w.add(b); 38 | w.show_all(); 39 | Gtk.main(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/GtkIconChange.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * GtkIconChange.vala - provide a window that changes window icons. 3 | * Copyright (C) 2009 Michael B. Trausch 4 | * License: GNU GPL v3.0 as published by the Free Software Foundation 5 | */ 6 | using GLib; 7 | using Posix; 8 | 9 | namespace AllTray.Test { 10 | public class Test : Object { 11 | Gtk.Window w; 12 | Gtk.Button b; 13 | 14 | public static int main(string[] args) { 15 | bool status = Gtk.init_check(ref args); 16 | if(!status) { 17 | stderr.printf("Oops, cannot run.\n"); 18 | exit(1); 19 | } 20 | 21 | Test obj = new Test(); 22 | return(0); 23 | } 24 | 25 | public Test() { 26 | w = new Gtk.Window(Gtk.WindowType.TOPLEVEL); 27 | w.set_default_size(300, 50); 28 | w.title = "Window Icon Test"; 29 | b = new Gtk.Button.with_label("Click to change window icon"); 30 | 31 | b.clicked += (source) => { 32 | string[] iconNames = { 33 | "1.png", 34 | "2.png" 35 | }; 36 | 37 | w.set_urgency_hint(!w.get_urgency_hint()); 38 | int which = (w.get_urgency_hint() ? 0 : 1); 39 | w.set_icon_from_file(iconNames[which]); 40 | }; 41 | 42 | b.destroy += Gtk.main_quit; 43 | 44 | w.add(b); 45 | w.show_all(); 46 | Gtk.main(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | # Automake file for AllTray 2 | 3 | bin_PROGRAMS = GtkDemandsAttention GtkIconChange 4 | AM_CFLAGS = @GTK_CFLAGS@ @GOBJECT_CFLAGS@ -DG_DISABLE_DEPRECATED \ 5 | -DG_DISABLE_SINGLE_INCLUDES 6 | GtkDemandsAttention_LDADD = @GTK_LIBS@ @GOBJECT_LIBS@ 7 | GtkIconChange_LDADD = @GTK_LIBS@ @GOBJECT_LIBS@ 8 | 9 | GtkDemandsAttention_VALASOURCES = GtkDemandsAttention.vala 10 | GtkIconChange_VALASOURCES = GtkIconChange.vala 11 | 12 | MAINTAINERCLEANFILES = $(GtkDemandsAttention_VALASOURCES:.vala=.c) \ 13 | $(GtkIconChange_VALASOURCES:.vala=.c) \ 14 | .GtkDemandsAttention.stamp \ 15 | .GtkIconChange.stamp 16 | 17 | BUILT_SOURCES = .GtkDemandsAttention.stamp \ 18 | .GtkIconChange.stamp 19 | 20 | GtkDemandsAttention_SOURCES = $(GtkDemandsAttention_VALASOURCES:.vala=.c) 21 | GtkIconChange_SOURCES = $(GtkIconChange_VALASOURCES:.vala=.c) 22 | 23 | EXTRA_DIST = $(GtkDemandsAttention_VALASOURCES) \ 24 | $(GtkIconChange_VALASOURCES) \ 25 | $(BUILT_SOURCES) \ 26 | 1.png 2.png 27 | 28 | VALA_FLAGS = --pkg gtk+-2.0 --pkg posix 29 | 30 | .GtkDemandsAttention.stamp: $(GtkDemandsAttention_VALASOURCES) 31 | $(VALAC) -C $(VALA_FLAGS) $(GtkDemandsAttention_VALASOURCES) 32 | touch $@ 33 | 34 | .GtkIconChange.stamp: $(GtkIconChange_VALASOURCES) 35 | $(VALAC) -C $(VALA_FLAGS) $(GtkIconChange_VALASOURCES) 36 | touch $@ 37 | -------------------------------------------------------------------------------- /utils/build-full-debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x ./autogen.sh ]; then 4 | ./autogen.sh CFLAGS="-Wall -Wextra -ggdb -O0" 5 | make 6 | else 7 | printf "Execute this script as 'utils/build-full-debug.sh' from the main directory.\n" 8 | exit 1 9 | fi 10 | -------------------------------------------------------------------------------- /utils/build-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x ./autogen.sh ]; then 4 | utils/clean-tree.sh 5 | ./autogen.sh CFLAGS="-Wall -ggdb -Os" 6 | 7 | make all 8 | 9 | objcopy --only-keep-debug src/alltray src/alltray.dbg 10 | objcopy --strip-debug src/alltray 11 | objcopy --add-gnu-debuglink=src/alltray.dbg src/alltray 12 | 13 | make dist 14 | mv alltray-*.tar.gz .. 15 | else 16 | printf "Execute this script as 'utils/build-release.sh' from the main directory.\n" 17 | exit 1 18 | fi 19 | -------------------------------------------------------------------------------- /utils/clean-tree.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$1" = "-y" ]; then 4 | force=--force 5 | else 6 | force="" 7 | fi 8 | 9 | bzr clean-tree --ignored --unknown $force 10 | 11 | -------------------------------------------------------------------------------- /utils/latest-rev.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from bzrlib import branch 4 | import os 5 | 6 | curpath = os.getcwd() 7 | 8 | b = branch.Branch.open('file://%s' % curpath) 9 | revision_number, revision_id = b.last_revision_info() 10 | 11 | print "Revision:\t%d" % revision_number 12 | print "ID:\t\t%s" % revision_id 13 | -------------------------------------------------------------------------------- /utils/release-changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # release-changelog.sh 4 | # 5 | # Update the ChangeLog file in the root of the repository to include new 6 | # changes, generated from bzr. 7 | # 8 | 9 | TMPFILE=/tmp/alltray-changes.$$ 10 | STARTREV="$1" 11 | 12 | if [ ! -w ChangeLog ]; then 13 | printf "ChangeLog does not exist or exists but is not writeable.\n" 14 | printf "This script must be run from the root directory of the AllTray checkout.\n" 15 | exit 1 16 | fi 17 | 18 | bzr log --gnu -v -r${STARTREV}..-1 > ${TMPFILE} 19 | cat ChangeLog >> ${TMPFILE} 20 | mv ${TMPFILE} ChangeLog 21 | 22 | printf "ChangeLog updated.\n" 23 | -------------------------------------------------------------------------------- /vapi/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST=alltray.vapi \ 2 | gtop_glue.vapi \ 3 | x11_glue.vapi 4 | -------------------------------------------------------------------------------- /vapi/alltray.vapi: -------------------------------------------------------------------------------- 1 | /* -*- mode: vala; c-basic-offset: 2; tab-width: 8; -*- 2 | * alltray.vapi - Imports information into Vala from the build system. 3 | */ 4 | [CCode(cheader_filename = "config.h", 5 | cprefix="", lower_case_cprefix = "")] 6 | namespace AllTray.Build { 7 | public const string PACKAGE; 8 | public const string PACKAGE_VERSION; 9 | 10 | public const string GETTEXT_PACKAGE; 11 | public const string LOCALE_DIR; 12 | 13 | public const string ALLTRAY_COPYRIGHT_YEARS; 14 | public const string ALLTRAY_LICENSE; 15 | 16 | public const string ALLTRAY_C_COMPILER; 17 | public const string ALLTRAY_COMPILE_FLAGS; 18 | public const string ALLTRAY_COMPILE_OS; 19 | public const string ALLTRAY_COMPILE_OS_REL; 20 | public const string ALLTRAY_COMPILE_OS_VER; 21 | public const string ALLTRAY_COMPILE_OS_HOST; 22 | public const string ALLTRAY_COMPILE_BUILD_DATE; 23 | public const string ALLTRAY_COMPILE_BUILD_DATE_EUS; 24 | 25 | public const string ALLTRAY_VALA_COMPILER; 26 | 27 | public const string ALLTRAY_CONFIGURE_FLAGS; 28 | } 29 | 30 | [CCode(cprefix="Gtk", lower_case_cprefix="gtk_")] 31 | namespace AllTray.LocalGtk { 32 | [CCode (cheader_filename = "gtk/gtk.h")] 33 | public class StatusIcon : GLib.Object { 34 | [CCode (has_construct_function = false)] 35 | public StatusIcon.from_file (string filename); 36 | [CCode (has_construct_function = false)] 37 | public StatusIcon.from_gicon (GLib.Icon icon); 38 | [CCode (has_construct_function = false)] 39 | public StatusIcon.from_icon_name (string icon_name); 40 | [CCode (has_construct_function = false)] 41 | public StatusIcon.from_pixbuf (Gdk.Pixbuf pixbuf); 42 | [CCode (has_construct_function = false)] 43 | public StatusIcon.from_stock (string stock_id); 44 | public bool get_blinking (); 45 | public bool get_geometry (out unowned Gdk.Screen screen, out Gdk.Rectangle area, out Gtk.Orientation orientation); 46 | public unowned GLib.Icon get_gicon (); 47 | public bool get_has_tooltip (); 48 | public unowned string get_icon_name (); 49 | public unowned Gdk.Pixbuf get_pixbuf (); 50 | public unowned Gdk.Screen get_screen (); 51 | public int get_size (); 52 | public unowned string get_stock (); 53 | public Gtk.ImageType get_storage_type (); 54 | public unowned string get_tooltip_markup (); 55 | public unowned string get_tooltip_text (); 56 | public bool get_visible (); 57 | public uint32 get_x11_window_id (); 58 | public bool is_embedded (); 59 | [CCode (has_construct_function = false)] 60 | public StatusIcon (); 61 | [CCode (instance_pos = -1)] 62 | public void position_menu (Gtk.Menu menu, out int x, out int y, out bool push_in); 63 | public void set_blinking (bool blinking); 64 | public void set_from_file (string filename); 65 | public void set_from_gicon (GLib.Icon icon); 66 | public void set_from_icon_name (string icon_name); 67 | public void set_from_pixbuf (Gdk.Pixbuf pixbuf); 68 | public void set_from_stock (string stock_id); 69 | public void set_has_tooltip (bool has_tooltip); 70 | public void set_screen (Gdk.Screen screen); 71 | public void set_tooltip (string tooltip_text); 72 | public void set_tooltip_markup (string markup); 73 | public void set_tooltip_text (string text); 74 | public void set_visible (bool visible); 75 | public bool blinking { get; set; } 76 | [NoAccessorMethod] 77 | public bool embedded { get; } 78 | [NoAccessorMethod] 79 | public string file { set; } 80 | [NoAccessorMethod] 81 | public GLib.Icon gicon { owned get; set; } 82 | public bool has_tooltip { get; set; } 83 | [NoAccessorMethod] 84 | public string icon_name { owned get; set; } 85 | [NoAccessorMethod] 86 | public Gtk.Orientation orientation { get; } 87 | [NoAccessorMethod] 88 | public Gdk.Pixbuf pixbuf { owned get; set; } 89 | public Gdk.Screen screen { get; set; } 90 | public int size { get; } 91 | [NoAccessorMethod] 92 | public string stock { owned get; set; } 93 | public Gtk.ImageType storage_type { get; } 94 | public string tooltip_markup { get; set; } 95 | public string tooltip_text { get; set; } 96 | public bool visible { get; set; } 97 | public virtual signal void activate (); 98 | public virtual signal bool button_press_event (Gdk.Event event); 99 | public virtual signal bool button_release_event (Gdk.Event event); 100 | public virtual signal void popup_menu (uint button, uint activate_time); 101 | public virtual signal bool query_tooltip (int x, int y, bool keyboard_mode, Gtk.Tooltip tooltip); 102 | public virtual signal bool scroll_event (Gdk.Event event); 103 | public virtual signal bool size_changed (int size); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /vapi/gtop_glue.vapi: -------------------------------------------------------------------------------- 1 | namespace AllTray { 2 | [CCode(cname = "alltray_get_ppid_for", 3 | cheader_filename = "gtop_glue.h")] 4 | public int get_ppid_for(int pid); 5 | 6 | [CCode(cname = "alltray_get_processes_in_pgrp", 7 | cheader_filename = "gtop_glue.h")] 8 | public void get_pids_in_pgid(int pgid, out int[] procs); 9 | 10 | [CCode(cname = "alltray_get_process_name", 11 | cheader_filename = "gtop_glue.h")] 12 | public string get_process_name_for(int pid); 13 | } 14 | -------------------------------------------------------------------------------- /vapi/x11_glue.vapi: -------------------------------------------------------------------------------- 1 | namespace AllTray { 2 | [CCode(cname = "alltray_get_x11_window_from_pid", 3 | cheader_filename = "x11_glue.h")] 4 | public ulong c_xwin_from_pid(GLib.Pid pid, void *Display); 5 | 6 | [CCode(cname = "alltray_find_managed_window", 7 | cheader_filename = "x11_glue.h")] 8 | public unowned Wnck.Window c_find_managed_window(ulong xwin, Gdk.Display d); 9 | } 10 | 11 | [CCode (cprefix = "", lower_case_cprefix = "", 12 | cheader_filename = "X11/Xlib.h,X11/Xatom.h,X11/Xutil.h,X11/Xregion.h")] 13 | namespace MX { 14 | [CCode (cname = "XStringToKeysym")] 15 | public uint string_to_keysym(string str); 16 | } --------------------------------------------------------------------------------